From 61d08323e80a46e366ff537632b8d4a2598b77bf Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Wed, 7 Jan 2015 11:19:29 -0800 Subject: [PATCH] Remove dead enums from StyleResolver. We never disable style sharing with DisallowStyleSharing now, and SMIL doesn't exist in Sky so the MatchAllRulesExcludingSMIL flag is just dead code. R=ojan@chromium.org Review URL: https://codereview.chromium.org/823633006 --- engine/core/css/resolver/StyleResolver.cpp | 9 ++++----- engine/core/css/resolver/StyleResolver.h | 15 ++------------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/engine/core/css/resolver/StyleResolver.cpp b/engine/core/css/resolver/StyleResolver.cpp index 873eb12c652..cddbcad1771 100644 --- a/engine/core/css/resolver/StyleResolver.cpp +++ b/engine/core/css/resolver/StyleResolver.cpp @@ -316,7 +316,7 @@ void StyleResolver::matchUARules(ElementRuleCollector& collector, RuleSet* rules collector.sortAndTransferMatchedRules(); } -void StyleResolver::matchAllRules(StyleResolverState& state, ElementRuleCollector& collector, bool includeSMILProperties) +void StyleResolver::matchAllRules(StyleResolverState& state, ElementRuleCollector& collector) { matchUARules(collector); matchAuthorRules(state.element(), collector, false); @@ -351,8 +351,7 @@ void StyleResolver::loadPendingResources(StyleResolverState& state) document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts(); } -PassRefPtr StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent, StyleSharingBehavior sharingBehavior, - RuleMatchingBehavior matchingBehavior) +PassRefPtr StyleResolver::styleForElement(Element* element, RenderStyle* defaultParent) { ASSERT(document().frame()); ASSERT(document().settings()); @@ -364,7 +363,7 @@ PassRefPtr StyleResolver::styleForElement(Element* element, RenderS document().setDirectionSetOnDocumentElement(false); StyleResolverState state(document(), element, defaultParent); - if (sharingBehavior == AllowStyleSharing && state.parentStyle()) { + if (state.parentStyle()) { SharedStyleFinder styleFinder(state.elementContext(), *this); if (RefPtr sharedStyle = styleFinder.findSharedStyle()) return sharedStyle.release(); @@ -391,7 +390,7 @@ PassRefPtr StyleResolver::styleForElement(Element* element, RenderS { ElementRuleCollector collector(state.elementContext(), state.style()); - matchAllRules(state, collector, matchingBehavior != MatchAllRulesExcludingSMIL); + matchAllRules(state, collector); applyMatchedProperties(state, collector.matchedResult()); } diff --git a/engine/core/css/resolver/StyleResolver.h b/engine/core/css/resolver/StyleResolver.h index 37f156c6f5d..bb971c669d4 100644 --- a/engine/core/css/resolver/StyleResolver.h +++ b/engine/core/css/resolver/StyleResolver.h @@ -64,16 +64,6 @@ class StyleRuleKeyframes; class MatchResult; -enum StyleSharingBehavior { - AllowStyleSharing, - DisallowStyleSharing, -}; - -enum RuleMatchingBehavior { - MatchAllRules, - MatchAllRulesExcludingSMIL -}; - const unsigned styleSharingListSize = 15; const unsigned styleSharingMaxDepth = 32; typedef Deque, styleSharingListSize> StyleSharingList; @@ -96,8 +86,7 @@ public: explicit StyleResolver(Document&); virtual ~StyleResolver(); - PassRefPtr styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing, - RuleMatchingBehavior = MatchAllRules); + PassRefPtr styleForElement(Element*, RenderStyle* parentStyle = 0); PassRefPtr styleForKeyframe(Element*, const RenderStyle&, RenderStyle* parentStyle, const StyleKeyframe*, const AtomicString& animationName); static PassRefPtr createAnimatableValueSnapshot(Element&, CSSPropertyID, CSSValue&); @@ -166,7 +155,7 @@ private: void matchUARules(ElementRuleCollector&, RuleSet*); void matchAuthorRules(Element*, ElementRuleCollector&, bool includeEmptyRules); void matchAuthorRulesForShadowHost(Element*, ElementRuleCollector&, bool includeEmptyRules, Vector, 8>& resolvers, Vector, 8>& resolversInShadowTree); - void matchAllRules(StyleResolverState&, ElementRuleCollector&, bool includeSMILProperties); + void matchAllRules(StyleResolverState&, ElementRuleCollector&); void matchUARules(ElementRuleCollector&); void applyMatchedProperties(StyleResolverState&, const MatchResult&);