Closed Bug 166752 Opened 23 years ago Closed 23 years ago

[FIX]A simple page with two forms - PageInfo reports three,

Categories

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

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.2alpha

People

(Reporter: rrkramer, Assigned: bzbarsky)

References

()

Details

(Keywords: regression)

Attachments

(1 file, 3 obsolete files)

On page with two forms the first form is duplicated as reported by View Page Info. The serious part is that javascript code such as document.forms[1].whatever fails. The DOM inspector display looks OK.
Wierd, looks like there is 3 forms document.forms[0],[1],[2]
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: A simple page with two forms - PageInfo reports three, → A simple page with two forms - PageInfo reports three,
also happens on linux trunk build 20020903 regression between 2002062713 and 2002062904
Keywords: regression
OS: Windows 2000 → All
hmmm, if i add an input to the first form, everything works corectly. this is DOM not form submission.
Assignee: alexsavulov → jst
Component: Form Submission → DOM Core
QA Contact: vladimire → stummala
If that additional input is a button, the problem remains.
bz, looks like the document.forms content list is out of whack, it puts the first form in the list twice, thus document.forms.length is 3, and not 2. Ideas?
Attached patch fix (obsolete) — Splinter Review
*** Bug 161152 has been marked as a duplicate of this bug. ***
Depends on: 144072
Comment on attachment 98088 [details] [diff] [review] fix Straightforward enough. r=jkeiser
Attachment #98088 - Flags: review+
taking
Assignee: jst → bzbarsky
Priority: -- → P1
Summary: A simple page with two forms - PageInfo reports three, → [FIX]A simple page with two forms - PageInfo reports three,
Target Milestone: --- → mozilla1.2alpha
Comment on attachment 98088 [details] [diff] [review] fix Looks fine to me too, but... >+ * We want to append instead of invalidating if the first one of >+ * the things that got appended comes after ourLastContent ... "the first one of the things" sounds a bit odd. Nix "one"? >+ nsCOMPtr<nsIDOM3Node> ourLastDOM3Node(do_QueryInterface(ourLastContent)); >+ nsCOMPtr<nsIContent> firstAppendedContent; >+ aContainer->ChildAt(aNewIndexInContainer, >+ *getter_AddRefs(firstAppendedContent)); >+ nsCOMPtr<nsIDOMNode> newNode(do_QueryInterface(firstAppendedContent)); >+ if (ourLastDOM3Node && newNode) { Getting the DOM3Node is somewhat expensive. Since you don't actually use ourLastDom3Node just yet, wouldn't it be better to delay getting that until after we know we have a newNode?
Attached patch sure thing. More like this? (obsolete) — Splinter Review
Attachment #98088 - Attachment is obsolete: true
Comment on attachment 98100 [details] [diff] [review] sure thing. More like this? bz's making a new patch that moves the newNode code into the if.
Attachment #98100 - Flags: needs-work+
Attached patch Argh. I am being dense today (obsolete) — Splinter Review
Comment on attachment 98103 [details] [diff] [review] Argh. I am being dense today r=caillon. :-)
Attachment #98103 - Flags: review+
+ * We want to append instead of invalidating if the first thing + * that that got appended comes after ourLastContent. invalidating should be invalidate that that Maybe the reviewers are dense today ;-).
Maybe. I saw the append/invalidating thing but my brain didn't flag it as wrong since it's not really that wrong. And it's late, 'that that' is just one of those optical illusions :-)
Attachment #98103 - Attachment is obsolete: true
Comment on attachment 98105 [details] [diff] [review] fix double "that", keep the correct gerund. sr=jst
Attachment #98105 - Flags: superreview+
Comment on attachment 98105 [details] [diff] [review] fix double "that", keep the correct gerund. a=asa (on behalf of drivers) for checkin to 1.2a
Attachment #98105 - Flags: approval+
fix is in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: