mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Add has_attr method to TElement.
If this is all the information the caller needs, we can get it from gecko without worrying about atomization and string conversions.
This commit is contained in:
parent
7947afc699
commit
96af00fbb9
4 changed files with 20 additions and 4 deletions
|
@ -386,6 +386,11 @@ impl<'le> TElement for ServoLayoutElement<'le> {
|
|||
self.element.get_state_for_layout()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn has_attr(&self, namespace: &Namespace, attr: &Atom) -> bool {
|
||||
self.get_attr(namespace, attr).is_some()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attr(&self, namespace: &Namespace, name: &Atom) -> Option<&str> {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue