Bug 89519 - Elements absolutely positioned to bottom or right may be off by one pixel with sub-pixel layout
Summary: Elements absolutely positioned to bottom or right may be off by one pixel wit...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-19 15:47 PDT by Levi Weintraub
Modified: 2013-01-25 15:42 PST (History)
5 users (show)

See Also:


Attachments
Test case (729 bytes, text/html)
2012-06-19 15:47 PDT, Levi Weintraub
no flags Details
Fixes the problem -- not for review (2.04 KB, patch)
2012-06-20 16:29 PDT, Levi Weintraub
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-02 (803.48 KB, application/zip)
2012-06-20 20:48 PDT, WebKit Review Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Weintraub 2012-06-19 15:47:14 PDT
Created attachment 148444 [details]
Test case

Due to pixel snapping, attempting to align the bottom or right-most edge can lead to the object pixel-snapping past that edge if it has a sub-pixel position.
Comment 1 Eric Seidel (no email) 2012-06-19 16:16:47 PDT
Oooh.  Excellent catch.
Comment 2 Levi Weintraub 2012-06-20 16:29:07 PDT
Created attachment 148675 [details]
Fixes the problem -- not for review

This hack fixes all variations of the test case, but is gross. The Length.h change is needed to address the jittering that can be seen here http://jsfiddle.net/YkB7a/1/

I'll continue to think about this.
Comment 3 WebKit Review Bot 2012-06-20 20:48:48 PDT
Comment on attachment 148675 [details]
Fixes the problem -- not for review

Attachment 148675 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13016071

New failing tests:
media/media-document-audio-repaint.html
svg/custom/svg-fonts-in-html.html
fast/block/positioning/047.html
Comment 4 WebKit Review Bot 2012-06-20 20:48:51 PDT
Created attachment 148723 [details]
Archive of layout-test-results from ec2-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-02  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 5 Emil A Eklund 2012-06-21 02:54:32 PDT
(In reply to comment #2)
> Created an attachment (id=148675) [details]
> Fixes the problem -- not for review
> 
> This hack fixes all variations of the test case, but is gross. The Length.h change is needed to address the jittering that can be seen here http://jsfiddle.net/YkB7a/1/
> 
> I'll continue to think about this.

The changes to RenderLayer.cpp are similar to what I've been trying, while it might not be the right place for it the concept seems reasonable in that we want to ensure that the values are aligned based on the bottom/right edges.
Comment 6 Levi Weintraub 2012-06-21 14:50:16 PDT
(In reply to comment #5)
> The changes to RenderLayer.cpp are similar to what I've been trying, while it might not be the right place for it the concept seems reasonable in that we want to ensure that the values are aligned based on the bottom/right edges.

I was troubled by the change to Length to round the value, but prior to our change to make Lengths floats, this was what occurred anyways. This makes me feel a little more comfortable.

The test case attached is fine for the RenderLayer change (which I'm still not very proud of, but I haven't come up with a better solution), but I have no idea how to write a test to ensure we aren't triggering jittering during an animation... Adding Jamesr who may have advice?
Comment 7 Levi Weintraub 2012-06-22 15:36:09 PDT
Either way, this won't work without the patch on 89238
Comment 8 Levi Weintraub 2012-07-23 11:24:51 PDT
Downstream Chromium bug: http://code.google.com/p/chromium/issues/detail?id=129842
Comment 9 Emil A Eklund 2013-01-25 15:42:52 PST
This appears to have been fixed recently, likely by levi's RenderLayer change. Neither the test case attached to this bug nor the one linked from the downstream buh reproduce the problem in recent builds.