[webkit-changes] [WebKit/WebKit] cee0d6: Fix font-variant shorthand serialization

Tim Nguyen noreply at github.com
Mon Nov 14 19:47:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cee0d60d4af3a42f1dfecc60aeb3928df9d7d2c1
      https://github.com/WebKit/WebKit/commit/cee0d60d4af3a42f1dfecc60aeb3928df9d7d2c1
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2022-11-14 (Mon, 14 Nov 2022)

  Changed paths:
    M LayoutTests/fast/css/font-property-priority-expected.txt
    M LayoutTests/fast/text/font-variant-shorthand-expected.txt
    M LayoutTests/fast/text/font-variant-shorthand.html
    A LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-variant-shorthand-serialization-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-variant-shorthand-serialization.html
    M Source/WebCore/css/CSSProperties.json
    M Source/WebCore/css/StyleProperties.cpp
    M Source/WebCore/css/StyleProperties.h
    M Source/WebCore/css/parser/CSSPropertyParser.cpp

  Log Message:
  -----------
  Fix font-variant shorthand serialization
https://bugs.webkit.org/show_bug.cgi?id=247919
rdar://102339716

Reviewed by Darin Adler.

- Fixed bug where font-variant-ligatures: none + another non-default longhand would serialize even if it not possible
- Clean up fontValue()/fontVariantValue() to not consider implicit/explicit anymore used to represent default/system values
- Refactor to remove appendFontLonghandValueIfExplicit()

* LayoutTests/fast/text/font-variant-shorthand-expected.txt:
* LayoutTests/fast/text/font-variant-shorthand.html:
* LayoutTests/fast/css/font-property-priority-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-shorthand-serialization-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-variant-shorthand-serialization-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-variant-shorthand-serialization.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/cssom/font-shorthand-serialization-expected.txt:
* Source/WebCore/css/CSSProperties.json:
Updated ordering to match order from the spec (which matters for serialization).

* Source/WebCore/css/StyleProperties.cpp:
(WebCore::StyleProperties::fontValue const):
Inlined parts of appendFontLonghandValueIfExplicit, simplified font-stretch handling.

(WebCore::StyleProperties::fontVariantValue const):
Rewrite to stop using appendFontLonghandValueIfExplicit, fix various serialization issues when collapsing longhands.

(WebCore::canUseShorthandForLonghand):
Add notes on why collapsing is not possible.

(WebCore::StyleProperties::appendFontLonghandValueIfExplicit const): Deleted.

* Source/WebCore/css/StyleProperties.h:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumeFontVariantShorthand):

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




More information about the webkit-changes mailing list