[webkit-changes] [WebKit/WebKit] 8792d4: [Flex] Fix imported/w3c/web-platform-tests/css/css...

Alan Baradlay noreply at github.com
Tue Jul 23 10:15:45 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8792d4d4d31eaa13eac9edfa9c3c1f6b54568c81
      https://github.com/WebKit/WebKit/commit/8792d4d4d31eaa13eac9edfa9c3c1f6b54568c81
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

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

  Log Message:
  -----------
  [Flex] Fix imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-005.html
https://bugs.webkit.org/show_bug.cgi?id=276901

Reviewed by Antti Koivisto.

Let's rebuild flex box subtree when adding an out-of-flow box in-between siblings.

1. Direct children of a flex box are supposed to be individual flex items.
2. Attaching an out-of-flow box (even) with specified beforeChild may not always end up in the exact same position where the insertion position is.

This patch handles cases when we go from

<div style="display: flex">
  some
  <div style="position: absolute"></div>
  text
</div>

to

<div style="display: flex">
  some
  text
</div>

at this point we construct the following render tree

  RenderFlexibleBox
    RenderBlock (anon flex item)
      RenderText
      RenderText

(notice the anon flex item)

and when the out-of-flow-box gets re-inserted (see the first markup above), we compute the final insertion point outside of the anon flex item

  RenderFlexibleBox
    RenderBlockFlow (out-of-flow box)
    RenderBlock (anon flex item)
      RenderText
      RenderText

but the render tree is supposed to look like this:

  RenderFlexibleBox
    RenderBlock (anon flex item)
      RenderText
    RenderBlockFlow (out-of-flow box)
    RenderBlock (anon flex item)
      RenderText

to be able to renderer those 2 (inflow) flex items according to flex layout.

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/align-items-baseline-column-horz.html:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRebuildRoots):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list