[ContentChangeObserver] Expand "isConsideredClickable" to descendants
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 23:51:05 +0000 (23:51 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Mar 2019 23:51:05 +0000 (23:51 +0000)
commitf92b6205b37ee2c1bbf0e0c2b74c56a3b024a9ce
tree941d7c63d9dd7d4269f813bacbdcf5630ec10029
parentd23d1f39833ce9ebac62895f77c2ce998d188660
[ContentChangeObserver] Expand "isConsideredClickable" to descendants
https://bugs.webkit.org/show_bug.cgi?id=195478
<rdar://problem/48724935>

Reviewed by Simon Fraser.

Source/WebCore:

In StyleChangeScope we try to figure out whether newly visible content should stick (menu panes etc) by checking if it is clickable.
This works fine as long as all the visible elements are gaining new renderers through this style update processs.
However when an element becomes visible by a change other than display: (not)none, it's not sufficient to just check the element itself,
since it might not respond to click at all, while its descendants do.
A concrete example is a max-height value change on usps.com, where the max-height is on a container (menu pane).
This container itself is not clickable while most of its children are (menu items).

Test: fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
(WebCore::isConsideredHidden): Deleted.
* page/ios/ContentChangeObserver.h:

LayoutTests:

* fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container-expected.txt: Added.
* fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h