Closed Bug 546426 Opened 14 years ago Closed 12 years ago

Non-HTML5 speculative parser only speculates to the end of the data available when we block

Categories

(Core :: DOM: HTML Parser, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: bzbarsky, Unassigned)

Details

(Whiteboard: [browserscope])

In particular, if more data arrives while we're blocked, we won't speculatively parse it.  This is what causes us to fail on <http://stevesouders.com/efws/stylesheet-before-iframe.php>: when we block on that initial inline <script> we only have the data to about the end of the <head>, so we never speculatively parse the stylesheet and whatnot that's being tested there.
So the obvious expedient of calling nsSpeculativeScriptThread::StartParsing when more data comes in triggers the !mCurrentlyParsing assert in that method and leads to memory corruption.

Ideally, we'd pass the data over to the speculative parser safely in that situation...
And in particular, the mNumConsumed and mScanner management is what would need to change to make this work.

Maybe it's not worth worrying about, since I assume the HTML5 parser speculative parsing doesn't have problems like this?
Assignee: bzbarsky → nobody
(In reply to comment #2)
> Maybe it's not worth worrying about, since I assume the HTML5 parser
> speculative parsing doesn't have problems like this?

The HTML5 parser doesn't have the problem described in this bug.

However, currently, the HTML5 parser speculates only in the network stream and doesn't speculate in document.written content that is left waiting when an earlier document.written part blocks the parser (bug 543062). So the HTML5 parser currently has a problem "like this" is that sense.
Is this mooted by the HTML5 parser? Or is this still relevant for XML?
I don't believe we do any speculative parsing in XML.  So this is fixed by the HTML5 parser as far as I can tell.
Whiteboard: [browserscope]
Is this still an issue?
Nope.  Wontfix, since we don't use that parser for anything serious anymore.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.