summaryrefslogtreecommitdiffstats
path: root/layout/style/nsCSSProps.cpp
diff options
context:
space:
mode:
authoryami <34216515+kn-yami@users.noreply.github.com>2018-12-16 16:17:20 +0100
committeryami <34216515+kn-yami@users.noreply.github.com>2019-02-02 18:06:10 +0100
commitb241a84d884293e1ce49a79c75e362c02c0899f9 (patch)
tree4d1df04790cc8c785141e8dd8ffea9e6da5a0c02 /layout/style/nsCSSProps.cpp
parentfa311a4cae5ea526e848adc4f49c6aa0b700702c (diff)
downloadUXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.gz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.lz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.tar.xz
UXP-b241a84d884293e1ce49a79c75e362c02c0899f9.zip
issue #908 - implement missing parts of CSS mask
Diffstat (limited to 'layout/style/nsCSSProps.cpp')
-rw-r--r--layout/style/nsCSSProps.cpp62
1 files changed, 35 insertions, 27 deletions
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index 9805eae14..ac2978c27 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -932,33 +932,43 @@ const KTableEntry nsCSSProps::kImageLayerAttachmentKTable[] = {
{ eCSSKeyword_UNKNOWN, -1 }
};
-static_assert(NS_STYLE_IMAGELAYER_CLIP_BORDER == NS_STYLE_IMAGELAYER_ORIGIN_BORDER &&
- NS_STYLE_IMAGELAYER_CLIP_PADDING == NS_STYLE_IMAGELAYER_ORIGIN_PADDING &&
- NS_STYLE_IMAGELAYER_CLIP_CONTENT == NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
- "Except background-clip:text, all {background,mask}-clip and "
- "{background,mask}-origin style constants must agree");
-
-const KTableEntry nsCSSProps::kImageLayerOriginKTable[] = {
- { eCSSKeyword_border_box, NS_STYLE_IMAGELAYER_ORIGIN_BORDER },
- { eCSSKeyword_padding_box, NS_STYLE_IMAGELAYER_ORIGIN_PADDING },
- { eCSSKeyword_content_box, NS_STYLE_IMAGELAYER_ORIGIN_CONTENT },
+const KTableEntry nsCSSProps::kBackgroundOriginKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
{ eCSSKeyword_UNKNOWN, -1 }
};
KTableEntry nsCSSProps::kBackgroundClipKTable[] = {
- { eCSSKeyword_border_box, NS_STYLE_IMAGELAYER_CLIP_BORDER },
- { eCSSKeyword_padding_box, NS_STYLE_IMAGELAYER_CLIP_PADDING },
- { eCSSKeyword_content_box, NS_STYLE_IMAGELAYER_CLIP_CONTENT },
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
// The next entry is controlled by the layout.css.background-clip-text.enabled
// pref.
- { eCSSKeyword_text, NS_STYLE_IMAGELAYER_CLIP_TEXT },
+ { eCSSKeyword_text, StyleGeometryBox::Text },
{ eCSSKeyword_UNKNOWN, -1 }
};
-static_assert(MOZ_ARRAY_LENGTH(nsCSSProps::kImageLayerOriginKTable) ==
- MOZ_ARRAY_LENGTH(nsCSSProps::kBackgroundClipKTable) - 1,
- "background-clip has one extra value, which is text, compared"
- "to {background,mask}-origin");
+const KTableEntry nsCSSProps::kMaskOriginKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
+ { eCSSKeyword_UNKNOWN, -1 }
+};
+
+const KTableEntry nsCSSProps::kMaskClipKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
+ { eCSSKeyword_no_clip, StyleGeometryBox::NoClip },
+ { eCSSKeyword_UNKNOWN, -1 }
+};
// Note: Don't change this table unless you update
// ParseImageLayerPosition!
@@ -2346,13 +2356,13 @@ const KTableEntry nsCSSProps::kFillRuleKTable[] = {
};
const KTableEntry nsCSSProps::kClipPathGeometryBoxKTable[] = {
- { eCSSKeyword_content_box, StyleClipPathGeometryBox::Content },
- { eCSSKeyword_padding_box, StyleClipPathGeometryBox::Padding },
- { eCSSKeyword_border_box, StyleClipPathGeometryBox::Border },
- { eCSSKeyword_margin_box, StyleClipPathGeometryBox::Margin },
- { eCSSKeyword_fill_box, StyleClipPathGeometryBox::Fill },
- { eCSSKeyword_stroke_box, StyleClipPathGeometryBox::Stroke },
- { eCSSKeyword_view_box, StyleClipPathGeometryBox::View },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_margin_box, StyleGeometryBox::Margin },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
{ eCSSKeyword_UNKNOWN, -1 }
};
@@ -3051,7 +3061,6 @@ static const nsCSSPropertyID gScrollSnapTypeSubpropTable[] = {
eCSSProperty_scroll_snap_type_y,
eCSSProperty_UNKNOWN
};
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
static const nsCSSPropertyID gMaskSubpropTable[] = {
eCSSProperty_mask_image,
eCSSProperty_mask_repeat,
@@ -3069,7 +3078,6 @@ static const nsCSSPropertyID gMaskPositionSubpropTable[] = {
eCSSProperty_mask_position_y,
eCSSProperty_UNKNOWN
};
-#endif
// FIXME: mask-border tables should be added when we implement
// mask-border properties.