Changeset 257126 in webkit


Ignore:
Timestamp:
Feb 20, 2020 7:40:37 PM (4 years ago)
Author:
Alan Bujtas
Message:

[First paint] Let optional style recalcs go through while in visually-non-empty state.
https://bugs.webkit.org/show_bug.cgi?id=208020
<rdar://problem/59636549>

Reviewed by Simon Fraser.

This is the final step to ensure we don't end up delaying the qualifiesAsVisuallyNonEmpty check when
the page happens to not trigger synchronous style recalcs.

Here is the optimized flow:
Optional style realc -> FrameView::styleAndRenderTreeDidChange -> qualifiesAsVisuallyNonEmpty -> Document::shouldScheduleLayout true.

This could be a slight regression in certain cases because now we let the optional style recalcs through and
only delay the redundant layouts (as opposed to delay both).

  • dom/Document.cpp:

(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::shouldScheduleLayout):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r257125 r257126  
     12020-02-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        [First paint] Let optional style recalcs go through while in visually-non-empty state.
     4        https://bugs.webkit.org/show_bug.cgi?id=208020
     5        <rdar://problem/59636549>
     6
     7        Reviewed by Simon Fraser.
     8
     9        This is the final step to ensure we don't end up delaying the qualifiesAsVisuallyNonEmpty check when
     10        the page happens to not trigger synchronous style recalcs.
     11
     12        Here is the optimized flow:
     13        Optional style realc -> FrameView::styleAndRenderTreeDidChange -> qualifiesAsVisuallyNonEmpty -> Document::shouldScheduleLayout true.
     14
     15        This could be a slight regression in certain cases because now we let the optional style recalcs through and
     16        only delay the redundant layouts (as opposed to delay both).
     17
     18        * dom/Document.cpp:
     19        (WebCore::Document::scheduleStyleRecalc):
     20        (WebCore::Document::shouldScheduleLayout):
     21
    1222020-02-20  Eric Carlson  <eric.carlson@apple.com>
    223
  • trunk/Source/WebCore/dom/Document.cpp

    r256911 r257126  
    18731873
    18741874    ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild);
    1875     auto shouldThrottleStyleRecalc = [&] {
    1876         if (!view() || !view()->isVisuallyNonEmpty())
    1877             return false;
    1878         if (!page() || !page()->chrome().client().renderingUpdateThrottlingIsActive())
    1879             return false;
    1880         return true;
    1881     };
    1882 
    1883     if (shouldThrottleStyleRecalc())
    1884         return;
     1875    if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive()) {
     1876        // Do not run optional style recalcs while we throttle painting.
     1877        return;
     1878    }
    18851879
    18861880    m_styleRecalcTimer.startOneShot(0_s);
     
    31363130    if (styleScope().hasPendingSheetsBeforeBody())
    31373131        return false;
    3138     if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive() && view() && view()->isVisuallyNonEmpty())
     3132    if (page() && page()->chrome().client().renderingUpdateThrottlingIsActive())
    31393133        return false;
    3140 
     3134    if (view() && !view()->isVisuallyNonEmpty())
     3135        return false;
    31413136    return true;
    31423137}
Note: See TracChangeset for help on using the changeset viewer.