diff options
author | Gilles Leblanc <gilles.leblanc@gmail.com> | 2014-09-11 23:19:26 -0400 |
---|---|---|
committer | Gilles Leblanc <gilles.leblanc@gmail.com> | 2014-09-11 23:19:26 -0400 |
commit | 81a0d065f18e12487d840ccdf46f81644d18a352 (patch) | |
tree | 6a6880257be0c3ae0d1d53ab62b8672f3602aecf /components/script/dom/attr.rs | |
parent | a18633b163ab81a726efee75309814868c15260f (diff) | |
download | servo-81a0d065f18e12487d840ccdf46f81644d18a352.tar.gz servo-81a0d065f18e12487d840ccdf46f81644d18a352.zip |
Make use of the list of Atoms in ClassSelector
Make use of the list of Atoms in the class attribute selector
(ClassSelector) in selector_matching.
Fixes #3111
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r-- | components/script/dom/attr.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 02945088bbb..4da59b96b55 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -188,6 +188,7 @@ impl<'a> AttrHelpers for JSRef<'a, Attr> { pub trait AttrHelpersForLayout { unsafe fn value_ref_forever(&self) -> &'static str; unsafe fn value_atom_forever(&self) -> Option<Atom>; + unsafe fn value_tokens_forever(&self) -> Option<Items<Atom>>; unsafe fn local_name_atom_forever(&self) -> Atom; } @@ -207,6 +208,15 @@ impl AttrHelpersForLayout for Attr { } } + unsafe fn value_tokens_forever(&self) -> Option<Items<Atom>> { + // cast to point to T in RefCell<T> directly + let value = mem::transmute::<&RefCell<AttrValue>, &AttrValue>(self.value.deref()); + match *value { + TokenListAttrValue(_, ref tokens) => Some(tokens.iter()), + _ => None, + } + } + unsafe fn local_name_atom_forever(&self) -> Atom { self.local_name.clone() } |