stylo: Store the prescontext on the rule tree and stop storing it on ServoStyleContext

RESOLVED WONTFIX

Status

()

Core
CSS Parsing and Computation
RESOLVED WONTFIX
7 months ago
7 months ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 months ago
Once we do the dependent bugs, we can save a word on the combined ServoStyleContext/ServoComputedValues by adding a PresContext pointer on the root rule node and pointer-chasing to it in the PresContext() accessor (like Gecko does).
(Assignee)

Comment 1

7 months ago
(On dep fixed - when we do fused objects we can do this).
(Assignee)

Updated

7 months ago
Assignee: nobody → bobbyholley
(Assignee)

Updated

7 months ago
No longer depends on: 1367904
(Assignee)

Comment 2

7 months ago
So I just wrote a patch for this, because I wanted to use the non-existence of a prescontext to indicate rule tree teardown, and figured out would knock this bug out while I was at it.

However, we just discussed it and realized there are a couple of downsides:
* We can't have Option<RuleNode> on the ComputedValues, and would have to use the root (which is extra refcount traffic, and complexity to pass to all the right places).
* The extra indirection may actually cost us in terms of performance, since nsIFrame::PresContext() (which is used all over layout) pointer-chases via the StyleContext.

So I'm going to torpedo this patch and just use a bit to indicate teardown. I'll post the patch here for posterity.
(Assignee)

Comment 3

7 months ago
Created attachment 8882476 [details] [diff] [review]
Store the PresContext on the rule tree. v1
(Assignee)

Updated

7 months ago
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.