Changeset 247152 in webkit
- Timestamp:
- Jul 5, 2019 7:18:46 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247151 r247152 1 2019-07-05 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r244218): desmos.com: Cannot scroll formulas region when region is scrollable 4 https://bugs.webkit.org/show_bug.cgi?id=199508 5 <rdar://problem/50925173> 6 7 Reviewed by Zalan Bujtas. 8 9 The page invokes preventDefault on simulated mouse events which stops scrolling. 10 To fix, add a quirk that turns simulated mouse events non-cancelable. 11 12 * dom/MouseEvent.h: 13 * dom/ios/MouseEventIOS.cpp: 14 (WebCore::MouseEvent::create): 15 * page/Quirks.cpp: 16 (WebCore::Quirks::simulatedMouseEventTypeForTarget const): 17 (WebCore::Quirks::shouldDispatchSimulatedMouseEventsOnTarget const): Deleted. 18 19 To avoid adding more similar functions, and for future flexibility, make this one return the type too. 20 21 * page/Quirks.h: 22 1 23 2019-07-05 Zalan Bujtas <zalan@apple.com> 2 24 -
trunk/Source/WebCore/dom/MouseEvent.h
r246490 r247152 55 55 56 56 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS_FAMILY) 57 static Ref<MouseEvent> create(const PlatformTouchEvent&, unsigned touchIndex, Ref<WindowProxy>&& );57 static Ref<MouseEvent> create(const PlatformTouchEvent&, unsigned touchIndex, Ref<WindowProxy>&&, IsCancelable = IsCancelable::Yes); 58 58 #endif 59 59 -
trunk/Source/WebCore/dom/ios/MouseEventIOS.cpp
r246490 r247152 49 49 } 50 50 51 Ref<MouseEvent> MouseEvent::create(const PlatformTouchEvent& event, unsigned index, Ref<WindowProxy>&& view )51 Ref<MouseEvent> MouseEvent::create(const PlatformTouchEvent& event, unsigned index, Ref<WindowProxy>&& view, IsCancelable cancelable) 52 52 { 53 return adoptRef(*new MouseEvent(mouseEventType(event.touchPhaseAtIndex(index)), CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.touchLocationAtIndex(index), event.touchLocationAtIndex(index), { }, event.modifiers(), 0, 0, nullptr, 0, 0, nullptr, IsSimulated::No, IsTrusted::Yes));53 return adoptRef(*new MouseEvent(mouseEventType(event.touchPhaseAtIndex(index)), CanBubble::Yes, cancelable, IsComposed::Yes, event.timestamp().approximateMonotonicTime(), WTFMove(view), 0, event.touchLocationAtIndex(index), event.touchLocationAtIndex(index), { }, event.modifiers(), 0, 0, nullptr, 0, 0, nullptr, IsSimulated::No, IsTrusted::Yes)); 54 54 } 55 55 -
trunk/Source/WebCore/page/Quirks.cpp
r247145 r247152 300 300 } 301 301 302 bool Quirks::shouldDispatchSimulatedMouseEventsOnTarget(EventTarget* target) const302 Optional<Event::IsCancelable> Quirks::simulatedMouseEventTypeForTarget(EventTarget* target) const 303 303 { 304 304 if (!needsQuirks() || !shouldDispatchSimulatedMouseEvents()) 305 return false;305 return { }; 306 306 307 307 // On Google Maps, we want to limit simulated mouse events to dragging the little man that allows entering into Street View. 308 308 auto& url = m_document->topDocument().url(); 309 309 auto host = url.host(); 310 if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/")) 311 return is<Element>(target) && downcast<Element>(target)->getAttribute("class") == "widget-expand-button-pegman-icon"; 312 return true; 313 } 310 if (equalLettersIgnoringASCIICase(host, "www.google.com") && url.path().startsWithIgnoringASCIICase("/maps/")) { 311 if (is<Element>(target) && downcast<Element>(target)->getAttribute("class") == "widget-expand-button-pegman-icon") 312 return Event::IsCancelable::Yes; 313 return { }; 314 } 315 316 if (equalLettersIgnoringASCIICase(host, "desmos.com") || host.endsWithIgnoringASCIICase(".desmos.com")) 317 return Event::IsCancelable::No; 318 319 return Event::IsCancelable::Yes; 320 } 314 321 #endif 315 322 -
trunk/Source/WebCore/page/Quirks.h
r247145 r247152 26 26 #pragma once 27 27 28 #include "Event.h" 28 29 #include <wtf/WeakPtr.h> 29 30 … … 52 53 #if ENABLE(TOUCH_EVENTS) 53 54 bool shouldDispatchSimulatedMouseEvents() const; 54 bool shouldDispatchSimulatedMouseEventsOnTarget(EventTarget*) const;55 Optional<Event::IsCancelable> simulatedMouseEventTypeForTarget(EventTarget*) const; 55 56 #endif 56 57 bool shouldDisablePointerEventsQuirk() const;
Note: See TracChangeset
for help on using the changeset viewer.