<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>268481</bug_id>
          
          <creation_ts>2024-01-31 10:26:40 -0800</creation_ts>
          <short_desc>Add `::first-line` UA stylesheet rules similar to `::placeholder`</short_desc>
          <delta_ts>2024-02-07 10:27:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=245523</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>koivisto</cc>
    
    <cc>ntim</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2009393</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-01-31 10:26:40 -0800</bug_when>
    <thetext>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

&quot;User agents may apply other properties as well except for the following excluded properties:

writing-mode
direction
text-orientation&quot;

__

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&amp;label=experimental&amp;aligned&amp;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&apos;t have CSS2 directory imported, so if I have to do this change, it would be without test case.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2009414</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-01-31 11:05:25 -0800</bug_when>
    <thetext>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&amp;label=experimental&amp;aligned=&amp;q=first-line</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010106</commentid>
    <comment_count>2</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2024-02-02 08:28:39 -0800</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2010119</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-02-02 09:07:50 -0800</bug_when>
    <thetext>(In reply to Antti Koivisto from comment #2)
&gt; That sort of rule on UA stylesheet would likely regress performance as we
&gt; would need to compute ::first-line pseudo-element for every element. I think
&gt; the correct approach is to prevent these properties from being applied in
&gt; 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. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2011444</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-02-07 10:27:23 -0800</bug_when>
    <thetext>&lt;rdar://problem/122479591&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>