Closed Bug 964507 Opened 6 years ago Closed 6 years ago
There are no tests for Firefox's support for Debugger
.Source .prototype .element and .element Attribute Name
(I have a patch in progress for this.)
Boris, if you can think of any other cases to test (I think you mentioned some oddities around <body> tags?), let me know.
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Attachment #8366442 - Flags: review?(bzbarsky)
Comment on attachment 8366442 [details] [diff] [review] Add mochitests for Debugger.Source.protoype.element and .elementAttributeName. The only other things are <body onfoo> (which adds an event listener on the _window_ but we want to associate it with the body) and the SVG cases where the name of the attribute doesn't match the name of the event....
Attachment #8366442 - Flags: review?(bzbarsky) → review+
Okay, this exercises the <body> vs. window case. Can you give me an example a case where the SVG attribute and event names are different?
Attachment #8366442 - Attachment is obsolete: true
> Can you give me an example a case where the SVG attribute and event names are different? Sure thing. Here's an example: <!DOCTYPE html> <script> var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); svg.setAttribute("onload", "alert('called: '+call)"); var call = "load" svg.dispatchEvent(new Event("load")); call = "SVGLoad" svg.dispatchEvent(new Event("SVGLoad")); </script> so in this case the event name is "SVGLoad" but the attribute name is "load".
Oh, and the full list is basically at http://hg.mozilla.org/mozilla-central/annotate/0eb2ba65a702/dom/events/nsEventListenerManager.cpp#l816 : the event name is the RHS of the if condition with the "on" removed and the attr name is what gets assigned to attrName, with the "on" removed. Might be simpler to use something other than load/SVGLoad that would just not fire unless you trigger it manually.
Okay, I've got both <body> and SVG tests in this one; the rest is unchanged. Boris, could you give it a quick look to ensure that it's actually testing for the correct behavior? Then I think this is done.
Comment on attachment 8367494 [details] [diff] [review] Add mochitests for Debugger.Source.protoype.element and .elementAttributeName. Looks great! r=me
Attachment #8367494 - Flags: review?(bzbarsky) → review+
Target Milestone: --- → mozilla29
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.