Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7a3aefde0128d2514b2aeac3caac401118ed5b82
      
https://github.com/WebKit/WebKit/commit/7a3aefde0128d2514b2aeac3caac401118ed5b82
  Author: Sammy Gill <[email protected]>
  Date:   2024-11-07 (Thu, 07 Nov 2024)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-max-content-height-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-max-content-height.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-min-content-height-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-min-content-height.html
    M Source/WebCore/rendering/RenderBox.cpp
    M Source/WebCore/rendering/RenderBoxInlines.h
    M Source/WebCore/rendering/RenderReplaced.cpp
    M Source/WebCore/rendering/RenderReplaced.h

  Log Message:
  -----------
  walzr.com: Images are vertically stretched.
https://bugs.webkit.org/show_bug.cgi?id=282634
rdar://137063317

Reviewed by Alan Baradlay.

Images on walzr.com have a fixed width and a computed height of min-content, 
which is
causing them to vertically stretch.

css-box-sizing-3 defines the min-content size to be: "the size it would have if 
it was a
float given an auto preferred size in that axis (and no minimum or maximum size 
in that
axis) and if its containing block was zero-sized in that axis."

CSS2 defines finding the logical height for floating replaced elements. If the 
width
is a non-auto computed width, a computed width of auto, and an intrinsic ratio, 
then
the logical height is computed via the aspect ratio.

RenderBox::computeIntrinsicLogicalContentHeightUsing was simply returning the 
intrinsic
logical height, which was not correct. Let's adjust this by adding some new 
logic to handle
this specific case for images and fall back to other types of content. We also 
will fall
back to the old logic if an aspect ratio is specified via the aspect-ratio 
property.
The max-content size is defined similarly (with a difference in the containing 
block
size for the float) so let's handle it here too.

https://drafts.csswg.org/css-sizing-3/#intrinsic-sizes
https://drafts.csswg.org/css2/#inline-replaced-height

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-max-content-height-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-max-content-height.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-min-content-height-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/intrinsic-fixed-width-with-min-content-height.html:
 Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing const):
* Source/WebCore/rendering/RenderBoxInlines.h:
(WebCore::resolveHeightForRatio):
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* Source/WebCore/rendering/RenderReplaced.h:

Canonical link: https://commits.webkit.org/286284@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

Reply via email to