Add a bunch more whitespace tests
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 22 Sep 2011 15:13:34 -0600
changeset 622 b94bc4cceb61
parent 621 04045f3f196c
child 623 e65c152295e3
Add a bunch more whitespace tests

These test that whitespace normalization behaves per spec for different
values of the CSS white-space property.
conformancetest/data.js
tests.js
--- a/conformancetest/data.js	Thu Sep 22 15:01:28 2011 -0600
+++ b/conformancetest/data.js	Thu Sep 22 15:13:34 2011 -0600
@@ -2207,6 +2207,206 @@
 	[["stylewithcss","true"],["delete",""]],
 	"<p>foo{}bar</p>",
 	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]</pre>",
+	[["stylewithcss","false"],["delete",""]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]</pre>",
+	[["stylewithcss","true"],["delete",""]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<pre>&nbsp;[] foo</pre>",
+	[["stylewithcss","false"],["delete",""]],
+	"<pre>{} foo</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<pre>&nbsp;[] foo</pre>",
+	[["stylewithcss","true"],["delete",""]],
+	"<pre>{} foo</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]bar</pre>",
+	[["stylewithcss","false"],["delete",""]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]bar</pre>",
+	[["stylewithcss","true"],["delete",""]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo&nbsp; []bar</pre>",
+	[["stylewithcss","false"],["delete",""]],
+	"<pre>foo&nbsp;[]bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo&nbsp; []bar</pre>",
+	[["stylewithcss","true"],["delete",""]],
+	"<pre>foo&nbsp;[]bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo  []bar</pre>",
+	[["stylewithcss","false"],["delete",""]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<pre>foo  []bar</pre>",
+	[["stylewithcss","true"],["delete",""]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>&nbsp;[] foo</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre\">{} foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>&nbsp;[] foo</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre\">{} foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo&nbsp; []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre\">foo&nbsp;[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo&nbsp; []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre\">foo&nbsp;[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo  []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo  []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>&nbsp;[] foo</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">{} foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>&nbsp;[] foo</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">{} foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo&nbsp; []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo&nbsp;[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo&nbsp; []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo&nbsp;[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo  []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo  []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>&nbsp;[] foo</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-line\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>&nbsp;[] foo</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-line\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo&nbsp; []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo&nbsp; []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo  []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo  []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:pre-line\">foo[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>&nbsp;[] foo</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:nowrap\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>&nbsp;[] foo</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:nowrap\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo&nbsp; []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo&nbsp; []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo  []bar</div>",
+	[["stylewithcss","false"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"delete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo  []bar</div>",
+	[["stylewithcss","true"],["delete",""]],
+	"<div style=\"white-space:nowrap\">foo[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"delete":[false,false,"",false,false,""]}],
 ["foo<table><tr><td>[]bar</table>baz",
 	[["stylewithcss","false"],["delete",""]],
 	"foo<table><tbody><tr><td>[]bar</td></tr></tbody></table>baz",
@@ -8375,6 +8575,206 @@
 	[["stylewithcss","true"],["forwarddelete",""]],
 	"<b>foo[]</b>bar",
 	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo []&nbsp;</pre>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo []&nbsp;</pre>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>[]&nbsp; foo</pre>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<pre>{} foo</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>[]&nbsp; foo</pre>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<pre>{} foo</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[] &nbsp;bar</pre>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<pre>foo[]&nbsp;bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[] &nbsp;bar</pre>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<pre>foo[]&nbsp;bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[]&nbsp; bar</pre>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<pre>foo[] bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[]&nbsp; bar</pre>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<pre>foo[] bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[]  bar</pre>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<pre>foo[] bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<pre>foo[]  bar</pre>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<pre>foo[] bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo []&nbsp;</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo []&nbsp;</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>[]&nbsp; foo</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">{} foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>[]&nbsp; foo</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">{} foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[] &nbsp;bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[]&nbsp;bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[] &nbsp;bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[]&nbsp;bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]&nbsp; bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]&nbsp; bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]  bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]  bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo []&nbsp;</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo []&nbsp;</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>[]&nbsp; foo</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">{} foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>[]&nbsp; foo</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">{} foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[] &nbsp;bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[]&nbsp;bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[] &nbsp;bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[]&nbsp;bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]&nbsp; bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]&nbsp; bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]  bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]  bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-wrap\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo []&nbsp;</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo []&nbsp;</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>[]&nbsp; foo</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>[]&nbsp; foo</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[] &nbsp;bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[] &nbsp;bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]&nbsp; bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]&nbsp; bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]  bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]  bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:pre-line\">foo[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo []&nbsp;</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo []&nbsp;</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>[]&nbsp; foo</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>[]&nbsp; foo</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">{}&nbsp;foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[] &nbsp;bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[] &nbsp;bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]&nbsp; bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]&nbsp; bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]  bar</div>",
