mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add attr_equals to TElement.
Same reasons as the previous patch.
This commit is contained in:
parent
96af00fbb9
commit
364c8e2976
4 changed files with 26 additions and 16 deletions
|
@ -391,6 +391,11 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
|||
self.get_attr(namespace, attr).is_some()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn attr_equals(&self, namespace: &Namespace, attr: &Atom, val: &Atom) -> bool {
|
||||
self.get_attr(namespace, attr).map_or(false, |x| x == val)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attr(&self, namespace: &Namespace, name: &Atom) -> Option<&str> {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue