diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-12 01:25:43 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-02-12 01:25:43 +0100 |
commit | 263d8500ce68b279a2d055c322f0ab3eab634989 (patch) | |
tree | 9f258c3d6186346dc4435427ce6565ec376efd5d /layout/style/nsCSSParser.cpp | |
parent | b06821da15b7ab2573cd18aea8048b94266e3a97 (diff) | |
parent | 8beab28bfff78ccefc8677c5bdddd6f60c544600 (diff) | |
download | uxp-263d8500ce68b279a2d055c322f0ab3eab634989.tar.gz |
Merge branch 'master' into Pale_Moon-release
# Conflicts:
# application/palemoon/components/preferences/advanced.xul
# application/palemoon/config/version.txt
# modules/libpref/init/all.js
Diffstat (limited to 'layout/style/nsCSSParser.cpp')
-rw-r--r-- | layout/style/nsCSSParser.cpp | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 736c66f87a..a8309314f8 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -12005,7 +12005,6 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID) return ParsePaintOrder(); case eCSSProperty_scroll_snap_type: return ParseScrollSnapType(); -#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND case eCSSProperty_mask: return ParseImageLayers(nsStyleImageLayers::kMaskLayerTable); case eCSSProperty_mask_repeat: @@ -12018,7 +12017,6 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID) aPropID == eCSSProperty_mask_position_x); case eCSSProperty_mask_size: return ParseImageLayerSize(eCSSProperty_mask_size); -#endif case eCSSProperty__webkit_text_stroke: return ParseWebkitTextStroke(); case eCSSProperty_all: @@ -12424,7 +12422,7 @@ CSSParserImpl::ParseImageLayersItem( aState.mImage->mValue.SetNoneValue(); aState.mAttachment->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL, eCSSUnit_Enumerated); - aState.mClip->mValue.SetIntValue(NS_STYLE_IMAGELAYER_CLIP_BORDER, + aState.mClip->mValue.SetIntValue(StyleGeometryBox::Border, eCSSUnit_Enumerated); aState.mRepeat->mXValue.SetIntValue(NS_STYLE_IMAGELAYER_REPEAT_REPEAT, @@ -12437,10 +12435,10 @@ CSSParserImpl::ParseImageLayersItem( aState.mPositionY->mValue.SetArrayValue(positionYArr, eCSSUnit_Array); if (eCSSProperty_mask == aTable[nsStyleImageLayers::shorthand]) { - aState.mOrigin->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ORIGIN_BORDER, + aState.mOrigin->mValue.SetIntValue(StyleGeometryBox::Border, eCSSUnit_Enumerated); } else { - aState.mOrigin->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ORIGIN_PADDING, + aState.mOrigin->mValue.SetIntValue(StyleGeometryBox::Padding, eCSSUnit_Enumerated); } positionXArr->Item(1).SetPercentValue(0.0f); @@ -12462,6 +12460,8 @@ CSSParserImpl::ParseImageLayersItem( haveMode = false, haveSomething = false; + const KTableEntry* originTable = + nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::origin]]; while (GetToken(true)) { nsCSSTokenType tt = mToken.mType; UngetToken(); // ...but we'll still cheat and use mToken @@ -12531,8 +12531,7 @@ CSSParserImpl::ParseImageLayersItem( aState.mSize->mXValue = scratch.mXValue; aState.mSize->mYValue = scratch.mYValue; } - } else if (nsCSSProps::FindKeyword(keyword, - nsCSSProps::kImageLayerOriginKTable, dummy)) { + } else if (nsCSSProps::FindKeyword(keyword, originTable, dummy)) { if (haveOrigin) return false; haveOrigin = true; @@ -12547,23 +12546,15 @@ CSSParserImpl::ParseImageLayersItem( // immediately following the first one (for background-origin). #ifdef DEBUG - for (size_t i = 0; nsCSSProps::kImageLayerOriginKTable[i].mValue != -1; i++) { + const KTableEntry* clipTable = + nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::clip]]; + for (size_t i = 0; originTable[i].mValue != -1; i++) { // For each keyword & value in kOriginKTable, ensure that // kBackgroundKTable has a matching entry at the same position. - MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mKeyword == - nsCSSProps::kBackgroundClipKTable[i].mKeyword); - MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mValue == - nsCSSProps::kBackgroundClipKTable[i].mValue); + MOZ_ASSERT(originTable[i].mKeyword == clipTable[i].mKeyword); + MOZ_ASSERT(originTable[i].mValue == clipTable[i].mValue); } #endif - 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, - "bg-clip and bg-origin style constants must agree"); - CSSParseResult result = ParseSingleValueProperty(aState.mClip->mValue, aTable[nsStyleImageLayers::clip]); |