[webkit-changes] [WebKit/WebKit] 226684: [margin-trim] Trigger layout on margin-trim style ...

Sammy Gill noreply at github.com
Fri Mar 31 10:58:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 226684b758a062ec07c68f2de73a6687844fbaf1
      https://github.com/WebKit/WebKit/commit/226684b758a062ec07c68f2de73a6687844fbaf1
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-03-31 (Fri, 31 Mar 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-style-change-triggers-layout-block-start-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-style-change-triggers-layout-block-start.html
    R LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-block-start-dynamic-expected.txt
    R LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-block-start-dynamic.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline.html
    M Source/WebCore/rendering/style/RenderStyle.cpp

  Log Message:
  -----------
  [margin-trim] Trigger layout on margin-trim style change.
https://bugs.webkit.org/show_bug.cgi?id=254300
rdar://107108810

Reviewed by Tim Nguyen.

When the value of the margin-trim property changes on a box, it
should trigger layout again so that the children can be relaid out
properly. This patch takes the first step and has rareDataChangeRequiresLayout
return true when the box's old margin-trim value is not the same as
the new one. The 3 container types in which margin-trim is applicable to
(flex, grid, and block) may need to have their styleDidChange function
adjusted to actually relayout their children properly, but that will be
done in a separate patch for each layout type.

However, we can verify that this change works by attempting to trigger
this logic for flexboxes. This is because when a flexbox goes through
layout again, it will set the main axis margins for each of its children
inside RenderFlexibleBox::prepareOrderIteratorAndMargins before it goes
through and lays them out. Since the main axis margins for each child
will be step at the beginning of flex layout each time it happens, the
trimming logic will also apply each time. The cross axis margins will
need to be handled and verified separately once the change is made to
RenderFlexibleBox::styleDidChange.

* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-style-change-triggers-layout-block-start-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-column-style-change-triggers-layout-block-start.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-block-start-dynamic.html.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/computed-margin-values/flexbox-row-block-start-dynamic-expected.txt: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-end.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block-start.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-column-style-change-triggers-layout-block.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-end.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline-start.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-box/margin-trim/flex-row-style-change-triggers-layout-inline.html: Added.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::rareDataChangeRequiresLayout):

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




More information about the webkit-changes mailing list