Title: [268815] trunk/Source/WebCore
- Revision
- 268815
- Author
- [email protected]
- Date
- 2020-10-21 12:19:36 -0700 (Wed, 21 Oct 2020)
Log Message
[LFC][Integration] Ascent and descent are rounded to integral position
https://bugs.webkit.org/show_bug.cgi?id=218036
Reviewed by Antti Koivisto.
In this patch, we round ascent/descent vertical position values to integral to match legacy behavior.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
* layout/inlineformatting/InlineLineBox.cpp:
(WebCore::Layout::LineBox::InlineLevelBox::setBaseline):
(WebCore::Layout::LineBox::InlineLevelBox::setDescent):
(WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds):
* layout/inlineformatting/InlineLineBox.h:
(WebCore::Layout::LineBox::InlineLevelBox::setBaseline): Deleted.
(WebCore::Layout::LineBox::InlineLevelBox::setDescent): Deleted.
(WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (268814 => 268815)
--- trunk/Source/WebCore/ChangeLog 2020-10-21 19:14:42 UTC (rev 268814)
+++ trunk/Source/WebCore/ChangeLog 2020-10-21 19:19:36 UTC (rev 268815)
@@ -1,3 +1,23 @@
+2020-10-21 Zalan Bujtas <[email protected]>
+
+ [LFC][Integration] Ascent and descent are rounded to integral position
+ https://bugs.webkit.org/show_bug.cgi?id=218036
+
+ Reviewed by Antti Koivisto.
+
+ In this patch, we round ascent/descent vertical position values to integral to match legacy behavior.
+
+ * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+ (WebCore::Layout::LineBoxBuilder::constructInlineLevelBoxes):
+ * layout/inlineformatting/InlineLineBox.cpp:
+ (WebCore::Layout::LineBox::InlineLevelBox::setBaseline):
+ (WebCore::Layout::LineBox::InlineLevelBox::setDescent):
+ (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds):
+ * layout/inlineformatting/InlineLineBox.h:
+ (WebCore::Layout::LineBox::InlineLevelBox::setBaseline): Deleted.
+ (WebCore::Layout::LineBox::InlineLevelBox::setDescent): Deleted.
+ (WebCore::Layout::LineBox::InlineLevelBox::setLayoutBounds): Deleted.
+
2020-10-21 Chris Dumez <[email protected]>
MessagePort & MessageEvent should be exposed to AudioWorklets
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp (268814 => 268815)
--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2020-10-21 19:14:42 UTC (rev 268814)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp 2020-10-21 19:19:36 UTC (rev 268815)
@@ -260,16 +260,16 @@
if (run.isBox()) {
auto& inlineLevelBoxGeometry = formattingContext().geometryForBox(layoutBox);
auto logicalHeight = inlineLevelBoxGeometry.marginBoxHeight();
- auto baseline = logicalHeight;
+ auto ascent = logicalHeight;
if (layoutBox.isInlineBlockBox() && layoutBox.establishesInlineFormattingContext()) {
auto& formattingState = layoutState().establishedInlineFormattingState(downcast<ContainerBox>(layoutBox));
auto& lastLine = formattingState.lines().last();
auto inlineBlockBaseline = lastLine.logicalTop() + lastLine.baseline();
- baseline = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().valueOr(0) + inlineBlockBaseline;
+ ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderTop() + inlineLevelBoxGeometry.paddingTop().valueOr(0) + inlineBlockBaseline;
}
auto atomicInlineLevelBox = LineBox::InlineLevelBox::createAtomicInlineLevelBox(layoutBox, logicalLeft, { run.logicalWidth(), logicalHeight });
- atomicInlineLevelBox->setBaseline(baseline);
- atomicInlineLevelBox->setLayoutBounds(LineBox::InlineLevelBox::LayoutBounds { baseline, { } });
+ atomicInlineLevelBox->setBaseline(ascent);
+ atomicInlineLevelBox->setLayoutBounds(LineBox::InlineLevelBox::LayoutBounds { ascent, { } });
if (logicalHeight)
atomicInlineLevelBox->setIsNonEmpty();
lineBox.addInlineLevelBox(WTFMove(atomicInlineLevelBox));
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp (268814 => 268815)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2020-10-21 19:14:42 UTC (rev 268814)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.cpp 2020-10-21 19:19:36 UTC (rev 268815)
@@ -39,6 +39,24 @@
{
}
+void LineBox::InlineLevelBox::setBaseline(InlineLayoutUnit baseline)
+{
+ // FIXME: Remove legacy rounding.
+ m_baseline = roundToInt(baseline);
+}
+
+void LineBox::InlineLevelBox::setDescent(InlineLayoutUnit descent)
+{
+ // FIXME: Remove legacy rounding.
+ m_descent = roundToInt(descent);
+}
+
+void LineBox::InlineLevelBox::setLayoutBounds(const LayoutBounds& layoutBounds)
+{
+ // FIXME: Remove legacy rounding.
+ m_layoutBounds = { InlineLayoutUnit(roundToInt(layoutBounds.ascent)), InlineLayoutUnit(roundToInt(layoutBounds.descent)) };
+}
+
bool LineBox::InlineLevelBox::hasLineBoxRelativeAlignment() const
{
auto verticalAlignment = layoutBox().style().verticalAlign();
Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h (268814 => 268815)
--- trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2020-10-21 19:14:42 UTC (rev 268814)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLineBox.h 2020-10-21 19:19:36 UTC (rev 268815)
@@ -102,8 +102,8 @@
void setLogicalTop(InlineLayoutUnit logicalTop) { m_logicalRect.setTop(logicalTop); }
void setLogicalWidth(InlineLayoutUnit logicalWidth) { m_logicalRect.setWidth(logicalWidth); }
void setLogicalHeight(InlineLayoutUnit logicalHeight) { m_logicalRect.setHeight(logicalHeight); }
- void setBaseline(InlineLayoutUnit baseline) { m_baseline = baseline; }
- void setDescent(InlineLayoutUnit descent) { m_descent = descent; }
+ void setBaseline(InlineLayoutUnit);
+ void setDescent(InlineLayoutUnit);
// See https://www.w3.org/TR/css-inline-3/#layout-bounds
struct LayoutBounds {
@@ -112,7 +112,7 @@
InlineLayoutUnit ascent { 0 };
InlineLayoutUnit descent { 0 };
};
- void setLayoutBounds(const LayoutBounds& layoutBounds) { m_layoutBounds = layoutBounds; }
+ void setLayoutBounds(const LayoutBounds&);
LayoutBounds layoutBounds() const { return m_layoutBounds; }
private:
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes