Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0f386a7db050c94475ac9278e508ae94b743330d
      
https://github.com/WebKit/WebKit/commit/0f386a7db050c94475ac9278e508ae94b743330d
  Author: Alan Baradlay <[email protected]>
  Date:   2024-07-05 (Fri, 05 Jul 2024)

  Changed paths:
    M LayoutTests/fast/repaint/selection-gap-flipped-absolute-child-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-012-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-013-expected.txt
    M Source/WebCore/rendering/RenderBox.cpp

  Log Message:
  -----------
  [Out-of-flow] Incorrect static position when in-flow parent is a writing-mode 
root with flipping
https://bugs.webkit.org/show_bug.cgi?id=276240
<rdar://problem/131150053>

Reviewed by Antti Koivisto.

This patch fixes incorrect static positioning when the (in-flow) parent is a 
writing-mode root with flipping value e.g. vertical-rl

Computing the final static _top_ position is a 2 step process for such 
writing-mode(s) given WebKit's current design.

<div id=containing-block style="position: relative;">
  <div id=parent style="writing-mode: vertical-lr;">
    <div id=out-of-flow style="position: absolute;></div>

   _________________________________ [containing-block]
  |  ___________________________ [parent]
  | |          x_______________ |
  | |          |               ||
  | |          | [out-of-flow] ||
  | |          |_______________||
  | |                           |
  |

1. [out-of-flow]'s static top position is 0px relative to [parent]'s border box 
logical top-left, which in case of vertical-lr is
   the visual top-right corner. [out-of-flow]'s logical top is also flush to 
that corner.
2. Converting it (turning it into physical (visual) left) requires both the 
physical width (logical height) of the [parent] (we have that) and
   physical width (logical height) of the [out-of-flow] box (we don't have 
that). -this is where (x) is located.

- in computeBlockStaticDistance we partially resolve this position (we don't 
yet have height information) and continue
- in computeLogicalTopPositionedOffset, where we already have the resolved 
height.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-012-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/abspos/position-absolute-013-expected.txt:
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::shouldFlipStaticPositionInParent):
(WebCore::computeBlockStaticDistance):
(WebCore::computeLogicalTopPositionedOffset):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to