Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 98c7df9af85fbea21d3bf6328bf3d92a10be31dc
      
https://github.com/WebKit/WebKit/commit/98c7df9af85fbea21d3bf6328bf3d92a10be31dc
  Author: Chris Dumez <[email protected]>
  Date:   2026-06-19 (Fri, 19 Jun 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-none-whitespace-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-none-whitespace.html
    M Source/WebCore/css/calc/CSSCalcTree+Parser.cpp

  Log Message:
  -----------
  clamp() fails to parse whitespace after 'none'
https://bugs.webkit.org/show_bug.cgi?id=317469

Reviewed by Darin Adler.

When parsing a 'none' bound, consumeClamp() consumed only the 'none' token via
CSSParserTokenRange::consume(), leaving any trailing whitespace in the range.
The <calc-sum> branch, by contrast, ends in consumeIncludingWhitespace(). Since
consumeCommaIncludingWhitespace() requires the next token to be a comma (it does
not skip leading whitespace), a space between 'none' and the following comma 
made
the comma check fail; likewise, trailing whitespace after a final 'none' tripped
the atEnd() check. As a result, clamp(none , 5px, 10px) and clamp(5px, 6px, 
none )
were rejected even though clamp(none, 5px, 10px) and clamp(5px, 6px, none) 
parsed.

Consume the trailing whitespace after 'none', matching the <calc-sum> branch.

Test: imported/w3c/web-platform-tests/css/css-values/clamp-none-whitespace.html

The test is failing in Shipping Safari but passing in Chrome and Firefox.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-none-whitespace-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-values/clamp-none-whitespace.html:
 Added.
* Source/WebCore/css/calc/CSSCalcTree+Parser.cpp:
(WebCore::CSSCalc::consumeClamp):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to