Closed
Bug 964507
Opened 11 years ago
Closed 11 years ago
There are no tests for Firefox's support for Debugger.Source.prototype.element and .elementAttributeName
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: jimb, Assigned: jimb)
References
Details
Attachments
(1 file, 2 obsolete files)
|
9.18 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Bug 941876 made Firefox tell SpiderMonkey which DOM elements, and which attributes of those elements, bits of JavaScript code belong to. The landed patch didn't include any tests; while the functionality is pretty straightforward, it would be nice to have some tests that exercise it.
| Assignee | ||
Comment 1•11 years ago
|
||
(I have a patch in progress for this.)
| Assignee | ||
Comment 2•11 years ago
|
||
Boris, if you can think of any other cases to test (I think you mentioned some oddities around <body> tags?), let me know.
| Assignee | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
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+
| Assignee | ||
Comment 5•11 years ago
|
||
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
Flags: needinfo?(bzbarsky)
Comment 6•11 years ago
|
||
> 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".
Flags: needinfo?(bzbarsky)
Comment 7•11 years ago
|
||
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.
| Assignee | ||
Comment 8•11 years ago
|
||
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.
Attachment #8366834 -
Attachment is obsolete: true
Attachment #8367494 -
Flags: review?(bzbarsky)
Comment 9•11 years ago
|
||
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+
| Assignee | ||
Comment 10•11 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla29
Comment 11•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•