Bug 148626 - Navigating to a fragment in an iframe scrolls the main page
Summary: Navigating to a fragment in an iframe scrolls the main page
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac OS X 10.11
: P2 Normal
Assignee: Nobody
URL: http://plnkr.co/edit/bKBag3Tfs5QYvwyw...
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2015-08-30 17:45 PDT by Chris Rebert
Modified: 2016-02-07 16:09 PST (History)
0 users

See Also:


Attachments
WebKit Nightly screenshot of the bug. Look at the scrollbar position. (495.61 KB, image/png)
2015-08-30 17:45 PDT, Chris Rebert
no flags Details
Chrome screenshot demonstrating correct behavior (556.15 KB, image/png)
2015-08-30 17:47 PDT, Chris Rebert
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rebert 2015-08-30 17:45:52 PDT
Created attachment 260259 [details]
WebKit Nightly screenshot of the bug. Look at the scrollbar position.

Version: r186963 WebKit Nightly
Corresponding fixed Chrome bug: https://code.google.com/p/chromium/issues/detail?id=462809

Steps to reproduce the problem:
1. Open http://plnkr.co/edit/bKBag3Tfs5QYvwywMk24?p=preview
2. Click the first "Click and window will scroll down" button in the pane on the right half of the window.
3. The contents of the iframe are scrolled to the bottom where the <p id="target"> is.

What is the expected behavior?
The scroll position of the main page should not change. It should stay at its original position at the top of the page.
(Note the position of the scrollbar in the attached Chrome screenshot.)

What went wrong?
The scroll position of the main page moves downward a bit.
Note the position of the scrollbar in the attached WebKit Nightly screenshot.


By comparison, in both OS X Chrome and OS X Firefox, the scroll position of the main page doesn't change.
Comment 1 Chris Rebert 2015-08-30 17:47:33 PDT
Created attachment 260260 [details]
Chrome screenshot demonstrating correct behavior
Comment 2 Chris Rebert 2016-02-07 16:09:54 PST
For further comparison, MS Edge behaves the same as Chrome & Firefox.