WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch, changelog, testcase
24552_patch.txt (text/plain), 6.84 KB, created by
Simon Fraser (smfr)
on 2009-03-12 12:23:49 PDT
(
hide
)
Description:
Patch, changelog, testcase
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2009-03-12 12:23:49 PDT
Size:
6.84 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index dab2a89..c71ab04 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2009-03-12 Simon Fraser <simon.fraser@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ https://bugs.webkit.org/show_bug.cgi?id=24552 >+ >+ Test hit testing when there is a normal-flow, self-painting layer >+ (e.g. a reflection) in the layer tree. >+ >+ * fast/layers/normal-flow-hit-test.html: Added. >+ * platform/mac/fast/layers/normal-flow-hit-test-expected.checksum: Added. >+ * platform/mac/fast/layers/normal-flow-hit-test-expected.png: Added. >+ * platform/mac/fast/layers/normal-flow-hit-test-expected.txt: Added. >+ > 2009-03-11 Oliver Hunt <oliver@apple.com> > > Reviewed by Adele Peterson. >diff --git a/LayoutTests/fast/layers/normal-flow-hit-test.html b/LayoutTests/fast/layers/normal-flow-hit-test.html >new file mode 100644 >index 0000000..a4cf547 >--- /dev/null >+++ b/LayoutTests/fast/layers/normal-flow-hit-test.html >@@ -0,0 +1,44 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >+ "http://www.w3.org/TR/html4/loose.dtd"> >+ >+<html lang="en"> >+<head> >+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> >+ <title>Reflections and hit testing</title> >+ <style type="text/css" media="screen"> >+ .reflected { >+ display: inline-block; >+ height: 100px; >+ width: 100px; >+ margin: 10px; >+ background-color: gray; >+ -webkit-box-reflect: below; >+ } >+ #results { >+ margin-top: 120px; >+ } >+ </style> >+ <script type="text/javascript" charset="utf-8"> >+ function runTest() >+ { >+ var hitNode = document.elementFromPoint(160, 168); >+ var link = document.getElementById('link'); >+ var results = document.getElementById('results'); >+ if (hitNode == link) >+ results.innerHTML = "Found link node, so PASS"; >+ else >+ results.innerHTML = "Did not find link node, so FAIL"; >+ } >+ </script> >+</head> >+<body onload="runTest()"> >+ >+<p>Tests for <a href="https://bugs.webkit.org/show_bug.cgi?id=24552">https://bugs.webkit.org/show_bug.cgi?id=24552</a></p> >+<div class="reflected"></div> >+ >+<a id="link" href="http://www.example.com">Link here</a> >+ >+<div id="results"></div> >+ >+</body> >+</html> >diff --git a/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.checksum b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.checksum >new file mode 100644 >index 0000000..a4ce84a >--- /dev/null >+++ b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.checksum >@@ -0,0 +1 @@ >+2adff7db0f399cd7967f88eed21fabb8 >\ No newline at end of file >diff --git a/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.png b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.png >new file mode 100644 >index 0000000..3481aa8 >Binary files /dev/null and b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.png differ >diff --git a/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.txt b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.txt >new file mode 100644 >index 0000000..0d48e17 >--- /dev/null >+++ b/LayoutTests/platform/mac/fast/layers/normal-flow-hit-test-expected.txt >@@ -0,0 +1,23 @@ >+layer at (0,0) size 800x600 >+ RenderView at (0,0) size 800x600 >+layer at (0,0) size 800x320 >+ RenderBlock {HTML} at (0,0) size 800x320 >+ RenderBody {BODY} at (8,16) size 784x296 >+ RenderBlock {P} at (0,0) size 784x18 >+ RenderText {#text} at (0,0) size 59x18 >+ text run at (0,0) width 59: "Tests for " >+ RenderInline {A} at (0,0) size 305x18 [color=#0000EE] >+ RenderText {#text} at (59,0) size 305x18 >+ text run at (59,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=24552" >+ RenderBlock (anonymous) at (0,34) size 784x124 >+ RenderText {#text} at (120,106) size 4x18 >+ text run at (120,106) width 4: " " >+ RenderInline {A} at (0,0) size 61x18 [color=#0000EE] >+ RenderText {#text} at (124,106) size 61x18 >+ text run at (124,106) width 61: "Link here" >+ RenderText {#text} at (0,0) size 0x0 >+ RenderBlock {DIV} at (0,278) size 784x18 >+ RenderText {#text} at (0,0) size 169x18 >+ text run at (0,0) width 169: "Found link node, so PASS" >+layer at (18,60) size 100x200 >+ RenderBlock {DIV} at (10,10) size 100x100 [bgcolor=#808080] >diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog >index cbe032b..027fb97 100644 >--- a/WebCore/ChangeLog >+++ b/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2009-03-12 Simon Fraser <simon.fraser@apple.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ https://bugs.webkit.org/show_bug.cgi?id=24552 >+ >+ Hit testing involving normal flow, self-painting layers (e.g. reflections) >+ was broken because it was not null-testing the result of hitTestLayer(), >+ so bailing early with a nil hit layer. >+ >+ Test: fast/layers/normal-flow-hit-test.html >+ >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::hitTestLayer): >+ > 2009-03-12 Adam Treat <adam.treat@torchmobile.com> > > Reviewed by George Staikos. >diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp >index aae7800..c56d8f5 100644 >--- a/WebCore/rendering/RenderLayer.cpp >+++ b/WebCore/rendering/RenderLayer.cpp >@@ -2319,14 +2319,16 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont > if (!currLayer->isSelfPaintingLayer()) > continue; > RenderLayer* hitLayer = currLayer->hitTestLayer(rootLayer, this, request, result, hitTestRect, hitTestPoint, false, localTransformState.get(), zOffsetForDescendantsPtr); >- if (depthSortDescendants) { >- // Don't return yet. Keep a ref to the frontmost layer, and keep looking. >- candidateLayer = hitLayer; >- } else { >- // Our container needs to know the z of the hit layer. This is actually computing our z, but that's OK because the hitLayer is coplanar with us. >- if (zOffset && !zOffsetForDescendantsPtr) >- *zOffset = computeZOffset(*unflattenedTransformState); >- return hitLayer; >+ if (hitLayer) { >+ if (depthSortDescendants) { >+ // Don't return yet. Keep a ref to the frontmost layer, and keep looking. >+ candidateLayer = hitLayer; >+ } else { >+ // Our container needs to know the z of the hit layer. This is actually computing our z, but that's OK because the hitLayer is coplanar with us. >+ if (zOffset && !zOffsetForDescendantsPtr) >+ *zOffset = computeZOffset(*unflattenedTransformState); >+ return hitLayer; >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
hyatt
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 24552
:
28535
| 28539