Bug 158782 - `all: unset` prevents `color` from being set
Summary: `all: unset` prevents `color` from being set
Status: RESOLVED DUPLICATE of bug 193171
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 9
Hardware: Unspecified All
: P2 Normal
Assignee: Joonghun Park
URL:
Keywords: BrowserCompat, InRadar
: 209854 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-06-15 06:29 PDT by Joey Hoer
Modified: 2020-04-04 00:21 PDT (History)
19 users (show)

See Also:


Attachments
Example of broken `color` with `all: unset` (291 bytes, text/html)
2016-06-15 06:29 PDT, Joey Hoer
no flags Details
Patch (4.91 KB, patch)
2020-03-19 12:50 PDT, Alexey Shvayka
koivisto: review-
koivisto: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joey Hoer 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.
Comment 1 Jake Archibald 2018-10-11 03:39:47 PDT
I just ran into this issue too. Another demo: https://jsbin.com/noselib/edit?css,output
Comment 2 Rob Brackett 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.
Comment 3 Simon Fraser (smfr) 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.
Comment 4 Simon Fraser (smfr) 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.
Comment 5 Simon Fraser (smfr) 2019-01-05 11:34:38 PST
^ 'currentcolor'
Comment 6 Simon Fraser (smfr) 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).
Comment 7 Gustavo Millasaky 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.
Comment 8 Radar WebKit Bug Importer 2019-05-04 07:59:39 PDT
<rdar://problem/50471104>
Comment 9 Joonghun Park 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.
Comment 10 Joonghun Park 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.
Comment 11 Joonghun Park 2019-06-10 19:42:57 PDT
To be clear, Blink still support -webkit-text-fill-color.
Comment 12 Alexey Shvayka 2020-03-19 12:50:25 PDT
Created attachment 394006 [details]
Patch
Comment 13 Simon Fraser (smfr) 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?
Comment 14 Joonghun Park 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.
Comment 15 Antoine Quint 2020-04-01 07:46:05 PDT
*** Bug 209854 has been marked as a duplicate of this bug. ***
Comment 16 Antti Koivisto 2020-04-03 04:29:24 PDT
Comment on attachment 394006 [details]
Patch

The right fix here is make 'currentcolor' work correctly.
Comment 17 Antti Koivisto 2020-04-04 00:21:45 PDT

*** This bug has been marked as a duplicate of bug 193171 ***