Index: PerformanceTests/CSS/SelectorCountScaling.html |
diff --git a/PerformanceTests/CSS/SelectorCountScaling.html b/PerformanceTests/CSS/SelectorCountScaling.html |
index 68a67fe827caa9cf3ff1b93f9e17024f7d44a6f2..881b6da5f6cf9eb82b247667ba3e9141dea6ff6f 100644 |
--- a/PerformanceTests/CSS/SelectorCountScaling.html |
+++ b/PerformanceTests/CSS/SelectorCountScaling.html |
@@ -17,18 +17,27 @@ function insertStyleSheet(css) |
return styleElement; |
} |
-function cssStr(count) { |
+function cssStrWithClassSelectors(count) { |
var selector = '.a' + count + ' .b' + count + ' { color: red } '; |
// Intentionally repeat the same classes many times, to test duplicate optimizations. |
return selector + selector + selector + selector + selector + selector + selector; |
} |
+function cssStrWithAttributeSelectors(count) { |
+ var selector = '[attrA' + count + '="1"]' + ' [attrB' + count + '="1"]' + ' { color: red } '; |
+ // Intentionally repeat the same classes many times, to test duplicate optimizations. |
+ return selector + selector + selector + selector + selector + selector + selector; |
+} |
+ |
function runFunction() |
{ |
var numRules = 1000; |
var arr = new Array(numRules); |
for (var i = 0 ; i < numRules; i++) { |
- arr[i] = cssStr(i); |
+ arr[i] = cssStrWithClassSelectors(i); |
+ } |
+ for (var i = 0 ; i < numRules; i++) { |
+ arr[numRules + i] = cssStrWithAttributeSelectors(i); |
} |
var styleElement = insertStyleSheet(arr.join(' ')); |