Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b7f6398790c88e7e1f9df80d68cc0251e0dc60d1
      
https://github.com/WebKit/WebKit/commit/b7f6398790c88e7e1f9df80d68cc0251e0dc60d1
  Author: Alan Baradlay <[email protected]>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    M Source/WebCore/rendering/BaselineAlignment.cpp
    M Source/WebCore/rendering/BaselineAlignment.h
    M Source/WebCore/rendering/GridBaselineAlignment.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderGrid.cpp

  Log Message:
  -----------
  [cleanup] Move the stateless baseline helpers out of BaselineAlignmentState 
into a BaselineAlignment struct
https://bugs.webkit.org/show_bug.cgi?id=318370

Reviewed by Antti Koivisto.

dominantBaseline(), usedWritingModeForBaselineAlignment() and
synthesizedBaseline() are stateless -- they touch none of
BaselineAlignmentState's members, and most callers (RenderGrid and
flex's first/last baseline queries) invoke them without any
BaselineAlignmentState instance at all.

Move them to a free BaselineAlignment struct, leaving
BaselineAlignmentState and BaselineGroup holding only per-context
grouping state. This separates the stateless baseline math -- one piece
of which, synthesizedBaseline(), needs a real RenderBox -- from the grouping 
machinery.

No change in behavior.

* Source/WebCore/rendering/BaselineAlignment.h:
* Source/WebCore/rendering/BaselineAlignment.cpp:
(WebCore::BaselineAlignment::dominantBaseline):
(WebCore::BaselineAlignment::synthesizedBaseline):
(WebCore::BaselineAlignment::usedWritingModeForBaselineAlignment):
(WebCore::BaselineAlignmentState::findCompatibleSharedGroup):
* Source/WebCore/rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForGridItem const):
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::RenderFlexibleBox::lastLineBaseline const):
(WebCore::RenderFlexibleBox::marginBoxAscentForFlexItem):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
* Source/WebCore/rendering/RenderGrid.cpp:
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::lastLineBaseline const):

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



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

Reply via email to