diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-09-01 02:44:36 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-01 02:44:36 -0500 |
commit | 57b372ba3bfc8c1c99c541be8d68fac93deb41ca (patch) | |
tree | ff592f6087faf58823ea240ebe26de96cf00babe /components/script | |
parent | 78baf21c54c954e5ebdea23aff5aa62198709027 (diff) | |
parent | ccb4e958e591bd415e8517d26a6c42672000cbc7 (diff) | |
download | servo-57b372ba3bfc8c1c99c541be8d68fac93deb41ca.tar.gz servo-57b372ba3bfc8c1c99c541be8d68fac93deb41ca.zip |
Auto merge of #13110 - emilio:element-flags, r=SimonSapin
Fix incremental restyling under some circumstances due to our bogus use of ElementFlags.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
<!-- Either: -->
- [x] There are tests for these changes OR
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Depends on https://github.com/servo/rust-selectors/pull/98
<!-- 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/13110)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/Cargo.toml | 2 | ||||
-rw-r--r-- | components/script/dom/element.rs | 6 | ||||
-rw-r--r-- | components/script/dom/node.rs | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index b573f182547..3e8e216c986 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -61,7 +61,7 @@ regex = "0.1.43" rustc-serialize = "0.3" script_layout_interface = {path = "../script_layout_interface"} script_traits = {path = "../script_traits"} -selectors = {version = "0.12", features = ["heap_size"]} +selectors = {version = "0.13", features = ["heap_size"]} serde = "0.8" smallvec = "0.1" string_cache = {version = "0.2.26", features = ["heap_size", "unstable"]} diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index e0342ebc3a6..193fb16b937 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -70,7 +70,7 @@ use html5ever::serialize::SerializeOpts; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::tree_builder::{LimitedQuirks, NoQuirks, Quirks}; -use selectors::matching::{ElementFlags, matches}; +use selectors::matching::{ElementFlags, MatchingReason, matches}; use selectors::matching::{HAS_SLOW_SELECTOR, HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS}; use selectors::parser::{AttrSelector, NamespaceConstraint, parse_author_origin_selector_list_from_str}; use std::ascii::AsciiExt; @@ -2006,7 +2006,7 @@ impl ElementMethods for Element { match parse_author_origin_selector_list_from_str(&selectors) { Err(()) => Err(Error::Syntax), Ok(ref selectors) => { - Ok(matches(selectors, &Root::from_ref(self), None)) + Ok(matches(selectors, &Root::from_ref(self), None, MatchingReason::Other)) } } } @@ -2024,7 +2024,7 @@ impl ElementMethods for Element { let root = self.upcast::<Node>(); for element in root.inclusive_ancestors() { if let Some(element) = Root::downcast::<Element>(element) { - if matches(selectors, &element, None) { + if matches(selectors, &element, None, MatchingReason::Other) { return Ok(Some(element)); } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 49aa8242b34..555c7719fb1 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -63,7 +63,7 @@ use script_layout_interface::message::Msg; use script_layout_interface::{HTMLCanvasData, OpaqueStyleAndLayoutData}; use script_layout_interface::{LayoutNodeType, LayoutElementType, TrustedNodeAddress}; use script_traits::UntrustedNodeAddress; -use selectors::matching::matches; +use selectors::matching::{MatchingReason, matches}; use selectors::parser::Selector; use selectors::parser::parse_author_origin_selector_list_from_str; use std::borrow::ToOwned; @@ -319,7 +319,7 @@ impl<'a> Iterator for QuerySelectorIterator { // (instead of passing `None`)? Probably. self.iterator.by_ref().filter_map(|node| { if let Some(element) = Root::downcast(node) { - if matches(selectors, &element, None) { + if matches(selectors, &element, None, MatchingReason::Other) { return Some(Root::upcast(element)); } } @@ -711,7 +711,7 @@ impl Node { // Step 3. Ok(ref selectors) => { Ok(self.traverse_preorder().filter_map(Root::downcast).find(|element| { - matches(selectors, element, None) + matches(selectors, element, None, MatchingReason::Other) })) } } |