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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/script-tests/figcaption-element.js

Issue 2674643002: Stop using script-tests in fast/html/. (Closed)
Patch Set: Created 3 years, 10 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 description('Various tests for the figcaption element.');
2
3 function getStyleValue(id, propertyName) {
4 return document.defaultView.getComputedStyle(document.getElementById(id), nu ll).getPropertyValue(propertyName);
5 }
6
7 var testParent = document.createElement('div');
8 document.body.appendChild(testParent);
9
10 debug('<figcaption> default styling:');
11 testParent.innerHTML = '<figcaption id="figcaption0">element</figure>';
12 var emSize = getStyleValue("figcaption0","font-size");
13 shouldBe('getStyleValue("figcaption0","display")', '"block"');
14
15 debug('&lt;figcaption> closes &lt;p>:');
16 testParent.innerHTML = '<p>Test that <figcaption id="figcaption1">a figcaption e lement</figcaption> closes &lt;p>.</p>';
17 var figcaption1 = document.getElementById('figcaption1');
18 shouldBeFalse('figcaption1.parentNode.nodeName == "p"');
19
20 debug('&lt;p> does not close &lt;figcaption>:');
21 testParent.innerHTML = '<figcaption>Test that <p id="p1">a p element</p> does no t close a figcaption element.</figcaption>';
22 var p1 = document.getElementById('p1');
23 shouldBe('p1.parentNode.nodeName', '"FIGCAPTION"');
24
25 debug('&lt;figcaption> can be nested inside &lt;figcaption> or &lt;footer>:');
26 testParent.innerHTML = '<figcaption id="figcaption2">Test that <figcaption id="f igcaption3">a figcaption element</figcaption> can be nested inside another figca ption element.</figcaption>';
27 var figcaption3 = document.getElementById('figcaption3');
28 shouldBe('figcaption3.parentNode.id', '"figcaption2"');
29 testParent.innerHTML = '<footer id="footer1">Test that <figcaption id="figcaptio n5">a figcaption element</figcaption> can be nested inside a footer element.</fo oter>';
30 var figcaption5 = document.getElementById('figcaption5');
31 shouldBe('figcaption5.parentNode.id', '"footer1"');
32
33 debug('Residual style:');
34 testParent.innerHTML = '<b><figcaption id="figcaption4">This text should be bold .</figcaption> <span id="span1">This is also bold.</span></b>';
35 shouldBe('getStyleValue("figcaption4","font-weight")', '"bold"');
36 shouldBe('getStyleValue("span1","font-weight")', '"bold"');
37 document.body.removeChild(testParent);
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698