Auto merge of #18752 - emilio:cc-parent, r=bzbarsky

style: Use the flattened tree parent to find the closest non-nac ancestor of an element.

This only matters for document level NAC like canvas custom content, in which
case otherwise we inherit from the document element (which is wrong).

Bug: 1405635

<!-- 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/18752)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-10-05 05:49:06 -05:00 committed by GitHub
commit 35e84c5cdf

View file

@ -930,7 +930,7 @@ impl<'le> TElement for GeckoElement<'le> {
fn closest_non_native_anonymous_ancestor(&self) -> Option<Self> {
debug_assert!(self.is_native_anonymous());
let mut parent = match self.parent_element() {
let mut parent = match self.traversal_parent() {
Some(e) => e,
None => return None,
};
@ -940,7 +940,7 @@ impl<'le> TElement for GeckoElement<'le> {
return Some(parent);
}
parent = match parent.parent_element() {
parent = match parent.traversal_parent() {
Some(p) => p,
None => return None,
};