Граф коммитов

4767 Коммитов

Автор SHA1 Сообщение Дата
Bogdan Tara dee73f16c3 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2019-02-12 00:01:16 +02:00
Boris Zbarsky afcd9842ec Bug 1525673. Don't assume that same-compartment means same-realm in WrapNewBindingNonWrapperCache. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D18863

--HG--
extra : moz-landing-system : lando
2019-02-11 13:33:23 +00:00
André Bargull b780900930 Bug 1526318: Assert the JSPropertySpec in XrayResolveAttribute has a native accessor function. r=bz 2019-02-08 07:06:42 -08:00
Boris Zbarsky d9fc29464f Bug 1521907 part 5. Start using CheckedUnwrapStatic/Dynamic in XPConnect. r=peterv
I am not a huge fan of the UnwrapReflectorToISupports setup here.  Maybe we
should introduce two differently-named methods that make it somewhat clear what
the limitations of not taking a JSContext are?  I couldn't think of sane
naming...

Differential Revision: https://phabricator.services.mozilla.com/D17885

--HG--
extra : moz-landing-system : lando
2019-02-02 03:24:45 +00:00
Boris Zbarsky 7e5a37a024 Bug 1521907 part 3. Start using CheckedUnwrapStatic/Dynamic in bindings. r=peterv
The basic idea for the changes around UnwrapObjectInternal and its callers
(UnwrapObject, UNWRAP_OBJECT, etc) is to add a parameter to the guts of the
object-unwrapping code in bindings which can be either a JSContext* or nullptr
(statically typed).  Then we test which type it is and do either a
CheckedUnwrapDynamic or CheckedUnwrapStatic.  Since the type is known at
compile time, there is no actual runtime check; the compiler just emits a call
to the right thing directly (verified by examining the assembly output on
Linux).

The rest of the changes are mostly propagating through that template parameter,
adding static asserts to make sure people don't accidentally pass nullptr while
trying to unwrap to a type that might be a WindowProxy or Location, etc.

There are also some changes to places that were calling CheckedUnwrap directly
to use either the static or dynamic version, as needed.

Differential Revision: https://phabricator.services.mozilla.com/D17883

--HG--
extra : moz-landing-system : lando
2019-02-02 03:23:49 +00:00
Gurzau Raul 44e4d42e8a Backed out 7 changesets (bug 1521907) for failing at unit/test_bug1151385.js on a CLOSED TREE.
Backed out changeset ef04359ccf0d (bug 1521907)
Backed out changeset ac1c61bf61e9 (bug 1521907)
Backed out changeset df09b7be63c5 (bug 1521907)
Backed out changeset 585fa0024d46 (bug 1521907)
Backed out changeset e593c29aaff4 (bug 1521907)
Backed out changeset ac2e180a35b6 (bug 1521907)
Backed out changeset 270b1db9ea81 (bug 1521907)
2019-02-02 00:58:16 +02:00
Boris Zbarsky aaacae7c45 Bug 1521907 part 5. Start using CheckedUnwrapStatic/Dynamic in XPConnect. r=peterv
I am not a huge fan of the UnwrapReflectorToISupports setup here.  Maybe we
should introduce two differently-named methods that make it somewhat clear what
the limitations of not taking a JSContext are?  I couldn't think of sane
naming...

Differential Revision: https://phabricator.services.mozilla.com/D17885

--HG--
extra : moz-landing-system : lando
2019-02-01 18:49:04 +00:00
Boris Zbarsky d061930645 Bug 1521907 part 3. Start using CheckedUnwrapStatic/Dynamic in bindings. r=peterv
The basic idea for the changes around UnwrapObjectInternal and its callers
(UnwrapObject, UNWRAP_OBJECT, etc) is to add a parameter to the guts of the
object-unwrapping code in bindings which can be either a JSContext* or nullptr
(statically typed).  Then we test which type it is and do either a
CheckedUnwrapDynamic or CheckedUnwrapStatic.  Since the type is known at
compile time, there is no actual runtime check; the compiler just emits a call
to the right thing directly (verified by examining the assembly output on
Linux).

