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

Side by Side Diff: LayoutTests/fast/dom/shadow/pseudoclass-update-enabled-area.html

Issue 408293002: Support for :enabled selector on Anchor & Area elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated layout tests with fixes from esprehn Created 6 years, 4 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
OLDNEW
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5
6 <body>
7
8 <style> 1 <style>
9 area { 2 area {
10 display: inline; 3 display: inline;
11 } 4 }
12 </style> 5 </style>
13
14 <p>When an anchor tag catch 'href' attribute or release 'href' attribute, distri bution should happen.</p> 6 <p>When an anchor tag catch 'href' attribute or release 'href' attribute, distri bution should happen.</p>
15
16 <div id="host1"></div> 7 <div id="host1"></div>
17 <div id="host2"></div> 8 <div id="host2"></div>
18
19 <script> 9 <script>
20 if (window.testRunner) 10 if (window.testRunner)
21 testRunner.waitUntilDone(); 11 testRunner.waitUntilDone();
22 12
23 function createArea(href, textContent) 13 function createArea(href, textContent)
24 { 14 {
25 var area = document.createElement('area'); 15 var area = document.createElement('area');
26 if (href) 16 if (href)
27 area.setAttribute('href', href); 17 area.setAttribute('href', href);
28 area.appendChild(document.createTextNode(textContent)); 18 area.appendChild(document.createTextNode(textContent));
29 19
30 return area; 20 return area;
31 } 21 }
32 22
33 var area1 = createArea('http://www.example.com/', 'Anchor 1'); 23 var area1 = createArea('http://www.example.com/', 'Anchor 1');
34 var area2 = createArea('http://www.example.com/', 'Anchor 2'); 24 var area2 = createArea('http://www.example.com/', 'Anchor 2');
35 var area3 = createArea(null, 'Anchor 3'); 25 var area3 = createArea(null, 'Anchor 3');
36 var area4 = createArea(null, 'Anchor 4'); 26 var area4 = createArea(null, 'Anchor 4');
37 27
38 host1.appendChild(area1); 28 host1.appendChild(area1);
39 host1.appendChild(area2); 29 host1.appendChild(area2);
40 host2.appendChild(area3); 30 host2.appendChild(area3);
41 host2.appendChild(area4); 31 host2.appendChild(area4);
42 32
43 host1.createShadowRoot().innerHTML = '<content select="area:link"></content>'; 33 host1.createShadowRoot().innerHTML = '<content select="area:enabled"></content>' ;
44 host2.createShadowRoot().innerHTML = '<content select="area:link"></content>'; 34 host2.createShadowRoot().innerHTML = '<content select="area:enabled"></content>' ;
45 35
46 setTimeout(function() { 36 setTimeout(function() {
47 area2.removeAttribute('href'); 37 area2.removeAttribute('href');
48 area4.setAttribute('href', 'http://www.example.com/'); 38 area4.setAttribute('href', 'http://www.example.com/');
49 if (testRunner) 39 if (testRunner)
50 testRunner.notifyDone(); 40 testRunner.notifyDone();
51 }, 0); 41 }, 0);
52
53 </script> 42 </script>
54 </body>
55 </html>
56
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698