Bug 9509 - Would like a way to pause/resume XML parsing
Summary: Would like a way to pause/resume XML parsing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks: 6058
  Show dependency treegraph
 
Reported: 2006-06-19 15:36 PDT by Anders Carlsson
Modified: 2006-06-20 14:29 PDT (History)
0 users

See Also:


Attachments
Patch (20.10 KB, patch)
2006-06-19 16:27 PDT, Anders Carlsson
mjs: review-
Details | Formatted Diff | Diff
Address comments (20.42 KB, patch)
2006-06-20 09:08 PDT, Anders Carlsson
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2006-06-19 15:36:44 PDT
This is needed to be able to load external DTD definitions without blocking, as well as external scripts (if a <script src=""> tag is encountered, parsing should pause until the file has loaded and then resume.
Comment 1 Anders Carlsson 2006-06-19 16:27:22 PDT
Created attachment 8925 [details]
Patch

Unfortunately there's no way to pause/resume the libxml SAX parser (it's possible with expat) so a rather kludgey workaround is used. I've verified that it works by calling pause before parsing and resume inside ::finish.
Comment 2 Maciej Stachowiak 2006-06-20 02:41:01 PDT
Comment on attachment 8925 [details]
Patch

On the substance this looks ok, but I think it would be better to use subclasses instead of just a tagged union for PendingCallbacks, this would allow elimination of most of the switch statements also. Suggest rewriting along theselines.
Comment 3 Anders Carlsson 2006-06-20 09:08:04 PDT
Created attachment 8933 [details]
Address comments
Comment 4 Geoffrey Garen 2006-06-20 14:24:47 PDT
Comment on attachment 8933 [details]
Address comments

union gone. band happy. r me.