Title: [105916] trunk
Revision
105916
Author
[email protected]
Date
2012-01-25 12:37:13 -0800 (Wed, 25 Jan 2012)

Log Message

[WK2] Navigation events not triggered by a mouse event claim to be triggered by the left mouse button during policy decisions
https://bugs.webkit.org/show_bug.cgi?id=76344

Reviewed by Sam Weinig.

Source/WebKit2:

When creating InjectedBundleNavigationActions, initialize the mouse button to NoButton.
This ensures that when there is no mouse event associated with the action, when the event
hits the client-API layer, the button is still NoButton.

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): Initialize m_mouseButton
to WebMouseEvent::NoButton.

Tools:

Add a test verifying that the mouse button during policy decisions for
events not triggered by mouse events is NoButton.

* TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
(TestWebKitAPI::decidePolicyForNavigationAction): Added test.
(TestWebKitAPI::decidePolicyForNewWindowAction): Added test.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (105915 => 105916)


--- trunk/Source/WebKit2/ChangeLog	2012-01-25 20:29:17 UTC (rev 105915)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-25 20:37:13 UTC (rev 105916)
@@ -1,3 +1,18 @@
+2012-01-25  Martin Robinson  <[email protected]>
+
+        [WK2] Navigation events not triggered by a mouse event claim to be triggered by the left mouse button during policy decisions
+        https://bugs.webkit.org/show_bug.cgi?id=76344
+
+        Reviewed by Sam Weinig.
+
+        When creating InjectedBundleNavigationActions, initialize the mouse button to NoButton.
+        This ensures that when there is no mouse event associated with the action, when the event
+        hits the client-API layer, the button is still NoButton.
+
+        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
+        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): Initialize m_mouseButton
+        to WebMouseEvent::NoButton.
+
 2012-01-25  Kenneth Rohde Christiansen  <[email protected]>
 
         [Qt] Implement tap feedback respecting -webkit-tap-highlight-color

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp (105915 => 105916)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp	2012-01-25 20:29:17 UTC (rev 105915)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp	2012-01-25 20:37:13 UTC (rev 105916)
@@ -86,10 +86,10 @@
 }
 
 InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, PassRefPtr<FormState> prpFormState)
+    : m_navigationType(navigationAction.type())
+    , m_modifiers(modifiersForNavigationAction(navigationAction))
+    , m_mouseButton(WebMouseEvent::NoButton)
 {
-    m_navigationType    = navigationAction.type();
-    m_modifiers         = modifiersForNavigationAction(navigationAction);
-
     if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
         m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false));
         m_mouseButton   = mouseButtonForMouseEvent(mouseEvent);

Modified: trunk/Tools/ChangeLog (105915 => 105916)


--- trunk/Tools/ChangeLog	2012-01-25 20:29:17 UTC (rev 105915)
+++ trunk/Tools/ChangeLog	2012-01-25 20:37:13 UTC (rev 105916)
@@ -1,3 +1,17 @@
+2012-01-25  Martin Robinson  <[email protected]>
+
+        [WK2] Navigation events not triggered by a mouse event claim to be triggered by the left mouse button during policy decisions
+        https://bugs.webkit.org/show_bug.cgi?id=76344
+
+        Reviewed by Sam Weinig.
+
+        Add a test verifying that the mouse button during policy decisions for
+        events not triggered by mouse events is NoButton.
+
+        * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+        (TestWebKitAPI::decidePolicyForNavigationAction): Added test.
+        (TestWebKitAPI::decidePolicyForNewWindowAction): Added test.
+
 2012-01-25  Ryosuke Niwa  <[email protected]>
 
         run-perf-tests should timeout sooner

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp (105915 => 105916)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp	2012-01-25 20:29:17 UTC (rev 105915)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp	2012-01-25 20:37:13 UTC (rev 105916)
@@ -90,6 +90,7 @@
     State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
     EXPECT_FALSE(state->didStartProvisionalLoadForFrame);
     EXPECT_FALSE(state->didCommitLoadForFrame);
+    EXPECT_TRUE(mouseButton = kWKEventMouseButtonNoButton);
 
     state->didDecidePolicyForNavigationAction = true;
 
@@ -98,6 +99,7 @@
 
 static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
 {
+    EXPECT_TRUE(mouseButton = kWKEventMouseButtonNoButton);
     WKFramePolicyListenerUse(listener);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to