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

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

Powered by Google App Engine
This is Rietveld 408576698