Changeset 141554 in webkit
- Timestamp:
- Feb 1, 2013 12:48:05 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141553 r141554 1 2013-02-01 Dan Alcantara <dfalcantara@chromium.org> 2 3 Touch disambiguation blacklist is not being queried properly 4 https://bugs.webkit.org/show_bug.cgi?id=108222 5 6 Reviewed by Adam Barth. 7 8 TEST=WebFrameTest::DisambiguationPopupBlacklist 9 10 Fix the blacklist so that we check it for the right nodes. 11 Add a chromium test to check that the blacklist is being built and used 12 correctly. Also update the other DisambiguationPopup tests to 13 use the new page scale method. 14 15 * page/TouchDisambiguation.cpp: 16 (WebCore::findGoodTouchTargets): 17 1 18 2013-01-31 Kentaro Hara <haraken@chromium.org> 2 19 -
trunk/Source/WebCore/page/TouchDisambiguation.cpp
r141062 r141554 107 107 HashSet<Node*> blackList; 108 108 for (ListHashSet<RefPtr<Node> >::const_iterator it = hitResults.begin(); it != hitResults.end(); ++it) { 109 // Ignore any Nodes that can't be clicked on. 109 110 RenderObject* renderer = it->get()->renderer(); 110 if (!renderer )111 if (!renderer || !it->get()->willRespondToMouseClickEvents()) 111 112 continue; 113 114 // Blacklist all of the Node's containers. 112 115 for (RenderBlock* container = renderer->containingBlock(); container; container = container->containingBlock()) { 113 116 Node* containerNode = container->node(); … … 123 126 for (ListHashSet<RefPtr<Node> >::const_iterator it = hitResults.begin(); it != hitResults.end(); ++it) { 124 127 for (Node* node = it->get(); node; node = node->parentNode()) { 125 if (blackList.contains( it->get()))128 if (blackList.contains(node)) 126 129 continue; 127 130 if (node->isDocumentNode() || node->hasTagName(HTMLNames::htmlTag) || node->hasTagName(HTMLNames::bodyTag)) -
trunk/Source/WebKit/chromium/ChangeLog
r141550 r141554 1 2013-02-01 Dan Alcantara <dfalcantara@chromium.org> 2 3 Touch disambiguation blacklist is not being queried properly 4 https://bugs.webkit.org/show_bug.cgi?id=108222 5 6 Reviewed by Adam Barth. 7 8 TEST=WebFrameTest::DisambiguationPopupBlacklist 9 10 Fix the blacklist so that we check it for the right nodes. 11 Add a test to check that the blacklist is being built and used 12 correctly. Also update the other DisambiguationPopup tests to 13 use the new page scale method. 14 15 * tests/WebFrameTest.cpp: 16 * tests/data/disambiguation_popup_blacklist.html: Added. 17 1 18 2013-02-01 Eberhard Graether <egraether@google.com> 2 19 -
trunk/Source/WebKit/chromium/tests/WebFrameTest.cpp
r141538 r141554 1825 1825 // only becomes available after the load begins. 1826 1826 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client)); 1827 webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true); 1828 webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true); 1827 1829 webViewImpl->resize(WebSize(1000, 1000)); 1828 1830 webViewImpl->layout(); … … 1869 1871 // only becomes available after the load begins. 1870 1872 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "disambiguation_popup_no_container.html", true, 0, &client)); 1873 webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true); 1874 webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true); 1871 1875 webViewImpl->resize(WebSize(1000, 1000)); 1872 1876 webViewImpl->layout(); … … 1887 1891 // only becomes available after the load begins. 1888 1892 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client)); 1893 webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true); 1894 webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true); 1889 1895 webViewImpl->resize(WebSize(1000, 1000)); 1890 1896 webViewImpl->layout(); … … 1909 1915 EXPECT_FALSE(client.triggered()); 1910 1916 } 1917 } 1918 1919 TEST_F(WebFrameTest, DisambiguationPopupBlacklist) 1920 { 1921 const unsigned viewportWidth = 500; 1922 const unsigned viewportHeight = 1000; 1923 const unsigned divHeight = 100; 1924 const std::string htmlFile = "disambiguation_popup_blacklist.html"; 1925 registerMockedHttpURLLoad(htmlFile); 1926 1927 DisambiguationPopupTestWebViewClient client; 1928 1929 // Make sure we initialize to minimum scale, even if the window size 1930 // only becomes available after the load begins. 1931 WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + htmlFile, true, 0, &client)); 1932 webViewImpl->settings()->setApplyDeviceScaleFactorInCompositor(true); 1933 webViewImpl->settings()->setApplyPageScaleFactorInCompositor(true); 1934 webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); 1935 webViewImpl->layout(); 1936 1937 // Click somewhere where the popup shouldn't appear. 1938 client.resetTriggered(); 1939 webViewImpl->handleInputEvent(fatTap(viewportWidth / 2, 0)); 1940 EXPECT_FALSE(client.triggered()); 1941 1942 // Click directly in between two container divs with click handlers, with children that don't handle clicks. 1943 client.resetTriggered(); 1944 webViewImpl->handleInputEvent(fatTap(viewportWidth / 2, divHeight)); 1945 EXPECT_TRUE(client.triggered()); 1946 1947 // The third div container should be blacklisted if you click on the link it contains. 1948 client.resetTriggered(); 1949 webViewImpl->handleInputEvent(fatTap(viewportWidth / 2, divHeight * 3.25)); 1950 EXPECT_FALSE(client.triggered()); 1911 1951 } 1912 1952
Note: See TracChangeset
for help on using the changeset viewer.