Bug 859966 - Switch linux builds to gcc 4.7.2. r=gps
Bug 860941 - Remove mArgumentsLast. r=jst

I'm not sure what it used to do, but it sure doesn't do a damn thing now.
Bug 860941 - Add an explicit flag to track modal content windows. r=jst

Tracking this with CHROME_MODAL is problematic, because that gets inherited by
any dependent windows opened by the modal content window, which may or may not
be modal content windows themselves. Thankfully, we have a few free bits lying
around.
Bug 860941 - Clarify shutdown invariants in ~nsGlobalWindow. r=jst

While the mArguments invariant should hold for _outers_, it doesn't necessarily
hold for inners, so this assertion fires reliably in automation. If mCleanedUp
is true then mArguments is definitely null, so let's disentangle this from
mArguments and be clearer about the invariants we expect.
Bug 860941 - Remove unnecessary argument cleanup in nsGlobalWindow::DetachFromDocShell. r=jst

This function proceeds to invoke CleanUp(), which also cleans this stuff up.
Bug 860941 - Separate the handling of |dialogArguments| and |arguments|, and use IDL for the |dialogArguments| getter. r=jst

This patch is bigger than I'd like it to be, but there are a lot of interlocked
dependencies and I eventually decided it was easier to just lump it together.

The semantics of |showModalDialog|/|window.dialogArguments| (an web-exposed
HTML5 feature) and |openDialog|/|window.arguments| (a XUL-proprietary feature)
are quite different. The former is essentially a security-checked JSVal, while
the latter gets converted into an array. We handled them together in the old
world, which led to a lot of confusion and muddled semantics. This patch
separates them.

This patch also eschews the roundabout resolve hook for dialogArguments in favor
of returning them directly from the XPIDL getter. This better matches the
behavior in the spec, especially because it allows dialogArguments to live on
the outer as they're supposed to, rather than the first inner that happens to
end up in the docshell. All in all, this should make this all very
straightforward to convert WebIDL when the time comes.

The current spec on the origin checks here is pretty fictional, so I've filed
https://www.w3.org/Bugs/Public/show_bug.cgi?id=21932 to fix it. This patch
should more or less preserve the current security behavior.
Bug 860941 - Make dialogArguments default to |undefined| rather than |null|. r=jst

This is correct by my reading of the spec. Quoting:

The dialogArguments IDL attribute, on getting, must check whether its browsing
context's active document's origin is the same as the dialog arguments' origin.
If it is, then the browsing context's dialog arguments must be returned
unchanged. Otherwise, if the dialog arguments are an object, then the empty
string must be returned, and if the dialog arguments are not an object, then
the stringification of the dialog arguments must be returned.
Bug 860941 - Use DialogValueHolder for returnValue. r=jst

The spec currently has returnValue as a DOMString, but this doesn't match
reality given my testing. I filed [1] to fix it.

Note that nsGlobalModalWindow is already set up to CC mReturnValue. Since
we're swapping in another CC-ed container class, we don't need to make any
changes here.

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=21771
Bug 860941 - Stop clearing return values on navigation. r=jst

Since this stuff is a property on the browsing context, this only makes sense
as a security check. But now that we're using a DialogValueHolder, the origin
checks are taken care of. So we can kill this off.
Bug 860941 - Tests. r=jst

We augment the existing showModalDialog tests with test coverage for
dialogArguments and returnValue.
Bug 860941 - Remove assertion annotations for the now-removed mArguments assertion. r=jst