diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index e994d26f2002..f296eb875319 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -231,6 +231,10 @@ static nsDOMClassInfoData sClassInfoData[] = { DOM_DEFAULT_SCRIPTABLE_FLAGS | nsIXPCScriptable::WANT_PRECREATE) + NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, 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, @@ -561,6 +565,11 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule) DOM_CLASSINFO_MAP_END + DOM_CLASSINFO_MAP_BEGIN(CSSFontFeatureValuesRule, nsIDOMCSSFontFeatureValuesRule) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule) + DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule) + DOM_CLASSINFO_MAP_END + DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement) DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement) DOM_CLASSINFO_MAP_END diff --git a/dom/base/nsDOMClassInfoID.h b/dom/base/nsDOMClassInfoID.h index 3d13480dd2e8..e16fea514809 100644 --- a/dom/base/nsDOMClassInfoID.h +++ b/dom/base/nsDOMClassInfoID.h @@ -45,6 +45,8 @@ enum nsDOMClassInfoID // @counter-style in CSS eDOMClassInfo_CSSCounterStyleRule_id, + eDOMClassInfo_CSSFontFeatureValuesRule_id, + eDOMClassInfo_XULControlElement_id, eDOMClassInfo_XULLabeledControlElement_id, eDOMClassInfo_XULButtonElement_id, diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index 6562771ee0ca..587aad279d84 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -23,6 +23,7 @@ class ProcessGlobal; class SandboxPrivate; class nsInProcessTabChildGlobal; class nsWindowRoot; +class nsCSSFontFeatureValuesRule; class nsCSSKeyframeRule; class nsCSSKeyframesRule; class nsCSSCounterStyleRule; @@ -283,6 +284,7 @@ private: friend class SandboxPrivate; friend class nsInProcessTabChildGlobal; friend class nsWindowRoot; + friend class nsCSSFontFeatureValuesRule; friend class nsCSSKeyframeRule; friend class nsCSSKeyframesRule; friend class nsCSSCounterStyleRule; diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf index 6f6467985deb..74107817e52c 100644 --- a/dom/bindings/Bindings.conf +++ b/dom/bindings/Bindings.conf @@ -207,11 +207,6 @@ DOMInterfaces = { 'headerFile': 'nsCSSRules.h', }, -'CSSFontFeatureValuesRule': { - 'nativeType': 'nsCSSFontFeatureValuesRule', - 'headerFile': 'nsCSSRules.h', -}, - 'CSSGroupingRule': { 'concrete': False, 'nativeType': 'mozilla::css::GroupRule', diff --git a/dom/webidl/CSSFontFeatureValuesRule.webidl b/dom/webidl/CSSFontFeatureValuesRule.webidl deleted file mode 100644 index 7532938141ea..000000000000 --- a/dom/webidl/CSSFontFeatureValuesRule.webidl +++ /dev/null @@ -1,29 +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-fonts/#om-fontfeaturevalues - */ - -// https://drafts.csswg.org/css-fonts/#om-fontfeaturevalues -// but we don't implement anything remotely resembling the spec. -interface CSSFontFeatureValuesRule : CSSRule { - [SetterThrows] - attribute DOMString fontFamily; - - // Not yet implemented - // readonly attribute CSSFontFeatureValuesMap annotation; - // readonly attribute CSSFontFeatureValuesMap ornaments; - // readonly attribute CSSFontFeatureValuesMap stylistic; - // readonly attribute CSSFontFeatureValuesMap swash; - // readonly attribute CSSFontFeatureValuesMap characterVariant; - // readonly attribute CSSFontFeatureValuesMap styleset; -}; - -partial interface CSSFontFeatureValuesRule { - // Gecko addition? - [SetterThrows] - attribute DOMString valueText; -}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 9b619e303dfc..1e2c0ac92df8 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -91,7 +91,6 @@ WEBIDL_FILES = [ 'CSSAnimation.webidl', 'CSSConditionRule.webidl', 'CSSFontFaceRule.webidl', - 'CSSFontFeatureValuesRule.webidl', 'CSSGroupingRule.webidl', 'CSSImportRule.webidl', 'CSSLexer.webidl', diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index f4bfa58bfe87..d7c277a9a4f1 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -40,7 +40,6 @@ #include "mozilla/dom/CSSMozDocumentRuleBinding.h" #include "mozilla/dom/CSSPageRuleBinding.h" #include "mozilla/dom/CSSFontFaceRuleBinding.h" -#include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h" #include "StyleRule.h" #include "nsFont.h" #include "nsIURI.h" @@ -1801,6 +1800,7 @@ NS_IMPL_RELEASE_INHERITED(nsCSSFontFeatureValuesRule, mozilla::css::Rule) // implementation. NS_INTERFACE_MAP_BEGIN(nsCSSFontFeatureValuesRule) NS_INTERFACE_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule) + NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSFontFeatureValuesRule) NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule) bool @@ -1909,20 +1909,6 @@ nsCSSFontFeatureValuesRule::GetCssTextImpl(nsAString& aCssText) const FontFeatureValuesRuleToString(mFamilyList, mFeatureValues, aCssText); } -void -nsCSSFontFeatureValuesRule::SetFontFamily(const nsAString& aFamily, - ErrorResult& aRv) -{ - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); -} - -void -nsCSSFontFeatureValuesRule::SetValueText(const nsAString& aFamily, - ErrorResult& aRv) -{ - aRv.Throw(NS_ERROR_NOT_IMPLEMENTED); -} - NS_IMETHODIMP nsCSSFontFeatureValuesRule::GetFontFamily(nsAString& aFamilyListStr) { @@ -2015,7 +2001,8 @@ nsCSSFontFeatureValuesRule::SizeOfIncludingThis( nsCSSFontFeatureValuesRule::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CSSFontFeatureValuesRuleBinding::Wrap(aCx, this, aGivenProto); + NS_NOTREACHED("We called SetIsNotDOMBinding() in our constructor"); + return nullptr; } // ------------------------------------------- diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index 74ce93e64d81..c1ceb70efacb 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -323,6 +323,7 @@ public: nsCSSFontFeatureValuesRule(uint32_t aLineNumber, uint32_t aColumnNumber) : mozilla::css::Rule(aLineNumber, aColumnNumber) { + SetIsNotDOMBinding(); } nsCSSFontFeatureValuesRule(const nsCSSFontFeatureValuesRule& aCopy) @@ -331,6 +332,7 @@ public: mFamilyList(aCopy.mFamilyList), mFeatureValues(aCopy.mFeatureValues) { + SetIsNotDOMBinding(); } NS_DECL_ISUPPORTS_INHERITED @@ -349,10 +351,6 @@ public: // WebIDL interface uint16_t Type() const override; void GetCssTextImpl(nsAString& aCssText) const override; - // The XPCOM GetFontFamily is fine - void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv); - // The XPCOM GetValueText is fine - void SetValueText(const nsAString& aFamily, mozilla::ErrorResult& aRv); const mozilla::FontFamilyList& GetFamilyList() { return mFamilyList; } void SetFamilyList(const mozilla::FontFamilyList& aFamilyList);