mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 00:27:29 +09:00
Issue #2490 - Part 16: Convert CSSFontFeatureValuesRule to WebIDL.
This commit is contained in:
parent
50f8c18757
commit
f0de637255
8 changed files with 55 additions and 18 deletions
|
|
@ -230,10 +230,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||||
nsIXPCScriptable::WANT_PRECREATE)
|
nsIXPCScriptable::WANT_PRECREATE)
|
||||||
|
|
||||||
NS_DEFINE_CLASSINFO_DATA(CSSFontFeatureValuesRule, nsDOMGenericSH,
|
|
||||||
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,
|
||||||
|
|
@ -565,11 +561,6 @@ nsDOMClassInfo::Init()
|
||||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCounterStyleRule)
|
||||||
DOM_CLASSINFO_MAP_END
|
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_BEGIN_NO_CLASS_IF(XULControlElement, nsIDOMXULControlElement)
|
||||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULControlElement)
|
||||||
DOM_CLASSINFO_MAP_END
|
DOM_CLASSINFO_MAP_END
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,6 @@ DOMCI_CLASS(CSSKeyframesRule)
|
||||||
// @counter-style in CSS
|
// @counter-style in CSS
|
||||||
DOMCI_CLASS(CSSCounterStyleRule)
|
DOMCI_CLASS(CSSCounterStyleRule)
|
||||||
|
|
||||||
DOMCI_CLASS(CSSFontFeatureValuesRule)
|
|
||||||
|
|
||||||
DOMCI_CLASS(XULControlElement)
|
DOMCI_CLASS(XULControlElement)
|
||||||
DOMCI_CLASS(XULLabeledControlElement)
|
DOMCI_CLASS(XULLabeledControlElement)
|
||||||
DOMCI_CLASS(XULButtonElement)
|
DOMCI_CLASS(XULButtonElement)
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ class ProcessGlobal;
|
||||||
class SandboxPrivate;
|
class SandboxPrivate;
|
||||||
class nsInProcessTabChildGlobal;
|
class nsInProcessTabChildGlobal;
|
||||||
class nsWindowRoot;
|
class nsWindowRoot;
|
||||||
class nsCSSFontFeatureValuesRule;
|
|
||||||
class nsCSSKeyframeRule;
|
class nsCSSKeyframeRule;
|
||||||
class nsCSSKeyframesRule;
|
class nsCSSKeyframesRule;
|
||||||
class nsCSSCounterStyleRule;
|
class nsCSSCounterStyleRule;
|
||||||
|
|
@ -284,7 +283,6 @@ private:
|
||||||
friend class SandboxPrivate;
|
friend class SandboxPrivate;
|
||||||
friend class nsInProcessTabChildGlobal;
|
friend class nsInProcessTabChildGlobal;
|
||||||
friend class nsWindowRoot;
|
friend class nsWindowRoot;
|
||||||
friend class nsCSSFontFeatureValuesRule;
|
|
||||||
friend class nsCSSKeyframeRule;
|
friend class nsCSSKeyframeRule;
|
||||||
friend class nsCSSKeyframesRule;
|
friend class nsCSSKeyframesRule;
|
||||||
friend class nsCSSCounterStyleRule;
|
friend class nsCSSCounterStyleRule;
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,11 @@ DOMInterfaces = {
|
||||||
'headerFile': 'nsCSSRules.h',
|
'headerFile': 'nsCSSRules.h',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
'CSSFontFeatureValuesRule': {
|
||||||
|
'nativeType': 'nsCSSFontFeatureValuesRule',
|
||||||
|
'headerFile': 'nsCSSRules.h',
|
||||||
|
},
|
||||||
|
|
||||||
'CSSGroupingRule': {
|
'CSSGroupingRule': {
|
||||||
'concrete': False,
|
'concrete': False,
|
||||||
'nativeType': 'mozilla::css::GroupRule',
|
'nativeType': 'mozilla::css::GroupRule',
|
||||||
|
|
|
||||||
29
dom/webidl/CSSFontFeatureValuesRule.webidl
Normal file
29
dom/webidl/CSSFontFeatureValuesRule.webidl
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
/* -*- 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;
|
||||||
|
};
|
||||||
|
|
@ -92,6 +92,7 @@ WEBIDL_FILES = [
|
||||||
'CSSAnimation.webidl',
|
'CSSAnimation.webidl',
|
||||||
'CSSConditionRule.webidl',
|
'CSSConditionRule.webidl',
|
||||||
'CSSFontFaceRule.webidl',
|
'CSSFontFaceRule.webidl',
|
||||||
|
'CSSFontFeatureValuesRule.webidl',
|
||||||
'CSSGroupingRule.webidl',
|
'CSSGroupingRule.webidl',
|
||||||
'CSSImportRule.webidl',
|
'CSSImportRule.webidl',
|
||||||
'CSSLexer.webidl',
|
'CSSLexer.webidl',
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@
|
||||||
#include "mozilla/dom/CSSMozDocumentRuleBinding.h"
|
#include "mozilla/dom/CSSMozDocumentRuleBinding.h"
|
||||||
#include "mozilla/dom/CSSPageRuleBinding.h"
|
#include "mozilla/dom/CSSPageRuleBinding.h"
|
||||||
#include "mozilla/dom/CSSFontFaceRuleBinding.h"
|
#include "mozilla/dom/CSSFontFaceRuleBinding.h"
|
||||||
|
#include "mozilla/dom/CSSFontFeatureValuesRuleBinding.h"
|
||||||
#include "StyleRule.h"
|
#include "StyleRule.h"
|
||||||
#include "nsFont.h"
|
#include "nsFont.h"
|
||||||
#include "nsIURI.h"
|
#include "nsIURI.h"
|
||||||
|
|
@ -1796,7 +1797,6 @@ NS_IMPL_RELEASE_INHERITED(nsCSSFontFeatureValuesRule, mozilla::css::Rule)
|
||||||
// implementation.
|
// implementation.
|
||||||
NS_INTERFACE_MAP_BEGIN(nsCSSFontFeatureValuesRule)
|
NS_INTERFACE_MAP_BEGIN(nsCSSFontFeatureValuesRule)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
|
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSFontFeatureValuesRule)
|
||||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CSSFontFeatureValuesRule)
|
|
||||||
NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
|
NS_INTERFACE_MAP_END_INHERITING(mozilla::css::Rule)
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
@ -1905,6 +1905,20 @@ nsCSSFontFeatureValuesRule::GetCssTextImpl(nsAString& aCssText) const
|
||||||
FontFeatureValuesRuleToString(mFamilyList, mFeatureValues, aCssText);
|
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
|
NS_IMETHODIMP
|
||||||
nsCSSFontFeatureValuesRule::GetFontFamily(nsAString& aFamilyListStr)
|
nsCSSFontFeatureValuesRule::GetFontFamily(nsAString& aFamilyListStr)
|
||||||
{
|
{
|
||||||
|
|
@ -1997,8 +2011,7 @@ nsCSSFontFeatureValuesRule::SizeOfIncludingThis(
|
||||||
nsCSSFontFeatureValuesRule::WrapObject(JSContext* aCx,
|
nsCSSFontFeatureValuesRule::WrapObject(JSContext* aCx,
|
||||||
JS::Handle<JSObject*> aGivenProto)
|
JS::Handle<JSObject*> aGivenProto)
|
||||||
{
|
{
|
||||||
NS_NOTREACHED("We called SetIsNotDOMBinding() in our constructor");
|
return CSSFontFeatureValuesRuleBinding::Wrap(aCx, this, aGivenProto);
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------
|
// -------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -322,7 +322,6 @@ public:
|
||||||
nsCSSFontFeatureValuesRule(uint32_t aLineNumber, uint32_t aColumnNumber)
|
nsCSSFontFeatureValuesRule(uint32_t aLineNumber, uint32_t aColumnNumber)
|
||||||
: mozilla::css::Rule(aLineNumber, aColumnNumber)
|
: mozilla::css::Rule(aLineNumber, aColumnNumber)
|
||||||
{
|
{
|
||||||
SetIsNotDOMBinding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCSSFontFeatureValuesRule(const nsCSSFontFeatureValuesRule& aCopy)
|
nsCSSFontFeatureValuesRule(const nsCSSFontFeatureValuesRule& aCopy)
|
||||||
|
|
@ -331,7 +330,6 @@ public:
|
||||||
, mFamilyList(aCopy.mFamilyList)
|
, mFamilyList(aCopy.mFamilyList)
|
||||||
, mFeatureValues(aCopy.mFeatureValues)
|
, mFeatureValues(aCopy.mFeatureValues)
|
||||||
{
|
{
|
||||||
SetIsNotDOMBinding();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
|
|
@ -350,6 +348,10 @@ 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;
|
||||||
|
// Our XPCOM GetFontFamily is OK
|
||||||
|
void SetFontFamily(const nsAString& aFamily, mozilla::ErrorResult& aRv);
|
||||||
|
// Our XPCOM GetValueText is OK
|
||||||
|
void SetValueText(const nsAString& aFamily, mozilla::ErrorResult& aRv);
|
||||||
|
|
||||||
const mozilla::FontFamilyList& GetFamilyList() { return mFamilyList; }
|
const mozilla::FontFamilyList& GetFamilyList() { return mFamilyList; }
|
||||||
void SetFamilyList(const mozilla::FontFamilyList& aFamilyList);
|
void SetFamilyList(const mozilla::FontFamilyList& aFamilyList);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue