Title: [132399] trunk/Source/WebKit/chromium
Revision
132399
Author
[email protected]
Date
2012-10-24 14:08:01 -0700 (Wed, 24 Oct 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=99202
[Chromium] shift-click fails to spawn new window with target=_blank

Reviewed by Adam Barth

No new tests in WebKit-land--see
https://codereview.chromium.org/11235048/ for tests that I'll submit
once this lands.

* src/ChromeClientImpl.cpp:
Change currentEventShouldCauseBackgroundTab to updatePolicyForEvent; we
were looking up the right policy, then throwing it away if it wasn't
forcing a background tab.
(WebKit::ChromeClientImpl::updatePolicyForEvent):
(WebKit::ChromeClientImpl::getNavigationPolicy):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (132398 => 132399)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-10-24 21:07:02 UTC (rev 132398)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-10-24 21:08:01 UTC (rev 132399)
@@ -1,3 +1,21 @@
+2012-10-24  Eric Uhrhane  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=99202
+        [Chromium] shift-click fails to spawn new window with target=_blank
+
+        Reviewed by Adam Barth
+
+        No new tests in WebKit-land--see
+        https://codereview.chromium.org/11235048/ for tests that I'll submit
+        once this lands.
+
+        * src/ChromeClientImpl.cpp:
+        Change currentEventShouldCauseBackgroundTab to updatePolicyForEvent; we
+        were looking up the right policy, then throwing it away if it wasn't
+        forcing a background tab.
+        (WebKit::ChromeClientImpl::updatePolicyForEvent):
+        (WebKit::ChromeClientImpl::getNavigationPolicy):
+
 2012-10-24  Ben Wagner  <[email protected]>
 
         Create skia_webkit.gyp to improve rebaselining.

Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (132398 => 132399)


--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-10-24 21:07:02 UTC (rev 132398)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp	2012-10-24 21:08:01 UTC (rev 132399)
@@ -265,17 +265,13 @@
     return newView->page();
 }
 
-static inline bool currentEventShouldCauseBackgroundTab(const WebInputEvent* inputEvent)
+static inline void updatePolicyForEvent(const WebInputEvent* inputEvent, WebNavigationPolicy* policy)
 {
-    if (!inputEvent)
-        return false;
+    if (!inputEvent || inputEvent->type != WebInputEvent::MouseUp)
+        return;
 
-    if (inputEvent->type != WebInputEvent::MouseUp)
-        return false;
-
     const WebMouseEvent* mouseEvent = static_cast<const WebMouseEvent*>(inputEvent);
 
-    WebNavigationPolicy policy;
     unsigned short buttonNumber;
     switch (mouseEvent->button) {
     case WebMouseEvent::ButtonLeft:
@@ -288,17 +284,14 @@
         buttonNumber = 2;
         break;
     default:
-        return false;
+        return;
     }
     bool ctrl = mouseEvent->modifiers & WebMouseEvent::ControlKey;
     bool shift = mouseEvent->modifiers & WebMouseEvent::ShiftKey;
     bool alt = mouseEvent->modifiers & WebMouseEvent::AltKey;
     bool meta = mouseEvent->modifiers & WebMouseEvent::MetaKey;
 
-    if (!WebViewImpl::navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, &policy))
-        return false;
-
-    return policy == WebNavigationPolicyNewBackgroundTab;
+    WebViewImpl::navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, policy);
 }
 
 WebNavigationPolicy ChromeClientImpl::getNavigationPolicy()
@@ -315,8 +308,8 @@
     WebNavigationPolicy policy = WebNavigationPolicyNewForegroundTab;
     if (asPopup)
         policy = WebNavigationPolicyNewPopup;
-    if (currentEventShouldCauseBackgroundTab(WebViewImpl::currentInputEvent()))
-        policy = WebNavigationPolicyNewBackgroundTab;
+    updatePolicyForEvent(WebViewImpl::currentInputEvent(), &policy);
+
     return policy;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to