The rest of the changes are mostly propagating through that template parameter,
adding static asserts to make sure people don't accidentally pass nullptr while
trying to unwrap to a type that might be a WindowProxy or Location, etc.

There are also some changes to places that were calling CheckedUnwrap directly
to use either the static or dynamic version, as needed.

Differential Revision: https://phabricator.services.mozilla.com/D17883

--HG--
extra : moz-landing-system : lando
2019-02-01 18:48:13 +00:00
Ciure Andrei 63b0f3f854 Backed out 7 changesets (bug 1521907) for JSObject Wrapper.cpp bustages and failures CLOSED TREE
Backed out changeset ce3108090e77 (bug 1521907)
Backed out changeset efd05f4979f1 (bug 1521907)
Backed out changeset 2d0895148907 (bug 1521907)
Backed out changeset 192152fe986a (bug 1521907)
Backed out changeset ca65b46b0d37 (bug 1521907)
Backed out changeset b3daf5ca3d11 (bug 1521907)
Backed out changeset 1b0a09a46c70 (bug 1521907)
2019-02-01 19:38:25 +02:00
Boris Zbarsky bed98f8c98 Bug 1521907 part 5. Start using CheckedUnwrapStatic/Dynamic in XPConnect. r=peterv
I am not a huge fan of the UnwrapReflectorToISupports setup here.  Maybe we
should introduce two differently-named methods that make it somewhat clear what
the limitations of not taking a JSContext are?  I couldn't think of sane
naming...

Differential Revision: https://phabricator.services.mozilla.com/D17885

--HG--
extra : moz-landing-system : lando
2019-02-01 16:17:44 +00:00
Boris Zbarsky a3784f4489 Bug 1521907 part 3. Start using CheckedUnwrapStatic/Dynamic in bindings. r=peterv
The basic idea for the changes around UnwrapObjectInternal and its callers
(UnwrapObject, UNWRAP_OBJECT, etc) is to add a parameter to the guts of the
object-unwrapping code in bindings which can be either a JSContext* or nullptr
(statically typed).  Then we test which type it is and do either a
CheckedUnwrapDynamic or CheckedUnwrapStatic.  Since the type is known at
compile time, there is no actual runtime check; the compiler just emits a call
to the right thing directly (verified by examining the assembly output on
Linux).

The rest of the changes are mostly propagating through that template parameter,
adding static asserts to make sure people don't accidentally pass nullptr while
trying to unwrap to a type that might be a WindowProxy or Location, etc.

There are also some changes to places that were calling CheckedUnwrap directly
to use either the static or dynamic version, as needed.

Differential Revision: https://phabricator.services.mozilla.com/D17883

--HG--
extra : moz-landing-system : lando
2019-01-31 15:50:06 +00:00
Jeff Gilbert ac012b5064 Bug 1522018 - Implement webgl draft ext EXT_float_blend. r=lsalzman,qdot
Differential Revision: https://phabricator.services.mozilla.com/D17336

--HG--
rename : dom/canvas/WebGLExtensionBase.cpp => dom/canvas/WebGLExtensions.cpp
extra : moz-landing-system : lando
2019-01-31 23:39:12 +00:00
Boris Zbarsky df186a33e6 Bug 1524041. Update the regexp for Web IDL identifiers to spec changes. r=qdot
See https://github.com/heycam/webidl/issues/632 and
https://github.com/heycam/webidl/pull/633

Differential Revision: https://phabricator.services.mozilla.com/D18125

--HG--
extra : moz-landing-system : lando
2019-01-31 19:19:00 +00:00
Kris Maglione e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Kris Maglione 2fe0de01dc Bug 1519596: Part 1 - Remove several unnecessary/unused ChromeUtils.import() calls. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D16377

