From e9f5626ad7e7795827822363f89093e4dc3a5006 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 14 Mar 2012 14:27:30 -0400 Subject: [PATCH] Bug 719518 - Selection.extend() with no ranges should throw standard exception type; r=ehsan --- layout/generic/nsSelection.cpp | 2 +- layout/generic/test/Makefile.in | 1 + layout/generic/test/test_bug719518.html | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 layout/generic/test/test_bug719518.html diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 45364479f1be..6b962a6fc463 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -5081,7 +5081,7 @@ nsTypedSelection::Extend(nsINode* aParentNode, PRInt32 aOffset) // First, find the range containing the old focus point: if (!mAnchorFocusRange) - return NS_ERROR_NOT_INITIALIZED; + return NS_ERROR_DOM_INVALID_STATE_ERR; if (!mFrameSelection) return NS_ERROR_NOT_INITIALIZED; // Can't do selection diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index c6e187634bc5..5cc222c6014f 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -128,6 +128,7 @@ _TEST_FILES = \ test_selection_splitText-normalize.html \ test_bug524925.html \ test_bug719503.html \ + test_bug719518.html \ $(NULL) _CHROME_FILES = \ diff --git a/layout/generic/test/test_bug719518.html b/layout/generic/test/test_bug719518.html new file mode 100644 index 000000000000..64e65104422b --- /dev/null +++ b/layout/generic/test/test_bug719518.html @@ -0,0 +1,24 @@ + + +Test for Bug 719518 + + +Mozilla Bug 719518 +

+ +
+