Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/domparsing/createContextualFragment.html

Issue 2623223003: Import wpt@82173128ef6f536e5faaafc29eecc521380f81ae (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {

Powered by Google App Engine
This is Rietveld 408576698