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

647 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini d9e70a0be6 Bug 1492036 - Reporting API - part 4 - Reporting, r=smaug 2018-11-14 20:02:33 +01:00
Andrea Marchesini db43f2464c Bug 1492036 - Reporting API - part 3 - Deprecate reports, r=smaug 2018-11-14 20:02:33 +01:00
Boris Zbarsky 39b5c78c43 Bug 1505468. Add more ClearDocumentDependentSlots instrumentation to see why Document.prototype creation fails. r=mccr8 2018-11-07 14:06:05 -05:00
Boris Zbarsky 006e812485 Bug 1503664. Keep trying to pin down why ClearDocumentDependentSlots is crashing. r=mccr8 2018-10-31 20:25:35 -04:00
Nika Layzell 84828b5af3 Bug 1501124 - Switch BackstagePass to use WebIDLGlobalNameHash, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D9736
2018-10-25 10:24:36 -04:00
Nika Layzell 23c990d165 Bug 1500926 - Part 1: Use a statically generated perfect hash in WebIDLGlobalNameHash, r=bzbarsky
This strategy allows us to dodge dynamic allocations in WebIDLGlobalNameHash.
This removes the Init() and Shutdown() methods, as well as Register. The
RegisterBindings.cpp file now only contains static data and one method
declaration for the WebIDLGlobalNameHash class.

This should also be faster by making the hashtable lookup infallible.

Differential Revision: https://phabricator.services.mozilla.com/D9406
2018-10-24 20:11:01 -04:00
Boris Zbarsky bf4550903b Bug 1499150. Add some more ClearDocumentDependentSlots crash instrumentation. r=mccr8 2018-10-15 14:40:14 -04:00
Boris Zbarsky c7f7303059 Bug 1496805. Add some more instrumentation to try to pin down why ClearDocumentDependentSlots crashes. r=mccr8 2018-10-05 15:59:43 -04:00
Alexander Surkov bdd3f4e880 Bug 1494230 - replace #text-base binding by webidl control, r=smaug 2018-10-01 11:37:39 +08:00
Andrew McCreight fee317ab0d Bug 1351501, part 2 - Preserve wrappers for non-nsISupports cycle collected weak map keys r=bzbarsky
A C++ object that is exposed to JS can have its reflector used as a
key in a weak map. Because a weak map does not keep its keys alive,
this means that the reflector can be discarded if it has no other
references aside from the C++ object, which will in turn remove its
weak map entry. If the C++ object can be accessed again later from JS,
it will get a new reflector which will have no weak map entry. This is
bad because it means some internal implementation detail has resulted
in data loss that is visible to JS. (Side note: this is also an issue
for cross compartment wrappers, which is handled by another
mechanism.)

To fix this, we can preserve the wrapper of any DOM reflector used as
a weak map key. This ensures that the reflector and its C++ object
have the same lifetime. If a WebIDL object is not wrapper cached, that
means that it cannot be accessed via C++, so we don't need to preserve
the wrapper. This is currently implemented for nsISupports classes,
but not other classes. For non-nsISupports classes, it would throw an
error rather than silently fail.

My patch adds support for non-nsISupports cycle collected objects. It
turns out that the existing addProperty hook just does wrapper
preservation, so we just call it for cycle collected classes. This
does mean that if addProperty changes in the future to do something
else, this code will need to be changed.

I verified that this test fails if TryPreserveWrapper is changed to do
nothing besides return true in the non-nsISuports case.

Depends on D6197

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

--HG--
extra : moz-landing-system : lando
2018-09-21 18:20:35 +00:00
Andrew McCreight 2abe1a8480 Bug 1351501, part 1 - Handlify TryPreserveWrapper r=bzbarsky
The patch in the next part will need a handle to the object in
TryPreserveWrapper.

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

--HG--
extra : moz-landing-system : lando
2018-09-21 18:20:33 +00:00
Emma Malysz 696ceb303f Bug 1465219, use XULMenuElement, a subclass of nsXULElement, instead of MenuBoxObject for menu and menulist elements, r=paolo,bz
MozReview-Commit-ID: 5253hAlxbhw

