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

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

Powered by Google App Engine
This is Rietveld 408576698