mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove get_attrs from TElement.
This should just be a helper.
This commit is contained in:
parent
a0c425fbef
commit
7947afc699
3 changed files with 7 additions and 15 deletions
|
@ -392,13 +392,6 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
||||||
(*self.element.unsafe_get()).get_attr_val_for_layout(namespace, name)
|
(*self.element.unsafe_get()).get_attr_val_for_layout(namespace, name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn get_attrs(&self, name: &Atom) -> Vec<&str> {
|
|
||||||
unsafe {
|
|
||||||
(*self.element.unsafe_get()).get_attr_vals_for_layout(name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -561,7 +554,10 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
|
||||||
self.get_attr(ns, name).map_or(false, |attr| test(attr))
|
self.get_attr(ns, name).map_or(false, |attr| test(attr))
|
||||||
},
|
},
|
||||||
NamespaceConstraint::Any => {
|
NamespaceConstraint::Any => {
|
||||||
self.get_attrs(name).iter().any(|attr| test(*attr))
|
let attrs = unsafe {
|
||||||
|
(*self.element.unsafe_get()).get_attr_vals_for_layout(name)
|
||||||
|
};
|
||||||
|
attrs.iter().any(|attr| test(*attr))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,6 @@ pub trait TElement : Sized + Copy + Clone + ElementExt + PresentationalHintsSynt
|
||||||
fn get_state(&self) -> ElementState;
|
fn get_state(&self) -> ElementState;
|
||||||
|
|
||||||
fn get_attr<'a>(&'a self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
|
fn get_attr<'a>(&'a self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
|
||||||
fn get_attrs<'a>(&'a self, attr: &Atom) -> Vec<&'a str>;
|
|
||||||
|
|
||||||
/// Properly marks nodes as dirty in response to restyle hints.
|
/// Properly marks nodes as dirty in response to restyle hints.
|
||||||
fn note_restyle_hint(&self, mut hint: RestyleHint) {
|
fn note_restyle_hint(&self, mut hint: RestyleHint) {
|
||||||
|
|
|
@ -369,11 +369,6 @@ impl<'le> TElement for GeckoElement<'le> {
|
||||||
reinterpret_string(ptr, length)
|
reinterpret_string(ptr, length)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn get_attrs<'a>(&'a self, _name: &Atom) -> Vec<&'a str> {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'le> PresentationalHintsSynthetizer for GeckoElement<'le> {
|
impl<'le> PresentationalHintsSynthetizer for GeckoElement<'le> {
|
||||||
|
@ -519,7 +514,9 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
||||||
self.get_attr(ns, name).map_or(false, |attr| test(attr))
|
self.get_attr(ns, name).map_or(false, |attr| test(attr))
|
||||||
},
|
},
|
||||||
NamespaceConstraint::Any => {
|
NamespaceConstraint::Any => {
|
||||||
self.get_attrs(name).iter().any(|attr| test(*attr))
|
// We should probably pass the atom into gecko and let it match
|
||||||
|
// against attributes across namespaces.
|
||||||
|
unimplemented!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue