Work around a minor WebKit bug
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Thu, 22 Sep 2011 14:57:21 -0600
changeset 620 ba1b5b4672db
parent 619 031902d853b9
child 621 04045f3f196c
Work around a minor WebKit bug

It was causing two tests to fail to generate properly in gentest.html.
implementation.js
--- a/implementation.js	Thu Sep 22 14:39:11 2011 -0600
+++ b/implementation.js	Thu Sep 22 14:57:21 2011 -0600
@@ -7631,7 +7631,10 @@
 		canonicalizeWhitespace(getActiveRange().endContainer, getActiveRange().endOffset, false);
 
 		// "Call collapseToEnd() on the context object's Selection."
-		getSelection().collapseToEnd();
+		//
+		// Work around WebKit bug: sometimes it blows up the selection and
+		// throws, which we don't want.
+		try { getSelection().collapseToEnd(); } catch(e) {}
 		getActiveRange().collapse(false);
 	}
 };