Changeset 141019 in webkit
- Timestamp:
- Jan 28, 2013 3:38:14 PM (11 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r141018 r141019 1 2013-01-28 Dan Alcantara <dfalcantara@chromium.org> 2 3 [Chromium, Mobile] Do not show disambiguation pop up in mobile sites 4 https://bugs.webkit.org/show_bug.cgi?id=107607 5 6 Reviewed by Adam Barth. 7 8 Add a check before showing the disambiguation popup to prevent it from appearing 9 on mobile sites. Makes a similar test to the current disambiguation popup test 10 that expects the popup to never appear. 11 12 * src/WebViewImpl.cpp: 13 (WebKit::WebViewImpl::handleGestureEvent): 14 (WebKit): 15 (WebKit::WebViewImpl::isLikelyMobileSite): 16 * src/WebViewImpl.h: 17 (WebViewImpl): 18 * tests/WebFrameTest.cpp: 19 * tests/data/disambiguation_popup_mobile_site.html: Added. 20 21 * src/WebViewImpl.cpp: 22 (WebKit::WebViewImpl::handleGestureEvent): 23 (WebKit): 24 (WebKit::WebViewImpl::shouldDisableDesktopWorkarounds): 25 * src/WebViewImpl.h: 26 (WebViewImpl): 27 * tests/WebFrameTest.cpp: 28 * tests/data/disambiguation_popup_mobile_site.html: Added. 29 1 30 2013-01-28 Stephen Chenney <schenney@chromium.org> 2 31 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r141015 r141019 754 754 ASSERT(!m_selectPopup); 755 755 756 if (event.data.tap.width > 0) { 756 // Don't trigger a disambiguation popup on sites designed for mobile devices. 757 // Instead, assume that the page has been designed with big enough buttons and links. 758 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) { 757 759 IntRect boundingBox(event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, event.data.tap.width, event.data.tap.height); 758 760 Vector<IntRect> goodTargets; … … 4366 4368 #endif 4367 4369 4370 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4371 { 4372 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewportArguments(); 4373 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.userZoom 4374 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != ViewportArguments::ValueAuto); 4375 } 4376 4368 4377 } // namespace WebKit -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r140808 r141019 602 602 #endif 603 603 604 // Heuristic-based function for determining if we should disable workarounds 605 // for viewing websites that are not optimized for mobile devices. 606 bool shouldDisableDesktopWorkarounds(); 607 604 608 #if ENABLE(GESTURE_EVENTS) 605 609 // Exposed for tests. -
trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp
r141015 r141019 1930 1930 } 1931 1931 1932 TEST_F(WebFrameTest, DisambiguationPopupMobileSite) 1933 { 1934 registerMockedHttpURLLoad("disambiguation_popup_mobile_site.html"); 1935 1936 DisambiguationPopupTestWebViewClient client; 1937 1938 // Make sure we initialize to minimum scale, even if the window size 1939 // only becomes available after the load begins. 1940 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "disambiguation_popup.html", true, 0, &client)); 1941 webViewImpl->resize(WebSize(1000, 1000)); 1942 webViewImpl->layout(); 1943 1944 client.resetTriggered(); 1945 webViewImpl->handleInputEvent(fatTap(0, 0)); 1946 EXPECT_FALSE(client.triggered()); 1947 1948 client.resetTriggered(); 1949 webViewImpl->handleInputEvent(fatTap(200, 115)); 1950 EXPECT_FALSE(client.triggered()); 1951 1952 for (int i = 0; i <= 46; i++) { 1953 client.resetTriggered(); 1954 webViewImpl->handleInputEvent(fatTap(120, 230 + i * 5)); 1955 EXPECT_FALSE(client.triggered()); 1956 } 1957 1958 for (int i = 0; i <= 46; i++) { 1959 client.resetTriggered(); 1960 webViewImpl->handleInputEvent(fatTap(10 + i * 5, 590)); 1961 EXPECT_FALSE(client.triggered()); 1962 } 1963 } 1964 1932 1965 class TestSubstituteDataWebFrameClient : public WebFrameClient { 1933 1966 public:
Note: See TracChangeset
for help on using the changeset viewer.