Can’t use RalphLauren.com on iPad because hover menus don’t stay up
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Dec 2018 00:08:50 +0000 (00:08 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 Dec 2018 00:08:50 +0000 (00:08 +0000)
commite106097134299e6cbc676129ecc233f0531a2fc1
treec4c97874a129b55605e38d0a020033b2d8cc42bf
parenta97b7d6aef98832c7432bb251e79fbf62274786c
Can’t use RalphLauren.com on iPad because hover menus don’t stay up
https://bugs.webkit.org/show_bug.cgi?id=192236
<rdar://problem/45792118>

Reviewed by Geoffrey Garen.

Source/WebCore:

This patch introduces asynchronous content change observation.
1. Start observing synchronous content change and timer install as the result of dispatching mouseMoved event.
2. Start observing synchronous content change and style recalc schedule as the result of a timer callback (installed at #1).
3. Start observing synchronous content change as the result of a style recalc (scheduled at #2).

This patch also extends the timeout value from 100ms to 250ms. Certain content prefer longer timeouts (see http://briancherne.github.io/jquery-hoverIntent/ for details).

Test: fast/events/touch/ios/hover-when-style-change-is-async.html

* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingStyleRecalcScheduling):
(WKStopObservingStyleRecalcScheduling):
(WKIsObservingStyleRecalcScheduling):
(WKSetShouldObserveNextStyleRecalc):
(WKShouldObserveNextStyleRecalc):
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:

LayoutTests:

* fast/events/touch/ios/hover-when-style-change-is-async-expected.txt: Added.
* fast/events/touch/ios/hover-when-style-change-is-async.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/hover-when-style-change-is-async.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/DOMTimer.cpp
Source/WebCore/platform/ios/wak/WKContentObservation.cpp
Source/WebCore/platform/ios/wak/WKContentObservation.h