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

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

Powered by Google App Engine
This is Rietveld 408576698