Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: aaa4976475c39a74135de7798905e3936380d06f
      
https://github.com/WebKit/WebKit/commit/aaa4976475c39a74135de7798905e3936380d06f
  Author: Ahmad Saleem <[email protected]>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

  Changed paths:
    M LayoutTests/svg/css/parse-height-expected.txt
    M LayoutTests/svg/css/parse-length-expected.txt
    R LayoutTests/svg/hixie/error/015-expected.png
    R LayoutTests/svg/hixie/error/015-expected.txt
    R LayoutTests/svg/hixie/error/015.xml
    A LayoutTests/svg/parser/whitespace-length-expected.txt
    A LayoutTests/svg/parser/whitespace-length.html
    M Source/WebCore/svg/SVGLengthValue.cpp

  Log Message:
  -----------
  SVG length parsing fails with leading/trailing whitespace
https://bugs.webkit.org/show_bug.cgi?id=303218
rdar://165501190

Reviewed by Brent Fulgham.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

SVGLengthValue::setValueAsString had below bug:

-  The CSS tokenizer doesn't handle leading whitespace, but SVG expects
   whitespace to be trimmed per the SVG/XML spec. Fixed by trimming
   ASCII whitespace before parsing. NOTE: consumeWhitespace() does not
   handle `\t` as well.

This patch also import `whitespace-length.html` from Blink / Chromium tip
of tree for coverage.

Test: svg/parser/whitespace-length.html
* LayoutTests/svg/css/parse-height-expected.txt:
* LayoutTests/svg/css/parse-length-expected.txt:
* LayoutTests/svg/hixie/error/015-expected.png: Removed.
* LayoutTests/svg/hixie/error/015-expected.txt: Removed.
* LayoutTests/svg/hixie/error/015.xml: Removed.
* LayoutTests/svg/parser/whitespace-length-expected.txt: Added.
* LayoutTests/svg/parser/whitespace-length.html: Added.
* Source/WebCore/svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::setValueAsString):

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



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

Reply via email to