Commit Graph

1660 Commits

Author SHA1 Message Date
Phil Ringnalda
2d79942fa4 Back out 66882ea6f8c7 (bug 788293) and 32f09cb3c7b6 (bug 834090) for bustage
CLOSED TREE
2013-01-31 22:29:30 -08:00
Nicholas Nethercote
46ba51002e Bug 788293 - Remove e4x support. r=jorendorff,terrence,evilpie.
Ding dong!  The witch is dead!

--HG--
extra : rebase_source : 7574f5620e303c25120fcfc8ceb2099ad75c8f1b
2013-01-24 21:24:57 -08:00
Nicholas Nethercote
9987ec3eb4 Bug 833208 (part 5) - Remove e4x support from mochitests. r=jorendorff.
--HG--
extra : rebase_source : a88f8ed13299c566df2297729b3a5ddf21fcaafa
2013-01-28 14:55:17 -08:00
Nicholas Nethercote
d0f259110b Bug 833208 (part 4) - Remove e4x support from xpcshell tests. r=jorendorff.
--HG--
extra : rebase_source : a7bd33905120f74e6c242e0c236450dd3be54436
2013-01-30 16:56:16 -08:00
Boris Zbarsky
de131aa791 Add a test for WebIDL-weakmap stuff in addition to XPConnect-weakmap. No bug, no review
--HG--
rename : js/xpconnect/tests/mochitest/test_bug655297.html => js/xpconnect/tests/mochitest/test_bug655297-1.html
rename : js/xpconnect/tests/mochitest/test_bug655297.html => js/xpconnect/tests/mochitest/test_bug655297-2.html
2013-01-31 01:04:48 -05:00
Boris Zbarsky
e7f12d401a Bug 829867. Unpref PaintRequest and Screen WebIDL bindings and remove some cruft from quickstubs. r=peterv
nsIDOMCharacterData and nsIDOMText quickstubs are not needed after bug 826703.

nsIDOMRect quickstubs haven't been needed since bug 824970 landed.

nsCSSPropertiesQS has been unused since bug 801083 at least.

The various includes being removed are either fully on WebIDL now or using WebIDL quickstubs.
2013-01-29 12:52:09 -05:00
Boris Zbarsky
e53ffbf3f0 Bug 824589. Convert XULElement to WebIDL. r=peterv
The assertions in nsINode and nsWrapperCache are to eagerly catch
failures to override those methods.

The classinfo change for XULTreeBuilder is needed because one of those
is returned via an nsIXULTemplateBuilder attribute on XULElement.
Alternately, I could mark it notflattened in Bindings.conf, but Enn
said he prefers this anyway.

The change to the QI impl in BindingUtils is needed because when
XPConnect converts an IID from C++ to JS it makes is an nsJSID, not an
nsJSIID.  We've run into this before, sadly.

I removed "id" from nsIDOMXULElement because it's already on Element.
I suppose I could have left it there, but this seems cleaner.

The nsJSIID::HasInstance changes are needed to support XBL-implemented
interfaces.  Sadly, this does mean that if the underlying object QIs
to something but we didn't put those props on the WebIDL we'll end up
testing true for instanceof but not exposing the props.  I don't see
an obviously better way.  We should work on killing off uses of
"instanceof someinterface".

The browser.js change is needed to avoid throwing exceptions during
browser-chrome tests that are now getting reported because our
swapFrameLoaders is no longer an XPConnect method.
2013-01-29 12:51:55 -05:00
Boris Zbarsky
e15be64167 Back out bug 824589 (rev 22695cac3896) on suspicion of Ts regression 2013-01-29 17:18:06 -05:00
Boris Zbarsky
3ce404fddd Back out bug 829867 (rev 2a0424e177c1) on suspicion of Ts regression 2013-01-29 17:17:37 -05:00
Terrence Cole
812eb2db9f Bug 706885 - Rework Rooting APIs to preserve all available type information; r=billm 2013-01-28 18:25:23 -08:00
Boris Zbarsky
d29ed299fd Bug 829867. Unpref PaintRequest and Screen WebIDL bindings and remove some cruft from quickstubs. r=peterv
nsIDOMCharacterData and nsIDOMText quickstubs are not needed after bug 826703.

nsIDOMRect quickstubs haven't been needed since bug 824970 landed.

nsCSSPropertiesQS has been unused since bug 801083 at least.

The various includes being removed are either fully on WebIDL now or using WebIDL quickstubs.
2013-01-29 12:52:09 -05:00
Boris Zbarsky
24d3443115 Bug 824589. Convert XULElement to WebIDL. r=peterv
The assertions in nsINode and nsWrapperCache are to eagerly catch
failures to override those methods.

