Changeset 242689 in webkit


Ignore:
Timestamp:
Mar 10, 2019 1:08:54 PM (5 years ago)
Author:
Alan Bujtas
Message:

[ContentChangeObserver] Fix failing test cases
https://bugs.webkit.org/show_bug.cgi?id=195524
<rdar://problem/48745101>

Reviewed by Simon Fraser.

Source/WebCore:

  1. Do not start DOM timer install observation when we already detected change at touchstart.
  2. hasPendingActivity() should only care about ContentChangeObserver flags.
  3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen

when a timer gets intalled and removed right away).

  • page/ios/ContentChangeObserver.cpp:

(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.

  • page/ios/ContentChangeObserver.h:

(WebCore::ContentChangeObserver::hasPendingActivity const):
(WebCore::ContentChangeObserver::isObservationTimeWindowActive const):

LayoutTests:

They've been failing ever since the 32ms fixed time window was introduced.

  • fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html:
  • fast/events/touch/ios/content-observation/stuck-with-hover-state.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242688 r242689  
     12019-03-10  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Fix failing test cases
     4        https://bugs.webkit.org/show_bug.cgi?id=195524
     5        <rdar://problem/48745101>
     6
     7        Reviewed by Simon Fraser.
     8
     9        They've been failing ever since the 32ms fixed time window was introduced.
     10
     11        * fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html:
     12        * fast/events/touch/ios/content-observation/stuck-with-hover-state.html:
     13
    1142019-03-10  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html

    r242621 r242689  
    2626        await tapAtPoint(x, y);
    2727
    28     testRunner.notifyDone();
     28    setTimeout("testRunner.notifyDone()", 50);
    2929}
    3030</script>
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/stuck-with-hover-state.html

    r242621 r242689  
    2626        await tapAtPoint(x, y);
    2727
    28     testRunner.notifyDone();
     28    setTimeout("testRunner.notifyDone()", 50);
    2929}
    3030</script>
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html

    r242621 r242689  
    5151        becomesVisible.style.visibility = "visible";
    5252        document.body.offsetHeight;
    53         if (window.testRunner)
    54             setTimeout(testRunner.notifyDone(), 0);
     53        setTimeout("testRunner.notifyDone()", 0);
    5554    }, 20);
    5655}, false);
  • trunk/LayoutTests/fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html

    r242628 r242689  
    5151            becomesVisible.style.visibility = "visible";
    5252            document.body.offsetHeight;
    53             if (window.testRunner)
    54                 setTimeout(testRunner.notifyDone(), 0);
     53            setTimeout("testRunner.notifyDone()", 0);
    5554        }, 10);
    5655    }, 0);
  • trunk/Source/WebCore/ChangeLog

    r242687 r242689  
     12019-03-10  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ContentChangeObserver] Fix failing test cases
     4        https://bugs.webkit.org/show_bug.cgi?id=195524
     5        <rdar://problem/48745101>
     6
     7        Reviewed by Simon Fraser.
     8
     9        1. Do not start DOM timer install observation when we already detected change at touchstart.
     10        2. hasPendingActivity() should only care about ContentChangeObserver flags.
     11        3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen
     12        when a timer gets intalled and removed right away).
     13
     14        * page/ios/ContentChangeObserver.cpp:
     15        (WebCore::ContentChangeObserver::adjustObservedState):
     16        (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
     17        * page/ios/ContentChangeObserver.h:
     18        (WebCore::ContentChangeObserver::hasPendingActivity const):
     19        (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
     20
    1212019-03-10  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp

    r242679 r242689  
    226226}
    227227
    228 #if !ASSERT_DISABLED
    229 bool ContentChangeObserver::isNotifyContentChangeAllowed() const
    230 {
    231     return m_document.settings().contentChangeObserverEnabled() && !m_mouseMovedEventIsBeingDispatched;
    232 }
    233 #endif
    234 
    235228void ContentChangeObserver::adjustObservedState(Event event)
    236229{
     
    240233            setHasNoChangeState();
    241234
    242         if (!hasDeterminateState()) {
    243             LOG(ContentObservation, "notifyContentChangeIfNeeded: not in a determined state yet.");
     235        // Do not notify the client unless we couldn't make the decision synchronously.
     236        if (m_mouseMovedEventIsBeingDispatched) {
     237            LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: in mouseMoved call. No need to notify the client.");
    244238            return;
    245239        }
    246         LOG_WITH_STREAM(ContentObservation, stream << "notifyContentChangeIfNeeded: sending observedContentChange ->" << observedContentChange());
    247         ASSERT(isNotifyContentChangeAllowed());
     240        if (!hasDeterminateState()) {
     241            LOG(ContentObservation, "adjustStateAndNotifyContentChangeIfNeeded: not in a determined state yet.");
     242            return;
     243        }
     244        LOG_WITH_STREAM(ContentObservation, stream << "adjustStateAndNotifyContentChangeIfNeeded: sending observedContentChange ->" << observedContentChange());
    248245        ASSERT(m_document.page());
    249246        ASSERT(m_document.frame());
     
    266263            setHasNoChangeState();
    267264            clearObservedDOMTimers();
    268         }
     265            setShouldObserveDOMTimerScheduling(true);
     266        } else
     267            setShouldObserveDOMTimerScheduling(!hasVisibleChangeState());
    269268        setIsBetweenTouchEndAndMouseMoved(false);
    270         setShouldObserveDOMTimerScheduling(true);
    271269        break;
    272270    case Event::EndedMouseMovedEventDispatching:
  • trunk/Source/WebCore/page/ios/ContentChangeObserver.h

    r242675 r242689  
    140140    bool isBetweenTouchEndAndMouseMoved() const { return m_isBetweenTouchEndAndMouseMoved; }
    141141
    142     bool hasPendingActivity() const { return hasObservedDOMTimer() || m_document.hasPendingStyleRecalc() || isObservationTimeWindowActive(); }
     142    bool hasPendingActivity() const { return hasObservedDOMTimer() || m_isWaitingForStyleRecalc || isObservationTimeWindowActive(); }
    143143    bool isObservationTimeWindowActive() const { return m_contentObservationTimer.isActive(); }
    144 #if !ASSERT_DISABLED
    145     bool isNotifyContentChangeAllowed() const;
    146 #endif
    147144
    148145    void completeDurationBasedContentObservation();
Note: See TracChangeset for help on using the changeset viewer.