--HG--
extra : rebase_source : 6c4311387d25de425806aeb6c4691e12c9fcb855
2019-01-11 16:59:23 -08:00
Jeff Walden 59aaefa333 Bug 1522350 - Move JS::ContextOptions{,Ref} to a new js/public/ContextOptions.h header to further slim jsapi.h. r=arai
--HG--
rename : js/src/jsapi.h => js/public/ContextOptions.h
2019-01-23 16:56:56 -08:00
Boris Zbarsky 5f472025a2 Bug 1520509. Remove the unused support for CrossOriginWritable=InterfaceName in Web IDL. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D16712

--HG--
extra : moz-landing-system : lando
2019-01-18 22:11:04 +00:00
Boris Zbarsky e5c8ead70a Bug 1363208 part 9. Remove now-unused cross-origin Xray infrastructure. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D15433

--HG--
extra : moz-landing-system : lando
2019-01-21 03:33:55 +00:00
Boris Zbarsky 46d5d31b59 Bug 1363208 part 7. Change the Location binding to inherit from MaybeCrossOriginObject. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D15431

--HG--
extra : moz-landing-system : lando
2019-01-21 04:26:13 +00:00
Boris Zbarsky 4dffd37187 Bug 1363208 part 6. Remove the NonOrdinaryGetPrototypeOf annotation. r=peterv
We can just check for a non-global object (so excluding Window) with cross-origin properties.

Differential Revision: https://phabricator.services.mozilla.com/D15430

--HG--
extra : moz-landing-system : lando
2019-01-21 03:33:16 +00:00
Boris Zbarsky c17e30f6b2 Bug 1363208 part 4. Stop using cross-origin Xrays for WindowProxy. r=peterv,jandem
The change to test_bug440572.html is due to a behavior change.  Specifically,
before this change, any IDL-declared property, even one not exposed
cross-origin, would prevent named frames with that name being visible
cross-origin.  The new behavior is that cross-origin-exposed IDL properties
prevent corresponding frame names from being visible, but ones not exposed
cross-origin don't.  This matches the spec and other browsers.

Same thing for the changes to test_bug860494.xul.

The wpt test changes are just adding test coverage for the thing the other
tests caught.

Differential Revision: https://phabricator.services.mozilla.com/D15428

--HG--
extra : moz-landing-system : lando
2019-01-21 03:30:31 +00:00
Boris Zbarsky 79d353e3bc Bug 1363208 part 2. Add a helper class for implementing the HTML requirements for cross-origin-accessible objects. r=jandem,peterv
Differential Revision: https://phabricator.services.mozilla.com/D15425

--HG--
extra : moz-landing-system : lando
2019-01-21 03:28:06 +00:00
Boris Zbarsky 67be15b8fc Bug 1363208 part 1. Add a MaybeWrapObject function that works on JSObject* instead of JS::Value. r=peterv,bholley
Differential Revision: https://phabricator.services.mozilla.com/D15424

--HG--
extra : moz-landing-system : lando
2019-01-21 03:24:42 +00:00
Paolo Amadini 788354b1e7 Bug 1516258 - Part 2 - Remove XULScrollElement. r=NeilDeakin
There is still styling associated with the "scrollbox" element, but eventually those instances can be replaced with simple boxes.

Differential Revision: https://phabricator.services.mozilla.com/D15298

--HG--
extra : rebase_source : 1ff8502e01df16e791c06b9cdcbe38fb2b55ccd7
2019-01-10 11:50:31 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 47a5dd1fb8 Bug 1519636 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D16388

