diff options
author | Ali Sabil <ali.sabil@gmail.com> | 2015-08-07 12:33:06 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-09-13 23:55:40 +0200 |
commit | 2e9d8a76d15d478b90fffb235ace1293ed329231 (patch) | |
tree | f5defe61b193b74651f801b663eb8d3d8ef3a749 /components/script/dom/element.rs | |
parent | ea655ada10cca75423dc5380ee26779e09c26883 (diff) | |
download | servo-2e9d8a76d15d478b90fffb235ace1293ed329231.tar.gz servo-2e9d8a76d15d478b90fffb235ace1293ed329231.zip |
Use cached element ID in LayoutElement::get_id
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 0ca9c3c3f90..bedce2ed975 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -494,6 +494,7 @@ pub trait LayoutElementHelpers { unsafe fn html_element_in_html_document_for_layout(&self) -> bool; #[allow(unsafe_code)] unsafe fn has_attr_for_layout(&self, namespace: &Namespace, name: &Atom) -> bool; + fn id_attribute(&self) -> *const Option<Atom>; fn style_attribute(&self) -> *const Option<PropertyDeclarationBlock>; fn local_name(&self) -> &Atom; fn namespace(&self) -> &Namespace; @@ -518,6 +519,13 @@ impl LayoutElementHelpers for LayoutJS<Element> { } #[allow(unsafe_code)] + fn id_attribute(&self) -> *const Option<Atom> { + unsafe { + (*self.unsafe_get()).id_attribute.borrow_for_layout() + } + } + + #[allow(unsafe_code)] fn style_attribute(&self) -> *const Option<PropertyDeclarationBlock> { unsafe { (*self.unsafe_get()).style_attribute.borrow_for_layout() |