Closed Bug 1082663 Opened 11 years ago Closed 11 years ago

DOMMatrix does not implement stringifier from spec

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: potch, Assigned: cabanier, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 4 obsolete files)

From the spec: http://dev.w3.org/fxtf/geometry/Overview.html#dom-dommatrixreadonly-stringifier > In this example, a matrix is created and several 2D transformation methods are called: > > var matrix = new DOMMatrix(); > matrix.scaleSelf(2); > matrix.translateSelf(20,20); > > Calling matrix.toString() returns the DOMString: > > "matrix(2, 0, 0, 2, 20, 20)" In Firefox this prints "[object DOMMatrix]".
Looks like this got added after we added the DOMMatrix implementation.
Mentor: bzbarsky
(In reply to Boris Zbarsky [:bz] from comment #1) > Looks like this got added after we added the DOMMatrix implementation. Can you tell me how I mark this up in the IDL? I'll implement it ASAP.
Flags: needinfo?(bzbarsky)
Assignee: nobody → cabanier
Just like it's in the spec: stringifier;
Flags: needinfo?(bzbarsky)
Attachment #8505256 - Attachment is obsolete: true
Attachment #8505258 - Attachment is obsolete: true
Attachment #8505256 - Flags: review?(bzbarsky)
Attachment #8505260 - Flags: review?(bzbarsky)
Attachment #8505256 - Flags: review?(bzbarsky)
Comment on attachment 8505260 [details] [diff] [review] Fix + test for stringification of DOMMatrix Where does the getStringRepresentation bit come from? You just want: stringifier; in the IDL and call the method Stringify in the C++. What you're doing actually adds a getStringRepresentation method to the object, which is very much not desirable in this case. Also, you don't need to define it on DOMMatrix; just putting it on DOMMatrixReadonly is enough. r=me with those fixed
Attachment #8505260 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky [:bz] from comment #8) > Comment on attachment 8505260 [details] [diff] [review] > Fix + test for stringification of DOMMatrix > > Where does the getStringRepresentation bit come from? You just want: > > stringifier; > > in the IDL and call the method Stringify in the C++. What you're doing > actually adds a getStringRepresentation method to the object, which is very > much not desirable in this case. > > Also, you don't need to define it on DOMMatrix; just putting it on > DOMMatrixReadonly is enough. > > r=me with those fixed I tried that first. Adding 'stringifier' to the IDL didn't do anything so I switched to adding the method to DOMMatrixReadOnly. Then I noticed that that wouldn't stringify DOMMatrix, so I added it to the IDL if DOMMatrix. (I'll double check if just adding stringifier works today once my mac has finished reinstalling)
> Adding 'stringifier' to the IDL didn't do anything Should work. > Then I noticed that that wouldn't stringify DOMMatrix Whyever not? It just puts a toString on the proto, and the proto of DOMMatrix chains up to the proto of DOMMatrixReadonly.
(In reply to Boris Zbarsky [:bz] from comment #10) > > Adding 'stringifier' to the IDL didn't do anything > > Should work. I tried and that did work. > > Then I noticed that that wouldn't stringify DOMMatrix > > Whyever not? It just puts a toString on the proto, and the proto of > DOMMatrix chains up to the proto of DOMMatrixReadonly. No, putting it only on the DOMMatrixReadonly object didn't work. See try build: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=53edc37b85c0 Try build where DOMMatrix also has stringifier: https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=86069ea6f0fd
Flags: needinfo?(bzbarsky)
Attachment #8505260 - Attachment is obsolete: true
> No, putting it only on the DOMMatrixReadonly object didn't work. Ah. This looks like a bug in the bindings codegen to me. We don't actually set up stringifiers for non-concrete interfaces, which is wrong. Bug 1083591 filed.
Flags: needinfo?(bzbarsky)
(In reply to Boris Zbarsky [:bz] from comment #13) > > No, putting it only on the DOMMatrixReadonly object didn't work. > > Ah. This looks like a bug in the bindings codegen to me. We don't actually > set up stringifiers for non-concrete interfaces, which is wrong. > > Bug 1083591 filed. Do I need to wait until that bug is fixed?
Flags: needinfo?(bzbarsky)
It might be a good idea, so we don't add stuff that we then have to immediately remove. I expect that bug to be fixed within the next day or two (patch is up, just needs review), so I don't think waiting is unreasonable.
Flags: needinfo?(bzbarsky)
Depends on: 1083591
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: