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

Side by Side Diff: PerformanceTests/ShadowDOM/StyleSheetInsert.html

Issue 28553005: Avoid parsing css text if there are identical inline style blocks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 11 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/CSSStyleSheet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../resources/runner.js"></script>
5 </head>
6 <body><iframe></iframe>
7 </body>
8 <script>
9 function setup() {
10 var frame = document.getElementsByTagName("iframe")[0];
11 var testDoc = frame.contentDocument;
12 testDoc.body.innerHTML = "<head></head><body><div id='sandbox'></div></body> ";
13 return testDoc;
14 }
15
16 PerfTestRunner.measureTime({run:function() {
17 var testDoc = setup();
18 var start = PerfTestRunner.now();
19 var sandbox = testDoc.getElementById('sandbox');
20 var templateA = testDoc.getElementById('templateA');
21 var templateB = testDoc.getElementById('templateB');
22 for (var i = 0; i < 100; i++) {
23 var elementA = testDoc.createElement("div");
24 var shadowRootForA = elementA.createShadowRoot();
25 shadowRootForA.innerHTML = "<style>@host{:scope{display:block}}ul.canary isdev li:nth-of-type(4)::after{content:'canary/dev'}ul.canaryisdev li:nth-of-typ e(5)::after{content:'beta'}ul.canaryisdev li:nth-of-type(6)::after{content:'stab le'}ul.canaryisdev li:nth-of-type(7)::after{content:''}ul.betaisdev li:nth-of-ty pe(4)::after{content:'canary'}ul.betaisdev li:nth-of-type(5)::after{content:'dev /beta'}ul.betaisdev li:nth-of-type(6)::after{content:'stable'}ul.betaisdev li:nt h-of-type(7)::after{content:''}ul li{cursor:pointer;padding:3px 0}ul li::before{ -webkit-transition:all 500ms ease;-moz-transition:all 500ms ease;-o-transition:a ll 500ms ease;transition:all 500ms ease;content:'';margin-right:5px;border-left: 3px solid transparent}ul li::after{font-size:75%;margin-left:10px}ul li:first-of -type,ul li:nth-of-type(2),ul li:nth-of-type(3){font-size:75%;font-style:italic} ul li:nth-of-type(3){border-bottom:1px solid #d4d4d4;padding-bottom:10px;margin- bottom:5px}ul li:nth-of-type(4)::after{content:'canary'}ul li:nth-of-type(5)::af ter{content:'dev'}ul li:nth-of-type(6)::after{content:'beta'}ul li:nth-of-type(7 )::after{content:'stable'}ul li[selected]{font-weight:600;color:#366597}ul li[se lected]::before{border-color:#366597}</style><div>A</div>";
26 sandbox.appendChild(elementA);
27
28 var elementB = testDoc.createElement("div");
29 var shadowRootForB = elementB.createShadowRoot();
30 shadowRootForB.innerHTML = "<style>@host{:scope{display:block;padding:1p x}}.milestone-marker{text-align:right;text-transform:uppercase;margin-top:10px;f ont-weight:600;font-size:14px;color:#366597}@media only screen and (max-width: 7 00px){[data-first-of-milestone]:after{font-size:12px;font-weight:normal;top:-22p x;opacity:1;text-transform:uppercase}}</style><div>B</div>";
31 sandbox.appendChild(elementB);
32 }
33 return PerfTestRunner.now() - start;
34 }});
35 </script>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698