Closed Bug 263705 Opened 21 years ago Closed 21 years ago

support multiple instances per model

Categories

(Core Graveyard :: XForms, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

Details

Attachments

(1 file)

We should support multiple instance elements per model. Instances other than the first one can be selected via the instance() xpath extension or by the getInstanceDocument() method on the model element.
Attached patch patchSplinter Review
Implement multi-instance support. Each instance now has its own InstanceElement, which handles waiting for the load event. So GetInstanceDocument works now, though the instance() xpath function remains unimplemented. The other thing this patch does is moves us away from using unfrozen Gecko API's. In a lot of ways XForms is the first real test of extending the layout engine using XTF, and if we really want that to be a viable option we're going to have to support frozen API's for doing so. In this patch I've gotten rid of _almost_ all of our usage of nsIContent and replaced it with DOM interfaces. It's a little less performant in spots, but overall I don't think it'll be too much of a killer. Here are some things I discovered while making that change: - We may want to freeze a parallel version of the DOM API that deals with nsIAtoms instead of strings. This of course means that we would have to freeze nsIAtom. - We also need to figure out what to do about properties on content nodes and documents. There's a lot more that's not frozen yet, of course, but this is a start.
Attachment #161654 - Flags: superreview?(darin)
Attachment #161654 - Flags: review?(allan)
Comment on attachment 161654 [details] [diff] [review] patch couple nits: - might be nice to #define the xforms namespace and other namespaces in a common header file (e.g., nsXForms.h). - you might be able to use nsIWebNavigation::currentURI to access the URI of the document. nsIWebNavigation is going to be frozen shortly, so that would be a good option. we just need to freeze a way to access it from a DOM document. - can nsXFormsInstanceElement.cpp use NS_IMPL_ISUPPORTSX?
Attachment #161654 - Flags: superreview?(darin) → superreview+
Also just nits from me. - nsXFormsModel::GetSubmissionFormat(nsIDOMElement *content) content -> aElement - nsXFormsModelElement.h: IsComplete() and AddPendingInstance() code should be moved to .cpp IMHO. Great work Brian.
Oh, I do have one more thing: Could you add a small JavaDoc-style comment for the new nsXFormsInstanceElement?
Comment on attachment 161654 [details] [diff] [review] patch marking + per allan's comments
Attachment #161654 - Flags: review?(allan) → review+
(In reply to comment #3) > - nsXFormsModelElement.h: > IsComplete() and AddPendingInstance() code should be moved to .cpp IMHO. I disagree, for the sake of efficiency.
checked in
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: