Index: third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html |
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html b/third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html |
index 07c0883e24027c90df3e8c8b8178a289a461e08c..a885a5dcb5ab149098c9aa3ec826c27be2e2040e 100644 |
--- a/third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html |
+++ b/third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html |
@@ -84,6 +84,45 @@ test(function() { |
assert_true(passed, "Fragment created and added to document, should run"); |
}, "<script>s should be run when appended to the document (but not before)"); |
+// Historical bugs in browsers; see https://github.com/whatwg/html/issues/2222 |
+ |
+[ |
+ // Void |
+ "area", |
+ "base", |
+ "basefont", |
+ "bgsound", |
+ "br", |
+ "col", |
+ "embed", |
+ "frame", |
+ "hr", |
+ "img", |
+ "input", |
+ "keygen", |
+ "link", |
+ "meta", |
+ "param", |
+ "source", |
+ "track", |
+ "wbr", |
+ |
+ // Historical |
+ "menuitem", |
+ "image" |
+].forEach(name => { |
+ test(() => { |
+ const range = document.createRange(); |
+ const contextNode = document.createElement(name); |
+ const selectedNode = document.createElement("div"); |
+ contextNode.appendChild(selectedNode); |
+ range.selectNode(selectedNode); |
+ |
+ range.createContextualFragment("some text"); |
+ }, `createContextualFragment should work even when the context is <${name}>`); |
+}); |
+ |
+ |
// Now that we've established basic sanity, let's do equivalence tests. Those |
// are easier to write anyway. |
function testEquivalence(element1, fragment1, element2, fragment2) { |