[webkit-changes] [WebKit/WebKit] 4c9ed1: Implement align-content on block containers

fantasai noreply at github.com
Sat Dec 9 16:59:51 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4c9ed164dcfcefd7d01ba15fe89a9e267072a846
      https://github.com/WebKit/WebKit/commit/4c9ed164dcfcefd7d01ba15fe89a9e267072a846
  Author: Elika Etemad <fantasai.bugs at inkedblade.net>
  Date:   2023-12-09 (Sat, 09 Dec 2023)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-002-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-002.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-003-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-003.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-004-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-004.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-005-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-005.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-006-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-006.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-007-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-007.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-008-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-008.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-009-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-009.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-010-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-010.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-011-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-011.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-aligned-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-unaligned-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-aligned-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-unaligned-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-020-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000-ref.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-simple-height-change-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-simple-height-change.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-table-cell-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-table-cell.html
    A LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-table-cell-expected.txt
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h
    M Source/WebCore/rendering/FloatingObjects.cpp
    M Source/WebCore/rendering/FloatingObjects.h
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderBlockFlow.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderLineBoxList.cpp
    M Source/WebCore/rendering/RenderLineBoxList.h
    M Source/WebCore/rendering/style/StyleContentAlignmentData.cpp
    M Source/WebCore/rendering/style/StyleContentAlignmentData.h

  Log Message:
  -----------
  Implement align-content on block containers
https://bugs.webkit.org/show_bug.cgi?id=266085
rdar://114740670

Reviewed by Alan Baradlay.

Implements 'align-content' on block containers by shifting the contents
of RenderBlockFlow if there is extra space after sizing. See
  https://www.w3.org/TR/css-align/#distribution-block

Alignment is not supported if the box is fragmented.

To support this, adds methods for shifting content in the block axis to:
- FloatingObjects
- legacy RenderLineBoxList
- modern LineLayout

Also implements the requirement that non-normal 'align-content' values
establish a new formatting context.

* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-003.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-004.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-005.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-006.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-007.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-008.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-009.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-010.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-011.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-aligned-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010-unaligned-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-010.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-aligned-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020-unaligned-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-content-020.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-010.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-020-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-020-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-break-overflow-020.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-overflow-000.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-block-simple-height-change.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-align/blocks/align-content-table-cell.html: Added.
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::shiftLinesBy): Implement shifting line boxes and their contents.
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.h: Add API to shift line boxes and their contents.
* Source/WebCore/rendering/FloatingObjects.cpp:
(WebCore::FloatingObjects::shiftFloatsBy): Implement shifting floats while avoiding side-effects.
* Source/WebCore/rendering/FloatingObjects.h: Add APIs for shifting all floats by a fixed amount.
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock): Shift for align-content, trigger abspos reflow if shifted.
(WebCore::RenderBlockFlow::shiftForAlignContent): Implement method to shift content per align-content.
* Source/WebCore/rendering/RenderBlockFlow.h: Add shiftForAlignContent()
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::createsNewFormattingContext const): Establish new formatting context.
* Source/WebCore/rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::shiftLinesBy): Implement method to shift lines by delta.
* Source/WebCore/rendering/RenderLineBoxList.h: Add API to shift lines by delta.
* Source/WebCore/rendering/style/StyleContentAlignmentData.cpp:
(WebCore::StyleContentAlignmentData::isStartward const): Add convenience method for 'start'-equivalent values.
(WebCore::StyleContentAlignmentData::isEndward const): Add convenience method for 'end'-equivalent values.
(WebCore::StyleContentAlignmentData::isCentered const): Add convenience method for 'center'-equivalent values.
* Source/WebCore/rendering/style/StyleContentAlignmentData.h:
(WebCore::StyleContentAlignmentData::isNormal const): Add convenience method to correctly check for 'normal'.

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




More information about the webkit-changes mailing list