-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Consider changing specified behavior of <meta name=color-scheme> to match WebKit #7213
Comments
This seems fine to me, if impls are okay with it. It would mean moving the concept of the "browser default" color scheme here into HTML, to cover the case when meta color-scheme isn't specified. |
IIUC, the effect of this change (apart from computed values via CSSOM) is that the used value for the color-scheme would be different for:
I don't think that should be a back compat concern for Blink. Color-scheme override probably needs some spec clarifications. In the case where we have: <meta name="color-scheme" content="dark light"> All elements have color-scheme:normal as their computed values. And the spec says: "If the element does not support that color scheme, the user agent must also auto-adjust other colors into this chosen color scheme" If the computed value is |
Right, I agree we shouldn't auto-adjust in that case. Seems everyone is ok with such a change? That's awesome :) I can try to write PRs + tests then :) |
This allows HTML to "set" the used value of the color-scheme property, via a meta tag. Part of whatwg/html#7213 Closes w3c#6726
Depends on w3c/csswg-drafts#6731 Fixes whatwg#7213.
I wrote some PRs:
If everyone is on board (specially @lilles / @tabatkins since Blink would be the one changing behavior) I can file a crbug (and hopefully get these merged). |
This allows HTML to "set" the used value of the color-scheme property, via a meta tag. Part of whatwg/html#7213 Closes w3c#6726
Depends on w3c/csswg-drafts#6731 Fixes whatwg#7213.
Depends on w3c/csswg-drafts#6731 Fixes whatwg#7213.
This allows HTML to "set" the used value of the color-scheme property, via a meta tag. Part of whatwg/html#7213 Closes #6726
Closes #7213. See also w3c/csswg-drafts#6731.
Closes whatwg#7213. See also w3c/csswg-drafts#6731.
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452}
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452}
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452}
… schemes, a=testonly Automatic update from web-platform-tests Make color-scheme meta affect all normal schemes The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452} -- wpt-commits: 2ffd24a48587d98f03f7f33faa8875ec888035e0 wpt-pr: 33416
… schemes, a=testonly Automatic update from web-platform-tests Make color-scheme meta affect all normal schemes The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452} -- wpt-commits: 2ffd24a48587d98f03f7f33faa8875ec888035e0 wpt-pr: 33416
Closes whatwg#7213. See also w3c/csswg-drafts#6731.
The HTML specification changed to use the meta color-scheme as a page's supported color schemes instead of presentation style for the root element. This means the color-scheme meta no longer affects the computed for an initial value root element, but still affects the used color-scheme the same way as before. There is one used value change, and that is when resetting the color-scheme to "normal" down the tree, which now follows the meta element instead of resolving to a "light" color-scheme. We now align with Gecko and Safari. See the whatwg issue[1] for a discussion. [1] whatwg/html#7213 Bug: 1260617 Change-Id: Ic72a2dead75257650f8d99cc5f30f13b7005ea41 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3560051 Reviewed-by: Anders Hartvoll Ruud <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#987452} NOKEYCHECK=True GitOrigin-RevId: 0d60d42899d1eee9b1118700755bc85ae9376476
https://html.spec.whatwg.org/#meta-color-scheme says:
This does match what Chrome (Dev Edition at least) does, but doesn't match what Safari does, see test-case:
I think the Safari behavior (which AFAICT is basically "changing the used value of
color-scheme: normal
") is slightly preferable, for two reasons:initial
keyword (which computes tonormal
) to behave as an author would expect (reverting to the meta-specified color-scheme). With the current definition, once an element setscolor-scheme
explicitly, the<meta>
value is forever lost in that subtree.<meta name=color-scheme>
to affect stuff that doesn't inherit from the root element (like::backdrop
).The CSS spec is down, but the
normal
definition says right now:I propose to remove the parenthetical, and perhaps change "browser's default color scheme" by "page's default color scheme". Then HTML would set the "page's default color-scheme" based on the meta tag's value.
This matches, I believe, what WebKit is doing, and seems to be a simpler model for how it should work, IMO. What do you think?
cc @lilles @hober @smfr @dholbert
The text was updated successfully, but these errors were encountered: