Bug 126664 - Subpixel layout: LayoutUnit::fromFloatFloor needs flooring the CSS pixel value.
Summary: Subpixel layout: LayoutUnit::fromFloatFloor needs flooring the CSS pixel value.
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
Keywords: InRadar
Depends on:
Blocks: 126283
  Show dependency treegraph
Reported: 2014-01-08 14:01 PST by zalan
Modified: 2014-01-14 15:53 PST (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-01-08 14:01:04 PST
HitTestLocation operates on flooredLayoutPoint which calls fromFloatFloor() to floor the LayoutUnit values. This produces different values when subpixel is on and may result in hitting different part of the document .

failed case: (hittesting on a transformed render layer's content) 
Comment 1 Simon Fraser (smfr) 2014-01-08 15:32:05 PST
Comment 2 Simon Fraser (smfr) 2014-01-08 15:46:21 PST
Needs some debugging to see what the issues are.
Comment 3 Radar WebKit Bug Importer 2014-01-14 10:26:00 PST
Comment 4 zalan 2014-01-14 15:52:45 PST
the current behavior is correct as snapping any user generated input (even after a transform) would generate false results.
1. user clicks at position x,y
2. after applying the render transform, it gets the value of 11.6px float.
3. the pixelsnaped value is -> 12(*64)=768, while normal rounding value is -> round(11.6*64)=742.
4. This pixelsnapped value would make the hittest code find the layer painted at 768/64=12px, while the user clicked at 11.6px (after transform)