From 0ebadaa7d154381f27fc1f6ef4642f558569037f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Thu, 17 Apr 2014 12:11:08 +0000 Subject: [PATCH] Bug 613659 - Remove remaining vestiges of -moz-background-inline-policy. r=cam --- layout/base/nsDisplayList.cpp | 5 +++-- layout/style/nsCSSKeywordList.h | 2 -- layout/style/nsCSSPropList.h | 16 ---------------- layout/style/nsCSSProps.cpp | 7 ------- layout/style/nsCSSProps.h | 1 - layout/style/nsComputedDOMStyle.cpp | 10 ---------- layout/style/nsComputedDOMStyle.h | 1 - layout/style/nsComputedDOMStylePropertyList.h | 1 - layout/style/nsRuleNode.cpp | 8 -------- layout/style/nsStyleStruct.cpp | 6 +----- layout/style/nsStyleStruct.h | 5 ----- layout/style/test/property_database.js | 8 -------- .../test/test_shorthand_property_getters.html | 4 ---- 13 files changed, 4 insertions(+), 70 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 605821167bd4..81955631bdc6 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -2182,12 +2182,13 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder, *aSnap = true; - // For policies other than EACH_BOX, don't try to optimize here, since + // For NS_STYLE_BOX_DECORATION_BREAK_SLICE, don't try to optimize here, since // this could easily lead to O(N^2) behavior inside InlineBackgroundData, // which expects frames to be sent to it in content order, not reverse // content order which we'll produce here. // Of course, if there's only one frame in the flow, it doesn't matter. - if (mBackgroundStyle->mBackgroundInlinePolicy == NS_STYLE_BG_INLINE_POLICY_EACH_BOX || + if (mFrame->StyleBorder()->mBoxDecorationBreak == + NS_STYLE_BOX_DECORATION_BREAK_CLONE || (!mFrame->GetPrevContinuation() && !mFrame->GetNextContinuation())) { const nsStyleBackground::Layer& layer = mBackgroundStyle->mLayers[mLayer]; if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL) { diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index 4f65808a84e7..5ae84e997d7e 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -188,7 +188,6 @@ CSS_KEY(border-box, border_box) CSS_KEY(both, both) CSS_KEY(bottom, bottom) CSS_KEY(bottom-outside, bottom_outside) -CSS_KEY(bounding-box, bounding_box) CSS_KEY(break-all, break_all) CSS_KEY(break-word, break_word) CSS_KEY(brightness, brightness) @@ -258,7 +257,6 @@ CSS_KEY(double, double) CSS_KEY(double-struck, double_struck) CSS_KEY(drop-shadow, drop_shadow) CSS_KEY(e-resize, e_resize) -CSS_KEY(each-box, each_box) CSS_KEY(ease, ease) CSS_KEY(ease-in, ease_in) CSS_KEY(ease-in-out, ease_in_out) diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index c8f0fd00592c..b92c078bc735 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -274,10 +274,6 @@ // 'text-shadow' (see above) and 'box-shadow' (which is like the // border properties). -// We include '-moz-background-inline-policy' (css3-background's -// 'background-break') in both as a background property, although this -// is somewhat questionable. - CSS_PROP_DISPLAY( -moz-appearance, appearance, @@ -537,18 +533,6 @@ CSS_PROP_BACKGROUND( nullptr, CSS_PROP_NO_OFFSET, eStyleAnimType_None) -CSS_PROP_BACKGROUND( - -moz-background-inline-policy, - _moz_background_inline_policy, - CSS_PROP_DOMPROP_PREFIXED(BackgroundInlinePolicy), - CSS_PROPERTY_PARSE_VALUE | - CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE | - CSS_PROPERTY_APPLIES_TO_PLACEHOLDER, - "", - VARIANT_HK, - kBackgroundInlinePolicyKTable, - CSS_PROP_NO_OFFSET, - eStyleAnimType_None) CSS_PROP_BACKGROUND( background-blend-mode, background_blend_mode, diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 4e0c7a01cc3e..a02f54138c1b 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -676,13 +676,6 @@ const KTableValue nsCSSProps::kBackgroundAttachmentKTable[] = { eCSSKeyword_UNKNOWN,-1 }; -const KTableValue nsCSSProps::kBackgroundInlinePolicyKTable[] = { - eCSSKeyword_each_box, NS_STYLE_BG_INLINE_POLICY_EACH_BOX, - eCSSKeyword_continuous, NS_STYLE_BG_INLINE_POLICY_CONTINUOUS, - eCSSKeyword_bounding_box, NS_STYLE_BG_INLINE_POLICY_BOUNDING_BOX, - eCSSKeyword_UNKNOWN,-1 -}; - static_assert(NS_STYLE_BG_CLIP_BORDER == NS_STYLE_BG_ORIGIN_BORDER && NS_STYLE_BG_CLIP_PADDING == NS_STYLE_BG_ORIGIN_PADDING && NS_STYLE_BG_CLIP_CONTENT == NS_STYLE_BG_ORIGIN_CONTENT, diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h index fde719e5dd42..0a6a4e5ec447 100644 --- a/layout/style/nsCSSProps.h +++ b/layout/style/nsCSSProps.h @@ -506,7 +506,6 @@ public: static const KTableValue kBackfaceVisibilityKTable[]; static const KTableValue kTransformStyleKTable[]; static const KTableValue kBackgroundAttachmentKTable[]; - static const KTableValue kBackgroundInlinePolicyKTable[]; static const KTableValue kBackgroundOriginKTable[]; static const KTableValue kBackgroundPositionKTable[]; static const KTableValue kBackgroundRepeatKTable[]; diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index e9a3f31772d4..31d435558434 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2073,16 +2073,6 @@ nsComputedDOMStyle::DoGetBackgroundImage() return valueList; } -CSSValue* -nsComputedDOMStyle::DoGetBackgroundInlinePolicy() -{ - nsROCSSPrimitiveValue *val = new nsROCSSPrimitiveValue; - val->SetIdent(nsCSSProps::ValueToKeywordEnum( - StyleBackground()->mBackgroundInlinePolicy, - nsCSSProps::kBackgroundInlinePolicyKTable)); - return val; -} - CSSValue* nsComputedDOMStyle::DoGetBackgroundBlendMode() { diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h index 45e0b841ae55..48183456dd21 100644 --- a/layout/style/nsComputedDOMStyle.h +++ b/layout/style/nsComputedDOMStyle.h @@ -284,7 +284,6 @@ private: mozilla::dom::CSSValue* DoGetBackgroundPosition(); mozilla::dom::CSSValue* DoGetBackgroundRepeat(); mozilla::dom::CSSValue* DoGetBackgroundClip(); - mozilla::dom::CSSValue* DoGetBackgroundInlinePolicy(); mozilla::dom::CSSValue* DoGetBackgroundBlendMode(); mozilla::dom::CSSValue* DoGetBackgroundOrigin(); mozilla::dom::CSSValue* DoGetBackgroundSize(); diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h index e83473a4dc8f..c66cc7c692d6 100644 --- a/layout/style/nsComputedDOMStylePropertyList.h +++ b/layout/style/nsComputedDOMStylePropertyList.h @@ -230,7 +230,6 @@ COMPUTED_STYLE_PROP(z_index, ZIndex) \* ******************************* */ COMPUTED_STYLE_PROP(appearance, Appearance) -COMPUTED_STYLE_PROP(_moz_background_inline_policy, BackgroundInlinePolicy) COMPUTED_STYLE_PROP(binding, Binding) COMPUTED_STYLE_PROP(border_bottom_colors, BorderBottomColors) COMPUTED_STYLE_PROP(border_left_colors, BorderLeftColors) diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index e1c56f868460..4c45bcfe5eff 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -6239,14 +6239,6 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct, uint8_t(NS_STYLE_BG_CLIP_BORDER), parentBG->mClipCount, bg->mClipCount, maxItemCount, rebuild, canStoreInRuleTree); - // background-inline-policy: enum, inherit, initial - SetDiscrete(*aRuleData->ValueForBackgroundInlinePolicy(), - bg->mBackgroundInlinePolicy, - canStoreInRuleTree, - SETDSC_ENUMERATED | SETDSC_UNSET_INITIAL, - parentBG->mBackgroundInlinePolicy, - NS_STYLE_BG_INLINE_POLICY_CONTINUOUS, 0, 0, 0, 0); - // background-blend-mode: enum, inherit, initial [list] SetBackgroundList(aContext, *aRuleData->ValueForBackgroundBlendMode(), bg->mLayers, diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 14d59f4ebb7b..6f5d49392a36 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -1971,7 +1971,6 @@ nsStyleBackground::nsStyleBackground() , mSizeCount(1) , mBlendModeCount(1) , mBackgroundColor(NS_RGBA(0, 0, 0, 0)) - , mBackgroundInlinePolicy(NS_STYLE_BG_INLINE_POLICY_CONTINUOUS) { MOZ_COUNT_CTOR(nsStyleBackground); Layer *onlyLayer = mLayers.AppendElement(); @@ -1990,7 +1989,6 @@ nsStyleBackground::nsStyleBackground(const nsStyleBackground& aSource) , mBlendModeCount(aSource.mBlendModeCount) , mLayers(aSource.mLayers) // deep copy , mBackgroundColor(aSource.mBackgroundColor) - , mBackgroundInlinePolicy(aSource.mBackgroundInlinePolicy) { MOZ_COUNT_CTOR(nsStyleBackground); // If the deep copy of mLayers failed, truncate the counts. @@ -2048,9 +2046,7 @@ nsChangeHint nsStyleBackground::CalcDifference(const nsStyleBackground& aOther) } } - if (hasVisualDifference || - mBackgroundColor != aOther.mBackgroundColor || - mBackgroundInlinePolicy != aOther.mBackgroundInlinePolicy) + if (hasVisualDifference || mBackgroundColor != aOther.mBackgroundColor) return NS_STYLE_HINT_VISUAL; return NS_STYLE_HINT_NONE; diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 05bc1438c39f..5e05bf832829 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -539,11 +539,6 @@ struct nsStyleBackground { nscolor mBackgroundColor; // [reset] - // FIXME: This (now background-break in css3-background) should - // probably move into a different struct so that everything in - // nsStyleBackground is set by the background shorthand. - uint8_t mBackgroundInlinePolicy; // [reset] See nsStyleConsts.h - // True if this background is completely transparent. bool IsTransparent() const; diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index a68273b39056..c82d270103e5 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -648,14 +648,6 @@ var gCSSProperties = { other_values: [ "radio", "menulist" ], invalid_values: [] }, - "-moz-background-inline-policy": { - domProp: "MozBackgroundInlinePolicy", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: [ "continuous" ], - other_values: ["bounding-box", "each-box" ], - invalid_values: [] - }, "-moz-binding": { domProp: "MozBinding", inherited: false, diff --git a/layout/style/test/test_shorthand_property_getters.html b/layout/style/test/test_shorthand_property_getters.html index 355ecb723a7a..5f761c4bd49e 100644 --- a/layout/style/test/test_shorthand_property_getters.html +++ b/layout/style/test/test_shorthand_property_getters.html @@ -139,10 +139,6 @@ isnot(e.style.background, "", "should have background shorthand (size:100% auto) e.setAttribute("style", "background: red; background-size: auto 100%"); isnot(e.style.background, "", "should have background shorthand (size:auto 100%)"); -// Test background-inline-policy not interacting with the background shorthand. -e.setAttribute("style", "background: red; -moz-background-inline-policy: each-box"); -isnot(e.style.background, "", "should have background shorthand (-moz-background-inline-policy not relevant)"); - // Check that we only serialize background when the lists (of layers) for // the subproperties are the same length. e.setAttribute("style", "background-clip: border-box, padding-box, border-box; background-origin: border-box, padding-box, padding-box; background-size: cover, auto, contain; background-color: blue; background-image: url(404.png), none, url(404-2.png); background-attachment: fixed, scroll, scroll; background-position: top left, center, 30px 50px; background-repeat: repeat-x, repeat, no-repeat");