Bug 1277090: Have Marionette return only attributes from getElementAttribute. r?ato
Using the Selenium atom we are conflating properties and attributes which is not
thing we really want to be doing.
MozReview-Commit-ID: HdZOz1jQrwz
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1781,17 +1781,26 @@ GeckoDriver.prototype.clickElement = fun
*/
GeckoDriver.prototype.getElementAttribute = function*(cmd, resp) {
let {id, name} = cmd.parameters;
switch (this.context) {
case Context.CHROME:
let win = this.getCurrentWindow();
let el = this.curBrowser.seenEls.get(id, {frame: win});
- resp.body.value = atom.getElementAttribute(el, name, this.getCurrentWindow());
+
+ if (element.isBooleanAttribute(el, name)) {
+ if (el.hasAttribute(name)) {
+ resp.body.value = "true";
+ } else {
+ resp.body.value = null;
+ }
+ } else {
+ resp.body.value = el.getAttribute(name);
+ }
break;
case Context.CONTENT:
resp.body.value = yield this.listener.getElementAttribute(id, name);
break;
}
};