Closed Bug 332644 Opened 19 years ago Closed 19 years ago

[FIX]Possible to double-notify on <head> element in HTMLContentSink

Categories

(Core :: DOM: HTML Parser, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 2 obsolete files)

Due to the way the notifications happen, esp. the "start at 1 on the stack" mess, we can end up notifying twice on the <head>. That doesn't assert right then, but asserts if the <head> is ever removed from the document... I'm going to add an assert to catch the double-notify earlier, and a fix for the actual problem.
Attached patch Fix (obsolete) — Splinter Review
I got dbaron's OK on the nsFrameManager change, so it's just the content sink changes that need reviewing. I doubt we want to risk this on branches. :(
Attachment #217118 - Flags: superreview?(peterv)
Attachment #217118 - Flags: review?(mrbkap)
Priority: -- → P2
Comment on attachment 217118 [details] [diff] [review] Fix >Index: content/html/document/src/nsHTMLContentSink.cpp >=================================================================== >+ // Note that we can start at stackPos == 0 here, because it's the caller's >+ // responsibility to handle flushing interactions between contexts (see >+ // HTMLContentSink::BeginContext). > PRInt32 stackPos = 1; Did you mean == 1 in the comment? >@@ -1790,19 +1794,20 @@ SinkContext::FlushTags(PRBool aNotify) > } > > void > SinkContext::UpdateChildCounts() > { > // Start from the top of the stack (growing upwards) and see if any 'growing downward'?
Attachment #217118 - Flags: superreview?(peterv) → superreview+
Comment on attachment 217118 [details] [diff] [review] Fix r=mrbkap with the comment changes suggested by peterv.
Attachment #217118 - Flags: review?(mrbkap) → review+
Attached patch Fixed issues (obsolete) — Splinter Review
> Did you mean == 1 in the comment? No, I meant to change the code to use 0 instead of 1. Then I was testing some more, and clearly forgot to change it back to 0. :( I guess this needs review again, with that change. :(
Attachment #217118 - Attachment is obsolete: true
Attachment #217437 - Flags: superreview?(peterv)
Attachment #217437 - Flags: review?(mrbkap)
Attachment #217437 - Flags: review?(mrbkap) → review+
Comment on attachment 217437 [details] [diff] [review] Fixed issues With bug 310985 checked in, this patch catches a bug in our notifications for head and body.... I'll update the patch.
Attachment #217437 - Flags: superreview?(peterv) → superreview-
Attachment #217437 - Attachment is obsolete: true
Attachment #218855 - Flags: superreview?(peterv)
Attachment #218855 - Flags: review?(mrbkap)
Attachment #218855 - Flags: superreview?(peterv) → superreview+
Attachment #218855 - Flags: review?(mrbkap) → review+
Fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Depends on: 339249
Depends on: 341062
Blocks: 351282
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: