[webkit-changes] [WebKit/WebKit] 93e654: (REGRESSION(257434 at main): https://readwise.io/read...

Sammy Gill noreply at github.com
Tue Jan 31 22:37:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 93e6542aebf91d6a023247a5068e8756eeae53d3
      https://github.com/WebKit/WebKit/commit/93e6542aebf91d6a023247a5068e8756eeae53d3
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-01-31 (Tue, 31 Jan 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/images/abs-pos-transferred-max-width-from-percentage-max-height-in-auto-height-containing-block-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/images/abs-pos-transferred-max-width-from-percentage-max-height-in-auto-height-containing-block.html
    M Source/WebCore/rendering/RenderBox.cpp

  Log Message:
  -----------
  (REGRESSION(257434 at main): https://readwise.io/read image squished
https://bugs.webkit.org/show_bug.cgi?id=251419
rdar://103481329

Reviewed by Alan Baradlay.

When viewing the website on iOS the image of the phone renders
incorrectly as the width that is computed is too large. The image has
max-height: 100%, so this constraint should also provide the transferred
max-width for the image. We should be able to compute this value since
the image is absolutely positioned.

The previous version (before the regression) of this code computed the
"constrained width" by calling computeReplacedLogicalHeight and then
using the intrinsic ratio to compute the final width. computeReplacedLogicalHeight
eventually called into computeReplacedLogicalHeightUsing to compute the
min/max heights. This ended up computing the correct value for the min/max
heights when the image was absolutely positioned and had a percentage
height in an auto-height containing block.

The new version of the code, which used the logic for the css
aspect-ratio property, did not handle this case correctly and returned
an incorrect value for max-height. To resolve this issue, we can check
to see if the object is a RenderReplaced object by the time we get
to RenderBox::computeLogicalHeightUsing and then call into
computeReplacedLogicalHeightUsing to get the correct value.

* LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/images/abs-pos-transferred-max-width-from-percentage-max-height-in-auto-height-containing-block-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/images/abs-pos-transferred-max-width-from-percentage-max-height-in-auto-height-containing-block.html: Added.
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeightUsing const):

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




More information about the webkit-changes mailing list