Index: PerformanceTests/CSS/FocusUpdate.html |
diff --git a/PerformanceTests/CSS/FocusUpdate.html b/PerformanceTests/CSS/FocusUpdate.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..30b0e43a0027bef287c244362b7197cae0f937ce |
--- /dev/null |
+++ b/PerformanceTests/CSS/FocusUpdate.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+ <title>Measure :focus update for a simple color change</title> |
+ <script src="../resources/runner.js"></script> |
+ <style type="text/css"> |
+ body { margin: 0 } |
+ a { color: black; } |
+ a:focus { color: red; } |
+ </style> |
+</head> |
+<body> |
+ <script> |
+ for (var i=0; i<100; i++) { |
+ document.write('<div>'); |
+ for (var j=0; j<100; j++) |
+ document.write('<a></a>'); |
+ document.write('</div>'); |
+ } |
+ </script> |
+ <div id="test"><a href="."></a><a href="."></div></div> |
+ <script type="text/javascript"> |
+ document.body.offsetTop; // Force layout. |
+ |
+ var testDiv = document.getElementById("test"); |
+ var a1 = testDiv.firstChild; |
+ var a2 = a1.nextSibling; |
+ |
+ PerfTestRunner.measureRunsPerSecond({ |
+ description: "Measure :focus update for a simple color change", |
+ run:function() { |
+ a1.focus(); |
+ document.body.offsetTop; // Update layout for focused state. |
+ a2.focus(); |
+ document.body.offsetTop; // Update layout for focused state. |
+ }}); |
+ </script> |
+</body> |
+</html> |