Repository navigation
style: Support anonymous box pseudo-elements - #10815
Conversation
|
Heads up! This PR modifies the following files:
|
|
Nice! A few random questions after a very brief and incomplete look at this:
|
|
Sorry for the extra comment, but Github ate the quotes on my previous one, and doesn't want to show them again.
Nothing,
Yes, in fact I changed them (see the
Agreed, but we can't do anything else other than passing around the The cool part is that with this change we can pass over more common data Now I think more about it, iff layout workers are per-document (which That'd reduce the overhead from one Arc clone per node to one clone per If you think this can't land without it, let me know and I'll make one |
That said I’m completely guessing, you’d have to benchmark it to be sure. |
|
Yeah, I think @bholley's concern is more memory-related (one extra pointer per node), but I feel the same here, I'd rather focus on be correct and later speed things up if required. |
5ca03f7 to
1b499bd
Compare
|
@bholley: I dind't have thought about inheritance, which Gecko relies a ton on. Just added a few patches to add support for it. |
|
Yeah, I was worried about memory rather than clone overhead. We have memory tests that complain whenever Node gets bigger. The memory reporters don't see into PrivateStyleData so the test doesn't notice, but this does grow Node by one pointer. In general I think passing some sort of general context from the caller is the right thing to do. Is it just annoying to pass, or does it also require parameterizing a bunch of stuff? It seems like having a SharedStyleContext available at most points in the cascade is probably worthwhile. I'm fine for it to be done in a followup though if it adds too much churn in this PR. I'd like to avoid relying on TLS too much if possible, since some of the thread invariants may change (i.e. we will probably end up sharing threads between documents at some point). |
8d7b70c to
92e75e6
Compare
|
@bholley: Added a bunch of changes that take rid of the extra field, take a look. Also, building stylo I get a crash in a I'll take a look at it later if I have the time, but it's trivial to implement I made a few changes to pseudo-elements, so I'm going to do a try run: @bors-servo: try |
[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 -->
|
💔 Test failed - mac-dev-unit |
|
@bors-servo: try It seems that the toml |
|
⌛ Trying commit 92d684d with merge 7b08d0d... |
[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 -->
|
💔 Test failed - linux-rel |
|
Moved to a gist to not overload the thread. |
This was causing panics in stylo.
correct origin to StyleSheet::from_raw
|
@bors-servo: r=SimonSapin,bholley |
|
📌 Commit 15a32fa has been approved by |
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 -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
style: Add infrastructure to support lazy pseudo-elements This builds on top of #10815, so it's really just the last commit the one that should be reviewed. I tried to apply the new infrastructure to servo, but failed (for now?). The problem with it is that it'd require `ThreadSafeLayoutElement` to implement `selectors::Element`, which is a lot of work and might be racy (not totally sure about it though). Thus, I prefered to keep selectors eager until knowing that it's safe to do it. r? @mbrubeck for style changes, @bholley for the geckolib changes (minimal for now, glue + a list of lazy PEs must be added) <!-- 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/10934) <!-- Reviewable:end -->
style: Add infrastructure to support lazy pseudo-elements This builds on top of #10815, so it's really just the last commit the one that should be reviewed. I tried to apply the new infrastructure to servo, but failed (for now?). The problem with it is that it'd require `ThreadSafeLayoutElement` to implement `selectors::Element`, which is a lot of work and might be racy (not totally sure about it though). Thus, I prefered to keep selectors eager until knowing that it's safe to do it. r? @mbrubeck for style changes, @bholley for the geckolib changes (minimal for now, glue + a list of lazy PEs must be added) <!-- 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/10934) <!-- Reviewable:end -->
This is a work-in-progress that:
StylistWrapper, and usesArc::get_mutinstead.-servo-details-contentpseudo'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
This change is