--HG--
rename : dom/webidl/MenuBoxObject.webidl => dom/chrome-webidl/XULMenuElement.webidl
rename : layout/xul/MenuBoxObject.cpp => dom/xul/XULMenuElement.cpp
rename : layout/xul/MenuBoxObject.h => dom/xul/XULMenuElement.h
2018-07-31 12:30:17 -07:00
Jan de Mooij cb90b553cd Bug 1487032 - Store origin/site info in CompartmentPrivate. r=bholley
This will let us answer the following questions (in a performant way):

1) What's the compartment's origin? Necessary to implement compartment-per-origin.
2) What's the origin's site? Necessary for the new Wrap() algorithm.
3) Has any realm in the compartment set document.domain? Necessary for the new Wrap() algorithm.

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

--HG--
extra : moz-landing-system : lando
2018-09-11 09:01:14 +00:00
Edgar Chen 0773815846 Bug 1487343 - Correct set the prefix for an autonomous custom element; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4871

--HG--
extra : moz-landing-system : lando
2018-09-03 22:13:35 +00:00
Jeff Walden e4f79e2a19 Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem 2018-08-20 07:54:45 -07:00
Jeff Walden cd10720691 Bug 1040316 - Move AutoStableStringChars out of friendapi into public API. r=jandem
--HG--
extra : rebase_source : 3f66710e9517aba203a3d5365f6c3f0102c7baf8
2018-08-20 07:44:44 -07:00
Henri Sivonen 3a52652295 Bug 1349528 - Use encoding_rs for normalizing USVString. r=smaug
MozReview-Commit-ID: 9uG6j8UdfKR

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

--HG--
extra : moz-landing-system : lando
2018-08-16 10:15:07 +00:00
Dave Townsend fd8d6b1590 Bug 1480465: Infer the namespace for custom elements at definition time by following the class hierarchy. r=smaug
When a custom element is defined we can check whether its class is an instance
of XULElement or HTMLElement and tag the defintion with a namespace accordingly.
This allows us to know the correct namespace for the custom element when
created.

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

--HG--
extra : moz-landing-system : lando
2018-08-15 10:31:16 +00:00
Jan de Mooij 5824a03a39 Bug 1478359 - Store a global object in nsXPCWrappedJS and use it for realm-entering. r=mccr8
The problem we're solving here: getting/entering the realm/global of a cross-compartment wrapper doesn't make sense once there are multiple realms in a compartment and the CCW will be shared by all of them. Because nsXPCWrappedJS can store a CCW, we will no longer be able to use this JSObject to enter the target realm.

What this patch does: we pass a JSContext* to nsXPCWrappedJS::GetNewOrUsed and we use this to store a global object in nsXPCWrappedJS (with the invariant that the object and global stored in nsXPCWrappedJS are same-compartment). Then when we want to enter the nsXPCWrappedJS's target realm, we use this global object instead of the maybe-CCW object. Because we currently still have one realm per compartment and the objects are same-compartment, this is guaranteed to preserve behavior for now.

nsXPCWrappedJS has some code to deal with weak pointers. Fortunately this applies only to root wrappers and root wrappers always store an unwrapped JSObject, so the extra global we store is guaranteed to be marked by the GC in that case (a global object is never collected when there are live JSObjects belonging to the same realm).
2018-08-07 11:57:41 +02:00
Narcis Beleuzu 4684ccf98e Merge inbound to mozilla-central. a=merge 2018-08-03 01:28:14 +03:00
Dave Townsend 0f27a04f08 Bug 1480195: Allow writing custom element definitions for the special XUL elements. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D2430

