Bug 1277090 - getElementAttribute() has to only return attributes. r=ato

Formerly getElementAttribute() has returned a mix of attributes and
properties. Since getElementProperty() has been added, there is no
need anymore for getElementAttribute() to return conflated data.

MozReview-Commit-ID: 29saWd9PsOX

--HG--
extra : rebase_source : e1dece7586c9b22320db406cfd60d211195f5f18
This commit is contained in:
Henrik Skupin 2016-12-14 22:26:34 +01:00
Родитель 0ed2e90726
Коммит 26107073d9
2 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -69,8 +69,14 @@ class HTMLElement(object):
"""Returns the requested property, or None if the property is
not set.
"""
body = {"id": self.id, "name": name}
return self.marionette._send_message("getElementProperty", body, key="value")
try:
body = {"id": self.id, "name": name}
return self.marionette._send_message("getElementProperty", body, key="value")
except errors.UnknownCommandException:
# Keep backward compatibility for code which uses get_attribute() to
# also retrieve element properties.
# Remove when Firefox 55 is stable.
return self.get_attribute(name)
def click(self):
self.marionette._send_message("clickElement", {"id": self.id})

Просмотреть файл

@ -1842,7 +1842,8 @@ GeckoDriver.prototype.getElementAttribute = function*(cmd, resp) {
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());
resp.body.value = el.getAttribute(name);
break;
case Context.CONTENT: