mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Make get_attr() take a &Namespace rather than Option<~str>
This commit is contained in:
parent
624e2714d4
commit
fdafc3701f
5 changed files with 24 additions and 16 deletions
|
@ -152,13 +152,14 @@ impl Element {
|
|||
}).map(|&x| x)
|
||||
}
|
||||
|
||||
pub unsafe fn get_attr_val_for_layout(&self, namespace: Namespace, name: &str)
|
||||
#[inline]
|
||||
pub unsafe fn get_attr_val_for_layout(&self, namespace: &Namespace, name: &str)
|
||||
-> Option<&'static str> {
|
||||
self.attrs.iter().find(|attr: & &@mut Attr| {
|
||||
// unsafely avoid a borrow because this is accessed by many tasks
|
||||
// during parallel layout
|
||||
let attr: ***Box<Attr> = cast::transmute(attr);
|
||||
name == (***attr).data.local_name && (***attr).data.namespace == namespace
|
||||
name == (***attr).data.local_name && (***attr).data.namespace == *namespace
|
||||
}).map(|attr| {
|
||||
let attr: **Box<Attr> = cast::transmute(attr);
|
||||
cast::transmute((**attr).data.value.as_slice())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue