Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

matching: Add a method to allow getting all the universal nodes from a SelectorMap - #81

Merged
bors-servo merged 3 commits into
servo:masterfrom
emilio:get-all-rules
Apr 26, 2016
Merged

bors-servo merged 3 commits into
servo:masterfrom
emilio:get-all-rules

Conversation

@emilio

@emilio emilio commented Apr 23, 2016

Copy link
Copy Markdown
Member

This is needed to support gecko anonymous-box-style pseudo-elements.

r? @SimonSapin


This change is Reviewable

bors-servo pushed a commit to servo/servo that referenced this pull request Apr 24, 2016
[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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Apr 24, 2016
[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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Apr 24, 2016
[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 -->
@SimonSapin

Copy link
Copy Markdown
Member

The name of SelectorMap::universal_rules is misleading. It is not rules whose selector is *|*. It is rules not in other hashmaps, those whose left-most compound selector (separated by combinators) does not contain an ID, class, or type simple selector. For example, #foo > :first-child is in there.

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.

@SimonSapin

Copy link
Copy Markdown
Member

While you’re touching this code, please rename the SelectorMap::universal_rules struct field to other_rules to make it less misleading.

@emilio

emilio commented Apr 26, 2016

Copy link
Copy Markdown
Member Author

@SimonSapin: Yep, you're right, updated the code to really match only universal rules, and did the rename you suggested.

Comment thread src/matching.rs Outdated
let init_len = matching_rules_list.len();

for rule in self.other_rules.iter() {
if rule.selector.simple_selectors.is_empty() {

@SimonSapin SimonSapin Apr 26, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also added a test

emilio added 2 commits April 26, 2016 15:32
This is needed to support gecko anonymous-box pseudo-elements.
@SimonSapin

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown

📌 Commit 49be0d7 has been approved by SimonSapin

@bors-servo

Copy link
Copy Markdown

⌛ Testing commit 49be0d7 with merge 7472da5...

bors-servo pushed a commit that referenced this pull request Apr 26, 2016
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 -->
@bors-servo

Copy link
Copy Markdown

☀️ Test successful - travis

@bors-servo
bors-servo merged commit 49be0d7 into servo:master Apr 26, 2016
@SimonSapin

Copy link
Copy Markdown
Member

v0.5.4 is on crates.io.

bors-servo pushed a commit to servo/servo that referenced this pull request Apr 27, 2016
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Apr 29, 2016
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 -->
bors-servo pushed a commit to servo/servo that referenced this pull request Apr 29, 2016
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 -->
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants