Bug 851892 part 19. Convert CSSCounterStyleRule to WebIDL. r=peterv,heycam

This commit is contained in:
Boris Zbarsky 2017-01-13 10:41:04 -05:00
Родитель 20af0376fd
Коммит 3bbf9711a6
8 изменённых файлов: 53 добавлений и 20 удалений

Просмотреть файл

@ -74,7 +74,6 @@
#include "nsMemory.h" #include "nsMemory.h"
// includes needed for the prototype chain interfaces // includes needed for the prototype chain interfaces
#include "nsIDOMCSSCounterStyleRule.h"
#include "nsIDOMXULCommandDispatcher.h" #include "nsIDOMXULCommandDispatcher.h"
#include "nsIControllers.h" #include "nsIControllers.h"
#ifdef MOZ_XUL #ifdef MOZ_XUL
@ -218,10 +217,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS) 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, NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULControlElement, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH, NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(XULLabeledControlElement, nsDOMGenericSH,
@ -537,11 +532,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender) DOM_CLASSINFO_MAP_ENTRY(nsIMessageSender)
DOM_CLASSINFO_MAP_END 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_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END

Просмотреть файл

@ -39,9 +39,6 @@ enum nsDOMClassInfoID
eDOMClassInfo_ChromeMessageBroadcaster_id, eDOMClassInfo_ChromeMessageBroadcaster_id,
eDOMClassInfo_ChromeMessageSender_id, eDOMClassInfo_ChromeMessageSender_id,
// @counter-style in CSS
eDOMClassInfo_CSSCounterStyleRule_id,
eDOMClassInfo_XULControlElement_id, eDOMClassInfo_XULControlElement_id,
eDOMClassInfo_XULLabeledControlElement_id, eDOMClassInfo_XULLabeledControlElement_id,
eDOMClassInfo_XULButtonElement_id, eDOMClassInfo_XULButtonElement_id,

Просмотреть файл

@ -23,7 +23,6 @@ class ProcessGlobal;
class SandboxPrivate; class SandboxPrivate;
class nsInProcessTabChildGlobal; class nsInProcessTabChildGlobal;
class nsWindowRoot; class nsWindowRoot;
class nsCSSCounterStyleRule;
#define NS_WRAPPERCACHE_IID \ #define NS_WRAPPERCACHE_IID \
{ 0x6f3179a1, 0x36f7, 0x4a5c, \ { 0x6f3179a1, 0x36f7, 0x4a5c, \
@ -281,7 +280,6 @@ private:
friend class SandboxPrivate; friend class SandboxPrivate;
friend class nsInProcessTabChildGlobal; friend class nsInProcessTabChildGlobal;
friend class nsWindowRoot; friend class nsWindowRoot;
friend class nsCSSCounterStyleRule;
void SetIsNotDOMBinding() void SetIsNotDOMBinding()
{ {
MOZ_ASSERT(!mWrapper && !(GetWrapperFlags() & ~WRAPPER_IS_NOT_DOM_BINDING), MOZ_ASSERT(!mWrapper && !(GetWrapperFlags() & ~WRAPPER_IS_NOT_DOM_BINDING),

Просмотреть файл

@ -202,6 +202,11 @@ DOMInterfaces = {
'headerFile': 'mozilla/css/GroupRule.h', 'headerFile': 'mozilla/css/GroupRule.h',
}, },
'CSSCounterStyleRule': {
'nativeType': 'nsCSSCounterStyleRule',
'headerFile': 'nsCSSRules.h',
},
'CSSFontFaceRule': { 'CSSFontFaceRule': {
'nativeType': 'nsCSSFontFaceRule', 'nativeType': 'nsCSSFontFaceRule',
'headerFile': 'nsCSSRules.h', 'headerFile': 'nsCSSRules.h',

Просмотреть файл

@ -0,0 +1,23 @@
/* -*- 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;
};

Просмотреть файл

@ -90,6 +90,7 @@ WEBIDL_FILES = [
'CSS.webidl', 'CSS.webidl',
'CSSAnimation.webidl', 'CSSAnimation.webidl',
'CSSConditionRule.webidl', 'CSSConditionRule.webidl',
'CSSCounterStyleRule.webidl',
'CSSFontFaceRule.webidl', 'CSSFontFaceRule.webidl',
'CSSFontFeatureValuesRule.webidl', 'CSSFontFeatureValuesRule.webidl',
'CSSGroupingRule.webidl', 'CSSGroupingRule.webidl',

Просмотреть файл

@ -43,6 +43,7 @@
#include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h" #include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
#include "mozilla/dom/CSSKeyframeRuleBinding.h" #include "mozilla/dom/CSSKeyframeRuleBinding.h"
#include "mozilla/dom/CSSKeyframesRuleBinding.h" #include "mozilla/dom/CSSKeyframesRuleBinding.h"
#include "mozilla/dom/CSSCounterStyleRuleBinding.h"
#include "StyleRule.h" #include "StyleRule.h"
#include "nsFont.h" #include "nsFont.h"
#include "nsIURI.h" #include "nsIURI.h"
@ -2782,7 +2783,6 @@ nsCSSCounterStyleRule::nsCSSCounterStyleRule(const nsCSSCounterStyleRule& aCopy)
, mName(aCopy.mName) , mName(aCopy.mName)
, mGeneration(aCopy.mGeneration) , mGeneration(aCopy.mGeneration)
{ {
SetIsNotDOMBinding();
for (size_t i = 0; i < ArrayLength(mValues); ++i) { for (size_t i = 0; i < ArrayLength(mValues); ++i) {
mValues[i] = aCopy.mValues[i]; mValues[i] = aCopy.mValues[i];
} }
@ -2812,7 +2812,6 @@ NS_IMPL_RELEASE_INHERITED(nsCSSCounterStyleRule, mozilla::css::Rule)
// QueryInterface implementation for nsCSSCounterStyleRule // QueryInterface implementation for nsCSSCounterStyleRule
NS_INTERFACE_MAP_BEGIN(nsCSSCounterStyleRule) NS_INTERFACE_MAP_BEGIN(nsCSSCounterStyleRule)
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSCounterStyleRule) NS_INTERFACE_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSCounterStyleRule)
NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule) NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
#ifdef DEBUG #ifdef DEBUG
@ -3208,6 +3207,5 @@ nsCSSCounterStyleRule::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
nsCSSCounterStyleRule::WrapObject(JSContext* aCx, nsCSSCounterStyleRule::WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) JS::Handle<JSObject*> aGivenProto)
{ {
NS_NOTREACHED("We called SetIsNotDOMBinding() in our constructor"); return CSSCounterStyleRuleBinding::Wrap(aCx, this, aGivenProto);
return nullptr;
} }

Просмотреть файл

@ -652,7 +652,6 @@ public:
, mName(aName) , mName(aName)
, mGeneration(0) , mGeneration(0)
{ {
SetIsNotDOMBinding();
} }
private: private:
@ -675,6 +674,28 @@ public:
// WebIDL interface // WebIDL interface
uint16_t Type() const override; uint16_t Type() const override;
void GetCssTextImpl(nsAString& aCssText) 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 // 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. // been accepted by parser, is valid for the given system and descriptor.