Skip to content
Permalink
Browse files
Web Automation: overflow:hidden elements with no children are mistake…
…nly 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'.

Canonical link: https://commits.webkit.org/193828@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
burg committed Sep 27, 2017
1 parent 37b2b9d commit 6da6d5d6f3b1adb0dcaa8cbb26fd31f71ccb6d94
Showing with 16 additions and 0 deletions.
  1. +13 −0 Source/WebKit/ChangeLog
  2. +3 −0 Source/WebKit/UIProcess/Automation/atoms/ElementDisplayed.js
@@ -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 Youenn Fablet <youenn@apple.com>

[Cocoa] Add a modern WKPreferences switch to disable WebRTC
@@ -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.

0 comments on commit 6da6d5d

Please sign in to comment.