Return the element rather than styles from the style sharing cache.

This gives us more flexibility, and doesn't cost us anything.

MozReview-Commit-ID: CuvOEcLA3My
This commit is contained in:
Bobby Holley 2017-09-12 16:42:04 -07:00
parent 729db5ccec
commit 9092e6b4c2
2 changed files with 7 additions and 7 deletions

View file

@ -655,9 +655,10 @@ where
// Now that our bloom filter is set up, try the style sharing
// cache.
match target.share_style_if_possible(context) {
Some(styles) => {
Some(shareable_element) => {
context.thread_local.statistics.styles_shared += 1;
styles
let shareable_data = shareable_element.borrow_data().unwrap();
shareable_data.styles.clone()
}
None => {
context.thread_local.statistics.elements_matched += 1;