[webkit-changes] [WebKit/WebKit] 5163a8: [text-box-edge/line-fit-edge] Add support for line...

Alan Baradlay noreply at github.com
Wed Aug 14 05:10:35 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5163a893fe8bd3f1ef116cfa4aaa71251ceed4c6
      https://github.com/WebKit/WebKit/commit/5163a893fe8bd3f1ef116cfa4aaa71251ceed4c6
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M LayoutTests/fast/text/text-box-edge-property-parsing-expected.txt
    M LayoutTests/fast/text/text-box-edge-property-parsing.html
    M LayoutTests/fast/text/text-box-edge-with-margin-padding-border-simple-expected-mismatch.html
    M LayoutTests/fast/text/text-box-edge-with-margin-padding-border-simple.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-inline/text-box-trim/inheritance-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/inheritance.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-computed.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-invalid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-valid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-inline/text-box-trim/text-box-edge-valid.html
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/property-list.js
    M LayoutTests/platform/ios/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/platform/ipad/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt
    M LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
    M Source/WebCore/Headers.cmake
    M Source/WebCore/Sources.txt
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp
    M Source/WebCore/css/parser/CSSPropertyParserHelpers.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h
    M Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
    M Source/WebCore/rendering/style/RenderStyle.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/StyleRareInheritedData.cpp
    M Source/WebCore/rendering/style/StyleRareInheritedData.h
    M Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
    M Source/WebCore/rendering/style/StyleRareNonInheritedData.h
    R Source/WebCore/rendering/style/StyleTextBoxEdge.cpp
    R Source/WebCore/rendering/style/StyleTextBoxEdge.h
    A Source/WebCore/rendering/style/StyleTextEdge.cpp
    A Source/WebCore/rendering/style/StyleTextEdge.h
    M Source/WebCore/style/StyleBuilderConverter.h

  Log Message:
  -----------
  [text-box-edge/line-fit-edge] Add support for line-fit-edge and update text-box-edge
https://bugs.webkit.org/show_bug.cgi?id=278030

Reviewed by Antti Koivisto.

This patch updates text-box-edge implementation to match changes added as part of "Changes since the 1 April 2023 Working Draft:"
(https://drafts.csswg.org/css-inline-3/#changes)

1. text-box-edge has new initial value of auto
2. text-box-edge is not inherited anymore (moving out of rare-inherited)
3. However text-box-edge: auto uses the newly introduce css property of line-fit-edge's value
4. Add line-fit-edge (initial value of leading and inherited)
5. Update inline layout logic to consult the correct css property

Most of the style logic is shared between these 2 properly using TextEdgeType. It helps to map the used values between text-box-edge and line-fit-edge.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
(WebCore::toCSSValueID):
(WebCore::fromCSSValueID):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::valueForTextBoxEdge):
(WebCore::valueForLineFitEdge):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::initialValueForLonghand):
* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeTextEdge):
(WebCore::CSSPropertyParserHelpers::consumeTextBoxEdge): Deleted.
* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBox.h:
(WebCore::Layout::InlineLevelBox::textBoxEdge const):
(WebCore::Layout::InlineLevelBox::lineFitEdge const):
* Source/WebCore/layout/formattingContexts/inline/InlineLevelBoxInlines.h:
(WebCore::Layout::m_style):
* Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp:
(WebCore::Layout::isLineFitEdgeLeading):
(WebCore::Layout::ascentAndDescentWithTextBoxEdgeForInlineBox):
(WebCore::Layout::LineBoxBuilder::enclosingAscentDescentWithFallbackFonts const):
(WebCore::Layout::LineBoxBuilder::setLayoutBoundsForInlineBox const):
(WebCore::Layout::LineBoxBuilder::applyTextBoxTrimIfNeeded const):
(WebCore::Layout::isTextBoxEdgeLeading): Deleted.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::rareDataChangeRequiresLayout):
(WebCore::rareInheritedDataChangeRequiresLayout):
(WebCore::RenderStyle::conservativelyCollectChangedAnimatableProperties const):
(WebCore::RenderStyle::textBoxEdge const):
(WebCore::RenderStyle::setTextBoxEdge):
(WebCore::RenderStyle::initialTextBoxEdge):
(WebCore::RenderStyle::lineFitEdge const):
(WebCore::RenderStyle::setLineFitEdge):
(WebCore::RenderStyle::initialLineFitEdge):
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* Source/WebCore/rendering/style/RenderStyleConstants.h:
* Source/WebCore/rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* Source/WebCore/rendering/style/StyleRareInheritedData.h:
* Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/rendering/style/StyleTextEdge.cpp: Renamed from Source/WebCore/rendering/style/StyleTextBoxEdge.cpp.
(WebCore::operator<<):
* Source/WebCore/rendering/style/StyleTextEdge.h: Renamed from Source/WebCore/rendering/style/StyleTextBoxEdge.h.
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextEdge):
(WebCore::Style::BuilderConverter::convertTextBoxEdge): Deleted.

Canonical link: https://commits.webkit.org/282228@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