<?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>243940</bug_id>
          
          <creation_ts>2022-08-15 09:32:41 -0700</creation_ts>
          <short_desc>REGRESSION(252825@main): wpt /css/CSS2/visudet/inline-block-baseline-011.xht &amp; inline-block-baseline-014.xht</short_desc>
          <delta_ts>2025-11-01 16:00:40 -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>Layout and Rendering</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=243197</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=209735</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=261212</see_also>
          <bug_file_loc>http://wpt.live/css/CSS2/visudet/inline-block-baseline-011.xht</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="Sam Sneddon [:gsnedders]">gsnedders</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</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>1891348</commentid>
    <comment_count>0</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-08-15 09:32:41 -0700</bug_when>
    <thetext>wpt.fyi: https://wpt.fyi/results/css/CSS2/visudet?label=master&amp;label=experimental&amp;product=safari-150%20preview&amp;product=safari-151%20preview&amp;view=subtest&amp;q=is%3Adifferent</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891349</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-15 09:33:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/98673438&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891566</commentid>
    <comment_count>2</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2022-08-15 20:33:05 -0700</bug_when>
    <thetext>This is about integral based alignment vs. non-integral based box model values
e.g:
vertical-align: -0.5px; -&gt; turns into 0px
margin-bottom: 0.5px; -&gt; stays at 0.5px

these tests trigger this mismatch through the combination of &apos;font-size: 15px&apos; and &apos;align/margin -&gt; 0.5em&apos;.

Legacy line layout is historically integral based, while IFC is not, currently it is forced to match legacy behavior through explicit flooring/ceiling of certain values.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891669</commentid>
    <comment_count>3</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2022-08-16 08:32:05 -0700</bug_when>
    <thetext>This is actually broken (and probably has been broken forever) with legacy line layout and now IFC just matches this broken behavior. :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891679</commentid>
    <comment_count>4</comment_count>
    <who name="alan">zalan</who>
    <bug_when>2022-08-16 09:11:49 -0700</bug_when>
    <thetext>Not forcing integral rounding fixes the issue (see below). So while 252825@main looks like the regression point, it never worked in IFC either, it was just covered by the directional rounding bug -which got corrected in 252825@main.
The actual cause of this bug is the explicit rounding we need to do in IFC to match legacy line layout behavior.

diff --git a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h b/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
index 0ac8876b9a15..16420dd6b53c 100644
--- a/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
+++ b/Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
@@ -123,11 +123,11 @@ private:
 
     // FIXME: Remove legacy rounding.
     void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); }
-    void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(roundToInt(logicalHeight)); }
-    void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop &gt;= 0 ? roundToInt(logicalTop) : -roundToInt(-logicalTop)); }
-    void setAscent(InlineLayoutUnit ascent) { m_ascent = roundToInt(ascent); }
-    void setDescent(InlineLayoutUnit descent) { m_descent = roundToInt(descent); }
-    void setLayoutBounds(const LayoutBounds&amp; layoutBounds) { m_layoutBounds = { InlineLayoutUnit(roundToInt(layoutBounds.ascent)), InlineLayoutUnit(roundToInt(layoutBounds.descent)) }; }
+    void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); }
+    void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop); }
+    void setAscent(InlineLayoutUnit ascent) { m_ascent = ascent; }
+    void setDescent(InlineLayoutUnit descent) { m_descent = descent; }
+    void setLayoutBounds(const LayoutBounds&amp; layoutBounds) { m_layoutBounds = { InlineLayoutUnit(layoutBounds.ascent), InlineLayoutUnit(layoutBounds.descent) }; }
 
     void setIsFirstBox() { m_isFirstWithinLayoutBox = true; }
     void setIsLastBox() { m_isLastWithinLayoutBox = true; }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2155760</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-11-01 16:00:40 -0700</bug_when>
    <thetext>We are passing these tests - https://wpt.fyi/results/css/CSS2/visudet?label=master&amp;label=experimental&amp;aligned&amp;q=inline-block-baseline-01

Since April 2025. So marking this as `RESOLVED Configuration Changed`.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>