Title: [242654] trunk/Source/WebCore
Revision
242654
Author
[email protected]
Date
2019-03-08 13:11:41 -0800 (Fri, 08 Mar 2019)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (242653 => 242654)


--- trunk/Source/WebCore/ChangeLog	2019-03-08 20:52:56 UTC (rev 242653)
+++ trunk/Source/WebCore/ChangeLog	2019-03-08 21:11:41 UTC (rev 242654)
@@ -1,3 +1,23 @@
+2019-03-08  Zalan Bujtas  <[email protected]>
+
+        [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.
+
 2019-03-08  Chris Fleizach  <[email protected]>
 
         AX: AOM accessibleclick does not work on iOS

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp (242653 => 242654)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-03-08 20:52:56 UTC (rev 242653)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-03-08 21:11:41 UTC (rev 242654)
@@ -94,6 +94,7 @@
     LOG_WITH_STREAM(ContentObservation, stream << "startObservingDOMTimerExecute: start observing (" << &timer << ") timer callback.");
 
     m_domTimerIsBeingExecuted = true;
+    adjustObservedState(Event::StartedDOMTimerExecution);
 }
 
 void ContentChangeObserver::domTimerExecuteDidFinish(const DOMTimer& timer)
@@ -110,7 +111,7 @@
 
 void ContentChangeObserver::styleRecalcDidStart()
 {
-    if (!isObservingStyleRecalc())
+    if (!isWaitingForStyleRecalc())
         return;
     if (hasVisibleChangeState())
         return;
@@ -117,17 +118,17 @@
     LOG(ContentObservation, "startObservingStyleRecalc: start observing style recalc.");
 
     m_styleRecalcIsBeingExecuted = true;
+    adjustObservedState(Event::StartedStyleRecalc);
 }
 
 void ContentChangeObserver::styleRecalcDidFinish()
 {
-    if (!isObservingStyleRecalc())
+    if (!isWaitingForStyleRecalc())
         return;
     LOG(ContentObservation, "stopObservingStyleRecalc: stop observing style recalc");
 
     m_styleRecalcIsBeingExecuted = false;
-    setShouldObserveNextStyleRecalc(false);
-    adjustObservedState(Event::StyleRecalcFinished);
+    adjustObservedState(Event::EndedStyleRecalc);
 }
 
 void ContentChangeObserver::cancelPendingActivities()
@@ -209,7 +210,7 @@
 {
     if (shouldObserve)
         LOG(ContentObservation, "Wait until next style recalc fires.");
-    m_isObservingStyleRecalc = shouldObserve;
+    m_isWaitingForStyleRecalc = shouldObserve;
 }
 
 bool ContentChangeObserver::hasDeterminateState() const
@@ -256,6 +257,10 @@
         setShouldObserveDOMTimerScheduling(true);
         m_isMouseMovedPrecededByTouch = false;
         break;
+    case Event::StartedDOMTimerExecution:
+    case Event::StartedStyleRecalc:
+        ASSERT(observedContentChange() == WKContentIndeterminateChange);
+        break;
     case Event::EndedTouchStartEventDispatching:
     case Event::EndedMouseMovedEventDispatching:
         setShouldObserveDOMTimerScheduling(false);
@@ -266,8 +271,10 @@
         ASSERT(!hasVisibleChangeState());
         setHasIndeterminateState();
         break;
+    case Event::EndedStyleRecalc:
+        setShouldObserveNextStyleRecalc(false);
+        FALLTHROUGH;
     case Event::RemovedDOMTimer:
-    case Event::StyleRecalcFinished:
     case Event::EndedDOMTimerExecution:
     case Event::EndedFixedObservationTimeWindow:
         // Demote to "no change" when there's no pending activity anymore.

Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.h (242653 => 242654)


--- trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-03-08 20:52:56 UTC (rev 242653)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-03-08 21:11:41 UTC (rev 242654)
@@ -117,7 +117,7 @@
     void styleRecalcDidStart();
     void styleRecalcDidFinish();
     void setShouldObserveNextStyleRecalc(bool);
-    bool isObservingStyleRecalc() const { return m_isObservingStyleRecalc; }
+    bool isWaitingForStyleRecalc() const { return m_isWaitingForStyleRecalc; }
 
     bool isObservingContentChanges() const { return m_mouseMovedEventIsBeingDispatched || m_touchEventIsBeingDispatched || m_domTimerIsBeingExecuted || m_styleRecalcIsBeingExecuted || m_contentObservationTimer.isActive(); }
 
@@ -145,11 +145,13 @@
         EndedMouseMovedEventDispatching,
         InstalledDOMTimer,
         RemovedDOMTimer,
+        StartedDOMTimerExecution,
         EndedDOMTimerExecution,
-        StyleRecalcFinished,
-        ContentVisibilityChanged,
+        StartedStyleRecalc,
+        EndedStyleRecalc,
         StartedFixedObservationTimeWindow,
-        EndedFixedObservationTimeWindow
+        EndedFixedObservationTimeWindow,
+        ContentVisibilityChanged
     };
     void adjustObservedState(Event);
 
@@ -157,7 +159,7 @@
     Timer m_contentObservationTimer;
     HashSet<const DOMTimer*> m_DOMTimerList;
     bool m_touchEventIsBeingDispatched { false };
-    bool m_isObservingStyleRecalc { false };
+    bool m_isWaitingForStyleRecalc { false };
     bool m_styleRecalcIsBeingExecuted { false };
     bool m_isObservingDOMTimerScheduling { false };
     bool m_domTimerIsBeingExecuted { false };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to