Changeset 228714 in webkit
- Timestamp:
- Feb 19, 2018 3:30:27 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228703 r228714 1 2018-02-19 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ 4 https://bugs.webkit.org/show_bug.cgi?id=182910 5 <rdar://problem/37533950> 6 7 Reviewed by Simon Fraser. 8 9 * fast/dom/elementFromPoint-scaled-scrolled.html: 10 Revert changes to this test made in r219342. 11 12 * fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html: 13 * fast/dom/elementFromPoint-scaled-scrolled-layout-viewport-expected.txt: 14 Add a test that is equivalent to elementFromPoint-scaled-scrolled.html after r219342, 15 which turns on the new setting. This test is disabled on iOS (like it was 16 in r219342) because it needs window.scrollTo. 17 18 * platform/ios-wk2/fast/dom/elementFromPoint-relative-to-viewport-expected.txt: 19 This now passes. 20 21 * platform/ios/TestExpectations: 22 Re-mark-failing a test that was un-marked-failing by r219342. 23 1 24 2018-02-19 Daniel Bates <dabates@apple.com> 2 25 -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-expected.txt
r227974 r228714 1 This test applies page scale and scrolls the page, and checks that elementFromPoint returns the correct element. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 5 6 PASS successfullyParsed is true 7 8 TEST COMPLETE 9 PASS document.elementFromPoint(225, 125) is b1 10 PASS document.elementFromPoint(525, 425) is b2 11 PASS document.elementFromPoint(225, 125) is b1 12 PASS document.elementFromPoint(525, 425) is b2 13 PASS document.elementFromPoint(115, 15) is b1 14 PASS document.elementFromPoint(415, 315) is b2 15 PASS document.elementFromPoint(-85, 15) is null 16 PASS document.elementFromPoint(215, 315) is b2 17 PASS document.elementFromPoint(525, 425) is b2 18 PASS successfullyParsed is true 19 20 TEST COMPLETE 21 1 B1B2B3 2 This test is successful if elementFromPoint returns the correct element. 3 B3 -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-layout-viewport-expected.txt
r228713 r228714 15 15 PASS document.elementFromPoint(-85, 15) is null 16 16 PASS document.elementFromPoint(215, 315) is b2 17 PASS document.elementFromPoint(525, 425) is b218 17 PASS successfullyParsed is true 19 18 -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html
r228713 r228714 31 31 if (window.internals) { 32 32 window.internals.settings.setVisualViewportEnabled(true); 33 window.internals.settings.setClientCoordinatesRelativeToLayoutViewport(true); 33 34 window.internals.setPageScaleFactor(2, 0, 0); 34 35 } … … 53 54 shouldBe("document.elementFromPoint(215, 315)", "b2"); 54 55 55 window.scrollTo(0, 0);56 if (window.internals)57 window.internals.setPageScaleFactor(0.5, 0, 0);58 // b2 is now technically outside the 800x600 scaled viewport rect,59 // but should still be found.60 61 shouldBe("document.elementFromPoint(525, 425)", "b2");62 63 56 finishJSTest(); 64 57 } -
trunk/LayoutTests/fast/dom/elementFromPoint-scaled-scrolled.html
r227974 r228714 2 2 <html> 3 3 <head> 4 <style> 5 body { 6 width: 2000px; 7 height: 2000px; 8 } 9 button { 10 position: absolute; 11 width: 50px; 12 height: 50px; 13 } 14 #b1 { 15 left: 200px; 16 top: 100px; 17 } 18 #b2 { 19 left: 500px; 20 top: 400px; 21 } 22 </style> 23 <script src="../../resources/js-test-pre.js"></script> 4 <script src="../../../../resources/js-test-pre.js"></script> 24 5 </head> 25 6 <body onload="runTest();" style="width:2000px;height:2000px;margin:0px;padding:100px"> 26 <button id="b1"></button> 27 <button id="b2"></button> 7 <button style="width:50px;height:50px;">B1</button><button style="width:50px;height:50px;">B2</button><button style="width:50px;height:50px;">B3</button> 8 <div>This test is successful if elementFromPoint returns the correct element.</div> 9 <div id="result"></div> 28 10 <script> 29 11 function runTest() { 30 description("This test applies page scale and scrolls the page, and checks that elementFromPoint returns the correct element."); 31 if (window.internals) { 32 window.internals.settings.setVisualViewportEnabled(true); 12 if (window.internals) 33 13 window.internals.setPageScaleFactor(2, 0, 0); 34 } 35 window.scrollTo(100, 100); 14 window.scrollTo(100,100); 36 15 37 // The layout viewport hasn't been scrolled. 38 shouldBe("document.elementFromPoint(225, 125)", "b1"); 39 shouldBe("document.elementFromPoint(525, 425)", "b2"); 16 if (window.testRunner) 17 testRunner.dumpAsText(); 40 18 41 window.scrollTo(200, 200); 42 43 // b1 is now offscreen, but still within the layout viewport. 44 shouldBe("document.elementFromPoint(225, 125)", "b1"); 45 shouldBe("document.elementFromPoint(525, 425)", "b2"); 46 47 window.scrollTo(500, 400); 48 shouldBe("document.elementFromPoint(115, 15)", "b1"); 49 shouldBe("document.elementFromPoint(415, 315)", "b2"); 50 51 window.scrollTo(700, 400); 52 shouldBeNull("document.elementFromPoint(-85, 15)"); 53 shouldBe("document.elementFromPoint(215, 315)", "b2"); 54 55 window.scrollTo(0, 0); 56 if (window.internals) 57 window.internals.setPageScaleFactor(0.5, 0, 0); 58 // b2 is now technically outside the 800x600 scaled viewport rect, 59 // but should still be found. 60 61 shouldBe("document.elementFromPoint(525, 425)", "b2"); 62 63 finishJSTest(); 19 document.getElementById("result").innerText = document.elementFromPoint(125, 25).innerText; 64 20 } 65 21 </script> 66 < script src="../../resources/js-test-post.js"></script>22 </script> 67 23 </body> 68 24 </html> -
trunk/LayoutTests/platform/ios-wk2/fast/dom/elementFromPoint-relative-to-viewport-expected.txt
r219668 r228714 21 21 PASS unscrolledBoxInitial is '0' 22 22 PASS scrolledDownBoxInitial is '5' 23 FAIL scrolledRightBoxInitial should be 3. Was 2. 24 FAIL scrolledDownAndRightBoxInitial should be 8. Was 7. 23 PASS scrolledRightBoxInitial is '3' 24 PASS scrolledDownAndRightBoxInitial is '8' 25 25 PASS successfullyParsed is true 26 26 -
trunk/LayoutTests/platform/ios/TestExpectations
r228699 r228714 2858 2858 2859 2859 # Test relies on window.scrollTo 2860 fast/dom/elementFromPoint-scaled-scrolled .html [ Skip ]2860 fast/dom/elementFromPoint-scaled-scrolled-layout-viewport.html [ Skip ] 2861 2861 fast/zooming/client-rect-in-fixed-zoomed.html [ Skip ] 2862 2862 fast/visual-viewport/zoomed-scroll-to-anchor-in-position-fixed.html [ Skip ] … … 2953 2953 webkit.org/b/171760 imported/w3c/i18n/bidi/bidi-plaintext-011.html [ ImageOnlyFailure ] 2954 2954 webkit.org/b/171760 imported/w3c/i18n/bidi/block-plaintext-005.html [ ImageOnlyFailure ] 2955 2956 webkit.org/b/172019 imported/w3c/web-platform-tests/cssom-view/elementFromPoint.html [ Failure ] 2955 2957 2956 2958 webkit.org/b/172547 http/tests/xmlhttprequest/xmlhttprequest-50ms-download-dispatch.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r228712 r228714 1 2018-02-19 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r219342): Touch event coordinates and elementFromPoint coordinates differ 4 https://bugs.webkit.org/show_bug.cgi?id=182910 5 <rdar://problem/37533950> 6 7 Reviewed by Simon Fraser. 8 9 We reverted other changes to the definition of client coordinates 10 in r219829 due to compatibility concerns. However, we failed to revert 11 r219342 on trunk, leaving elementFromPoint() using coordinates relative 12 to the layout viewport. 13 14 Add a currently off-by-default setting to switch on layout-viewport-relative 15 client coordinates and guard the elementFromPoint changes behind it. 16 A future patch should roll r219829 back in also behind this setting, so 17 that everything remains consistent regardless of which coordinate space we choose. 18 19 * dom/TreeScope.cpp: 20 (WebCore::absolutePointIfNotClipped): 21 * page/Settings.yaml: 22 * rendering/RenderLayer.cpp: 23 (WebCore::RenderLayer::hitTest): 24 1 25 2018-02-19 Eric Carlson <eric.carlson@apple.com> 2 26 -
trunk/Source/WebCore/dom/TreeScope.cpp
r225719 r228714 300 300 return std::nullopt; 301 301 302 if (document.frame()->settings().visualViewportEnabled()) { 302 const auto& settings = document.frame()->settings(); 303 if (settings.visualViewportEnabled() && settings.clientCoordinatesRelativeToLayoutViewport()) { 303 304 document.updateLayout(); 304 305 if (!document.view() || !document.hasLivingRenderTree()) -
trunk/Source/WebCore/page/Settings.yaml
r228697 r228714 732 732 resourceLoadStatisticsDebugMode: 733 733 initial: false 734 735 clientCoordinatesRelativeToLayoutViewport: 736 initial: false 737 onChange: setNeedsRecalcStyleInAllFrames -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r227974 r228714 4932 4932 LayoutRect hitTestArea = renderer().view().documentRect(); 4933 4933 if (!request.ignoreClipping()) { 4934 if (renderer().settings().visualViewportEnabled()) { 4934 const auto& settings = renderer().settings(); 4935 if (settings.visualViewportEnabled() && settings.clientCoordinatesRelativeToLayoutViewport()) { 4935 4936 auto& frameView = renderer().view().frameView(); 4936 4937 LayoutRect absoluteLayoutViewportRect = frameView.layoutViewportRect();
Note: See TracChangeset
for help on using the changeset viewer.