The classinfo change for XULTreeBuilder is needed because one of those
is returned via an nsIXULTemplateBuilder attribute on XULElement.
Alternately, I could mark it notflattened in Bindings.conf, but Enn
said he prefers this anyway.

The change to the QI impl in BindingUtils is needed because when
XPConnect converts an IID from C++ to JS it makes is an nsJSID, not an
nsJSIID.  We've run into this before, sadly.

I removed "id" from nsIDOMXULElement because it's already on Element.
I suppose I could have left it there, but this seems cleaner.

The nsJSIID::HasInstance changes are needed to support XBL-implemented
interfaces.  Sadly, this does mean that if the underlying object QIs
to something but we didn't put those props on the WebIDL we'll end up
testing true for instanceof but not exposing the props.  I don't see
an obviously better way.  We should work on killing off uses of
"instanceof someinterface".

The browser.js change is needed to avoid throwing exceptions during
browser-chrome tests that are now getting reported because our
swapFrameLoaders is no longer an XPConnect method.
2013-01-29 12:51:55 -05:00
Nils Maier
05cea1012b Bug 761552 - Part 2: Avoid external JS strings in XPCConvert. r=bholley
XPCConvert needs to convert some string types to JS strings in order to call
from C++ into JS land. Make those converted JS strings allocate the buffers
from the JS compartment memory pool, instead of making them external and
allocated from the main heap.
This improves memory reporting and may also influence memory fragmentation
and/or performance.
2013-01-29 10:50:04 -05:00
Boris Zbarsky
ffb6f4551e Bug 829252 followup. Now that WindowRoot has a wrapper cache, we need to be able to deal with ConstructSlimWrapper on things that have no classinfo. r=peterv pending, but landing on CLOSED TREE now to fix orange. 2013-01-29 10:18:05 -05:00
Boris Zbarsky
634d722804 Bug 834877 part 3. Add faster DOMString-to-JS conversion code. r=peterv 2013-01-29 09:42:14 -05:00
Boris Zbarsky
42d12beb79 Bug 829252 part 4. Turn on the EventTarget quickstubs. r=peterv 2013-01-29 08:44:01 -05:00
Nathan Froyd
e1f9ebca82 Bug 835358 - remove unused member nsXPConnect::mScopes; r=bholley
--HG--
extra : rebase_source : 7c5c2152666c9b8eb8860db4d7e39c274f772b5b
2013-01-28 10:37:57 -05:00
Peter Van der Beken
105d61cacc Fix for bug 715156 (JS code no longer work for select options as array in a Greasemonkey script (index and name setters don't really work via XrayWrapper)). r=bz.
--HG--
extra : rebase_source : 2ced75b6d49dbab5afe9a6ce7c322bf18a634026
2013-01-14 11:29:48 +01:00
Ed Morley
19dd19ed37 Backout f3c145bd1dd2 & 5075690572a9 for OS X startup failures 2013-01-28 11:08:21 +00:00
Peter Van der Beken
18764acd4b Fix for bug 715156 (JS code no longer work for select options as array in a Greasemonkey script (index and name setters don't really work via XrayWrapper)). r=bz.
--HG--
extra : rebase_source : 6bc420bd917e00a49dc5f6f3de13ff9e290c9580
2013-01-14 11:29:48 +01:00
Kyle Machulis
8a6e862a23 Bug 777271 - Re-implement nsIDOMCallEvent using event implementation codegen. r=bent,vicamo,hsinyi 2013-01-28 15:39:50 +08:00
Bill McCloskey
0b41061a2c Bug 751618 - Add js/GCAPI.h (r=terrence) 2013-01-27 12:35:12 -08:00
Jan de Mooij
223b6a2efc Bug 833817 part 3 - Replace JSStackFrame with JSAbstractFramePtr. r=luke 2013-01-25 09:49:29 +01:00
Jon Coppeard
49c07872fb Bug 815542 - crash in IncrementalCollectSlice r=billm
--HG--
extra : rebase_source : d751b3684f6461b094278aa39508417928c2b660
2013-01-25 09:56:04 +00:00
Bobby Holley
29dd20ec7d Bug 833856 - Handle errors better in EvaluateString. r=bz
This bug happens when we take the !useSandbox path. Basically, when the code
throws, we can end up with garbage in *aRetValue while still returning true
from EvaluateString. It looks like the convention is for these kind of eval
functions to return success even for invalid code, so lets just make sure we
check things a bit better.

This crashtest is kind of half-baked in the sense that it doesn't actually
crash without the rest of the patch. But the testcase here involves a lot of
undefined behavior (what ends up getting left in *aRetValue) during a call
to window.open (which spins the event loop, etc). I already sunk about half
an hour into trying to make it crash, so I'm just going to go with this for
now.
2013-01-25 11:17:40 +01:00
Bobby Holley
bc4863413b Bug 823348 - Tests. r=mrbkap
We tack these onto the tests from bug 812415, adding coverage for
nsExpandedPrincipal and making sure that the waivers are deep.

We also take the opportunity to check the asymmetric security
relationship between a principal and its corresponding nsEP.
2013-01-23 06:04:39 +01:00
Bobby Holley
ded682bc4a Bug 823348 - Stop checking for Xray waivers in the Xray machinery. r=mrbkap
All the casese where we want to waive should now be going through WaiveXrayWrapper.
2013-01-23 06:04:39 +01:00
Bobby Holley
4e3138cf29 Bug 823348 - Replace security wrapper enumeration with a more rule-based approach. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
f7f57d1c83 Bug 823348 - Hoist special cases to the top of WrapperFactory::Rewrap. r=mrbkap
This paves the way for more rule-based selection of wrappers in the common case.
2013-01-23 06:04:39 +01:00
Bobby Holley
0d89c821ca Bug 823348 - Move COW prototype remapping out of wrapper selection. r=mrbkap
It's pretty orthogonal, and makes the critical block more complicated than it
needs to be.
2013-01-23 06:04:39 +01:00
Bobby Holley
08c058f711 Bug 823348 - Precompute various parameters in Rewrap. r=mrbkap
This is generally cleaner, and avoids potentially calling these functions
multiple times when we start moving this stuff around.
2013-01-23 06:04:39 +01:00
Bobby Holley
39b3f7c72e Bug 823348 - Use GetXrayType for content->chrome Xray wrappers. r=mrbkap
There's no reason to do this any different than we do for XOWs and such. The
only thing this might conceivably support would be certain chrome XPWNs-as-COWs.
But that would require that they forced a parent in precreate without being
flagged as DOM objects in classinfo. And it's not clear why we'd want to support
that. And we're generally moving away from COWs anyway.
2013-01-23 06:04:39 +01:00
Bobby Holley
69822a012d Bug 823348 - Use EnsureCompartmentPrivate In Rewrap and stop checking for null. r=mrbkap 2013-01-23 06:04:39 +01:00
Bobby Holley
c3882ecf88 Bug 823348 - Flip off the wantXrays for chrome sandboxes. r=mrbkap
wantXrays means that the sandbox wants Xray wrappers even when accessing same-
origin content. The default is true, which Blake says has something to do with
GreaseMonkey and days of old.

This flag never had an effect for chrome, because the chrome->chrome case always
short-circuited to &CrossCompartmentWrapper::singleton. But once we start
respecting the flag as a general-purpose indicator that Xrays should be applied
same-origin, we need to either add a special case in Rewrap or make the flag reflect
reality. The latter seems cleaner and more sane.

However, things are complicated by the fact that there's also a completely different,
orthogonal usage, whereby setting wantXrays to false implicitly waives Xray on the
returned sandbox _and_ on any results returned from evalInSandbox. This is just nuts.
The former can be accomplished by callers manually using .wrappedJSObject, and the
latter by having EvalInSandbox transitively apply waivers from their sandbox arguments.

I've updated the documentation on the MDN page so that it only describes the
reasonable usage. The next step is to get rid of the crazy behavior. I think the
best path of migration is to have wantXrays: false keep implicitly waiving, but
waive return values from EvalInSandbox based on whether the argument was waived. This
patch does that.
2013-01-23 06:04:39 +01:00
Bobby Holley
44a21fc15a Bug 823348 - Make NNXOWs use an explicitly opaque Policy. r=mrbkap
There's no reason to be doing a dynamic check here, given that the JSClasses
will never match. Lets be explicit and safe.
2013-01-23 06:04:38 +01:00
Bobby Holley
ddece7045a Bug 823348 - Do a better job of lying about the holder and make assertions fatal. r=mrbkap
I noticed this nonfatal assertion firing, unrelated to my patches. Leaking
the holder is not so great. Let's fix this for real.
2013-01-23 06:04:38 +01:00
Bobby Holley
d0a9794947 Bug 823348 - Remove broken and unused __scriptOnly__ check. r=mrbkap
__scriptOnly__ is unused on mxr and addons-mxr. Morevoer, the current
implementation is totally broken, because we check for NNXOW, which only
happens when a random content JS object ends up in some other cross-origin
scope (via addons, presumably), whereas chrome objects use ChomeObjectWrapper.

I'm soon going to replace SCRIPT_ACCESS_ONLY with checked unwrapping, and mark
all COWs as unsafe to unwrap (see bug 821573 and bug 658909). So let's just kill
this thing here.
2013-01-23 06:04:38 +01:00
Bobby Holley
c0cc2fa626 Bug 823348 - Don't set universalXPConnectEnabled for chrome compartments. r=mrbkap
There's a browser-chrome test that does this, which means that _all_ subsequent
browser-chrome tests inherit it. So depending on the ordering of cases in
WrapperFactory, we might end up using a CrossCompartmentWrapper rather than an
XrayWrapper, meaning that stuff like nodePrincipal doesn't work anymore.

The semantics of UniversalXPConnect are now entirely dicatated by what makes
our test suite go green. So let's not force ourselves to bend over backwards
during wrapping to handle this case. And let's fix that stupid test while
we're at it.
2013-01-23 06:04:38 +01:00
Bobby Holley
71cfd0816b Bug 823348 - Uninline UniversalXPConnect management. r=mrbkap
Every time the layout of CompartmentPrivate changes, I forget to rebuild in
caps/ and spend half an hour wondering what the heck is going on. :-(
2013-01-23 06:04:38 +01:00
Ehsan Akhgari
94b2981ab9 Bug 833631 - Unprefix mozAudioContext; r=roc
--HG--
extra : rebase_source : 3c477a97ea842a806f6fad6f5c3a81d6e50b27c3
2013-01-22 20:12:21 -05:00
Steve Fink
d3f194fbfb Bug 828753 - jsid rooting, mostly in jsinfer.*. Also switch JSObject from struct to class. r=terrence 2012-12-31 12:40:21 -08:00
Terrence Cole
6b98628bf0 Bug 803182 - Make the js shell stack limit match the browser's; r=dmandelin
This should help ensure that recursion errors found in the shell actually
represent real errors. This also attempts to account for the difference in size
between debug and optimized builds to the size of js::Interpret's stack frame.
2012-10-29 13:36:41 -07:00
Irving Reid
e97ded2b9d Bug 818958: Tell SPSProfiler when the JS runtime shuts down r=luke 2013-01-18 12:04:35 -05:00
Nicholas Nethercote
9ffa66e982 Bug 832026 - Measure JSRuntime::bumpAlloc_ in the JS memory reporter. r=sstangl.
--HG--
rename : js/src/tests/lib/jittests.py => js/src/jit-test/jit_test.py
rename : layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1-ref.html => layout/reftests/css-calc/background-image-gradient-1-ref.html
rename : layout/reftests/w3c-css/submitted/values3/calc-background-image-gradient-1.html => layout/reftests/css-calc/background-image-gradient-1.html
rename : layout/reftests/w3c-css/submitted/values3/reftest.list => layout/reftests/css-calc/reftest.list
rename : layout/reftests/text/auto-hyphenation-10-ref.html => layout/reftests/text/auto-hyphenation-10.html
rename : layout/reftests/text/auto-hyphenation-8-ref.html => layout/reftests/text/auto-hyphenation-8.html
rename : layout/reftests/text/auto-hyphenation-9-ref.html => layout/reftests/text/auto-hyphenation-9.html
rename : services/common/servicesComponents.manifest => services/sync/SyncComponents.manifest
extra : rebase_source : 6b9d955241e189e52c6145f3fb4c3169ec834b78
2013-01-17 17:50:21 -08:00
Boris Zbarsky
2837c731e6 Bug 823228 part 2. Move indexed property access on windows from nsWindowSH::GetProperty to the outer window proxy. r=bholley 2013-01-17 12:30:37 -05:00
Bobby Holley
1d5c9aeac3 Bug 824864 - Implement nsContentUtils::GetObjectPrincipal. r=bz
The SSM interface is super awkward.
2013-01-16 18:50:25 -08:00
Trevor Saunders
b98e34aed0 bug 822289 - remove NS_IMPL_CYCLE_COLLECTION_CLASS and friends r=mccr8 2013-01-12 07:40:33 -05:00
Andrew McCreight
30ded1b75a Bug 829430 - Use the right check for if we're GCing. r=billm 2013-01-15 09:10:36 -08:00
Mats Palmgren
0ae685efa9 Bug 786533 - On Windows, one of the system header files (windef.h) defines 'min' and 'max' as macros which breaks any use of std::min/std::max. Define NOMINMAX before including system header files where needed to avoid defining those macros. r=ehsan 2013-01-15 13:22:03 +01:00
Mats Palmgren
d5826be6d7 Bug 786533 - Replace NS_MIN/NS_MAX with std::min/std::max and #include <algorithm> where needed. r=ehsan 2013-01-15 13:22:03 +01:00