--HG--
extra : moz-landing-system : lando
2018-08-02 14:49:04 +00:00
Jan de Mooij b79494e142 Bug 1479363 part 2 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in dom/bindings. r=bz 2018-08-02 08:48:50 +02:00
Jan de Mooij 80adc67aba Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Andreea Pavel 10f6df7c1f Merge mozilla-central to autoland. a=merge on a CLOSED TREE
--HG--
rename : dom/webidl/ScrollBoxObject.webidl => dom/chrome-webidl/XULScrollElement.webidl
rename : layout/xul/ScrollBoxObject.cpp => dom/xul/XULScrollElement.cpp
rename : layout/xul/ScrollBoxObject.h => dom/xul/XULScrollElement.h
2018-07-13 00:53:43 +03:00
Emma Malysz ce8c74748f Bug 1454358, removes unneccessary implementation of ScrollBoxObject rr?enndeakin+6102 r=bz,enndeakin+6102
MozReview-Commit-ID: LBQ0RoS0ZVc

--HG--
rename : dom/webidl/ScrollBoxObject.webidl => dom/chrome-webidl/XULScrollElement.webidl
rename : layout/xul/ScrollBoxObject.cpp => dom/xul/XULScrollElement.cpp
rename : layout/xul/ScrollBoxObject.h => dom/xul/XULScrollElement.h
extra : rebase_source : 6a0de76dfdacbc29d261a4aea703a44f87ad7e12
2018-06-25 10:11:31 -07:00
Bogdan Tara 6dbc2726d8 Backed out changeset b099e7e0b264 (bug 1454358) for build bustages on Element.h CLOSED TREE
--HG--
rename : dom/chrome-webidl/XULScrollElement.webidl => dom/webidl/ScrollBoxObject.webidl
rename : dom/xul/XULScrollElement.cpp => layout/xul/ScrollBoxObject.cpp
rename : dom/xul/XULScrollElement.h => layout/xul/ScrollBoxObject.h
2018-07-12 01:50:53 +03:00
Emma Malysz c28a132d13 Bug 1454358, removes unneccessary implementation of ScrollBoxObject rr?enndeakin+6102 r=bz,enndeakin+6102
MozReview-Commit-ID: LBQ0RoS0ZVc

--HG--
rename : dom/webidl/ScrollBoxObject.webidl => dom/chrome-webidl/XULScrollElement.webidl
rename : layout/xul/ScrollBoxObject.cpp => dom/xul/XULScrollElement.cpp
rename : layout/xul/ScrollBoxObject.h => dom/xul/XULScrollElement.h
extra : rebase_source : ad00e7030e50229975b0bc0d3c622af4fe244a79
2018-06-25 10:11:31 -07:00
Andi-Bogdan Postelnicu 88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Jan de Mooij d11d85a23c Bug 1472973 part 13 - Use JS::GetNonCCWObjectGlobal in BindingUtils. r=bz 2018-07-12 12:14:38 +02:00
Jan de Mooij 09149a5c4a Bug 1472973 part 3 - Remove some GetGlobalForObjectCrossCompartment calls on globals/WindowProxy. r=bz 2018-07-06 18:16:23 +02:00
Jan de Mooij a51f9bdda9 Bug 1472973 part 2 - Use JS::GetNonCCWObjectGlobal in some functions where we unwrapped the object. r=bz 2018-07-06 18:16:23 +02:00
Neil Deakin f08f9ce4af Bug 1437638, move frame, browser and editor to be based on XULFrameElement, a new subclass of XULElement, r=paolo,bz 2018-07-05 20:14:18 -04:00
Arnaud Bienner bd000427cf Bug 1466182 - Add AudioWorkletProcessor definitions. r=baku,karlt
MozReview-Commit-ID: 1KKrUqRY2qf

