Changeset 242630 in webkit
- Timestamp:
- Mar 7, 2019 8:24:40 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242628 r242630 1 2019-03-07 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com 4 https://bugs.webkit.org/show_bug.cgi?id=195397 5 6 Reviewed by Simon Fraser. 7 8 * fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple-expected.txt: Added. 9 * fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html: Added. 10 1 11 2019-03-07 Zalan Bujtas <zalan@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r242628 r242630 1 2019-03-07 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com 4 https://bugs.webkit.org/show_bug.cgi?id=195397 5 6 Reviewed by Simon Fraser. 7 8 This patch introduces TouchEventScope to track changes triggered by touch start. 9 10 Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html 11 12 * page/ios/ContentChangeObserver.cpp: 13 (WebCore::ContentChangeObserver::touchEventDidStart): 14 (WebCore::ContentChangeObserver::touchEventDidFinish): 15 (WebCore::ContentChangeObserver::mouseMovedDidStart): 16 (WebCore::ContentChangeObserver::mouseMovedDidFinish): 17 (WebCore::ContentChangeObserver::adjustObservedState): 18 (WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope): 19 (WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope): 20 * page/ios/ContentChangeObserver.h: 21 (WebCore::ContentChangeObserver::isObservingContentChanges const): 22 1 23 2019-03-07 Zalan Bujtas <zalan@apple.com> 2 24 -
trunk/Source/WebCore/page/ios/ContentChangeObserver.cpp
r242628 r242630 155 155 } 156 156 157 void ContentChangeObserver::touchEventDidStart(PlatformEvent::Type eventType) 158 { 159 #if ENABLE(TOUCH_EVENTS) 160 if (!m_document.settings().contentChangeObserverEnabled()) 161 return; 162 if (eventType != PlatformEvent::Type::TouchStart) 163 return; 164 LOG(ContentObservation, "touchEventDidStart: touch start event started."); 165 m_touchEventIsBeingDispatched = true; 166 adjustObservedState(Event::StartedTouchStartEventDispatching); 167 #endif 168 } 169 170 void ContentChangeObserver::touchEventDidFinish() 171 { 172 #if ENABLE(TOUCH_EVENTS) 173 if (!m_touchEventIsBeingDispatched) 174 return; 175 ASSERT(m_document.settings().contentChangeObserverEnabled()); 176 LOG(ContentObservation, "touchEventDidFinish: touch start event finished."); 177 m_touchEventIsBeingDispatched = false; 178 adjustObservedState(Event::EndedTouchStartEventDispatching); 179 #endif 180 } 181 157 182 void ContentChangeObserver::mouseMovedDidStart() 158 183 { … … 160 185 m_mouseMovedIsBeingDispatched = true; 161 186 #endif 162 ASSERT(!m_document.hasPendingStyleRecalc());163 clearObservedDOMTimers();164 setShouldObserveDOMTimerScheduling(true);165 187 adjustObservedState(Event::StartedMouseMovedEventDispatching); 166 188 } … … 168 190 void ContentChangeObserver::mouseMovedDidFinish() 169 191 { 170 setShouldObserveDOMTimerScheduling(false);192 adjustObservedState(Event::EndedMouseMovedEventDispatching); 171 193 #if !ASSERT_DISABLED 172 194 m_mouseMovedIsBeingDispatched = false; … … 215 237 216 238 switch (event) { 239 case Event::StartedTouchStartEventDispatching: 240 setHasNoChangeState(); 241 clearObservedDOMTimers(); 242 m_isMouseMovedPrecededByTouch = true; 243 setShouldObserveDOMTimerScheduling(true); 244 break; 217 245 case Event::StartedMouseMovedEventDispatching: 218 setHasNoChangeState(); 246 ASSERT(!m_document.hasPendingStyleRecalc()); 247 if (!m_isMouseMovedPrecededByTouch) { 248 setHasNoChangeState(); 249 clearObservedDOMTimers(); 250 } 251 setShouldObserveDOMTimerScheduling(true); 252 m_isMouseMovedPrecededByTouch = false; 253 break; 254 case Event::EndedTouchStartEventDispatching: 255 case Event::EndedMouseMovedEventDispatching: 256 setShouldObserveDOMTimerScheduling(false); 219 257 break; 220 258 case Event::InstalledDOMTimer: … … 299 337 } 300 338 339 #if ENABLE(TOUCH_EVENTS) 340 ContentChangeObserver::TouchEventScope::TouchEventScope(Document& document, PlatformEvent::Type eventType) 341 : m_contentChangeObserver(document.contentChangeObserver()) 342 { 343 m_contentChangeObserver.touchEventDidStart(eventType); 344 } 345 346 ContentChangeObserver::TouchEventScope::~TouchEventScope() 347 { 348 m_contentChangeObserver.touchEventDidFinish(); 349 } 350 #endif 351 301 352 ContentChangeObserver::MouseMovedScope::MouseMovedScope(Document& document) 302 353 : m_contentChangeObserver(document.contentChangeObserver()) -
trunk/Source/WebCore/page/ios/ContentChangeObserver.h
r242628 r242630 29 29 30 30 #include "Document.h" 31 #include "PlatformEvent.h" 31 32 #include "RenderStyleConstants.h" 32 33 #include "Timer.h" … … 66 67 }; 67 68 69 class TouchEventScope { 70 public: 71 WEBCORE_EXPORT TouchEventScope(Document&, PlatformEvent::Type); 72 WEBCORE_EXPORT ~TouchEventScope(); 73 private: 74 ContentChangeObserver& m_contentChangeObserver; 75 }; 76 68 77 class MouseMovedScope { 69 78 public: … … 92 101 93 102 private: 103 void touchEventDidStart(PlatformEvent::Type); 104 void touchEventDidFinish(); 105 94 106 void mouseMovedDidStart(); 95 107 void mouseMovedDidFinish(); … … 111 123 bool isObservingStyleRecalc() const { return m_isObservingStyleRecalc; } 112 124 113 bool isObservingContentChanges() const { return m_ domTimerIsBeingExecuted || m_styleRecalcIsBeingExecuted || m_contentObservationTimer.isActive(); }125 bool isObservingContentChanges() const { return m_touchEventIsBeingDispatched || m_domTimerIsBeingExecuted || m_styleRecalcIsBeingExecuted || m_contentObservationTimer.isActive(); } 114 126 115 127 void cancelPendingActivities(); … … 131 143 132 144 enum class Event { 145 StartedTouchStartEventDispatching, 146 EndedTouchStartEventDispatching, 133 147 StartedMouseMovedEventDispatching, 148 EndedMouseMovedEventDispatching, 134 149 InstalledDOMTimer, 135 150 RemovedDOMTimer, … … 145 160 Timer m_contentObservationTimer; 146 161 HashSet<const DOMTimer*> m_DOMTimerList; 162 bool m_touchEventIsBeingDispatched { false }; 147 163 bool m_isObservingStyleRecalc { false }; 148 164 bool m_styleRecalcIsBeingExecuted { false }; 149 165 bool m_isObservingDOMTimerScheduling { false }; 150 166 bool m_domTimerIsBeingExecuted { false }; 167 bool m_isMouseMovedPrecededByTouch { false }; 151 168 #if !ASSERT_DISABLED 152 169 bool m_mouseMovedIsBeingDispatched { false };
Note: See TracChangeset
for help on using the changeset viewer.