Closed Bug 599744 Opened 14 years ago Closed 14 years ago

Dom range and selection demo fails if no selected text with an uncaught exception 0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: scoobidiver, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: ietestdrive)

Build : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b7pre) Gecko/20100926 Firefox/4.0b7pre

This demo fails whatever the change : color, font family, text size, language.

Each time a selection is done, the following error is displayed in the error console :
Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsISelection.getRangeAt]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: http://ie.microsoft.com/testdrive/HTML5/60Editor/Default.html :: onclick :: line 1"  data: no]
This worksforme in a 2010-09-26 Mac trunk build.....
Whiteboard: ietestdrive
This demo changed and does not work for me.

Now, the error on Web console is:
Exception: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount"  code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)"  location: "http://ie.microsoft.com/testdrive/HTML5/Editor/ Line: 1"] Source File:  Line: 0, Column: 0 Category: content javascript
Component: General → DOM
QA Contact: general → general
Summary: Dom range and selection demo fails with an uncaught exception 0x80070057 → Dom range and selection demo fails with an uncaught exception 0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)
WFM. Did you select something before clicking the link?

(The new exception is due to bug 589621.)
> WFM. Did you select something before clicking the link?
Yes. As stated in comment 0, I clicked on any link in that page.
Blocks: 589621
The point is that this is exactly what would happen if no text was highlighted. In that case, window.getSelection() would be empty, and window.getSelection().getRangeAt(0) would throw the exceptions you've seen.

I can't reproduce with 32bit WinXP either; we don't remove the selection when clicking on Win7, do we?
With selected text, it works. Without a selection, there is an error in the Web console. I didn't read well your question in comment 3.
It is the expected behavior.
No longer blocks: 589621
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Summary: Dom range and selection demo fails with an uncaught exception 0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR) → Dom range and selection demo fails if no selected text with an uncaught exception 0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)
Okay. (I have to admit that I only realized that I had to highlight something after reading the source, myself.)
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.