Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7edec7b820967fa0c2988982366054dc96d91cf9
https://github.com/WebKit/WebKit/commit/7edec7b820967fa0c2988982366054dc96d91cf9
Author: Alexsander Borges Damaceno <[email protected]>
Date: 2025-12-03 (Wed, 03 Dec 2025)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/box-sizing-aspect-ratio-positioned-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/box-sizing-aspect-ratio-positioned.html
M Source/WebCore/rendering/RenderBox.cpp
Log Message:
-----------
Box with `box-sizing:border-box` causes incorrect width calculation
https://bugs.webkit.org/show_bug.cgi?id=267625
Reviewed by Alan Baradlay.
Fix width calculation for boxes with `border-box`, `aspect-ratio` and `display:
positioned`
When a box has `box-sizing: border-box` and an aspect ratio set and is
positioned,
the width calculation incorrectly adds the border and padding to the box size.
Since the box uses `border-box`, this border and padding addition is wrong.
This patch fixes the behavior by checking if box has `box-sizing: border-box`
and an aspect ratio before setting the final width value.
Test:
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/box-sizing-aspect-ratio-positioned.html
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/box-sizing-aspect-ratio-positioned.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/box-sizing-aspect-ratio-positioned-expected.txt:
Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeOutOfFlowPositionedLogicalWidth const):
Canonical link: https://commits.webkit.org/303834@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications