Diff
Modified: trunk/Source/WebCore/ChangeLog (203084 => 203085)
--- trunk/Source/WebCore/ChangeLog 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/ChangeLog 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1,3 +1,49 @@
+2016-07-11 Enrica Casucci <[email protected]>
+
+ Add synthetic click origin to WKNavigationAction.
+ https://bugs.webkit.org/show_bug.cgi?id=159584
+ rdar://problem/25610422
+
+ Reviewed by Tim Horton.
+
+ Adding plumbing code to pass synthetic click type
+ through WebCore.
+
+ * dom/Element.cpp:
+ (WebCore::Element::dispatchMouseEvent):
+ (WebCore::Element::dispatchMouseForceWillBegin):
+ * dom/MouseEvent.cpp:
+ (WebCore::MouseEvent::create):
+ (WebCore::MouseEvent::MouseEvent):
+ (WebCore::MouseEvent::initMouseEvent):
+ (WebCore::MouseEvent::cloneFor):
+ * dom/MouseEvent.h:
+ (WebCore::MouseEvent::createForBindings):
+ (WebCore::MouseEvent::button):
+ (WebCore::MouseEvent::syntheticClickType):
+ (WebCore::MouseEvent::buttonDown):
+ (WebCore::MouseEvent::setRelatedTarget):
+ * dom/SimulatedClick.cpp:
+ * dom/WheelEvent.cpp:
+ (WebCore::WheelEvent::WheelEvent):
+ * page/ContextMenuController.cpp:
+ (WebCore::ContextMenuController::showContextMenuAt):
+ * page/DragController.cpp:
+ (WebCore::createMouseEvent):
+ (WebCore::DragController::DragController):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::dispatchDragEvent):
+ (WebCore::EventHandler::sendContextMenuEventForKey):
+ (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
+ * platform/PlatformMouseEvent.h:
+ (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+ (WebCore::PlatformMouseEvent::clickCount):
+ (WebCore::PlatformMouseEvent::modifierFlags):
+ (WebCore::PlatformMouseEvent::force):
+ (WebCore::PlatformMouseEvent::syntheticClickType):
+ * replay/SerializationMethods.cpp:
+ (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
+
2016-07-11 Anders Carlsson <[email protected]>
Able to open multiple payment sheets in Safari at the same time
Modified: trunk/Source/WebCore/dom/Element.cpp (203084 => 203085)
--- trunk/Source/WebCore/dom/Element.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/dom/Element.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -292,7 +292,7 @@
mouseEvent->bubbles(), mouseEvent->cancelable(), mouseEvent->view(), mouseEvent->detail(),
mouseEvent->screenX(), mouseEvent->screenY(), mouseEvent->clientX(), mouseEvent->clientY(),
mouseEvent->ctrlKey(), mouseEvent->altKey(), mouseEvent->shiftKey(), mouseEvent->metaKey(),
- mouseEvent->button(), relatedTarget);
+ mouseEvent->button(), mouseEvent->syntheticClickType(), relatedTarget);
if (mouseEvent->defaultHandled())
doubleClickEvent->setDefaultHandled();
@@ -2372,7 +2372,7 @@
if (!frame)
return false;
- PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
+ PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap);
Ref<MouseEvent> mouseForceWillBeginEvent = MouseEvent::create(eventNames().webkitmouseforcewillbeginEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
mouseForceWillBeginEvent->setTarget(this);
dispatchEvent(mouseForceWillBeginEvent);
Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (203084 => 203085)
--- trunk/Source/WebCore/dom/MouseEvent.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -50,7 +50,7 @@
event.movementDelta().x(), event.movementDelta().y(),
#endif
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(),
- relatedTarget, event.force());
+ relatedTarget, event.force(), event.syntheticClickType());
}
Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY,
@@ -57,7 +57,7 @@
#if ENABLE(POINTER_LOCK)
int movementX, int movementY,
#endif
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force)
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType)
{
return MouseEvent::create(type, canBubble, cancelable, timestamp, view,
@@ -65,7 +65,7 @@
#if ENABLE(POINTER_LOCK)
movementX, movementY,
#endif
- ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, 0, false);
+ ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, syntheticClickType, 0, false);
}
Ref<MouseEvent> MouseEvent::create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView* view, int detail, int screenX, int screenY, int pageX, int pageY,
@@ -72,7 +72,7 @@
#if ENABLE(POINTER_LOCK)
int movementX, int movementY,
#endif
- bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
+ bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
{
return adoptRef(*new MouseEvent(type, canBubble, cancelable, timestamp, view,
detail, screenX, screenY, pageX, pageY,
@@ -79,12 +79,12 @@
#if ENABLE(POINTER_LOCK)
movementX, movementY,
#endif
- ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, dataTransfer, isSimulated));
+ ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, force, syntheticClickType, dataTransfer, isSimulated));
}
-Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget)
+Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget)
{
- return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget));
+ return adoptRef(*new MouseEvent(eventType, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, syntheticClickType, relatedTarget));
}
MouseEvent::MouseEvent()
@@ -99,7 +99,7 @@
int movementX, int movementY,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force,
+ unsigned short button, PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType,
PassRefPtr<DataTransfer> dataTransfer, bool isSimulated)
: MouseRelatedEvent(eventType, canBubble, cancelable, timestamp, view, detail, IntPoint(screenX, screenY),
IntPoint(pageX, pageY),
@@ -108,6 +108,7 @@
#endif
ctrlKey, altKey, shiftKey, metaKey, isSimulated)
, m_button(button == (unsigned short)-1 ? 0 : button)
+ , m_syntheticClickType(button == (unsigned short)-1 ? 0 : syntheticClickType)
, m_buttonDown(button != (unsigned short)-1)
, m_relatedTarget(relatedTarget)
, m_force(force)
@@ -115,7 +116,7 @@
{
}
-MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget)
+MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget)
: MouseRelatedEvent(eventType, canBubble, cancelable, WTF::currentTime(), view, detail, IntPoint(screenX, screenY), IntPoint(0, 0),
#if ENABLE(POINTER_LOCK)
IntPoint(0, 0),
@@ -122,6 +123,7 @@
#endif
ctrlKey, altKey, shiftKey, metaKey, false)
, m_button(button == (unsigned short)-1 ? 0 : button)
+ , m_syntheticClickType(button == (unsigned short)-1 ? 0 : syntheticClickType)
, m_buttonDown(button != (unsigned short)-1)
, m_relatedTarget(relatedTarget)
{
@@ -158,6 +160,7 @@
m_shiftKey = shiftKey;
m_metaKey = metaKey;
m_button = button == (unsigned short)-1 ? 0 : button;
+ m_syntheticClickType = 0;
m_buttonDown = button != (unsigned short)-1;
m_relatedTarget = relatedTarget;
@@ -245,6 +248,7 @@
frameView ? adjustedClientY(clientY(), iframe, frameView) : 0,
ctrlKey(), altKey(), shiftKey(), metaKey(),
button(),
+ syntheticClickType(),
// Nullifies relatedTarget.
0);
clonedMouseEvent->setForce(force());
Modified: trunk/Source/WebCore/dom/MouseEvent.h (203084 => 203085)
--- trunk/Source/WebCore/dom/MouseEvent.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/dom/MouseEvent.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -46,7 +46,7 @@
int movementX, int movementY,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
- PassRefPtr<EventTarget> relatedTarget, double force);
+ PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType);
WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*,
int detail, int screenX, int screenY, int pageX, int pageY,
@@ -54,7 +54,7 @@
int movementX, int movementY,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
- PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated = false);
+ PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer>, bool isSimulated = false);
WEBCORE_EXPORT static Ref<MouseEvent> create(const AtomicString& eventType, AbstractView*, const PlatformMouseEvent&, int detail, PassRefPtr<Node> relatedTarget);
@@ -61,7 +61,7 @@
static Ref<MouseEvent> create(const AtomicString& eventType, bool canBubble, bool cancelable, AbstractView*,
int detail, int screenX, int screenY, int clientX, int clientY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget);
+ unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget);
static Ref<MouseEvent> createForBindings()
{
@@ -80,6 +80,7 @@
// WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedown/up, maybe others),
// but we will match the standard DOM.
unsigned short button() const { return m_button; }
+ unsigned short syntheticClickType() const { return m_syntheticClickType; }
bool buttonDown() const { return m_buttonDown; }
EventTarget* relatedTarget() const final { return m_relatedTarget.get(); }
void setRelatedTarget(PassRefPtr<EventTarget> relatedTarget) { m_relatedTarget = relatedTarget; }
@@ -110,12 +111,12 @@
int movementX, int movementY,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button,
- PassRefPtr<EventTarget> relatedTarget, double force, PassRefPtr<DataTransfer>, bool isSimulated);
+ PassRefPtr<EventTarget> relatedTarget, double force, unsigned short syntheticClickType, PassRefPtr<DataTransfer>, bool isSimulated);
MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView*,
int detail, int screenX, int screenY, int clientX, int clientY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
- unsigned short button, PassRefPtr<EventTarget> relatedTarget);
+ unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget);
MouseEvent(const AtomicString& type, const MouseEventInit&);
@@ -123,6 +124,7 @@
private:
unsigned short m_button;
+ unsigned short m_syntheticClickType;
bool m_buttonDown;
RefPtr<EventTarget> m_relatedTarget;
double m_force { 0 };
Modified: trunk/Source/WebCore/dom/SimulatedClick.cpp (203084 => 203085)
--- trunk/Source/WebCore/dom/SimulatedClick.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/dom/SimulatedClick.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -49,7 +49,7 @@
#if ENABLE(POINTER_LOCK)
0, 0,
#endif
- false, false, false, false, 0, 0, 0, 0, true)
+ false, false, false, false, 0, 0, 0, 0, 0, true)
{
if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEvent.get())) {
m_ctrlKey = keyStateEvent->ctrlKey();
Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (203084 => 203085)
--- trunk/Source/WebCore/dom/WheelEvent.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -70,7 +70,7 @@
#if ENABLE(POINTER_LOCK)
, 0, 0
#endif
- , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, false)
+ , event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, 0, false)
, m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
, m_deltaX(-event.deltaX())
, m_deltaY(-event.deltaY())
Modified: trunk/Source/WebCore/page/ContextMenuController.cpp (203084 => 203085)
--- trunk/Source/WebCore/page/ContextMenuController.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/page/ContextMenuController.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1434,7 +1434,7 @@
clearContextMenu();
// Simulate a click in the middle of the accessibility object.
- PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick);
+ PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick, NoTap);
frame->eventHandler().handleMousePressEvent(mouseEvent);
bool handled = frame->eventHandler().sendContextMenuEvent(mouseEvent);
if (handled)
Modified: trunk/Source/WebCore/page/DragController.cpp (203084 => 203085)
--- trunk/Source/WebCore/page/DragController.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/page/DragController.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -105,7 +105,7 @@
return PlatformMouseEvent(dragData.clientPosition(), dragData.globalPosition(),
LeftButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey,
- metaKey, currentTime(), ForceAtClick);
+ metaKey, currentTime(), ForceAtClick, NoTap);
}
DragController::DragController(Page& page, DragClient& client)
Modified: trunk/Source/WebCore/page/EventHandler.cpp (203084 => 203085)
--- trunk/Source/WebCore/page/EventHandler.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/page/EventHandler.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -2131,7 +2131,7 @@
event.movementDelta().x(), event.movementDelta().y(),
#endif
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
- 0, 0, event.force(), dataTransfer);
+ 0, 0, event.force(), NoTap, dataTransfer);
dragTarget.dispatchEvent(me);
return me->defaultPrevented();
@@ -2855,7 +2855,7 @@
PlatformEvent::Type eventType = PlatformEvent::MousePressed;
#endif
- PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick);
+ PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap);
return !dispatchMouseEvent(eventNames().contextmenuEvent, targetNode, true, 0, platformMouseEvent, false);
}
@@ -2937,7 +2937,7 @@
bool altKey;
bool metaKey;
PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey);
- PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0);
+ PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0, NoTap);
mouseMoved(fakeMouseMoveEvent);
}
#endif // !ENABLE(IOS_TOUCH_EVENTS)
Modified: trunk/Source/WebCore/platform/PlatformMouseEvent.h (203084 => 203085)
--- trunk/Source/WebCore/platform/PlatformMouseEvent.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/platform/PlatformMouseEvent.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -48,6 +48,7 @@
// These button numbers match the ones used in the DOM API, 0 through 2, except for NoButton which isn't specified.
enum MouseButton : int8_t { NoButton = -1, LeftButton, MiddleButton, RightButton };
+ enum SyntheticClickType : int8_t { NoTap, OneFingerTap, TwoFingerTap };
class PlatformMouseEvent : public PlatformEvent {
public:
@@ -66,7 +67,7 @@
}
PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type,
- int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp, double force)
+ int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp, double force, SyntheticClickType syntheticClickType)
: PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
, m_position(position)
, m_globalPosition(globalPosition)
@@ -74,6 +75,7 @@
, m_clickCount(clickCount)
, m_modifierFlags(0)
, m_force(force)
+ , m_syntheticClickType(syntheticClickType)
#if PLATFORM(MAC)
, m_eventNumber(0)
, m_menuTypeForEvent(0)
@@ -93,7 +95,7 @@
int clickCount() const { return m_clickCount; }
unsigned modifierFlags() const { return m_modifierFlags; }
double force() const { return m_force; }
-
+ SyntheticClickType syntheticClickType() const { return m_syntheticClickType; }
#if PLATFORM(GTK)
explicit PlatformMouseEvent(GdkEventButton*);
@@ -129,6 +131,7 @@
int m_clickCount;
unsigned m_modifierFlags;
double m_force { 0 };
+ SyntheticClickType m_syntheticClickType { NoTap };
#if PLATFORM(MAC)
int m_eventNumber;
Modified: trunk/Source/WebCore/replay/SerializationMethods.cpp (203084 => 203085)
--- trunk/Source/WebCore/replay/SerializationMethods.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebCore/replay/SerializationMethods.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -338,7 +338,7 @@
input = std::make_unique<PlatformMouseEvent>(IntPoint(positionX, positionY),
IntPoint(globalPositionX, globalPositionY),
button, type, clickCount,
- shiftKey, ctrlKey, altKey, metaKey, timestamp, force);
+ shiftKey, ctrlKey, altKey, metaKey, timestamp, force, WebCore::NoTap);
return true;
}
Modified: trunk/Source/WebKit/ios/ChangeLog (203084 => 203085)
--- trunk/Source/WebKit/ios/ChangeLog 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/ios/ChangeLog 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1,3 +1,14 @@
+2016-07-11 Enrica Casucci <[email protected]>
+
+ Add synthetic click origin to WKNavigationAction.
+ https://bugs.webkit.org/show_bug.cgi?id=159584
+ rdar://problem/25610422
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebPDFViewPlaceholder.mm:
+ (-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):
+
2016-06-23 Alex Christensen <[email protected]>
Remove unused didCancelAuthenticationChallenge
Modified: trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm (203084 => 203085)
--- trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/ios/WebView/WebPDFViewPlaceholder.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -471,7 +471,7 @@
#if ENABLE(POINTER_LOCK)
0, 0,
#endif
- false, false, false, false, 0, 0, 0, 0, true);
+ false, false, false, false, 0, 0, 0, 0, 0, true);
// Call to the frame loader because this is where our security checks are made.
Frame* frame = core([_dataSource webFrame]);
Modified: trunk/Source/WebKit/mac/ChangeLog (203084 => 203085)
--- trunk/Source/WebKit/mac/ChangeLog 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1,3 +1,16 @@
+2016-07-11 Enrica Casucci <[email protected]>
+
+ Add synthetic click origin to WKNavigationAction.
+ https://bugs.webkit.org/show_bug.cgi?id=159584
+ rdar://problem/25610422
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _dragSourceEndedAt:operation:]):
+ * WebView/WebPDFView.mm:
+ (-[WebPDFView PDFViewWillClickOnLink:withURL:]):
+
2016-07-11 Anders Carlsson <[email protected]>
Able to open multiple payment sheets in Safari at the same time
Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (203084 => 203085)
--- trunk/Source/WebKit/mac/WebView/WebFrame.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -977,7 +977,7 @@
return;
// FIXME: These are fake modifier keys here, but they should be real ones instead.
PlatformMouseEvent event(IntPoint(windowLoc), IntPoint(globalPoint(windowLoc, [view->platformWidget() window])),
- LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick);
+ LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap);
_private->coreFrame->eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
}
#endif
Modified: trunk/Source/WebKit/mac/WebView/WebPDFView.mm (203084 => 203085)
--- trunk/Source/WebKit/mac/WebView/WebPDFView.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/mac/WebView/WebPDFView.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1042,7 +1042,7 @@
[nsEvent modifierFlags] & NSShiftKeyMask,
[nsEvent modifierFlags] & NSCommandKeyMask,
#pragma clang diagnostic pop
- button, 0, WebCore::ForceAtClick, 0, true);
+ button, 0, WebCore::ForceAtClick, 0, 0, true);
}
// Call to the frame loader because this is where our security checks are made.
Modified: trunk/Source/WebKit/win/ChangeLog (203084 => 203085)
--- trunk/Source/WebKit/win/ChangeLog 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/win/ChangeLog 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1,3 +1,14 @@
+2016-07-11 Enrica Casucci <[email protected]>
+
+ Add synthetic click origin to WKNavigationAction.
+ https://bugs.webkit.org/show_bug.cgi?id=159584
+ rdar://problem/25610422
+
+ Reviewed by Tim Horton.
+
+ * WebDropSource.cpp:
+ (generateMouseEvent):
+
2016-07-07 Alex Christensen <[email protected]>
Fix Windows build after r202930.
Modified: trunk/Source/WebKit/win/WebDropSource.cpp (203084 => 203085)
--- trunk/Source/WebKit/win/WebDropSource.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit/win/WebDropSource.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -101,7 +101,7 @@
if (SUCCEEDED(webView->viewWindow(&viewWindow)))
::ScreenToClient(viewWindow, reinterpret_cast<LPPOINT>(&localpt));
return PlatformMouseEvent(IntPoint(localpt.x, localpt.y), IntPoint(pt.x, pt.y),
- isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
+ isDrag ? LeftButton : NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, 0);
}
STDMETHODIMP WebDropSource::QueryContinueDrag(_In_ BOOL fEscapePressed, _In_ DWORD grfKeyState)
Modified: trunk/Source/WebKit2/ChangeLog (203084 => 203085)
--- trunk/Source/WebKit2/ChangeLog 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1,3 +1,89 @@
+2016-07-11 Enrica Casucci <[email protected]>
+
+ Add synthetic click origin to WKNavigationAction.
+ https://bugs.webkit.org/show_bug.cgi?id=159584
+ rdar://problem/25610422
+
+ Reviewed by Tim Horton.
+
+ Adds a private property to WKNavigationAction to retrieve
+ the origin of the synthetic click.
+
+ * Shared/NavigationActionData.cpp:
+ (WebKit::NavigationActionData::encode):
+ (WebKit::NavigationActionData::decode):
+ * Shared/NavigationActionData.h:
+ * Shared/WebEvent.h:
+ (WebKit::WebMouseEvent::button):
+ (WebKit::WebMouseEvent::menuTypeForEvent):
+ (WebKit::WebMouseEvent::force):
+ (WebKit::WebMouseEvent::syntheticClickType):
+ * Shared/WebMouseEvent.cpp:
+ (WebKit::WebMouseEvent::WebMouseEvent):
+ (WebKit::WebMouseEvent::encode):
+ (WebKit::WebMouseEvent::decode):
+ * Shared/mac/WebEventFactory.mm:
+ (WebKit::WebEventFactory::createWebMouseEvent):
+ (WebKit::WebEventFactory::createWebWheelEvent):
+ * UIProcess/API/APINavigationAction.h:
+ * UIProcess/API/Cocoa/WKNavigationAction.mm:
+ (toWKNavigationType):
+ (toWKSyntheticClickType):
+ (-[WKNavigationAction description]):
+ (-[WKNavigationAction sourceFrame]):
+ (-[WKNavigationAction request]):
+ (-[WKNavigationAction _syntheticClickType]):
+ (-[WKNavigationAction modifierFlags]):
+ * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
+ (-[WKContentView _longPressRecognized:]):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::getSelectionContext):
+ (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
+ (WebKit::WebPageProxy::selectWithTwoTouches):
+ * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
+ (WebKit::mouseButtonForMouseEvent):
+ (WebKit::syntheticClickTypeForMouseEvent):
+ (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
+ (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
+ (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
+ (WebKit::InjectedBundleNavigationAction::create):
+ (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
+ * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
+ (WebKit::InjectedBundleNavigationAction::navigationType):
+ (WebKit::InjectedBundleNavigationAction::modifiers):
+ (WebKit::InjectedBundleNavigationAction::mouseButton):
+ (WebKit::InjectedBundleNavigationAction::hitTestResult):
+ (WebKit::InjectedBundleNavigationAction::formElement):
+ (WebKit::InjectedBundleNavigationAction::syntheticClickType):
+ (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
+ (WebKit::InjectedBundleNavigationAction::shouldTryAppLinks):
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::createWindow):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
+ (WebKit::WebPage::contextMenuAtPointInWindow):
+ (WebKit::WebPage::dragEnded):
+ (WebKit::WebPage::simulateMouseDown):
+ (WebKit::WebPage::simulateMouseUp):
+ (WebKit::WebPage::simulateMouseMotion):
+ (WebKit::WebPage::setCompositionForTesting):
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in:
+ * WebProcess/WebPage/ios/WebPageIOS.mm:
+ (WebKit::WebPage::handleSyntheticClick):
+ (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
+ (WebKit::WebPage::completeSyntheticClick):
+ (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
+ (WebKit::WebPage::handleTwoFingerTapAtPoint):
+ (WebKit::WebPage::potentialTapAtPosition):
+ (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
+
2016-07-11 Anders Carlsson <[email protected]>
Able to open multiple payment sheets in Safari at the same time
Modified: trunk/Source/WebKit2/Shared/NavigationActionData.cpp (203084 => 203085)
--- trunk/Source/WebKit2/Shared/NavigationActionData.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/Shared/NavigationActionData.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -39,6 +39,7 @@
encoder.encodeEnum(navigationType);
encoder.encodeEnum(modifiers);
encoder.encodeEnum(mouseButton);
+ encoder.encodeEnum(syntheticClickType);
encoder << isProcessingUserGesture;
encoder << canHandleRequest;
encoder.encodeEnum(shouldOpenExternalURLsPolicy);
@@ -53,6 +54,8 @@
return false;
if (!decoder.decodeEnum(result.mouseButton))
return false;
+ if (!decoder.decodeEnum(result.syntheticClickType))
+ return false;
if (!decoder.decode(result.isProcessingUserGesture))
return false;
if (!decoder.decode(result.canHandleRequest))
Modified: trunk/Source/WebKit2/Shared/NavigationActionData.h (203084 => 203085)
--- trunk/Source/WebKit2/Shared/NavigationActionData.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/Shared/NavigationActionData.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -43,6 +43,7 @@
WebCore::NavigationType navigationType { WebCore::NavigationType::Other };
WebEvent::Modifiers modifiers { };
WebMouseEvent::Button mouseButton { WebMouseEvent::NoButton };
+ WebMouseEvent::SyntheticClickType syntheticClickType { WebMouseEvent::NoTap };
bool isProcessingUserGesture { false };
bool canHandleRequest { false };
WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy { WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow };
Modified: trunk/Source/WebKit2/Shared/WebEvent.h (203084 => 203085)
--- trunk/Source/WebKit2/Shared/WebEvent.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/Shared/WebEvent.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -130,12 +130,14 @@
RightButton
};
+ enum SyntheticClickType { NoTap, OneFingerTap, TwoFingerTap };
+
WebMouseEvent();
#if PLATFORM(MAC)
- WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force, int eventNumber = -1, int menuType = 0);
+ WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force, SyntheticClickType = NoTap, int eventNumber = -1, int menuType = 0);
#else
- WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force = 0);
+ WebMouseEvent(Type, Button, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers, double timestamp, double force = 0, SyntheticClickType = NoTap);
#endif
Button button() const { return static_cast<Button>(m_button); }
@@ -150,6 +152,7 @@
int32_t menuTypeForEvent() const { return m_menuTypeForEvent; }
#endif
double force() const { return m_force; }
+ SyntheticClickType syntheticClickType() const { return static_cast<SyntheticClickType>(m_syntheticClickType); }
void encode(IPC::ArgumentEncoder&) const;
static bool decode(IPC::ArgumentDecoder&, WebMouseEvent&);
@@ -169,6 +172,7 @@
int32_t m_menuTypeForEvent;
#endif
double m_force { 0 };
+ uint32_t m_syntheticClickType { NoTap };
};
// FIXME: Move this class to its own header file.
Modified: trunk/Source/WebKit2/Shared/WebMouseEvent.cpp (203084 => 203085)
--- trunk/Source/WebKit2/Shared/WebMouseEvent.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/Shared/WebMouseEvent.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -48,9 +48,9 @@
}
#if PLATFORM(MAC)
-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, int eventNumber, int menuType)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, SyntheticClickType syntheticClickType, int eventNumber, int menuType)
#else
-WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force)
+WebMouseEvent::WebMouseEvent(Type type, Button button, const IntPoint& position, const IntPoint& globalPosition, float deltaX, float deltaY, float deltaZ, int clickCount, Modifiers modifiers, double timestamp, double force, SyntheticClickType syntheticClickType)
#endif
: WebEvent(type, modifiers, timestamp)
, m_button(button)
@@ -65,6 +65,7 @@
, m_menuTypeForEvent(menuType)
#endif
, m_force(force)
+ , m_syntheticClickType(syntheticClickType)
{
ASSERT(isMouseEventType(type));
}
@@ -85,6 +86,7 @@
encoder << m_menuTypeForEvent;
#endif
encoder << m_force;
+ encoder << m_syntheticClickType;
}
bool WebMouseEvent::decode(IPC::ArgumentDecoder& decoder, WebMouseEvent& result)
@@ -115,6 +117,9 @@
if (!decoder.decode(result.m_force))
return false;
+ if (!decoder.decode(result.m_syntheticClickType))
+ return false;
+
return true;
}
Modified: trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm (203084 => 203085)
--- trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -405,7 +405,7 @@
force = pressure + stage;
#endif
- return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, force, eventNumber, menuTypeForEvent);
+ return WebMouseEvent(type, button, IntPoint(position), IntPoint(globalPosition), deltaX, deltaY, deltaZ, clickCount, modifiers, timestamp, force, WebMouseEvent::SyntheticClickType::NoTap, eventNumber, menuTypeForEvent);
}
WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windowView)
Modified: trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/API/APINavigationAction.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -62,6 +62,7 @@
WebCore::NavigationType navigationType() const { return m_navigationActionData.navigationType; }
WebKit::WebEvent::Modifiers modifiers() const { return m_navigationActionData.modifiers; }
WebKit::WebMouseEvent::Button mouseButton() const { return m_navigationActionData.mouseButton; }
+ WebKit::WebMouseEvent::SyntheticClickType syntheticClickType() const { return m_navigationActionData.syntheticClickType; }
bool isProcessingUserGesture() const { return m_navigationActionData.isProcessingUserGesture; }
bool canHandleRequest() const { return m_navigationActionData.canHandleRequest; }
bool shouldOpenExternalSchemes() const { return m_navigationActionData.shouldOpenExternalURLsPolicy == WebCore::ShouldOpenExternalURLsPolicy::ShouldAllow || m_navigationActionData.shouldOpenExternalURLsPolicy == WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes; }
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -55,6 +55,20 @@
return WKNavigationTypeOther;
}
+static WKSyntheticClickType toWKSyntheticClickType(WebKit::WebMouseEvent::SyntheticClickType syntheticClickType)
+{
+ switch (syntheticClickType) {
+ case WebKit::WebMouseEvent::NoTap:
+ return WKSyntheticClickTypeNoTap;
+ case WebKit::WebMouseEvent::OneFingerTap:
+ return WKSyntheticClickTypeOneFingerTap;
+ case WebKit::WebMouseEvent::TwoFingerTap:
+ return WKSyntheticClickTypeTwoFingerTap;
+ }
+ ASSERT_NOT_REACHED();
+ return WKSyntheticClickTypeNoTap;
+}
+
#if PLATFORM(MAC)
// FIXME: This really belongs in WebEventFactory.
@@ -108,8 +122,8 @@
- (NSString *)description
{
- return [NSString stringWithFormat:@"<%@: %p; navigationType = %ld; request = %@; sourceFrame = %@; targetFrame = %@>", NSStringFromClass(self.class), self,
- (long)self.navigationType, self.request, self.sourceFrame, self.targetFrame];
+ return [NSString stringWithFormat:@"<%@: %p; navigationType = %ld; syntheticClickType = %ld; request = %@; sourceFrame = %@; targetFrame = %@>", NSStringFromClass(self.class), self,
+ (long)self.navigationType, (long)self._syntheticClickType, self.request, self.sourceFrame, self.targetFrame];
}
- (WKFrameInfo *)sourceFrame
@@ -136,6 +150,11 @@
return _navigationAction->request().nsURLRequest(WebCore::DoNotUpdateHTTPBody);
}
+- (WKSyntheticClickType)_syntheticClickType
+{
+ return toWKSyntheticClickType(_navigationAction->syntheticClickType());
+}
+
#if PLATFORM(MAC)
- (NSEventModifierFlags)modifierFlags
{
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -27,6 +27,12 @@
#if WK_API_ENABLED
+typedef NS_ENUM(NSInteger, WKSyntheticClickType) {
+ WKSyntheticClickTypeNoTap,
+ WKSyntheticClickTypeOneFingerTap,
+ WKSyntheticClickTypeTwoFingerTap
+} WK_API_AVAILABLE(macosx(NA), ios(10.0));
+
@interface WKNavigationAction (WKPrivate)
@property (nonatomic, readonly) NSURL *_originalURL;
@@ -37,6 +43,8 @@
@property (nonatomic, readonly) BOOL _shouldOpenExternalURLs WK_API_DEPRECATED("use _shouldOpenExternalSchemes and _shouldOpenAppLinks", macosx(10.11, 10.11), ios(9.0, 9.0));
+@property (nonatomic, readonly) WKSyntheticClickType _syntheticClickType WK_API_AVAILABLE(macosx(NA), ios(10.0));
+
@end
#endif
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -520,7 +520,7 @@
void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
void contentSizeCategoryDidChange(const String& contentSizeCategory);
void getSelectionContext(std::function<void(const String&, const String&, const String&, CallbackBase::Error)>);
- void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);
+ void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
void setForceAlwaysUserScalable(bool);
#endif
#if ENABLE(DATA_DETECTION)
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1369,21 +1369,9 @@
- (void)_twoFingerSingleTapGestureRecognized:(UITapGestureRecognizer *)gestureRecognizer
{
- _page->tapHighlightAtPosition(gestureRecognizer.centroid, ++_latestTapID);
_isTapHighlightIDValid = YES;
- RetainPtr<WKContentView> view = self;
- WKWebView *webView = _webView;
- _page->handleTwoFingerTapAtPoint(roundedIntPoint(gestureRecognizer.centroid), [view, webView](const String& string, CallbackBase::Error error) {
- if (error != CallbackBase::Error::None)
- return;
- if (!string.isEmpty()) {
- id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([webView UIDelegate]);
- if ([uiDelegate respondsToSelector:@selector(_webView:alternateActionForURL:)])
- [uiDelegate _webView:webView alternateActionForURL:[NSURL _web_URLWithWTFString:string]];
- [view _finishInteraction];
- } else
- [view _cancelInteraction];
- });
+ _isExpectingFastSingleTapCommit = YES;
+ _page->handleTwoFingerTapAtPoint(roundedIntPoint(gestureRecognizer.centroid), ++_latestTapID);
}
- (void)_longPressRecognized:(UILongPressGestureRecognizer *)gestureRecognizer
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (203084 => 203085)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -568,15 +568,9 @@
m_process->send(Messages::WebPage::GetSelectionContext(callbackID), m_pageID);
}
-void WebPageProxy::handleTwoFingerTapAtPoint(const WebCore::IntPoint& point, std::function<void(const String&, CallbackBase::Error)> callbackFunction)
+void WebPageProxy::handleTwoFingerTapAtPoint(const WebCore::IntPoint& point, uint64_t requestID)
{
- if (!isValid()) {
- callbackFunction(String(), CallbackBase::Error::Unknown);
- return;
- }
-
- uint64_t callbackID = m_callbacks.put(WTFMove(callbackFunction), m_process->throttler().backgroundActivityToken());
- process().send(Messages::WebPage::HandleTwoFingerTapAtPoint(point, callbackID), m_pageID);
+ process().send(Messages::WebPage::HandleTwoFingerTapAtPoint(point, requestID), m_pageID);
}
void WebPageProxy::selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)> callbackFunction)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -58,6 +58,17 @@
return static_cast<WebMouseEvent::Button>(mouseEvent->button());
}
+static WebMouseEvent::SyntheticClickType syntheticClickTypeForMouseEvent(const MouseEvent* mouseEvent)
+{
+ if (!mouseEvent)
+ return WebMouseEvent::NoTap;
+
+ if (!mouseEvent->buttonDown() || !mouseEvent->isTrusted())
+ return WebMouseEvent::NoTap;
+
+ return static_cast<WebMouseEvent::SyntheticClickType>(mouseEvent->syntheticClickType());
+}
+
WebEvent::Modifiers InjectedBundleNavigationAction::modifiersForNavigationAction(const NavigationAction& navigationAction)
{
uint32_t modifiers = 0;
@@ -81,6 +92,10 @@
return mouseButtonForMouseEvent(mouseEventForNavigationAction(navigationAction));
}
+WebMouseEvent::SyntheticClickType InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction(const NavigationAction& navigationAction)
+{
+ return syntheticClickTypeForMouseEvent(mouseEventForNavigationAction(navigationAction));
+}
Ref<InjectedBundleNavigationAction> InjectedBundleNavigationAction::create(WebFrame* frame, const NavigationAction& action, PassRefPtr<FormState> formState)
{
@@ -98,6 +113,7 @@
if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler().hitTestResultAtPoint(mouseEvent->absoluteLocation()));
m_mouseButton = mouseButtonForMouseEvent(mouseEvent);
+ m_syntheticClickType = syntheticClickTypeForNavigationAction(navigationAction);
}
RefPtr<FormState> formState = prpFormState;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -49,6 +49,7 @@
static WebEvent::Modifiers modifiersForNavigationAction(const WebCore::NavigationAction&);
static WebMouseEvent::Button mouseButtonForNavigationAction(const WebCore::NavigationAction&);
+ static WebMouseEvent::SyntheticClickType syntheticClickTypeForNavigationAction(const WebCore::NavigationAction&);
WebCore::NavigationType navigationType() const { return m_navigationType; }
WebEvent::Modifiers modifiers() const { return m_modifiers; }
@@ -55,6 +56,7 @@
WebMouseEvent::Button mouseButton() const { return m_mouseButton; }
InjectedBundleHitTestResult* hitTestResult() const { return m_hitTestResult.get(); }
InjectedBundleNodeHandle* formElement() const { return m_formElement.get(); }
+ WebMouseEvent::SyntheticClickType syntheticClickType() const { return m_syntheticClickType; }
bool shouldOpenExternalURLs() const { return m_shouldOpenExternalURLs; }
bool shouldTryAppLinks() const { return m_shouldTryAppLinks; }
@@ -66,6 +68,7 @@
WebCore::NavigationType m_navigationType;
WebEvent::Modifiers m_modifiers;
WebMouseEvent::Button m_mouseButton;
+ WebMouseEvent::SyntheticClickType m_syntheticClickType;
RefPtr<InjectedBundleHitTestResult> m_hitTestResult;
RefPtr<InjectedBundleNodeHandle> m_formElement;
AtomicString m_downloadAttribute;
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -220,6 +220,7 @@
navigationActionData.navigationType = navigationAction.type();
navigationActionData.modifiers = InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction);
navigationActionData.mouseButton = InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction);
+ navigationActionData.syntheticClickType = InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction(navigationAction);
navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
navigationActionData.canHandleRequest = m_page->canHandleRequest(request.resourceRequest());
navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -726,6 +726,7 @@
navigationActionData.navigationType = action->navigationType();
navigationActionData.modifiers = action->modifiers();
navigationActionData.mouseButton = action->mouseButton();
+ navigationActionData.syntheticClickType = action->syntheticClickType();
navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
navigationActionData.canHandleRequest = webPage->canHandleRequest(request);
navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
@@ -792,6 +793,7 @@
navigationActionData.navigationType = action->navigationType();
navigationActionData.modifiers = action->modifiers();
navigationActionData.mouseButton = action->mouseButton();
+ navigationActionData.syntheticClickType = action->syntheticClickType();
navigationActionData.isProcessingUserGesture = navigationAction.processingUserGesture();
navigationActionData.canHandleRequest = webPage->canHandleRequest(request);
navigationActionData.shouldOpenExternalURLsPolicy = navigationAction.shouldOpenExternalURLsPolicy();
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-07-11 21:34:36 UTC (rev 203085)
@@ -1241,7 +1241,7 @@
#if ENABLE(POINTER_LOCK)
0, 0,
#endif
- false, false, false, false, 0, nullptr, 0, nullptr);
+ false, false, false, false, 0, nullptr, 0, WebCore::NoTap, nullptr);
mainFrame->loader().urlSelected(mainFrameDocument->completeURL(url), emptyString(), mouseEvent.get(), LockHistory::No, LockBackForwardList::No, ShouldSendReferrer::MaybeSendReferrer, ShouldOpenExternalURLsPolicy::ShouldNotAllow);
}
@@ -2027,7 +2027,7 @@
corePage()->contextMenuController().clearContextMenu();
// Simulate a mouse click to generate the correct menu.
- PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick);
+ PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap);
bool handled = corePage()->userInputBridge().handleContextMenuEvent(mouseEvent, &corePage()->mainFrame());
if (!handled)
return 0;
@@ -3443,7 +3443,7 @@
if (!view)
return;
// FIXME: These are fake modifier keys here, but they should be real ones instead.
- PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0);
+ PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, WebCore::NoTap);
m_page->mainFrame().eventHandler().dragSourceEndedAt(event, (DragOperation)operation);
}
@@ -4396,17 +4396,17 @@
void WebPage::simulateMouseDown(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
{
- mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
+ mouseEvent(WebMouseEvent(WebMouseEvent::MouseDown, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick, WebMouseEvent::NoTap));
}
void WebPage::simulateMouseUp(int button, WebCore::IntPoint position, int clickCount, WKEventModifiers modifiers, double time)
{
- mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick));
+ mouseEvent(WebMouseEvent(WebMouseEvent::MouseUp, static_cast<WebMouseEvent::Button>(button), position, position, 0, 0, 0, clickCount, static_cast<WebMouseEvent::Modifiers>(modifiers), time, WebCore::ForceAtClick, WebMouseEvent::NoTap));
}
void WebPage::simulateMouseMotion(WebCore::IntPoint position, double time)
{
- mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0));
+ mouseEvent(WebMouseEvent(WebMouseEvent::MouseMove, WebMouseEvent::NoButton, position, position, 0, 0, 0, 0, WebMouseEvent::Modifiers(), time, 0, WebMouseEvent::NoTap));
}
void WebPage::setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-07-11 21:34:36 UTC (rev 203085)
@@ -60,6 +60,7 @@
#include <WebCore/Page.h>
#include <WebCore/PageOverlay.h>
#include <WebCore/PageVisibilityState.h>
+#include <WebCore/PlatformMouseEvent.h>
#include <WebCore/ScrollTypes.h>
#include <WebCore/TextChecking.h>
#include <WebCore/TextIndicator.h>
@@ -560,7 +561,7 @@
WebCore::IntRect rectForElementAtInteractionLocation();
void updateSelectionAppearance();
void getSelectionContext(uint64_t callbackID);
- void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t callbackID);
+ void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID);
#if ENABLE(IOS_TOUCH_EVENTS)
void dispatchAsynchronousTouchEvents(const Vector<WebTouchEvent, 1>& queue);
#endif
@@ -977,7 +978,7 @@
void getAssistedNodeInformation(AssistedNodeInformation&);
void platformInitializeAccessibility();
void handleSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
- void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location);
+ void completeSyntheticClick(WebCore::Node* nodeRespondingToClick, const WebCore::FloatPoint& location, WebCore::SyntheticClickType);
void sendTapHighlightForNodeIfNecessary(uint64_t requestID, WebCore::Node*);
void resetTextAutosizing();
WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithAssistedNode);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in 2016-07-11 21:34:36 UTC (rev 203085)
@@ -96,7 +96,7 @@
ExecuteEditCommandWithCallback(String name, uint64_t callbackID)
GetSelectionContext(uint64_t callbackID)
SetAllowsMediaDocumentInlinePlayback(bool allows)
- HandleTwoFingerTapAtPoint(WebCore::IntPoint point, uint64_t callbackID)
+ HandleTwoFingerTapAtPoint(WebCore::IntPoint point, uint64_t requestID)
SetForceAlwaysUserScalable(bool userScalable)
#endif
Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (203084 => 203085)
--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-07-11 21:10:29 UTC (rev 203084)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm 2016-07-11 21:34:36 UTC (rev 203085)
@@ -517,7 +517,7 @@
WKBeginObservingContentChanges(true);
- mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, WebCore::ForceAtClick));
+ mainframe.eventHandler().mouseMoved(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, WebCore::ForceAtClick, WebCore::NoTap));
mainframe.document()->updateStyleIfNeeded();
WKStopObservingContentChanges();
@@ -535,7 +535,7 @@
m_pendingSyntheticClickLocation = location;
return;
case WKContentNoChange:
- completeSyntheticClick(nodeRespondingToClick, location);
+ completeSyntheticClick(nodeRespondingToClick, location, WebCore::OneFingerTap);
return;
}
ASSERT_NOT_REACHED();
@@ -547,13 +547,13 @@
return;
// Only dispatch the click if the document didn't get changed by any timers started by the move event.
if (WKObservedContentChange() == WKContentNoChange)
- completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation);
+ completeSyntheticClick(m_pendingSyntheticClickNode.get(), m_pendingSyntheticClickLocation, WebCore::OneFingerTap);
m_pendingSyntheticClickNode = nullptr;
m_pendingSyntheticClickLocation = FloatPoint();
}
-void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location)
+void WebPage::completeSyntheticClick(Node* nodeRespondingToClick, const WebCore::FloatPoint& location, SyntheticClickType syntheticClickType)
{
IntPoint roundedAdjustedPoint = roundedIntPoint(location);
Frame& mainframe = m_page->mainFrame();
@@ -564,8 +564,8 @@
bool tapWasHandled = false;
m_lastInteractionLocation = roundedAdjustedPoint;
- tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0, WebCore::ForceAtClick));
- tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0, WebCore::ForceAtClick));
+ tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, 0, WebCore::ForceAtClick, syntheticClickType));
+ tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, 0, WebCore::ForceAtClick, syntheticClickType));
RefPtr<Frame> newFocusedFrame = m_page->focusController().focusedFrame();
RefPtr<Element> newFocusedElement = newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr;
@@ -637,15 +637,20 @@
#endif
}
-void WebPage::handleTwoFingerTapAtPoint(const WebCore::IntPoint& point, uint64_t callbackID)
+void WebPage::handleTwoFingerTapAtPoint(const WebCore::IntPoint& point, uint64_t requestID)
{
FloatPoint adjustedPoint;
Node* nodeRespondingToClick = m_page->mainFrame().nodeRespondingToClickEvents(point, adjustedPoint);
- Element* element = (nodeRespondingToClick && is<Element>(*nodeRespondingToClick)) ? downcast<Element>(nodeRespondingToClick) : nullptr;
- String url;
- if (element && element->isLink())
- url = "" *)element->document().completeURL(stripLeadingAndTrailingHTMLSpaces(element->getAttribute(HTMLNames::hrefAttr))) absoluteString];
- send(Messages::WebPageProxy::StringCallback(url, callbackID));
+ if (!nodeRespondingToClick || !nodeRespondingToClick->renderer()) {
+ send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(adjustedPoint)));
+ return;
+ }
+ sendTapHighlightForNodeIfNecessary(requestID, nodeRespondingToClick);
+ if (is<Element>(*nodeRespondingToClick) && DataDetection::shouldCancelDefaultAction(downcast<Element>(*nodeRespondingToClick))) {
+ requestPositionInformation(roundedIntPoint(adjustedPoint));
+ send(Messages::WebPageProxy::DidNotHandleTapAsClick(roundedIntPoint(adjustedPoint)));
+ } else
+ completeSyntheticClick(nodeRespondingToClick, adjustedPoint, WebCore::TwoFingerTap);
}
void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& position)
@@ -722,7 +727,7 @@
IntPoint adjustedPoint = roundedIntPoint(position);
Frame& mainframe = m_page->mainFrame();
- mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, 0));
+ mainframe.eventHandler().mouseMoved(PlatformMouseEvent(adjustedPoint, adjustedPoint, NoButton, PlatformEvent::MouseMoved, 0, false, false, false, false, 0, 0, WebCore::NoTap));
mainframe.document()->updateStyleIfNeeded();
}