71 Commits

Author SHA1 Message Date
bzbarsky%mit.edu
75f1b92fe5 Don't leave an exception just hangin' out on the JSContext. Bug 422009,
r+sr=jst, a=shaver


git-svn-id: svn://10.0.0.236/trunk@248233 18797224-902f-48f8-a5cc-f745e15eee43
2008-03-20 00:42:48 +00:00
bzbarsky%mit.edu
1fd4026864 Allow JS 1.7 in XBL. Bug 389322, r=brendan, sr=jst, a=brendan
git-svn-id: svn://10.0.0.236/trunk@245814 18797224-902f-48f8-a5cc-f745e15eee43
2008-02-16 05:13:19 +00:00
peterv%propagandism.org
e3e0240f6a Fix for bug 368369 (nsIScriptContextOwner looks unused). r/sr=jst.
git-svn-id: svn://10.0.0.236/trunk@220731 18797224-902f-48f8-a5cc-f745e15eee43
2007-02-22 13:33:50 +00:00
dbaron%dbaron.org
9216c4e082 Call JS_ClearScope up the global object's prototype chain to fix leaks. Consolidate the cleanup of non-fastback-cached inner windows currently spread throughout SetNewDocument into a pair of calls to FreeInnerObjects, and various other cleanup. b=353090 r=jst sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@212044 18797224-902f-48f8-a5cc-f745e15eee43
2006-09-20 01:13:59 +00:00
mhammond%skippinet.com.au
7016d67f13 Bug 341915: can we move nsIScriptContext(Owner) from dom to xpconnect
r=timeless, sr=jst


git-svn-id: svn://10.0.0.236/trunk@203077 18797224-902f-48f8-a5cc-f745e15eee43
2006-07-19 04:15:50 +00:00
mhammond%skippinet.com.au
e96b5e495a Land DOM_AGNOSTIC3_BRANCH, bug 255942. r=a few people, sr=brendan.
git-svn-id: svn://10.0.0.236/trunk@199778 18797224-902f-48f8-a5cc-f745e15eee43
2006-06-13 03:07:47 +00:00
bsmedberg%covad.net
8be3b17c8f Bug 315562 - non-MOZILLA_INTERNAL_API usage of dom/content headers, r=just
git-svn-id: svn://10.0.0.236/trunk@184778 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-16 20:29:29 +00:00
bsmedberg%covad.net
0217e2f9a9 Bug 313309 part 2 - change the NS_DEFINE_STATIC_IID_ACCESSOR macro to NS_DECLARE, and make a NS_DEFINE_ macro that's outside the class declaration, r=shaver
git-svn-id: svn://10.0.0.236/trunk@184456 18797224-902f-48f8-a5cc-f745e15eee43
2005-11-11 14:36:26 +00:00
bzbarsky%mit.edu
b8e0480ec5 Keep the results of EvaluateStringWithValue properly alive while we're using
them, and make sure we don't GC the xbl property getter when we create the
setter.  Bug 299205, r=jst, sr=brendan


git-svn-id: svn://10.0.0.236/trunk@180397 18797224-902f-48f8-a5cc-f745e15eee43
2005-09-16 15:44:59 +00:00
jst%mozilla.jstenback.com
f0b0de34e7 Fix dumb typo.
git-svn-id: svn://10.0.0.236/trunk@177973 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-17 18:17:39 +00:00
jst%mozilla.jstenback.com
a9f668bc25 Followup changes to bzabarsky's review for bug 296639. Reviews pending, a=drivers@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@177635 18797224-902f-48f8-a5cc-f745e15eee43
2005-08-12 04:11:00 +00:00
jst%mozilla.jstenback.com
792744ce69 Landing the split window work, bug 296639. This change doesn't have full reviews yet, bzbarsky@mit.edu and shaver@mozilla.org have done partial reviews, but there's still more to look at. Given the current time constraint this is landed with reviews and followup changes that result to come after the initial checkin. a=drivers
git-svn-id: svn://10.0.0.236/trunk@176884 18797224-902f-48f8-a5cc-f745e15eee43
2005-07-30 20:57:07 +00:00
bzbarsky%mit.edu
e01bd5e327 Make sure to call ScriptEvaluated when doing all evaluations, to call it
_after_ we've popped the JSContext from the stack, and to handle multiple
termination functions being posted from a single script evaluation.  Fixes
leaks when closing windows or tabs with still-loading documents.  Bug 295983,
r+sr=jst, a=asa


