[webkit-changes] [WebKit/WebKit] 1469b4: [Ruby] With vertical writing mode, inter-character...

Alan Baradlay noreply at github.com
Fri Sep 13 11:59:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1469b43361a4189c331516c8184af4d7a39cd0b2
      https://github.com/WebKit/WebKit/commit/1469b43361a4189c331516c8184af4d7a39cd0b2
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-09-13 (Fri, 13 Sep 2024)

  Changed paths:
    A LayoutTests/fast/ruby/vertical-inter-character-annotation-size-expected.html
    A LayoutTests/fast/ruby/vertical-inter-character-annotation-size.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-001.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-002.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-ruby/ruby-position-expected.txt
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-001-expected.txt
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-ruby/br-clear-all-002-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/CSSValueKeywords.in
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.h
    M Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.cpp
    M Source/WebCore/layout/layouttree/LayoutBox.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleConstants.cpp
    M Source/WebCore/rendering/style/RenderStyleConstants.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebCore/style/StyleBuilderState.cpp

  Log Message:
  -----------
  [Ruby] With vertical writing mode, inter-character ruby text is significantly smaller than over ruby text
https://bugs.webkit.org/show_bug.cgi?id=279557
<rdar://135732371>

Reviewed by Antti Koivisto.

ruby-position's 'inter-character' value behaves as 'over' in vertical writing modes. (see https://drafts.csswg.org/css-ruby/#rubypos)
However the prefixed version of ruby-position has a slightly different behavior where the annotation content gets a font-size multiplier of 0.25
regardless of the writing mode.

This patch ensure that while we keep the legacy behavior for prefixed ruby-position, the standards version works as expected (i.e. like over).

* LayoutTests/fast/ruby/vertical-inter-character-annotation-size-expected.html: Added.
* LayoutTests/fast/ruby/vertical-inter-character-annotation-size.html: Added.
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::toCSSValueID):
(WebCore::fromCSSValueID):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/CSSValueKeywords.in:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::valueForWebkitRubyPosition):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeWebKitRubyPosition):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
* Source/WebCore/layout/formattingContexts/inline/ruby/RubyFormattingContext.cpp:
(WebCore::Layout::rubyPosition):
(WebCore::Layout::RubyFormattingContext::hasInterCharacterAnnotation):
* Source/WebCore/layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isInterlinearRubyAnnotationBox const):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::isInterCharacterRubyPosition const):
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::determineRubyTextSizeMultiplier):
* Source/WebCore/style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::adjustStyleForInterCharacterRuby):

Let's introduce a new property value for legacy inter-character and use it when parsing -webkit-ruby-position to be able to
differentiate at font size adjustment time.

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



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


More information about the webkit-changes mailing list