Closed Bug 40917 Opened 25 years ago Closed 25 years ago

nsDocument::GetDoctype() fails if doctype not first node

Categories

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

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: hjtoi-bugzilla, Assigned: jst)

Details

(Whiteboard: nsbeta2+)

There is a small typo in the for loop that goes through the prolog looking for doctype node: we always get the 0th node!
This is embarrassing, nsbeta2+ please? Index: layout/base/src/nsDocument.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/base/src/nsDocument.cpp,v retrieving revision 3.218 diff -u -r3.218 nsDocument.cpp --- nsDocument.cpp 2000/05/27 22:39:39 3.218 +++ nsDocument.cpp 2000/05/29 17:44:58 @@ -1983,7 +1983,7 @@ PRInt32 i, count = mProlog->Count(); for (i = 0; i < count; i++) { - nsIContent* content = (nsIContent *)mProlog->ElementAt(0); + nsIContent* content = (nsIContent *)mProlog->ElementAt(i); if (!content) continue;
Status: NEW → ASSIGNED
In support of getting this fix in for nsbeta2: this will probably break some things in Composer which rely on GetDoctype (when editing a file with the doctype not the first node)
No need for embarassment -- nsbeta2+ approved.
Whiteboard: nsbeta2+
QA Contact: gerardok → janc
Thanks Rick, fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
sounds like a code fix. heikki, can you verify?
Marking verified.
Status: RESOLVED → VERIFIED
Flags: in-testsuite-
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.