From 65122eed2098a04c67dcc9f48b7de4b990a9b004 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 21 Dec 2017 12:17:37 +1100 Subject: [PATCH] Bug 1326514 - Implement the CSSOM bits for CSSNamespaceRule. r=bz MozReview-Commit-ID: 5UpvH4osOfn --HG-- extra : rebase_source : 9b04b92e1c270217e068ce72e6c64884067500b7 --- dom/webidl/CSSNamespaceRule.webidl | 6 ++---- layout/style/CSSNamespaceRule.h | 6 ++++++ .../meta/css/cssom/CSSNamespaceRule.html.ini | 5 ----- .../web-platform/meta/css/cssom/interfaces.html.ini | 12 ------------ 4 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 testing/web-platform/meta/css/cssom/CSSNamespaceRule.html.ini diff --git a/dom/webidl/CSSNamespaceRule.webidl b/dom/webidl/CSSNamespaceRule.webidl index 0051c904a72d..63f9301738d6 100644 --- a/dom/webidl/CSSNamespaceRule.webidl +++ b/dom/webidl/CSSNamespaceRule.webidl @@ -9,8 +9,6 @@ // https://drafts.csswg.org/cssom/#cssnamespacerule interface CSSNamespaceRule : CSSRule { - // Not implemented yet. . - // readonly attribute DOMString namespaceURI; - // readonly attribute DOMString prefix; + readonly attribute DOMString namespaceURI; + readonly attribute DOMString prefix; }; diff --git a/layout/style/CSSNamespaceRule.h b/layout/style/CSSNamespaceRule.h index 106f11362f3f..c7e601f55ebf 100644 --- a/layout/style/CSSNamespaceRule.h +++ b/layout/style/CSSNamespaceRule.h @@ -36,6 +36,12 @@ public: uint16_t Type() const final { return nsIDOMCSSRule::NAMESPACE_RULE; } + void GetNamespaceURI(nsString& aNamespaceURI) { + GetURLSpec(aNamespaceURI); + } + void GetPrefix(DOMString& aPrefix) { + aPrefix.SetOwnedAtom(GetPrefix(), DOMString::eNullNotExpected); + } size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const = 0; diff --git a/testing/web-platform/meta/css/cssom/CSSNamespaceRule.html.ini b/testing/web-platform/meta/css/cssom/CSSNamespaceRule.html.ini deleted file mode 100644 index 035da399c1c4..000000000000 --- a/testing/web-platform/meta/css/cssom/CSSNamespaceRule.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[CSSNamespaceRule.html] - type: testharness - [CSSOM - CSSNamespaceRule interface] - expected: FAIL - diff --git a/testing/web-platform/meta/css/cssom/interfaces.html.ini b/testing/web-platform/meta/css/cssom/interfaces.html.ini index 20674c2ce8e3..e2f64b20fa51 100644 --- a/testing/web-platform/meta/css/cssom/interfaces.html.ini +++ b/testing/web-platform/meta/css/cssom/interfaces.html.ini @@ -75,12 +75,6 @@ [CSSMarginRule interface: attribute style] expected: FAIL - [CSSNamespaceRule interface: attribute namespaceURI] - expected: FAIL - - [CSSNamespaceRule interface: attribute prefix] - expected: FAIL - [CSSStyleDeclaration interface: operation setPropertyValue(DOMString,DOMString)] expected: FAIL @@ -189,12 +183,6 @@ [CSSRule interface: style_element.sheet.cssRules[2\].cssRules[0\] must inherit property "parentStyleSheet" with the proper type] expected: FAIL - [CSSNamespaceRule interface: style_element.sheet.cssRules[1\] must inherit property "namespaceURI" with the proper type] - expected: FAIL - - [CSSNamespaceRule interface: style_element.sheet.cssRules[1\] must inherit property "prefix" with the proper type] - expected: FAIL - [CSSRule interface: style_element.sheet.cssRules[1\] must inherit property "MARGIN_RULE" with the proper type] expected: FAIL