Closed Bug 294115 Opened 20 years ago Closed 18 years ago

[FIX]Eliminate the DummyParserRequest

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

I think we can replace the DummyParserRequest with blocking onload via the
nsIDocument api I added in bug 293818.  Need to deal with Cancel(), though; I
think expected behavior on pressing the stop button is in fact that nothing else
will be parsed.  So we may want to terminate the parser even when just
STOP_NETWORK is done (right now we do it for STOP_CONTENT).  Then we can nix
this class altogether.
Priority: -- → P1
Target Milestone: --- → mozilla1.9alpha
Attached patch Proposed patch (obsolete) — Splinter Review
I decided to not worry about Cancel().  Right now it only cancels the parser if we're under the event loop; if we're under parsing (e.g. inline script) it doesn't.  The parser will cancel itself anyway once it gets the OnStopRequest from necko, unless it's already buffered up the whole document...

If we decide we do want to cancel, we can add this to nsDocShell::Stop:

        if (mContentViewer) {
            // Terminate the parser, in case it hasn't happened yet
            nsCOMPtr<nsIDocument> doc;
            mContentViewer->GetDocument(getter_AddRefs(doc));
            if (doc) {
                doc->StopDocumentLoad();
            }
        }
Attachment #254093 - Flags: superreview?(jst)
Attachment #254093 - Flags: review?(mrbkap)
Summary: Eliminate the DummyParserRequest → [FIX]Eliminate the DummyParserRequest
Comment on attachment 254093 [details] [diff] [review]
Proposed patch

Seems reasonable.
Attachment #254093 - Flags: review?(mrbkap) → review+
Comment on attachment 254093 [details] [diff] [review]
Proposed patch

Yay, less code! Looks good. sr=jst
Attachment #254093 - Flags: superreview?(jst) → superreview+
Attached patch Updated to tipSplinter Review
Attachment #254093 - Attachment is obsolete: true
Fixed.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Does the code added in this bug still serve a purpose considering that nsDocument::BeginLoad() and nsDocument::EndLoad() block and unblock onload?
Good question.  Maybe not.  Are there cases when DropParserAndPerfHint happen after the content-loaded events fire?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: