Closed
Bug 1399011
Opened 7 years ago
Closed 7 years ago
stylo: Swap RestyleFlags for ElementDataFlags and eliminate RestyleData
Categories
(Core :: CSS Parsing and Computation, enhancement, P4)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
Details
Attachments
(2 files)
24.17 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
34.79 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
Right now the only flags in ElementData live in RestyleData. This means we need to abuse abstractions a bit in order to have non-restyle-related flags, because adding another byte anywhere else within ElementData will cause it to grow.
Unfortunately, just moving the flags outside of RestyleData still causes ElementData to grow, presumably because the size of RestyleData gets rounded up. Given that the structure is just conceptual at this point and doesn't have any special heap-allocation semantics, it's easiest to just get rid of it.
Assignee | ||
Comment 1•7 years ago
|
||
MozReview-Commit-ID: 8emE83lykh3
Assignee | ||
Comment 2•7 years ago
|
||
Without this change, the previous commit increases the size of ElementData.
MozReview-Commit-ID: 87BZuXINiT9
Assignee | ||
Updated•7 years ago
|
Attachment #8906911 -
Flags: review?(emilio)
Assignee | ||
Updated•7 years ago
|
Attachment #8906912 -
Flags: review?(emilio)
Assignee | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment on attachment 8906911 [details] [diff] [review]
Part 1 - Hoist flags out of RestyleData. v1
Review of attachment 8906911 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, with that bit addressed.
::: servo/components/style/matching.rs
@@ +605,5 @@
> cascade_requirement = cmp::max(
> cascade_requirement,
> self.accumulate_damage_for(
> context.shared,
> + data.skip_applying_damage(),
Why not just passing `data` down? I'd actually prefer to keep the check as it was, since it seemed more obvious it was a Gecko-only optimization.
@@ +706,5 @@
> shared_context: &SharedStyleContext,
> restyle: &mut RestyleData,
> old_values: Option<&ComputedValues>,
> new_values: &ComputedValues,
> + pseudo: Option<&PseudoElement>,
I think this is dead code?
I'll remove it in https://github.com/servo/servo/pull/18456, that way you can just pass data down.
Attachment #8906911 -
Flags: review?(emilio) → review+
Comment 5•7 years ago
|
||
Comment on attachment 8906912 [details] [diff] [review]
Part 2 - Eliminate RestyleData entirely. v1
Review of attachment 8906912 [details] [diff] [review]:
-----------------------------------------------------------------
Not super-happy, but shrug.
::: servo/components/style/matching.rs
@@ +628,5 @@
> (&Some(ref old), &Some(ref new)) => {
> self.accumulate_damage_for(
> context.shared,
> data.skip_applying_damage(),
> + &mut data.damage,
ditto, you can just pass `data` here I think.
Well, maybe not since it may be borrowed up... That kinda sucks, but ok, I guess it's fine to do this skip_applying_damage() method.
Attachment #8906912 -
Flags: review?(emilio) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
status-firefox57:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•