NEW 268481
Add `::first-line` UA stylesheet rules similar to `::placeholder`
https://bugs.webkit.org/show_bug.cgi?id=268481
Summary Add `::first-line` UA stylesheet rules similar to `::placeholder`
Ahmad Saleem
Reported 2024-01-31 10:26:40 PST
Hi Team, In bug 244982 (254416@main), I added UA stylesheet rules for ::placeholder as per web-spec that it states that similar rules of ::first-line applies to ::placeholder but I never added them for ::first-line: Web-Spec: https://drafts.csswg.org/css-pseudo-4/#first-line-styling "User agents may apply other properties as well except for the following excluded properties: writing-mode direction text-orientation" __ So if I add following in html.css: ::first-line { direction: inherit !important; text-orientation: inherit !important; writing-mode: inherit !important; } __ We progress two WPT tests: https://wpt.fyi/results/css/CSS2/selectors?label=master&label=experimental&aligned&q=first-line-inherit%20safari%3Afail __ Just wanted to raise to get input whether it is right way to go ahead and do it. NOTE - We don't have CSS2 directory imported, so if I have to do this change, it would be without test case. Thanks!
Attachments
Ahmad Saleem
Comment 1 2024-01-31 11:05:25 PST
Note - if I expand this like: ::first-line { direction: inherit !important; text-orientation: inherit !important; writing-mode: inherit !important; transform: none !important; word-break: normal !important; border: none !important; border-image: none !important; border-radius: 0 !important; transition: all !important; margin: 0 !important; padding: 0 !important; position: static !important; } __ I also progress all except two tests in : https://wpt.fyi/results/css/css-pseudo/first-line-allowed-properties.html?label=master&label=experimental&aligned=&q=first-line
Antti Koivisto
Comment 2 2024-02-02 08:28:39 PST
That sort of rule on UA stylesheet would likely regress performance as we would need to compute ::first-line pseudo-element for every element. I think the correct approach is to prevent these properties from being applied in the C++ level (see PropertyAllowList.h/.cpp) for a possible strategy.
Ahmad Saleem
Comment 3 2024-02-02 09:07:50 PST
(In reply to Antti Koivisto from comment #2) > That sort of rule on UA stylesheet would likely regress performance as we > would need to compute ::first-line pseudo-element for every element. I think > the correct approach is to prevent these properties from being applied in > the C++ level (see PropertyAllowList.h/.cpp) for a possible strategy. Thanks! I can try and see how far I progress. But never tried that part of area. :-)
Radar WebKit Bug Importer
Comment 4 2024-02-07 10:27:23 PST
Note You need to log in before you can comment on or make changes to this bug.