Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 19966d8fdd43b807d9b7bf6ea89538663f040763
      
https://github.com/WebKit/WebKit/commit/19966d8fdd43b807d9b7bf6ea89538663f040763
  Author: Kiet Ho <[email protected]>
  Date:   2025-03-31 (Mon, 31 Mar 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-try-parsing-expected.txt
    M Source/WebCore/css/ShorthandSerializer.cpp
    M Source/WebCore/css/parser/CSSPropertyParser.cpp
    M Source/WebCore/css/parser/CSSPropertyParserConsumer+PositionTry.cpp

  Log Message:
  -----------
  [css-anchor-position-1] Fix various bugs in position-try shorthand parser and 
serializer
rdar://148068669
https://bugs.webkit.org/show_bug.cgi?id=290593

Reviewed by Antti Koivisto.

There are some bugs in the parser/serializer code for position-try shorthand:
* The shorthand serializer uses serializeLonghandsOmittingInitialValues,
  however the position-try-fallbacks portion must always be serialized,
  whether it has the initial value or not
* The shorthand parser doesn't detect when not all tokens have been consumed
* The parser doesn't reject an empty fallback (a fallback without a
  position-area, nor a @position-try rule ident/tactic)

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-anchor-position/parsing/position-try-parsing-expected.txt:
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
    - Use serializePositionTry instead of 
serializeLonghandsOmittingInitialValues
      for position-try.

(WebCore::ShorthandSerializer::serializePositionTry const):
    - Add specialized serialization function for position-try.

* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::consumePositionTryShorthand):
    - Return whether all tokens have been consumed or not. This indicates
      whether parsing is successful or not.

* Source/WebCore/css/parser/CSSPropertyParserConsumer+PositionTry.cpp:
(WebCore::CSSPropertyParserHelpers::consumePositionTryFallbacks):
    - Rearrange code a bit to make it easier to understand.
    - Bail out if an empty fallback is encountered.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to