Changeset 105916 in webkit


Ignore:
Timestamp:
Jan 25, 2012 12:37:13 PM (12 years ago)
Author:
Martin Robinson
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.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r105893 r105916  
     12012-01-25  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [WK2] Navigation events not triggered by a mouse event claim to be triggered by the left mouse button during policy decisions
     4        https://bugs.webkit.org/show_bug.cgi?id=76344
     5
     6        Reviewed by Sam Weinig.
     7
     8        When creating InjectedBundleNavigationActions, initialize the mouse button to NoButton.
     9        This ensures that when there is no mouse event associated with the action, when the event
     10        hits the client-API layer, the button is still NoButton.
     11
     12        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
     13        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction): Initialize m_mouseButton
     14        to WebMouseEvent::NoButton.
     15
    1162012-01-25  Kenneth Rohde Christiansen  <kenneth@webkit.org>
    217
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp

    r95901 r105916  
    8787
    8888InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame, const NavigationAction& navigationAction, PassRefPtr<FormState> prpFormState)
     89    : m_navigationType(navigationAction.type())
     90    , m_modifiers(modifiersForNavigationAction(navigationAction))
     91    , m_mouseButton(WebMouseEvent::NoButton)
    8992{
    90     m_navigationType    = navigationAction.type();
    91     m_modifiers         = modifiersForNavigationAction(navigationAction);
    92 
    9393    if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
    9494        m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false));
  • trunk/Tools/ChangeLog

    r105915 r105916  
     12012-01-25  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [WK2] Navigation events not triggered by a mouse event claim to be triggered by the left mouse button during policy decisions
     4        https://bugs.webkit.org/show_bug.cgi?id=76344
     5
     6        Reviewed by Sam Weinig.
     7
     8        Add a test verifying that the mouse button during policy decisions for
     9        events not triggered by mouse events is NoButton.
     10
     11        * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
     12        (TestWebKitAPI::decidePolicyForNavigationAction): Added test.
     13        (TestWebKitAPI::decidePolicyForNewWindowAction): Added test.
     14
    1152012-01-25  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp

    r95188 r105916  
    9191    EXPECT_FALSE(state->didStartProvisionalLoadForFrame);
    9292    EXPECT_FALSE(state->didCommitLoadForFrame);
     93    EXPECT_TRUE(mouseButton = kWKEventMouseButtonNoButton);
    9394
    9495    state->didDecidePolicyForNavigationAction = true;
     
    99100static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
    100101{
     102    EXPECT_TRUE(mouseButton = kWKEventMouseButtonNoButton);
    101103    WKFramePolicyListenerUse(listener);
    102104}
Note: See TracChangeset for help on using the changeset viewer.