Closed Bug 1954044 Opened 5 months ago Closed 4 months ago

anseki.github.io - The LeaderLine Javascripts objects don't work anymore

Categories

(Web Compatibility :: Site Reports, defect, P1)

Desktop
All

Tracking

(Webcompat Score:4, Webcompat Priority:P3, firefox-esr128 unaffected, firefox136 wontfix, firefox137 wontfix, firefox138 verified, firefox139 verified)

VERIFIED FIXED
139 Branch
Webcompat Score 4
Webcompat Priority P3
Tracking Status
firefox-esr128 --- unaffected
firefox136 --- wontfix
firefox137 --- wontfix
firefox138 --- verified
firefox139 --- verified

People

(Reporter: railioaie, Assigned: longsonr)

References

(Regression, )

Details

(Keywords: regression, webcompat:site-report, Whiteboard: [webcompat-source:web-bugs])

User Story

platform:windows,mac,linux,android
impact:content-missing
configuration:general
affects:all
branch:release
user-impact-score:60

Attachments

(4 files)

Environment:
Operating system: Mac OS X 10.15
Firefox version: Firefox 137.0

Preconditions:
Clean profile

Steps to reproduce:

  1. Navigate to : https://anseki.github.io/leader-line/
  2. Observe

Expected Behavior:
The page is displayed correctly

Actual Behavior:
The LeaderLine Javascripts objects don't work anymore(see attachments)

Notes:

  • Reproduces regardless of the status of ETP
  • Reproduces in firefox-nightly, and firefox-release
  • Does not reproduce in chrome

Created from https://github.com/webcompat/web-bugs/issues/150099

Summary: anseki.github.io - The page is not displayed corectly → anseki.github.io - The LeaderLine Javascripts objects don't work anymore

I can reproduce the issue on Nightly138.0a1 Windows11.

The following error is shown in Browser Console.

TypeError: can't access property "results", queryContext is undefined

Uncaught TypeError: SVGPathElement.setPathData: Element of argument 1 does not implement interface SVGPathSegment.
$e https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
it https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
setOptions https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
ot https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
<anonymous> https://anseki.github.io/leader-line/:45
EventListener.handleEvent* https://anseki.github.io/leader-line/:42
libs-d4667dd-211118164156.js:3:45362
$e https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
it https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
setOptions https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
ot https://anseki.github.io/leader-line/js/libs-d4667dd-211118164156.js:3
<anonymous> https://anseki.github.io/leader-line/:45
(Async: EventListener.handleEvent)
<anonymous> https://anseki.github.io/leader-line/:42

*** snip ***

OS: macOS → All

It's creating functions getPathData & setPathData on the path element. Unfortunately they already have meaning in the new SVG path specification.

I suspect the javascript tries to implement the SVG Path data interface but the interface it implements is not quite the same as the interface that the specification defines. It can't or doesn't override the native interface but then when it tries to use the SVG Path interface it runs into trouble because the way the SVG Path interface actually works isn't the same as the implementer of the site thought it should work.

Webcompat Score: --- → 1

I wanted to suggest outreach, but their repo is archived. Unless this is being used on a real site instead of just a demo page, there isn't much we can do.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WONTFIX

James, can you maybe try to find real-world sites that use this library?

Flags: needinfo?(james)

