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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/footer-element.html

Issue 2669403002: Move tests for sections elements to html/sections/. (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 <!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 footer element.');
9
10 var testParent = document.createElement('div');
11 document.body.appendChild(testParent);
12
13 debug('&lt;footer> closes &lt;p>:');
14 testParent.innerHTML = '<p>Test that <footer id="footer1">a footer element</foot er> closes &lt;p>.</p>';
15 var footer1 = document.getElementById('footer1');
16 shouldBeFalse('footer1.parentNode.nodeName == "p"');
17
18 debug('&lt;p> does not close &lt;footer>:');
19 testParent.innerHTML = '<footer>Test that <p id="p1">a p element</p> does not cl ose a footer element.</footer>';
20 var p1 = document.getElementById('p1');
21 shouldBe('p1.parentNode.nodeName', '"FOOTER"');
22
23 debug('&lt;footer> can be nested inside &lt;footer> or &lt;header>:');
24 testParent.innerHTML = '<footer id="footer2">Test that <footer id="footer3">a fo oter element</footer> can be nested inside another footer element.</footer>';
25 var footer3 = document.getElementById('footer3');
26 shouldBe('footer3.parentNode.id', '"footer2"');
27 testParent.innerHTML = '<header id="header1">Test that <footer id="footer5">a fo oter element</footer> can be nested inside a header element.</header>';
28 var footer5 = document.getElementById('footer5');
29 shouldBe('footer5.parentNode.id', '"header1"');
30
31 debug('Residual style:');
32 testParent.innerHTML = '<b><footer id="footer4">This text should be bold.</foote r> <span id="span1">This is also bold.</span></b>';
33 function getWeight(id) {
34 return document.defaultView.getComputedStyle(document.getElementById(id), nu ll).getPropertyValue('font-weight');
35 }
36 shouldBe('getWeight("footer4")', '"bold"');
37 shouldBe('getWeight("span1")', '"bold"');
38 document.body.removeChild(testParent);
39
40 debug('FormatBlock:');
41 var editable = document.createElement('div');
42 editable.innerHTML = '[<span id="span2">The text will be a child of &lt;footer>. </span>]';
43 document.body.appendChild(editable);
44 editable.contentEditable = true;
45 var selection = window.getSelection();
46 selection.selectAllChildren(editable);
47 document.execCommand('FormatBlock', false, 'footer');
48 selection.removeAllRanges();
49 shouldBe('document.getElementById("span2").parentNode.nodeName', '"FOOTER"');
50 document.body.removeChild(editable);
51
52 </script>
53 </body>
54 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698