Closed Bug 1407813 Opened 3 years ago Closed 3 years ago

Stylo: Visited cascade for reparenting should limit to visited properties

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox56 --- disabled
firefox57 --- wontfix
firefox58 --- fixed

People

(Reporter: jryans, Assigned: jryans)

Details

Attachments

(1 file)

The specialized cascade flow in `stylist::compute_style_with_inputs` (used with reparenting) currently computes all properties for visited styles, but we should only need visited-dependent properties.

We already limit this for the main cascade flow, so I'll apply the same thing here.
Comment on attachment 8917616 [details]
Bug 1407813 - Limit visited cascade for reparenting.

https://reviewboard.mozilla.org/r/188566/#review193816

r=me. Fwiw I don't think affects correctness (otherwise I'd ask for a test), in the sense of "I don't think we ever read from those for other properties anyway". But it's definitely worth for consistency.

::: servo/components/style/stylist.rs:930
(Diff revision 1)
>                  Some(inherited_style),
>                  Some(inherited_style_ignoring_first_line),
>                  Some(layout_parent_style_for_visited),
>                  None,
>                  font_metrics,
> -                cascade_flags,
> +                visited_cascade_flags,

Just `cascade_flags | VISITED_DEPENDENT_ONLY` here?
Attachment #8917616 - Flags: review?(emilio) → review+
Comment on attachment 8917616 [details]
Bug 1407813 - Limit visited cascade for reparenting.

https://reviewboard.mozilla.org/r/188566/#review193816

Right, we don't read from the other props from visited style, so this just helps us skip some work we don't need to do.

> Just `cascade_flags | VISITED_DEPENDENT_ONLY` here?

Ah, thanks!
https://hg.mozilla.org/integration/autoland/rev/f26e4a8b210def93bd27914be13f0f777fd79092

Since it's a small perf tweak, I don't see a need to uplift this at the moment.  If we discover it actually has a big impact, then it's at least quite a small change.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.