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

Unified Diff: tools/perf/page_sets/key_silk_cases/pushState.html

Issue 378803002: Add a history state update example to key_silk_cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved to a local file Created 6 years, 5 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 | « tools/perf/page_sets/key_silk_cases.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/key_silk_cases/pushState.html
diff --git a/tools/perf/page_sets/key_silk_cases/pushState.html b/tools/perf/page_sets/key_silk_cases/pushState.html
new file mode 100644
index 0000000000000000000000000000000000000000..dd7402571ca883ac50b75a33463a3caf707120b8
--- /dev/null
+++ b/tools/perf/page_sets/key_silk_cases/pushState.html
@@ -0,0 +1,65 @@
+<!doctype html><html><meta charset=utf-8>
+<meta name = "viewport" content = "width = device-width, user-scalable = no">
+<style>
+body {
+ width: 300px;
+}
+div.o {
+ height: 50px;
+ width: 50px;
+ border-radius: 50px;
+ position: absolute;
+ left: 150px; top: 50px;
+ background: red;
+ -webkit-transform-origin: 25px 100px;
+}
+div.b {
+ position: relative;
+}
+.b div {
+ position: absolute;
+ height: 25px;
+ width: 25px;
+ border-radius: 25px;
+}
+</style>
+<body>
+<div class=b></div>
+<div class=o></div>
+<script>
+var count=0;
+function rnd(x) {
+ count++;
+ return Math.floor(Math.abs(Math.cos(count)) * x);
+}
+function newdiv() {
+ var d = document.createElement('div');
+ d.style.top = rnd(350) + 'px';
+ d.style.left = rnd(275) + 'px';
+ d.style.background = 'rgb(' + rnd(255) + ',' + rnd(255) + ',' + rnd(255) + ')';
+ document.querySelector('.b').appendChild(d);
+}
+for (var i = 0; i < 1000; i++) {
+ newdiv();
+}
+
+a = 0;
+n = 0;
+d = document.querySelector('.o');
+function update(a) {
+ d.style.webkitTransform = 'rotate3d(0,0,1,' + a + 'deg)';
+}
+function step() {
+ a = (a + 3) % 360;
+ update(a);
+ window.requestAnimationFrame(step);
+ if (a == 0) {
+ n++;
+ history.pushState(n, n, '/pushstate/' + n);
+ }
+}
+step();
+</script>
+
+<body>
+</html>
« no previous file with comments | « tools/perf/page_sets/key_silk_cases.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698