Bug 1506409 [wpt PR 14015] - Remove ES6 object matching shorthand notation from WebDriver tests, a=testonly

Automatic update from web-platform-testsRemove ES6 object matching shorthand notation from WebDriver tests (#14015)

This change is to allow older user agents that do not support ES6
constructs to run the WebDriver tests.
--

wpt-commits: fc1a5b73230225faf32bfb85f3928ce154211b0a
wpt-pr: 14015
This commit is contained in:
jimevans 2018-11-13 13:41:57 +00:00 коммит произвёл moz-wptsync-bot
Родитель 9bb9ef5323
Коммит 5dc8403338
3 изменённых файлов: 11 добавлений и 11 удалений

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

@ -108,8 +108,8 @@ def clear_all_cookies(session):
def document_dimensions(session):
return tuple(session.execute_script("""
let {width, height} = document.documentElement.getBoundingClientRect();
return [width, height];
let rect = document.documentElement.getBoundingClientRect();
return [rect.width, rect.height];
"""))
@ -145,13 +145,13 @@ def document_hidden(session):
def element_rect(session, element):
return session.execute_script("""
let element = arguments[0];
let {height, left, top, width} = element.getBoundingClientRect();
let rect = element.getBoundingClientRect();
return {
x: left + window.pageXOffset,
y: top + window.pageYOffset,
width: width,
height: height,
x: rect.left + window.pageXOffset,
y: rect.top + window.pageYOffset,
width: rect.width,
height: rect.height,
};
""", args=(element,))

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

@ -1,6 +1,6 @@
def element_rect(session, element):
return session.execute_script("""
let {devicePixelRatio} = window;
let devicePixelRatio = window.devicePixelRatio;
let rect = arguments[0].getBoundingClientRect();
return {

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

@ -1,6 +1,6 @@
def document_dimensions(session):
return tuple(session.execute_script("""
let {devicePixelRatio} = window;
let {width, height} = document.documentElement.getBoundingClientRect();
return [Math.floor(width * devicePixelRatio), Math.floor(height * devicePixelRatio)];
let devicePixelRatio = window.devicePixelRatio;
let rect = document.documentElement.getBoundingClientRect();
return [Math.floor(rect.width * devicePixelRatio), Math.floor(rect.height * devicePixelRatio)];
"""))