зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
0ed2e90726
Коммит
26107073d9
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче