Bug 23170

Summary: [Transforms] Hit test issue with large scale() transform
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser@apple.com>
Component: Layout and RenderingAssignee: Allan Sandfeld Jensen <allan.jensen@digia.com>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen@digia.com, dglazkov@chromium.org, dominik.rottsches@intel.com, eae@chromium.org, eric@webkit.org, hyatt@apple.com, igor.oliveira@webkit.org, leviw@chromium.org, mitz@webkit.org, tonikitoo@webkit.org, webkit.review.bot@gmail.com
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: Mac OS X 10.5   
Bug Depends on: 60318, 93475    
Bug Blocks:    
Attachments:
Description Flags
Testcase
none
Patch
none
Archive of layout-test-results from gce-cr-linux-03
none
Patch
none
Archive of layout-test-results from gce-cr-linux-06
none
Archive of layout-test-results from gce-cr-linux-03
none
Patch
none
Archive of layout-test-results from apple-mac-5
none
Patch none

Description From 2009-01-07 12:12:56 PST
The attached testcase shows a hit testing issue when an element has a large scale() transform. This is probably a rounding issue.
------- Comment #1 From 2009-01-07 12:13:19 PST -------
<rdar://problem/6478048>
------- Comment #2 From 2009-01-07 12:13:43 PST -------
Created an attachment (id=26500) [details]
Testcase
------- Comment #3 From 2009-01-07 12:49:17 PST -------
To fix this we need to use FloatPoints for hit testing in RenderLayer, and down through RenderObject::hitTest() and RenderObject::nodeAtPoint().
------- Comment #4 From 2012-08-02 01:51:12 PST -------
(In reply to comment #3)
> To fix this we need to use FloatPoints for hit testing in RenderLayer, and down through RenderObject::hitTest() and RenderObject::nodeAtPoint().

Since I added support for transforms to rect-based hit-testing we actually have a floatpoint copy of the point, which is used whenever new transforms are applied.
------- Comment #5 From 2012-08-02 05:43:27 PST -------
Actually this bug does and did not depend on subpixel layout at all. This is all caused by bad rounding. Once the bad rounding is scaled up x60, the last 30px in width and height becomes unhittable.
------- Comment #6 From 2012-08-02 05:50:57 PST -------
Created an attachment (id=156054) [details]
Patch
------- Comment #7 From 2012-08-02 08:54:38 PST -------
(From update of attachment 156054 [details])
Attachment 156054 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13430027

New failing tests:
css1/box_properties/margin_right.html
css2.1/t0803-c5502-mrgn-r-01-c-a.html
css2.1/20110323/absolute-non-replaced-width-007.htm
css1/box_properties/float_elements_in_series.html
css2.1/t0804-c5507-padn-r-01-c-a.html
css1/box_properties/clear_float.html
compositing/reflections/deeply-nested-reflections.html
compositing/reflections/nested-reflection.html
compositing/reflections/nested-reflection-anchor-point.html
css2.1/t0804-c5507-padn-r-00-c-ag.html
compositing/reflections/nested-reflection-transformed2.html
compositing/rtl/rtl-fixed.html
css2.1/20110323/absolute-non-replaced-width-009.htm
compositing/reflections/reflection-ordering.html
css2.1/20110323/absolute-non-replaced-width-012.htm
compositing/reflections/nested-reflection-size-change.html
css2.1/20110323/absolute-non-replaced-width-021.htm
compositing/shadows/shadow-drawing.html
compositing/reflections/nested-reflection-mask-change.html
css2.1/20110323/absolute-non-replaced-width-005.htm
compositing/reflections/nested-reflection-transformed.html
compositing/rtl/rtl-absolute.html
css1/box_properties/float_on_text_elements.html
css1/text_properties/text_align.html
css2.1/20110323/absolute-non-replaced-width-002.htm
compositing/reflections/nested-reflection-opacity.html
css2.1/t0803-c5502-mrgn-r-00-c-ag.html
compositing/reflections/nested-reflection-animated.html
------- Comment #8 From 2012-08-02 08:54:46 PST -------
Created an attachment (id=156100) [details]
Archive of layout-test-results from gce-cr-linux-03

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-03  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
------- Comment #9 From 2012-08-02 10:35:24 PST -------
(From update of attachment 156054 [details])
Needs move investigation, and I will probably leave some of the bugs unfixed to minimize the number of affected test-cases.
------- Comment #10 From 2012-08-03 03:24:50 PST -------
Created an attachment (id=156306) [details]
Patch

Corrected mistake in FractionalLayoutUnit::floor, that resulted in many 1px differences.
------- Comment #11 From 2012-08-03 05:44:02 PST -------
(From update of attachment 156306 [details])
Attachment 156306 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13431312

New failing tests:
fast/block/float/overhanging-tall-block.html
transforms/3d/hit-testing/perspective-clipped.html
fast/html/details-writing-mode.html
------- Comment #12 From 2012-08-03 05:44:07 PST -------
Created an attachment (id=156337) [details]
Archive of layout-test-results from gce-cr-linux-06

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-06  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
------- Comment #13 From 2012-08-03 06:49:58 PST -------
(From update of attachment 156306 [details])
Attachment 156306 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13431336

New failing tests:
fast/block/float/overhanging-tall-block.html
transforms/3d/hit-testing/perspective-clipped.html
fast/html/details-writing-mode.html
------- Comment #14 From 2012-08-03 06:50:03 PST -------
Created an attachment (id=156357) [details]
Archive of layout-test-results from gce-cr-linux-03

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-03  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
------- Comment #15 From 2012-08-03 07:08:23 PST -------
Created an attachment (id=156362) [details]
Patch

Skip two bening changes in Chromium, and modified one test that was incorrect under higher accuracy
------- Comment #16 From 2012-08-03 12:20:06 PST -------
(From update of attachment 156362 [details])
Attachment 156362 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13423895

New failing tests:
fast/block/float/overhanging-tall-block.html
------- Comment #17 From 2012-08-03 12:20:10 PST -------
Created an attachment (id=156430) [details]
Archive of layout-test-results from apple-mac-5

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: apple-mac-5  Port: <class 'webkitpy.common.config.ports.MacPort'>  Platform: Mac OS X 10.7.4
------- Comment #18 From 2012-08-06 03:01:02 PST -------
(In reply to comment #16)
> (From update of attachment 156362 [details] [details])
> Attachment 156362 [details] [details] did not pass mac-ews (mac):
> Output: http://queues.webkit.org/results/13423895
> 
> New failing tests:
> fast/block/float/overhanging-tall-block.html

I will update the mac baseline before landing, but will leave the current patch for review. The logic behind it is unchanged.
------- Comment #19 From 2012-08-08 07:13:31 PST -------
I have split the part of the patch out that corrects floored rounding into bug #93475 and uploaded a patch there. 

The patch here will need to be rebased once that lands. The only remaining part of the patch will be the changes in HitTestResult.cpp.
------- Comment #20 From 2012-08-10 02:16:17 PST -------
Created an attachment (id=157684) [details]
Patch
------- Comment #21 From 2012-08-10 11:42:54 PST -------
(From update of attachment 157684 [details])
Clearing flags on attachment: 157684

Committed r125306: <http://trac.webkit.org/changeset/125306>
------- Comment #22 From 2012-08-10 11:43:01 PST -------
All reviewed patches have been landed.  Closing bug.