Closed
Bug 330252
Opened 19 years ago
Closed 19 years ago
Expose a .getInstanceDoc() on instance element
Categories
(Core Graveyard :: XForms, enhancement)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: allan, Assigned: surkov)
References
()
Details
(Keywords: fixed1.8.0.4, fixed1.8.1)
Attachments
(2 files, 1 obsolete file)
If you via script run through a document, find an instance element and want to inspect its instance document, you have to note its ID and then go to the model element to ask for the instance document via the ID. It seems a bit awkward to me.
How about creating a scriptable function that returns the document directly on the instance itself?
interface nsIXFormsInstanceElement : nsISupports {
nsIDOMDocument getInstanceDocument();
}
And yes, somebody (I...) should make an effort to push some of these extensions to the WG...
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #214869 -
Flags: review?(allan)
Assignee | ||
Comment 2•19 years ago
|
||
Reporter | ||
Comment 3•19 years ago
|
||
Comment on attachment 214869 [details] [diff] [review]
patch
>+[scriptable, uuid(80669B92-8331-4f92-AAF8-06E80E6827B3)]
I think this needs to be small caps.
Change nsIInstanceElementPrivate to have a setInstanceDocument() function instead of the current attribute, and (naturally) change the callers. We should only have one function for getting the document.
(and remember to create a new uuid for nsIInstanceElementPrivate then).
Attachment #214869 -
Flags: review?(allan) → review-
Comment 4•19 years ago
|
||
Do we need a security check - only allow getInstanceDoc to work if the same-origin check succeeds?
js could then access documents from any domain using this...
(In reply to comment #4)
> Do we need a security check - only allow getInstanceDoc to work if the
> same-origin check succeeds?
>
> js could then access documents from any domain using this...
>
A .js author trying to use getInstanceDoc() will only be able to get the same instance document that XForms already loaded (and which the script author already has access to via model.getInstanceDocument('id')). XForms uses the CheckSameOrigin code in nsXFormsInstanceElement::LoadExternalInstance (http://lxr.mozilla.org/mozilla/source/extensions/xforms/nsXFormsInstanceElement.cpp#510) so we already offer some level of protection for the user from cross domain instance loading.
Assignee | ||
Comment 6•19 years ago
|
||
Attachment #214869 -
Attachment is obsolete: true
Attachment #214968 -
Flags: review?(allan)
Assignee | ||
Updated•19 years ago
|
Attachment #214968 -
Flags: review?(aaronr)
Reporter | ||
Comment 7•19 years ago
|
||
Comment on attachment 214968 [details] [diff] [review]
patch2
yessir. r=me
Attachment #214968 -
Flags: review?(allan) → review+
Reporter | ||
Updated•19 years ago
|
Assignee: aaronr → surkov
Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
Comment on attachment 214968 [details] [diff] [review]
patch2
nice
Attachment #214968 -
Flags: review?(aaronr) → review+
checked into trunk for surkov
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch
Reporter | ||
Updated•19 years ago
|
Keywords: fixed1.8.0.3,
fixed1.8.1
Reporter | ||
Updated•19 years ago
|
Whiteboard: xf-to-branch
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
•