--HG--
extra : rebase_source : c287e1c4952f0f9a28dd39879d35bf37d6ce50d2
2018-06-24 20:02:47 +02:00
André Bargull 781fc92292 Bug 1471900: Change return type of JS_EncodeStringToBuffer to bool. r=jandem 2018-06-28 07:35:20 -07:00
Ben Kelly 818897b5a1 Bug 1471303 Fix CopyableErrorResult::operator==() to actually compile with ipdl types. r=bz 2018-06-27 06:51:24 -07:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Andrea Marchesini 037d3a703f Bug 1455256 - Port more components to WorkerRef - part 1 - WorkerProxyToMainThreadRunnable, r=asuth 2018-06-18 16:37:21 -04:00
Jan de Mooij f7fb3be6ec Bug 1466121 part 1 - Rename JSCompartment to JS::Compartment. r=luke
--HG--
extra : rebase_source : cd7140ecda54f0caa02a96f562167b3c9a107450
2018-06-07 16:44:40 +02:00
Jan de Mooij 09c4068fa0 Bug 1464134 part 1 - Fix various places to use Realm instead of JSCompartment. r=luke 2018-05-31 11:28:48 +02:00
Jan de Mooij 7148cd7d35 Bug 1464036 - Remove PropertyInfo constructor to keep MSVC from generating static initializers. r=bz
--HG--
extra : rebase_source : c59d1878615029c7c8b075f4ec288daef77414c6
2018-05-26 14:14:10 +02:00
Peter Van der Beken 0a2e4b8cb7 Bug 1146316 - Remove nsWrapperCache::SetIsNotDOMBinding and IsDOMBinding(). r=bz.
--HG--
extra : rebase_source : cd36e7afb4f6ebcd042ea40d9403546a683375ad
2018-04-05 17:22:41 +02:00
Timothy Guan-tin Chien 08741f30ed Bug 1460962 - Support customized built-in element in XUL r=smaug
This patch enables us to specify a custom element type with |is| attribute
or property when creating a XUL element. Because non-dashed names are valid
custom element names in XUL (bug 1446247), other checks has to modified
accordingly.

The checks I am settling with are
1) Forbids the custom built-in element names to be a non-dashed name.
2) Forbids the custom built-in element to extend a dashed built-in element name.

This also ensures the custom built-in element types don't take on the same
name as the element name it extends.

MozReview-Commit-ID: GCQ9RnfvvrC

--HG--
extra : rebase_source : 2fa13742525d2107580d50872ff5b0fc42539498
extra : source : 2dc5513660d78a4de4801109140743ffc9297f71
2018-05-11 12:44:46 -07:00
Boris Zbarsky fd520f957c Bug 1424160 part 2. Add infrastructure for defining @@toStringTag on Web IDL prototypes. r=qdot 2018-05-17 23:45:35 -04:00
Boris Zbarsky 85cfd5fbdf Bug 1375829 part 2. The default binding toJSON should skip over attributes that are not exposed in the current global. r=qdot
Without this, we will start including mozMemory in performance.toJSON() even if
the pref for it is not set, once 'object' becomes a JSON type.

This changes behavior in the following observable ways:

1) We stop exposing PerformanceResourceTiming's .serverTiming in the JSON
serialization in insecure contexts.

2) We stop exposing PerformanceTiming's timeToNonBlankPaint and
timeToDOMContentFlushed in the JSON serialization unless the relevant
preferences are turned on.
2018-05-17 23:39:52 -04:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Neil Deakin e25f02a7f3 Bug 1446961, restructuring to allow nsXULElement to be subclassed. Rename nsXULElement::Create to make it clearer it creates from the prototype element, r=bz 2018-04-27 11:04:37 -04:00
Ben Kelly d4090dc614 Bug 1357463 Add CopyableErrorResult to opt in to auto-cloning ErrorResult values. r=bz 2018-04-26 13:50:56 -07:00
Boris Zbarsky 8baa26a2af Bug 1457051. The WebIDL isInstance should be a pure brand check, not an instanceof-like check. r=qdot 2018-04-26 01:38:07 -04:00
Jeff Walden 04d21ccac0 Bug 1451248. r=jorendorff, r=bz
--HG--
extra : rebase_source : e26439a5954162bdaf332fbd63d623a3810e19e0
2018-04-25 19:40:09 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00