New issue
Advanced search Search tips

Issue 734815 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

PrepareFrameAndViewForPrint won't restore scroll offset if the main frame is remote

Project Member Reported by lukasza@chromium.org, Jun 19 2017

Issue description

The following methods assume that the main frame is local (and will ignore scrolling offset):
- PrepareFrameAndViewForPrint::ResizeForPrinting
- PrepareFrameAndViewForPrint::RestoreSize

The main frame will be remote in the following repro steps:
1. Launch chrome with --site-per-process
2. Navigate to https://csreis.github.io/tests/cross-site-iframe.html
3. Click "Go cross-site (complex page)" button
4. Inspect the subframe
5. Run window.print() in the subframe

 
Summary: PrepareFrameAndViewForPrint won't restore scroll offset if the main frame is remote (was: PrepareFrameAndViewForPrint assumes that the main frame is local)
I am a little bit surprised that when printing a single *subframe*, we resize the whole *page* at the end of PrepareFrameAndViewForPrint::ResizeForPrinting.  If we didn't resize the whole page, then we wouldn't need to worry about restoring the scroll offsets for the page (and wouldn't have to worry about the case when the main frame is remote).
weili: Do you want to take this one since it's OOPIF related?

Comment 5 by weili@chromium.org, Aug 9 2017

Cc: -weili@chromium.org
Owner: weili@chromium.org
Status: Assigned (was: Untriaged)

Comment 6 by weili@chromium.org, Feb 27 2018

Blocking: -455764
When the main frame is remote, resize of WebView doesn't really change the viewport and scroll offset. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/exported/WebViewImpl.cpp?type=cs&l=1761, so this should be fine.

In a deeper look, I suspect with blink's new changes -- anchored scroll during resize, we no longer need to keep track of previous scroll.

Will check more later, unblock main bug for now.  

Sign in to add a comment