git-svn-id: svn://10.0.0.236/trunk@174364 18797224-902f-48f8-a5cc-f745e15eee43
2005-06-09 15:42:19 +00:00
tor%cs.brown.edu
c5c142199f Bug 242234 - svg event attributes.
Original patch by sicking, r=bryner, sr=jst


git-svn-id: svn://10.0.0.236/trunk@159662 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-22 16:38:05 +00:00
jst%mozilla.jstenback.com
c21b6f5c4d Fixing bug 245619. Don't bother serializing the result of JS execution when the caller doesn't care about the value. r+sr=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@157744 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-11 00:48:00 +00:00
gerv%gerv.net
98831918fc Bug 236613: change to MPL/LGPL/GPL tri-license.
git-svn-id: svn://10.0.0.236/trunk@155044 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-17 21:52:36 +00:00
darin%meer.net
d512bb2e4d fixes bug 239038 "rev IIDs for all interfaces modified since Mozilla 1.6" r=bsmedberg sr=jst
git-svn-id: svn://10.0.0.236/trunk@154957 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-15 23:30:05 +00:00
jst%mozilla.jstenback.com
d28978604e Fixing bug 68215. Adding support for the onbeforeunload event. r=peterv@propagandism.org, sr=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@152654 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 06:09:51 +00:00
jst%mozilla.jstenback.com
854468a176 Fixing bug 233307. deCOMtaminating nsIScript* and related interfaces. r+sr=bryner@brianryner.com.
git-svn-id: svn://10.0.0.236/trunk@152565 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-09 22:48:53 +00:00
jst%mozilla.jstenback.com
7442fffb44 Fixing bug 226462. Eliminating the aReverseReturnResult argument from nsIScriptContext::CallEventHandler(). r=caillon@aillon.org, sr=brendan@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@150607 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-21 18:01:19 +00:00
bzbarsky%mit.edu
5435c5826d Add correct line number reporting to errors from XBL fields and handlers. Make
it possible to pass a url and line number to CompileEventHandler in general.
Bug 127567, r=bryner, sr=brendan


git-svn-id: svn://10.0.0.236/trunk@144752 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-11 22:54:36 +00:00
jst%netscape.com
ecae24eff4 Fixing bug 209884. Writing an inline helper to safely get an nsIScriptContext from a JSContext and making direct callers of JS_GetContextPrivate() use the helper. r=caillon@aillon.org, sr=peterv@netscape.com
git-svn-id: svn://10.0.0.236/trunk@144108 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-24 21:43:01 +00:00
bzbarsky%mit.edu
63ed4e4cd2 Make XBL methods and properties report useful line numbers and urls so that the
JS errors/warnings in the JS console point to the right place.  Bug 127567,
r=bryner, sr=alecf


