[webkit-changes] [WebKit/WebKit] e3642b: [IFC][Integration] Implement legacy -webkit-line-a...

Antti Koivisto noreply at github.com
Wed Sep 27 09:51:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3642b7d4d2b8b9c6f8f42542458058d250a1891
      https://github.com/WebKit/WebKit/commit/e3642b7d4d2b8b9c6f8f42542458058d250a1891
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-09-27 (Wed, 27 Sep 2023)

  Changed paths:
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/ios/fast/line-grid/line-align-left-edges-expected.txt
    M LayoutTests/platform/ios/fast/line-grid/line-align-right-edges-expected.txt
    M LayoutTests/platform/mac/fast/line-grid/line-align-left-edges-expected.txt
    M LayoutTests/platform/mac/fast/line-grid/line-align-right-edges-expected.txt
    M Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationCoverage.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

  Log Message:
  -----------
  [IFC][Integration] Implement legacy -webkit-line-align property
https://bugs.webkit.org/show_bug.cgi?id=262174
<rdar://problem/116114203>

Reviewed by Alan Baradlay.

This property snaps line edges to a grid defined by an ancestor box.

* LayoutTests/platform/mac/fast/line-grid/line-align-left-edges-expected.txt:
* LayoutTests/platform/mac/fast/line-grid/line-align-right-edges-expected.txt:

Floats are no longer aligned to the grid, just the actual line content.

* Source/WebCore/layout/formattingContexts/block/BlockLayoutState.h:
(WebCore::Layout::BlockLayoutState::BlockLayoutState):
(WebCore::Layout::BlockLayoutState::lineGrid const):

Add line grid data.

* Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.cpp:
(WebCore::Layout::InlineFormattingQuirks::adjustedRectForLineGridLineAlign):

Adjust the line rect.
This is based on the code in RenderBlock::adjustLogicalLeftOffsetForLine/adjustLogicalRightOffsetForLine

* Source/WebCore/layout/formattingContexts/inline/InlineFormattingQuirks.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::initialConstraintsForLine const):
(WebCore::Layout::LineBuilder::floatConstrainedRect const):

The adjustment to the line rect is done after computing float constrains and has similar effect.

* Source/WebCore/layout/formattingContexts/inline/TextOnlySimpleLineBuilder.cpp:
(WebCore::Layout::TextOnlySimpleLineBuilder::isEligibleForSimplifiedTextOnlyInlineLayout):

Don't allow this property in simplified builder.

* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForBlockStyle):

Enable.

* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::lineGrid):
(WebCore::LayoutIntegration::LineLayout::layout):

Set up to the line grid to BlockLayoutState.

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




More information about the webkit-changes mailing list