[webkit-changes] [WebKit/WebKit] ab6f97: [IFC][Ruby] Introduce LineBuilder::handleRubyContent

Alan Baradlay noreply at github.com
Sun Sep 17 08:04:05 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab6f97a87291789515d66d5d89331d5d256bb2ee
      https://github.com/WebKit/WebKit/commit/ab6f97a87291789515d66d5d89331d5d256bb2ee
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-09-17 (Sun, 17 Sep 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h
    M Source/WebCore/layout/layouttree/LayoutBox.h

  Log Message:
  -----------
  [IFC][Ruby] Introduce LineBuilder::handleRubyContent
https://bugs.webkit.org/show_bug.cgi?id=261626

Reviewed by Antti Koivisto.

Ruby _base_ content is supposed to be placed on the current line as if it was regular inline content.
In order to place inline content on the line we need logical width information (line breaking).
Ruby _base_ content logical width has dependency on paired annotation(s) (see ruby columns).

The idea here is that when IFC sees a <ruby>, we construct Ruby Formatting Context (RFC) which
 - takes an inline item range (<ruby> range)
 - runs ruby inline axis layout -> computes base run logical widths using ruby column sizing
 - probes line breaking
 - places content on the current line

as far as line building is concerned.

* Source/WebCore/layout/formattingContexts/inline/InlineFormattingGeometry.cpp:
(WebCore::Layout::InlineFormattingGeometry::nextWrapOpportunity):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::LineCandidate::InlineContent::rubyContainerRange const):
(WebCore::Layout::LineCandidate::InlineContent::appendRubyContainerRange):
(WebCore::Layout::LineCandidate::InlineContent::isRuby const):
(WebCore::Layout::LineCandidate::InlineContent::reset):
(WebCore::Layout::LineBuilder::candidateContentForLine):
(WebCore::Layout::LineBuilder::handleInlineContent):
(WebCore::Layout::LineBuilder::handleRubyContent):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.h:
* Source/WebCore/layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isRuby const):

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




More information about the webkit-changes mailing list