From 637c9b2a8625caf18100354e470bb27cb17bb51c Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Wed, 28 Mar 2018 12:23:58 +1100 Subject: [PATCH] Bug 1449103 part 2 - Make CSSKeyframesRule inherit from Rule directly. r=emilio The spec doesn't say CSSKeyframesRule needs to inherit CSSGroupingRule. It inherited GroupRule because Gecko's keyframes rule implementation relies on that to manage its children. MozReview-Commit-ID: CnVP2tozwQU --HG-- extra : rebase_source : 63c61d7b7d003ff82bd73e183516f6076a2dafb6 --- layout/style/CSSKeyframesRule.h | 8 +++++--- layout/style/ServoKeyframesRule.cpp | 5 ----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/layout/style/CSSKeyframesRule.h b/layout/style/CSSKeyframesRule.h index 4cb914529803..ac98c2c89f7f 100644 --- a/layout/style/CSSKeyframesRule.h +++ b/layout/style/CSSKeyframesRule.h @@ -7,20 +7,22 @@ #ifndef mozilla_dom_CSSKeyframesRule_h #define mozilla_dom_CSSKeyframesRule_h -#include "mozilla/css/GroupRule.h" +#include "mozilla/css/Rule.h" #include "mozilla/dom/CSSKeyframeRule.h" namespace mozilla { namespace dom { -class CSSKeyframesRule : public css::GroupRule +class CSSKeyframesRule : public css::Rule { protected: - using css::GroupRule::GroupRule; + using css::Rule::Rule; virtual ~CSSKeyframesRule() {} public: int32_t GetType() const final { return Rule::KEYFRAMES_RULE; } + // Let's not worry for now about sorting out whether we're a leaf or not. + bool IsCCLeaf() const override { return false; } // WebIDL interface uint16_t Type() const final { return CSSRuleBinding::KEYFRAMES_RULE; } diff --git a/layout/style/ServoKeyframesRule.cpp b/layout/style/ServoKeyframesRule.cpp index 07ffe70685fc..5d7dc2b0757f 100644 --- a/layout/style/ServoKeyframesRule.cpp +++ b/layout/style/ServoKeyframesRule.cpp @@ -158,10 +158,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END ServoKeyframesRule::ServoKeyframesRule(RefPtr aRawRule, uint32_t aLine, uint32_t aColumn) - // Although this class inherits from GroupRule, we don't want to use - // it at all, so it is fine to call the constructor for Gecko. We can - // make CSSKeyframesRule inherit from Rule directly once we can get - // rid of nsCSSKeyframeRule. : dom::CSSKeyframesRule(aLine, aColumn) , mRawRule(Move(aRawRule)) { @@ -347,7 +343,6 @@ ServoKeyframesRule::FindRule(const nsAString& aKey) ServoKeyframesRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const { size_t n = aMallocSizeOf(this); - n += GroupRule::SizeOfExcludingThis(aMallocSizeOf); if (mKeyframeList) { n += mKeyframeList->SizeOfIncludingThis(aMallocSizeOf); }