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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/html/script-tests/article-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 article element.');
2
3 var testParent = document.createElement('div');
4 document.body.appendChild(testParent);
5
6 debug('<article> closes <p>:');
7 testParent.innerHTML = '<p>Test that <article id="article1">an article element</ article> closes &lt;p>.</p>';
8 var article1 = document.getElementById('article1');
9 shouldBeFalse('article1.parentNode.nodeName == "p"');
10
11 debug('&lt;p> does not close &lt;article>:');
12 testParent.innerHTML = '<article>Test that <p id="p1">a p element</p> does not c lose an article element.</article>';
13 var p1 = document.getElementById('p1');
14 shouldBe('p1.parentNode.nodeName', '"ARTICLE"');
15
16 debug('&lt;article> can be nested inside &lt;article>:');
17 testParent.innerHTML = '<article id="article2">Test that <article id="article3"> an article element</article> can be nested inside another.</article>';
18 var article3 = document.getElementById('article3');
19 shouldBe('article3.parentNode.id', '"article2"');
20
21 debug('Residual style:');
22 testParent.innerHTML = '<b><article id="article4">This text should be bold.</art icle> <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("article4")', '"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;article> .</span>]';
33 document.body.appendChild(editable);
34 editable.contentEditable = true;
35 var selection = window.getSelection();
36 selection.selectAllChildren(editable);
37 document.execCommand('FormatBlock', false, 'article');
38 selection.removeAllRanges();
39 shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"');
40 document.body.removeChild(editable);
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698