RESOLVED DUPLICATE of bug 193171 158782
`all: unset` prevents `color` from being set
https://bugs.webkit.org/show_bug.cgi?id=158782
Summary `all: unset` prevents `color` from being set
Joey Hoer
Reported 2016-06-15 06:29:15 PDT
Created attachment 281356 [details] Example of broken `color` with `all: unset` When `all: unset` is defined, the color value is set to black and cannot be changed with future CSS color declarations. This works in Chrome.
Attachments
Example of broken `color` with `all: unset` (291 bytes, text/html)
2016-06-15 06:29 PDT, Joey Hoer
no flags
Patch (4.91 KB, patch)
2020-03-19 12:50 PDT, Alexey Shvayka
koivisto: review-
koivisto: commit-queue-
Jake Archibald
Comment 1 2018-10-11 03:39:47 PDT
I just ran into this issue too. Another demo: https://jsbin.com/noselib/edit?css,output
Rob Brackett
Comment 2 2018-11-30 17:24:20 PST
I’m also running into this in an HTML diffing tool I work on — we use some CSS like: ins.our-special-differ, del.our-special-differ { all: unset; } to make sure there are no conflicting styles on <ins>/<del> elements, and then use a script to adjust the text colors in order to make sure they have enough contrast with the green/red backgrounds of the insertions and deletions. We can't adjust the text color on Safari with this bug, though.
Simon Fraser (smfr)
Comment 3 2019-01-05 11:26:46 PST
This is happening because the "all: unset" is setting -webkit-text-fill-color to black, and that overrides color.
Simon Fraser (smfr)
Comment 4 2019-01-05 11:34:25 PST
... and our initial value for -webkit-text-fill-color isn't 'current color', as it should be if it followed fill-color.
Simon Fraser (smfr)
Comment 5 2019-01-05 11:34:38 PST
^ 'currentcolor'
Simon Fraser (smfr)
Comment 6 2019-01-05 11:49:20 PST
I guess this is really about how 'currentColor' inherits. The initial value of -webkit-text-fill-color on the root element is 'currentColor', and "all:unset" on the body should thefefore set -webkit-text-fill-color to "inherit" which should inherit currentColor as the keyword, rather than the resolved color value (according to the new currentColor inheritance rules in https://drafts.csswg.org/css-color/#resolving-color-values).
Gustavo Millasaky
Comment 7 2019-03-06 04:05:34 PST
Blink had this issue before too, as described in it's bug tacker: https://bugs.chromium.org/p/chromium/issues/detail?id=420781 I don't see any reason why this cannot be patched.
Radar WebKit Bug Importer
Comment 8 2019-05-04 07:59:39 PDT
Joonghun Park
Comment 9 2019-06-10 19:08:13 PDT
(In reply to Gustavo Millasaky from comment #7) > Blink had this issue before too, as described in it's bug tacker: > https://bugs.chromium.org/p/chromium/issues/detail?id=420781 > > I don't see any reason why this cannot be patched. https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-text-fill-color says, "The -webkit-text-fill-color CSS property specifies the fill color of characters of text. If this property is not set, the value of the color property is used." In case of Blink, they drop the support for -webkit-text-fill-color. But WebKit still maintain the support for the css property, so as long as WebKit keep the support this behavior will be maintained as it is currently. The decision whether to keep this property or not should be discussed in WebKit community through this jira comments or via webkit-dev mailing list I think. If community want to keep this property in WebKit then we could resolve this issue as wontfix, otherwise we could drop the support for -webkit-text-fill-color for interoperability I guess.
Joonghun Park
Comment 10 2019-06-10 19:25:43 PDT
I saw the blocking issue for this one, and as Simon commented, if currentcolor works as keyword then this issue can be resolved. So it seems that dropping -webkit-text-fill-color is nothing to do with this issue. I will take the blocking issue to solve this one.
Joonghun Park
Comment 11 2019-06-10 19:42:57 PDT
To be clear, Blink still support -webkit-text-fill-color.
Alexey Shvayka
Comment 12 2020-03-19 12:50:25 PDT
Simon Fraser (smfr)
Comment 13 2020-03-19 20:06:13 PDT
Comment on attachment 394006 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=394006&action=review > Source/WebCore/css/CSSProperties.json:6315 > + "no-default-color": true What's the justification for using this for -webkit-text-fill-color, but not, say, -webkit-text-stroke-color, -webkit-text-emphasis-color, text-decoration-color etc?
Joonghun Park
Comment 14 2020-03-19 20:41:17 PDT
(In reply to Alexey Shvayka from comment #12) > Created attachment 394006 [details] > Patch Hi, Alexey, I think the root cause is 'currentcolor', as Simon said in comment #6. I'm currently working on https://bugs.webkit.org/show_bug.cgi?id=107380, and as soon as it is done I will work on https://bugs.webkit.org/show_bug.cgi?id=193171, which is the bug for 'currentcolor'. So I think it could be good to see this issue's state after having the 'currentcolor' behavior follow the spec in comment #6.
Antoine Quint
Comment 15 2020-04-01 07:46:05 PDT
*** Bug 209854 has been marked as a duplicate of this bug. ***
Antti Koivisto
Comment 16 2020-04-03 04:29:24 PDT
Comment on attachment 394006 [details] Patch The right fix here is make 'currentcolor' work correctly.
Antti Koivisto
Comment 17 2020-04-04 00:21:45 PDT
*** This bug has been marked as a duplicate of bug 193171 ***
Note You need to log in before you can comment on or make changes to this bug.