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

Side by Side Diff: third_party/WebKit/LayoutTests/html/grouping-content/main-element.html

Issue 2780363002: Rename subdirectory names in LayoutTests/html/. (Closed)
Patch Set: Created 3 years, 8 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 main element.');
9
10 var testParent = document.createElement('div');
11 document.body.appendChild(testParent);
12
13 debug('&lt;main> closes &lt;p>:');
14 testParent.innerHTML = '<p>Test that <main id="main1">an main element</main> clo ses &lt;p>.</p>';
15 var main1 = document.getElementById('main1');
16 shouldBeFalse('main1.parentNode.nodeName == "p"');
17
18 debug('&lt;p> does not close &lt;main>:');
19 testParent.innerHTML = '<main>Test that <p id="p1">a p element</p> does not clos e an main element.</main>';
20 var p1 = document.getElementById('p1');
21 shouldBe('p1.parentNode.nodeName', '"MAIN"');
22
23 debug('&lt;main> can be nested inside &lt;main>:');
24 testParent.innerHTML = '<main id="main2">Test that <main id="main3">an main elem ent</main> can be nested inside another.</main>';
25 var main3 = document.getElementById('main3');
26 shouldBe('main3.parentNode.id', '"main2"');
27
28 debug('Residual style:');
29 testParent.innerHTML = '<b><main id="main4">This text should be bold.</main> <sp an 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("main4")', '"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;main>.</ span>]';
40 document.body.appendChild(editable);
41 editable.contentEditable = true;
42 var selection = window.getSelection();
43 selection.selectAllChildren(editable);
44 document.execCommand('FormatBlock', false, 'main');
45 selection.removeAllRanges();
46 shouldBe('document.getElementById("span2").parentNode.nodeName', '"MAIN"');
47 document.body.removeChild(editable);
48
49 </script>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698