Skip to content
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

[geometry] DOMMatrix stringifier in workers #145

Closed
zcorpan opened this issue May 10, 2017 · 6 comments
Closed

[geometry] DOMMatrix stringifier in workers #145

zcorpan opened this issue May 10, 2017 · 6 comments
Assignees

Comments

@zcorpan
Copy link
Member

zcorpan commented May 10, 2017

https://drafts.fxtf.org/geometry/#dom-dommatrixreadonly-stringifier

stringifier()
If is2D is true
Return a DOMString in the form of a CSS Transforms <matrix()> function where a is a attribute, b is b attribute, c is c attribute, d is d attribute, e is e attribute, f is f attribute. [CSS3-TRANSFORMS]
Otherwise
Return a DOMString in the form of a CSS Transforms <matrix3d()> function where m11 to m44 are set to m11 to m44 attributes. [CSS3-TRANSFORMS]

In #122 we limited CSS parser entry points for DOMMatrix to Window. Should we also limit the stringifier to Window (so that in workers it would stringify to "[object DOMMatrix]")?

cc @esprehn @chrishtr @foolip

@foolip
Copy link
Member

foolip commented May 10, 2017

At a glance I can't tell if [Exposed=Window] stringifier is allowed in Web IDL, but my initial reaction is that there wouldn't be much point in limiting this. The serialization code path seems to be standalone, and so making it work would be less work that limiting it, I think.

@chrishtr
Copy link
Contributor

I think we should limit the special stringifier to the main thread, and return [object DOMMatrix]
in workers. Reasons: symmetry, simplicity for implementors.

@foolip
Copy link
Member

foolip commented May 11, 2017

I wouldn't really mind that, but isn't it actually more complicated for implementors?

@zcorpan
Copy link
Member Author

zcorpan commented May 11, 2017

Another aspect is that #120 proposes making the stringifier throw if there are NaN/Infinity values, which could be nice to avoid in workers.

@zcorpan
Copy link
Member Author

zcorpan commented May 11, 2017

As far as I can tell from WebIDL, [Exposed=Window] stringifier; should work. stringifier; is shorthand for stringifier DOMString ();, which is an interface member, and [Exposed] applies to interface members.

@foolip
Copy link
Member

foolip commented May 15, 2017

If [Exposed=Window] stringifier works, then that SGTM, no custom bindings or anything funny needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants