Unreviewed, rolling out r242403.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 17:18:30 +0000 (17:18 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 17:18:30 +0000 (17:18 +0000)
Caused layout test crashes on iOS simulator.

Reverted changeset:

"[ContentChangeObserver] Introduce fixed duration content
observation"
https://bugs.webkit.org/show_bug.cgi?id=195295
https://trac.webkit.org/changeset/242403

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

LayoutTests/ChangeLog
LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops-expected.txt [deleted file]
LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

index 1b182c0..3b423ee 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r242403.
+
+        Caused layout test crashes on iOS simulator.
+
+        Reverted changeset:
+
+        "[ContentChangeObserver] Introduce fixed duration content
+        observation"
+        https://bugs.webkit.org/show_bug.cgi?id=195295
+        https://trac.webkit.org/changeset/242403
+
 2019-03-04  Diego Pino Garcia  <dpino@igalia.com>
 
         [GTK] Unreviewed test gardening
diff --git a/LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops-expected.txt b/LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops-expected.txt
deleted file mode 100644 (file)
index 66db4c9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-PASS if 'clicked' text is not shown below.
-
diff --git a/LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops.html b/LayoutTests/fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
deleted file mode 100644 (file)
index 6077028..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<head>
-<title>This tests the case when nested timers trigger visible content change</title>
-<script src="../../../../resources/basic-gestures.js"></script>
-<style>
-#tapthis {
-    width: 400px;
-    height: 400px;
-    border: 1px solid green;
-}
-
-#becomesVisible {
-    visibility: hidden;
-    width: 100px;
-    height: 100px;
-    background-color: green;
-}
-</style>
-<script>
-async function test() {
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    testRunner.waitUntilDone();
-    testRunner.dumpAsText();
-
-    let rect = tapthis.getBoundingClientRect();
-    let x = rect.left + rect.width / 2;
-    let y = rect.top + rect.height / 2;
-
-    await tapAtPoint(x, y);
-}
-</script>
-</head>
-<body onload="test()">
-<div id=tapthis>PASS if 'clicked' text is not shown below.</div>
-<div id=becomesVisible></div>
-<pre id=result></pre>
-<script>
-tapthis.addEventListener("mouseover", function( event ) {
-    // 1. Install a short timer on hover
-    setTimeout(function() {
-        // 2. Trigger some non-visibility style change with forcing offsetHeight.
-        becomesVisible.style.marginLeft = "5px";
-        document.body.offsetHeight;
-
-        // 3. Install a nested timer with visibility change.
-        setTimeout(function() {
-            becomesVisible.style.visibility = "visible";
-            document.body.offsetHeight;
-            if (window.testRunner)
-                setTimeout(testRunner.notifyDone(), 0);
-        }, 10);
-    }, 0);
-}, false);
-
-becomesVisible.addEventListener("click", function( event ) {   
-    result.innerHTML = "clicked hidden";
-}, false);
-
-tapthis.addEventListener("click", function( event ) {   
-    result.innerHTML = "clicked";
-}, false);
-</script>
-</body>
-</html>
index 1d4a3c1..ee7b9f4 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r242403.
+
+        Caused layout test crashes on iOS simulator.
+
+        Reverted changeset:
+
+        "[ContentChangeObserver] Introduce fixed duration content
+        observation"
+        https://bugs.webkit.org/show_bug.cgi?id=195295
+        https://trac.webkit.org/changeset/242403
+
 2019-03-05  Frederic Wang  <fwang@igalia.com>
 
         Web Inspector: Better categorize CPU usage per-thread / worker
