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

Side by Side Diff: LayoutTests/fast/parser/script-tests/fragment-parser.js

Issue 96653004: Remove support for the obsolete <isindex> tag. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description('Test that fragment parsing does not affect the host document.'); 1 description('Test that fragment parsing does not affect the host document.');
2 2
3 function parse(string, removeDocumentElement) { 3 function parse(string, removeDocumentElement) {
4 var iframe = document.createElement("iframe"); 4 var iframe = document.createElement("iframe");
5 document.body.appendChild(iframe); 5 document.body.appendChild(iframe);
6 var doc = iframe.contentDocument; 6 var doc = iframe.contentDocument;
7 doc.documentElement.removeChild(doc.documentElement.firstChild); 7 doc.documentElement.removeChild(doc.documentElement.firstChild);
8 if (removeDocumentElement) 8 if (removeDocumentElement)
9 doc.removeChild(doc.documentElement); 9 doc.removeChild(doc.documentElement);
10 10
11 var div = doc.createDocumentFragment().appendChild(doc.createElement("div")) ; 11 var div = doc.createDocumentFragment().appendChild(doc.createElement("div")) ;
12 div.innerHTML = string; 12 div.innerHTML = string;
13 document.body.removeChild(iframe); 13 document.body.removeChild(iframe);
14 return [div.innerHTML, doc.documentElement ? doc.documentElement.outerHTML : "no document element"]; 14 return [div.innerHTML, doc.documentElement ? doc.documentElement.outerHTML : "no document element"];
15 } 15 }
16 16
17 shouldBe("parse('<span><body bgcolor=red>')", "['<span></span>','<html><body></b ody></html>']"); 17 shouldBe("parse('<span><body bgcolor=red>')", "['<span></span>','<html><body></b ody></html>']");
18 shouldBe("parse('<span><html bgcolor=red>')", "['<span></span>','<html><body></b ody></html>']"); 18 shouldBe("parse('<span><html bgcolor=red>')", "['<span></span>','<html><body></b ody></html>']");
19 shouldBe("parse('<span><meta>')", "['<span><meta></span>','<html><body></body></ html>']"); 19 shouldBe("parse('<span><meta>')", "['<span><meta></span>','<html><body></body></ html>']");
20 shouldBe("parse('<span><base>')", "['<span><base></span>','<html><body></body></ html>']"); 20 shouldBe("parse('<span><base>')", "['<span><base></span>','<html><body></body></ html>']");
21 shouldBe("parse('<html><script>')", "['<script></script>','<html><body></body></ html>']"); 21 shouldBe("parse('<html><script>')", "['<script></script>','<html><body></body></ html>']");
22 shouldBe("parse('<html><style>')", "['<style></style>','<html><body></body></htm l>']"); 22 shouldBe("parse('<html><style>')", "['<style></style>','<html><body></body></htm l>']");
23 shouldBe("parse('<html><meta>')", "['<meta>','<html><body></body></html>']"); 23 shouldBe("parse('<html><meta>')", "['<meta>','<html><body></body></html>']");
24 shouldBe("parse('<html><link>')", "['<link>','<html><body></body></html>']"); 24 shouldBe("parse('<html><link>')", "['<link>','<html><body></body></html>']");
25 shouldBe("parse('<html><object>')", "['<object></object>','<html><body></body></ html>']"); 25 shouldBe("parse('<html><object>')", "['<object></object>','<html><body></body></ html>']");
26 shouldBe("parse('<html><embed>')", "['<embed>','<html><body></body></html>']"); 26 shouldBe("parse('<html><embed>')", "['<embed>','<html><body></body></html>']");
27 27
28 shouldBe("parse('<html><title>')", "['<title></title>','<html><body></body></htm l>']"); 28 shouldBe("parse('<html><title>')", "['<title></title>','<html><body></body></htm l>']");
29 shouldBe("parse('<html><isindex>')", "['<form><hr><label>This is a searchable in dex. Enter search keywords: <input name=\"isindex\"></label><hr></form>','<html> <body></body></html>']"); 29 shouldBe("parse('<html><isindex>')", "['<isindex></isindex>','<html><body></body ></html>']");
30 shouldBe("parse('<html><base>')", "['','<html><body></body></html>']"); 30 shouldBe("parse('<html><base>')", "['','<html><body></body></html>']");
31 shouldBe("parse('<html><div>')", "['<div></div>','<html><body></body></html>']") ; 31 shouldBe("parse('<html><div>')", "['<div></div>','<html><body></body></html>']") ;
32 shouldBe("parse('<frameset>')", "['','<html><body></body></html>']"); 32 shouldBe("parse('<frameset>')", "['','<html><body></body></html>']");
33 shouldBe("parse('<html>x', true)", "['x','no document element']"); 33 shouldBe("parse('<html>x', true)", "['x','no document element']");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698