Bug 243940
Summary: | REGRESSION(252825@main): wpt /css/CSS2/visudet/inline-block-baseline-011.xht & inline-block-baseline-014.xht | ||
---|---|---|---|
Product: | WebKit | Reporter: | Sam Sneddon [:gsnedders] <gsnedders> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, bfulgham, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar, WPTImpact |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://wpt.live/css/CSS2/visudet/inline-block-baseline-011.xht | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=243197 https://bugs.webkit.org/show_bug.cgi?id=209735 https://bugs.webkit.org/show_bug.cgi?id=261212 |
Sam Sneddon [:gsnedders]
wpt.fyi: https://wpt.fyi/results/css/CSS2/visudet?label=master&label=experimental&product=safari-150%20preview&product=safari-151%20preview&view=subtest&q=is%3Adifferent
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/98673438>
alan baradlay
This is about integral based alignment vs. non-integral based box model values
e.g:
vertical-align: -0.5px; -> turns into 0px
margin-bottom: 0.5px; -> stays at 0.5px
these tests trigger this mismatch through the combination of 'font-size: 15px' and 'align/margin -> 0.5em'.
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.
alan baradlay
This is actually broken (and probably has been broken forever) with legacy line layout and now IFC just matches this broken behavior. :(
alan baradlay
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 >= 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& 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& layoutBounds) { m_layoutBounds = { InlineLayoutUnit(layoutBounds.ascent), InlineLayoutUnit(layoutBounds.descent) }; }
void setIsFirstBox() { m_isFirstWithinLayoutBox = true; }
void setIsLastBox() { m_isLastWithinLayoutBox = true; }