Bug 1326514 - Implement the CSSOM bits for CSSNamespaceRule. r?bz
MozReview-Commit-ID: 5UpvH4osOfn
--- a/dom/webidl/CSSNamespaceRule.webidl
+++ b/dom/webidl/CSSNamespaceRule.webidl
@@ -4,13 +4,11 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://drafts.csswg.org/cssom/#cssnamespacerule
*/
// https://drafts.csswg.org/cssom/#cssnamespacerule
interface CSSNamespaceRule : CSSRule {
- // Not implemented yet. <See
- // https://bugzilla.mozilla.org/show_bug.cgi?id=1326514>.
- // readonly attribute DOMString namespaceURI;
- // readonly attribute DOMString prefix;
+ readonly attribute DOMString namespaceURI;
+ readonly attribute DOMString prefix;
};
--- a/layout/style/CSSNamespaceRule.h
+++ b/layout/style/CSSNamespaceRule.h
@@ -31,16 +31,22 @@ public:
virtual nsAtom* GetPrefix() const = 0;
virtual void GetURLSpec(nsString& aURLSpec) const = 0;
// WebIDL interfaces
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;
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) final {
return CSSNamespaceRuleBinding::Wrap(aCx, this, aGivenProto);
}
};
deleted file mode 100644
--- 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
-
--- a/testing/web-platform/meta/css/cssom/interfaces.html.ini
+++ b/testing/web-platform/meta/css/cssom/interfaces.html.ini
@@ -70,22 +70,16 @@
expected: FAIL
[CSSMarginRule interface: attribute name]
expected: FAIL
[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
[CSSStyleDeclaration interface: operation setPropertyPriority(DOMString,DOMString)]
expected: FAIL
[CSSStyleDeclaration interface: attribute cssFloat]
expected: FAIL
@@ -184,22 +178,16 @@
expected: FAIL
[CSSRule interface: style_element.sheet.cssRules[2\].cssRules[0\] must inherit property "parentRule" with the proper type]
expected: FAIL
[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
[CSSStyleDeclaration interface: operation setPropertyValue(CSSOMString, CSSOMString)]
expected: FAIL
[CSSStyleDeclaration interface: operation setPropertyPriority(CSSOMString, CSSOMString)]
expected: FAIL