diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2019-03-13 07:49:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-13 07:49:07 +0100 |
commit | bf0413359245579e9509146d42cd5547e35da695 (patch) | |
tree | 8218d4f60d9eccacbf42df8cb88094a082d401b4 /layout/style/nsCSSParser.cpp | |
parent | 51b821b3fdc5a7eab2369cb6a6680598a6264b08 (diff) | |
parent | 709bc24e9110eba12f94cfcb8db00a8338ac4098 (diff) | |
download | UXP-bf0413359245579e9509146d42cd5547e35da695.tar UXP-bf0413359245579e9509146d42cd5547e35da695.tar.gz UXP-bf0413359245579e9509146d42cd5547e35da695.tar.lz UXP-bf0413359245579e9509146d42cd5547e35da695.tar.xz UXP-bf0413359245579e9509146d42cd5547e35da695.zip |
Merge pull request #998 from MoonchildProductions/master
Merge master into Sync-weave
Diffstat (limited to 'layout/style/nsCSSParser.cpp')
-rw-r--r-- | layout/style/nsCSSParser.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 33e5fe56d..a8309314f 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -1551,7 +1551,7 @@ protected: nsCSSExpandedDataBlock mData; // Value to make sure our resolved variable results stay within sane limits. - const int32_t MAX_CSS_VAR_LENGTH = 10240; + const uint32_t MAX_CSS_VAR_LENGTH = 10240; public: // Used from nsCSSParser constructors and destructors @@ -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]); |