Closed Bug 16569 Opened 25 years ago Closed 25 years ago

substringData throws exception when offset==length

Categories

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

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 9777

People

(Reporter: dbaron, Assigned: waqar)

Details

DESCRIPTION:  Text::substringData() should only throw an exception when offset >
Text::length, not when offset == Text::length.  This is very similar to
bug 9777.

The problem should be fixed by changing the ">=" currently at
http://lxr.mozilla.org/mozilla/source/layout/base/src/nsGenericDOMDataNode.cpp#288
to a ">".

STEPS TO REPRODUCE:
 * Load http://www.fas.harvard.edu/~dbaron/dom/test/one-core-xml/Text
 * Press the button

ACTUAL RESULTS:
 * It stops after 7 lines of output and an exception is seen in the text window.

EXPECTED RESULTS:
 * much more output
 * no exception

DOES NOT WORK CORRECTLY ON:
 * Linux, apprunner, 1999-10-15-11-M11
Assignee: vidur → waqar
Waqar, this should be dealt with by your recent checkin. Please confirm and
close the bug.
This is actually a different bug, but it's a similar one-line fix.
OK, it is fixed, I think.  I was looking at the source code, and for some reason
LXR is showing the old code, but CVS blame is showing me the right thing.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
splitText internally uses substringData, so it was the same bug.  For some
reason LXR is returning old code, and I saw this bug looking at the code and
thought it wasn't fixed.

It's fixed now anyway.

*** This bug has been marked as a duplicate of 9777 ***
VERIFY dupe
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.