On 9/30/09 12:55 AM, John J. Barton wrote:
> I hit a problem, I get an error message "Security Manager vetoed action"
> with the line number point to:
> delete node.__walkingAnonymousChildren; // unmark looping
> Here node is in an nsIDOMDocumentXBL document loaded in a content
I assume |node| is just something that looks like a DOM node to you (as in, you didn't do wrappedJSObject on it or anything?
If so, looks like the issue is that XPC_NW_DelProperty will throw NS_ERROR_XPC_SECURITY_MANAGER_VETO, in general, when touching content from chrome. Not sure why that code is as it is; this was part of the initial XPCNativeWrapper landing. Looks wrong to me; worth filing a bug on and ccing ":jst" and "brendan@moz" and probably "mrbkap" and ":bz". Minimal-ish testcase:
Of course I'm not quite sure why you need the __walkingAnonymousChildren thing at all... Why do you need it?
This code was probably working when the js was running in extensions space on extension nodes, but fails when the js is in extension space but the node is content.
Blocks nothing, I wrote different code.
I was talking about this with Blake, and we see no reason to forbid deletes on an XPCNativeWrapper from deleting own properties. Brendan, jst, can you think of any such reasons?
Created attachment 405965 [details] [diff] [review]
Note that unlike the other wrappers, XPCNativeWrapper doesn't forward the delete to its underlying object. If you delete an IDL-declared property, we'll simply re-resolve it the next time you ask for it. Expandos get nuked until you recreate them.
Comment on attachment 405965 [details] [diff] [review]
So is this a fix for this limitation:
"16. Using the delete operator on "expando" properties of an XPCNativeWrapper throws a security exception."
Yes, it is.