Bug 24252 - Assert when hit testing a 3d transform that is null
Summary: Assert when hit testing a 3d transform that is null
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Dean Jackson
URL:
Keywords:
: 24277 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-27 15:19 PST by Dean Jackson
Modified: 2009-03-02 11:49 PST (History)
3 users (show)

See Also:


Attachments
fix for crash (3.92 KB, patch)
2009-02-27 16:49 PST, Dean Jackson
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 Dean Jackson 2009-02-27 15:19:50 PST
WebCore::TransformationMatrix::isInvertible() bombs out if you hit test a transform that doesn't exist.
Comment 1 Dean Jackson 2009-02-27 16:49:19 PST
Created attachment 28108 [details]
fix for crash
Comment 2 Simon Fraser (smfr) 2009-02-27 16:54:50 PST
Comment on attachment 28108 [details]
fix for crash

> diff --git a/LayoutTests/transforms/no_transform_hit_testing-expected.txt b/LayoutTests/transforms/no_transform_hit_testing-expected.txt
> new file mode 100644
> index 0000000..57ff5af
> --- /dev/null
> +++ b/LayoutTests/transforms/no_transform_hit_testing-expected.txt
> @@ -0,0 +1,5 @@
> +Testing hittest on a layer with null transform
> +
> +https://bugs.webkit.org/show_bug.cgi?id=24252
> +
> +transformed elementdid not crash

Make that "Did not crash, to test PASSED"

> diff --git a/LayoutTests/transforms/no_transform_hit_testing.html b/LayoutTests/transforms/no_transform_hit_testing.html

> +  <script type="text/javascript" charset="utf-8">
> +     if (window.layoutTestController) {
> +       layoutTestController.dumpAsText();
> +       layoutTestController.waitUntilDone();

I don't think this needs to wait if you run the test from onload. Also, I don't think it
needs to be a text test.

> +     function runTest()
> +     {
> +       if (window.layoutTestController) {
> +         eventSender.mouseMoveTo(100, 50);
> +         eventSender.mouseDown();
> +         eventSender.mouseUp();
> +         eventSender.mouseDown();
> +         eventSender.mouseUp();

Just call document.elementFromPoint(...) so it works in Safari too.

> diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
> index 9c59011..1a22d7a 100644
> --- a/WebCore/ChangeLog
> +++ b/WebCore/ChangeLog
> @@ -1,3 +1,16 @@
> +2009-02-27  Dean Jackson  <dino@apple.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        Fix asserting when hit testing an element that
> +        has no transform.
> +        https://bugs.webkit.org/show_bug.cgi?id=24252

I think this needs to explain the crash. Something like:

"renderer()->hasTransform() returns true for elements with perspective, but no transform,
 so test for transform when hit testing".

r=me wit those changes.
Comment 3 Dean Jackson 2009-02-27 17:08:17 PST
New test used elementFromPoint and will work outside of test system

Committed r41309
	M	WebCore/ChangeLog
	M	WebCore/rendering/RenderLayer.cpp
	M	LayoutTests/ChangeLog
	A	LayoutTests/transforms/no_transform_hit_testing.html

next commit adds the file I forgot :(

Comment 4 Dean Jackson 2009-02-27 17:13:38 PST
Committed r41311
	A	LayoutTests/platform/mac/transforms/no_transform_hit_testing-expected.checksum
	A	LayoutTests/platform/mac/transforms/no_transform_hit_testing-expected.png
	M	LayoutTests/ChangeLog

Comment 5 Simon Fraser (smfr) 2009-03-01 20:03:56 PST
*** Bug 24277 has been marked as a duplicate of this bug. ***