[css-grid] Scroll reset position when updating inner html on content
[WebKit-https.git] / LayoutTests / editing / deleting / backspace-avoid-preceding-style.html
1 <body contentEditable="true">
2 <div id="test-case">
3   <u>This should be underlined.</u><div id="not-underlined">This should not be underlined.</div>
4 </div>
5 <div id="results"></div>
6 </body>
7 <script src="../editing.js"></script>
8 <script>
9     if (window.testRunner)
10         testRunner.dumpAsText();
11
12     // Pressing delete to merge the two lines should not cause the text
13     // "not underlined" to be inside the <u> tag.
14     var secondLine = document.getElementById("not-underlined");
15     execSetSelectionCommand(secondLine, 0, secondLine, 0);
16     document.execCommand("Delete");
17
18     var result = document.getElementById("test-case").innerHTML;
19     result = result.replace(/^\s+/g, "").replace(/\s+$/g, "");  // Removing leading/trailing whitespace.
20     if (result == "<u>This should be underlined.</u>This should not be underlined.")
21         document.getElementById("results").innerText = "PASS";
22     else
23         document.getElementById("results").innerText = "FAIL";
24 </script>