Repository navigation
matching: Add a method to allow getting all the universal nodes from a SelectorMap - #81
Conversation
[WIP] style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
[WIP] style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
[WIP] style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
|
The name of Is this really what you want here? At the very least this needs a more detailed doc-comment that explains what "universal rule" means exactly. |
|
While you’re touching this code, please rename the |
|
@SimonSapin: Yep, you're right, updated the code to really match only universal rules, and did the rename you suggested. |
| let init_len = matching_rules_list.len(); | ||
|
|
||
| for rule in self.other_rules.iter() { | ||
| if rule.selector.simple_selectors.is_empty() { |
There was a problem hiding this comment.
Did you mean to include rules with selectors like #foo > *|*? If so, please change the doc-comment from "rules with selectors *|*" to "rules whose left-most compound selector (separated by combinators) is *|*". If not, this needs to check rule.selector.next.is_none() as well.
This is needed to support gecko anonymous-box pseudo-elements.
|
@bors-servo r+ |
|
📌 Commit 49be0d7 has been approved by |
matching: Add a method to allow getting all the universal nodes from a `SelectorMap` This is needed to support gecko anonymous-box-style pseudo-elements. r? @SimonSapin <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-selectors/81) <!-- Reviewable:end -->
|
☀️ Test successful - travis |
|
v0.5.4 is on crates.io. |
style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
style: Support anonymous box pseudo-elements This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like @bholley to take a look before following, do you think that the aproach is the correct? Also, @SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10815) <!-- Reviewable:end -->
…rom emilio:anonbox-gcs); r=SimonSapin,bholley This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like bholley to take a look before following, do you think that the aproach is the correct? Also, SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 Source-Repo: https://github.com/servo/servo Source-Revision: 407f991c8aba5dcf5312bb2c34a3dd4fe12e5471 UltraBlame original commit: be5d2d5fb6f1adcba0bccac5c9db2fd82ffaef12
…rom emilio:anonbox-gcs); r=SimonSapin,bholley This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like bholley to take a look before following, do you think that the aproach is the correct? Also, SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 Source-Repo: https://github.com/servo/servo Source-Revision: 407f991c8aba5dcf5312bb2c34a3dd4fe12e5471 UltraBlame original commit: be5d2d5fb6f1adcba0bccac5c9db2fd82ffaef12
…rom emilio:anonbox-gcs); r=SimonSapin,bholley This is a work-in-progress that: * Adds support for some pseudo-elements to skip the cascade entirely, in an analogous way to Gecko's anonymous box pseudo-elements. * Takes rid of `StylistWrapper`, and uses `Arc::get_mut` instead. * Uses the first bullet to precompute the `-servo-details-content` pseudo's style. I'd like bholley to take a look before following, do you think that the aproach is the correct? Also, SimonSapin could want to put some eyes on it. Depends on servo/rust-selectors#81 Source-Repo: https://github.com/servo/servo Source-Revision: 407f991c8aba5dcf5312bb2c34a3dd4fe12e5471 UltraBlame original commit: be5d2d5fb6f1adcba0bccac5c9db2fd82ffaef12
This is needed to support gecko anonymous-box-style pseudo-elements.
r? @SimonSapin
This change is