Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 140fa4b7c9c1fa567212f19d743a211b0622f417
https://github.com/WebKit/WebKit/commit/140fa4b7c9c1fa567212f19d743a211b0622f417
Author: Sammy Gill <[email protected]>
Date: 2024-11-22 (Fri, 22 Nov 2024)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/content-based-height-rounds-up-to-step-unit-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/content-based-height-rounds-up-to-step-unit.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-next-multiple-of-step-unit-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-next-multiple-of-step-unit.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-step-unit-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-step-unit.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-same-as-step-unit-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-same-as-step-unit.html
M Source/WebCore/rendering/RenderBlockFlow.cpp
M Source/WebCore/rendering/RenderBlockFlow.h
Log Message:
-----------
[block-step-sizing] Support block-step-size for some simple content.
https://bugs.webkit.org/show_bug.cgi?id=283378
rdar://140229901
Reviewed by Alan Baradlay.
This patch serves as a first step towards the implementation of block step
sizing.
Specifically, this patch adds support for the block-step-size property on some
very
simple pieces of content. These pieces of content are described in more detail
below
as a description for the tests added, but for a brief description: The tests
focus on
rounding up the outer sizes of boxes with both a definite and content-based
height.
This sizing is performed during block layout after we perform child on the
block level
box. We check to see if the box has block-step-size specified and do the
following if it
does:
1.) Compute the extra space that should be distributed as part of this sizing.
This is
done by taking the outer size of the box and computing the next multiple of the
step unit
that is larger than or equal to the outer size. We then return the difference
between
the two as the extra space to distribute. If the outer size of the box is
already a multiple
of the step unit, then there is no space to distribute.
2.) Distribute the computed extra space by distributing it in half among the
block margins
of the box.
This patch should allow us to perform block step sizing correctly with the test
cases
attached, but there will need to be further testing needed for different types
of content.
Some of this should happen naturally as we continue to implement the spec, but
other
tests will likely come as we experiment with the feature in different contexts.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/content-based-height-rounds-up-to-step-unit-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/content-based-height-rounds-up-to-step-unit.html:
Added.
Simple test where some content of a block level box drives its block size. This
content
driven size is smaller than the specified step unit so it should just get
rounded up to
that value.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-next-multiple-of-step-unit-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-next-multiple-of-step-unit.html:
Added.
The definite height that is specified on this box is larger than the step unit
so it
should just get rounded up to the next multiple of the step unit.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-step-unit-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-rounds-up-to-step-unit.html:
Added.
The definite height of the box is smaller than the step unit so it should just
get rounded
up to the step unit.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-same-as-step-unit-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-rhythm/definite-height-same-as-step-unit.html:
Added.
This definite height is the same as the step unit so there should be no extra
space
computed and the size of the box should not change.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::computeExtraSpaceForBlockStepSizing):
(WebCore::RenderBlockFlow::distributeExtraBlockStepSizingSpaceToChild const):
(WebCore::RenderBlockFlow::layoutBlockChild):
* Source/WebCore/rendering/RenderBlockFlow.h:
Canonical link: https://commits.webkit.org/286969@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes