Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: sky/tests/layout/document-elementFromPoint.sky

Issue 924263002: Get rid of HitTestChildBlockBackground walk. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sky/tests/layout/document-elementFromPoint.sky
diff --git a/sky/tests/layout/document-elementFromPoint.sky b/sky/tests/layout/document-elementFromPoint.sky
index 817991a3c8588c02518b24b2f600c9d52639381e..b08d00a7f3d0d460c0e3bdf38620531822998f39 100644
--- a/sky/tests/layout/document-elementFromPoint.sky
+++ b/sky/tests/layout/document-elementFromPoint.sky
@@ -1,9 +1,14 @@
<sky>
<style>
-foo { width: 100px; height: 100px; background: blue; }
+foo, parent { width: 100px; height: 100px; background: blue; }
bar { width: 100px; height: 100px; background: purple; }
+parent { display: paragraph; }
+child { background: salmon; }
</style>
<foo /><bar />
+<parent>
+ <child>Foo bar</child>
+</parent>
<script>
import "../resources/third_party/unittest/unittest.dart";
import "../resources/unit.dart";
@@ -24,7 +29,24 @@ void main() {
// z-order (missing, zero, positive and negative)
expect(document.elementFromPoint(50, 50).tagName, equals('foo'));
expect(document.elementFromPoint(50, 150).tagName, equals('bar'));
- expect(document.elementFromPoint(50, 250).tagName, equals('sky'));
+ expect(document.elementFromPoint(150, 50).tagName, equals('sky'));
+ });
+
+ void hitTestWithChildren() {
+ expect(document.elementFromPoint(50, 210).tagName, equals('child'));
+ // Right of the <child> inline.
+ expect(document.elementFromPoint(95, 210).tagName, equals('parent'));
+ // Below the <child> inline.
+ expect(document.elementFromPoint(50, 275).tagName, equals('parent'));
+ }
+
+ test("should hit test child and parent", () {
+ hitTestWithChildren();
+ });
+
+ test("should hit test child with layered parent", () {
+ document.querySelector('parent').style.setProperty("transform", "translate3d(0, 0, 0)");
+ hitTestWithChildren();
});
}
</script>

Powered by Google App Engine
This is Rietveld 408576698