Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / extend-to-trailing-spaces.html
blobe5d4b43fea0689f9a6089571f13301634dc29fe3
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/js-test.js"></script>
5 <div id="test"></div>
6 <script>
7 description("Ensure that extending a selection to trailing spaces does not cause exceptions.");
9 var div = document.getElementById('test');
10 var selection = window.getSelection();
12 function testIt(text) {
13 var len = text.length;
14 div.textContent = text;
15 selection.collapse(div.firstChild, 0);
16 try {
17 selection.extend(div.firstChild, len);
18 } catch (e) {
19 testFailed(div.outerHTML + ': ' + String(e.toString()));
20 return;
22 try {
23 selection.extend(div.firstChild, len + 1);
24 testFailed(div.outerHTML + ': ' + String(e.toString()));
25 return;
26 } catch (e) {
28 testPassed(div.outerHTML);
30 testIt('0123');
31 testIt('012 ');
32 testIt('012 ');
33 testIt('012\n');
34 testIt('012\n\n');
36 div.textContent = '';
37 </script>
38 </body>
39 </html>