⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242654 in webkit


Ignore:
Timestamp:
Mar 8, 2019, 1:11:41 PM (7 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
https://bugs.webkit.org/show_bug.cgi?id=195463
<rdar://problem/48714762>

Reviewed by Simon Fraser.

This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).

  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):

  • page/ios/ContentChangeObserver.h:

(WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242651 r242654  
     12019-03-08  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
     4        https://bugs.webkit.org/show_bug.cgi?id=195463
     5        <rdar://problem/48714762>
     6
     7        Reviewed by Simon Fraser.
     8
     9        This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).
     10
     11        * page/ios/ContentChangeObserver.cpp:
     12        (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
     13        (WebCore::ContentChangeObserver::styleRecalcDidStart):
     14        (WebCore::ContentChangeObserver::styleRecalcDidFinish):
     15        (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
     16        (WebCore::ContentChangeObserver::adjustObservedState):
     17        * page/ios/ContentChangeObserver.h:
     18        (WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
     19        (WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.
     20
    1212019-03-08  Chris Fleizach  <cfleizach@apple.com>
    222
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r242635 r242654  
    9595
    9696    m_domTimerIsBeingExecuted = true;
     97    adjustObservedState(Event::StartedDOMTimerExecution);
    9798}
    9899
     
    111112void ContentChangeObserver::styleRecalcDidStart()
    112113{
    113     if (!isObservingStyleRecalc())
     114    if (!isWaitingForStyleRecalc())
    114115        return;
    115116    if (hasVisibleChangeState())
     
    118119
    119120    m_styleRecalcIsBeingExecuted = true;
     121    adjustObservedState(Event::StartedStyleRecalc);
    120122}
    121123
    122124void ContentChangeObserver::styleRecalcDidFinish()
    123125{
    124     if (!isObservingStyleRecalc())
     126    if (!isWaitingForStyleRecalc())
    125127        return;
    126128    LOG(ContentObservation, "stopObservingStyleRecalc: stop observing style recalc");
    127129
    128130    m_styleRecalcIsBeingExecuted = false;
    129     setShouldObserveNextStyleRecalc(false);
    130     adjustObservedState(Event::StyleRecalcFinished);
     131    adjustObservedState(Event::EndedStyleRecalc);
    131132}
    132133
     
    210211    if (shouldObserve)
    211212        LOG(ContentObservation, "Wait until next style recalc fires.");
    212     m_isObservingStyleRecalc = shouldObserve;
     213    m_isWaitingForStyleRecalc = shouldObserve;
    213214}
    214215
     
    257258        m_isMouseMovedPrecededByTouch = false;
    258259        break;
     260    case Event::StartedDOMTimerExecution:
     261    case Event::StartedStyleRecalc:
     262        ASSERT(observedContentChange() == WKContentIndeterminateChange);
     263        break;
    259264    case Event::EndedTouchStartEventDispatching:
    260265    case Event::EndedMouseMovedEventDispatching:
     
    267272        setHasIndeterminateState();
    268273        break;
     274    case Event::EndedStyleRecalc:
     275        setShouldObserveNextStyleRecalc(false);
     276        FALLTHROUGH;
    269277    case Event::RemovedDOMTimer:
    270     case Event::StyleRecalcFinished:
    271278    case Event::EndedDOMTimerExecution:
    272279    case Event::EndedFixedObservationTimeWindow:
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.h

    r242635 r242654  
    118118    void styleRecalcDidFinish();
    119119    void setShouldObserveNextStyleRecalc(bool);
    120     bool isObservingStyleRecalc() const { return m_isObservingStyleRecalc; }
     120    bool isWaitingForStyleRecalc() const { return m_isWaitingForStyleRecalc; }
    121121
    122122    bool isObservingContentChanges() const { return m_mouseMovedEventIsBeingDispatched || m_touchEventIsBeingDispatched || m_domTimerIsBeingExecuted || m_styleRecalcIsBeingExecuted || m_contentObservationTimer.isActive(); }
     
    146146        InstalledDOMTimer,
    147147        RemovedDOMTimer,
     148        StartedDOMTimerExecution,
    148149        EndedDOMTimerExecution,
    149         StyleRecalcFinished,
    150         ContentVisibilityChanged,
     150        StartedStyleRecalc,
     151        EndedStyleRecalc,
    151152        StartedFixedObservationTimeWindow,
    152         EndedFixedObservationTimeWindow
     153        EndedFixedObservationTimeWindow,
     154        ContentVisibilityChanged
    153155    };
    154156    void adjustObservedState(Event);
     
    158160    HashSet<const DOMTimer*> m_DOMTimerList;
    159161    bool m_touchEventIsBeingDispatched { false };
    160     bool m_isObservingStyleRecalc { false };
     162    bool m_isWaitingForStyleRecalc { false };
    161163    bool m_styleRecalcIsBeingExecuted { false };
    162164    bool m_isObservingDOMTimerScheduling { false };
Note: See TracChangeset for help on using the changeset viewer.