[webkit-changes] [WebKit/WebKit] 6801b3: Incorrect inline box decoration position when cont...

alan noreply at github.com
Fri Sep 16 07:08:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6801b3e1c42c273e12254b6e0cfdb9774fbaa398
      https://github.com/WebKit/WebKit/commit/6801b3e1c42c273e12254b6e0cfdb9774fbaa398
  Author: Alan Bujtas <zalan at apple.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    A LayoutTests/fast/inline/inline-box-decoration-with-border-and-padding-expected.html
    A LayoutTests/fast/inline/inline-box-decoration-with-border-and-padding.html
    M Source/WebCore/rendering/TextBoxPainter.cpp

  Log Message:
  -----------
  Incorrect inline box decoration position when content box is vertically shifted
https://bugs.webkit.org/show_bug.cgi?id=245209
<rdar://problem/99950939>

Reviewed by Simon Fraser.

1. the logical top of an inline box points to the edge of the border box.
2. the logical top of an inline box is relative to its parent inline box.
3. the vertical padding/border on an inline box does not make it any taller (and does not stretch the line).

It simply means that putting vertical padding/border on an inline box has no impact on its content box's vertical position.
    <div><span style="padding-top: 200px">with padding</span></div>
  and
    <div><span style="padding-top: 0px">without padding</span></div>
produce the same layout.

However the top value always includes both the border and the padding values (e.g. in the example above, the <span>'s logical top is resolved to -200px).

In this patch we ensure that the content box's top is used when paining the underline/overline/etc foreground decorations.

* LayoutTests/fast/inline/inline-box-decoration-with-border-and-padding-expected.html: Added.
* LayoutTests/fast/inline/inline-box-decoration-with-border-and-padding.html: Added.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter<TextBoxPath>::collectDecoratingBoxesForTextBox):

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




More information about the webkit-changes mailing list