Closed Bug 309534 Opened 19 years ago Closed 19 years ago

Pass a boolean aDidNotify to DoneAddingChildren?

Categories

(Core :: DOM: HTML Parser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: Biesinger, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 2 obsolete files)

Code added in bug 1156 would benefit from knowing whether the content sink
already notified for the content it created (so that it knows whether it has to
notify or not)
Just wondering...
When would the aDidNotify be PR_FALSE, when PR_TRUE?

Just FYI,
I think, XTF (or especially XForms) wouldn't use the parameter for anything.
Atm, it is assumed that BeginAddingChildren is called before adding any attributes
or child nodes, and DoneAddingChildren happens after those. And that
Begin/DoneAddingChildren are called only by ContentSink.
it would basically be PR_FALSE if there has not been any attempt to create
frames for this node, PR_TRUE otherwise.
Attached patch Something like this, say (obsolete) — Splinter Review
The idea is to use this in applet and object as this patch does.
Attachment #196966 - Flags: superreview?(jst)
Attachment #196966 - Flags: review?(mrbkap)
Attached patch Actually compiling (obsolete) — Splinter Review
Attachment #196970 - Flags: superreview?(jst)
Attachment #196970 - Flags: review?(mrbkap)
Attachment #196966 - Attachment is obsolete: true
Attachment #196966 - Flags: superreview?(jst)
Attachment #196966 - Flags: review?(mrbkap)
Comment on attachment 196970 [details] [diff] [review]
Actually compiling

>Index: content/html/document/src/nsHTMLContentSink.cpp
>@@ -1371,21 +1372,37 @@ SinkContext::CloseContainer(const nsHTML
>+    {
>+      PRBool notified = PR_TRUE;
>+      if (0 < mStackPos) {
>+        nsIContent* parent = mStack[mStackPos - 1].mContent;
>+        notified =
>+          mStack[mStackPos-1].mNumFlushed == parent->GetChildCount();
>+      }
>+      content->DoneAddingChildren(notified);
>+    }
...
>+    {
>+      PRBool notified = PR_TRUE;
>+      if (0 < mStackPos) {
>+        nsIContent* parent = mStack[mStackPos - 1].mContent;
>+        notified =
>+          mStack[mStackPos-1].mNumFlushed == parent->GetChildCount();
>+      }
>+      result = mSink->ProcessSCRIPTEndTag(content, notified);
>+    }

Want to break the common code out into a function or a macro or something?

r=mrbkap with that.
Attachment #196970 - Flags: review?(mrbkap) → review+
Comment on attachment 196970 [details] [diff] [review]
Actually compiling

sr=jst
Attachment #196970 - Flags: superreview?(jst) → superreview+
Assignee: mrbkap → bzbarsky
Attachment #196970 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: