Bug 109317 - REGRESSION (r132422): Page content and scrollbars are incorrectly offset after restoring a page from the page cache
Summary: REGRESSION (r132422): Page content and scrollbars are incorrectly offset afte...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-02-08 13:08 PST by Tim Horton
Modified: 2013-02-10 12:13 PST (History)
4 users (show)

See Also:


Attachments
preliminary patch (breaks at least one test, needs a test of its own) (1.47 KB, patch)
2013-02-08 13:36 PST, Tim Horton
no flags Details | Formatted Diff | Diff
with a test (11.99 KB, patch)
2013-02-10 01:51 PST, Tim Horton
simon.fraser: review-
Details | Formatted Diff | Diff
patch (6.42 KB, patch)
2013-02-10 11:59 PST, Tim Horton
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-02-08 13:08:36 PST
There are a variety of codepaths that cause scrolling during layout, whether temporary or not. These scrolls are all programmatic, but many go through FrameView/ScrollableArea functions that don't have this knowledge. Since there's no chance a user-originated scroll can happen during layout, we should just mark all scrolls during layout as programmatic.

This fixes numerous bugs on builds that use ScrollingCoordinator, one of which has these steps to reproduce:

1. Load news.ycombinator.com
2. Scroll to the bottom of the page.
3. Click a link.
4. Click the back button.

Expected:

The scrollbar is in the right place relative to the content, and hovering over links hovers over the appropriate link (see the status bar).

Actual:

The scrollbar is at the top, but the content is scrolled. Hovering over links hovers over the wrong links.

<rdar://problem/12649131>
Comment 1 Tim Horton 2013-02-08 13:36:16 PST
Created attachment 187357 [details]
preliminary patch (breaks at least one test, needs a test of its own)
Comment 2 Tim Horton 2013-02-10 01:51:46 PST
Created attachment 187471 [details]
with a test
Comment 3 Tim Horton 2013-02-10 02:00:27 PST
Comment on attachment 187471 [details]
with a test

View in context: https://bugs.webkit.org/attachment.cgi?id=187471&action=review

> LayoutTests/platform/mac-wk2/tiled-drawing/resources/scroll-and-load-page.html:17
> +                    log += internals.layerTreeAsText(window.document, internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);

Should check for internals' existence here.

> LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:14
> +            if (window.internals)

Don't need this line.
Comment 4 Simon Fraser (smfr) 2013-02-10 09:49:20 PST
Comment on attachment 187471 [details]
with a test

View in context: https://bugs.webkit.org/attachment.cgi?id=187471&action=review

> LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:22
> +            window.open("resources/scroll-and-load-page.html");

Do you need to use window.open? Can't you just scroll, load another page that goes back, then finish the test?

> Tools/ChangeLog:9
> +        WebKitTestRunner should propagate window creation options to subwindows (so that children of tiled-drawing windows use tiled drawing, in this case).

This should really be a separate patch.

> Tools/WebKitTestRunner/PlatformWebView.h:98
> +    WKDictionaryRef options() { return m_options.get(); }

const?
Comment 5 Tim Horton 2013-02-10 10:26:14 PST
(In reply to comment #4)
> (From update of attachment 187471 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=187471&action=review
> 
> > LayoutTests/platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:22
> > +            window.open("resources/scroll-and-load-page.html");
> 
> Do you need to use window.open? Can't you just scroll, load another page that goes back, then finish the test?

I'm not sure why that didn't work; it looked like the first page (the one that turns on the page cache) wasn't getting put *into* the page cache. So I followed suit with the other page-cache-testing tests and turned it on, then opened a new window. Maybe Brady knows.

> > Tools/ChangeLog:9
> > +        WebKitTestRunner should propagate window creation options to subwindows (so that children of tiled-drawing windows use tiled drawing, in this case).
> 
> This should really be a separate patch.

Yerp.

> > Tools/WebKitTestRunner/PlatformWebView.h:98
> > +    WKDictionaryRef options() { return m_options.get(); }
> 
> const?

Sure.
Comment 6 Tim Horton 2013-02-10 11:59:13 PST
Created attachment 187490 [details]
patch
Comment 7 Tim Horton 2013-02-10 12:13:23 PST
http://trac.webkit.org/changeset/142416