mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Add CSSNamespaceRule.{namespaceURI, prefix}
This commit is contained in:
parent
64442090ba
commit
8108fc465a
3 changed files with 18 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding;
|
||||
use dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding::CSSNamespaceRuleMethods;
|
||||
use dom::bindings::js::Root;
|
||||
use dom::bindings::reflector::reflect_dom_object;
|
||||
use dom::bindings::str::DOMString;
|
||||
|
@ -38,6 +39,20 @@ impl CSSNamespaceRule {
|
|||
}
|
||||
}
|
||||
|
||||
impl CSSNamespaceRuleMethods for CSSNamespaceRule {
|
||||
// https://drafts.csswg.org/cssom/#dom-cssnamespacerule-prefix
|
||||
fn Prefix(&self) -> DOMString {
|
||||
self.namespacerule.read().prefix
|
||||
.as_ref().map(|s| s.to_string().into())
|
||||
.unwrap_or(DOMString::new())
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-cssnamespacerule-namespaceuri
|
||||
fn NamespaceURI(&self) -> DOMString {
|
||||
(*self.namespacerule.read().url).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl SpecificCSSRule for CSSNamespaceRule {
|
||||
fn ty(&self) -> u16 {
|
||||
use dom::bindings::codegen::Bindings::CSSRuleBinding::CSSRuleConstants;
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
// https://drafts.csswg.org/cssom/#the-cssnamespacerule-interface
|
||||
[Exposed=Window]
|
||||
interface CSSNamespaceRule : CSSRule {
|
||||
// readonly attribute DOMString namespaceURI;
|
||||
// readonly attribute DOMString prefix;
|
||||
readonly attribute DOMString namespaceURI;
|
||||
readonly attribute DOMString prefix;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue