Bug 1277090: Have Marionette return only attributes from getElementAttribute. r=ato
authorDavid Burns <dburns@mozilla.com>
Tue, 31 May 2016 23:23:05 +0100
changeset 302069 7be72cdc9d7801fced2f4496e1c5b14eb6c0fa9a
parent 302068 3c5025f98e561a20e24d97c91a9e4e0ec28015ea
child 302070 4517cfdd7f7997324aacf013102334b4aab1b09a
push id78572
push userdburns@mozilla.com
push dateMon, 20 Jun 2016 09:13:02 +0000
treeherdermozilla-inbound@4517cfdd7f79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1277090
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
testing/marionette/driver.js
--- 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;
   }
 };