[Webkit-unassigned] [Bug 164512] New: element.focus() inside tall iframe scrolls parent to incorrect screen position

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 8 06:22:32 PST 2016


            Bug ID: 164512
           Summary: element.focus() inside tall iframe scrolls parent to
                    incorrect screen position
    Classification: Unclassified
           Product: WebKit
           Version: Safari 10
          Hardware: iPhone / iPad
                OS: iOS 10
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: coridyn+bugzilla at gmail.com
                CC: cdumez at apple.com

Created attachment 294157
  --> https://bugs.webkit.org/attachment.cgi?id=294157&action=review

Calling element.focus() on an element inside an iframe taller than the viewport causes the parent to scroll to an incorrect position.


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.


 - 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).

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161108/ff7bba2b/attachment.html>

More information about the webkit-unassigned mailing list