Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / inserting / edited-whitespace-1.html
blob5ecbfd1dc50a6501308352e7505385d5710c7cdf
1 <p>This tests that edited whitespaces aren't all nbsps. When the region becomes non-editable, Hello and World should still be on different lines. This demonstrates a bug: the div's focus halo doesn't go away when it becomes non-editable.</p>
2 <div id="div" contenteditable="true" style="border: 1px solid black; width: 60px;"></div>
3 <ol id="console"></ol>
4 <script>
5 function log(str) {
6 var li = document.createElement("li");
7 li.appendChild(document.createTextNode(str));
8 var console = document.getElementById("console");
9 console.appendChild(li);
12 if (window.testRunner)
13 testRunner.waitUntilDone();
15 var div = document.getElementById("div");
16 var sel = window.getSelection();
17 sel.collapse(div, 0);
18 document.execCommand("InsertText", false, " ");
19 document.execCommand("InsertText", false, "Hello");
20 document.execCommand("InsertText", false, " ");
21 document.execCommand("InsertText", false, " ");
22 document.execCommand("InsertText", false, " ");
23 document.execCommand("InsertText", false, " ");
24 document.execCommand("InsertText", false, " ");
25 document.execCommand("InsertText", false, "World");
26 document.execCommand("InsertText", false, " ");
28 var innerText = div.innerHTML;
30 // Check the pattern produced. This might change in the future.
31 var expected = "&nbsp;Hello &nbsp; &nbsp; World&nbsp;";
32 var nbsp = false;
33 for (var i = 0; i < innerText.length; i++) {
34 if(innerText[i] != expected[i])
35 log("Error: Character " + i + " of the editable region was not what was expected.");
38 div.contentEditable = "false";
39 // When we turn content editability off, we'll see Hello and World on the same line if editing is using all nbsps.
41 // Ensure we push a final frame to avoid flake.
42 if (window.testRunner) {
43 window.requestAnimationFrame(function() {
44 testRunner.notifyDone();
45 });
47 </script>