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

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

Issue 1019723002: Fix hit-testing in the stocks apps when scrolled. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | sky/tests/layout/clipping-elementFromPoint-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tests/layout/clipping-elementFromPoint.sky
diff --git a/sky/tests/layout/clipping-elementFromPoint.sky b/sky/tests/layout/clipping-elementFromPoint.sky
new file mode 100644
index 0000000000000000000000000000000000000000..f2bed0b599f97c3e3a0b46ea42e9be3f59f99e42
--- /dev/null
+++ b/sky/tests/layout/clipping-elementFromPoint.sky
@@ -0,0 +1,39 @@
+<style>
+toolbar {
+ background: yellow;
+ width: 50px;
+ height: 50px;
+}
+scrollable {
+ overflow: hidden;
+ height: 400px;
+ background: red;
+}
+content {
+ height: 400px;
+ background-color: pink;
+ transform: translateY(-100px);
+}
+</style>
+<toolbar>toolbar</toolbar>
+<scrollable><content>content</content></scrollable>
+<script>
+import "../resources/third_party/unittest/unittest.dart";
+import "../resources/unit.dart";
+
+import "dart:async";
+import "dart:sky";
+
+void main() {
+ initUnit();
+
+ test("should hit test toolbar", () {
+ expect(document.elementFromPoint(10, 10).textContent, equals("toolbar"));
+ });
+
+ test("should hit test toolbar when transformed, but clipped element overlaps", () {
+ document.querySelector("scrollable").style["transform"] = "translate(0, 0)";
+ expect(document.elementFromPoint(10, 10).textContent, equals("toolbar"));
+ });
+}
+</script>
« no previous file with comments | « sky/engine/core/rendering/RenderBox.cpp ('k') | sky/tests/layout/clipping-elementFromPoint-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698