Backed out changeset f62d345e9d41 (bug 851892)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 20 Jan 2017 19:29:42 +0100
changeset 330365 b01edf06d37c5187a99e79565b5b22bceb582aaa
parent 330364 7d4dc504eea50040e44edc20e0857cb28c2e4a96
child 330366 b1de3822315025667bc5add742b6c29e2f8c2abb
push id85957
push userarchaeopteryx@coole-files.de
push dateFri, 20 Jan 2017 18:31:47 +0000
treeherdermozilla-inbound@6fb381da04b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs851892
milestone53.0a1
backs outf62d345e9d41e0761e443ecc6aec28e877e5590d
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset f62d345e9d41 (bug 851892)
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfoID.h
dom/base/nsWrapperCache.h
dom/bindings/Bindings.conf
dom/webidl/CSSCounterStyleRule.webidl
dom/webidl/moz.build
layout/style/nsCSSRules.cpp
layout/style/nsCSSRules.h
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -69,16 +69,17 @@
 #include "nsIDOMEventTarget.h"
 
 // CSS related includes
 #include "nsCSSRules.h"
 #include "nsIDOMCSSRule.h"
 #include "nsMemory.h"
 
 // includes needed for the prototype chain interfaces
+#include "nsIDOMCSSCounterStyleRule.h"
 #include "nsIDOMXULCommandDispatcher.h"
 #include "nsIControllers.h"
 #ifdef MOZ_XUL
 #include "nsITreeSelection.h"
 #include "nsITreeContentView.h"
 #include "nsITreeView.h"
 #include "nsIXULTemplateBuilder.h"
 #endif
@@ -212,16 +213,20 @@ static nsDOMClassInfoData sClassInfoData
                                        nsIXPCScriptable::WANT_ENUMERATE |
                                        nsIXPCScriptable::IS_GLOBAL_OBJECT)
   NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ChromeMessageBroadcaster, nsDOMGenericSH,
                                        DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ChromeMessageSender, nsDOMGenericSH,
                                        DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
 
+  NS_DEFINE_CLASSINFO_DATA(CSSCounterStyleRule, nsCSSRuleSH,
+                           DOM_DEFAULT_SCRIPTABLE_FLAGS |
+                           nsIXPCScriptable::WANT_PRECREATE)
+
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULButtonElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULCheckboxElement, nsDOMGenericSH,
                                       DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -527,16 +532,21 @@ nsDOMClassInfo::Init()
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ChromeMessageSender, nsISupports)
     DOM_CLASSINFO_MAP_ENTRY(nsIFrameScriptLoader)
     DOM_CLASSINFO_MAP_ENTRY(nsIProcessScriptLoader)
     DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)
     DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
   DOM_CLASSINFO_MAP_END
 
+  DOM_CLASSINFO_MAP_BEGIN(CSSCounterStyleRule, nsIDOMCSSCounterStyleRule)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
+    DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
+  DOM_CLASSINFO_MAP_END
+
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULLabeledControlElement, nsIDOMXULLabeledControlElement)
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULLabeledControlElement)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoID.h
+++ b/dom/base/nsDOMClassInfoID.h
@@ -34,16 +34,19 @@ enum nsDOMClassInfoID
   eDOMClassInfo_XULTreeBuilder_id,
 #endif
 
   eDOMClassInfo_ContentFrameMessageManager_id,
   eDOMClassInfo_ContentProcessMessageManager_id,
   eDOMClassInfo_ChromeMessageBroadcaster_id,
   eDOMClassInfo_ChromeMessageSender_id,
 
+  // @counter-style in CSS
+  eDOMClassInfo_CSSCounterStyleRule_id,
+
   eDOMClassInfo_XULControlElement_id,
   eDOMClassInfo_XULLabeledControlElement_id,
   eDOMClassInfo_XULButtonElement_id,
   eDOMClassInfo_XULCheckboxElement_id,
   eDOMClassInfo_XULPopupElement_id,
 
   // This one better be the last one in this list
   eDOMClassInfoIDCount
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -18,16 +18,17 @@ namespace mozilla {
 namespace dom {
 class TabChildGlobal;
 class ProcessGlobal;
 } // namespace dom
 } // namespace mozilla
 class SandboxPrivate;
 class nsInProcessTabChildGlobal;
 class nsWindowRoot;
