Closed Bug 1016830 Opened 12 years ago Closed 11 years ago

Console.jsm fails when logging SVG elements

Categories

(DevTools :: Console, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: pbro, Unassigned)

Details

Attachments

(2 obsolete files)

0:06.53 A coding exception was thrown and uncaught in a Task. 0:06.53 0:06.53 Full message: TypeError: aElement.className.split is not a function 0:06.53 Full stack: debugElement@resource://gre/modules/devtools/Console.jsm:167:1 0:06.53 stringify@resource://gre/modules/devtools/Console.jsm:130:7 0:06.53 createDumper/</data<@resource://gre/modules/devtools/Console.jsm:471:7 0:06.53 createDumper/<@resource://gre/modules/devtools/Console.jsm:470:9 0:06.53 isHighlighterVisible@chrome://mochitests/content/browser/browser/devtools/markupview/test/head.js:228:21 0:06.54 test<@chrome://mochitests/content/browser/browser/devtools/markupview/test/browser_markupview_highlight_hover_02.js:19:3 0:06.54 TaskImpl_run@resource://gre/modules/Task.jsm:282:13 0:06.54 Handler.prototype.process@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:863:11 0:06.54 this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm -> resource://gre/modules/Promise-backend.js:742:7 This happened when I tried to `console.log(element)` in a mochitest. element, in this case, is a SVG node and apparently its className property is of type SVGAnimatedString which doesn't implement the split function (https://developer.mozilla.org/en-US/docs/Web/API/SVGAnimatedString).
Attached patch patch untested (obsolete) — Splinter Review
How about this Patrick?
Flags: needinfo?(pbrosset)
Fails with the following error: "ReferenceError: SVGAnimatedString is not defined" Would aElement.ownerDocument.defaultView.SVGAnimatedString work ?
Flags: needinfo?(pbrosset)
Attached patch patch tested (obsolete) — Splinter Review
This seems to work.
Assignee: nobody → longsonr
Attachment #8430586 - Attachment is obsolete: true
Attachment #8432136 - Flags: review?(jwalker)
Attachment #8432136 - Flags: review?(jwalker)
This got fixed since I filed it. Apparently by bug 920141.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Assignee: longsonr → nobody
Attachment #8432136 - Attachment is obsolete: true
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: