Skip to content

Commit

Permalink
Merge r222536 - Web Automation: overflow:hidden elements with no chil…
Browse files Browse the repository at this point in the history
…dren are mistakenly reported as not visible

https://bugs.webkit.org/show_bug.cgi?id=177514
<rdar://problem/31936291>

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/atoms/ElementDisplayed.js:
(isShown.isElementSubtreeHiddenByOverflow):
Array.prototype.every returns true when passed an empty list, so we need
to check for the case where the element has no children and return 'false'.
  • Loading branch information
burg authored and carlosgcampos committed Oct 17, 2017
1 parent cdc2b8f commit 50d3b7e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,16 @@
2017-09-26 Brian Burg <bburg@apple.com>

Web Automation: overflow:hidden elements with no children are mistakenly reported as not visible
https://bugs.webkit.org/show_bug.cgi?id=177514
<rdar://problem/31936291>

Reviewed by Joseph Pecoraro.

* UIProcess/Automation/atoms/ElementDisplayed.js:
(isShown.isElementSubtreeHiddenByOverflow):
Array.prototype.every returns true when passed an empty list, so we need
to check for the case where the element has no children and return 'false'.

2017-09-26 Brent Fulgham <bfulgham@apple.com>

Harden our access to the vector of URL schemes.
Expand Down
3 changes: 3 additions & 0 deletions Source/WebKit/UIProcess/Automation/atoms/ElementDisplayed.js
Expand Up @@ -132,6 +132,9 @@ function isShown(element) {
if (!elementOverflowsContainer(element))
return false;

if (!element.childNodes.length)
return false;

// This element's subtree is hidden by overflow if all child subtrees are as well.
return Array.from(element.childNodes).every((childNode) => {
// Returns true if the child node is overflowed or otherwise hidden.
Expand Down

0 comments on commit 50d3b7e

Please sign in to comment.