-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a DOMMatrix
polyfill for Node.js environments (PR 13361 follow-up)
#13530
Conversation
d09e670
to
e5c2dbe
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ababe85273871b7/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/fa9791958724a1d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/ababe85273871b7/output.txt Total script time: 26.27 mins
Image differences available at: http://54.67.70.0:8877/ababe85273871b7/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/fa9791958724a1d/output.txt Total script time: 30.20 mins
Image differences available at: http://3.101.106.178:8877/fa9791958724a1d/reftest-analyzer.html#web=eq.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ with the change below
Given that `DOMMatrix` is, unsurprisingly, not supported in Node.js the `createMatrix` helper function in `src/display/pattern_helper.js` is most likely broken in Node.js environments. It will obviously try to fallback to the `DOMSVGFactory`, however that isn't intended for Node.js usage and errors will be thrown. Rather than trying to implement a `NodeSVGFactory`, this patch takes the easier route of just adding a `DOMMatrix` polyfill using: https://www.npmjs.com/package/dommatrix This isn't done only for simplicity, but it'll become necessary anyway since the `createMatrix` helper function is only temporary and will be removed in the future.
…ory` This is similar to all of the other factories in this file, since they *directly* throw errors.
e5c2dbe
to
3bd24d8
Compare
Given that
DOMMatrix
is, unsurprisingly, not supported in Node.js thecreateMatrix
helper function insrc/display/pattern_helper.js
is most likely broken in Node.js environments. It will obviously try to fallback to theDOMSVGFactory
, however that isn't intended for Node.js usage and errors will be thrown.Rather than trying to implement a
NodeSVGFactory
, this patch takes easier route of just adding aDOMMatrix
polyfill using: https://www.npmjs.com/package/dommatrixThis isn't done only for simplicity, but it'll become necessary anyway since the
createMatrix
helper function is only temporary and will be removed in the future.