Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / parser / script-tests / pre-first-line-break.js
blobeee015700c094145ca5a2037f6410c7ad5fc2613
1 description('Test for handling of line breaks following the pre element.');
3 var element = document.createElement("div");
5 function roundTrip(string)
7     element.innerHTML = string;
8     return element.innerHTML;
11 shouldBe("roundTrip('<pre></pre>')", "'<pre></pre>'");
12 shouldBe("roundTrip('<pre>\\n</pre>')", "'<pre></pre>'");
13 shouldBe("roundTrip('<pre>\\n\\n</pre>')", "'<pre>\\n</pre>'");
14 shouldBe("roundTrip('<pre>x\\n</pre>')", "'<pre>x\\n</pre>'");
15 shouldBe("roundTrip('<pre>&lt;\\n</pre>')", "'<pre>&lt;\\n</pre>'");
16 shouldBe("roundTrip('<pre>&#61;\\n</pre>')", "'<pre>=\\n</pre>'");
17 shouldBe("roundTrip('<pre><a></a></pre>')", "'<pre><a></a></pre>'");
18 shouldBe("roundTrip('<pre><a>\\n</a></pre>')", "'<pre><a>\\n</a></pre>'");
19 shouldBe("roundTrip('<pre>\\n<a></a></pre>')", "'<pre><a></a></pre>'");
20 shouldBe("roundTrip('<pre>\\n<a>\\n</a></pre>')", "'<pre><a>\\n</a></pre>'");
22 shouldBe("roundTrip('<listing></listing>')", "'<listing></listing>'");
23 shouldBe("roundTrip('<listing>\\n</listing>')", "'<listing></listing>'");
24 shouldBe("roundTrip('<listing>\\n\\n</listing>')", "'<listing>\\n</listing>'");
25 shouldBe("roundTrip('<listing>x\\n</listing>')", "'<listing>x\\n</listing>'");
26 shouldBe("roundTrip('<listing>&lt;\\n</listing>')", "'<listing>&lt;\\n</listing>'");
27 shouldBe("roundTrip('<listing>&#61;\\n</listing>')", "'<listing>=\\n</listing>'");
28 shouldBe("roundTrip('<listing><a></a></listing>')", "'<listing><a></a></listing>'");
29 shouldBe("roundTrip('<listing><a>\\n</a></listing>')", "'<listing><a>\\n</a></listing>'");
30 shouldBe("roundTrip('<listing>\\n<a></a></listing>')", "'<listing><a></a></listing>'");
31 shouldBe("roundTrip('<listing>\\n<a>\\n</a></listing>')", "'<listing><a>\\n</a></listing>'");
33 shouldBe("roundTrip('<div></div>')", "'<div></div>'");
34 shouldBe("roundTrip('<div>\\n</div>')", "'<div>\\n</div>'");
35 shouldBe("roundTrip('<div>\\n\\n</div>')", "'<div>\\n\\n</div>'");
36 shouldBe("roundTrip('<div>x\\n</div>')", "'<div>x\\n</div>'");
37 shouldBe("roundTrip('<div>&lt;\\n</div>')", "'<div>&lt;\\n</div>'");
38 shouldBe("roundTrip('<div>&#61;\\n</div>')", "'<div>=\\n</div>'");
39 shouldBe("roundTrip('<div><a></a></div>')", "'<div><a></a></div>'");
40 shouldBe("roundTrip('<div><a>\\n</a></div>')", "'<div><a>\\n</a></div>'");
41 shouldBe("roundTrip('<div>\\n<a></a></div>')", "'<div>\\n<a></a></div>'");
42 shouldBe("roundTrip('<div>\\n<a>\\n</a></div>')", "'<div>\\n<a>\\n</a></div>'");