Commit Graph

5844 Commits

Author SHA1 Message Date
Cristian Tuns
a583e0e387 Backed out changeset 6ff09962db9e (bug 1792655) for causing mochitest failures in test_bug1123516_maplikesetlike.html CLOSED TREE 2022-11-24 10:27:15 -05:00
Peter Van der Beken
f650e7dd34 Bug 1792655 - Make maplike<> and setlike<> generated methods enumerable. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D162860
2022-11-24 14:35:35 +00:00
Jan Varga
7ce6e92fa1 Bug 1790207 - Change nsIGlobalObject::GetStorageKey to return NS_ERROR_NOT_AVAILABLE by default; r=dom-storage-reviewers,jesup,asuth
nsGlobalWindowInner, WorkerGlobalScopeBase, BackstagePas and SandboxPrivate now
explicitly provide GetStorageKey implementation which explicitly block null and
expanded principals. All other globals (nsGlobalWindowOuter, SimpleGlobalObject,
ShadowRealmGlobalScope and WorkletGlobalScope) inherit the default
implementation which returns NS_ERROR_NOT_AVAILABLE.

Differential Revision: https://phabricator.services.mozilla.com/D162087
2022-11-15 17:13:01 +00:00
Randell Jesup
229303901a Bug 1790207: Provide cross-origin security checks for OPFS r=nika,asuth
Differential Revision: https://phabricator.services.mozilla.com/D157892
2022-11-15 17:13:01 +00:00
Peter Van der Beken
96f97d1609 Bug 1796832 - Assertion failure: !mMightHaveUnreportedJSException in IterableIterator.cpp. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D161475
2022-11-08 06:09:45 +00:00
Kagami Sascha Rosylight
79c944ca42 Bug 1798369 - Part 1: Esmify dom/bindings/test/TestInterfaceJS.jsm r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D160824
2022-11-01 12:05:23 +00:00
Edward Thomas
cd3bf16625 Bug 1622677 - Make dom/bindings flake8 compliant. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D160280
2022-10-31 17:45:33 +00:00
Sean Feng
6181fdcbf8 Bug 1785331 - Allow partially implemented ORB to be used in Nightly r=emilio,smaug,necko-reviewers,valentin
This patch starts to actually blocking opaque responses
for most type of the resources that are defined in the spec.
There are still pieces missing such as blocking JSON responses,
and this is why it's called partially implemented.

This patch was originally written by farre, and I made some
modifications based on it.

Depends on D155128

Differential Revision: https://phabricator.services.mozilla.com/D155129
2022-10-27 19:18:11 +00:00
Matthew Gaudet
47be3bc251 Bug 1726039 - Disallow setting private fields on MaybeCrossOrigin objects (HostEnsureCanPrivateElementAdd) r=peterv,jandem
Differential Revision: https://phabricator.services.mozilla.com/D122780
2022-10-26 21:53:36 +00:00
Peter Van der Beken
784ccbccdb Bug 1796804 - Make async iterables support compatible with MOZ_CAN_RUN_SCRIPT. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D159944
2022-10-22 09:42:27 +00:00
Peter Van der Beken
03a79b07d0 Bug 1794127 - Wrap errors from AsyncIterableNextImpl::GetNextResult/AsyncIterableReturnImpl::GetReturnPromise in a promise. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D158842
2022-10-17 16:26:23 +00:00
Tim Chevalier
2244e565d8 Bug 1765477: Allow wrapping ExtendedPrimitives in dom::MaybeWrapValue() r=edgar,nchevobbe
The dom::MaybeWrapValue() method was calling `isObject()` rather than
`hasObjectPayload()`, causing an assertion failure when passed a value
representing an ExtendedPrimitive (record or tuple). This was causing a crash
when evaluating a record or tuple literal either in the navigation bar or
the developer console. In addition, js::ToBooleanSlow() was missing a case
for ExtendedPrimitives, which would also cause an assertion failure in the
same scenario.

For documentation, I also added explicit assertions to dom::...Wrap...()
methods defined in BindingUtils.h that aren't expected to support
ExtendedPrimitives.

I also added placeholders for pretty-printing records and tuples in the
console (fully rendering these values is left for Bug 1772157).

Depends on D156494

Differential Revision: https://phabricator.services.mozilla.com/D148062
2022-10-12 15:00:35 +00:00
Peter Van der Beken
f8868855ed Bug 1792883 - Stop requiring a mutable handle for converting to a WebIDL union. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D158360
2022-09-30 06:40:26 +00:00
Peter Van der Beken
9e85242679 Bug 1792444 - Switch some WebIDL APIs from 'any' to a union with 'undefined'. r=edgar,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D158195
2022-09-28 19:10:51 +00:00
Edgar Chen
5151189f4d Bug 1784266 - Part 8: Hide union TrySetTo* methods; r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D156197
2022-09-28 08:56:09 +00:00
Edgar Chen
3410f7bc19 Bug 1784266 - Part 4: Generate init methods for union; r=peterv
And switch to use `Init` method in binding code.

