Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / paste-without-nesting.html
blobd3dbde692d2602f2f1d91afb5b3c0b2a035716e4
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description">This test checks that copy a selection and paste over the same selection does not create nested divs.</p>
8 <div id="console"></div>
9 <script>
11 var sel = document.getSelection();
12 var root = document.createElement("root");
13 document.body.appendChild(root);
16 function createEditable(tagName, markup) {
17 var node = document.createElement(tagName);
18 node.contentEditable = true;
19 node.innerHTML = markup;
20 return node;
23 function testCopyPaste(tagName, originalMarkup, expected) {
24 var node = createEditable(tagName, originalMarkup);
25 root.appendChild(node);
27 node.focus();
28 document.execCommand("SelectAll", false);
29 document.execCommand("Copy", false);
30 document.execCommand("Paste", false);
32 confirmedMarkup = node.innerHTML;
34 shouldBe("confirmedMarkup", "'" + expected + "'");
37 testCopyPaste("div", "Hello", "Hello");
38 testCopyPaste("div", "Hello<br>world", "Hello<br>world");
39 testCopyPaste("div", "<div>Hello</div><div>world</div>", "<div>Hello</div><div>world</div>");
40 testCopyPaste("div", "<div><div>Hello</div><div>world</div></div>", "<div>Hello</div><div>world</div>");
41 testCopyPaste("div", "<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>", "<div><b><i>Hello</i></b></div><div><b><i>world</i></b></div>");
42 testCopyPaste("div", "<div style=\"text-align: center;\"><div><font color=\"#ff0000\"><b><i>hello</i></b></font></div><div><font color=\"#ff0000\"><b><i>world</i></b></font></div></div>", "<div style=\"text-align: center;\"><div><font color=\"#ff0000\"><b><i>hello</i></b></font></div><div><font color=\"#ff0000\"><b><i>world</i></b></font></div></div>");
44 root.style.display = "none";
46 </script>
47 </body>
48 </html>