git-svn-id: svn://10.0.0.236/trunk@144079 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-24 01:20:40 +00:00
dbaron%fas.harvard.edu
772b5b8c58 Convert users of nsAReadable[C]String and nsAWritable[C]String typedefs to [const] nsA[C]String. b=131899 r=scc sr=jag a=asa
git-svn-id: svn://10.0.0.236/trunk@117354 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-24 00:16:18 +00:00
jst%netscape.com
a49bb992db Fixing bug 116834. Making element.innerHTML='...<script>...</script>...' not execute the script, this makes mozilla compatible with IE wrt innerHTML and execution of scripts. r=bzbarsky@mit.edu, sr=rpotts@netscape.com
git-svn-id: svn://10.0.0.236/trunk@113684 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-05 05:53:56 +00:00
jst%netscape.com
19215022f1 Fixing bug 105572. Don't bother GC'ing on context destruction when we're tearing down a frame in a frameset (or an iframe). r=jband@netscape.com, sr=vidur@netscape.com
git-svn-id: svn://10.0.0.236/trunk@105748 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-19 04:13:37 +00:00
gerv%gerv.net
612ee840db License changes, take 2. Bug 98089. mozilla/dom/.
git-svn-id: svn://10.0.0.236/trunk@103755 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 22:43:09 +00:00
dbaron%fas.harvard.edu
9359000a40 Header include dependency cleanup. b=64023 r=jag rs=brendan
git-svn-id: svn://10.0.0.236/trunk@99299 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 02:40:48 +00:00
dbaron%fas.harvard.edu
88810ef1eb Fix bad getters on nsIDocument and nsIScriptContext to use out params rather than return |AddRef|ed pointers. b=81289 r=jaggernaut sr=jst a=asa
git-svn-id: svn://10.0.0.236/trunk@97540 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-20 03:27:48 +00:00
radha%netscape.com
52d37371b0 Fix for bug # 72197 javascript urls cause problems with history r= rpotts sr=blizzard
git-svn-id: svn://10.0.0.236/trunk@95060 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-15 22:26:19 +00:00
jst%netscape.com
43eee52859 Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@94242 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-08 17:42:36 +00:00
jband%netscape.com
e9ee268b9d fix bug 52579. Avoid infinite recursion dialog when JS is run by xpconnect on DOM context. a,r=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@79277 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-15 06:17:08 +00:00
danm%netscape.com
be2b97977f new method SetRootedScriptObject. bug 43466 r=brendan
git-svn-id: svn://10.0.0.236/trunk@77316 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-26 23:32:52 +00:00
jst%netscape.com
7e0575bfee DOM string changes. All nsString& in DOM interfaces (and interfaces needed by DOM implementations) have been changed to nsAReadableString& and nsAWritableString&. String implementation additions (sanctioned by scc) to support DOM needs. Bug 49091. r=vidur,jst,scc
git-svn-id: svn://10.0.0.236/trunk@76967 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-23 17:27:06 +00:00
joki%netscape.com
8aabc79a05 fixes for 5995, 7304, 10573, 22832, and 9668.
Changes to event handling to deal with reentrant events, cursor fixes, and return value fixes.


git-svn-id: svn://10.0.0.236/trunk@66958 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-24 04:41:27 +00:00
jst%netscape.com
cb06101661 Eliminating the last traces of NS_COMFALSE from the DOM code, fixes M15 bug #11594.
git-svn-id: svn://10.0.0.236/trunk@65304 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-05 02:40:08 +00:00
hyatt%netscape.com
81bbe05843 Enhancements to nsIScriptcontext. r=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@64420 18797224-902f-48f8-a5cc-f745e15eee43
2000-03-29 01:18:21 +00:00
akkana%netscape.com
418dacce26 9266: Disable JS in the editor (and allow for disabling it anywhere). r=brendan,jband,norris,sfraser
git-svn-id: svn://10.0.0.236/trunk@64271 18797224-902f-48f8-a5cc-f745e15eee43
2000-03-28 00:15:56 +00:00
norris%netscape.com
953def32a1 Fix
32088 Circumventing Same Origin security policy using javascript: URLs
        32040 about: can't be link
Also remove deprecated method
r=mstoltz


