:first-letter doesn't work as expected with :before
Reported by
ryu...@gmail.com,
Sep 15 2016
|
|||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Example URL: https://jsfiddle.net/8f5v60uj/1/ Steps to reproduce the problem: 1. style p:first-letter {color: red} 2. add p:before { content: '#'} What is the expected behavior? First-letter "#" should be red. What went wrong? "#" seems to not be a "letter" for chrome Does it occur on multiple sites: N/A Is it a problem with a plugin? No Did this work before? N/A Does this work in other browsers? Yes Chrome version: 52.0.2743.116 Channel: n/a OS Version: OS X 10.11.4 Flash Version: Shockwave Flash 22.0 r0
,
Sep 16 2016
Mac->All +Blink>CSS
,
Sep 19 2016
Screenshots attached for Firefox and Chrome. Adding Hotlist-Interop since this is clearly an interop bug. Marking as available for anyone who wants to pick this up.
,
Jan 12 2017
While I agree this is an interop bug, none of the major engines seem to agree on the expected behavior, as can be seen on the screenshots: - Blink still shows the first "#l" and all ">"s in red. - EdgeHTML shows all the "#l"s and all ">"s in red. - Gecko shows the first "#l" in red, all the other "#"s in red and does not change the color of any ">"s. - WebKit shows the first "#l" in red, all other "#"s in red and all ">"s in red. Surprisingly, according to the relevant specs all the behaviors above seem to be acceptable: - https://drafts.csswg.org/css-pseudo-4/#generated-content says "the generated content of ::before and :after pseudo-elements may be included in any ::first-line and ::first-letter pseudo-elements applied to its originating element" ("may", not "must"). - https://drafts.csswg.org/css-pseudo-4/#first-letter-pseudo says "If the characters that would form the ::first-letter are not in the same element, such as ‘T in <p>‘<em>T..., the user agent may create a ::first-letter pseudo-element from one of the elements, both elements, or simply not create a pseudo-element". ">" is part of the "Math_Symbol" category in Unicode, so it's neither punctuation nor a typographical letter, so it could be argued that it should not have its color changed to red at all (though the spec is not very explicit in stating what to do when the first typographical letter unit is preceded by characters that are not punctuation). I wonder if the spec needs an update or if everything is just working as intended.
,
Feb 13 2017
,
Oct 31 2017
Attached a screenshot of how this looks now on Chrome 62.0.3202.62 (linux) and firefox Adding Standards label since the correct behaviour seems ambiguous.
,
Dec 6 2017
,
Dec 6
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Dec 7
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by borissch...@gmail.com
, Sep 15 2016