Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[css-contain-intrinsic-size] Apply the value of css contain-intrinsic…
…-size to <select> https://bugs.webkit.org/show_bug.cgi?id=246338 Reviewed by Alan Baradlay. Per [1], the intrinsic size is determined as if the element had no content. When RenderMenuList without content, it should still display the appearance of theme. So if it is a size containment, it should have size of theme appearance. While calculating height, we should keep the height from theme style. Per [2], contain-intrinsic-* properties specify an explicit intrinsic inner size. For RenderMenuList, the explicit intrinsic inner size includes the content size and the theme size. So while calculating height, we should override the intrinsic size. When adjusting the style for themes, it might set a fixed value to properties, like width, height, min-width and min-height. This would make contain-intrinsic-* properties not effective. To fix this, the values of these properties need to restore to the auto value. [1] https://www.w3.org/TR/css-contain-2/#containment-size [2] https://www.w3.org/TR/css-sizing-4/#intrinsic-size-override * LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-032-expected.txt: * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::overrideLogicalHeightForSizeContainment): Override the height and handle RenderMenuList. (WebCore::RenderBox::updateLogicalHeight): * Source/WebCore/rendering/RenderBox.h: * Source/WebCore/style/StyleAdjuster.cpp: (WebCore::Style::Adjuster::adjust const): (WebCore::Style::Adjuster::adjustThemeStyle const): If there is contain-intrinsic-size and the css size properties are changed from auto to a fixed value, we should restore them, so that contain-intrinsic-size would be effective. * Source/WebCore/style/StyleAdjuster.h: Canonical link: https://commits.webkit.org/257704@main
- Loading branch information
1 parent
d3b4d2e
commit b727666
Showing
5 changed files
with
59 additions
and
29 deletions.
There are no files selected for viewing
24 changes: 6 additions & 18 deletions
24
...tform-tests/css/css-sizing/contain-intrinsic-size/contain-intrinsic-size-032-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,12 @@ | ||
|
||
|
||
FAIL .test 1 assert_equals: | ||
<select class="test ciw-none cih-none" data-expected-client-width="34" data-expected-client-height="16"></select> | ||
clientHeight expected 16 but got 12 | ||
FAIL .test 2 assert_equals: | ||
<select class="test ciw-none cih-0" data-expected-client-width="34" data-expected-client-height="0"></select> | ||
clientHeight expected 0 but got 12 | ||
PASS .test 1 | ||
PASS .test 2 | ||
PASS .test 3 | ||
FAIL .test 4 assert_equals: | ||
<select class="test ciw-0 cih-none" data-expected-client-width="0" data-expected-client-height="16"></select> | ||
clientHeight expected 16 but got 12 | ||
FAIL .test 5 assert_equals: | ||
<select class="test ciw-0 cih-0" data-expected-client-width="0" data-expected-client-height="0"></select> | ||
clientHeight expected 0 but got 12 | ||
PASS .test 4 | ||
PASS .test 5 | ||
PASS .test 6 | ||
FAIL .test 7 assert_equals: | ||
<select class="test ciw-100 cih-none" data-expected-client-width="100" data-expected-client-height="16"></select> | ||
clientHeight expected 16 but got 12 | ||
FAIL .test 8 assert_equals: | ||
<select class="test ciw-100 cih-0" data-expected-client-width="100" data-expected-client-height="0"></select> | ||
clientHeight expected 0 but got 12 | ||
PASS .test 7 | ||
PASS .test 8 | ||
PASS .test 9 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters