Title: [222536] trunk/Source/WebKit
Revision
222536
Author
[email protected]
Date
2017-09-26 17:02:02 -0700 (Tue, 26 Sep 2017)

Log Message

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'.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (222535 => 222536)


--- trunk/Source/WebKit/ChangeLog	2017-09-26 23:59:12 UTC (rev 222535)
+++ trunk/Source/WebKit/ChangeLog	2017-09-27 00:02:02 UTC (rev 222536)
@@ -1,3 +1,16 @@
+2017-09-26  Brian Burg  <[email protected]>
+
+        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  <[email protected]>
 
         [Cocoa] Add a modern WKPreferences switch to disable WebRTC

Modified: trunk/Source/WebKit/UIProcess/Automation/atoms/ElementDisplayed.js (222535 => 222536)


--- trunk/Source/WebKit/UIProcess/Automation/atoms/ElementDisplayed.js	2017-09-26 23:59:12 UTC (rev 222535)
+++ trunk/Source/WebKit/UIProcess/Automation/atoms/ElementDisplayed.js	2017-09-27 00:02:02 UTC (rev 222536)
@@ -132,6 +132,9 @@
         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.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to