Commit e3134c1b authored by stgao's avatar stgao Committed by Commit bot

[ChromeDriver] Fix clicking a map area broken by blink change 180610.

NOTRY=true

Review URL: https://codereview.chromium.org/591723002

Cr-Commit-Position: refs/heads/master@{#295910}
parent 13b93d8a
...@@ -11,7 +11,11 @@ function getElementRegion(element) { ...@@ -11,7 +11,11 @@ function getElementRegion(element) {
// and then the bounding client rect. // and then the bounding client rect.
// SVG is one case that doesn't have a first client rect. // SVG is one case that doesn't have a first client rect.
var clientRects = element.getClientRects(); var clientRects = element.getClientRects();
if (clientRects.length == 0) {
// Element area of a map has same first ClientRect and BoundingClientRect
// after blink roll at chromium commit position 290738 which includes blink
// revision 180610. Thus handle area as a special case.
if (clientRects.length == 0 || element.tagName.toLowerCase() == 'area') {
var box = element.getBoundingClientRect(); var box = element.getBoundingClientRect();
if (element.tagName.toLowerCase() == 'area') { if (element.tagName.toLowerCase() == 'area') {
var coords = element.coords.split(','); var coords = element.coords.split(',');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment