[ContentChangeObserver] Rename contentVisibilityDidChange to elementDidBecomeVisible
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 04:28:49 +0000 (04:28 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 04:28:49 +0000 (04:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200780
<rdar://problem/54358330>

Reviewed by Simon Fraser.

"elementDidBecomeVisible" name is more accurate and also we'll probably start tracking changes from visible to hidden soon.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didFinishTransition):
(WebCore::ContentChangeObserver::visibilityChangedFromHiddenToVisible):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::contentVisibilityDidChange): Deleted.
* page/ios/ContentChangeObserver.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248761 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h

index 1085d1c..2abc69d 100644 (file)
@@ -1,5 +1,23 @@
 2019-08-15  Zalan Bujtas  <zalan@apple.com>
 
+        [ContentChangeObserver] Rename contentVisibilityDidChange to elementDidBecomeVisible
+        https://bugs.webkit.org/show_bug.cgi?id=200780
+        <rdar://problem/54358330>
+
+        Reviewed by Simon Fraser.
+
+        "elementDidBecomeVisible" name is more accurate and also we'll probably start tracking changes from visible to hidden soon.
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::didFinishTransition):
+        (WebCore::ContentChangeObserver::visibilityChangedFromHiddenToVisible):
+        (WebCore::ContentChangeObserver::adjustObservedState):
+        (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
+        (WebCore::ContentChangeObserver::contentVisibilityDidChange): Deleted.
+        * page/ios/ContentChangeObserver.h:
+
+2019-08-15  Zalan Bujtas  <zalan@apple.com>
+
         [ContentChangeObserver] Keep track of all the visibility candidates.
         https://bugs.webkit.org/show_bug.cgi?id=200777
         <rdar://problem/54356331>
index e2a469f..e89fb05 100644 (file)
@@ -253,7 +253,7 @@ void ContentChangeObserver::didFinishTransition(const Element& element, CSSPrope
             return;
         }
         if (isConsideredClickable(*targetElement, ElementHadRenderer::Yes))
-            weakThis->contentVisibilityDidChange(*targetElement);
+            weakThis->elementDidBecomeVisible(*targetElement);
         weakThis->adjustObservedState(Event::CompletedTransition);
     });
 }
@@ -409,11 +409,11 @@ void ContentChangeObserver::rendererWillBeDestroyed(const Element& element)
     }
 }
 
-void ContentChangeObserver::contentVisibilityDidChange(const Element& element)
+void ContentChangeObserver::elementDidBecomeVisible(const Element& element)
 {
-    LOG(ContentObservation, "contentVisibilityDidChange: visible content change did happen.");
+    LOG(ContentObservation, "elementDidBecomeVisible: visible content change did happen.");
     m_visibilityCandidateList.add(element);
-    adjustObservedState(Event::ContentVisibilityChanged);
+    adjustObservedState(Event::ElementDidBecomeVisible);
 }
 
 void ContentChangeObserver::touchEventDidStart(PlatformEvent::Type eventType)
@@ -612,7 +612,7 @@ void ContentChangeObserver::adjustObservedState(Event event)
         return;
     }
     // The page produced an visible change on an actionable content.
-    if (event == Event::ContentVisibilityChanged) {
+    if (event == Event::ElementDidBecomeVisible) {
         setHasVisibleChangeState();
         // Stop pending activities. We don't need to observe them anymore.
         stopObservingPendingActivities();
@@ -641,7 +641,7 @@ ContentChangeObserver::StyleChangeScope::~StyleChangeScope()
     };
 
     if (changedFromHiddenToVisible() && isConsideredClickable(m_element, m_hadRenderer ? ElementHadRenderer::Yes : ElementHadRenderer::No))
-        m_contentChangeObserver.contentVisibilityDidChange(m_element);
+        m_contentChangeObserver.elementDidBecomeVisible(m_element);
 }
 
 #if ENABLE(TOUCH_EVENTS)
index 21c2fd6..80980ac 100644 (file)
@@ -128,7 +128,7 @@ private:
 
     void didRecognizeLongPress();
 
-    void contentVisibilityDidChange(const Element&);
+    void elementDidBecomeVisible(const Element&);
 
     void setShouldObserveDOMTimerSchedulingAndTransitions(bool);
     bool isObservingDOMTimerScheduling() const { return m_isObservingDOMTimerScheduling; }
@@ -195,7 +195,7 @@ private:
         CanceledTransition,
         StartedFixedObservationTimeWindow,
         EndedFixedObservationTimeWindow,
-        ContentVisibilityChanged
+        ElementDidBecomeVisible
     };
     void adjustObservedState(Event);