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

Side by Side Diff: third_party/WebKit/LayoutTests/html/grouping-content/figure-element.html

Issue 2780363002: Rename subdirectory names in LayoutTests/html/. (Closed)
Patch Set: Created 3 years, 8 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
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description('Various tests for the figure element.');
9
10 function getStyleValue(id, propertyName) {
11 return document.defaultView.getComputedStyle(document.getElementById(id), nu ll).getPropertyValue(propertyName);
12 }
13
14 var testParent = document.createElement('div');
15 document.body.appendChild(testParent);
16
17 debug('&lt;figure> default styling:');
18 testParent.innerHTML = '<figure id="figure0">element</figure>';
19 var emSize = getStyleValue("figure0","font-size");
20 shouldBe('getStyleValue("figure0","display")', '"block"');
21 shouldBe('getStyleValue("figure0","margin-top")', 'emSize');
22 shouldBe('getStyleValue("figure0","margin-right")', '"40px"');
23 shouldBe('getStyleValue("figure0","margin-bottom")', 'emSize');
24 shouldBe('getStyleValue("figure0","margin-left")', '"40px"');
25
26 debug('&lt;figure> closes &lt;p>:');
27 testParent.innerHTML = '<p>Test that <figure id="figure1">a figure element</figu re> closes &lt;p>.</p>';
28 var figure1 = document.getElementById('figure1');
29 shouldBeFalse('figure1.parentNode.nodeName == "p"');
30
31 debug('&lt;p> does not close &lt;figure>:');
32 testParent.innerHTML = '<figure>Test that <p id="p1">a p element</p> does not cl ose a figure element.</figure>';
33 var p1 = document.getElementById('p1');
34 shouldBe('p1.parentNode.nodeName', '"FIGURE"');
35
36 debug('&lt;figure> can be nested inside &lt;figure> or &lt;footer>:');
37 testParent.innerHTML = '<figure id="figure2">Test that <figure id="figure3">a fi gure element</figure> can be nested inside another figure element.</figure>';
38 var figure3 = document.getElementById('figure3');
39 shouldBe('figure3.parentNode.id', '"figure2"');
40 testParent.innerHTML = '<footer id="footer1">Test that <figure id="figure5">a fi gure element</figure> can be nested inside a footer element.</footer>';
41 var figure5 = document.getElementById('figure5');
42 shouldBe('figure5.parentNode.id', '"footer1"');
43
44 debug('Residual style:');
45 testParent.innerHTML = '<b><figure id="figure4">This text should be bold.</figur e> <span id="span1">This is also bold.</span></b>';
46 shouldBe('getStyleValue("figure4","font-weight")', '"bold"');
47 shouldBe('getStyleValue("span1","font-weight")', '"bold"');
48 document.body.removeChild(testParent);
49
50 </script>
51 </body>
52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698