[webkit-changes] [WebKit/WebKit] 7e5259: Use intrinsic ratio of replaced elements when comp...

Sammy Gill noreply at github.com
Wed Dec 7 07:28:30 PST 2022


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

  Changed paths:
    M LayoutTests/TestExpectations
    M Source/WebCore/rendering/RenderFlexibleBox.cpp

  Log Message:
  -----------
  Use intrinsic ratio of replaced elements when computing flex sizes
https://bugs.webkit.org/show_bug.cgi?id=247447
rdar://101922427

Reviewed by Alan Baradlay.

When computing sizes for replaced element flex items, we should check
to see if there is an intrinsic ratio and not rely on the intrinsic
sizes directly. This is because there are scenarios where an element
can only have an intrinsic size in only one dimension but still have
an aspect ratio. For example, a SVG could have an intrinsic width and
an intrinsic ratio. Since we could not compute the aspect ratio from
the intrinsic sizes, we must use the specified intrinsic ratio.

* LayoutTests/TestExpectations:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing const):
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes):
Here the call to childHasComputableAspectRatio was too strong. In cases
like the example above, the item would still have an aspect ratio but
this call would still return false.

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




More information about the webkit-changes mailing list