[webkit-changes] [WebKit/WebKit] 19c64d: [IFC][Ruby] Nested rubies with interlinear annotat...

Alan Baradlay noreply at github.com
Tue Dec 5 22:00:39 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 19c64d9bd82280614cc3d445f6c2bc4704b64fb4
      https://github.com/WebKit/WebKit/commit/19c64d9bd82280614cc3d445f6c2bc4704b64fb4
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp
    M Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.cpp
    M Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.h

  Log Message:
  -----------
  [IFC][Ruby] Nested rubies with interlinear annotations pushes their ancestors' interlinear annotations vertically
https://bugs.webkit.org/show_bug.cgi?id=265881

Reviewed by Antti Koivisto.

<ruby>base<ruby>nested base<rt>nested annotation</rt></ruby><rt>annotation</rt>

Outer ruby's annotation should be placed above the inner ruby (including annotation) to avoid overlapping.

Normally inline boxes don't get stretched by their content so the inner ruby does not
make the other ruby's margin box taller.
However in order to avoid annotation overlapping, rubies need to be special cased where the nested
ruby's annotation pushes ancestor annotations vertically.

Let's move annotation placement _after_ finishing with child ruby handling and adjust (but not set) the candidate rect with
the descendant annotations for RubyFormattingContext::placeAnnotationBox.

* Source/WebCore/layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::processRubyBase):
* Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.cpp:
(WebCore::Layout::RubyFormattingContext::placeAnnotationBox):
* Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.h:

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




More information about the webkit-changes mailing list