Closed
Bug 264991
Opened 20 years ago
Closed 20 years ago
Support xforms submission replace attribute
Categories
(Core Graveyard :: XForms, enhancement)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta1
People
(Reporter: darin.moz, Assigned: darin.moz)
References
Details
Attachments
(1 file)
|
26.95 KB,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
Support xforms submission replace attribute. see file:///home/darinf/packages/xforms-spec/slice11.html#submit-event
| Assignee | ||
Comment 1•20 years ago
|
||
This patch takes a simplistic approach to xforms submission. Instead, of using a different loader for each type of replacement, I use Necko directly to load the submission response into a memory buffer (a pipe). Then I process the data in the pipe. For replace='all', I use nsIDocShell::loadStream, and for replace='instance', I use nsIDOMParser::parseFromStream. This seems to work well, and should be fine for reasonably sized responses. We may wish to optimize replace='all' in the future by calling nsIDocShell::loadStream from within OnStartRequest before all of the data has been downloaded. This would require some careful wrangling of object ownership, etc., but I think it could be done. In the future, we could also invent a way to invoke the DOM parser on a sequence of data chunks. Or, maybe we could create a special interface for that. The benefits of the current solution is that we don't have N different codepaths leading up to calling AsyncOpen. Using document.load is not a good option since it does not provide a way to configure the upload stream. And, using webnavigation.loadURI is not a good option either because it does not give us a way to abort the replacement of the current page if the resulting document is empty (that's an xforms requirement!) -- see bug 263084, which becomes somewhat obsolete by this patch.
| Assignee | ||
Updated•20 years ago
|
Attachment #162535 -
Flags: review?(bryner)
| Assignee | ||
Updated•20 years ago
|
Comment 2•20 years ago
|
||
+ // create a pipe in which to store the response hmm, wouldn't nsIStreamLoader be easier?
| Assignee | ||
Comment 3•20 years ago
|
||
(In reply to comment #2) > + // create a pipe in which to store the response > > hmm, wouldn't nsIStreamLoader be easier? yes, but the pipe uses much more optimal storage. nsIStreamLoader forces all of the content into a continguous buffer, whereas nsIDOMParser and nsIDocShell can load content from a nsIInputStream, which can be a segmented buffer (which is what nsPipe implements).
Updated•20 years ago
|
Attachment #162535 -
Flags: review?(bryner) → review+
| Assignee | ||
Comment 4•20 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•