Closed
Bug 1409040
Opened 7 years ago
Closed 7 years ago
Functions for telling apart element prototypes
Categories
(Remote Protocol :: Marionette, enhancement)
Tracking
(firefox58 fixed)
RESOLVED
FIXED
mozilla58
Tracking | Status | |
---|---|---|
firefox58 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
References
Details
Attachments
(5 files)
(deleted),
text/x-review-board-request
|
impossibus
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
impossibus
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
impossibus
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
impossibus
:
review+
|
Details |
(deleted),
text/x-review-board-request
|
impossibus
:
review+
|
Details |
With https://bugzil.la/1400256 we need to have more versatile and
specific functions for determining the prototypes of elements. We
need the ability to tell DOM elements apart from SVG elements, XUL
elements, XBL elements, and WindowProxies.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → ato
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8918892 [details]
Bug 1409040 - Make element.isXULElement more resiliant.
https://reviewboard.mozilla.org/r/189774/#review195552
Attachment #8918892 -
Flags: review?(mjzffr) → review+
Comment 11•7 years ago
|
||
mozreview-review |
Comment on attachment 8918893 [details]
Bug 1409040 - Add element.isDOMElement.
https://reviewboard.mozilla.org/r/189776/#review195558
Attachment #8918893 -
Flags: review?(mjzffr) → review+
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8918894 [details]
Bug 1409040 - Add element.isDOMWindow.
https://reviewboard.mozilla.org/r/189778/#review195562
::: testing/marionette/element.js:1097
(Diff revision 2)
> + */
> +element.isDOMWindow = function(node) {
> + return typeof node == "object" &&
> + node !== null &&
> + typeof node.toString == "function" &&
> + node.toString() == "[object Window]" &&
Would it help to check `Object.prototype.toString.call(node)`?
Attachment #8918894 -
Flags: review?(mjzffr) → review+
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8918895 [details]
Bug 1409040 - Add element.isSVGElement.
https://reviewboard.mozilla.org/r/189780/#review195564
Attachment #8918895 -
Flags: review?(mjzffr) → review+
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8919300 [details]
Bug 1409040 - Add element.isElement shorthand.
https://reviewboard.mozilla.org/r/190178/#review195566
Attachment #8919300 -
Flags: review?(mjzffr) → review+
Assignee | ||
Comment 15•7 years ago
|
||
(In reply to Maja Frydrychowicz (:maja_zf) from comment #12)
> Comment on attachment 8918894 [details]
> Bug 1409040 - Add element.isDOMWindow.
>
> https://reviewboard.mozilla.org/r/189778/#review195562
>
> ::: testing/marionette/element.js:1097
> (Diff revision 2)
> > + */
> > +element.isDOMWindow = function(node) {
> > + return typeof node == "object" &&
> > + node !== null &&
> > + typeof node.toString == "function" &&
> > + node.toString() == "[object Window]" &&
>
> Would it help to check `Object.prototype.toString.call(node)`?
This would be the correct thing to do, but I’m not sure how to
unit test it since calling that on the domWin stub will return
"[object Object]". Perhaps there is some way to replace the
object’s prototype?
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 24•7 years ago
|
||
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7add260fcf97
Make element.isXULElement more resiliant. r=maja_zf
https://hg.mozilla.org/integration/autoland/rev/3682877a6a42
Add element.isDOMElement. r=maja_zf
https://hg.mozilla.org/integration/autoland/rev/e156787ee23b
Add element.isDOMWindow. r=maja_zf
https://hg.mozilla.org/integration/autoland/rev/207c5e066fda
Add element.isSVGElement. r=maja_zf
https://hg.mozilla.org/integration/autoland/rev/1283b971ebd8
Add element.isElement shorthand. r=maja_zf
Comment 25•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7add260fcf97
https://hg.mozilla.org/mozilla-central/rev/3682877a6a42
https://hg.mozilla.org/mozilla-central/rev/e156787ee23b
https://hg.mozilla.org/mozilla-central/rev/207c5e066fda
https://hg.mozilla.org/mozilla-central/rev/1283b971ebd8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox58:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•