--HG--
extra : moz-landing-system : lando
2019-01-16 08:50:07 +00:00
Neil Deakin cdf4a288ec Bug 1482389, remove tree box object special case in Codegen.py, r=bz 2019-01-14 20:59:34 -05:00
Neil Deakin cb10352f4b Bug 1482389, replace TreeBoxObject with XULTreeElement inherited from XULElement, r=peterv,paolo
--HG--
rename : dom/webidl/TreeBoxObject.webidl => dom/chrome-webidl/XULTreeElement.webidl
rename : layout/xul/tree/TreeBoxObject.cpp => dom/xul/XULTreeElement.cpp
rename : layout/xul/tree/TreeBoxObject.h => dom/xul/XULTreeElement.h
2018-12-04 11:25:30 -05:00
Jeff Walden 7883beee5b Bug 1517674 - Rename JS_NewDateObject and JS_ObjectIsDate to JS:: versions of the same, and move their declarations to js/public/Date.h and their implementations to js/src/jsdate.cpp. r=arai
--HG--
extra : rebase_source : 581fa2b7831ab09c33801f8e9a52a78566973ff4
2019-01-04 11:43:31 -06:00
Jeff Walden a128f0c35c Bug 1517624 - Move JSPropertySpec and JSFunctionSpec definitions into a new js/public/PropertySpec.h header. r=arai
--HG--
extra : rebase_source : b80911e01f984ee9f99fbbc6c4552ef3d2178587
2019-01-03 15:37:01 -06:00
Jorg K 64e5de9372 Bug 1353867 - Follow-up, take 2: revert rev c9a17c8a3c3f and add include of WindowProxyHolder.h where it was missing. r=bz 2019-01-03 09:11:00 +02:00
Ciure Andrei 7a748ae68f Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-01-04 01:03:06 +02:00
Boris Zbarsky 3c5a7b2986 Bug 1517415. We might be trying to JS-wrap a BrowsingContext with a torn-down-enough docshell that we have no window. r=nika
The old code did this check in GetContentWindow, basically.  We _could_ just put
the null-check there, but this seems safer.

Differential Revision: https://phabricator.services.mozilla.com/D15676

--HG--
extra : moz-landing-system : lando
2019-01-03 20:31:05 +00:00
Peter Van der Beken 066d891adb Bug 1353867 - Add cross-process proxies for WindowProxy. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D12656

--HG--
extra : moz-landing-system : lando
2019-01-02 13:29:18 +00:00
Peter Van der Beken b816d68b07 Bug 1353867 - Add code generation for array of cross origin properties. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D12654

--HG--
extra : moz-landing-system : lando
2019-01-02 13:28:06 +00:00
Peter Van der Beken 58c7fc4d20 Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky
Make the WindowProxyHolder hold a strong reference to a BrowsingContext, as in the future
we might not have a nsPIDOMWindowOuter (if the document is loaded in a different process).

Differential Revision: https://phabricator.services.mozilla.com/D12651

--HG--
extra : moz-landing-system : lando
2019-01-02 13:27:05 +00:00
Peter Van der Beken a17049feac Bug 1353867 - Change WindowProxy type. r=bzbarsky
Add a WindowProxyHolder type and generate binding code that takes or returns it whenever
the WebIDL refers to the WindowProxy type. This patch just makes the WindowProxyHolder
hold a strong reference to a nsPIDOMWindowOuter.

Differential Revision: https://phabricator.services.mozilla.com/D12650

--HG--
extra : moz-landing-system : lando
2019-01-02 13:26:56 +00:00
longsonr 5106b5cfcf Bug 1516727 - Part 2 rename SVGAngle to DOMSVGAngle r=jwatt
--HG--
rename : dom/svg/SVGAngle.cpp => dom/svg/DOMSVGAngle.cpp
rename : dom/svg/SVGAngle.h => dom/svg/DOMSVGAngle.h
2018-12-30 18:18:30 +00:00
Emilio Cobos Álvarez f131713362 Bug 1516366 - Move base classes from nsDocument to nsIDocument. r=smaug
This is a big step in order to merge both.

Also allows to remove some very silly casts, though it causes us to add some
ToSupports around to deal with ambiguity of casts from nsIDocument to
nsISupports, and add a dummy nsISupports implementation that will go away later
in the series.

