Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 38108b94b33ff2c5084a669724c8da2bde9fb406
https://github.com/WebKit/WebKit/commit/38108b94b33ff2c5084a669724c8da2bde9fb406
Author: Alan Baradlay <[email protected]>
Date: 2026-04-24 (Fri, 24 Apr 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/RenderBlock.cpp
M Source/WebCore/rendering/RenderBlock.h
M Source/WebCore/rendering/RenderBlockFlow.cpp
M Source/WebCore/rendering/RenderBlockInlines.h
M Source/WebCore/rendering/RenderTable.cpp
M Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
M Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
M Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
M Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
M Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
Log Message:
-----------
Fix imported/w3c/web-platform-tests/css/css-sizing/calc-margins-block.html,
calc-margins-fieldset-content.html, calc-margins-fieldset-legend.html and
calc-margins-table-caption.html
https://bugs.webkit.org/show_bug.cgi?id=313247
Reviewed by Antti Koivisto.
The same tryFixed()-based margin computation was duplicated in 6 places
for intrinsic width calculation. tryFixed() only handles pure fixed
lengths, missing calc() expressions like calc(10% + 100px) where the
fixed part should contribute during intrinsic sizing.
webkit.org/b/313239 fixed this for flex by using evaluateMinimum in
marginIntrinsicLogicalWidthForChild. This commit refactors the remaining
callsites to use the same function, fixing calc() margins for block,
fieldset (both content and legend), and table captions.
* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::intrinsicLogicalMarginStartAndEnd const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
(WebCore::RenderBlock::computePreferredWidthsForExcludedChildren const):
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const): Deleted.
* Source/WebCore/rendering/RenderBlock.h:
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* Source/WebCore/rendering/RenderBlockInlines.h:
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
* Source/WebCore/rendering/RenderTable.cpp:
(WebCore::RenderTable::computePreferredLogicalWidths):
* Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLRow.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp:
* Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp:
Canonical link: https://commits.webkit.org/311987@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications