RESOLVED FIXED 197211
[iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
https://bugs.webkit.org/show_bug.cgi?id=197211
Summary [iOS] Element::focus and Element::scrollIntoView do not clamp scroll positions
Ryosuke Niwa
Reported 2019-04-23 14:10:11 PDT
Element::focus and Element::scrollIntoView don't clamp scroll positions. This results in scrollTop to report bogus numbers like -1000. <rdar://problem/49784711>
Attachments
Fixes the bug (10.69 KB, patch)
2019-04-23 14:21 PDT, Ryosuke Niwa
no flags
Archive of layout-test-results from ews103 for mac-highsierra (3.15 MB, application/zip)
2019-04-23 15:06 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (3.63 MB, application/zip)
2019-04-23 15:33 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-highsierra (3.07 MB, application/zip)
2019-04-23 16:26 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (4.34 MB, application/zip)
2019-04-23 16:27 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews200 for win-future (12.88 MB, application/zip)
2019-04-23 17:27 PDT, EWS Watchlist
no flags
Fixes the bug (9.85 KB, patch)
2019-04-23 18:56 PDT, Ryosuke Niwa
no flags
Fixes the bug (9.79 KB, patch)
2019-04-23 21:05 PDT, Ryosuke Niwa
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.72 MB, application/zip)
2019-04-24 02:05 PDT, EWS Watchlist
no flags
Fixed the test (13.58 KB, patch)
2019-04-30 20:36 PDT, Ryosuke Niwa
simon.fraser: review+
Ryosuke Niwa
Comment 1 2019-04-23 14:21:47 PDT
Created attachment 368063 [details] Fixes the bug
EWS Watchlist
Comment 2 2019-04-23 15:06:39 PDT
Comment on attachment 368063 [details] Fixes the bug Attachment 368063 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/11975688 New failing tests: fast/scrolling/programmatic-document-rtl-scrollIntoView.html fast/dynamic/anchor-lock.html fast/transforms/selection-bounds-in-transformed-view.html imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html fast/visual-viewport/zoomed-scroll-into-view-fixed.html fast/scrolling/scroll-to-anchor-zoomed-header.html
EWS Watchlist
Comment 3 2019-04-23 15:06:40 PDT
Created attachment 368068 [details] Archive of layout-test-results from ews103 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 4 2019-04-23 15:33:00 PDT
Comment on attachment 368063 [details] Fixes the bug Attachment 368063 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/11975760 New failing tests: fast/scrolling/programmatic-document-rtl-scrollIntoView.html fast/dynamic/anchor-lock.html fast/transforms/selection-bounds-in-transformed-view.html imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html fast/visual-viewport/zoomed-scroll-into-view-fixed.html fast/scrolling/scroll-to-anchor-zoomed-header.html
EWS Watchlist
Comment 5 2019-04-23 15:33:02 PDT
Created attachment 368071 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 6 2019-04-23 16:26:57 PDT
Comment on attachment 368063 [details] Fixes the bug Attachment 368063 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/11975991 New failing tests: fast/scrolling/programmatic-document-rtl-scrollIntoView.html fast/dynamic/anchor-lock.html fast/transforms/selection-bounds-in-transformed-view.html imported/w3c/web-platform-tests/shadow-dom/scroll-to-the-fragment-in-shadow-tree.html fast/visual-viewport/zoomed-scroll-into-view-fixed.html fast/scrolling/scroll-to-anchor-zoomed-header.html
EWS Watchlist
Comment 7 2019-04-23 16:26:58 PDT
Created attachment 368080 [details] Archive of layout-test-results from ews114 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 8 2019-04-23 16:27:03 PDT
Comment on attachment 368063 [details] Fixes the bug Attachment 368063 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/11975885 New failing tests: fast/dom/focus-contenteditable.html fast/dynamic/anchor-lock.html imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint.html fast/scrolling/ios/scroll-into-view-with-top-content-inset.html fast/scrolling/programmatic-document-rtl-scrollIntoView.html
EWS Watchlist
Comment 9 2019-04-23 16:27:05 PDT
Created attachment 368081 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 10 2019-04-23 17:26:58 PDT
Comment on attachment 368063 [details] Fixes the bug Attachment 368063 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/11976734 New failing tests: fast/transforms/selection-bounds-in-transformed-view.html fast/visual-viewport/zoomed-scroll-into-view-fixed.html fast/dynamic/anchor-lock.html fast/scrolling/scroll-to-anchor-zoomed-header.html fast/scrolling/programmatic-document-rtl-scrollIntoView.html
EWS Watchlist
Comment 11 2019-04-23 17:27:09 PDT
Created attachment 368088 [details] Archive of layout-test-results from ews200 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews200 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Ryosuke Niwa
Comment 12 2019-04-23 18:56:14 PDT
Created attachment 368100 [details] Fixes the bug
Simon Fraser (smfr)
Comment 13 2019-04-23 20:12:30 PDT
Comment on attachment 368100 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=368100&action=review > Source/WebCore/rendering/RenderLayer.cpp:2602 > + IntRect snappedRevealRect = snappedIntRect(absoluteRect); > + snappedRevealRect.setLocation(clampedScrollPosition); Remove these lines. > Source/WebCore/rendering/RenderLayer.cpp:2604 > frameView.setScrollPosition(roundedIntPoint(revealRect.location())); Remove this line.
Ryosuke Niwa
Comment 14 2019-04-23 21:05:41 PDT
Created attachment 368108 [details] Fixes the bug
EWS Watchlist
Comment 15 2019-04-24 02:05:38 PDT
Comment on attachment 368108 [details] Fixes the bug Attachment 368108 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/11980380 New failing tests: fast/dom/focus-contenteditable.html imported/w3c/web-platform-tests/css/cssom-view/elementFromPoint.html fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
EWS Watchlist
Comment 16 2019-04-24 02:05:40 PDT
Created attachment 368113 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
Brent Fulgham
Comment 17 2019-04-26 12:41:06 PDT
I can't tell if the test failures related to this patch, but these failing test cases sound like they are the kind of things that would be impacted: fast/dom/focus-contenteditable.html fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
Ryosuke Niwa
Comment 18 2019-04-30 20:36:41 PDT
Created attachment 368647 [details] Fixed the test
Simon Fraser (smfr)
Comment 19 2019-05-01 14:31:04 PDT
Comment on attachment 368647 [details] Fixed the test View in context: https://bugs.webkit.org/attachment.cgi?id=368647&action=review > Source/WebCore/rendering/RenderLayer.cpp:2610 > +// frameView.setScrollPosition(roundedIntPoint(revealRect.location())); Remove this line.
Ryosuke Niwa
Comment 20 2019-05-01 14:38:03 PDT
Note You need to log in before you can comment on or make changes to this bug.