Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 20:38:59 +0000 (20:38 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 20:38:59 +0000 (20:38 +0000)
commitbdf2b6c13ab1dbd680e67e627632380b93457f36
tree19581ea51682a5072f5e235e72c19080a79cf2e7
parent8ad61619212f83344641b0e89a272d655ba74386
Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
https://bugs.webkit.org/show_bug.cgi?id=193835

Reviewed by Simon Fraser.

Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
By calling it from incrementVisually*() and setting the m_isVisuallyNonEmpty flag to true early does not have any impact on when the milestone is fired.
The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).

This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().

* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::loadProgressingStatusChanged):
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h