Closed
Bug 220215
Opened 21 years ago
Closed 20 years ago
use the xpcnativewrapper for the current callers of components.lookupmethod
Categories
(SeaMonkey :: General, defect)
SeaMonkey
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: caillon, Assigned: neil)
Details
Attachments
(3 files, 4 obsolete files)
6.52 KB,
patch
|
caillon
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
1.62 KB,
patch
|
caillon
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
8.17 KB,
patch
|
caillon
:
review+
|
Details | Diff | Splinter Review |
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 132135 [details] [diff] [review] Editor portion of patch glazou says moa if I test it 10 times but I can only think of 6 tests so far :-/
Attachment #132135 -
Flags: superreview?(bzbarsky)
Attachment #132135 -
Flags: review?(caillon)
Comment 3•21 years ago
|
||
Comment on attachment 132135 [details] [diff] [review] Editor portion of patch sr=bzbarsky
Attachment #132135 -
Flags: superreview?(bzbarsky) → superreview+
Reporter | ||
Updated•21 years ago
|
Attachment #132135 -
Flags: review?(caillon) → review+
Assignee | ||
Comment 4•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #132190 -
Flags: superreview?(bzbarsky)
Attachment #132190 -
Flags: review?(caillon)
Assignee | ||
Comment 5•21 years ago
|
||
There's an inspector use too, although I didn't realize the style property on an element is replaceable (or is it?)
Comment 6•21 years ago
|
||
Comment on attachment 132190 [details] [diff] [review] Xpfe portion of patch Hmmm how come just importing the JS in contentAreaContextOverlay makes it available in all those JS files (eg navigator.js)? Have you tested all the callsites?
Assignee | ||
Comment 7•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #132345 -
Flags: superreview?(bzbarsky)
Attachment #132345 -
Flags: review?(caillon)
Reporter | ||
Updated•21 years ago
|
Attachment #132345 -
Flags: review?(caillon) → review+
Reporter | ||
Comment 8•21 years ago
|
||
Comment on attachment 132190 [details] [diff] [review] Xpfe portion of patch Does JS Console etc use any of these files, especially contentAreaUtils and will it care about these functions? I think editor also uses that file...
Attachment #132190 -
Flags: review?(caillon)
Assignee | ||
Comment 9•21 years ago
|
||
Comment on attachment 132190 [details] [diff] [review] Xpfe portion of patch mailNavigatorOverlay.xul and navigator.js are only used by navigator, which already uses contentAreaContextOverlay.xul contentAreaUtils.js and nsContextMenu.js are only used by contentAreaContextOverlay.xul which (surprise) is where I am also including XPCNativeWrapper.js Sorry for not being more obvious.
Attachment #132190 -
Flags: review?(caillon)
Comment 10•21 years ago
|
||
Comment on attachment 132190 [details] [diff] [review] Xpfe portion of patch sr=bzbarsky
Attachment #132190 -
Flags: superreview?(bzbarsky) → superreview+
Comment 11•21 years ago
|
||
Comment on attachment 132190 [details] [diff] [review] Xpfe portion of patch >Index: communicator/resources/content/nsContextMenu.js >+ var spec = new XPCNativeWrapper(window.content.opener, "location").location; accessing .opener is already not safe, no? The wrapper needs to be on window.content (this was buggy in the code you changed already). >+ var characterSet = new XPCNativeWrapper(this.target.ownerDocument, "characterSet").characterSet; Accessing ownerDocument is already not safe; the wrapper needs to be on this.target. Although you may also need to rewrap the ownerDocument object returned; please test. >Index: browser/resources/content/navigator.js >+ var spec = new XPCNativeWrapper(window.content.opener, "location").location; Accessing opener is unsafe. > Index: browser/resources/content/mailNavigatorOverlay.xul >+ new XPCNativeWrapper(window._content.document, 'title').title);"/> Accessing .document is not safe; you want the wrapper on window._content....
Attachment #132190 -
Flags: superreview+ → superreview-
Comment 12•21 years ago
|
||
Comment on attachment 132345 [details] [diff] [review] Inspector portion of patch sr=bzbarsky on this one; the other sr was a case of mistaken patch identity.
Attachment #132345 -
Flags: superreview?(bzbarsky) → superreview+
Assignee | ||
Comment 13•21 years ago
|
||
I've hacked Send Frame/Link/Page around a bit but they still work.
Attachment #132190 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #132355 -
Flags: superreview?(bzbarsky)
Attachment #132355 -
Flags: review?(caillon)
Reporter | ||
Comment 14•21 years ago
|
||
Comment on attachment 132355 [details] [diff] [review] Improved xpfe portion of patch Hm, I'm wondering why I put some of these wrapers on fooWin.location.href... That should be completely safe. See: http://lxr.mozilla.org/mozilla/source/dom/src/base/nsDOMClassInfo.cpp#3144 http://lxr.mozilla.org/mozilla/source/dom/src/base/nsDOMClassInfo.cpp#3182 http://lxr.mozilla.org/mozilla/source/dom/src/base/nsDOMClassInfo.cpp#3209 http://lxr.mozilla.org/mozilla/source/dom/src/base/nsDOMClassInfo.cpp#4145 etc. Also, this is kind of obtuse enough, could you please not nest |new XPCNativeWrapper|s? Just use a temporary local. You aren't gaining that much by not doing that, and you're losing readability.
Reporter | ||
Updated•21 years ago
|
Attachment #132190 -
Flags: review?(caillon)
Assignee | ||
Comment 15•21 years ago
|
||
Assignee | ||
Updated•21 years ago
|
Attachment #132355 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #132543 -
Flags: superreview?(bzbarsky)
Attachment #132543 -
Flags: review?(caillon)
Updated•21 years ago
|
Attachment #132355 -
Flags: superreview?(bzbarsky)
Attachment #132355 -
Flags: review?(caillon)
Comment 16•21 years ago
|
||
Comment on attachment 132543 [details] [diff] [review] Removed unnecessary wrappers on window.document/.location >Index: browser/resources/content/navigator.js > gFocusedDocument = focusedWindow.document; Is this safe? sr=me if caillon is happy with it.
Attachment #132543 -
Flags: superreview?(bzbarsky) → superreview+
Reporter | ||
Comment 17•21 years ago
|
||
Comment on attachment 132543 [details] [diff] [review] Removed unnecessary wrappers on window.document/.location >--- browser/resources/content/mailNavigatorOverlay.xul 30 May 2003 05:08:36 -0000 1.4 >+++ browser/resources/content/mailNavigatorOverlay.xul 2 Oct 2003 20:28:46 -0000 >@@ -120,12 +120,10 @@ > { > if (!aDocument) > aDocument = window._content.document; This looks like it needs wrapping. >- >- var pageUrl = aDocument.URL; >- var pageTitle = Components.lookupMethod(aDocument, 'title').call(aDocument); > > try { >- openComposeWindow(pageUrl, pageTitle, 1); >+ aDocument = new XPCNativeWrapper(aDocument, "URL", "title"); >+ openComposeWindow(aDocument.URL, aDocument.title, 1); > } catch(ex) { dump("Cannot Send Page: " + ex + "\n"); } >--- browser/resources/content/navigator.js 23 Sep 2003 06:49:05 -0000 1.517 >+++ browser/resources/content/navigator.js 2 Oct 2003 20:28:48 -0000 >@@ -271,7 +271,7 @@ function contentAreaFrameFocus() > { > var focusedWindow = document.commandDispatcher.focusedWindow; > if (isContentFrame(focusedWindow)) { >- gFocusedURL = Components.lookupMethod(focusedWindow, 'location').call(focusedWindow).href; >+ gFocusedURL = focusedWindow.location.href; > gFocusedDocument = focusedWindow.document; This, too.
Attachment #132543 -
Flags: review?(caillon) → review+
Assignee | ||
Comment 18•21 years ago
|
||
Attachment #132543 -
Attachment is obsolete: true
Assignee | ||
Comment 19•21 years ago
|
||
Comment on attachment 135169 [details] [diff] [review] Actually it's document.location that's safe, window is totally unsafe Re-requesting reviews as the patch is significantly different.
Attachment #135169 -
Flags: superreview?(bz-vacation)
Attachment #135169 -
Flags: review?(caillon)
Comment 20•21 years ago
|
||
I'll probably take me about a week to get to this.
Comment 21•21 years ago
|
||
Comment on attachment 135169 [details] [diff] [review] Actually it's document.location that's safe, window is totally unsafe sr=bzbarsky
Attachment #135169 -
Flags: superreview?(bz-vacation) → superreview+
Reporter | ||
Comment 22•21 years ago
|
||
Comment on attachment 135169 [details] [diff] [review] Actually it's document.location that's safe, window is totally unsafe Both suck. r=me if you put back the document change. I will try hacking classinfo and caps stuff to see if I can get a better all around solution....
Attachment #135169 -
Flags: review?(caillon) → review+
Assignee | ||
Comment 23•21 years ago
|
||
Attachment #135169 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #136014 -
Flags: review?(caillon)
Reporter | ||
Comment 24•21 years ago
|
||
Comment on attachment 136014 [details] [diff] [review] wrapping .location again > >- function sendLink(pageUrl, pageTitle) >+ function sendLink(aDocument) > { >+ if (!aDocument) >+ aDocument = window._content.document; Nit: Use |window.content| instead? It's slightly faster. r=me. I hope to come up with a better generic solution for this whole issue sometime soon. It really annoys me that we need to use the XPCWrapper; though it is better than not, I will agree.
Attachment #136014 -
Flags: review?(caillon) → review+
Assignee | ||
Comment 25•20 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 26•20 years ago
|
||
Sometime between 2004-05-20 09:00:00 and 2004-05-21 08:00:00 "save as" stopped working fromm the View Source windows. Could this checkin have caused that? See bug 248964
Updated•20 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•