[webkit-changes] [WebKit/WebKit] dfe253: [css-grid] Introduce AncestorSubgridIterator

Sammy Gill noreply at github.com
Tue Oct 17 18:34:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dfe2536d72733b14b2167988444f227ac3ca799f
      https://github.com/WebKit/WebKit/commit/dfe2536d72733b14b2167988444f227ac3ca799f
  Author: Sammy Gill <sammy.gill at apple.com>
  Date:   2023-10-17 (Tue, 17 Oct 2023)

  Changed paths:
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    A Source/WebCore/rendering/AncestorSubgridIterator.cpp
    A Source/WebCore/rendering/AncestorSubgridIterator.h
    M Source/WebCore/rendering/GridLayoutFunctions.cpp
    M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
    M Source/WebCore/rendering/style/GridPositionsResolver.cpp
    M Source/WebCore/rendering/svg/RenderSVGPath.cpp

  Log Message:
  -----------
  [css-grid] Introduce AncestorSubgridIterator
https://bugs.webkit.org/show_bug.cgi?id=263262
rdar://117083828

Reviewed by Matt Woodrow.

This patch adds an iterator that can be used to traverse a chain of
ancestor subgrids and also uses it in a few different places where it
can be used. The iterator is very similar to the RenderAncestorIterator,
but the main difference is that we need to check if the next ancestor
we are traversing is a subgrid in the appropriate direction.

There are two main ways to use the iterator:
1.) Providing the first subgrid ancestor that will be used in the
traversal along with the traversal direction.

2.) Using the ancestorSubgridsOfGridItem helper function. This is
useful when you have a subgridded item that you want to traverse the
ancestor subgrids of.

* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/rendering/AncestorSubgridIterator.cpp: Added.
(WebCore::AncestorSubgridIterator::AncestorSubgridIterator):
(WebCore::AncestorSubgridIterator::begin):
(WebCore::AncestorSubgridIterator::end):
(WebCore::AncestorSubgridIterator::operator++):
(WebCore::AncestorSubgridIterator::operator*):
(WebCore::AncestorSubgridIterator::operator== const):
(WebCore::ancestorSubgridsOfGridItem):
* Source/WebCore/rendering/AncestorSubgridIterator.h: Added.
* Source/WebCore/rendering/GridLayoutFunctions.cpp:
(WebCore::GridLayoutFunctions::extraMarginForSubgridAncestors):
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::accumulateIntrinsicSizesForTrack):
* Source/WebCore/rendering/style/GridPositionsResolver.cpp:
(WebCore::NamedLineCollection::NamedLineCollection):
* Source/WebCore/rendering/svg/RenderSVGPath.cpp:

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




More information about the webkit-changes mailing list