index b079559..8b1cfe2 100644 (file)
@@ -38,26 +38,9 @@ namespace WebCore {
 
 ContentChangeObserver::ContentChangeObserver(Document& document)
     : m_document(document)
-    , m_contentObservationTimer([this] { stopDurationBasedContentObservation(); })
 {
 }
 
-void ContentChangeObserver::startContentObservationForDuration(Seconds duration)
-{
-    if (hasVisibleChangeState())
-        return;
-    LOG_WITH_STREAM(ContentObservation, stream << "startContentObservationForDuration: start observing the content for " << duration.milliseconds() << "ms");
-    adjustObservedState(Event::StartedFixedObservationTimeWindow);
-    m_contentObservationTimer.startOneShot(duration);
-}
-
-void ContentChangeObserver::stopDurationBasedContentObservation()
-{
-    LOG_WITH_STREAM(ContentObservation, stream << "stopDurationBasedContentObservation: stop duration based content observing ");
-    adjustObservedState(Event::EndedFixedObservationTimeWindow);
-    notifyContentChangeIfNeeded();
-}
-
 void ContentChangeObserver::didInstallDOMTimer(const DOMTimer& timer, Seconds timeout, bool singleShot)
 {
     if (m_document.activeDOMObjectsAreSuspended())
@@ -196,7 +179,7 @@ bool ContentChangeObserver::hasDeterminateState() const
 {
     if (hasVisibleChangeState())
         return true;
-    return observedContentChange() == WKContentNoChange && !hasPendingActivity();
+    return observedContentChange() == WKContentNoChange && !hasObservedDOMTimer() && !m_document.hasPendingStyleRecalc();
 }
 
 void ContentChangeObserver::adjustObservedState(Event event)
@@ -206,16 +189,14 @@ void ContentChangeObserver::adjustObservedState(Event event)
         setHasNoChangeState();
         break;
     case Event::InstalledDOMTimer:
-    case Event::StartedFixedObservationTimeWindow:
         // Expecting a timer fire. Promote to an indeterminate state.
         ASSERT(!hasVisibleChangeState());
         setHasIndeterminateState();
         break;
     case Event::RemovedDOMTimer:
     case Event::StyleRecalcFinished:
-    case Event::EndedFixedObservationTimeWindow:
         // Demote to "no change" when there's no pending activity anymore.
-        if (observedContentChange() == WKContentIndeterminateChange && !hasPendingActivity())
+        if (observedContentChange() == WKContentIndeterminateChange && !hasObservedDOMTimer() && !m_document.hasPendingStyleRecalc())
             setHasNoChangeState();
         break;
     case Event::ContentVisibilityChanged:
index 170f2e7..23d1250 100644 (file)
@@ -27,7 +27,6 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#include "Timer.h"
 #include "WKContentObservation.h"
 
 namespace WebCore {
@@ -39,7 +38,6 @@ class ContentChangeObserver {
 public:
     ContentChangeObserver(Document&);
 
-    WEBCORE_EXPORT void startContentObservationForDuration(Seconds duration);
     WEBCORE_EXPORT WKContentChange observedContentChange() const;
 
     void didInstallDOMTimer(const DOMTimer&, Seconds timeout, bool singleShot);
@@ -104,7 +102,7 @@ private:
     void setShouldObserveNextStyleRecalc(bool);
     bool isObservingStyleRecalc() const { return m_isObservingStyleRecalc; }
 
-    bool isObservingContentChanges() const { return m_domTimerisBeingExecuted || m_styleRecalcIsBeingExecuted || m_contentObservationTimer.isActive(); }
+    bool isObservingContentChanges() const { return m_domTimerisBeingExecuted || m_styleRecalcIsBeingExecuted; }
 
     void clearObservedDOMTimers() { m_DOMTimerList.clear(); }
     void clearTimersAndReportContentChange();
@@ -119,23 +117,16 @@ private:
 
     void notifyContentChangeIfNeeded();
 
-    void stopDurationBasedContentObservation();
-
-    bool hasPendingActivity() const { return hasObservedDOMTimer() || m_document.hasPendingStyleRecalc() || m_contentObservationTimer.isActive(); }
-
     enum class Event {
         ContentObservationStarted,
         InstalledDOMTimer,
         RemovedDOMTimer,
         StyleRecalcFinished,
-        ContentVisibilityChanged,
-        StartedFixedObservationTimeWindow,
-        EndedFixedObservationTimeWindow
+        ContentVisibilityChanged
     };
     void adjustObservedState(Event);
 
     Document& m_document;
-    Timer m_contentObservationTimer;
     HashSet<const DOMTimer*> m_DOMTimerList;
     bool m_isObservingStyleRecalc { false };
     bool m_styleRecalcIsBeingExecuted { false };
index dedb8ab..dd134f3 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-05  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r242403.
+
+        Caused layout test crashes on iOS simulator.
+
+        Reverted changeset:
+
+        "[ContentChangeObserver] Introduce fixed duration content
+        observation"
+        https://bugs.webkit.org/show_bug.cgi?id=195295
+        https://trac.webkit.org/changeset/242403
+
 2019-03-05  Loïc Yhuel  <loic.yhuel@softathome.com>
 
         [WPE] Do not create a PlatformDisplay in the Service Worker process
index 0105768..42ee757 100644 (file)
@@ -552,9 +552,6 @@ void WebPage::handleSyntheticClick(Node& nodeRespondingToClick, const WebCore::F
         mainframe.document()->updateStyleIfNeeded();
     }
 
-    const Seconds observationDuration = 32_ms;
-    respondingDocument.contentChangeObserver().startContentObservationForDuration(observationDuration);
-
     m_pendingSyntheticClickNode = nullptr;
     m_pendingSyntheticClickLocation = FloatPoint();
     m_pendingSyntheticClickModifiers = { };