Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-pseudo-4] Add discussion of properties from the originating element #9428

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

schenney-chromium
Copy link
Contributor

Spec issue: #7591

Per resolution, properties not allowed on highlights but otherwise required to resolve units or modify colors are instead taken from the originating element.

Spec issue: w3c#7591

Per resolution, properties not allowed on highlights but otherwise required to resolve units or modify colors are instead taken from the originating element.
@schenney-chromium schenney-chromium marked this pull request as ready for review September 30, 2023 16:34
@schenney-chromium
Copy link
Contributor Author

Ping!

@fantasai
Copy link
Collaborator

fantasai commented Dec 1, 2023

Alright, question I'm not entirely clear on: what is the result of getComputedStyle() for font-size and border-width on the highlight pseudo given:

p { font-size: 20px; border-width: 10px; }
p::selection { font-size: 30px; border-width: 20px; }

?

@schenney-chromium
Copy link
Contributor Author

schenney-chromium commented Jan 4, 2024

Alright, question I'm not entirely clear on: what is the result of getComputedStyle() for font-size and border-width on the highlight pseudo given:

p { font-size: 20px; border-width: 10px; }
p::selection { font-size: 30px; border-width: 20px; }

?

Sorry I missed this way back. In any event. getComputedStyle in Chrome reports the originating element's font size because the font size in the selection pseudo is never applied and the font size is set from the originating element always.

<style> p { font-size: 20px; border-width: 10px; border-style: solid; border-color: green;} p::selection { font-size: 30px; border-width: 20px; border-style: solid; border-color: green;} </style>

Hello world

getComputedStyle(x, ":selection").fontSize

20px

The border properties are defaults, e.g. borderTopWidth > 0px.

The CSS working group resolved that custom property values should come from the originating element, and here I update the spec.
@schenney-chromium
Copy link
Contributor Author

I'd like to finally land this. I added the update for the custom property resolution.

@fantasai
Copy link
Collaborator

I think this text needs tweaking, since the language is a bit imprecise; but I think it'll be easier to tweak after merging so accepting it as-is for now.

@fantasai fantasai merged commit 1dcf54e into w3c:main Oct 15, 2024
1 check passed
fantasai added a commit that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants