<?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>245156</bug_id>
          
          <creation_ts>2022-09-13 12:54:18 -0700</creation_ts>
          <short_desc>Align &quot;UA&quot; stylesheet for &quot;hr&quot;, &quot;fieldset&quot;, &quot;marquee&quot;, &quot;details&quot; etc. with HTML Spec</short_desc>
          <delta_ts>2022-12-27 18:14:56 -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>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=157323</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=245160</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=245159</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=245174</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=172801</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</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>karlcow</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1898312</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-13 12:54:18 -0700</bug_when>
    <thetext>Hi Team,

I was going through &quot;html.css&quot; UA stylesheet and noticed following:

1) marquee element is missing &quot;text-align: initial&quot;.

https://html.spec.whatwg.org/#the-marquee-element-2

2) hr element is missing &quot;overflow: hidden&quot;.

https://html.spec.whatwg.org/#the-hr-element-2

3) fieldset element needs to change to &quot;min-inline-size: min-content;&quot; from &quot;min-width: min-content;&quot;

https://html.spec.whatwg.org/#the-fieldset-and-legend-elements

4) details and summary elements to be aligned:

https://html.spec.whatwg.org/#the-details-and-summary-elements

Also bring change of Chrome / Blink, which is also in Firefox / Gecko about:

details &gt; summary:first-of-type {
    display: list-item;
    counter-increment: list-item 0;
    list-style: disclosure-closed inside;
}

_____

I will try to do Pull Request and see if it works without any breakage. If it would be too complex, I would leave it for others to do.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898377</commentid>
    <comment_count>1</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-09-13 18:10:43 -0700</bug_when>
    <thetext>For reference

=================================
WebKit
https://searchfox.org/wubkat/source/Source/WebCore/css/html.css

marquee {
    display: inline-block;
}

hr {
    display: block;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: auto;
    margin-inline-end: auto;
    border-style: inset;
    border-width: 1px;
}

fieldset {
    display: block;
    margin-inline-start: 2px;
    margin-inline-end: 2px;
    padding-block-start: 0.35em;
    padding-inline-start: 0.75em;
    padding-inline-end: 0.75em;
    padding-block-end: 0.625em;
    border: 2px groove ThreeDFace;
    min-width: min-content;
}


=================================
Blink
https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/core/html/resources/html.css

marquee {
    display: inline-block;
    width: -webkit-fill-available;
}

hr {
    display: block;
    overflow: hidden;
    unicode-bidi: isolate;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: auto;
    margin-inline-end: auto;
    border-style: inset;
    border-width: 1px
}

fieldset {
    display: block;
    margin-inline-start: 2px;
    margin-inline-end: 2px;
    padding-block-start: 0.35em;
    padding-inline-start: 0.75em;
    padding-inline-end: 0.75em;
    padding-block-end: 0.625em;
    border: 2px groove #C0C0C0;
    min-inline-size: min-content;
}


=================================
Gecko 
https://searchfox.org/mozilla-central/source/layout/style/res/html.css

marquee {
  inline-size: -moz-available;
  display: inline-block;
  vertical-align: text-bottom;
  text-align: start;
}

marquee:is([direction=&quot;up&quot;], [direction=&quot;down&quot;]) {
  block-size: 200px;
}

/* &lt;hr&gt; noshade and color attributes are handled completely by
 * HTMLHRElement::MapAttributesIntoRule.
 * https://html.spec.whatwg.org/#the-hr-element-2
 */
hr {
  color: gray;
  border-width: 1px;
  border-style: inset;
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  margin-inline-start: auto;
  margin-inline-end: auto;
  overflow: hidden;

  /* FIXME: This is not really per spec */
  display: block;
}

hr[size=&quot;1&quot;] {
  border-style: solid none none none;
}


For details and summary it will be slightly complex, because there are specific behaviors associated to this. See Bug 157323

