Nothing Special   »   [go: up one dir, main page]

Page MenuHomePhabricator

Bug 1886441: Part 1 - Introduce scope proximity in cascade ordering. r=#style
ClosedPublic

Authored by dshin on Apr 17 2024, 7:19 PM.
Referenced Files
Unknown Object (File)
Tue, Oct 15, 10:30 PM
Unknown Object (File)
Tue, Oct 15, 10:30 PM
Unknown Object (File)
Thu, Oct 10, 7:30 AM
Unknown Object (File)
Thu, Oct 10, 7:30 AM
Unknown Object (File)
Thu, Sep 26, 11:54 AM
Unknown Object (File)
Thu, Sep 26, 11:54 AM
Unknown Object (File)
May 31 2024, 11:21 AM
Subscribers

Details

Summary

Uses the u32 hole left in ApplicableDeclarationBlock.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
emilio requested changes to this revision.Apr 18 2024, 2:38 AM

Just a couple minor questions, but looks good. I have some perf concerns that would be good to address, since in the past keeping ApplicableDeclarationBlock small was key for performance.

It feels like this could use the 8 bits remaining of source_order unless I'm missing something. How big do we expect the scope proximity to get realistically? In any case I'd rather start limited and expand it than having to limit it in the future.

servo/components/style/applicable_declarations.rs
151

Or just `other.0.cmp(&self.0)?

228

Hmm, we've gone quite out of our way to avoid growing this, and this was important for performance. Have you run this through stylebench?

Also, do we need the whole 32 bits in any case? Can we stash it in the remaining 8 bits of source_order? At the very least we should probably add a limit on it, we don't support DOM trees that deep). Maybe 8 or 16 bits is enough.

servo/components/style/stylist.rs
2834

I'm confused, precomputed pseudo-elements are UA only. we can just assert that we're not on a scope rule of any sort, right? Just like we assert the layer id and origin.

This revision now requires changes to proceed.Apr 18 2024, 2:38 AM

Oh, though you're right right now this doesn't grow ApplicableDeclarationBlock in 64-bit builds...

Can we:

  • Add an assert of the size of ApplicableDeclarationBlock so we notice if we grow it.
  • Consider limiting it regardless, to keep some bits for the next fancy CSS feature?
servo/components/style/applicable_declarations.rs
228

Yeah, ok. u32 is unrealistically big.
Is this the limit you're referring to?
Seems like purely from the layout side, we can clamp down to u16 but not u8.

dshin requested review of this revision.Apr 19 2024, 6:11 PM
dshin updated this revision to Diff 851577.
dshin marked 2 inline comments as done.

Have the entirety of the stack perftested here

servo/components/style/applicable_declarations.rs
277

Here we have the assert for ApplicableDeclarationBlock.

servo/components/style/stylist.rs
2834

Yep - added in D207780

This revision is now accepted and ready to land.Apr 23 2024, 4:25 PM