Bug 104294 - Incorrect position of layers for fixed position elements when page is scaled smaller than viewport
Summary: Incorrect position of layers for fixed position elements when page is scaled ...
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: Xianzhu Wang
URL:
Keywords:
Depends on:
Blocks: 102543 104303
  Show dependency treegraph
 
Reported: 2012-12-06 13:45 PST by Xianzhu Wang
Modified: 2012-12-14 15:11 PST (History)
10 users (show)

See Also:


Attachments
test case (757 bytes, text/html)
2012-12-06 13:45 PST, Xianzhu Wang
no flags Details
Patch (6.34 KB, patch)
2012-12-06 14:11 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff
Add missing expected file (7.23 KB, patch)
2012-12-06 14:55 PST, Xianzhu Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xianzhu Wang 2012-12-06 13:45:40 PST
Created attachment 178072 [details]
test case

This might be for Chromium only. Not tested on other platforms.

scrollOffsetForFixedPosition() calculates incorrect position for fixed elements when the content (originally larger than viewport) is scaled to smaller than the viewport, causing the graphics layers of fixed position elements be placed at wrong positions.

To reproduce, run the attached test case on chromium-linux. The position of the layer for the fixed element is (218, 230). Should be (10, 10).
Comment 1 Xianzhu Wang 2012-12-06 14:11:28 PST
Created attachment 178080 [details]
Patch
Comment 2 WebKit Review Bot 2012-12-06 14:46:52 PST
Comment on attachment 178080 [details]
Patch

Attachment 178080 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15170670
Comment 3 Xianzhu Wang 2012-12-06 14:55:34 PST
Created attachment 178087 [details]
Add missing expected file
Comment 4 Xianzhu Wang 2012-12-07 15:30:59 PST
Comment on attachment 178087 [details]
Add missing expected file

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

Added some explanations for reviewers.

> Source/WebCore/page/scrolling/ScrollingCoordinator.cpp:71
> +    if (maxValue <= 0)

If contentsSize < visibleContentSize, return 0 directly.
All other changed code should be equivalent with the original code.

> Source/WebCore/page/scrolling/ScrollingCoordinator.cpp:-94
> -        (contentsSize.height() - visibleContentRect.height() * frameScaleFactor) / maxOffset.height());

The above code is moved into fixedPositionScrollOffset().
Here maxOffset might be 0, and there were unnecessary floating point operations on infinity values.
Comment 5 Xianzhu Wang 2012-12-10 13:49:29 PST
@bdakin, could you please review this change? Thanks!
Comment 6 James Robinson 2012-12-11 15:00:58 PST
Comment on attachment 178087 [details]
Add missing expected file

R=me
Comment 7 WebKit Review Bot 2012-12-11 15:23:23 PST
Comment on attachment 178087 [details]
Add missing expected file

Clearing flags on attachment: 178087

Committed r137368: <http://trac.webkit.org/changeset/137368>
Comment 8 WebKit Review Bot 2012-12-11 15:23:30 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Beth Dakin 2012-12-14 15:07:16 PST
compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html is failing on the WK2 bots.
Comment 10 Beth Dakin 2012-12-14 15:11:02 PST
(In reply to comment #9)
> compositing/geometry/fixed-position-composited-page-scale-smaller-than-viewport.html is failing on the WK2 bots.

Though it seems fine on my computer. Ugh.