Skip to content

Update Stylo to "Always borrow applicable declarations" - #64006

Open
servo-wpt-sync wants to merge 1 commit into
web-platform-tests:masterfrom
servo:servo_export_48031
Open

servo-wpt-sync wants to merge 1 commit into
web-platform-tests:masterfrom
servo:servo_export_48031

Conversation

@servo-wpt-sync

@servo-wpt-sync servo-wpt-sync commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Mainly, the problem is that the change upstream changed ApplicableDeclarationBlock to contain a StyleSourceBorrow instead of a StyleSource. And this impacts synthesize_presentational_hints_for_legacy_attributes(), since it uses ApplicableDeclarationBlock.

This requires refactoring the computation of presentational hints to something closer to Gecko: instead of producing them on the fly during style resolution, we now compute them beforehand, and cache them.

Caching them directly on Element would have increased its size. So again I used an approach similar to Gecko: the AttributeStorage will now use a HeaderSlice instead of a Vec. This way we can store the presentational hints in the header. In fact, this approach reduces the size of Element.

Testing: No behavior change, but adding a new test that would have crashed with a previous iteration of this patch. Unit tests check ensure that Element is now smaller.

Stylo PR: servo/stylo#461

Reviewed in servo/servo#48031

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync
servo-wpt-sync force-pushed the servo_export_48031 branch 2 times, most recently from 4a7d915 to b9daf75 Compare October 26, 2026 14:34
@servo-wpt-sync
servo-wpt-sync force-pushed the servo_export_48031 branch 6 times, most recently from 32eead3 to dd2db26 Compare November 4, 2026 22:57
This requires refactoring the computation of presentational hints
to something closer to Gecko.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants