[webkit-changes] [WebKit/WebKit] 6abbfb: Implement percentage values for letter-spacing and...

fantasai noreply at github.com
Thu Nov 30 13:52:41 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6abbfb00701a455534e7d9af010909a6dc2b66ed
      https://github.com/WebKit/WebKit/commit/6abbfb00701a455534e7d9af010909a6dc2b66ed
  Author: Elika Etemad <fantasai.bugs at inkedblade.net>
  Date:   2023-11-30 (Thu, 30 Nov 2023)

  Changed paths:
    M LayoutTests/css1/text_properties/letter_spacing.html
    M LayoutTests/css2.1/t1604-c542-letter-sp-01-b-a.html
    R LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-expected.html
    R LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html
    R LayoutTests/fast/text/synthetic-bold-percentage-word-spacing-expected.html
    R LayoutTests/fast/text/synthetic-bold-percentage-word-spacing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/inheritance.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-percent-001-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-percent-001.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-computed.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-invalid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-valid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-valid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-computed-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-computed.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-invalid.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-valid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-valid.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-002-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-002.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-computed-001.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-percent-001-expected.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-percent-001.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/letter-spacing-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/animations/calc-interpolation-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-letter-spacing.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/minmax-length-invalid-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-values/minmax-length-invalid.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/platform/glib/css1/text_properties/letter_spacing-expected.txt
    M LayoutTests/platform/glib/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt
    M LayoutTests/platform/gtk/css1/text_properties/letter_spacing-expected.png
    M LayoutTests/platform/ios/css1/text_properties/letter_spacing-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 LayoutTests/platform/mac/css1/text_properties/letter_spacing-expected.png
    M LayoutTests/platform/mac/css1/text_properties/letter_spacing-expected.txt
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/inspector/InspectorOverlay.cpp
    M Source/WebCore/inspector/InspectorOverlayLabel.cpp
    M Source/WebCore/layout/formattingContexts/inline/InlineLine.h
    M Source/WebCore/page/DebugPageOverlays.cpp
    M Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
    M Source/WebCore/platform/graphics/FontCascade.cpp
    M Source/WebCore/platform/graphics/FontCascade.h
    M Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
    M Source/WebCore/platform/win/DragImageWin.cpp
    M Source/WebCore/rendering/RenderCombineText.cpp
    M Source/WebCore/rendering/RenderEmbeddedObject.cpp
    M Source/WebCore/rendering/RenderLayerBacking.cpp
    M Source/WebCore/rendering/RenderListBox.cpp
    M Source/WebCore/rendering/style/RenderStyle.cpp
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/svg/RenderSVGInlineText.cpp
    M Source/WebCore/style/StyleBuilderConverter.h
    M Source/WebCore/style/StyleBuilderCustom.h
    M Source/WebKit/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp

  Log Message:
  -----------
  Implement percentage values for letter-spacing and word-spacing per css-text-4
https://bugs.webkit.org/show_bug.cgi?id=262762
rdar://problem/116562262

Reviewed by Antti Koivisto and Matthieu Dubet.

Updates property grammars to accept <length-percentage>.
Shifts storage of word-spacing and letter-spacing on FontCascade
  from float to Length so that it inherits correctly.
Updates float accessors to compute the Length against current font-size.
Adds computed value accessors.
Adapts FontCascade constructors to more cleanly support cloning vs resetting.

Note: letter-spacing and word-spacing values need to live on FontCascade
because they're used for text measurement routines, which don't have
access to RenderStyle.

