Auto merge of #7611 - nox:cache-element-id, r=frewsxcv

Cache the `id` attribute on Element

Thanks to @asabil for the original work, I only rebased it.

Fixes #6359 and #7040.


<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7611)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-09-20 09:23:20 -06:00
commit d1269294e6
6 changed files with 43 additions and 536 deletions

View file

@ -487,7 +487,7 @@ impl<'le> ::selectors::Element for LayoutElement<'le> {
#[inline]
fn get_id(&self) -> Option<Atom> {
unsafe {
(*self.element.unsafe_get()).get_attr_atom_for_layout(&ns!(""), &atom!("id"))
(*self.element.id_attribute()).clone()
}
}