<?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>256754</bug_id>
          
          <creation_ts>2023-05-13 01:34:01 -0700</creation_ts>
          <short_desc>Align with &apos;UA&apos; Stylesheet for &apos;lists&apos; by changing &apos;1__qem&apos; to &apos;1em&apos; for `margin-block-start`</short_desc>
          <delta_ts>2023-05-22 15:09:37 -0700</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=253177</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=256760</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>ntim</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1955215</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-13 01:34:01 -0700</bug_when>
    <thetext>Hi Team,

While we are going to sync-up partial UA rules, based on Tim&apos;s suggestion, I am tackling this case separately since it would require further discussion.

HTML Spec: https://html.spec.whatwg.org/#lists

Current use of &apos;1__qem&apos;:

ol {
...
margin-block-start: 1__qem;
...
}

and

dl {
...
margin-block-start: 1__qem;
...
}

__________________

As per Web-Spec and aligning with &apos;Firefox&apos;, we have to use &apos;1em&apos;.

This was added by this commit in 2002 - https://github.com/WebKit/WebKit/commit/ad72cdff4371a3c296ab7a7e162620ebdc940325

__________________

Just wanted to raise this.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955217</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-13 01:39:23 -0700</bug_when>
    <thetext>Also:

ul, menu, dir {
...
margin-block-start: 1__qem;
...
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955250</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-13 11:43:02 -0700</bug_when>
    <thetext>(In reply to Ahmad Saleem from comment #1)
&gt; Also:
&gt; 
&gt; ul, menu, dir {
&gt; ...
&gt; margin-block-start: 1__qem;
&gt; ...
&gt; }

Also this bit:

ul, menu {
    counter-reset: list-item;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956702</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-05-20 01:34:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/109600780&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956834</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-05-21 21:30:44 -0700</bug_when>
    <thetext>tldr:
* safe to remove from html.css
* Quirk Unit code could be removed in another bug(?) Let&apos;s ask Alan?


Details:

Before making a decision on that, it would be good to check in the code.
I see in the code some specific usage for qem

* CSS_QUIRKY_EMS
  https://searchfox.org/wubkat/search?q=CSS_QUIRKY_EMS&amp;path=&amp;case=false&amp;regexp=false
* isQuirkyEms()
  https://searchfox.org/wubkat/search?q=isquirkyems&amp;path=&amp;case=false&amp;regexp=false

isQuirkyEms is not used at all in the code, apart its declaration. Probably can be removed. 

https://searchfox.org/wubkat/rev/622bd3bfe173b244d3cc68f2cb14ebbf987e14dd/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp#542-545

        case CSSUnitType::CSS_QUIRKY_EMS:
            if (parserMode != UASheetMode)
                return std::nullopt;
            FALLTHROUGH;
 
and other cases with no difference with the standard ems. 

but I&apos;m not even sure it has the impact it had in the past.
https://searchfox.org/wubkat/rev/622bd3bfe173b244d3cc68f2cb14ebbf987e14dd/Source/WebCore/css/CSSUnits.h#121-125

    // This value is used to handle quirky margins in reflow roots (body, td, and th) like WinIE.
    // The basic idea is that a stylesheet can use the value __qem (for quirky em) instead of em.
    // When the quirky value is used, if you&apos;re in quirks mode, the margin will collapse away
    // inside a table cell. This quirk is specified in the HTML spec but our impl is different.
    CSS_QUIRKY_EMS

https://bugs.webkit.org/show_bug.cgi?id=204101

Is the implementation handling it now directly?
https://searchfox.org/wubkat/rev/622bd3bfe173b244d3cc68f2cb14ebbf987e14dd/Source/WebCore/layout/formattingContexts/table/TableFormattingGeometry.cpp#46-62

when this was written?
https://searchfox.org/wubkat/commit/ab3b5a332211ad9e67239fe06dce4ec9f5d155b7

I wonder if all of this can be retired



Probably it would be safe to remove from the css. 
https://searchfox.org/wubkat/search?q=_qem&amp;path=&amp;case=false&amp;regexp=false

And there is a need for a followup bug on removing the QEM code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1957119</commentid>
    <comment_count>5</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-05-22 15:09:37 -0700</bug_when>
    <thetext>Ah wait, I&apos;m walking back my previous comment. 

I had missed this part 
https://searchfox.org/wubkat/rev/622bd3bfe173b244d3cc68f2cb14ebbf987e14dd/Source/WebCore/style/StyleBuilderConverter.h#233-237

which associates the qem to the quirk behavior.


    if (primitiveValue.isLength()) {
        Length length = primitiveValue.computeLength&lt;Length&gt;(conversionData);
        length.setHasQuirk(primitiveValue.primitiveType() == CSSUnitType::CSS_QUIRKY_EMS);
        return length;
    }

ok we should make a test and change the CSS to see what differences it creates for the tables.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>