[webkit-changes] [WebKit/WebKit] eff0d2: Implement white-space-collapse & text-wrap as long...

Commit Queue noreply at github.com
Fri Jun 16 22:58:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: eff0d22edb04a7bc761bc1fb0428abef8ccbb1ba
      https://github.com/WebKit/WebKit/commit/eff0d22edb04a7bc761bc1fb0428abef8ccbb1ba
  Author: David Choi <david_choi5 at apple.com>
  Date:   2023-06-16 (Fri, 16 Jun 2023)

  Changed paths:
    M LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
    M LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
    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-cascade/all-prop-revert-layer-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/white-space-shorthand-text-wrap-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/white-space-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/white-space.html
    M LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/platform/ios-wk2/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/css/css-cascade/all-prop-revert-layer-expected.txt
    M LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt
    M LayoutTests/svg/css/getComputedStyle-basic-expected.txt
    M Source/WebCore/animation/CSSPropertyAnimation.cpp
    M Source/WebCore/css/CSSComputedStyleDeclaration.cpp
    M Source/WebCore/css/CSSPrimitiveValueMappings.h
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/ComputedStyleExtractor.cpp
    M Source/WebCore/css/ComputedStyleExtractor.h
    M Source/WebCore/css/ShorthandSerializer.cpp
    M Source/WebCore/css/parser/CSSParserContext.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.h
    M Source/WebCore/editing/EditingStyle.cpp
    M Source/WebCore/html/HTMLInputElement.cpp
    M Source/WebCore/html/HTMLPreElement.cpp
    M Source/WebCore/html/HTMLTableCellElement.cpp
    M Source/WebCore/html/HTMLTextAreaElement.cpp
    M Source/WebCore/html/track/TextTrackCueGeneric.cpp
    M Source/WebCore/html/track/VTTCue.cpp
    M Source/WebCore/rendering/RenderListItem.cpp
    M Source/WebCore/rendering/RenderTheme.cpp
    M Source/WebCore/rendering/RenderThemeMac.mm
    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/RenderStyleInlines.h
    M Source/WebCore/style/PropertyAllowlist.cpp
    M Source/WebCore/style/StyleAdjuster.cpp
    M Source/WebCore/svg/SVGTextContentElement.cpp

  Log Message:
  -----------
  Implement white-space-collapse & text-wrap as longhands of white-space
https://bugs.webkit.org/show_bug.cgi?id=256927
rdar://109486221

Reviewed by Tim Nguyen.

This commit lays the groundwork for future work on white-space-collapse
and text-wrap. White-space is now parsed as a shorthand property, and
the longhand values for white-space (white-space-collapse and text-wrap)
are set accordingly.

The whiteSpace value in m_inheritedFlags in RenderStyle has been removed.
The RenderStyle.whiteSpace() method still exists, but it uses the two
longhand variables above to reconstruct the original value of whiteSpace.
The setWhiteSpace method has been removed, and any existing references
to setWhiteSpace have been replaced with the corresponding calls to
setWhiteSpaceCollapse and setTextWrap.

Further work needs to be done to properly integrate the white-space-collapse
and text-wrap longhands into WebKit. Currently, this commit preserves
the original behavior of white-space processing, but it assumes that
white-space-collapse and text-wrap only take on the combinations of
values that are achievable via the shorthand values of white-space.
(Otherwise, the whiteSpace getter in RenderStyle cannot reconstruct the
'original' value of white-space.) Thus, the codebase must replace
existing references to RenderStyle.whiteSpace() with appropriate references
to RenderStyle.whiteSpaceCollapse() and RenderStyle.textWrap() before
individually modifying the white-space-collapse and text-wrap properties.

* LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt:
* LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/white-space-shorthand-text-wrap-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/white-space-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-typed-om/the-stylepropertymap/properties/white-space.html:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ipad/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/svg/css/getComputedStyle-basic-expected.txt:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue const):
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::ComputedStyleExtractor::whiteSpaceShorthandValue):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* Source/WebCore/css/ComputedStyleExtractor.h:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
(WebCore::ShorthandSerializer::serializeWhiteSpace const):
* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::initialValueForLonghand):
(WebCore::CSSPropertyParser::consumeWhiteSpaceShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/editing/EditingStyle.cpp:
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::StyleChange::StyleChange):
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::createInnerTextStyle):
* Source/WebCore/html/HTMLPreElement.cpp:
(WebCore::HTMLPreElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::collectPresentationalHintsForAttribute):
* Source/WebCore/html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* Source/WebCore/html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
* Source/WebCore/rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle const):
* Source/WebCore/rendering/RenderTheme.cpp:
(WebCore::RenderTheme::adjustStyle):
* Source/WebCore/rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::adjustMenuListStyle const):
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::RenderStyle):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::whiteSpace const):
* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::whiteSpace const): Deleted.
(WebCore::RenderStyle::setWhiteSpace): Deleted.
* Source/WebCore/rendering/style/RenderStyleConstants.cpp:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::InheritedFlags::operator== const):
* Source/WebCore/style/PropertyAllowlist.cpp:
(WebCore::Style::isValidMarkerStyleProperty):
(WebCore::Style::isValidCueStyleProperty):
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
* Source/WebCore/svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::collectPresentationalHintsForAttribute):

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




More information about the webkit-changes mailing list