Bug 1326514 - Implement the CSSOM bits for CSSNamespaceRule. r=bz
authorXidorn Quan <me@upsuper.org>
Thu, 21 Dec 2017 12:17:37 +1100
changeset 397126 cd981f26866c3eb5953ee43a504d58ec3b6605d6
parent 397080 06a19fbe2581a81e6908b4810f8aa302f1516145
child 397127 73d7cbc68383e859a039873298a4990a11b460df
push id33127
push useraiakab@mozilla.com
push dateThu, 21 Dec 2017 22:17:05 +0000
treeherdermozilla-central@d20967c26da5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1326514
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1326514 - Implement the CSSOM bits for CSSNamespaceRule. r=bz MozReview-Commit-ID: 5UpvH4osOfn
dom/webidl/CSSNamespaceRule.webidl
layout/style/CSSNamespaceRule.h
testing/web-platform/meta/css/cssom/CSSNamespaceRule.html.ini
testing/web-platform/meta/css/cssom/interfaces.html.ini
--- 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