Auto merge of #17431 - emilio:restyle-hints-xbl, r=emilio

style: Cleanup after #17427, and remove extra-optimistic optimization added in #17429.

This just addresses my review comments in #17427, and removes a wrong optimization I added in #17429 thinking it was correct.

<!-- 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/17431)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-20 08:13:05 -07:00 committed by GitHub
commit b50cf33efd
3 changed files with 5 additions and 4 deletions

View file

@ -1747,8 +1747,8 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
// If this element is the shadow root of an use-element shadow
// tree, according to the spec, we should not match rules
// cross the shadow DOM boundary.
e.get_local_name().as_ptr() == atom!("use").as_ptr() &&
e.get_namespace() == &*Namespace(atom!("http://www.w3.org/2000/svg"))
e.get_local_name() == &*local_name!("use") &&
e.get_namespace() == &*ns!("http://www.w3.org/2000/svg")
},
None => false,
}

View file

@ -13,7 +13,8 @@ use string_cache::{Atom, WeakAtom};
#[macro_export]
macro_rules! ns {
() => { $crate::string_cache::Namespace(atom!("")) }
() => { $crate::string_cache::Namespace(atom!("")) };
($s: tt) => { $crate::string_cache::Namespace(atom!($s)) };
}
/// A Gecko namespace is just a wrapped atom.

View file

@ -333,7 +333,7 @@ impl<'a, 'b: 'a, E> TreeStyleInvalidator<'a, 'b, E>
//
// Since we keep the traversal flags in terms of the flattened tree,
// we need to propagate it as appropriate.
if invalidated_child && child.parent_element() != Some(self.element) {
if invalidated_child {
let mut current = child.traversal_parent();
while let Some(parent) = current.take() {
if parent == self.element {