Open
Bug 1394271
Opened 7 years ago
Updated 2 years ago
stylo: check matching rules before cascading eager pseudos
Categories
(Core :: CSS Parsing and Computation, enhancement, P4)
Core
CSS Parsing and Computation
Tracking
()
People
(Reporter: heycam, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
In bug 1385154 we avoid storing any ComputedValues generated for ::before and ::after if it didn't result in any effective generated content. It would be nice to do this check after matching and before producing the ComputedValues, to avoid a lot of churn.
Reporter | ||
Comment 1•7 years ago
|
||
Comment hidden (mozreview-request) |
Reporter | ||
Updated•7 years ago
|
Assignee: nobody → cam
Status: NEW → ASSIGNED
Priority: -- → P1
Reporter | ||
Comment 3•7 years ago
|
||
Hmm, that's very orange...
Comment hidden (mozreview-request) |
Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8901633 [details]
Bug 1394271 - style: Don't produce ComputedValues for ::before/::after just to throw them away.
https://reviewboard.mozilla.org/r/173036/#review178444
Per IRC chat I think I'd like to make sure this actually improves things (doing that now), but this otherwise looks good.
::: servo/components/style/rule_tree/mod.rs:1286
(Diff revision 2)
> + /// `content: none` or `content: normal`.
> + pub fn has_effective_generated_content_declarations(
> + &self,
> + guards: &StylesheetGuards,
> + ) -> bool {
> + use properties::longhands::display::SpecifiedValue as Display;
nit: I believe everywhere else we use `display` (lowercased) and `content`.
::: servo/components/style/rule_tree/mod.rs:1298
(Diff revision 2)
> + let style_source = node.style_source();
> + if matches!(*style_source, StyleSource::None) {
> + continue;
> + }
> +
> + for &(ref decl, importance) in node.style_source()
nit: You have a `style_source` variable in scope already.
::: servo/components/style/rule_tree/mod.rs:1310
(Diff revision 2)
> + if !found_display {
> + if let PropertyDeclaration::Display(display) = *decl {
> + if display == Display::none {
> + return false;
> + }
> + if found_content {
nit: maybe this would be easier to reason about (and shorter) with
```
if found_display && found_content {
return true;
}
```
below the two `if`s. wdyt?
::: servo/components/style/style_resolver.rs:115
(Diff revision 2)
> + if !pseudo.is_before_or_after() {
> + return false;
> + }
> +
> + if let Some(visited_rules) = visited_rules {
> + if visited_rules.has_effective_generated_content_declarations(guards) {
I don't think we need to check visited rules, since we only probe the non-visited style to determine whether to generate a pseudo.
Attachment #8901633 -
Flags: review?(emilio) → review+
Comment 7•7 years ago
|
||
Given that we're already tracking the high-level memory issue in bug 1289864, I think we probably don't need to track all the sub-bugs as P1.
Priority: P1 → P4
Updated•7 years ago
|
status-firefox55:
--- → wontfix
status-firefox56:
--- → wontfix
status-firefox57:
--- → affected
status-firefox-esr52:
--- → wontfix
Comment 8•7 years ago
|
||
status-firefox57=wontfix unless someone thinks this bug should block 57
Reporter | ||
Updated•4 years ago
|
Assignee: cam → nobody
Status: ASSIGNED → NEW
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•