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

Unified Diff: tools/telemetry/unittest_data/draggable.html

Issue 955653003: Adding Maps page to page_sets for telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mousedrag2
Patch Set: Added unittest. 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: tools/telemetry/unittest_data/draggable.html
diff --git a/tools/telemetry/unittest_data/draggable.html b/tools/telemetry/unittest_data/draggable.html
new file mode 100644
index 0000000000000000000000000000000000000000..f6171da783aa029bf30b4bb907e9355fcac3be37
--- /dev/null
+++ b/tools/telemetry/unittest_data/draggable.html
@@ -0,0 +1,33 @@
+<html>
+ <head>
+ <style>
+ body { margin:0; }
+ #drag_div {
+ width:100%;
+ height:100%;
+ background:blue;
+ position:relative;
+ }
+ </style>
+ <script>
+ offsetX = 0;
+ offsetY = 0;
+
+ function drag(event) {
+ d = document.getElementById("drag_div");
+ offsetX = event.clientX - d.offsetLeft;
+ offsetY = event.clientY - d.offsetTop;
+ }
+
+ function drop(event) {
+ d = document.getElementById("drag_div");
+ d.style.left = event.clientX - offsetX;
+ d.style.top = event.clientY - offsetY;
+ }
+ </script>
+ </head>
+
+ <body id ="body" onmouseup="drop(event)">
Sami 2015/03/02 14:03:56 nit: no need for "(event)" here and below.
ssid 2015/03/02 20:09:42 Done.
+ <div id="drag_div" onmousedown="drag(event)"> </div>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698