Closed
Bug 47221
Opened 25 years ago
Closed 25 years ago
adding datasource after load fails
Categories
(Core :: XPConnect, defect, P3)
Tracking
()
VERIFIED
INVALID
People
(Reporter: joe, Assigned: joe)
Details
Adding a datasource to a tree immediately after calling GetDataSource works.
However, if you wait for the datasource to have loaded, and then add it to the
tree, nothing happens.
Pretty straightforward test case coming in a segundo....
| Assignee | ||
Comment 2•25 years ago
|
||
Files are at:
http://www.joehewitt.com/mozilla/testcases/47221
My stupid web host company doesn't have the xul mime type in so you can't go
straight to the file (main.xul) but you can save the files to a folder and it'll
work. Sorry about that.
Comment 3•25 years ago
|
||
Add "flex='1'" to your <treechildren> tag.
Status: UNCONFIRMED → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
| Assignee | ||
Comment 4•25 years ago
|
||
Chris, that unfortunately does not fix the problem. It's true that I omitted
the flex attribute, but adding it back in does not help. Try running the demo
and see.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
Comment 5•25 years ago
|
||
I see this error using a debug build:
Document file:///d|/bugs/main.xul loaded successfully
observer: onEndLoad
************************************************************
** NOTE: This report will only be printed in DEBUG builds.**
* Call to xpconnect wrapped JSObject produced this error: *
[Exception... "Access to XPConnect service denied.
[nsIRDFXMLSinkObserver::onEndLoad]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]
************************************************************
Furthermore, if I move the files to the "chrome" directory (e.g.,
$(DIST)/bin/chrome/packages/widget-toolkit/global/content) and load from a
"chrome:" URL, everything works fine.
jband & mstoltz might know why XPConnect doesn't want to call into JS here,
even though UniversalXPConnect has been enabled...
Assignee: waterson → jband
Status: UNCONFIRMED → NEW
Component: XP Toolkit/Widgets → XPConnect
Ever confirmed: true
QA Contact: jrgm → pschwartau
Comment 6•25 years ago
|
||
No, false == "UniversalXPConnect has been enabled"
The code gets the UniversalXPConnect privilege to run the loadResultSetPost
function. The error happens when observer.onEndLoad() gets called sometime
later. The privilege does not bind to the object for its lifetime. The privilege
is stack scoped. You have to ask again in observer.onEndLoad.
Assignee: jband → joe
| Assignee | ||
Comment 7•25 years ago
|
||
I guess this isn't a bug, then.
I am a bit surprised to find out that I have to enable XPConnect in each
scope. I did try once enabling in the global section of code but that didn't
work. Any particular reason why priviledges need to be re-enabled per scope
rather than once per application lifetime?
| Assignee | ||
Comment 8•25 years ago
|
||
jband is correct. enabling XPConnect after onEndLoad repairs the problem.
Status: NEW → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → INVALID
Comment 9•25 years ago
|
||
Privileges are bound to scope because this limits the amount of privileged code.
Any code for which privileges are enabled must be reviewed carefully for
security; enabling privileges only in the function where they are needed
minimizes the security-critical code sections.
You need to log in
before you can comment on or make changes to this bug.
Description
•