Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 95fb2ea4c7b35e3b2acffc1d2792458c2c5ecf2c
https://github.com/WebKit/WebKit/commit/95fb2ea4c7b35e3b2acffc1d2792458c2c5ecf2c
Author: Karl Dubost <[email protected]>
Date: 2026-06-25 (Thu, 25 Jun 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/RenderReplaced.cpp
Log Message:
-----------
SVG <img> with near-integral intrinsic width renders one device pixel narrow
https://bugs.webkit.org/show_bug.cgi?id=317725
rdar://180490343
Reviewed by Simon Fraser.
An SVG with width="99.99999" laid out one device pixel narrower than
width="100". Fractional intrinsic dimensions were truncated, not rounded,
when stored as LayoutUnit.
In RenderReplaced::computeIntrinsicSizesConstrainedByTransferredMinMaxSizes,
the FloatSize& OUT-parameter is round-tripped through LayoutUnit before the
caller reads it. The brace-init LayoutUnit{float} truncates toward zero.
For 99.99999, that gave 99.984375. After paint-time snapping, that lost a
device pixel.
Switch the conversion to LayoutUnit::fromFloatRound.
* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeIntrinsicSizesConstrainedByTransferredMinMaxSizes
const):
Round float intrinsic dimensions to nearest LayoutUnit instead of truncating.
Canonical link: https://commits.webkit.org/315807@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications