RESOLVED DUPLICATE of bug 186956 164512
element.focus() inside tall iframe scrolls parent to incorrect screen position
https://bugs.webkit.org/show_bug.cgi?id=164512
Summary element.focus() inside tall iframe scrolls parent to incorrect screen position
Coridyn
Reported 2016-11-08 06:22:32 PST
Created attachment 294157 [details] iframecontent.html Calling element.focus() on an element inside an iframe taller than the viewport causes the parent to scroll to an incorrect position. Scenario: 1. iframe with content taller than parent viewport (iframe is sized to 100% of its content) 2. iframe has DIV "target" element that sits below viewport page fold 3. Scroll parent page down so "target" element is visible 4. From inside iframe call element.focus() on "target" element 5. The parent page will attempt to scroll the "target" element into view but instead scrolls screen to wrong position so "target" element is no longer visible. With this issue it's not possible to set focus on an HTML element without the target element being scrolled off-screen. Notes: - The issue occurs in iOS 10.1.1 and iOS 10.2 beta 2. - The issue doesn't occur in iOS 9.3.2. - The issue only occurs when focussing on non-input HTML elements e.g. DIV, SPAN, anchor tags. - The issue doesn't occur when setting focus on INPUT elements (parent page scrolls to the correct location).
Attachments
iframecontent.html (3.60 KB, text/html)
2016-11-08 06:22 PST, Coridyn
no flags
reduction (622 bytes, text/html)
2016-11-08 06:23 PST, Coridyn
no flags
Coridyn
Comment 1 2016-11-08 06:23:49 PST
Created attachment 294158 [details] reduction
Radar WebKit Bug Importer
Comment 2 2016-11-08 08:21:44 PST
Yann Armelin
Comment 3 2018-06-04 01:59:34 PDT
Issue also occurs when element.scrollIntoView() is called from an iframe. It's still reproducable on last Webkit version compiled locally.
Simon Fraser (smfr)
Comment 4 2018-11-12 15:28:45 PST
This was fixed by bug 186956. *** This bug has been marked as a duplicate of bug 186956 ***
Note You need to log in before you can comment on or make changes to this bug.