I have the feeling that would be probably addressing each of them separately instead of one single PR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898434</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-14 04:43:28 -0700</bug_when>
    <thetext>(In reply to Karl Dubost from comment #1)
&gt; For reference
&gt; 
&gt; =================================
&gt; WebKit
&gt; https://searchfox.org/wubkat/source/Source/WebCore/css/html.css
&gt; 
&gt; marquee {
&gt;     display: inline-block;
&gt; }
&gt; 
&gt; hr {
&gt;     display: block;
&gt;     margin-block-start: 0.5em;
&gt;     margin-block-end: 0.5em;
&gt;     margin-inline-start: auto;
&gt;     margin-inline-end: auto;
&gt;     border-style: inset;
&gt;     border-width: 1px;
&gt; }
&gt; 
&gt; fieldset {
&gt;     display: block;
&gt;     margin-inline-start: 2px;
&gt;     margin-inline-end: 2px;
&gt;     padding-block-start: 0.35em;
&gt;     padding-inline-start: 0.75em;
&gt;     padding-inline-end: 0.75em;
&gt;     padding-block-end: 0.625em;
&gt;     border: 2px groove ThreeDFace;
&gt;     min-width: min-content;
&gt; }
&gt; 
&gt; 
&gt; =================================
&gt; Blink
&gt; https://github.com/chromium/chromium/blob/main/third_party/blink/renderer/
&gt; core/html/resources/html.css
&gt; 
&gt; marquee {
&gt;     display: inline-block;
&gt;     width: -webkit-fill-available;
&gt; }
&gt; 
&gt; hr {
&gt;     display: block;
&gt;     overflow: hidden;
&gt;     unicode-bidi: isolate;
&gt;     margin-block-start: 0.5em;
&gt;     margin-block-end: 0.5em;
&gt;     margin-inline-start: auto;
&gt;     margin-inline-end: auto;
&gt;     border-style: inset;
&gt;     border-width: 1px
&gt; }
&gt; 
&gt; fieldset {
&gt;     display: block;
&gt;     margin-inline-start: 2px;
&gt;     margin-inline-end: 2px;
&gt;     padding-block-start: 0.35em;
&gt;     padding-inline-start: 0.75em;
&gt;     padding-inline-end: 0.75em;
&gt;     padding-block-end: 0.625em;
&gt;     border: 2px groove #C0C0C0;
&gt;     min-inline-size: min-content;
&gt; }
&gt; 
&gt; 
&gt; =================================
&gt; Gecko 
&gt; https://searchfox.org/mozilla-central/source/layout/style/res/html.css
&gt; 
&gt; marquee {
&gt;   inline-size: -moz-available;
&gt;   display: inline-block;
&gt;   vertical-align: text-bottom;
&gt;   text-align: start;
&gt; }
&gt; 
&gt; marquee:is([direction=&quot;up&quot;], [direction=&quot;down&quot;]) {
&gt;   block-size: 200px;
&gt; }
&gt; 
&gt; /* &lt;hr&gt; noshade and color attributes are handled completely by
&gt;  * HTMLHRElement::MapAttributesIntoRule.
&gt;  * https://html.spec.whatwg.org/#the-hr-element-2
&gt;  */
&gt; hr {
&gt;   color: gray;
&gt;   border-width: 1px;
&gt;   border-style: inset;
&gt;   margin-block-start: 0.5em;
&gt;   margin-block-end: 0.5em;
&gt;   margin-inline-start: auto;
&gt;   margin-inline-end: auto;
&gt;   overflow: hidden;
&gt; 
&gt;   /* FIXME: This is not really per spec */
&gt;   display: block;
&gt; }
&gt; 
&gt; hr[size=&quot;1&quot;] {
&gt;   border-style: solid none none none;
&gt; }
&gt; 
&gt; 
&gt; For details and summary it will be slightly complex, because there are
&gt; specific behaviors associated to this. See Bug 157323
&gt; 
&gt; I have the feeling that would be probably addressing each of them separately
&gt; instead of one single PR.

Yes - I have already created separate bugs for &quot;fieldset&quot; and &quot;marquee&quot;, will ignore &quot;details and summary&quot; for now but will try to do &quot;hr&quot; but I noticed that there were a lot of failures let&apos;s see.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898602</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-14 17:38:59 -0700</bug_when>
    <thetext>I tried to land this in one go but failed so I did split patches:

PR of failed attempt for reference: https://github.com/WebKit/WebKit/pull/4327

I am able to do changes for &apos;fieldset&apos; and &apos;marquee&apos; - please refer to &apos;See Also&apos; section.

___

Learning:

&apos;hr&apos; element change is troublesome because it leads to &quot;render&quot; layer being added and had to re baseline 200+ tests.

Although rebaselining is not the difficult part:

-&gt; on &apos;win&apos; bot, it leads to change in outline color being changed from &apos;blue&apos; to &apos;black&apos; and I don&apos;t know how to fix it.
-&gt; on some WPT test cases in &apos;SELECTION&apos;, we start to fail them and they time out.

Although it leads to some passes as well.

___

For Details &amp; Summary - I will try to land them in separate during this week without &apos;list-item&apos; to see at least, it works for remaining cases.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1899915</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-09-20 12:55:22 -0700</bug_when>
    <thetext>&lt;rdar://problem/100185628&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922045</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2022-12-27 18:12:04 -0800</bug_when>
    <thetext>Ahmad,

&gt; &apos;hr&apos; element change is troublesome because it leads to &quot;render&quot; layer being added and had to re baseline 200+ tests.

the HR patch has been landed.
https://github.com/WebKit/WebKit/pull/4724</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1922046</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-12-27 18:12:57 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #5)
&gt; Ahmad,
&gt; 
&gt; &gt; &apos;hr&apos; element change is troublesome because it leads to &quot;render&quot; layer being added and had to re baseline 200+ tests.
&gt; 
&gt; the HR patch has been landed.
&gt; https://github.com/WebKit/WebKit/pull/4724

Yes - I think we can close this bug since now pretty much everything is done here except details, which is dependent on bug 157323.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>