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
--- a/layout/style/CSSKeyframesRule.h
+++ b/layout/style/CSSKeyframesRule.h
@@ -2,30 +2,32 @@
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#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; }
virtual void GetName(nsAString& aName) const = 0;
virtual void SetName(const nsAString& aName) = 0;
virtual CSSRuleList* CssRules() = 0;
virtual void AppendRule(const nsAString& aRule) = 0;
virtual void DeleteRule(const nsAString& aKey) = 0;
--- a/layout/style/ServoKeyframesRule.cpp
+++ b/layout/style/ServoKeyframesRule.cpp
@@ -153,20 +153,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
// -------------------------------------------
// ServoKeyframesRule
//
ServoKeyframesRule::ServoKeyframesRule(RefPtr<RawServoKeyframesRule> 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))
{
}
ServoKeyframesRule::~ServoKeyframesRule()
{
if (mKeyframeList) {
@@ -342,16 +338,15 @@ ServoKeyframesRule::FindRule(const nsASt
}
return nullptr;
}
/* virtual */ size_t
ServoKeyframesRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
{
size_t n = aMallocSizeOf(this);
- n += GroupRule::SizeOfExcludingThis(aMallocSizeOf);
if (mKeyframeList) {
n += mKeyframeList->SizeOfIncludingThis(aMallocSizeOf);
}
return n;
}
} // namespace mozilla