WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

Include aspect-ratio when calculating inline min-content size and add min-content block computation

Open sammygill opened this issue 3 years ago โ€ข 1 comments

4205ff2acfadf09d0364ea4de4a706e8b37803e9

Include aspect-ratio when calculating inline min-content size and add min-content block computation
https://bugs.webkit.org/show_bug.cgi?id=243473

Reviewed by NOBODY (OOPS!).

When we compute the content size suggestion of an element with a
preferred aspect ratio, we need to make sure that the minimum-content
size itself of the element. When the main axis is in the inline direction,
we have to consider whether or not an aspect-ratio is specified. If
there is an aspect-ratio, we must calculate the minimum-content size
using that. Otherwise, we will just compute the main axis extent for
the child.

However, the definition of of the minimum-content size in the block
direction is slightly different. According to the CSS Sizing spec,
the min-content block size is: he box's "ideal" size in the block axis.
Usually the block size of the content after layout.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::inlineSizeFromAspectRatio):

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes):
(WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):

sammygill avatar Aug 04 '22 21:08 sammygill

There are quite a number of typos to fix (minimuim etc.).

Overall progress looks great. However flex-aspect-ratio-026.html is not completely fixed. I worry a bit that improving/fixing that may need touching this code section again, do you have any idea about that?

I am not sure, but that is a good point! I'll look into that test and see what needs to be done. If the change is related, I'll add it to this patch so we can hold off on it for a bit.

sammygill avatar Aug 08 '22 16:08 sammygill

EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/e48f6943e9d874f7bc56433d2ec4aadef94212e4)

Misc iOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  ๐Ÿงช win
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-debug โ€ƒ ~~๐Ÿ›  gtk~~ โณ ๐Ÿ›  wincairo
โœ… ๐Ÿงช webkitperl โ€ƒ ~~๐Ÿงช ios-wk2~~ โœ… ๐Ÿ›  mac-AS-debug [โŒ ๐Ÿงช gtk-wk2](https://ews-build.webkit.org/#/builders/35/builds/22519 "Unexpected infrastructure issue: The layout-test run with change generated no list of results and exited with error, retrying with the hope it was a random infrastructure error.
Retrying build [retry count is 0 of 3]")
โœ… ๐Ÿงช api-ios โ€ƒ ~~๐Ÿงช api-mac~~ โ€ƒ ~~๐Ÿงช api-gtk~~
โœ… ๐Ÿ›  tv โ€ƒ ~~๐Ÿงช mac-wk1~~
โœ… ๐Ÿ›  tv-sim โ€ƒ ~~๐Ÿงช mac-wk2~~
โœ… ๐Ÿ›  watch โ€ƒ ~~๐Ÿงช mac-AS-debug-wk2~~
โœ… ๐Ÿ›  watch-sim โœ… ๐Ÿงช mac-wk2-stress

EWS run on previous version of this PR (hash https://github.com/WebKit/WebKit/commit/e48f6943e9d874f7bc56433d2ec4aadef94212e4)

Misc iOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  ๐Ÿงช win
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โœ… ๐Ÿ›  mac-debug โ€ƒ ~~๐Ÿ›  gtk~~ โณ ๐Ÿ›  wincairo
โœ… ๐Ÿงช webkitperl โ€ƒ ~~๐Ÿงช ios-wk2~~ โœ… ๐Ÿ›  mac-AS-debug [โŒ ๐Ÿงช gtk-wk2](https://ews-build.webkit.org/#/builders/35/builds/22519 "Unexpected infrastructure issue: The layout-test run with change generated no list of results and exited with error, retrying with the hope it was a random infrastructure error.
Retrying build [retry count is 0 of 3]")
โœ… ๐Ÿงช api-ios โ€ƒ ~~๐Ÿงช api-mac~~ โ€ƒ ~~๐Ÿงช api-gtk~~
โœ… ๐Ÿ›  tv โ€ƒ ~~๐Ÿงช mac-wk1~~
โœ… ๐Ÿ›  tv-sim โ€ƒ ~~๐Ÿงช mac-wk2~~
โœ… ๐Ÿ›  watch โ€ƒ ~~๐Ÿงช mac-AS-debug-wk2~~
โœ… ๐Ÿ›  watch-sim โœ… ๐Ÿงช mac-wk2-stress

Committed 253740@main (588e20666a36): https://commits.webkit.org/253740@main

Reviewed commits have been landed. Closing PR #3025 and removing active labels.

webkit-commit-queue avatar Aug 24 '22 21:08 webkit-commit-queue