[webkit-changes] [248761] trunk/Source/WebCore

2019-08-15 Thread zalan
Title: [248761] trunk/Source/WebCore








Revision 248761
Author za...@apple.com
Date 2019-08-15 21:28:49 -0700 (Thu, 15 Aug 2019)


Log Message
[ContentChangeObserver] Rename contentVisibilityDidChange to elementDidBecomeVisible
https://bugs.webkit.org/show_bug.cgi?id=200780


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:

Modified Paths

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




Diff

Modified: trunk/Source/WebCore/ChangeLog (248760 => 248761)

--- trunk/Source/WebCore/ChangeLog	2019-08-16 03:03:32 UTC (rev 248760)
+++ trunk/Source/WebCore/ChangeLog	2019-08-16 04:28:49 UTC (rev 248761)
@@ -1,5 +1,23 @@
 2019-08-15  Zalan Bujtas  
 
+[ContentChangeObserver] Rename contentVisibilityDidChange to elementDidBecomeVisible
+https://bugs.webkit.org/show_bug.cgi?id=200780
+
+
+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  
+
 [ContentChangeObserver] Keep track of all the visibility candidates.
 https://bugs.webkit.org/show_bug.cgi?id=200777
 


Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp (248760 => 248761)

--- trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-16 03:03:32 UTC (rev 248760)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp	2019-08-16 04:28:49 UTC (rev 248761)
@@ -253,7 +253,7 @@
 return;
 }
 if (isConsideredClickable(*targetElement, ElementHadRenderer::Yes))
-weakThis->contentVisibilityDidChange(*targetElement);
+weakThis->elementDidBecomeVisible(*targetElement);
 weakThis->adjustObservedState(Event::CompletedTransition);
 });
 }
@@ -409,11 +409,11 @@
 }
 }
 
-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 @@
 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 @@
 };
 
 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)


Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.h (248760 => 248761)

--- trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-08-16 03:03:32 UTC (rev 248760)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.h	2019-08-16 04:28:49 UTC (rev 248761)
@@ -128,7 +128,7 @@
 
 void didRecognizeLongPress();
 
-void contentVisibilityDidChange(const Element&);
+void elementDidBecomeVisible(const Element&);
 
 void setShouldObserveDOMTimerSchedulingAndTransitions(bool);
 bool isObservingDOMTimerScheduling() const { return m_isObservingDOMTimerScheduling; }
@@ -195,7 +195,7 @@
 CanceledTransition,
 StartedFixedObservationTimeWindow,
 EndedFixedObservationTimeWindow,
-ContentVisibilityChanged
+ElementDidBecomeVisible
 

[webkit-changes] [248759] trunk

2019-08-15 Thread zalan
Title: [248759] trunk








Revision 248759
Author za...@apple.com
Date 2019-08-15 19:20:57 -0700 (Thu, 15 Aug 2019)


Log Message
[ContentChangeObserver] Keep track of all the visibility candidates.
https://bugs.webkit.org/show_bug.cgi?id=200777


Reviewed by Simon Fraser.

Source/WebCore:

In order to find out whether a visible (and actionable) content change happened, we need to keep track of all the candidate elements.

Test: fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::reset):
(WebCore::ContentChangeObserver::rendererWillBeDestroyed):
(WebCore::ContentChangeObserver::contentVisibilityDidChange):
(WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):
* page/ios/ContentChangeObserver.h:

Source/WTF:

* wtf/WeakHashSet.h:

LayoutTests:

* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt: Added.
* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/WeakHashSet.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp
trunk/Source/WebCore/page/ios/ContentChangeObserver.h


Added Paths

trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt
trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html




Diff

Modified: trunk/LayoutTests/ChangeLog (248758 => 248759)

--- trunk/LayoutTests/ChangeLog	2019-08-16 02:08:29 UTC (rev 248758)
+++ trunk/LayoutTests/ChangeLog	2019-08-16 02:20:57 UTC (rev 248759)
@@ -1,3 +1,14 @@
+2019-08-15  Zalan Bujtas  
+
+[ContentChangeObserver] Keep track of all the visibility candidates.
+https://bugs.webkit.org/show_bug.cgi?id=200777
+
+
+Reviewed by Simon Fraser.
+
+* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt: Added.
+* fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html: Added.
+
 2019-08-15  Myles C. Maxfield  
 
 [WHLSL] Add unary plus


Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt (0 => 248759)

--- trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2-expected.txt	2019-08-16 02:20:57 UTC (rev 248759)
@@ -0,0 +1 @@
+PASS if 'clicked' text is not shown below.


Added: trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html (0 => 248759)

--- trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html	(rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/content-observation/going-from-hidden-to-visible-and-to-hidden2.html	2019-08-16 02:20:57 UTC (rev 248759)
@@ -0,0 +1,70 @@
+
+
+
+This tests the case when 2 visible and actionable elements show up and the first one gets destroyed right away.
+
+#tapThis {
+width: 400px;
+height: 400px;
+border: 1px solid green;
+}
+
+#willBecomeVisibleMomentarily {
+display: none;
+width: 100px;
+height: 100px;
+background-color: red;
+}
+#willBecomeVisible {
+display: none;
+width: 100px;
+height: 100px;
+background-color: green;
+}
+
+