[webkit-changes] [WebKit/WebKit] 28021b: Wide-layout attachments: Fix baseline computation

Gerald Squelart noreply at github.com
Sun Jul 9 23:57:44 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 28021b9b53fe677af02c6099ef04bfc612d6f673
      https://github.com/WebKit/WebKit/commit/28021b9b53fe677af02c6099ef04bfc612d6f673
  Author: Gerald Squelart <g_squelart at apple.com>
  Date:   2023-07-09 (Sun, 09 Jul 2023)

  Changed paths:
    M LayoutTests/fast/attachment/mac/wide-attachment-image-controls-basic-expected.txt
    M LayoutTests/platform/ios-wk2/fast/attachment/cocoa/wide-attachment-rendering-expected.txt
    M LayoutTests/platform/mac-wk2/fast/attachment/cocoa/wide-attachment-rendering-expected.txt
    M Source/WebCore/rendering/RenderAttachment.cpp

  Log Message:
  -----------
  Wide-layout attachments: Fix baseline computation
https://bugs.webkit.org/show_bug.cgi?id=259039
rdar://problem/111991128

Reviewed by Tim Nguyen.

The previous computation used `renderRect`s, which relied on the baseline, modifying the baseline again
and again.
Instead, assume that the image is vertically centred, so it's just a matter of adding half-heights to find
the bottom of that image. (Fallback to the full attachment height alone in case the inner element doesn't
have its height yet.)

* LayoutTests/fast/attachment/mac/wide-attachment-image-controls-basic-expected.txt:
* LayoutTests/platform/ios-wk2/fast/attachment/cocoa/wide-attachment-rendering-expected.txt:
* LayoutTests/platform/mac-wk2/fast/attachment/cocoa/wide-attachment-rendering-expected.txt:
* Source/WebCore/rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::baselinePosition const):

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




More information about the webkit-changes mailing list