Auto merge of #14581 - bholley:dont_traverse_xbl, r=heycam

stylo: Avoid traversing children of XBL-bound elements during initial styling

Corresponding Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1294572

CC @heycam @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14581)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-14 19:41:12 -08:00 committed by GitHub
commit 535563be31
6 changed files with 73 additions and 14 deletions

View file

@ -131,7 +131,7 @@ fn traverse_subtree(element: GeckoElement, raw_data: RawServoStyleSetBorrowed,
// When new content is inserted in a display:none subtree, we will call into
// servo to try to style it. Detect that here and bail out.
if let Some(parent) = element.parent_element() {
if parent.get_data().is_none() || parent.is_display_none() {
if parent.borrow_data().map_or(true, |d| d.styles().is_display_none()) {
debug!("{:?} has unstyled parent - ignoring call to traverse_subtree", parent);
return;
}