mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 719518 - Selection.extend() with no ranges should throw standard exception type; r=ehsan
This commit is contained in:
parent
0435827509
commit
d0cb80ca7b
@ -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
|
||||
|
@ -128,6 +128,7 @@ _TEST_FILES = \
|
||||
test_selection_splitText-normalize.html \
|
||||
test_bug524925.html \
|
||||
test_bug719503.html \
|
||||
test_bug719518.html \
|
||||
$(NULL)
|
||||
|
||||
_CHROME_FILES = \
|
||||
|
24
layout/generic/test/test_bug719518.html
Normal file
24
layout/generic/test/test_bug719518.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=719518
|
||||
-->
|
||||
<title>Test for Bug 719518</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=719518">Mozilla Bug 719518</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script>
|
||||
var thrown = false;
|
||||
try {
|
||||
getSelection().extend(document.body, 0);
|
||||
} catch(e) {
|
||||
thrown = true;
|
||||
ok(e instanceof DOMException,
|
||||
"Need to throw DOMException for extend() with no ranges");
|
||||
is(e.code, DOMException.INVALID_STATE_ERR,
|
||||
"Need to throw INVALID_STATE_ERR for extend() with no ranges");
|
||||
}
|
||||
ok(thrown, "Need to throw exception for extend() with no ranges");
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user