Changeset 248641 in webkit


Ignore:
Timestamp:
Aug 13, 2019 4:03:44 PM (5 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] adjustStateAndNotifyContentChangeIfNeeded should check isObservationTimeWindowActive()
https://bugs.webkit.org/show_bug.cgi?id=200687
<rdar://problem/54271221>

Reviewed by Simon Fraser.

Move the check to adjustStateAndNotifyContentChangeIfNeeded.

  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::adjustObservedState):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r248640 r248641  
     12019-08-13  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] adjustStateAndNotifyContentChangeIfNeeded should check isObservationTimeWindowActive()
     4        https://bugs.webkit.org/show_bug.cgi?id=200687
     5        <rdar://problem/54271221>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Move the check to adjustStateAndNotifyContentChangeIfNeeded.
     10
     11        * page/ios/ContentChangeObserver.cpp:
     12        (WebCore::ContentChangeObserver::adjustObservedState):
     13
    1142019-08-13  John Wilander  <wilander@apple.com>
    215
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r248635 r248641  
    495495    };
    496496
    497     auto adjustStateAndNotifyContentChangeIfNeeded = [&] {
    498         // Demote to "no change" when there's no pending activity anymore.
     497    auto notifyClientIfNeeded = [&] {
     498        // First demote to "no change" if there's no pending activity anymore.
    499499        if (observedContentChange() == WKContentIndeterminateChange && !hasPendingActivity())
    500500            setHasNoChangeState();
    501501
    502         // Do not notify the client unless we couldn't make the decision synchronously.
     502        if (isBetweenTouchEndAndMouseMoved()) {
     503            LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: Not reached mouseMoved yet. No need to notify the client.");
     504            return;
     505        }
    503506        if (m_mouseMovedEventIsBeingDispatched) {
    504507            LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: in mouseMoved call. No need to notify the client.");
    505508            return;
    506509        }
    507         if (isBetweenTouchEndAndMouseMoved()) {
    508             LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: Not reached mouseMoved yet. No need to notify the client.");
     510        if (isObservationTimeWindowActive()) {
     511            LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: Inside the fixed window observation. No need to notify the client.");
    509512            return;
    510513        }
     
    552555        }
    553556        if (event == Event::EndedFixedObservationTimeWindow) {
    554             adjustStateAndNotifyContentChangeIfNeeded();
     557            notifyClientIfNeeded();
    555558            return;
    556559        }
     
    564567        }
    565568        if (event == Event::RemovedDOMTimer || event == Event::CanceledTransition) {
    566             if (!isObservationTimeWindowActive())
    567                 adjustStateAndNotifyContentChangeIfNeeded();
     569            notifyClientIfNeeded();
    568570            return;
    569571        }
     
    573575        }
    574576        if (event == Event::EndedDOMTimerExecution) {
    575             setShouldObserveNextStyleRecalc(m_document.hasPendingStyleRecalc());
    576             if (!isObservationTimeWindowActive())
    577                 adjustStateAndNotifyContentChangeIfNeeded();
     577            if (m_document.hasPendingStyleRecalc()) {
     578                setShouldObserveNextStyleRecalc(true);
     579                return;
     580            }
     581            notifyClientIfNeeded();
    578582            return;
    579583        }
     
    584588                // We need to start observing this style change synchronously.
    585589                m_isInObservedStyleRecalc = true;
    586             } else
    587                 setShouldObserveNextStyleRecalc(true);
     590                return;
     591            }
     592            setShouldObserveNextStyleRecalc(true);
    588593            return;
    589594        }
    590595        if (event == Event::CompletedTransition) {
    591             if (m_document.inStyleRecalc())
     596            if (m_document.inStyleRecalc()) {
    592597                m_isInObservedStyleRecalc = true;
    593             else if (!isObservationTimeWindowActive())
    594                 adjustStateAndNotifyContentChangeIfNeeded();
     598                return;
     599            }
     600            notifyClientIfNeeded();
    595601            return;
    596602        }
     
    601607        }
    602608        if (event == Event::EndedStyleRecalc) {
    603             if (!isObservationTimeWindowActive())
    604                 adjustStateAndNotifyContentChangeIfNeeded();
     609            notifyClientIfNeeded();
    605610            return;
    606611        }
Note: See TracChangeset for help on using the changeset viewer.