+	[["stylewithcss","false"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[]bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"forwarddelete":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]  bar</div>",
+	[["stylewithcss","true"],["forwarddelete",""]],
+	"<div style=\"white-space:nowrap\">foo[]bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"forwarddelete":[false,false,"",false,false,""]}],
 ["foo[]<table><tr><td>bar</table>baz",
 	[["stylewithcss","false"],["forwarddelete",""]],
 	"foo{<table><tbody><tr><td>bar</td></tr></tbody></table>}baz",
@@ -16127,77 +16527,69 @@
 	[["stylewithcss","true"],["inserttext"," "]],
 	"foo []<b>bar</b>",
 	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>foo[]</pre>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<pre>foo []</pre>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>foo[]</pre>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<pre>foo []</pre>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>[]foo</pre>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<pre> []foo</pre>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>[]foo</pre>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<pre> []foo</pre>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>foo []bar</pre>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<pre>foo  []bar</pre>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<pre>foo []bar</pre>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<pre>foo  []bar</pre>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>foo[]</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre\">foo []</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>foo[]</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre\">foo []</span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>[]foo</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre\"> []foo</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>[]foo</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre\"> []foo</span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>foo []bar</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre\">foo  []bar</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre>foo []bar</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre\">foo  []bar</span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>foo[]</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\">foo []</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>foo[]</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\">foo []</span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>[]foo</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\"> []foo</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>[]foo</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\"> []foo</span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>foo []bar</span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\">foo  []bar</span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span style=white-space:pre-wrap>foo []bar</span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span style=\"white-space:pre-wrap\">foo  []bar</span>",
+["foo[] ",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"foo&nbsp;[]",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["foo[] ",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"foo&nbsp;[]",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+[" foo   []   ",
+	[["stylewithcss","false"],["inserttext"," "]],
+	" foo&nbsp;[]",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+[" foo   []   ",
+	[["stylewithcss","true"],["inserttext"," "]],
+	" foo&nbsp;[]",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["foo[]<span> </span>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"foo&nbsp;[]<span> </span>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["foo[]<span> </span>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"foo&nbsp;[]<span> </span>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["foo[]<span> </span> ",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"foo&nbsp;[]<span> </span> ",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["foo[]<span> </span> ",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"foo&nbsp;[]<span> </span> ",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+[" []foo",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"&nbsp;[]foo",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+[" []foo",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"&nbsp;[]foo",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["   []   foo ",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"&nbsp;[]foo ",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["   []   foo ",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"&nbsp;[]foo ",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<span> </span>[]foo",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<span> </span>&nbsp;[]foo",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<span> </span>[]foo",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<span> </span>&nbsp;[]foo",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+[" <span> </span>[]foo",
+	[["stylewithcss","false"],["inserttext"," "]],
+	" <span> </span>&nbsp;[]foo",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+[" <span> </span>[]foo",
+	[["stylewithcss","true"],["inserttext"," "]],
+	" <span> </span>&nbsp;[]foo",
 	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
 ["{}<br>",
 	[["stylewithcss","false"],["inserttext"," "]],
@@ -16239,6 +16631,326 @@
 	[["stylewithcss","true"],["inserttext"," "]],
 	"<p>foo&nbsp;[]</p><p>&nbsp;bar</p>",
 	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[]bar</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[]bar</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo []bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo []bar</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo  []bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo []bar</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo  []bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[] bar</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo [] bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[] bar</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo [] bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]bar</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo &nbsp; []bar</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo &nbsp;[]bar</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo &nbsp; []bar</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>[]foo</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre> []foo</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>[]foo</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre> []foo</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[]</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo[]</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo []</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo&nbsp;[]</pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre>foo&nbsp; []</pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre>foo&nbsp;[]</pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre>foo&nbsp; []</pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre> foo   []   </pre>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<pre> foo    []   </pre>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<pre> foo   []   </pre>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<pre> foo    []   </pre>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo []bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo  []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo []bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo  []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[] bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo [] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[] bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo [] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>[]foo</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\"> []foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>[]foo</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\"> []foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo&nbsp;[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo&nbsp; []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre>foo&nbsp;[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\">foo&nbsp; []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre> foo   []   </div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre\"> foo    []   </div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre> foo   []   </div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre\"> foo    []   </div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo []bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo  []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo []bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo  []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[] bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo [] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[] bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo [] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>[]foo</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\"> []foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>[]foo</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\"> []foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo&nbsp;[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo&nbsp; []</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap>foo&nbsp;[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\">foo&nbsp; []</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap> foo   []   </div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\"> foo    []   </div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-wrap> foo   []   </div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-wrap\"> foo    []   </div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo []bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo []bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[] bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[] bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>[]foo</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">&nbsp;[]foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>[]foo</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">&nbsp;[]foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo&nbsp;[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo &nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line>foo&nbsp;[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\">foo &nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line> foo   []   </div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\"> foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:pre-line> foo   []   </div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:pre-line\"> foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo []bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo []bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[] bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[] bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[] bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[] bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo &nbsp;[]bar</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo &nbsp; []bar</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>[]foo</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">&nbsp;[]foo</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>[]foo</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">&nbsp;[]foo</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo&nbsp;[]</div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo &nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap>foo&nbsp;[]</div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\">foo &nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap> foo   []   </div>",
+	[["stylewithcss","false"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\"> foo&nbsp;[]</div>",
+	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
+["<div style=white-space:nowrap> foo   []   </div>",
+	[["stylewithcss","true"],["inserttext"," "]],
+	"<div style=\"white-space:nowrap\"> foo&nbsp;[]</div>",
+	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
 ["foo[]",
 	[["stylewithcss","false"],["inserttext","   "]],
 	"foo &nbsp;&nbsp;[]",
@@ -17015,70 +17727,6 @@
 	[["stylewithcss","true"],["inserttext","a"]],
 	"<blockquote><font color=\"blue\">a[]</font></blockquote>",
 	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[] ",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"foo&nbsp;[]",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[] ",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"foo&nbsp;[]",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-[" foo   []   ",
-	[["stylewithcss","false"],["inserttext"," "]],
-	" foo&nbsp;[]",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-[" foo   []   ",
-	[["stylewithcss","true"],["inserttext"," "]],
-	" foo&nbsp;[]",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[]<span> </span>",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"foo&nbsp;[]<span> </span>",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[]<span> </span>",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"foo&nbsp;[]<span> </span>",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[]<span> </span> ",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"foo&nbsp;[]<span> </span> ",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["foo[]<span> </span> ",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"foo&nbsp;[]<span> </span> ",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-[" []foo",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"&nbsp;[]foo",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-[" []foo",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"&nbsp;[]foo",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["   []   foo ",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"&nbsp;[]foo ",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["   []   foo ",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"&nbsp;[]foo ",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-["<span> </span>[]foo",
-	[["stylewithcss","false"],["inserttext"," "]],
-	"<span> </span>&nbsp;[]foo",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-["<span> </span>[]foo",
-	[["stylewithcss","true"],["inserttext"," "]],
-	"<span> </span>&nbsp;[]foo",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
-[" <span> </span>[]foo",
-	[["stylewithcss","false"],["inserttext"," "]],
-	" <span> </span>&nbsp;[]foo",
-	{"stylewithcss":[false,true,"",false,false,""],"inserttext":[false,false,"",false,false,""]}],
-[" <span> </span>[]foo",
-	[["stylewithcss","true"],["inserttext"," "]],
-	" <span> </span>&nbsp;[]foo",
-	{"stylewithcss":[false,false,"",false,true,""],"inserttext":[false,false,"",false,false,""]}],
 ["foo[]bar",
 	[["stylewithcss","false"],["insertunorderedlist",""]],
 	"<ul><li>foo[]bar</li></ul>",
--- a/tests.js	Thu Sep 22 15:01:28 2011 -0600
+++ b/tests.js	Thu Sep 22 15:13:34 2011 -0600
@@ -373,6 +373,36 @@
 		'<b>foo </b> []bar',
 		'<p>foo </p><p>[] bar</p>',
 
+		'<pre>foo &nbsp;[]</pre>',
+		'<pre>&nbsp;[] foo</pre>',
+		'<pre>foo &nbsp;[]bar</pre>',
+		'<pre>foo&nbsp; []bar</pre>',
+		'<pre>foo  []bar</pre>',
+
+		'<div style=white-space:pre>foo &nbsp;[]</div>',
+		'<div style=white-space:pre>&nbsp;[] foo</div>',
+		'<div style=white-space:pre>foo &nbsp;[]bar</div>',
+		'<div style=white-space:pre>foo&nbsp; []bar</div>',
+		'<div style=white-space:pre>foo  []bar</div>',
+
+		'<div style=white-space:pre-wrap>foo &nbsp;[]</div>',
+		'<div style=white-space:pre-wrap>&nbsp;[] foo</div>',
+		'<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>',
+		'<div style=white-space:pre-wrap>foo&nbsp; []bar</div>',
+		'<div style=white-space:pre-wrap>foo  []bar</div>',
+
+		'<div style=white-space:pre-line>foo &nbsp;[]</div>',
+		'<div style=white-space:pre-line>&nbsp;[] foo</div>',
+		'<div style=white-space:pre-line>foo &nbsp;[]bar</div>',
+		'<div style=white-space:pre-line>foo&nbsp; []bar</div>',
+		'<div style=white-space:pre-line>foo  []bar</div>',
+
+		'<div style=white-space:nowrap>foo &nbsp;[]</div>',
+		'<div style=white-space:nowrap>&nbsp;[] foo</div>',
+		'<div style=white-space:nowrap>foo &nbsp;[]bar</div>',
+		'<div style=white-space:nowrap>foo&nbsp; []bar</div>',
+		'<div style=white-space:nowrap>foo  []bar</div>',
+
 		// Tables with collapsed selection
 		'foo<table><tr><td>[]bar</table>baz',
 		'foo<table><tr><td>bar</table>[]baz',
@@ -1286,6 +1316,36 @@
 		'<b>foo[]&nbsp;</b>&nbsp;bar',
 		'<b>foo[] </b> bar',
 
+		'<pre>foo []&nbsp;</pre>',
+		'<pre>[]&nbsp; foo</pre>',
+		'<pre>foo[] &nbsp;bar</pre>',
+		'<pre>foo[]&nbsp; bar</pre>',
+		'<pre>foo[]  bar</pre>',
+
+		'<div style=white-space:pre>foo []&nbsp;</div>',
+		'<div style=white-space:pre>[]&nbsp; foo</div>',
+		'<div style=white-space:pre>foo[] &nbsp;bar</div>',
+		'<div style=white-space:pre>foo[]&nbsp; bar</div>',
+		'<div style=white-space:pre>foo[]  bar</div>',
+
+		'<div style=white-space:pre-wrap>foo []&nbsp;</div>',
+		'<div style=white-space:pre-wrap>[]&nbsp; foo</div>',
+		'<div style=white-space:pre-wrap>foo[] &nbsp;bar</div>',
+		'<div style=white-space:pre-wrap>foo[]&nbsp; bar</div>',
+		'<div style=white-space:pre-wrap>foo[]  bar</div>',
+
+		'<div style=white-space:pre-line>foo []&nbsp;</div>',
+		'<div style=white-space:pre-line>[]&nbsp; foo</div>',
+		'<div style=white-space:pre-line>foo[] &nbsp;bar</div>',
+		'<div style=white-space:pre-line>foo[]&nbsp; bar</div>',
+		'<div style=white-space:pre-line>foo[]  bar</div>',
+
+		'<div style=white-space:nowrap>foo []&nbsp;</div>',
+		'<div style=white-space:nowrap>[]&nbsp; foo</div>',
+		'<div style=white-space:nowrap>foo[] &nbsp;bar</div>',
+		'<div style=white-space:nowrap>foo[]&nbsp; bar</div>',
+		'<div style=white-space:nowrap>foo[]  bar</div>',
+
 		// Tables with collapsed selection
 		'foo[]<table><tr><td>bar</table>baz',
 		'foo<table><tr><td>bar[]</table>baz',
@@ -2298,6 +2358,10 @@
 		['\ud800', 'foo[]bar'],
 		['\x07', 'foo[]bar'],
 
+		// Whitespace tests!  The following two bugs are relevant to some of
+		// these:
+		// http://www.w3.org/Bugs/Public/show_bug.cgi?id=14119
+		// https://bugzilla.mozilla.org/show_bug.cgi?id=681626
 		[' ', 'foo[]bar'],
 		[' ', 'foo []bar'],
 		[' ', 'foo[] bar'],
@@ -2325,15 +2389,14 @@
 		[' ', '<b>foo[]</b>bar'],
 		[' ', 'foo[]<b>bar</b>'],
 
-		[' ', '<pre>foo[]</pre>'],
-		[' ', '<pre>[]foo</pre>'],
-		[' ', '<pre>foo []bar</pre>'],
-		[' ', '<span style=white-space:pre>foo[]</span>'],
-		[' ', '<span style=white-space:pre>[]foo</span>'],
-		[' ', '<span style=white-space:pre>foo []bar</span>'],
-		[' ', '<span style=white-space:pre-wrap>foo[]</span>'],
-		[' ', '<span style=white-space:pre-wrap>[]foo</span>'],
-		[' ', '<span style=white-space:pre-wrap>foo []bar</span>'],
+		[' ', 'foo[] '],
+		[' ', ' foo   []   '],
+		[' ', 'foo[]<span> </span>'],
+		[' ', 'foo[]<span> </span> '],
+		[' ', ' []foo'],
+		[' ', '   []   foo '],
+		[' ', '<span> </span>[]foo'],
+		[' ', ' <span> </span>[]foo'],
 
 		[' ', '{}<br>'],
 		[' ', '<p>{}<br>'],
@@ -2342,6 +2405,55 @@
 		[' ', '<p>foo&nbsp;[]<p>bar'],
 		[' ', '<p>foo[]<p>&nbsp;bar'],
 
+		// Some of the same tests as above, repeated with various values of
+		// white-space.
+		[' ', '<pre>foo[]bar</pre>'],
+		[' ', '<pre>foo []bar</pre>'],
+		[' ', '<pre>foo[] bar</pre>'],
+		[' ', '<pre>foo &nbsp;[]bar</pre>'],
+		[' ', '<pre>[]foo</pre>'],
+		[' ', '<pre>foo[]</pre>'],
+		[' ', '<pre>foo&nbsp;[]</pre>'],
+		[' ', '<pre> foo   []   </pre>'],
+
+		[' ', '<div style=white-space:pre>foo[]bar</div>'],
+		[' ', '<div style=white-space:pre>foo []bar</div>'],
+		[' ', '<div style=white-space:pre>foo[] bar</div>'],
+		[' ', '<div style=white-space:pre>foo &nbsp;[]bar</div>'],
+		[' ', '<div style=white-space:pre>[]foo</div>'],
+		[' ', '<div style=white-space:pre>foo[]</div>'],
+		[' ', '<div style=white-space:pre>foo&nbsp;[]</div>'],
+		[' ', '<div style=white-space:pre> foo   []   </div>'],
+
+		[' ', '<div style=white-space:pre-wrap>foo[]bar</div>'],
+		[' ', '<div style=white-space:pre-wrap>foo []bar</div>'],
+		[' ', '<div style=white-space:pre-wrap>foo[] bar</div>'],
+		[' ', '<div style=white-space:pre-wrap>foo &nbsp;[]bar</div>'],
+		[' ', '<div style=white-space:pre-wrap>[]foo</div>'],
+		[' ', '<div style=white-space:pre-wrap>foo[]</div>'],
+		[' ', '<div style=white-space:pre-wrap>foo&nbsp;[]</div>'],
+		[' ', '<div style=white-space:pre-wrap> foo   []   </div>'],
+
+		[' ', '<div style=white-space:pre-line>foo[]bar</div>'],
+		[' ', '<div style=white-space:pre-line>foo []bar</div>'],
+		[' ', '<div style=white-space:pre-line>foo[] bar</div>'],
+		[' ', '<div style=white-space:pre-line>foo &nbsp;[]bar</div>'],
+		[' ', '<div style=white-space:pre-line>[]foo</div>'],
+		[' ', '<div style=white-space:pre-line>foo[]</div>'],
+		[' ', '<div style=white-space:pre-line>foo&nbsp;[]</div>'],
+		[' ', '<div style=white-space:pre-line> foo   []   </div>'],
+
+		[' ', '<div style=white-space:nowrap>foo[]bar</div>'],
+		[' ', '<div style=white-space:nowrap>foo []bar</div>'],
+		[' ', '<div style=white-space:nowrap>foo[] bar</div>'],
+		[' ', '<div style=white-space:nowrap>foo &nbsp;[]bar</div>'],
+		[' ', '<div style=white-space:nowrap>[]foo</div>'],
+		[' ', '<div style=white-space:nowrap>foo[]</div>'],
+		[' ', '<div style=white-space:nowrap>foo&nbsp;[]</div>'],
+		[' ', '<div style=white-space:nowrap> foo   []   </div>'],
+
+		// End whitespace tests
+
 		['   ', 'foo[]'],
 
 		'foo[]bar',
@@ -2450,17 +2562,6 @@
 
 		// https://bugs.webkit.org/show_bug.cgi?id=19702
 		'<blockquote><font color=blue>[foo]</font></blockquote>',
-
-		// http://www.w3.org/Bugs/Public/show_bug.cgi?id=14119
-		// https://bugzilla.mozilla.org/show_bug.cgi?id=681626
-		[' ', 'foo[] '],
-		[' ', ' foo   []   '],
-		[' ', 'foo[]<span> </span>'],
-		[' ', 'foo[]<span> </span> '],
-		[' ', ' []foo'],
-		[' ', '   []   foo '],
-		[' ', '<span> </span>[]foo'],
-		[' ', ' <span> </span>[]foo'],
 	],
 	//@}
 	insertunorderedlist: [