Differential Revision: https://phabricator.services.mozilla.com/D156176
2022-09-28 08:56:07 +00:00
Edgar Chen
1aa03613fa Bug 1784266 - Part 3: Get rid of union conversion structure; r=peterv
TrySetTo* conversion methods are generated in the regular union structure now.

Differential Revision: https://phabricator.services.mozilla.com/D157327
2022-09-28 08:56:07 +00:00
Edgar Chen
82be3e6295 Bug 1784266 - Part 2: Stop using the union conversion structure to root Record/Sequence type; r=peterv
Remove the conditional *Rooter member in the union conversion structure and switch
the regular union structure to use Rooted* for Record and Sequence that contains
js object (like what we do for Dictionary type). Codegen introudces a new type on
isMember in getJSToNativeConversionInfo() as we need to generate different conversion
code for Sequence and Record if they are union member which now use Rooted* instead
of *Rooter to root js object.

Differential Revision: https://phabricator.services.mozilla.com/D157326
2022-09-28 08:56:06 +00:00
Edgar Chen
587c7f6dd0 Bug 1784266 - Part 1: Move union conversion code generator to getUnionConversionTemplate; r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D156175
2022-09-28 08:56:06 +00:00
Peter Van der Beken
b6baa7702e Bug 1782400 - Implement "return" method for WebIDL async iterable iterator. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156350
2022-09-22 18:28:18 +00:00
Peter Van der Beken
b8156bbc41 Bug 1777145 - Don't expose Wrap for WebIDL iterable iterator objects outside of binding code. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156348
2022-09-22 18:28:18 +00:00
Peter Van der Beken
b79090edf7 Bug 1777145 - Store the WebIDL iterable iterator's data directly in the iterator. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156347
2022-09-22 18:28:17 +00:00
Peter Van der Beken
aef7bf7e9c Bug 1777145 - Iterable iterators don't need aGivenProto. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156346
2022-09-22 18:28:17 +00:00
Peter Van der Beken
c7f3535543 Bug 1777145 - Stop declaring IterableIteratorBase as derived from nsISupports. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156345
2022-09-22 18:28:16 +00:00
Peter Van der Beken
4bf997b37a Bug 1777145 - Expose the Wrap function for WebIDL iterable iterators through a template argument instead of as a function pointer member. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156344
2022-09-22 18:28:16 +00:00
Peter Van der Beken
3e507adf99 Bug 1788969 - Align async iterable code more closely with the spec. r=edgar
Implement the common steps for the next method from
https://webidl.spec.whatwg.org/#es-asynchronous-iterator-prototype-object in
a base class, that all async iterable iterator objects inherit from. Natives
that implement an async iterable only need to implement the "getting the
next iteration result" part in their GetNextPromise method. This means they
don't have to create the object according to "CreateIterResultObject"
themselves, but can just create promise and often resolve it with a native
value directly. We've switched to a special JS::Value to signal "end of
iteration", but that's hidden inside the
iterator_utils::ResolvePromiseForFinished helper.
The WebIDL parser now uses the right return type for the generated "next"
method, which means that any exceptions in the binding code itself will
actually be correctly converted to a rejected promise instead of being
rethrown.
This also uses a class for the generated iterable iterator that's not
exposed outside the binding code. No other code should create and/or
wrap these anyway.

Differential Revision: https://phabricator.services.mozilla.com/D156323
2022-09-22 18:28:15 +00:00
Peter Van der Beken
90faeb9a24 Bug 1788969 - Reject async iterable result promises on error instead of throwing. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156321
2022-09-22 18:28:15 +00:00
Peter Van der Beken
74d51ab622 Bug 1788969 - Improve example code for async iterable. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156320
2022-09-22 18:28:14 +00:00
Sandor Molnar
141cdeeed6 Backed out 11 changesets (bug 1788969, bug 1782400, bug 1777145) for causing bp-hybri bustages. CLOSED TREE
Backed out changeset 8acabb924ef7 (bug 1782400)
Backed out changeset e3d452e99f77 (bug 1782400)
Backed out changeset 5727bc4895d2 (bug 1777145)
Backed out changeset cf375034e2b8 (bug 1777145)
Backed out changeset a50fd5608d8d (bug 1777145)
Backed out changeset f24853cacd7a (bug 1777145)
Backed out changeset c714f3a35b11 (bug 1777145)
Backed out changeset 56682c253427 (bug 1788969)
Backed out changeset edaf37ffc49d (bug 1788969)
Backed out changeset d19caa9f062b (bug 1788969)
Backed out changeset 18b26912dc03 (bug 1788969)
2022-09-22 19:13:01 +03:00
Peter Van der Beken
2fecef1b02 Bug 1782400 - Implement "return" method for WebIDL async iterable iterator. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156350
2022-09-22 15:02:26 +00:00
Peter Van der Beken
8dbae0a524 Bug 1777145 - Don't expose Wrap for WebIDL iterable iterator objects outside of binding code. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156348
2022-09-22 15:02:25 +00:00
Peter Van der Beken
80a3ebc106 Bug 1777145 - Store the WebIDL iterable iterator's data directly in the iterator. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156347
2022-09-22 15:02:24 +00:00
Peter Van der Beken
ea2b0b31e4 Bug 1777145 - Iterable iterators don't need aGivenProto. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156346
2022-09-22 15:02:24 +00:00
Peter Van der Beken
611ff2e6c3 Bug 1777145 - Stop declaring IterableIteratorBase as derived from nsISupports. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156345
2022-09-22 15:02:24 +00:00
Peter Van der Beken
a61442c4ca Bug 1777145 - Expose the Wrap function for WebIDL iterable iterators through a template argument instead of as a function pointer member. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156344
2022-09-22 15:02:23 +00:00
Peter Van der Beken
aa9940a9b5 Bug 1788969 - Align async iterable code more closely with the spec. r=edgar
Implement the common steps for the next method from
https://webidl.spec.whatwg.org/#es-asynchronous-iterator-prototype-object in
a base class, that all async iterable iterator objects inherit from. Natives
that implement an async iterable only need to implement the "getting the
next iteration result" part in their GetNextPromise method. This means they
don't have to create the object according to "CreateIterResultObject"
themselves, but can just create promise and often resolve it with a native
value directly. We've switched to a special JS::Value to signal "end of
iteration", but that's hidden inside the
iterator_utils::ResolvePromiseForFinished helper.
The WebIDL parser now uses the right return type for the generated "next"
method, which means that any exceptions in the binding code itself will
actually be correctly converted to a rejected promise instead of being
rethrown.
This also uses a class for the generated iterable iterator that's not
exposed outside the binding code. No other code should create and/or
wrap these anyway.

