Closed
Bug 1141498
Opened 10 years ago
Closed 10 years ago
Make testcommon.js's addDiv() more portable, and more flexible
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: jwatt, Assigned: jwatt)
Details
Attachments
(2 files)
|
965 bytes,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
|
1.17 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•10 years ago
|
||
From bug 1073379 comment 22:
According to MDN...
https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove#Browser_compatibility
...remove() isn't supported everywhere -- it's supported not in IE, at least. Given that this is a testharness.js test & hence can in theory be run w/ other browsers, maybe better to avoid using remove(). (and use div.parentNode.removeChild(div) instead)
| Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8575255 -
Flags: review?(dholbert)
| Assignee | ||
Comment 3•10 years ago
|
||
Per the "Obviously, feel free to wrap or extend it to add the extra class / ID setting behaviour" comment in bug 1072037 comment 11.
Attachment #8575256 -
Flags: review?(dholbert)
Updated•10 years ago
|
Attachment #8575255 -
Flags: review?(dholbert) → review+
Comment 4•10 years ago
|
||
Comment on attachment 8575256 [details] [diff] [review]
part 2 - Enable calls to DOM animation test's testcommon.js's addDiv() to set attributes
>+++ b/dom/animation/test/testcommon.js
>-function addDiv(t) {
>+function addDiv(t, attrs) {
> var div = document.createElement('div');
>+ if (attrs) {
>+ for (var attr in attrs) {
>+ div.setAttribute(attr, attrs[attr]);
>+ }
>+ }
nit: maybe rename "attr" to "attrName"? For me at least, that'd make the setAttribute call easier to skim & make it easier to keep track of what the various values involved are.
r=me regardless
Attachment #8575256 -
Flags: review?(dholbert) → review+
| Assignee | ||
Comment 5•10 years ago
|
||
Sure, sounds good.
| Assignee | ||
Comment 6•10 years ago
|
||
Both backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/f8076d7dcfcb for mochitest-1 bustage, along with bug 1141710:
https://treeherder.mozilla.org/logviewer.html#?job_id=7437755&repo=mozilla-inbound
Flags: needinfo?(jwatt)
| Assignee | ||
Comment 8•10 years ago
|
||
Part 1 caused the test test_element-get-animation-players.html to fail because calling element.remove() is a no-op when the element has no parent node, but of course if element.parentNode is null then evaluating element.parentNode.removeChild(element) causes a JavaScript error. So despite how the patch looked, the old and new code are not strictly equivalent! :/
Flags: needinfo?(jwatt)
| Assignee | ||
Comment 9•10 years ago
|
||
Repushed with fix after full local run of all test files using this utilities file.
https://hg.mozilla.org/integration/mozilla-inbound/rev/475fe01b5ddc
https://hg.mozilla.org/integration/mozilla-inbound/rev/f168c9676e5c
Comment 10•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/475fe01b5ddc
https://hg.mozilla.org/mozilla-central/rev/f168c9676e5c
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•