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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/section-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 section element.');
9
10 var testParent = document.createElement('div');
11 document.body.appendChild(testParent);
12
13 debug('&lt;section> closes &lt;p>:');
14 testParent.innerHTML = '<p>Test that <section id="section1">a section element</s ection> closes &lt;p>.</p>';
15 var section1 = document.getElementById('section1');
16 shouldBeFalse('section1.parentNode.nodeName == "p"');
17
18 debug('&lt;p> does not close &lt;section>:');
19 testParent.innerHTML = '<section>Test that <p id="p1">a p element</p> does not c lose a section element.</section>';
20 var p1 = document.getElementById('p1');
21 shouldBe('p1.parentNode.nodeName', '"SECTION"');
22
23 debug('&lt;section> can be nested inside &lt;section>:');
24 testParent.innerHTML = '<section id="section2">Test that <section id="section3"> a section element</section> can be nested inside another.</section>';
25 var section3 = document.getElementById('section3');
26 shouldBe('section3.parentNode.id', '"section2"');
27
28 debug('Residual style:');
29 testParent.innerHTML = '<b><section id="section4">This text should be bold.</sec tion> <span id="span1">This is also bold.</span></b>';
30 function getWeight(id) {
31 return document.defaultView.getComputedStyle(document.getElementById(id), nu ll).getPropertyValue('font-weight');
32 }
33 shouldBe('getWeight("section4")', '"bold"');
34 shouldBe('getWeight("span1")', '"bold"');
35 document.body.removeChild(testParent);
36
37 debug('FormatBlock:');
38 var editable = document.createElement('div');
39 editable.innerHTML = '[<span id="span2">The text will be a child of &lt;section> .</span>]';
40 document.body.appendChild(editable);
41 editable.contentEditable = true;
42 var selection = window.getSelection();
43 selection.selectAllChildren(editable);
44 document.execCommand('FormatBlock', false, 'section');
45 selection.removeAllRanges();
46 shouldBe('document.getElementById("span2").parentNode.nodeName', '"SECTION"');
47 document.body.removeChild(editable);
48
49 </script>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698