Closed Bug 1284232 Opened 4 years ago Closed 3 years ago

Unable to return HTMLFormControlsCollection, HTMLAllCollection, or HTMLOptionsCollection from evaluated scripts

Categories

(Testing :: Marionette, defect)

Version 3
defect
Not set

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: ato, Assigned: ato)

Details

Attachments

(3 files)

In a document such as

    <form>
     <input>
     <input>
    </form>

evaluating a script such as

    return document.forms[0].elements

will not return the collection of <input> elements, as the data type is HTMLFormControlsCollection, which is not handled in Marionette.
Assignee: nobody → ato
Status: NEW → ASSIGNED
We should likely also handle HTMLAllCollection and HTMLOptionsCollection from HTML.
Summary: Unable to return HTMLFormControlsCollection from evaluated scripts → Unable to return HTMLFormControlsCollection, HTMLAllCollection, or HTMLOptionsCollection from evaluated scripts
This is also a specification issue.
Does FirefoxDriver handle this?
Flags: needinfo?(ato)
I believe it handles _some_ of them.
Flags: needinfo?(ato)
This patch adds marshaling of HTMLFormControlsCollection,
HTMLAllCollection, and HTMLOptionsCollection element collections to
Marionette.

It will allow us you to return from HTMLSelectElement.options,
document.forms[0].elements, and document.all. This is in
addition to the already supported document.querySelector
(NodeList), document.getElementsBy* (HTMLCollection), and
Array.from(ELEMENT...) collections.

Review commit: https://reviewboard.mozilla.org/r/62126/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/62126/
Attachment #8767713 - Flags: review?(dburns)
Comment on attachment 8767713 [details]
Bug 1284232 - Marshal all HTML and JS collections;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62126/diff/1-2/
Comment on attachment 8767713 [details]
Bug 1284232 - Marshal all HTML and JS collections;

https://reviewboard.mozilla.org/r/62126/#review58896
Attachment #8767713 - Flags: review?(dburns) → review+
It turns out that certain objects such as a DOMRectList have peculiarities
that cause string comparison to throw. This is normally not a problem
as error.isError is usually passed JSON serialisable data. But when it
is not, this try condition helps diagnose problems.

Review commit: https://reviewboard.mozilla.org/r/63152/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/63152/
Attachment #8769174 - Flags: review?(dburns)
Attachment #8769175 - Flags: review?(dburns)
Comment on attachment 8767713 [details]
Bug 1284232 - Marshal all HTML and JS collections;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62126/diff/2-3/
Comment on attachment 8769174 [details]
Bug 1284232 - Guard against ill-behaved objects on error check;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/63152/diff/1-2/
Comment on attachment 8769175 [details]
Bug 1284232 - Convert internal error list to a set;

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/63154/diff/1-2/
Comment on attachment 8769174 [details]
Bug 1284232 - Guard against ill-behaved objects on error check;

https://reviewboard.mozilla.org/r/63152/#review60010
Attachment #8769174 - Flags: review?(dburns) → review+
Comment on attachment 8769175 [details]
Bug 1284232 - Convert internal error list to a set;

https://reviewboard.mozilla.org/r/63154/#review60012
Attachment #8769175 - Flags: review?(dburns) → review+
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7b175334ebc6
Marshal all HTML and JS collections; r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/bb0f0424f0f0
Guard against ill-behaved objects on error check; r=automatedtester
https://hg.mozilla.org/integration/autoland/rev/53d2d214a699
Convert internal error list to a set; r=automatedtester
https://hg.mozilla.org/mozilla-central/rev/7b175334ebc6
https://hg.mozilla.org/mozilla-central/rev/bb0f0424f0f0
https://hg.mozilla.org/mozilla-central/rev/53d2d214a699
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.