Changeset 137214 in webkit
- Timestamp:
- Dec 10, 2012, 3:34:32 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r137213 r137214 1 2012-12-10 Ojan Vafai <ojan@chromium.org> 2 3 Unreviewed, rolling out r134150. 4 http://trac.webkit.org/changeset/134150 5 https://bugs.webkit.org/show_bug.cgi?id=99940 6 7 Caused JS-based tooltips to remain during scroll on Facebook 8 and Gmail. Rollout until I have time to experiment with less 9 aggresive approaches. 10 11 * fast/scrolling/fake-mouse-event-throttling-expected.txt: Removed. 12 * fast/scrolling/fake-mouse-event-throttling.html: Removed. 13 * platform/mac/TestExpectations: 14 1 15 2012-12-10 Yi Shen <max.hong.shen@gmail.com> 2 16 -
trunk/LayoutTests/platform/mac/TestExpectations
r137161 r137214 1215 1215 platform/mac/tiled-drawing/ [ Skip ] 1216 1216 1217 # DRT is not firing fake mouse events. Safari fires them fine. Looks like a bug with Apple's Mac DRT.1218 webkit.org/b/101808 fast/scrolling/fake-mouse-event-throttling.html [ Skip ]1219 1220 1217 webkit.org/b/100846 inspector-protocol/debugger-pause-dedicated-worker.html [ Skip ] 1221 1218 webkit.org/b/100846 inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r137213 r137214 1 2012-12-10 Ojan Vafai <ojan@chromium.org> 2 3 Unreviewed, rolling out r134150. 4 http://trac.webkit.org/changeset/134150 5 https://bugs.webkit.org/show_bug.cgi?id=99940 6 7 Caused JS-based tooltips to remain during scroll on Facebook 8 and Gmail. Rollout until I have time to experiment with less 9 aggresive approaches. 10 11 * page/EventHandler.cpp: 12 (WebCore): 13 (WebCore::MaximumDurationTracker::MaximumDurationTracker): 14 (WebCore::MaximumDurationTracker::~MaximumDurationTracker): 15 (MaximumDurationTracker): 16 (WebCore::EventHandler::EventHandler): 17 (WebCore::EventHandler::clear): 18 (WebCore::EventHandler::mouseMoved): 19 (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon): 20 (WebCore::EventHandler::fakeMouseMoveEventTimerFired): 21 * page/EventHandler.h: 22 (EventHandler): 23 * platform/Timer.h: 24 1 25 2012-12-10 Yi Shen <max.hong.shen@gmail.com> 2 26 -
trunk/Source/WebCore/page/EventHandler.cpp
r136924 r137214 141 141 const double autoscrollInterval = 0.05; 142 142 143 // The amount of time to wait before sending a fake mouse event, triggered during a scroll. 144 const double fakeMouseMoveMinimumInterval = 0.1; 145 // Amount to increase the fake mouse event throttling when the running average exceeds the delay. 146 // Picked fairly arbitrarily. 147 const double fakeMouseMoveIntervalIncrease = 0.05; 148 const double fakeMouseMoveRunningAverageCount = 10; 149 // Decrease the fakeMouseMoveInterval when the current delay is >2x the running average, 150 // but only decrease to 3/4 the current delay to avoid too much thrashing. 151 // Not sure this distinction really matters in practice. 152 const double fakeMouseMoveIntervalReductionLimit = 0.5; 153 const double fakeMouseMoveIntervalReductionFraction = 0.75; 143 // The amount of time to wait before sending a fake mouse event, triggered 144 // during a scroll. The short interval is used if the content responds to the mouse events quickly enough, 145 // otherwise the long interval is used. 146 const double fakeMouseMoveShortInterval = 0.1; 147 const double fakeMouseMoveLongInterval = 0.250; 154 148 155 149 const int maximumCursorSize = 128; … … 176 170 }; 177 171 178 class RunningAverageDurationTracker {172 class MaximumDurationTracker { 179 173 public: 180 RunningAverageDurationTracker(double* average, unsigned numberOfRunsToTrack) 181 : m_average(average) 182 , m_numberOfRunsToTrack(numberOfRunsToTrack) 174 explicit MaximumDurationTracker(double *maxDuration) 175 : m_maxDuration(maxDuration) 183 176 , m_start(monotonicallyIncreasingTime()) 184 177 { 185 178 } 186 179 187 ~ RunningAverageDurationTracker()180 ~MaximumDurationTracker() 188 181 { 189 double duration = monotonicallyIncreasingTime() - m_start; 190 if (!*m_average) { 191 *m_average = duration; 192 return; 193 } 194 *m_average = (*m_average * (m_numberOfRunsToTrack - 1) + (duration)) / m_numberOfRunsToTrack; 182 *m_maxDuration = max(*m_maxDuration, monotonicallyIncreasingTime() - m_start); 195 183 } 196 184 197 185 private: 198 double* m_average; 199 unsigned m_numberOfRunsToTrack; 186 double* m_maxDuration; 200 187 double m_start; 201 188 }; … … 354 341 , m_mouseDownMayStartAutoscroll(false) 355 342 , m_mouseDownWasInSubframe(false) 356 , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFired , fakeMouseMoveMinimumInterval)343 , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFired) 357 344 #if ENABLE(SVG) 358 345 , m_svgPan(false) … … 371 358 , m_touchPressed(false) 372 359 #endif 373 , m_m ouseMovedDurationRunningAverage(0)360 , m_maxMouseMovedDuration(0) 374 361 , m_baseEventType(PlatformEvent::NoType) 375 362 , m_didStartDrag(false) … … 426 413 m_scrollbarHandlingScrollGesture = 0; 427 414 #endif 428 m_m ouseMovedDurationRunningAverage= 0;415 m_maxMouseMovedDuration = 0; 429 416 m_baseEventType = PlatformEvent::NoType; 430 417 m_didStartDrag = false; … … 1792 1779 { 1793 1780 RefPtr<FrameView> protector(m_frame->view()); 1794 RunningAverageDurationTracker durationTracker(&m_mouseMovedDurationRunningAverage, fakeMouseMoveRunningAverageCount);1781 MaximumDurationTracker maxDurationTracker(&m_maxMouseMovedDuration); 1795 1782 1796 1783 … … 3008 2995 return; 3009 2996 3010 // Adjust the mouse move throttling so that it's roughly around our running average of the duration of mousemove events. 3011 // This will cause the content to receive these moves only after the user is done scrolling, reducing pauses during the scroll. 3012 // This will only measure the duration of the mousemove event though (not for example layouts), 3013 // so maintain at least a minimum interval. 3014 if (m_mouseMovedDurationRunningAverage > m_fakeMouseMoveEventTimer.delay()) 3015 m_fakeMouseMoveEventTimer.setDelay(m_mouseMovedDurationRunningAverage + fakeMouseMoveIntervalIncrease); 3016 else if (m_mouseMovedDurationRunningAverage < fakeMouseMoveIntervalReductionLimit * m_fakeMouseMoveEventTimer.delay()) 3017 m_fakeMouseMoveEventTimer.setDelay(max(fakeMouseMoveMinimumInterval, fakeMouseMoveIntervalReductionFraction * m_fakeMouseMoveEventTimer.delay())); 3018 m_fakeMouseMoveEventTimer.restart(); 2997 // If the content has ever taken longer than fakeMouseMoveShortInterval we 2998 // reschedule the timer and use a longer time. This will cause the content 2999 // to receive these moves only after the user is done scrolling, reducing 3000 // pauses during the scroll. 3001 if (m_maxMouseMovedDuration > fakeMouseMoveShortInterval) { 3002 if (m_fakeMouseMoveEventTimer.isActive()) 3003 m_fakeMouseMoveEventTimer.stop(); 3004 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveLongInterval); 3005 } else { 3006 if (!m_fakeMouseMoveEventTimer.isActive()) 3007 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveShortInterval); 3008 } 3019 3009 } 3020 3010 … … 3036 3026 } 3037 3027 3038 void EventHandler::fakeMouseMoveEventTimerFired( DeferrableOneShotTimer<EventHandler>* timer)3028 void EventHandler::fakeMouseMoveEventTimerFired(Timer<EventHandler>* timer) 3039 3029 { 3040 3030 ASSERT_UNUSED(timer, timer == &m_fakeMouseMoveEventTimer); -
trunk/Source/WebCore/page/EventHandler.h
r136642 r137214 288 288 static bool eventInvertsTabsToLinksClientCallResult(KeyboardEvent*); 289 289 290 void fakeMouseMoveEventTimerFired( DeferrableOneShotTimer<EventHandler>*);290 void fakeMouseMoveEventTimerFired(Timer<EventHandler>*); 291 291 void cancelFakeMouseMoveEvent(); 292 292 … … 413 413 bool m_mouseDownWasInSubframe; 414 414 415 DeferrableOneShotTimer<EventHandler> m_fakeMouseMoveEventTimer;415 Timer<EventHandler> m_fakeMouseMoveEventTimer; 416 416 417 417 #if ENABLE(SVG) … … 471 471 #endif 472 472 473 double m_m ouseMovedDurationRunningAverage;473 double m_maxMouseMovedDuration; 474 474 PlatformEvent::Type m_baseEventType; 475 475 bool m_didStartDrag; -
trunk/Source/WebCore/platform/Timer.h
r134150 r137214 141 141 } 142 142 143 void setDelay(double delay)144 {145 m_delay = delay;146 if (isActive()) {147 stop();148 restart();149 }150 }151 152 double delay() const { return m_delay; }153 154 143 using TimerBase::stop; 155 144 using TimerBase::isActive;
Note:
See TracChangeset
for help on using the changeset viewer.