[webkit-changes] [WebKit/WebKit] cb84a2: [Flex][9.2.3E] Base size of replaced element with ...

Sammy Gill noreply at github.com
Wed Dec 11 08:20:43 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cb84a2076fa44498ab1debd59561b6ea3af32e07
      https://github.com/WebKit/WebKit/commit/cb84a2076fa44498ab1debd59561b6ea3af32e07
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2024-12-11 (Wed, 11 Dec 2024)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-001-expected.txt
    M Source/WebCore/rendering/RenderReplaced.cpp

  Log Message:
  -----------
  [Flex][9.2.3E] Base size of replaced element with no intrinsic sizes but intrinsic ratio should be stretched into the available space.
https://bugs.webkit.org/show_bug.cgi?id=221474
rdar://74279029

Reviewed by Alan Baradlay.

When computing the base size of a flex item via 9.2.3E in the flex
layout algorithm, we need to compute the max-content size of the flex
item if it has a used flex-basis of content.

css-box-sizing-3 says to compute the max-content size of this type of
box (replaced elements without natrual sizes but a preferred aspect
ratio) as: "If the available space is definite in the inline axis,
use the stretch fit into that size for the inline size and
calculate the block size using the aspect ratio."

When we are in RenderReplaced::computeReplacedLogicalWidth, this can be
done by checking to see if we are indeed a flex item and if the flexbox
is computing the base sizes for the item. If that's the case, then we
should compute the constrained size (the stretch fit) size instead of
computing the preferred logical widths.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-001-expected.txt:
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computedReplacedLogicalWidth):

Canonical link: https://commits.webkit.org/287672@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list