From 15b9626feb0f70d5f6f639fef44397be2ec60dcb Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 12 Oct 2017 11:13:07 +1100 Subject: [PATCH] Bug 1363088 - Remove text-shadow handling from HasAuthorSpecifiedRules. r=heycam After bug 1401825, we no longer need the code for text-shadow anymore, so we can just remove it. MozReview-Commit-ID: B2zpzetwW91 --HG-- extra : rebase_source : 655ef8f1fc646b3905c55199b5f509c8e4093ddb --- layout/base/nsPresContext.h | 1 - layout/style/nsRuleNode.cpp | 40 ++++--------------------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 8857799654d0..64432059d050 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -119,7 +119,6 @@ enum nsLayoutPhase { #define NS_AUTHOR_SPECIFIED_BACKGROUND (1 << 0) #define NS_AUTHOR_SPECIFIED_BORDER (1 << 1) #define NS_AUTHOR_SPECIFIED_PADDING (1 << 2) -#define NS_AUTHOR_SPECIFIED_TEXT_SHADOW (1 << 3) class nsRootPresContext; diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 8f68cf6cadb7..14359a6717f2 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -10507,14 +10507,9 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, if (ruleTypeMask & NS_AUTHOR_SPECIFIED_PADDING) inheritBits |= NS_STYLE_INHERIT_BIT(Padding); - if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) - inheritBits |= NS_STYLE_INHERIT_BIT(Text); - // properties in the SIDS, whether or not we care about them size_t nprops = 0, - backgroundOffset, borderOffset, paddingOffset, textShadowOffset; - - // We put the reset properties the start of the nsCSSValue array.... + backgroundOffset, borderOffset, paddingOffset; if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) { backgroundOffset = nprops; @@ -10531,14 +10526,6 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Padding); } - // ...and the inherited properties at the end of the array. - size_t inheritedOffset = nprops; - - if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) { - textShadowOffset = nprops; - nprops += nsCSSProps::PropertyCountInStruct(eStyleStruct_Text); - } - void* dataStorage = alloca(nprops * sizeof(nsCSSValue)); AutoCSSValueArray dataArray(dataStorage, nprops); @@ -10558,10 +10545,6 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, ruleData.mValueOffsets[eStyleStruct_Padding] = paddingOffset; } - if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) { - ruleData.mValueOffsets[eStyleStruct_Text] = textShadowOffset; - } - static const nsCSSPropertyID backgroundValues[] = { eCSSProperty_background_color, eCSSProperty_background_image, @@ -10593,22 +10576,16 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, eCSSProperty_padding_left, }; - static const nsCSSPropertyID textShadowValues[] = { - eCSSProperty_text_shadow - }; - // Number of properties we care about size_t nValues = 0; nsCSSValue* values[MOZ_ARRAY_LENGTH(backgroundValues) + MOZ_ARRAY_LENGTH(borderValues) + - MOZ_ARRAY_LENGTH(paddingValues) + - MOZ_ARRAY_LENGTH(textShadowValues)]; + MOZ_ARRAY_LENGTH(paddingValues)]; nsCSSPropertyID properties[MOZ_ARRAY_LENGTH(backgroundValues) + MOZ_ARRAY_LENGTH(borderValues) + - MOZ_ARRAY_LENGTH(paddingValues) + - MOZ_ARRAY_LENGTH(textShadowValues)]; + MOZ_ARRAY_LENGTH(paddingValues)]; if (ruleTypeMask & NS_AUTHOR_SPECIFIED_BACKGROUND) { for (uint32_t i = 0, i_end = ArrayLength(backgroundValues); @@ -10634,14 +10611,6 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, } } - if (ruleTypeMask & NS_AUTHOR_SPECIFIED_TEXT_SHADOW) { - for (uint32_t i = 0, i_end = ArrayLength(textShadowValues); - i < i_end; ++i) { - properties[nValues] = textShadowValues[i]; - values[nValues++] = ruleData.ValueFor(textShadowValues[i]); - } - } - GeckoStyleContext* styleContextRef = styleContext; // We need to be careful not to count styles covered up by user-important or @@ -10672,8 +10641,7 @@ nsRuleNode::HasAuthorSpecifiedRules(GeckoStyleContext* aStyleContext, if (unit != eCSSUnit_Null && unit != eCSSUnit_Dummy && unit != eCSSUnit_DummyInherit) { - if (unit == eCSSUnit_Inherit || - (i >= inheritedOffset && unit == eCSSUnit_Unset)) { + if (unit == eCSSUnit_Inherit) { haveExplicitUAInherit = true; values[i]->SetDummyInheritValue(); } else {