[ContentChangeObserver] Ignore reconstructed renderers when checking for visibility...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 19:43:51 +0000 (19:43 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2019 19:43:51 +0000 (19:43 +0000)
commite3f0190e987350520385a13db4f89b7f5b6af37c
tree7efd104d0c705903ace48a666409ce9b24275a34
parent3a0ccb6a1ea8555064a45f544cf3bf2a5f090794
[ContentChangeObserver] Ignore reconstructed renderers when checking for visibility change
https://bugs.webkit.org/show_bug.cgi?id=196483
<rdar://problem/49288174>

Reviewed by Simon Fraser.

Source/WebCore:

This patch fixes the cases when the content gets reconstructed in a way that existing and visible elements gain
new renderers within one style recalc. We failed to recognize such cases and ended up detecting the newly constructed renderers
as "visible change" thereby triggering hover.

Test: fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::renderTreeUpdateDidStart):
(WebCore::ContentChangeObserver::renderTreeUpdateDidFinish):
(WebCore::ContentChangeObserver::reset):
(WebCore::ContentChangeObserver::willDestroyRenderer):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::RenderTreeUpdateScope::RenderTreeUpdateScope):
(WebCore::ContentChangeObserver::RenderTreeUpdateScope::~RenderTreeUpdateScope):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::visibleRendererWasDestroyed const):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::tearDownRenderers):

LayoutTests:

* fast/events/touch/ios/content-observation/visible-content-gains-new-renderer-expected.txt: Added.
* fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/content-observation/non-visible-becomes-visible-and-gains-new-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/non-visible-becomes-visible-and-gains-new-renderer.html [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/non-visible-content-gains-new-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/non-visible-content-gains-new-renderer.html [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/visible-content-gains-new-renderer-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebCore/rendering/updating/RenderTreeUpdater.cpp