Title: [141475] branches/chromium/1364/Source/WebKit/chromium
- Revision
- 141475
- Author
- k...@chromium.org
- Date
- 2013-01-31 13:24:57 -0800 (Thu, 31 Jan 2013)
Log Message
Merge 141019
> [Chromium, Mobile] Do not show disambiguation pop up in mobile sites
> https://bugs.webkit.org/show_bug.cgi?id=107607
>
> Patch by Dan Alcantara <dfalcant...@chromium.org> on 2013-01-28
> Reviewed by Adam Barth.
>
> Add a check before showing the disambiguation popup to prevent it from appearing
> on mobile sites. Makes a similar test to the current disambiguation popup test
> that expects the popup to never appear.
>
> * src/WebViewImpl.cpp:
> (WebKit::WebViewImpl::handleGestureEvent):
> (WebKit):
> (WebKit::WebViewImpl::isLikelyMobileSite):
> * src/WebViewImpl.h:
> (WebViewImpl):
> * tests/WebFrameTest.cpp:
> * tests/data/disambiguation_popup_mobile_site.html: Added.
>
> * src/WebViewImpl.cpp:
> (WebKit::WebViewImpl::handleGestureEvent):
> (WebKit):
> (WebKit::WebViewImpl::shouldDisableDesktopWorkarounds):
> * src/WebViewImpl.h:
> (WebViewImpl):
> * tests/WebFrameTest.cpp:
> * tests/data/disambiguation_popup_mobile_site.html: Added.
TBR=commit-qu...@webkit.org
Review URL: https://codereview.chromium.org/12086096
Modified Paths
Added Paths
Diff
Modified: branches/chromium/1364/Source/WebKit/chromium/ChangeLog (141474 => 141475)
--- branches/chromium/1364/Source/WebKit/chromium/ChangeLog 2013-01-31 21:18:16 UTC (rev 141474)
+++ branches/chromium/1364/Source/WebKit/chromium/ChangeLog 2013-01-31 21:24:57 UTC (rev 141475)
@@ -1,5 +1,34 @@
-2013-01-30 John Knottenbelt <jknot...@chromium.org>
+2013-01-28 Dan Alcantara <dfalcant...@chromium.org>
+ [Chromium, Mobile] Do not show disambiguation pop up in mobile sites
+ https://bugs.webkit.org/show_bug.cgi?id=107607
+
+ Reviewed by Adam Barth.
+
+ Add a check before showing the disambiguation popup to prevent it from appearing
+ on mobile sites. Makes a similar test to the current disambiguation popup test
+ that expects the popup to never appear.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+ (WebKit):
+ (WebKit::WebViewImpl::isLikelyMobileSite):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ * tests/WebFrameTest.cpp:
+ * tests/data/disambiguation_popup_mobile_site.html: Added.
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+ (WebKit):
+ (WebKit::WebViewImpl::shouldDisableDesktopWorkarounds):
+ * src/WebViewImpl.h:
+ (WebViewImpl):
+ * tests/WebFrameTest.cpp:
+ * tests/data/disambiguation_popup_mobile_site.html: Added.
+
+2013-01-28 Stephen Chenney <schen...@chromium.org>
+
[Chromium] Fix find in page rects for overflowing content.
https://bugs.webkit.org/show_bug.cgi?id=104924
Modified: branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.cpp (141474 => 141475)
--- branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.cpp 2013-01-31 21:18:16 UTC (rev 141474)
+++ branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.cpp 2013-01-31 21:24:57 UTC (rev 141475)
@@ -728,7 +728,9 @@
hideSelectPopup();
ASSERT(!m_selectPopup);
- if (event.data.tap.width > 0) {
+ // Don't trigger a disambiguation popup on sites designed for mobile devices.
+ // Instead, assume that the page has been designed with big enough buttons and links.
+ if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) {
IntRect boundingBox(event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, event.data.tap.width, event.data.tap.height);
Vector<IntRect> goodTargets;
findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScaleFactor(), goodTargets);
@@ -4300,4 +4302,11 @@
}
#endif
+bool WebViewImpl::shouldDisableDesktopWorkarounds()
+{
+ ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewportArguments();
+ return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.userZoom
+ || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != ViewportArguments::ValueAuto);
+}
+
} // namespace WebKit
Modified: branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.h (141474 => 141475)
--- branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.h 2013-01-31 21:18:16 UTC (rev 141474)
+++ branches/chromium/1364/Source/WebKit/chromium/src/WebViewImpl.h 2013-01-31 21:24:57 UTC (rev 141475)
@@ -596,6 +596,10 @@
virtual bool isPointerLocked();
#endif
+ // Heuristic-based function for determining if we should disable workarounds
+ // for viewing websites that are not optimized for mobile devices.
+ bool shouldDisableDesktopWorkarounds();
+
#if ENABLE(GESTURE_EVENTS)
// Exposed for tests.
LinkHighlight* linkHighlight() { return m_linkHighlight.get(); }
Modified: branches/chromium/1364/Source/WebKit/chromium/tests/WebFrameTest.cpp (141474 => 141475)
--- branches/chromium/1364/Source/WebKit/chromium/tests/WebFrameTest.cpp 2013-01-31 21:18:16 UTC (rev 141474)
+++ branches/chromium/1364/Source/WebKit/chromium/tests/WebFrameTest.cpp 2013-01-31 21:24:57 UTC (rev 141475)
@@ -1697,6 +1697,39 @@
EXPECT_FALSE(client.triggered());
}
+TEST_F(WebFrameTest, DisambiguationPopupMobileSite)
+{
+ registerMockedHttpURLLoad("disambiguation_popup_mobile_site.html");
+
+ DisambiguationPopupTestWebViewClient client;
+
+ // Make sure we initialize to minimum scale, even if the window size
+ // only becomes available after the load begins.
+ WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "disambiguation_popup.html", true, 0, &client));
+ webViewImpl->resize(WebSize(1000, 1000));
+ webViewImpl->layout();
+
+ client.resetTriggered();
+ webViewImpl->handleInputEvent(fatTap(0, 0));
+ EXPECT_FALSE(client.triggered());
+
+ client.resetTriggered();
+ webViewImpl->handleInputEvent(fatTap(200, 115));
+ EXPECT_FALSE(client.triggered());
+
+ for (int i = 0; i <= 46; i++) {
+ client.resetTriggered();
+ webViewImpl->handleInputEvent(fatTap(120, 230 + i * 5));
+ EXPECT_FALSE(client.triggered());
+ }
+
+ for (int i = 0; i <= 46; i++) {
+ client.resetTriggered();
+ webViewImpl->handleInputEvent(fatTap(10 + i * 5, 590));
+ EXPECT_FALSE(client.triggered());
+ }
+}
+
class TestSubstituteDataWebFrameClient : public WebFrameClient {
public:
TestSubstituteDataWebFrameClient()
Copied: branches/chromium/1364/Source/WebKit/chromium/tests/data/disambiguation_popup_mobile_site.html (from rev 141019, trunk/Source/WebKit/chromium/tests/data/disambiguation_popup_mobile_site.html) (0 => 141475)
--- branches/chromium/1364/Source/WebKit/chromium/tests/data/disambiguation_popup_mobile_site.html (rev 0)
+++ branches/chromium/1364/Source/WebKit/chromium/tests/data/disambiguation_popup_mobile_site.html 2013-01-31 21:24:57 UTC (rev 141475)
@@ -0,0 +1,31 @@
+<html>
+<head>
+<title>Disambiguation Popup Test</title>
+<style type="text/css">
+.horizontal-link {
+ display:block;
+ width:200px;
+ height:30px;
+ margin:20px;
+ background-color:#ccccff;
+}
+.vertical-link {
+ display:inline-block;
+ width:30px;
+ height:200px;
+ margin:10px;
+ background-color:#ccccff;
+}
+</style>
+<meta name="viewport" content="width=device-width">
+</head>
+<body style="margin:0px;">
+<a href="" class="horizontal-link" style="margin:100px">Link</a>
+<a href="" class="horizontal-link">Link 1</a>
+<a href="" class="horizontal-link">Link 2</a>
+<a href="" class="horizontal-link">Link 3</a>
+<a href="" class="horizontal-link">Link 4</a>
+<a href="" class="horizontal-link">Link 5</a>
+<a href="" class="vertical-link">Link 1</a><a href="" class="vertical-link">Link 2</a><a href="" class="vertical-link">Link 3</a><a href="" class="vertical-link">Link 4</a><a href="" class="vertical-link">Link 5</a>
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes