Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: Use DOMPointInit for getCharNumAtPosition, isPointInFill, isPointInStroke

256 views
Skip to first unread message

Chromestatus

unread,
Mar 25, 2025, 1:59:53 PMMar 25
to blin...@chromium.org, vinay...@microsoft.com

Contact emails

vinay...@microsoft.com

Explainer

None

Specification

https://svgwg.org/svg2-draft

Summary

This change brings Chromium code in line with the latest W3C spec for SVGGeometryElement and SVGPathElement in terms of usage of DOMPointInit over SVGPoint for getCharNumAtPosition, isPointInFill, isPointInStroke. The change has already landed: https://chromium-review.googlesource.com/c/chromium/src/+/6284886 Firefox and Safari already have this live making this a fairly safe change to land. Details for both added under Signals for both.



Blink component

Blink>SVG

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is already implemented in Firefox and Safari with no reported open issues. Moreover, DOMPointInit is a superset of SVGPoint, but the extra params do have default values to support backward compatibility. We have however introduced some checks on Nan/Infinite values but those are exclusively to handle invalid requests to these APIs, say trying to access points at (Infinity, Nan) - (x,y) coordinate. And even then, we simply return back with a default value instead of throwing back an exception.



Gecko: Shipped/Shipping (https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/isPointInFill) Firefox uses DOMPointInit already in the corresponding API: https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometryElement/isPointInFill Also, WPT has been passing for Firefox indicating that they have implemented this already: https://wpt.fyi/results/svg/types/scripted/SVGGeometryElement.isPointInFill-01.svg

WebKit: Shipped/Shipping (https://github.com/WebKit/WebKit/commit/7589919c57641e1e3dac86872171d4d681e3f2d0) Webkit (Safari) already uses DOMPointInit in these APIs. Here is the commit link for one of the APIs: https://github.com/WebKit/WebKit/commit/7589919c57641e1e3dac86872171d4d681e3f2d0 Also, WPT has been passing for Safari indicating that they have implemented this already: https://wpt.fyi/results/svg/types/scripted/SVGGeometryElement.isPointInFill-01.svg

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

The SVGTextContentElement interface in JavaScript is implemented by elements that support rendering child text content. This interface is inherited by various text-related interfaces, such as SVGTextElement, SVGTSpanElement, SVGTRefElement, and SVGTextPathElement. Any of the above elements can be used to access and test APIs in SVGTextContentElement interface. For SVGGeometryElement, it is implemented by Geometry elements like SVGRectElement and SVGCircleElement. Objects of these classes can be used to access and test APIs in SVGGeometryElement interface.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

* https://wpt.fyi/results/svg/types/scripted/SVGAnimatedEnumeration-SVGTextContentElement.html * https://wpt.fyi/results/svg/types/scripted/SVGGeometryElement.isPointInFill-01.svg



Flag name on about://flags

None

Finch feature name

None

Non-finch justification

This is a simple spec catch up in Chromium which is already implemented in Firefox and Safari. Also, this change cannot be put behind a feature flag since it is a change in method/API signature. However, Firefox and Safari already have this live making this a fairly safe change to land. Details for both added under Signals for both.



Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/40572887

Estimated milestones

Shipping on desktop 136
Shipping on Android 136
Shipping on iOS 136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5203869052960768?gate=5197116357738496

This intent message was generated by Chrome Platform Status.

TAMURA, Kent

unread,
Mar 25, 2025, 7:50:49 PMMar 25
to vinay...@microsoft.com, blin...@chromium.org, Chromestatus
On Wed, Mar 26, 2025 at 2:59 AM Chromestatus <ad...@cr-status.appspotmail.com> wrote:

Contact emails

vinay...@microsoft.com

Explainer

None

Specification

https://svgwg.org/svg2-draft

Summary

This change brings Chromium code in line with the latest W3C spec for SVGGeometryElement and SVGPathElement in terms of usage of DOMPointInit over SVGPoint for getCharNumAtPosition, isPointInFill, isPointInStroke. The change has already landed: https://chromium-review.googlesource.com/c/chromium/src/+/6284886 Firefox and Safari already have this live making this a fairly safe change to land. Details for both added under Signals for both.



Blink component

Blink>SVG

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is already implemented in Firefox and Safari with no reported open issues. Moreover, DOMPointInit is a superset of SVGPoint, but the extra params do have default values to support backward compatibility. We have however introduced some checks on Nan/Infinite values but those are exclusively to handle invalid requests to these APIs, say trying to access points at (Infinity, Nan) - (x,y) coordinate. And even then, we simply return back with a default value instead of throwing back an exception.


Will code using createSVGPoint() still work after the change?
 
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/67e2ef0b.170a0220.2e951e.01ad.GAE%40google.com.


--
TAMURA Kent
Software Engineer, Google


Vinay Singh

unread,
Mar 26, 2025, 10:55:35 AMMar 26
to TAMURA, Kent, blin...@chromium.org, Chromestatus
Yes, createSVGPoint() will still work.
We have a WPT as well to ensure it.
https://wpt.fyi/results/svg/types/scripted/SVGGeometryElement.isPointInStroke-02.svg

Thanks,
Vinay

From: TAMURA, Kent <tk...@chromium.org>
Sent: Wednesday, March 26, 2025 05:20 AM
To: Vinay Singh <vinay...@microsoft.com>; blin...@chromium.org <blin...@chromium.org>
Cc: Chromestatus <ad...@cr-status.appspotmail.com>
Subject: [EXTERNAL] Re: [blink-dev] Intent to Ship: Use DOMPointInit for getCharNumAtPosition, isPointInFill, isPointInStroke
 
You don't often get email from tk...@chromium.org. Learn why this is important

Yoav Weiss (@Shopify)

unread,
Mar 26, 2025, 11:22:29 AMMar 26
to blink-dev, vinay...@microsoft.com, Chromestatus, Kent Tamura
LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Chris Harrelson

unread,
Mar 26, 2025, 11:24:46 AMMar 26
to Yoav Weiss (@Shopify), blink-dev, vinay...@microsoft.com, Chromestatus, Kent Tamura
LGTM2

LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.


--
TAMURA Kent
Software Engineer, Google


--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/f79155ea-f89d-4347-ac5b-801f3e5ea310n%40chromium.org.

Daniel Bratell

unread,
Mar 26, 2025, 11:29:34 AMMar 26
to Chris Harrelson, Yoav Weiss (@Shopify), blink-dev, vinay...@microsoft.com, Chromestatus, Kent Tamura
Reply all
Reply to author
Forward
0 new messages