Backed out changeset 76136a4cadcc (bug 851892)

This commit is contained in:
Sebastian Hengst
2017-01-20 19:29:52 +01:00
parent 655c59a134
commit 38f8942c5e
8 changed files with 19 additions and 33 deletions

View File

@@ -74,6 +74,7 @@
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#include "nsIDOMCSSKeyframeRule.h"
#include "nsIDOMCSSKeyframesRule.h"
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMXULCommandDispatcher.h"
@@ -219,6 +220,9 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframeRule, nsCSSRuleSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_PRECREATE)
NS_DEFINE_CLASSINFO_DATA(CSSKeyframesRule, nsCSSRuleSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::WANT_PRECREATE)
@@ -542,6 +546,11 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframeRule, nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframeRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(CSSKeyframesRule, nsIDOMCSSKeyframesRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSKeyframesRule)

View File

@@ -39,6 +39,7 @@ enum nsDOMClassInfoID
eDOMClassInfo_ChromeMessageBroadcaster_id,
eDOMClassInfo_ChromeMessageSender_id,
eDOMClassInfo_CSSKeyframeRule_id,
eDOMClassInfo_CSSKeyframesRule_id,
// @counter-style in CSS

View File

@@ -23,6 +23,7 @@ class ProcessGlobal;
class SandboxPrivate;
class nsInProcessTabChildGlobal;
class nsWindowRoot;
class nsCSSKeyframeRule;
class nsCSSKeyframesRule;
class nsCSSCounterStyleRule;
@@ -282,6 +283,7 @@ private:
friend class SandboxPrivate;
friend class nsInProcessTabChildGlobal;
friend class nsWindowRoot;
friend class nsCSSKeyframeRule;
friend class nsCSSKeyframesRule;
friend class nsCSSCounterStyleRule;
void SetIsNotDOMBinding()

View File

@@ -221,11 +221,6 @@ DOMInterfaces = {
'nativeType': 'mozilla::css::ImportRule',
},
'CSSKeyframeRule': {
'nativeType': 'nsCSSKeyframeRule',
'headerFile': 'nsCSSRules.h',
},
'CSSLexer': {
'wrapperCache': False
},

View File

@@ -1,14 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*
* The origin of this IDL file is
* https://drafts.csswg.org/css-animations/#interface-csskeyframerule
*/
// https://drafts.csswg.org/css-animations/#interface-csskeyframerule
interface CSSKeyframeRule : CSSRule {
attribute DOMString keyText;
readonly attribute CSSStyleDeclaration style;
};

View File

@@ -94,7 +94,6 @@ WEBIDL_FILES = [
'CSSFontFeatureValuesRule.webidl',
'CSSGroupingRule.webidl',
'CSSImportRule.webidl',
'CSSKeyframeRule.webidl',
'CSSLexer.webidl',
'CSSMediaRule.webidl',
'CSSMozDocumentRule.webidl',

View File

@@ -41,7 +41,6 @@
#include "mozilla/dom/CSSPageRuleBinding.h"
#include "mozilla/dom/CSSFontFaceRuleBinding.h"
#include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
#include "mozilla/dom/CSSKeyframeRuleBinding.h"
#include "StyleRule.h"
#include "nsFont.h"
#include "nsIURI.h"
@@ -2097,6 +2096,7 @@ nsCSSKeyframeRule::nsCSSKeyframeRule(const nsCSSKeyframeRule& aCopy)
, mKeys(aCopy.mKeys)
, mDeclaration(new css::Declaration(*aCopy.mDeclaration))
{
SetIsNotDOMBinding();
mDeclaration->SetOwningRule(this);
}
@@ -2142,6 +2142,7 @@ nsCSSKeyframeRule::IsCCLeaf() const
// QueryInterface implementation for nsCSSKeyframeRule
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsCSSKeyframeRule)
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSKeyframeRule)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSKeyframeRule)
NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
#ifdef DEBUG
@@ -2239,18 +2240,12 @@ nsCSSKeyframeRule::SetKeyText(const nsAString& aKeyText)
NS_IMETHODIMP
nsCSSKeyframeRule::GetStyle(nsIDOMCSSStyleDeclaration** aStyle)
{
NS_ADDREF(*aStyle = Style());
return NS_OK;
}
nsICSSDeclaration*
nsCSSKeyframeRule::Style()
{
if (!mDOMDeclaration) {
mDOMDeclaration = new nsCSSKeyframeStyleDeclaration(this);
}
return mDOMDeclaration;
NS_ADDREF(*aStyle = mDOMDeclaration);
return NS_OK;
}
void
@@ -2292,7 +2287,8 @@ nsCSSKeyframeRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
nsCSSKeyframeRule::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto)
{
return CSSKeyframeRuleBinding::Wrap(aCx, this, aGivenProto);
NS_NOTREACHED("We called SetIsNotDOMBinding() in our constructor");
return nullptr;
}
// -------------------------------------------

View File

@@ -417,6 +417,7 @@ public:
, mKeys(mozilla::Move(aKeys))
, mDeclaration(mozilla::Move(aDeclaration))
{
SetIsNotDOMBinding();
mDeclaration->SetOwningRule(this);
}
private:
@@ -440,9 +441,6 @@ public:
// WebIDL interface
uint16_t Type() const override;
void GetCssTextImpl(nsAString& aCssText) const override;
// The XPCOM GetKeyText is fine.
// The XPCOM SetKeyText is fine.
nsICSSDeclaration* Style();
const nsTArray<float>& GetKeys() const { return mKeys; }
mozilla::css::Declaration* Declaration() { return mDeclaration; }