Title: [282823] trunk/Source/WebCore
- Revision
- 282823
- Author
- [email protected]
- Date
- 2021-09-21 09:39:54 -0700 (Tue, 21 Sep 2021)
Log Message
[LFC][IFC] Ceil the descent value when adjusting the layout bounds for an inline box
https://bugs.webkit.org/show_bug.cgi?id=230557
Reviewed by Antti Koivisto.
Use ceil instead of floor to match legacy line layout positioning.
* layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp: use ceilf everywhere
(WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineContent):
* layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::LineBoxBuilder::adjustVerticalGeometryForInlineBoxWithFallbackFonts const):
(WebCore::Layout::LineBoxBuilder::setInitialVerticalGeometryForInlineBox const):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (282822 => 282823)
--- trunk/Source/WebCore/ChangeLog 2021-09-21 16:37:43 UTC (rev 282822)
+++ trunk/Source/WebCore/ChangeLog 2021-09-21 16:39:54 UTC (rev 282823)
@@ -1,3 +1,18 @@
+2021-09-21 Alan Bujtas <[email protected]>
+
+ [LFC][IFC] Ceil the descent value when adjusting the layout bounds for an inline box
+ https://bugs.webkit.org/show_bug.cgi?id=230557
+
+ Reviewed by Antti Koivisto.
+
+ Use ceil instead of floor to match legacy line layout positioning.
+
+ * layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp: use ceilf everywhere
+ (WebCore::Layout::InlineDisplayContentBuilder::createRunsAndUpdateGeometryForLineContent):
+ * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
+ (WebCore::Layout::LineBoxBuilder::adjustVerticalGeometryForInlineBoxWithFallbackFonts const):
+ (WebCore::Layout::LineBoxBuilder::setInitialVerticalGeometryForInlineBox const):
+
2021-09-21 Youenn Fablet <[email protected]>
[iOS] Disable default system gesture on extended gamepad
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp (282822 => 282823)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp 2021-09-21 16:37:43 UTC (rev 282822)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp 2021-09-21 16:39:54 UTC (rev 282823)
@@ -74,7 +74,7 @@
auto initialContaingBlockSize = RuntimeEnabledFeatures::sharedFeatures().layoutFormattingContextIntegrationEnabled()
? formattingState.layoutState().viewportSize()
: formattingState.layoutState().geometryForBox(layoutBox.initialContainingBlock()).contentBox().size();
- auto strokeOverflow = std::ceil(style.computedStrokeWidth(ceiledIntSize(initialContaingBlockSize)));
+ auto strokeOverflow = ceilf(style.computedStrokeWidth(ceiledIntSize(initialContaingBlockSize)));
auto inkOverflow = textRunRect;
inkOverflow.inflate(strokeOverflow);
auto letterSpacing = style.fontCascade().letterSpacing();
Modified: trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (282822 => 282823)
--- trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-21 16:37:43 UTC (rev 282822)
+++ trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp 2021-09-21 16:39:54 UTC (rev 282823)
@@ -189,7 +189,7 @@
// We need floor/ceil to match legacy layout integral positioning.
auto layoutBounds = inlineBox.layoutBounds();
- inlineBox.setLayoutBounds({ std::max(layoutBounds.ascent, floorf(maxAscent)), std::max(layoutBounds.descent, floorf(maxDescent)) });
+ inlineBox.setLayoutBounds({ std::max(layoutBounds.ascent, floorf(maxAscent)), std::max(layoutBounds.descent, ceilf(maxDescent)) });
}
void LineBoxBuilder::setInitialVerticalGeometryForInlineBox(InlineLevelBox& inlineLevelBox) const
@@ -201,7 +201,7 @@
auto logicalHeight = ascent + descent;
// We need floor/ceil to match legacy layout integral positioning.
inlineLevelBox.setBaseline(floorf(ascent));
- inlineLevelBox.setDescent(ceil(descent));
+ inlineLevelBox.setDescent(ceilf(descent));
inlineLevelBox.setLogicalHeight(logicalHeight);
// FIXME: Adjust layout bounds with fallback font when applicable.
@@ -223,7 +223,7 @@
descent += halfLeading;
}
// We need floor/ceil to match legacy layout integral positioning.
- inlineLevelBox.setLayoutBounds(InlineLevelBox::LayoutBounds { floorf(ascent), ceil(descent) });
+ inlineLevelBox.setLayoutBounds(InlineLevelBox::LayoutBounds { floorf(ascent), ceilf(descent) });
}
InlineLayoutUnit LineBoxBuilder::constructAndAlignInlineLevelBoxes(LineBox& lineBox, const Line::RunList& runs)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes