[ContentChangeObserver] Check for pending style recalcs at the end of each timer...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 22:48:54 +0000 (22:48 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 22:48:54 +0000 (22:48 +0000)
commit9f293b16f55e6863a9fb019ed03d4ac0cf29a429
treeb88aa5e98f6fb3d54616a96ddd3c7b9d38b95cac
parentdbc5e54a351a7771786b4ebc22066370490fbc29
[ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
https://bugs.webkit.org/show_bug.cgi?id=195220
<rdar://problem/48518979>

Reviewed by Simon Fraser.

Source/WebCore:

didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
Let's just check if we've got a pending style recalc when the DOM timer comes back.

Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html

* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/ios/ContentChangeObserver.cpp:
(WebCore::hasPendingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.

LayoutTests:

* fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt: Added.
* fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h