Differential Revision: https://phabricator.services.mozilla.com/D156323
2022-09-22 15:02:23 +00:00
Peter Van der Beken
97b8e69531 Bug 1788969 - Reject async iterable result promises on error instead of throwing. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156321
2022-09-22 15:02:22 +00:00
Peter Van der Beken
40e72fae73 Bug 1788969 - Improve example code for async iterable. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D156320
2022-09-22 15:02:21 +00:00
Peter Van der Beken
241d381ab0 Bug 1659158 - Support undefined in union. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D144876
2022-09-21 07:44:59 +00:00
Peter Van der Beken
f0982436f2 Bug 1659158 - Switch WebIDL from void to undefined. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D107108
2022-09-21 07:44:58 +00:00
Chun-Min Chang
25e9c48e99 Bug 1790481 - Use NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS for webidl-example generated macros r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D157233
2022-09-13 23:37:04 +00:00
Jon Coppeard
b89abe6790 Bug 1785804 - Part 2: Remove tracing name context and pass name through the trace methods r=sfink
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.

Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.

Depends on D156559

Differential Revision: https://phabricator.services.mozilla.com/D156560
2022-09-07 09:49:58 +00:00
Olli Pettay
93acdfad59 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Butkovits Atila
be3e9ca06c Backed out 7 changesets (bug 1785804) for causing reftest crashes at @ mozilla::dom::Promise::MaybeReject(nsresult). CLOSED TREE
Backed out changeset 31ef32f519f2 (bug 1785804)
Backed out changeset 361dc2862d74 (bug 1785804)
Backed out changeset 27771c8d9865 (bug 1785804)
Backed out changeset f9e864cd34a6 (bug 1785804)
Backed out changeset a115e9eaffee (bug 1785804)
Backed out changeset 271975a555d0 (bug 1785804)
Backed out changeset 55855c5ad184 (bug 1785804)
2022-09-07 14:09:56 +03:00
Jon Coppeard
e418b6997d Bug 1785804 - Part 2: Remove tracing name context and pass name through the trace methods r=sfink
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.

Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.

Depends on D156559

Differential Revision: https://phabricator.services.mozilla.com/D156560
2022-09-07 09:49:58 +00:00
Peter Van der Beken
d81d165c25 Bug 1781730 - Support optional arguments in async iterable declarations. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D155422
2022-09-05 15:27:11 +00:00
Mark Banner
783a2f2187 Bug 1788037 - Turn on ESLint rule for prefer-boolean-length-check for dom. r=asuth,karlt
Differential Revision: https://phabricator.services.mozilla.com/D155965
2022-09-02 11:05:17 +00:00
nchevobbe
96c3cea2ea Bug 1483662 - Add microSecondTimeStamp to nsConsoleMessage, nsScriptError and ConsoleEvent. r=edgar.
Those will be consumed by DevTools webconsole so we can order messages
emitted within the same millisecond more precisely (see next patch in queue)

Differential Revision: https://phabricator.services.mozilla.com/D155545
2022-09-02 04:58:28 +00:00
Peter Van der Beken
c778194602 Bug 1782399 - InitAsyncIterator needs to have an ErrorResult parameter. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D155418
2022-08-29 10:57:20 +00:00
Kagami Sascha Rosylight
e8c55759ed Bug 1695435 - Part 4: Hide @@hasInstance behind flag also in xray r=edgar
Depends on D110930

Differential Revision: https://phabricator.services.mozilla.com/D110931
2022-08-24 22:47:43 +00:00