+class nsCSSCounterStyleRule;
 
 #define NS_WRAPPERCACHE_IID \
 { 0x6f3179a1, 0x36f7, 0x4a5c, \
   { 0x8c, 0xf1, 0xad, 0xc8, 0x7c, 0xde, 0x3e, 0x87 } }
 
 /**
  * Class to store the wrapper for an object. This can only be used with objects
  * that only have one non-security wrapper at a time (for an XPCWrappedNative
@@ -275,16 +276,17 @@ private:
   // Friend declarations for things that need to be able to call
   // SetIsNotDOMBinding().  The goal is to get rid of all of these, and
   // SetIsNotDOMBinding() too.
   friend class mozilla::dom::TabChildGlobal;
   friend class mozilla::dom::ProcessGlobal;
   friend class SandboxPrivate;
   friend class nsInProcessTabChildGlobal;
   friend class nsWindowRoot;
+  friend class nsCSSCounterStyleRule;
   void SetIsNotDOMBinding()
   {
     MOZ_ASSERT(!mWrapper && !(GetWrapperFlags() & ~WRAPPER_IS_NOT_DOM_BINDING),
                "This flag should be set before creating any wrappers.");
     SetWrapperFlags(WRAPPER_IS_NOT_DOM_BINDING);
   }
 
   JSObject *GetWrapperJSObject() const
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -197,21 +197,16 @@ DOMInterfaces = {
 },
 
 'CSSConditionRule': {
     'concrete': False,
     'nativeType': 'mozilla::css::ConditionRule',
     'headerFile': 'mozilla/css/GroupRule.h',
 },
 
-'CSSCounterStyleRule': {
-    'nativeType': 'nsCSSCounterStyleRule',
-    'headerFile': 'nsCSSRules.h',
-},
-
 'CSSFontFaceRule': {
     'nativeType': 'nsCSSFontFaceRule',
     'headerFile': 'nsCSSRules.h',
 },
 
 'CSSFontFeatureValuesRule': {
     'nativeType': 'nsCSSFontFeatureValuesRule',
     'headerFile': 'nsCSSRules.h',
deleted file mode 100644
--- a/dom/webidl/CSSCounterStyleRule.webidl
+++ /dev/null
@@ -1,23 +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-counter-styles-3/#the-csscounterstylerule-interface
- */
-
-// https://drafts.csswg.org/css-counter-styles-3/#the-csscounterstylerule-interface
-interface CSSCounterStyleRule : CSSRule {
-  attribute DOMString name;
-  attribute DOMString system;
-  attribute DOMString symbols;
-  attribute DOMString additiveSymbols;
-  attribute DOMString negative;
-  attribute DOMString prefix;
-  attribute DOMString suffix;
-  attribute DOMString range;
-  attribute DOMString pad;
-  attribute DOMString speakAs;
-  attribute DOMString fallback;
-};
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -85,17 +85,16 @@ WEBIDL_FILES = [
     'Coordinates.webidl',
     'CreateOfferRequest.webidl',
     'Crypto.webidl',
     'CSPDictionaries.webidl',
     'CSPReport.webidl',
     'CSS.webidl',
     'CSSAnimation.webidl',
     'CSSConditionRule.webidl',
-    'CSSCounterStyleRule.webidl',
     'CSSFontFaceRule.webidl',
     'CSSFontFeatureValuesRule.webidl',
     'CSSGroupingRule.webidl',
     'CSSImportRule.webidl',
     'CSSKeyframeRule.webidl',
     'CSSKeyframesRule.webidl',
     'CSSLexer.webidl',
     'CSSMediaRule.webidl',
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -38,17 +38,16 @@
 #include "mozilla/dom/CSSMediaRuleBinding.h"
 #include "mozilla/dom/CSSSupportsRuleBinding.h"
 #include "mozilla/dom/CSSMozDocumentRuleBinding.h"
 #include "mozilla/dom/CSSPageRuleBinding.h"
 #include "mozilla/dom/CSSFontFaceRuleBinding.h"
 #include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
 #include "mozilla/dom/CSSKeyframeRuleBinding.h"
 #include "mozilla/dom/CSSKeyframesRuleBinding.h"
-#include "mozilla/dom/CSSCounterStyleRuleBinding.h"
 #include "StyleRule.h"
 #include "nsFont.h"
 #include "nsIURI.h"
 #include "mozAutoDocUpdate.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsWrapperCacheInlines.h"
 
 using namespace mozilla;
@@ -2883,16 +2882,17 @@ CSSSupportsRule::WrapObject(JSContext* a
 // nsCSSCounterStyleRule
 //
 
 nsCSSCounterStyleRule::nsCSSCounterStyleRule(const nsCSSCounterStyleRule& aCopy)
   : Rule(aCopy)
   , mName(aCopy.mName)
   , mGeneration(aCopy.mGeneration)
 {
+  SetIsNotDOMBinding();
   for (size_t i = 0; i < ArrayLength(mValues); ++i) {
     mValues[i] = aCopy.mValues[i];
   }
 }
 
 nsCSSCounterStyleRule::~nsCSSCounterStyleRule()
 {
 }
@@ -2914,16 +2914,17 @@ nsCSSCounterStyleRule::kGetters[] = {
 NS_IMPL_ADDREF_INHERITED(nsCSSCounterStyleRule, mozilla::css::Rule)
 NS_IMPL_RELEASE_INHERITED(nsCSSCounterStyleRule, mozilla::css::Rule)
 
 // QueryInterface implementation for nsCSSCounterStyleRule
 // If this ever gets its own cycle-collection bits, reevaluate our IsCCLeaf
 // implementation.
 NS_INTERFACE_MAP_BEGIN(nsCSSCounterStyleRule)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
+  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSCounterStyleRule)
 NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
 
 bool
 nsCSSCounterStyleRule::IsCCLeaf() const
 {
   return Rule::IsCCLeaf();
 }
 
@@ -3315,10 +3316,11 @@ nsCSSCounterStyleRule::SizeOfIncludingTh
 {
   return aMallocSizeOf(this);
 }
 
 /* virtual */ JSObject*
 nsCSSCounterStyleRule::WrapObject(JSContext* aCx,
                                   JS::Handle<JSObject*> aGivenProto)
 {
-  return CSSCounterStyleRuleBinding::Wrap(aCx, this, aGivenProto);
+  NS_NOTREACHED("We called SetIsNotDOMBinding() in our constructor");
+  return nullptr;
 }
--- a/layout/style/nsCSSRules.h
+++ b/layout/style/nsCSSRules.h
@@ -651,16 +651,17 @@ class nsCSSCounterStyleRule final : publ
 {
 public:
   explicit nsCSSCounterStyleRule(const nsAString& aName,
                                  uint32_t aLineNumber, uint32_t aColumnNumber)
     : mozilla::css::Rule(aLineNumber, aColumnNumber)
     , mName(aName)
     , mGeneration(0)
   {
+    SetIsNotDOMBinding();
   }
 
 private:
   nsCSSCounterStyleRule(const nsCSSCounterStyleRule& aCopy);
   ~nsCSSCounterStyleRule();
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
@@ -674,38 +675,16 @@ public:
   virtual already_AddRefed<mozilla::css::Rule> Clone() const override;
 
   // nsIDOMCSSCounterStyleRule
   NS_DECL_NSIDOMCSSCOUNTERSTYLERULE
 
   // WebIDL interface
   uint16_t Type() const override;
   void GetCssTextImpl(nsAString& aCssText) const override;
-  // The XPCOM GetName is OK
-  // The XPCOM SetName is OK
-  // The XPCOM GetSystem is OK
-  // The XPCOM SetSystem is OK
-  // The XPCOM GetSymbols is OK
-  // The XPCOM SetSymbols is OK
-  // The XPCOM GetAdditiveSymbols is OK
-  // The XPCOM SetAdditiveSymbols is OK
-  // The XPCOM GetNegative is OK
-  // The XPCOM SetNegative is OK
-  // The XPCOM GetPrefix is OK
-  // The XPCOM SetPrefix is OK
-  // The XPCOM GetSuffix is OK
-  // The XPCOM SetSuffix is OK
-  // The XPCOM GetRange is OK
-  // The XPCOM SetRange is OK
-  // The XPCOM GetPad is OK
-  // The XPCOM SetPad is OK
-  // The XPCOM GetSpeakAs is OK
-  // The XPCOM SetSpeakAs is OK
-  // The XPCOM GetFallback is OK
-  // The XPCOM SetFallback is OK
 
   // This function is only used to check whether a non-empty value, which has
   // been accepted by parser, is valid for the given system and descriptor.
   static bool CheckDescValue(int32_t aSystem,
                              nsCSSCounterDesc aDescID,
                              const nsCSSValue& aValue);
 
   const nsString& GetName() const { return mName; }