Differential Revision: https://phabricator.services.mozilla.com/D15352
2018-12-29 20:41:28 +01:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
longsonr 2ea3c4dbf3 Bug 1516551 - Part 1 rename SVGTransform to DOMSVGTransform r=dholbert
--HG--
rename : dom/svg/SVGTransform.cpp => dom/svg/DOMSVGTransform.cpp
rename : dom/svg/SVGTransform.h => dom/svg/DOMSVGTransform.h
2018-12-28 17:20:15 +00:00
longsonr a19c169444 Bug 1516206 - Part 1 Move DOM lengths and numbers into the mozilla::dom namespace r=dholbert 2018-12-28 13:42:46 +00:00
Boris Zbarsky d6876ebbfa Bug 1515999. Remove the unused JSContext argument from GetArrayIndexFromId. r=peterv 2018-12-26 13:45:15 -08:00
longsonr 1a3007051c Bug 1516076 - Part 2 Rename SVGAnimatedTransformList to DOMSVGAnimatedTransformList r=dholbert
--HG--
rename : dom/svg/SVGAnimatedTransformList.cpp => dom/svg/DOMSVGAnimatedTransformList.cpp
rename : dom/svg/SVGAnimatedTransformList.h => dom/svg/DOMSVGAnimatedTransformList.h
2018-12-23 11:08:14 +00:00
longsonr 3d04ba9c9e Bug 1515187 - Part 4 Rename nsSVGElement to SVGElement and put it in the mozilla:dom namespace r=dholbert
--HG--
rename : dom/svg/nsSVGElement.cpp => dom/svg/SVGElement.cpp
rename : dom/svg/nsSVGElement.h => dom/svg/SVGElement.h
2018-12-21 08:58:14 +00:00
Jan de Mooij 2104ae00bb Bug 1514672 part 1 - Move XPCWrappedNativeScope from RealmPrivate to CompartmentPrivate. r=bzbarsky
This needs to be on the compartment to prevent creating duplicate wrapped natives.
We now also allocate these objects in the compartment's first global for
consistency and to prevent leaks.

XPCWrappedNativeScope also stores the content XBL scope. I considered moving
this to RealmPrivate, but given the fate of in-content XBL I went with the
simpler option of keeping it on XPCWrappedNativeScope and release-asserting we
have a single realm in the XBL case.

Because XPCWrappedNativeScope no longer stores a global object, we no longer
need XPCWrappedNativeScope::TraceSelf, XPCWrappedNativeProto::TraceInside and
XPC_WN_Proto_Trace.

Differential Revision: https://phabricator.services.mozilla.com/D14849

--HG--
extra : moz-landing-system : lando
2018-12-20 08:23:31 +00:00
Razvan Maries f658ebcbab Merge mozilla-inbound to mozilla-central a=merge 2018-12-20 07:04:06 +02:00
Andrew McCreight 0507792161 Bug 1471989 - Clear JSStackFrame's JS object pointer when the window goes away. r=bzbarsky
JSStackFrames are C++ objects that are exposed to chrome JS and keep
alive content JS. This means that if chrome JS leaks a stack frame
then a window can be leaked.

The basic idea of this patch is to think of JSStackFrames as
cross-compartment wrappers, and do a "hueyfix" on them by dropping the
content JS reference when the associated content window is closed.

To do that, this patch modifies the realm private to keep a list of
all live JSStackFrames that have been created with objects in that
realm. When we nuke that realm, we also clear out all of the JS
pointers from the registered stack frames on that realm.

This adds a hash table lookup to the JSStackFrame ctor and dtor, which
is hopefully not too much overhead.

The test works by intentionally leaking a JSStackFrame from chrome JS
and making sure that the window still goes away.

Differential Revision: https://phabricator.services.mozilla.com/D14880

--HG--
extra : moz-landing-system : lando
2018-12-19 19:42:04 +00:00
Peter Van der Beken 9ae4291779 Bug 1515319 - Allow record<DOMString, object> member in dictionary. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D14968

--HG--
extra : moz-landing-system : lando
2018-12-19 19:29:48 +00:00
Andreea Pavel f9260c6914 Backed out changeset b1fe3750580d (bug 1471989) for build bustages on a CLOSED TREE 2018-12-19 20:48:10 +02:00