-Success
-Success
+Test 1: Verify that a header at the beginning of inserted content is preserved.
+Success. <h1>bar</h1><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h1>bar</h1>bazfoo
+Success. <h2>bar</h2><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h2>bar</h2>bazfoo
+Success. <h3>bar</h3><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h3>bar</h3>bazfoo
+Success. <h4>bar</h4><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h4>bar</h4>bazfoo
+Success. <h5>bar</h5><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h5>bar</h5>bazfoo
+Success. <h6>bar</h6><div>baz</div> was inserted into <div>foo^foo<div> and the result was:foo<h6>bar</h6>bazfoo
+Test 2: Verify that a header at the end of inserted content is preserved.
+Success. <div>bar</div><h1>baz</h1> was inserted into <div>foo^foo<div> and the result was:foobar<h1>baz</h1>foo
+Success. <div>bar</div><h2>baz</h2> was inserted into <div>foo^foo<div> and the result was:foobar<h2>baz</h2>foo
+Success. <div>bar</div><h3>baz</h3> was inserted into <div>foo^foo<div> and the result was:foobar<h3>baz</h3>foo
+Success. <div>bar</div><h4>baz</h4> was inserted into <div>foo^foo<div> and the result was:foobar<h4>baz</h4>foo
+Success. <div>bar</div><h5>baz</h5> was inserted into <div>foo^foo<div> and the result was:foobar<h5>baz</h5>foo
+Success. <div>bar</div><h6>baz</h6> was inserted into <div>foo^foo<div> and the result was:foobar<h6>baz</h6>foo
-<div id="div1" contentEditable="true">foofoo</div>
-<div id="div2" contentEditable="true">foofoo</div>
-
+<!DOCTYPE html>
+<html>
+<body>
+</body>
<script>
+function insertHeaderForTest(testContent, expected)
+{
+ document.body.innerHTML = "<div id='testDiv' contentEditable='true'>foofoo</div>";
+ var targetDiv = document.getElementById("testDiv");
+ var targetText = targetDiv.firstChild;
+ window.getSelection().setPosition(targetText, 3);
+ document.execCommand("InsertHTML", false, testContent);
+ var actual = targetDiv.innerHTML;
+ if (actual == expected)
+ return "Success. " + testContent +" was inserted into <div>foo^foo<div> and the result was:" + actual + "\n";
+ return "Failure. Result was: " + actual + ", should have been: " + expected + "\n";
+}
+
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
-
-output = "";
// Test 1: Verify that a header at the beginning of inserted content is preserved.
-div = document.getElementById("div1");
-text = div.firstChild;
-window.getSelection().setPosition(text, 3);
-document.execCommand("InsertHTML", false, "<h1>bar</h1><div>baz</div>");
-expected = "foo<h1>bar</h1>bazfoo";
-actual = div.innerHTML;
-if (actual == expected)
- output += "Success\n";
-else
- output += "Failure. Result was: " + actual + ", should have been: " + expected + "\n";
-
+output = "Test 1: Verify that a header at the beginning of inserted content is preserved.\n";
+output += insertHeaderForTest("<h1>bar</h1><div>baz</div>", "foo<h1>bar</h1>bazfoo");
+output += insertHeaderForTest("<h2>bar</h2><div>baz</div>", "foo<h2>bar</h2>bazfoo");
+output += insertHeaderForTest("<h3>bar</h3><div>baz</div>", "foo<h3>bar</h3>bazfoo");
+output += insertHeaderForTest("<h4>bar</h4><div>baz</div>", "foo<h4>bar</h4>bazfoo");
+output += insertHeaderForTest("<h5>bar</h5><div>baz</div>", "foo<h5>bar</h5>bazfoo");
+output += insertHeaderForTest("<h6>bar</h6><div>baz</div>", "foo<h6>bar</h6>bazfoo");
+
// Test 2: Verify that a header at the end of inserted content is preserved.
-div = document.getElementById("div2");
-text = div.firstChild;
-window.getSelection().setPosition(text, 3);
-document.execCommand("InsertHTML", false, "<div>bar</div><h1>baz</h1>");
-expected = "foobar<h1>baz</h1>foo";
-actual = div.innerHTML;
-if (actual == expected)
- output += "Success\n";
-else
- output += "Failure. Result was: " + actual + ", should have been: " + expected + "\n";
+output += "Test 2: Verify that a header at the end of inserted content is preserved.\n";
+output += insertHeaderForTest("<div>bar</div><h1>baz</h1>", "foobar<h1>baz</h1>foo");
+output += insertHeaderForTest("<div>bar</div><h2>baz</h2>", "foobar<h2>baz</h2>foo");
+output += insertHeaderForTest("<div>bar</div><h3>baz</h3>", "foobar<h3>baz</h3>foo");
+output += insertHeaderForTest("<div>bar</div><h4>baz</h4>", "foobar<h4>baz</h4>foo");
+output += insertHeaderForTest("<div>bar</div><h5>baz</h5>", "foobar<h5>baz</h5>foo");
+output += insertHeaderForTest("<div>bar</div><h6>baz</h6>", "foobar<h6>baz</h6>foo");
document.body.innerText = output;
</script>
+</html>
+2012-04-13 Yi Shen <yi.4.shen@nokia.com>
+
+ InsertHTML fails to insert h6 if the insertion point is before some text.
+ https://bugs.webkit.org/show_bug.cgi?id=82689
+
+ Reviewed by Ryosuke Niwa.
+
+ Added the missing h6 tag for the isHeaderElement.
+
+ No new tests: updated existing test (editing/execCommand/4128080-1.html)
+
+ * editing/ReplaceSelectionCommand.cpp:
+ (WebCore::isHeaderElement):
+
2012-04-13 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: exception in heap profiler when expanding a class in summary view