Changeset 214900 in webkit
- Timestamp:
- Apr 4, 2017, 2:32:15 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
dom/Document.cpp (modified) (1 diff)
-
dom/Document.h (modified) (2 diffs)
-
html/HTMLPlugInImageElement.cpp (modified) (2 diffs)
-
loader/FrameLoader.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r214897 r214900 1 2017-04-04 Simon Fraser <simon.fraser@apple.com> 2 3 Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime 4 https://bugs.webkit.org/show_bug.cgi?id=170468 5 6 Reviewed by Zalan Bujtas. 7 8 Change the double to MonotonicTime. No behavior change. 9 10 * dom/Document.cpp: 11 (WebCore::Document::updateLastHandledUserGestureTimestamp): 12 * dom/Document.h: 13 (WebCore::Document::lastHandledUserGestureTimestamp): 14 * html/HTMLPlugInImageElement.cpp: 15 (WebCore::documentHadRecentUserGesture): 16 * loader/FrameLoader.cpp: 17 (WebCore::shouldAskForNavigationConfirmation): 18 1 19 2017-04-04 Youenn Fablet <youenn@apple.com> 2 20 -
trunk/Source/WebCore/dom/Document.cpp
r214721 r214900 6311 6311 void Document::updateLastHandledUserGestureTimestamp() 6312 6312 { 6313 m_lastHandledUserGestureTimestamp = monotonicallyIncreasingTime();6313 m_lastHandledUserGestureTimestamp = MonotonicTime::now(); 6314 6314 ResourceLoadObserver::sharedObserver().logUserInteractionWithReducedTimeResolution(*this); 6315 6315 } -
trunk/Source/WebCore/dom/Document.h
r214721 r214900 1144 1144 void didRemoveWheelEventHandler(Node&, EventHandlerRemoval = EventHandlerRemoval::One); 1145 1145 1146 double lastHandledUserGestureTimestamp() const { return m_lastHandledUserGestureTimestamp; }1146 MonotonicTime lastHandledUserGestureTimestamp() const { return m_lastHandledUserGestureTimestamp; } 1147 1147 void updateLastHandledUserGestureTimestamp(); 1148 1148 … … 1573 1573 std::unique_ptr<EventTargetSet> m_wheelEventTargets; 1574 1574 1575 double m_lastHandledUserGestureTimestamp { 0 };1575 MonotonicTime m_lastHandledUserGestureTimestamp; 1576 1576 1577 1577 void clearScriptedAnimationController(); -
trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp
r211591 r214900 53 53 static const int sizingTinyDimensionThreshold = 40; 54 54 static const float sizingFullPageAreaRatioThreshold = 0.96; 55 static const float autostartSoonAfterUserGestureThreshold = 5.0;55 static const Seconds autostartSoonAfterUserGestureThreshold = 5_s; 56 56 57 57 // This delay should not exceed the snapshot delay in PluginView.cpp … … 500 500 static bool documentHadRecentUserGesture(Document& document) 501 501 { 502 double lastKnownUserGestureTimestamp = document.lastHandledUserGestureTimestamp();502 MonotonicTime lastKnownUserGestureTimestamp = document.lastHandledUserGestureTimestamp(); 503 503 if (document.frame() != &document.page()->mainFrame() && document.page()->mainFrame().document()) 504 504 lastKnownUserGestureTimestamp = std::max(lastKnownUserGestureTimestamp, document.page()->mainFrame().document()->lastHandledUserGestureTimestamp()); 505 505 506 return monotonicallyIncreasingTime() - lastKnownUserGestureTimestamp < autostartSoonAfterUserGestureThreshold;506 return MonotonicTime::now() - lastKnownUserGestureTimestamp < autostartSoonAfterUserGestureThreshold; 507 507 } 508 508 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r214392 r214900 3037 3037 static bool shouldAskForNavigationConfirmation(Document& document, const BeforeUnloadEvent& event) 3038 3038 { 3039 bool userDidInteractWithPage = document.topDocument().lastHandledUserGestureTimestamp() > 0;3039 bool userDidInteractWithPage = static_cast<bool>(document.topDocument().lastHandledUserGestureTimestamp()); 3040 3040 // Web pages can request we ask for confirmation before navigating by: 3041 3041 // - Cancelling the BeforeUnloadEvent (modern way)
Note:
See TracChangeset
for help on using the changeset viewer.