Bug 268481
Summary: | Add `::first-line` UA stylesheet rules similar to `::placeholder` | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
Component: | CSS | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | koivisto, ntim, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar, WPTImpact |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=245523 |
Ahmad Saleem
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
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
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
(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
<rdar://problem/122479591>