git-svn-id: svn://10.0.0.236/trunk@64066 18797224-902f-48f8-a5cc-f745e15eee43
2000-03-24 22:15:37 +00:00
brendan%mozilla.org
bc0baef1a1 (bug 22795, r=vidur@netscape.com)
- Add "aShared" flag to nsIScriptContext::CompileEventHandler, telling it to clear the compiled event handler's scope chain if true, in order to
  (a) avoid entraining garbage
      (i.e., a shared compile-time-only parent object); and
  (b) cause later BindCompiledEventHandler calls to ensure that the event handler has the particular scope chain needed for the binding
      (to the target object that's receiving the event).
- Use :: consistently (and all over the place) before calls to JS_ functions in nsJSEnvironment.cpp.
- Eliminate tabs and barbarians-at-the-gate-of-Rome style, in favor of when-in-Rome style (hail Waterson Maximus!)


git-svn-id: svn://10.0.0.236/trunk@57127 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-08 00:24:24 +00:00
brendan%mozilla.org
d2ded9c6d9 - Rename "FunctionObject" or shorthands to "EventHandler" to make nsIScriptContext more scripting-language-neutral.
- Allow nsIScriptContext::BindEventHandler to take a null void* handler argument, to remove the binding by nullifying it (for hyatt's XML-driven-key-mapping work). 
- Try to GetCompiledEventHandler (and if we don't, and compile it, Put too) for the load event and other non-deferred (XUL window-level) event listeners. 
- Improve doc comments and whitespace.


git-svn-id: svn://10.0.0.236/trunk@55612 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-07 22:14:17 +00:00
waterson%netscape.com
820584eef4 Bug 20786. Use function object, rather than function, as the thing which is executed, ensuring that the correct bindings are used when the function is shared across several contexts. This checkin is really brendan@mozilla.org; I'm just landing the code.
git-svn-id: svn://10.0.0.236/trunk@55349 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-05 07:29:25 +00:00
brendan%mozilla.org
4ccbd4b644 - Doc-comments for nsIScriptContext methods I added or modified.
- Rename nsIScriptContext::CompileFunction to CompileEventHandler, and add BindCompiledEventHandler, to reflect function name restrictions and help brutal sharing.
- Add adjunct-interface nsIScriptEventHandlerOwner to nsIScriptObjectOwner.h; this interface is queried for by nsEventListenerManger.cpp to test and fill the XUL prototype event handler "cache".
- PR_LOG JS warnings, and look in javascript.options.{strict,werror} for those options.  
- Implement nsIScriptEventHandlerOwner in nsXULElement, keeping pointers to pre-compiled event handlers in nsXULPrototypeAttribute.
 
(bug 13218, r=waterson@netscape.com,vidur@netscape.com)


git-svn-id: svn://10.0.0.236/trunk@55157 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-03 03:40:30 +00:00
brendan%mozilla.org
abfb05cbb4 XULDOMJS_19991106_BRANCH landing (15146, r=vidur@netscape.com)
git-svn-id: svn://10.0.0.236/trunk@53328 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-12 06:08:14 +00:00
dmose%mozilla.org
92d791b7b0 updated license boilerplate to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@52908 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-06 03:40:37 +00:00
brendan%mozilla.org
f980be0221 (13163, r=alecf, scc, waterson, others; names available on request)
- 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
1999-10-31 00:43:30 +00:00
vidur%netscape.com
1173466bfc Added a version of window.close, which when alled from script that defers actual closure if it is invoked from the script context of the window itself. Fixes bug 15261. R=joki.
git-svn-id: svn://10.0.0.236/trunk@52080 18797224-902f-48f8-a5cc-f745e15eee43
1999-10-28 14:12:56 +00:00
norris%netscape.com
761b5f5706 Add ability to disable JS. Fix 13978 shopping at webvan.com crashes
git-svn-id: svn://10.0.0.236/trunk@47995 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-17 20:13:52 +00:00
norris%netscape.com
3036cb7a8a Add security support for javascript: uris.
git-svn-id: svn://10.0.0.236/trunk@47649 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-15 20:58:41 +00:00
vidur%netscape.com
ccf644288f Added JS exceptions to DOM glue. Added implementation for nsIDOMDOMException. Added nsIScriptContextOwner::ReportScriptError.
git-svn-id: svn://10.0.0.236/trunk@46438 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-08 23:14:30 +00:00