Closed Bug 333922 Opened 19 years ago Closed 19 years ago

Setting designMode doesn't work with enhanced privileges on a frame with a different domain

Categories

(Core :: DOM: Editor, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: martijn.martijn)

References

Details

(Keywords: fixed1.8.1, testcase)

Attachments

(3 files, 1 obsolete file)

See upcoming testcase. I've used netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); for it, so I was hoping I could set designMode for documents at a different domain. However, that doesn't work currently.
Attached file testcase (obsolete) —
Attached patch patchSplinter Review
This fixes it for me. Not sure if this is enough. I got a js error message some time before with this patch, but now I'm not seeing that js error message anymore. Currently undo is not working anymore, so I have something screwed up.
Blocks: 197305
Comment on attachment 218358 [details] [diff] [review] patch Ok, tested this again. It doesn't cause any problems mentioned in comment 2. It doesn't solve this bug, though. But it is necessary to solve the regression as mentioned in bug 197305, comment 7. I've tested that this makes it at least possible for chrome code to set designMode.
Attachment #218358 - Flags: review?(bzbarsky)
I probably should morph this bug into the more general problem that with UniversalBrowserWrite privileges, you still aren't allowed to access window/document properties from other domains.
Ah, sorry, I just need to do netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite"); for it to work, so there is no 'general problem' as mentioned in comment 4.
Status: NEW → ASSIGNED
Assignee: mozeditor → martijn.martijn
Status: ASSIGNED → NEW
Attached file Correct testcase
This is a correct testcase, using netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead UniversalBrowserWrite");
Attachment #218355 - Attachment is obsolete: true
Comment on attachment 218358 [details] [diff] [review] patch Makes sense. Thanks for fixing this! r+sr=bzbarsky
Attachment #218358 - Flags: superreview+
Attachment #218358 - Flags: review?(bzbarsky)
Attachment #218358 - Flags: review+
Checking in content/html/document/src/nsHTMLDocument.cpp; /cvsroot/mozilla/content/html/document/src/nsHTMLDocument.cpp,v <-- nsHTMLDocu ment.cpp new revision: 3.682; previous revision: 3.681 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment on attachment 218358 [details] [diff] [review] patch Brendan asked approval for the patch in bug 197305, in that case, this bug needs also be approved.
Attachment #218358 - Flags: approval-branch-1.8.1?(bugmail)
Attachment #218358 - Flags: approval-branch-1.8.1?(bugmail) → approval-branch-1.8.1+
This is going to need some merging to land on branch...
Flags: blocking1.8.1?
Ok, this is a combined patch for this bug and for bug 197305. It is a bit different from the original patch on trunk, because NodePrincipal() does't exist on 1.8.1 branch. Boris already took a look on it, but just to be sure, I'm asking review on him. I've checked that this fixes the two bugs.
Attachment #226413 - Flags: review?(bzbarsky)
Comment on attachment 226413 [details] [diff] [review] 1.8.1 branch patch Yeah, looks great
Attachment #226413 - Flags: superreview+
Attachment #226413 - Flags: review?(bzbarsky)
Attachment #226413 - Flags: review+
Checking in nsHTMLDocument.cpp; /cvsroot/mozilla/content/html/document/src/nsHTMLDocument.cpp,v <-- nsHTMLDocu ment.cpp new revision: 3.615.2.20; previous revision: 3.615.2.19 done Fixed on 1.8.1 branch.
Keywords: fixed1.8.1
Flags: blocking1.8.1?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: