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: LayoutTests/fast/html/script-tests/article-element.js

Issue 236693002: Replace Selection.collapse() with Selection.removeAllRanges() in layout tests.. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
1 description('Various tests for the article element.'); 1 description('Various tests for the article element.');
2 2
3 var testParent = document.createElement('div'); 3 var testParent = document.createElement('div');
4 document.body.appendChild(testParent); 4 document.body.appendChild(testParent);
5 5
6 debug('<article> closes <p>:'); 6 debug('<article> closes <p>:');
7 testParent.innerHTML = '<p>Test that <article id="article1">an article element</ article> closes &lt;p>.</p>'; 7 testParent.innerHTML = '<p>Test that <article id="article1">an article element</ article> closes &lt;p>.</p>';
8 var article1 = document.getElementById('article1'); 8 var article1 = document.getElementById('article1');
9 shouldBeFalse('article1.parentNode.nodeName == "p"'); 9 shouldBeFalse('article1.parentNode.nodeName == "p"');
10 10
(...skipping 17 matching lines...) Expand all
28 document.body.removeChild(testParent); 28 document.body.removeChild(testParent);
29 29
30 debug('FormatBlock:'); 30 debug('FormatBlock:');
31 var editable = document.createElement('div'); 31 var editable = document.createElement('div');
32 editable.innerHTML = '[<span id="span2">The text will be a child of &lt;article> .</span>]'; 32 editable.innerHTML = '[<span id="span2">The text will be a child of &lt;article> .</span>]';
33 document.body.appendChild(editable); 33 document.body.appendChild(editable);
34 editable.contentEditable = true; 34 editable.contentEditable = true;
35 var selection = window.getSelection(); 35 var selection = window.getSelection();
36 selection.selectAllChildren(editable); 36 selection.selectAllChildren(editable);
37 document.execCommand('FormatBlock', false, 'article'); 37 document.execCommand('FormatBlock', false, 'article');
38 selection.collapse(); 38 selection.removeAllRanges();
39 shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"'); 39 shouldBe('document.getElementById("span2").parentNode.nodeName', '"ARTICLE"');
40 document.body.removeChild(editable); 40 document.body.removeChild(editable);
41 41
OLDNEW
« no previous file with comments | « LayoutTests/fast/html/nav-element.html ('k') | LayoutTests/fast/html/script-tests/aside-element.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698