Page MenuHomePhabricator

Bug 1995268 - Make StylesheetContents more obviously immutable. r=nicoburns,oriol,#style
ClosedPublic

Authored by emilio on Oct 20 2025, 12:20 PM.
Referenced Files
Unknown Object (File)
Thu, Apr 9, 5:07 AM
Unknown Object (File)
Wed, Apr 1, 4:03 PM
Unknown Object (File)
Wed, Apr 1, 2:15 PM
Unknown Object (File)
Wed, Apr 1, 12:34 PM
Unknown Object (File)
Wed, Apr 1, 11:34 AM
Unknown Object (File)
Wed, Apr 1, 5:31 AM
Unknown Object (File)
Thu, Mar 26, 10:21 AM
Unknown Object (File)
Jan 29 2026, 9:32 PM
Subscribers

Details

Summary

I want to update the UrlExtraData of the stylesheet contents when
cloning for uniqueness.

This removes an API that servo uses but that's easily replaceable, see:
https://github.com/servo/servo/pull/40024

Diff Detail

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.
servo/components/style/stylesheets/stylesheet.rs
476

This comment was already obsolete, but can be removed while you are at it.

This revision is now accepted and ready to land.Oct 20 2025, 12:36 PM

This change makes sense to me. Removing the RwLocks is nice. The only bit I didn't understand was this comment:

I want to update the UrlExtraData of the stylesheet contents when cloning for uniqueness.

Does this mean "I only want to update UrlExtraData when/by cloning (and not by mutating)?" (copy-on-write semantics)
As written, it makes it sounds to me like you are adding a mutation to UrlExtraData where there wasn't previously one.

This change makes sense to me. Removing the RwLocks is nice. The only bit I didn't understand was this comment:

I want to update the UrlExtraData of the stylesheet contents when cloning for uniqueness.

Does this mean "I only want to update UrlExtraData when/by cloning (and not by mutating)?" (copy-on-write semantics)
As written, it makes it sounds to me like you are adding a mutation to UrlExtraData where there wasn't previously one.

Yeah, to fix bug 1994008 I want for the StylesheetContents copy-on-write to pull the "right" base URI directly.