* LayoutTests/css1/text_properties/letter_spacing.html:
* LayoutTests/css2.1/t1604-c542-letter-sp-01-b-a.html:
* LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage-expected.html: Removed.
* LayoutTests/fast/css3-text/css3-word-spacing-percentage/word-spacing-percentage.html: Removed.
* LayoutTests/fast/text/synthetic-bold-percentage-word-spacing-expected.html: Removed.
* LayoutTests/fast/text/synthetic-bold-percentage-word-spacing.html: Removed.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/inheritance.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-percent-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/letter-spacing/letter-spacing-percent-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-computed.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-invalid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-invalid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/letter-spacing-valid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-computed.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-invalid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-invalid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-valid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/word-spacing-valid.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-002-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-002.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-computed-001-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-computed-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-negative-value-001-expected.xht: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-negative-value-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-percent-001-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/word-spacing/word-spacing-percent-001.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/letter-spacing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/letter-spacing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/animations/calc-interpolation-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/calc-letter-spacing.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/minmax-length-invalid-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-values/minmax-length-invalid.html:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
* LayoutTests/platform/glib/css1/text_properties/letter_spacing-expected.txt:
* LayoutTests/platform/gtk/css1/text_properties/letter_spacing-expected.png:
* LayoutTests/platform/mac/css1/text_properties/letter_spacing-expected.png:
* LayoutTests/platform/mac/css1/text_properties/letter_spacing-expected.txt:
* LayoutTests/platform/wincairo/TestExpectations:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
* Source/WebCore/inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawRulers):
* Source/WebCore/inspector/InspectorOverlayLabel.cpp:
(WebCore::systemFont):
* Source/WebCore/layout/formattingContexts/inline/InlineLine.h:
* Source/WebCore/page/DebugPageOverlays.cpp:
(WebCore::NonFastScrollableRegionOverlay::drawRect):
(WebCore::InteractionRegionOverlay::drawSettings):
* Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp:
* Source/WebCore/platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
(WebCore::FontCascade::operator=):
(WebCore::FontCascade::operator== const):
(WebCore::FontCascade::letterSpacing const):
(WebCore::FontCascade::wordSpacing const):
* Source/WebCore/platform/graphics/FontCascade.h:
(WebCore::FontCascade::computedLetterSpacing const):
(WebCore::FontCascade::computedWordSpacing const):
(WebCore::FontCascade::setLetterSpacing):
(WebCore::FontCascade::setWordSpacing):
(WebCore::FontCascade::textAutospace const):
(WebCore::FontCascade::equalForTextAutoSizing const):
(WebCore::FontCascade::Spacing::Spacing):
(WebCore::FontCascade::Spacing::operator== const):
(WebCore::FontCascade::wordSpacing const): Deleted.
(WebCore::FontCascade::letterSpacing const): Deleted.
* Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* Source/WebCore/platform/win/DragImageWin.cpp:
(WebCore::dragLabelFont):
* Source/WebCore/rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
* Source/WebCore/rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry const):
* Source/WebCore/rendering/RenderLayerBacking.cpp:
(WebCore::patternForDescription):
* Source/WebCore/rendering/RenderListBox.cpp:
(WebCore::bolder):
(WebCore::RenderListBox::paintItemForeground):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedWordSpacing const):
(WebCore::RenderStyle::computedLetterSpacing const):
(WebCore::RenderStyle::setFontDescription):
(WebCore::RenderStyle::setLetterSpacing):
(WebCore::RenderStyle::setWordSpacing):
(WebCore::RenderStyle::wordSpacing const): Deleted.
(WebCore::RenderStyle::letterSpacing const): Deleted.
(WebCore::RenderStyle::setLetterSpacingWithoutUpdatingFontDescription): Deleted.
* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialLetterSpacing): Deleted.
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::initialLetterSpacing):
(WebCore::RenderStyle::letterSpacing const):
(WebCore::RenderStyle::wordSpacing const):
* Source/WebCore/rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertTextLengthOrNormal):
(WebCore::Style::BuilderConverter::convertSpacing): Deleted.
(WebCore::Style::BuilderConverter::convertWordSpacing): Deleted.
* Source/WebCore/style/StyleBuilderCustom.h:
(WebCore::Style::BuilderCustom::applyInheritWordSpacing):
(WebCore::Style::BuilderCustom::applyInheritLetterSpacing):
(WebCore::Style::BuilderCustom::applyInitialLetterSpacing):
(WebCore::Style::BuilderCustom::applyValueLetterSpacing):
(WebCore::Style::applyLetterSpacing): Deleted.

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




More information about the webkit-changes mailing list