Closed
Bug 138295
Opened 23 years ago
Closed 23 years ago
XML Loading on Mac fails on .childNodes of non-root nodes
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.2alpha
People
(Reporter: andyed, Assigned: peterv)
References
()
Details
(Whiteboard: [adt2 RTM])
Attachments
(4 files, 3 obsolete files)
962 bytes,
text/html
|
Details | |
55 bytes,
text/xml
|
Details | |
1.10 KB,
text/html
|
Details | |
12.79 KB,
patch
|
security-bugs
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Expected behavior:
Text box contains 4 rolodex nodes (works on windows)
Observed behavior on Mac OS9/OSX:
Error: [Exception... "'Permission denied to get property NodeList.length' when
calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "" data: no]
Updated•23 years ago
|
QA Contact: petersen → rakeshmishra
Comment 1•23 years ago
|
||
changing Q/A contact
This is bizarre, works on latest Windows mozilla build, but I get the error
using Mac OSX build from last week or something...
I don't think XML is the correct component, reassigning to DOM Core and adding
mstoltz as this is security related.
Assignee: heikki → jst
Component: XML → DOM Core
QA Contact: rakeshmishra → stummala
Assignee | ||
Comment 3•23 years ago
|
||
I've seen other failures like this one on OS 9 too.
We need to check this out, we can't ship if simple DOM operations won't work on
the Mac.
Could we get the testcase in normal HTML to see if it happens in XML only (doubt
it)?
Severity: normal → major
Keywords: nsbeta1
Reporter | ||
Comment 5•23 years ago
|
||
I'll craft a XML-free test case, but I've got XBL that loops over childNodes on
the Mac successfully (http://surfmind.com/musings/categories/mozilla/).
Reporter | ||
Comment 6•23 years ago
|
||
ML free .childNodes iteration, works fine on Mac OS9.
This does seem to be an issue with XML load as opposed to general Mac DOM
operations. Email me directly if there's a further testcase which would help.
Updated•23 years ago
|
Assignee | ||
Comment 7•23 years ago
|
||
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
Ok, so when opening attachment 80932 [details] on Mac I get an exception "Permission
denied to get property NodeList.length", while on Windows and Linux accessing
.length just gives the right value (0). I have no idea what is going on here.
I'm adding the XPConnect folks too, right now I'm stuck and I could use some
hints on how to debug this.
Assignee | ||
Comment 10•23 years ago
|
||
Ok, so with dbradley's help I tracked this down a bit. It seems that the
security check to get .length fails in CheckSameOrigin. Mitch, any idea why this
would fail on Mac only?
Assignee: jst → mstoltz
Comment 11•23 years ago
|
||
We have similar problems when using code like:
var xpe = new XPathEvaluator();
var nsRes = xpe.createNSResolver(xmlNode); // Permission denied exception
var result = xpe.evaluate(xpath, xmlNode,
null, null, null); // Permission denied exception
Maybe there is a problem with the eventhandler and is the xmlDoc not yet loaded?
Updated•23 years ago
|
Whiteboard: [adt1] → [adt1 RTM]
Comment 12•23 years ago
|
||
What's the current status of this bug? (No comments for a VERY long time...)
Comment 13•23 years ago
|
||
I'm looking at it now. ETA 6/20.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.0.1
Assignee | ||
Comment 14•23 years ago
|
||
Jst and I have debugged this and I have a patch almost ready.
Comment 15•23 years ago
|
||
What was the problem? And why did it only affect the Mac?
Comment 16•23 years ago
|
||
OK, sounds like peterv has a fix for the trunk, but it won't work for the branch
because it depends on some major API changes that have landed on the trunk
recently. jst thinks we can get by without this fix for Moz1.0.1, but I'm going
to reassign this to peterv and let him make the final call. If this is not a
stop-ship, please remove the nsbeta1+.
Assignee: mstoltz → peterv
Status: ASSIGNED → NEW
Comment 17•23 years ago
|
||
makring as nsbeta1-, and lowering ADT impact to ADT2 per Comment #16 From
Mitchell Stoltz. let's see if we can't get this on a future release.
Assignee | ||
Updated•23 years ago
|
No longer blocks: 143047
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: mozilla1.0.1 → mozilla1.1beta
Assignee | ||
Comment 18•23 years ago
|
||
This fixes it for me. Not sure if there are other place where we need a similar
fix. The problem is that we were using the safe context when calling the event
handler and the safe context comes from the hidden window (and on Mac the
hidden window probably contains a document with a chrome URI).
Comment 19•23 years ago
|
||
Comment on attachment 88885 [details] [diff] [review]
Patch
nsContentUtils::GetDocshellFromGlobalObject needs to be renamed to something
like GetCurrentDOMWindow() and changed to return the DOM window off the current
JS context.
- In nsXMLDocument.cpp:
+ nsCOMPtr<nsIScriptGlobalObjectOwner> container =
+ do_QueryReferent(mDocumentContainer);
Sigh, 4-space indentation! :-)
sr=jst if you fix that.
Attachment #88885 -
Flags: superreview+
Assignee | ||
Comment 20•23 years ago
|
||
Updated to trunk and renamed method.
Attachment #88885 -
Attachment is obsolete: true
Assignee | ||
Comment 21•23 years ago
|
||
Comment on attachment 91813 [details] [diff] [review]
Patch
Carrying forward jst's sr.
Attachment #91813 -
Flags: superreview+
Comment 22•23 years ago
|
||
Comment on attachment 91813 [details] [diff] [review]
Patch
Would there be any performance benefit to keeping a reference to the
JSContextStack service across multiple iterations of this code?
r=mstoltz whether or not you do this.
Attachment #91813 -
Flags: review+
Updated•23 years ago
|
Assignee | ||
Comment 23•23 years ago
|
||
Changed to cache context stack.
Attachment #91813 -
Attachment is obsolete: true
Assignee | ||
Comment 24•23 years ago
|
||
Comment on attachment 94019 [details] [diff] [review]
Patch
Carrying forward r and sr.
Attachment #94019 -
Flags: superreview+
Attachment #94019 -
Flags: review+
Comment 25•23 years ago
|
||
There's now (as of a few weeks ago) an nsCxPusher class in
nsEventListenerManager.h, maybe you could move that to nsContentUtils and use
that in nsXMLDocument?
Either way, my sr= still stands.
Assignee | ||
Comment 26•23 years ago
|
||
Attachment #94019 -
Attachment is obsolete: true
Comment 27•23 years ago
|
||
Comment on attachment 94451 [details] [diff] [review]
Patch
- In nsXMLDocument.cpp:
+
+ nsCOMPtr<nsIJSContextStack> stack;
+ nsCOMPtr<nsIScriptGlobalObjectOwner> container =
+ do_QueryReferent(mDocumentContainer);
+
+ nsCxPusher pusher(container);
+
HandleDOMEvent(nsnull, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
I don't see stack being used anywhere, so remove that.
Other than that, sr=jst
Attachment #94451 -
Flags: superreview+
Comment 28•23 years ago
|
||
Comment on attachment 94451 [details] [diff] [review]
Patch
Looks good to me. r=mstoltz.
Attachment #94451 -
Flags: review+
Assignee | ||
Comment 29•23 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 30•20 years ago
|
||
Can you reopen this bug, it seems to be back again.
I'm getting the same error again on MacOS X 10.3.6. I'm getting this both in
Firefox 1.0 and Mozilla 1.8.alpha5. The example provided for this bug, gives me:
"Error: xmlDoc.childNodes.item(i) has no properties
Source File: http://surfmind.com/lab/moz/bugs/macxml/
Line: 28"
In my own code I still get the original childNodes.length error. And it seems to
be for nodes from level 2 and down. I have tested to create the DOM document
both thru document.load and XMLHTTPRequest, with the same result.
Assignee | ||
Comment 31•20 years ago
|
||
File a new bug if this regressed.
Component: DOM: Core → DOM: Core & HTML
QA Contact: stummala → general
You need to log in
before you can comment on or make changes to this bug.
Description
•