DOM: getting rid of JS_GetContextPrivate wherever possible. Use static parent
links where we can. When we do need to find this info about the caller
we call a function that knows how to get that info rather than inline calls
to JS_GetContextPrivate. This is all required for calling DOM objects on
non-DOM JSContexts as we do via xpconnect.
XPConnect: basic refactoring work to disassociate wrappers from the JSContext
that was active when the wrapper was constructed. This allows for calling into
wrapped JS objects on the right JSContext and for proper grouping of wrapped
native objects so that they can share proto objects. This also allows for
better sharing of objects and lays the foundations for threadsafety and
interface flattening.
Also, xpconnect tests are reorganized and improved.
fixes bugs: 13419, 17736, 17746, 17952, 22086
r=vidur r=mccabe r=norris r=cbegle
a=chofmann
git-svn-id: svn://10.0.0.236/trunk@56202 18797224-902f-48f8-a5cc-f745e15eee43
#ifdef strftime formatting string "%#c" ('format to 4-digit date string, any format') to "%c" for non-Windows platform, as only Windows accepts, requires or understands that extra '#' to get a 4-digit date.
Thanks to KerryGinn@computer.org for spotting this one. (document.lastModified came out as "%#c" on a mac.)
r=Pavlov
a=choffman.
git-svn-id: svn://10.0.0.236/trunk@56089 18797224-902f-48f8-a5cc-f745e15eee43
fixed the webshell leak in <textarea> and <input type=text|password>
the problem was the new nsWebShell::SetDocument() call was indirectly causing nsHTMLDocument to instantiate a parser
and fire off a parse. bad circular references ensued. The fix is to use the "aCommand" param to pass a hint
to the nsHTMLDocument, telling it there's no need to involve a parser.
in the simple case, we no longer leak webshells. That is, if you open mozilla.exe, look at a page (whether it has a text
control on it or not), and shut down the app, no webshell is leaked. If I browse around, sometimes we still leak a webshell
somewhere. I haven't figured out exactly where that is yet. A guess is history, which is in the process of being reworked
anyway.
r=mscott
a=chofmann
git-svn-id: svn://10.0.0.236/trunk@55796 18797224-902f-48f8-a5cc-f745e15eee43
selection, because output needs to get style nodes on the body. r=sfraser
git-svn-id: svn://10.0.0.236/trunk@55681 18797224-902f-48f8-a5cc-f745e15eee43
2.) WebShell now implements the new nsIScriptGlobalObjectOwner.
3.) WebShell supports GetInterface to nsIScriptGlobalObject.
4.) Documents no longer carry around a reference to nsIScriptContextOwner. Instead they hold on to a nsIScriptGlobalObject. nsIDocument::GetScriptContextOwner has now become nsIDocument::GetScriptGlobalObject(). Same change to the set methods.
git-svn-id: svn://10.0.0.236/trunk@55175 18797224-902f-48f8-a5cc-f745e15eee43
* Implement site-specific security policies (bug 858)
r=mstoltz
* Use Recycle rather than delete[] to clean up Purify logs
r=law
git-svn-id: svn://10.0.0.236/trunk@53631 18797224-902f-48f8-a5cc-f745e15eee43
already handles the trailing ';'.
NOTE: trying to compile a ';' fails on AIX
git-svn-id: svn://10.0.0.236/trunk@53239 18797224-902f-48f8-a5cc-f745e15eee43
10194 Possible security vulnerability in "chrome:" protocol - acce
14979 "chrome" protocol allows accessing arbitrary files on the lo
r=vidur
git-svn-id: svn://10.0.0.236/trunk@52615 18797224-902f-48f8-a5cc-f745e15eee43
- Fix most of bug 13163 (see TODO for rest). This entails adding a version-string argument to nsIScriptContext::EvaluateString and passing it around lots of places in content sinks.
- Fix leaks and confusion about mSecurityManager and mNameSpaceManager in nsJSEnvironment.cpp. These still need to move from nsJSContext to nsGlobalWindow or thereabouts, jband and vidur are looking at that.
- Added comments and expanded tabs in nsJSEnvironment.cpp, esp. to EvaluateString. Also changed various nsresult vars to be named rv. Also restored brace/style conformity to nsJSProtocolHandler.cpp.
- Factored CompileFunction from AddScriptEventListener to pave the way for brutal sharing of compiled JS event handlers via JS_CloneFunctionObject.
- Lots of nsCOMPtr uses added. I'm using one for mNameSpaceManager. Hold mSecurityManager as a service explicitly, on the other hand (awaiting scc's fix to allow comptrs for services), and release in nsJSContext's dtor (fixing a leak). These two managers should be moved to the window object -- TODO item below.
- Hold JSRuntimeService along with JSRuntime for live of nsJSEnvironment, fix for shaver.
- Fix window.setTimeout etc. so the filename and line number of the timeout expr is propagated. This meant factoring nsJSUtils.cpp code.
- Fix all content sinks to use the same, and up-to-date JavaScript version parsing (whether for script type or for old language attribute); also fix SplitMimeType clones to strip whitespace.
- With waterson, fix bug in brutal-sharing version of XUL content sink: script src= should not evaluate the inline content of its tag.
git-svn-id: svn://10.0.0.236/trunk@52347 18797224-902f-48f8-a5cc-f745e15eee43