Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 48ed528d4e27ad7f8424955add1d503ed28f0ee6
      
https://github.com/WebKit/WebKit/commit/48ed528d4e27ad7f8424955add1d503ed28f0ee6
  Author: Ahmad Saleem <[email protected]>
  Date:   2024-09-26 (Thu, 26 Sep 2024)

  Changed paths:
    A 
LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-detached-expected.txt
    A LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-detached.html
    A 
LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-exception-expected.txt
    A LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-exception.html
    M Source/WebCore/svg/SVGGeometryElement.cpp
    M Source/WebCore/svg/SVGGeometryElement.h
    M Source/WebCore/svg/SVGPathElement.cpp
    M Source/WebCore/svg/SVGPathElement.h

  Log Message:
  -----------
  [SVG2] Sync `getTotalLength()` with web specification to throw exception when 
non-renderable and path is empty

https://bugs.webkit.org/show_bug.cgi?id=280350
rdar://136719548

Reviewed by Said Abou-Hallawa.

This patch aligns WebKit with Web Specification [1]:

[1] 
https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getTotalLength

"If current element is a non-rendered element, and the UA is not able to
compute the total length of the path, then throw an InvalidStateError."

In following patch, we update to throw exception when there is no `renderer`
and also when path is empty similar to `getPointAtLength`.

It merges tests from following Chromium commit [2]:

[2] 
https://source.chromium.org/chromium/chromium/src/+/5ad2c261332caaad06a0827addccb575215e87b7

* Source/WebCore/svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::getTotalLength const):
(WebCore::SVGGeometryElement::getPointAtLength const):
* Source/WebCore/svg/SVGGeometryElement.h:
* Source/WebCore/svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::getTotalLength const):
(WebCore::SVGPathElement::getPointAtLength const):
* Source/WebCore/svg/SVGPathElement.h:
* LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-exception.html:
* LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-exception-expected.txt:
* LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-detached.html:
* LayoutTests/svg/dom/SVGGeometryElement-getTotalLength-detached-expected.txt:

Canonical link: https://commits.webkit.org/284311@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