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

Side by Side Diff: PerformanceTests/ShadowDOM/shadow-style-share-attr-selectors.html

Issue 195903002: Only process each StyleSheetContents once when collecting features during style resolution (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only hash shared stylesheets Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <style> 2 <style>
3 div { 3 div {
4 color: orange; 4 color: orange;
5 } 5 }
6 </style> 6 </style>
7 <script src="../resources/runner.js"></script> 7 <script src="../resources/runner.js"></script>
8 <script> 8 <script>
9 var listSize = 100; 9 var listSize = 1000;
10 window.onload = function() { 10 window.onload = function() {
11 PerfTestRunner.measureTime({ 11 PerfTestRunner.measureTime({
12 run: function() { 12 run: function() {
13 var list = document.querySelector('#list'); 13 var list = document.querySelector('#list');
14 var tmpl = document.querySelector("#tmpl"); 14 var tmpl = document.querySelector("#tmpl");
15 list.innerHTML = ''; 15 list.innerHTML = '';
16 var start = PerfTestRunner.now(); 16 var start = PerfTestRunner.now();
17 var i = 0; 17 var i = 0;
18 do { 18 do {
19 var host = document.createElement('div'); 19 var host = document.createElement('div');
20 var root = host.createShadowRoot(); 20 var root = host.createShadowRoot();
21 root.appendChild(tmpl.content.cloneNode(true)); 21 root.appendChild(tmpl.content.cloneNode(true));
22 var light = document.createElement('div'); 22 var light = document.createElement('div');
23 list.appendChild(host); 23 list.appendChild(host);
24 } while (++i < listSize); 24 } while (++i < listSize);
25 25
26 document.body.offsetHeight; 26 document.body.offsetHeight;
27 return PerfTestRunner.now() - start; 27 return PerfTestRunner.now() - start;
28 } 28 }
29 }); 29 });
30 } 30 }
31 </script> 31 </script>
32 <template id="tmpl"> 32 <template id="tmpl">
33 <!-- None of these styles match, but that's on purpose -->
33 <style> 34 <style>
34 .foo .bar .foo.bar.baz { 35 [foo] {
35 color: blue; 36 color: blue;
36 } 37 }
37 .bar.baz { 38 [bar] {
38 color: red; 39 color: red;
39 } 40 }
41 [baz] {
42 color: green;
43 }
40 </style> 44 </style>
41 <div class="foo"> 45 <div>
42 <div class="bar"> 46 <div>
43 <div class="foo bar baz">item</div> 47 <div>item</div>
44 </div> 48 </div>
45 </div> 49 </div>
46 <content></content> 50 <content></content>
47 </template> 51 </template>
48 <section id="list"></section> 52 <section id="list"></section>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698