From b241a84d884293e1ce49a79c75e362c02c0899f9 Mon Sep 17 00:00:00 2001 From: yami <34216515+kn-yami@users.noreply.github.com> Date: Sun, 16 Dec 2018 16:17:20 +0100 Subject: issue #908 - implement missing parts of CSS mask --- layout/style/nsStyleConsts.h | 47 ++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'layout/style/nsStyleConsts.h') diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index be588113e..6d207aec9 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -134,16 +134,35 @@ enum class StyleClear : uint8_t { Max = 13 // Max = (Both | Line) }; -// clip-path geometry box -enum class StyleClipPathGeometryBox : uint8_t { - NoBox, +// Define geometry box for clip-path's reference-box, background-clip, +// background-origin, mask-clip and mask-origin. +enum class StyleGeometryBox : uint8_t { Content, Padding, Border, - Margin, - Fill, - Stroke, - View, + Margin, // XXX Bug 1260094 comment 9. + // Although margin-box is required by mask-origin and mask-clip, we + // do not implement that due to lack of support in other browsers. + // clip-path reference-box only. + Fill, // mask-clip, mask-origin and clip-path reference-box only. + Stroke, // mask-clip, mask-origin and clip-path reference-box only. + View, // mask-clip, mask-origin and clip-path reference-box only. + NoClip, // mask-clip only. + Text, // background-clip only. + NoBox, // Depending on which kind of element this style value applied on, + // the default value of a reference-box can be different. + // For an HTML element, the default value of reference-box is + // border-box; for an SVG element, the default value is fill-box. + // Since we can not determine the default value at parsing time, + // set it as NoBox so that we make a decision later. + // clip-path reference-box only. + MozAlmostPadding = 127 // A magic value that we use for our "pretend that + // background-clip is 'padding' when we have a solid + // border" optimization. This isn't actually equal + // to StyleGeometryBox::Padding because using that + // causes antialiasing seams between the background + // and border. + // background-clip only. }; // fill-rule @@ -359,14 +378,6 @@ enum class FillMode : uint32_t; #define NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED 1 #define NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL 2 -// See nsStyleImageLayers -// Code depends on these constants having the same values as IMAGELAYER_ORIGIN_* -#define NS_STYLE_IMAGELAYER_CLIP_BORDER 0 -#define NS_STYLE_IMAGELAYER_CLIP_PADDING 1 -#define NS_STYLE_IMAGELAYER_CLIP_CONTENT 2 -// One extra constant which does not exist in IMAGELAYER_ORIGIN_* -#define NS_STYLE_IMAGELAYER_CLIP_TEXT 3 - // A magic value that we use for our "pretend that background-clip is // 'padding' when we have a solid border" optimization. This isn't // actually equal to NS_STYLE_IMAGELAYER_CLIP_PADDING because using that @@ -374,12 +385,6 @@ enum class FillMode : uint32_t; // is a backend-only value. #define NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING 127 -// See nsStyleImageLayers -// Code depends on these constants having the same values as BG_CLIP_* -#define NS_STYLE_IMAGELAYER_ORIGIN_BORDER 0 -#define NS_STYLE_IMAGELAYER_ORIGIN_PADDING 1 -#define NS_STYLE_IMAGELAYER_ORIGIN_CONTENT 2 - // See nsStyleImageLayers // The parser code depends on |ing these values together. #define NS_STYLE_IMAGELAYER_POSITION_CENTER (1<<0) -- cgit v1.2.3