This can be reproduced in the console: let temp0 be an SVG <path> element, then evaluate temp0.setPathData([{"type":"M","values":[0,0]}]) in the console. In Firefox this throws an exception but it works in Chrome (and sets temp0's d attribute to M 0 0).

Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---

The fact that this is a regression from adding the feature is known, the question is whether there's any compat impact other than breaking the demo page of an unmaintained library.

From the HTTPArchive 10k sample I found https://chartink.com/build/assets/vue-clipboard-c01e20e0.js that's using this library. I didn't immediately find any breakage on chartlink.com

https://www.npmjs.com/browse/depended/leader-line also shows 34 packages that depend on leader-line, some of which seem to have relatively recent updates. However the vast majority have <10 weekly downloads. https://www.npmjs.com/package/deseruntnam has the most weekly downloads, and https://github.com/EstevanKlein/deseruntnam/blob/440d6c65cb872469704da3b332a3b2c0c4e71821/products/devex/src/components/DetailsPages/TxnDetailsPage/TxBlock.tsx#L53 does seem to use this library, but I have no idea what that repo is or where it's deployed.

Just searching for \.(?:get|set)PathData returns a lot of matches (~1000): https://docs.google.com/spreadsheets/d/1wnfzNUt5Alc6sldUFvyv_0zMcwv4P_owqNwXESkscro/edit?gid=82029868 but the ones I sampled seemed to be use defined functions.

Maybe this is a case where we should put a use counter on the API itself, so we at least have some idea how many users the problem might be affecting, even if we can't work out URLs?

Flags: needinfo?(james)

Let's triage this as if it would be a real site, where it would probably be "content missing". It technically is a regression, so we'll leave the flag for now, but it's hard to track it as such because this is just a demo page of an archived library. Things would be different if we had good evidence of this breaking real sites, but we don't have that.

Severity: -- → S2
User Story: (updated)
Webcompat Priority: --- → P3
Webcompat Score: 1 → 4
Priority: -- → P1

Set release status flags based on info from the regressing bug 1934525

SVGPathElement.prototype.setPathData() API as introduced in Firefox 137 seems to require all segments to be instances of SVGPathSegment rather than plain JS objects, so it will break any app that relies on https://www.npmjs.com/package/path-data-polyfill. I already received several complains from users of https://boxy-svg.com/app.

Assignee: nobody → longsonr

with the patch, temp0.setPathData([{"type":"M","values":[0,0]}]) will set the path data i.e. you'd just need a javascript object with the same properties, i.e. not necessarily an SVGPathSegment object.

Thanks for patch. I also updated the polyfill so that it should work on Firefox with and without the patch.

Duplicate of this bug: 1961079
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/94b9436ff8ff Implement https://github.com/w3c/editing/issues/483 so that setPathData can accept a plain javascript object that matches the structure of SVGPathSegment r=emilio

Backed out for causing hazard failures

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: gmake[4]: *** Deleting file 'DOMtoATK.o'
    /builds/worker/checkouts/gecko/obj-analyzed-browser/dist/include/mozilla/Assertions.h:495:60: error: ignoring attributes on template argument 'mozilla::StringBuffer*' [-Werror=ignored-attributes]
Flags: needinfo?(longsonr)

Reading previous comments about impact radius of this issue... be aware that https://github.com/AhmedAyachi/LinkerLine is the ongoing active fork of LeaderLine, and there are active users of it. https://github.com/AhmedAyachi/LinkerLine/issues/12 .

Regarding the backout, it looks like it that fail was caused by another bug, I will reland it.
Sorry for that.

Flags: needinfo?(longsonr)
Pushed by ctuns@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe3e6fc7196a Implement https://github.com/w3c/editing/issues/483 so that setPathData can accept a plain javascript object that matches the structure of SVGPathSegment r=emilio
Status: REOPENED → RESOLVED
Closed: 5 months ago4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 139 Branch

The patch should be in the next nightly. Please let us know if everything is OK now. If not, do raise other bugs and CC me.

Flags: needinfo?(jarek)

The patch landed in nightly and beta is affected.
:longsonr, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(longsonr)

Verified as FIXED using the RC Build

Tested with:

Browser / Version: Firefox 138.0-candidate build 1
Operating System: Windows 10 PRO x64
Operating System: Mac OS X 10.15

Status: RESOLVED → VERIFIED

The fix isn't in Firefox 138 though, it's only in 139 at the moment.

Flags: needinfo?(rbucata)

We are conducting a series of tests before 138 is released on the RC Build. If it does not reproduce there, we classify the issue as verified in 138, since it is in the list of issues that need to be verified.

Flags: needinfo?(rbucata)

I performed some tests using Firefox Nightly version 139.0a1 (2025-04-22, Linux, aarch64) and I confirm that the patch fixes compatibility issues with apps that rely on older version of path-data-polyfill.

The only potential problems might arise from the fact that the polyfilled setPathData() method was (incorrectly?) very permissive about "Z" segment syntax while Firefox allows only {type: "Z", values: []}, but not {type: "Z"} (throws an error) or {type: "Z", values: [0, 0]} (ignores the segment without throwing an error). I'm not sure how large impact this might have.

Flags: needinfo?(jarek)

Comment on attachment 9478731 [details]
Bug 1954044 - Implement https://github.com/w3c/editing/issues/483 so that setPathData can accept a plain javascript object that matches the structure of SVGPathSegment r=emilio

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: some sites that depend on setPathData/getPathData polyfill won't work correctly now that Firefox implements these methods natively.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Makes setPathData more permissive in what it accepts but does not otherwise change how it works.
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(longsonr)
Attachment #9478731 - Flags: approval-mozilla-beta?

Comment on attachment 9478731 [details]
Bug 1954044 - Implement https://github.com/w3c/editing/issues/483 so that setPathData can accept a plain javascript object that matches the structure of SVGPathSegment r=emilio

There are no more betas in 138. I will leave this request open in case of an RC re-spin or for consideration for the 138 dot release.

Attachment #9478731 - Flags: approval-mozilla-beta? → approval-mozilla-release?

:longsonr this will need a release patch

Flags: needinfo?(longsonr)

Are there some instructions somewhere as to how to do that?

Flags: needinfo?(dholbert)

Same steps that generated comment 33, I think (via Lando / request uplift from the original patch, but just selecting release as the target branch).

Documentation/instructions are at https://wiki.mozilla.org/Release_Management/Uplift_rules

Flags: needinfo?(dholbert)
Attachment #9485291 - Flags: approval-mozilla-release?
Flags: needinfo?(longsonr)

Comment on attachment 9485291 [details]
Bug 1954044 - Implement https://github.com/w3c/editing/issues/483 so that setPathData can accept a plain javascript object that matches the structure of SVGPathSegment

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: The interface for setPathData is not compatible with how it's used by a widely used polyfill. The polyfill accepts a plain javascript object with the correct fields and this patch mirrors that.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Makes an existing interface more flexible.
  • String changes made/needed: none
  • Is Android affected?: Yes
Attachment #9478731 - Flags: approval-mozilla-release?
Attachment #9485291 - Flags: approval-mozilla-release? → approval-mozilla-release+
QA Whiteboard: [qa-ver-needed-c140/b139]
Flags: qe-verify+
QA Whiteboard: [qa-ver-needed-c140/b139] → [uplift] [qa-ver-needed-c140/b139]

Verified that this is fixed on both 138.0.3 and 139.0b7 using Windows 11 and Mac OS X 10.15.

QA Whiteboard: [uplift] [qa-ver-needed-c140/b139] → [uplift] [qa-ver-done-c140/b139]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: