[webkit-changes] [WebKit/WebKit] 11eb34: [@property] <declaration-value> used in initial-va...

Antti Koivisto noreply at github.com
Wed Dec 21 14:03:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 11eb340cd2d87f5b32d8b746e829eda7ab2f2d18
      https://github.com/WebKit/WebKit/commit/11eb340cd2d87f5b32d8b746e829eda7ab2f2d18
  Author: Antti Koivisto <antti at apple.com>
  Date:   2022-12-21 (Wed, 21 Dec 2022)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-cssom-expected.txt
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/CSSProperty.h
    M Source/WebCore/css/CSSPropertyRule.cpp
    M Source/WebCore/css/parser/CSSParserImpl.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/css/process-css-properties.py

  Log Message:
  -----------
  [@property] <declaration-value> used in initial-value descriptor should preserve whitespace
https://bugs.webkit.org/show_bug.cgi?id=249731
rdar://103607902

Reviewed by Sam Weinig.

The 'initial-value' descriptor has syntax <declaration-value> and it should preserve whitespace.

https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value

* LayoutTests/imported/w3c/web-platform-tests/css/css-properties-values-api/at-property-cssom-expected.txt:
* Source/WebCore/css/CSSProperties.json:

Use parser-grammar: "<declaration-value>"

* Source/WebCore/css/CSSProperty.h:
* Source/WebCore/css/CSSPropertyRule.cpp:
(WebCore::CSSPropertyRule::cssText const):

Don't add extra space when serializing.

* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclaration):

Trim whitespace conditionally.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseValue):

Trim whitespace conditionally.

* Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeDeclarationValue):
(WebCore::CSSPropertyParserHelpers::consumePropertyInitialValue): Deleted.
* Source/WebCore/css/parser/CSSPropertyParserHelpers.h:
* Source/WebCore/css/process-css-properties.py:
(PropertiesAndDescriptors):
(PropertiesAndDescriptors.all_preserving_whitespace):
(ReferenceTerm):

Add a build-in type for <declaration-value>.

(Grammar):
(Grammar.preserve_whitespace):

Those have a special property that they preserve whitespace.

(GenerateCSSPropertyNames):

Generate Property::shouldPreserveWhitespace().

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




More information about the webkit-changes mailing list