Commit Graph

399 Commits

Author SHA1 Message Date
Boris Zbarsky
ddfb1afd8e Bug 1186265 - Check the current interface's members. r=bz
MozReview-Commit-ID: JJC82zi33YS

--HG--
extra : rebase_source : 06ccab0bdacd5a4ff669915a1d18c1506c0ec532
2018-05-23 13:56:20 -07:00
Boris Zbarsky
19aa8a3bac Bug 1465602 part 1. Enforce that the default toJSON can only return 'object'. r=qdot
The spec says:

  The return type of the default toJSON operation must be object.
2018-06-01 12:17:10 -04:00
Narcis Beleuzu
8bfcff6f8c Backed out 3 changesets (bug 1186265) for devtools chrome failures on browser_webconsole_visibility_messages.js. CLOSED TREE
Backed out changeset 4a9965aeeef3 (bug 1186265)
Backed out changeset 55bd80764231 (bug 1186265)
Backed out changeset 00fefd3eb634 (bug 1186265)
2018-05-25 05:36:52 +03:00
Boris Zbarsky
8601802fff Bug 1186265 - Check the current interface's members. r=bz
MozReview-Commit-ID: Hfh0yyNBGE4

--HG--
extra : rebase_source : ed9544d4a8d02aaa69ecf5c364517bca584cf04f
2018-05-23 13:56:20 -07:00
Boris Zbarsky
453d037a95 Bug 1424160 part 3. Set up @@toStringTag on our synthesized iterator interfaces. r=qdot 2018-05-17 23:45:45 -04: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
1fb670215a Bug 1424160 part 1. Allow interfaces the have a different name for SpiderMonkey class name purposes. r=qdot
We want to have some class names with spaces in them, but everything assumes
that an interface identifier is in fact an identifier (e.g. uses it in C++
identifiers like namespace names).
2018-05-17 23:45:26 -04:00
Boris Zbarsky
bbb35f3bbb Bug 1375829 part 5. Switch from using "jsonifier" syntax to the spec's "[Default] toJSON" syntax. r=qdot 2018-05-17 23:43:59 -04:00
Boris Zbarsky
5d1de86578 Bug 1375829 part 4. Enforce the spec restrictions on methods named toJSON(). r=qdot
There are two restrictions: such methods must take no arguments and must return a JSON type.
2018-05-17 23:43:55 -04:00
Boris Zbarsky
aae7b887d6 Bug 1375829 part 3. Align our definition of "JSON type" with the spec. r=qdot
Compared to the spec, we had the following differences:

* Date was a JSON type in our implementation.  It doesn't even exist as a type
  in the spec.  It stops being a JSON type.
* Annotated types are not supported yet.  Nothing changes here.
* Typedef types were not JSON types in our implementation.  They become JSON
  types if the type it's a typedef for is one.
* Frozen arrays are not supported yet.  nothing changes here.
* Records were not JSON types in our implementation.  They become JSON types
  when the value type is a JSON type.
* Object was not a JSON type in our implementation.  It becomes a JSON type.
* Interface types were only JSON types in our implementation if they had a
  jsonifier.  We change to treating them as JSON types if there is a jsonifier
  anywhere on the inheritance chain.

In terms of observable behavior, the following properties now get included by
toJSON methods that didn't use to be included:

  PaymentResponse.details
  Performance.mozMemory

both because they're of type "object".
2018-05-17 23:39:52 -04:00
Boris Zbarsky
0e86edbbdf Bug 1375829 part 1. Rename isSerializable() to isJSONType(). r=qdot
The spec calls these types "JSON types".
2018-05-17 23:39:52 -04:00
Boris Zbarsky
6072982c14 Bug 1456887 part 2. Remove ArrayClass support. r=qdot 2018-04-26 01:38:07 -04:00
Boris Zbarsky
b808305604 Bug 1450182. Remove the EventListenerWasAdded/Removed hooks from DOMEventTargetHelper. r=smaug
MozReview-Commit-ID: GWnAvK61hVT
2018-04-04 15:32:19 -04:00
Tooru Fujisawa
9a81f2437f Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because the current compartment is used in the
following places and all of them are safe:

1. GlobalObject::CallerType(), that is ultimately passed to
   nsDocument::IsWebAnimationsEnabled in KeyframeEffectParamsFromUnion,
   to decide whether to copy mIterationComposite/mComposite to
   KeyframeEffectParams.

   GlobalObject::CallerType() can now be different than the target window's one,
   if the caller has the system principal and the target is web content, and
   in that case nsDocument::IsWebAnimationsEnabled there always returns true
   while Web Animations can be disabled on web content.

   honoring the mIterationComposite/mComposite properties is OK, since it just
   changes the animation behavior, and this is disabled by default until
   remaining spec issues are resolved.

2. GlobalObject::Context(), that is ultimately passed to
   KeyframeUtils::GetKeyframesFromObject and used while extracting information
   from passed-in keyframe object, with iterable/iterator protocols.

   Performing that operation in the caller side is okay, since the same thing
   can be done on caller, and the operation doesn't perform any GCThing
   allocation on the target window global.
2018-02-17 17:21:13 +09:00
Tooru Fujisawa
d70a10cbd8 Backed out changeset c3f16a179c93 (bug 1414674) 2018-02-18 01:24:08 +09:00
Tooru Fujisawa
d58a217b1c Bug 1414674 - Do not enter the compartment of the target window when calling KeyframeEffect and KeyframeEffectReadOnly constructor via Xray. r=bz,birtles
KeyframeEffect and KeyframeEffectReadOnly constructors can run in the caller
compartment, which is okay because of the following reasons:

1. The target window global is used for most operation:
     * KeyframeEffectReadOnly::ConstructKeyframeEffect uses the target window
       global instead of current global.
     * KeyframeEffectParamsFromUnion which receives `aGlobal.CallerType()`

   In Xray case, Web Animations API can be disabled on web content
   (currently disabled on beta/release by default), and in that case some API
   won't work even it's triggered from WebExtensions, but it should be fine.

2. GetKeyframesFromObject is executed in the caller's compartment to access
   the passed-in JSObject that is keyframe, with iterable/iterator protocols.
   This operation doesn't perform any GCThing allocation on the target window
   global.
2018-02-17 17:21:13 +09:00
Boris Zbarsky
a6113241a2 Bug 1436831 part 1. Support [Pref] annotations on Web IDL namespaces. r=qdot
MozReview-Commit-ID: 6gzMWPOlKWM
2018-02-09 11:17:10 -05:00
Adrian Wielgosik
35b93ce926 Bug 1297480 - Add BindingAlias= for WebIDL attrbutes, use it to slim CSS2Properties down. r=bz
As opposed to Alias attribute, which reuses the JS function object for the property, BindingAlias will only reuse the generated attribute binding implementation, without changing observable behavior. It can be used to reduce amount of generated code, if the attributes are known to behave exactly the same.

This cuts the size of generated CSS2PropertiesBinding.cpp by half, and removes ~100kB of dupicated code from libxul.

MozReview-Commit-ID: G0q8TbaqFdp

--HG--
extra : rebase_source : 87a2a501cc8adb379df1f4563d3696a339abd0fc
2018-01-23 20:47:05 +01:00
Nika Layzell
a0d1f16079 Bug 1383876 - Part 1: Remove GroupedSHistory and Prerendering logic from C++ code, r=freesamael, r=smaug
MozReview-Commit-ID: 2aHA6NcQPGk
2018-01-12 17:52:52 -05:00
Boris Zbarsky
a61f696c24 Bug 1419270 part 1. Add NeedsSubjectPrincipal to the extended attributes we compute for interface members. r=qdot
MozReview-Commit-ID: 7aBqqWdF6Bn
2017-12-05 16:03:18 -05:00
Boris Zbarsky
97828fce1d Bug 1415389. Make ChromeUtils a WebIDL namespace. Remove ThreadSafeChromeUtils. r=kmag
MozReview-Commit-ID: 9ysAeaBMNVt
2017-11-08 00:25:33 -05:00
Boris Zbarsky
37836d94c0 Bug 1414359. Remove vestigial support for 'creator' operations from webidl; all setters are creators. r=qdot
MozReview-Commit-ID: AeRjWxk1YwE
2017-11-04 00:36:10 -04:00
Kyle Machulis
df8270946f Bug 792059 - Add NeedsWindowsUndef extended attribute for constants; r=bz
When defining WebIDL constants in C++, we may need to undefine some
constant names that conflict with windows.h preprocessor defines.
Doing this in the binding header is far easier than tracking down the
include orders that may cause conflicts.

MozReview-Commit-ID: A0UoYezIQs5

--HG--
extra : rebase_source : d9100af2ccdb5c6e6468542ac68f74b2e4f9050c
2017-10-23 17:34:28 -07:00
Boris Zbarsky
005450266e Bug 1400139 part 1. Add infrastructure for marking WebIDL interface members as non-enumerable. r=qdot
MozReview-Commit-ID: 9F0ZNverS63
2017-09-18 21:24:37 -04:00
Andrea Marchesini
351d938b86 Bug 1128959 - Implement the WHATWG Streams spec - part 1 - WebIDL Bindings, r=bz 2017-08-10 18:04:54 -07:00
Boris Zbarsky
12bc4392d8 Bug 1360557. Fix the Web IDL parser to report more useful errors when extended attributes are used on constructs that don't allow them. r=qdot 2017-05-01 13:25:47 -04:00
John Dai
3fbf49822e Bug 1309147 - Part 1: Implement the support for CEReactions in WebIDL parser. r=bz
MozReview-Commit-ID: Dw0CMgzXKKy

--HG--
extra : rebase_source : 2254eae5076d4d51eff61d8ee1363075c3aeb13b
extra : histedit_source : 618b4e46eb6b5ac1791bd4f762a97373c6b8e2b3
2017-02-03 11:44:09 +08:00
Olli Pettay
d7c9e40c86 Bug 1352746 - Rename ProbablyShortLivingObject to ProbablyShortLivingWrapper in webidl, r=qDot
--HG--
extra : rebase_source : 41c2aae34d1140881078aeb336e974394425b9c3
2017-04-11 00:01:29 +03:00
Boris Zbarsky
a66c62ea91 Bug 1352996. Remove vestige of AvailableIn/CheckAnyPermissions/CheckAllPermissions from WebIDL.py. r=qdot
MozReview-Commit-ID: HsvhRefytXQ
2017-04-05 23:04:26 -04:00
kvark
a38edf6b85 Bug 1348111 - Clarify the error message. r=smaug
--HG--
extra : rebase_source : dee38b43c0eb7470c2861e78c9d6bd1e653a2db7
2017-03-16 18:51:00 -04:00
Boris Zbarsky
46964f231f Bug 1330699 part 9. Rename "MozMap" to "record" in our IDL parser and IDL files. r=qdot
The key type is unused so far.

--HG--
rename : dom/bindings/parser/tests/test_mozmap.py => dom/bindings/parser/tests/test_record.py
2017-02-15 00:00:17 -05:00
Boris Zbarsky
f096eee1f8 Bug 1330699 part 8. Split up PrimitiveOrStringType into PrimitiveType and StringType in the Web IDL parser. r=qdot 2017-02-15 00:00:07 -05:00
Boris Zbarsky
c41dd5c904 Bug 1330699 part 6. Add some tests for distinguishability of unions. r=qdot 2017-02-15 00:00:05 -05:00
Boris Zbarsky
c2ed802c58 Bug 1330699 part 5. Disallow mozmap-typed constants. r=qdot 2017-02-15 00:00:04 -05:00
Boris Zbarsky
cb6b07df97 Remove bogus comments. Note that toJSON is no longer reserved in the spec as of <https://github.com/heycam/webidl/pull/293>. No bug, DONTBUILD. 2017-02-09 22:12:15 -05:00
Mike Shal
795f995ed4 Bug 1335796 - Move WebIDL parser tests out of 'make check'; r=dustin,Ms2ger
This test suite involves a bunch of python tests which don't require
configure or any generated binaries to run. We can split them out into a
Taskcluster linter type task to run directly on the source tree in
parallel with builds.

MozReview-Commit-ID: 9ux3rAuFXAY

--HG--
extra : rebase_source : 95378cd686644e34ea017c682d7384906b17d13a
2017-01-31 19:08:50 -05:00
Boris Zbarsky
9894e14428 Bug 1332713 part 2. Disallow [SameObject] Promise-typed attributes. r=qdot 2017-01-27 18:53:36 -05:00
Boris Zbarsky
94a230e52a Bug 1332713 part 1. Disallow Promise-typed attributes with setters. r=qdot 2017-01-27 18:53:36 -05:00
Boris Zbarsky
7547c36287 Bug 1333480. Disallow indexed getters on interfaces without an integer-typed 'length' attribute. r=qdot 2017-01-24 16:11:33 -05:00
Iris Hsiao
747c446db4 Backed out changeset f9ae7da00387 (bug 1333480) for bustage
CLOSED TREE
2017-01-25 10:44:16 +08:00
Boris Zbarsky
1586a2e95a Bug 1333480. Disallow indexed getters on interfaces without an integer-typed 'length' attribute. r=qdot 2017-01-24 16:11:33 -05:00
Wes Kocher
29f8528a73 Backed out changeset b8b06fdb30ce (bug 1333480) for build bustage a=backout
MozReview-Commit-ID: 7wCiW0N8tby

--HG--
extra : rebase_source : fa619c21ee25c58ab67336cc3c4a9d5692029e5c
2017-01-24 13:57:26 -08:00
Boris Zbarsky
20418bd1bf Bug 1333480. Disallow indexed getters on interfaces without an integer-typed 'length' attribute. r=qdot 2017-01-24 16:11:33 -05:00
Boris Zbarsky
b1b6ca681a Bug 1333117. We should ensure, at build-time, that partial interfaces are defined in the same file as the interface they extend, since our build system doesn't really support correct dep builds if they're placed in a different file. r=qdot 2017-01-24 16:11:30 -05:00
Boris Zbarsky
2973eff777 Bug 1330536 part 1. Add a CanOOM annotation, and the corresponding GetterCanOOM, SetterCanOOM annotations, to the IDL parser. These can be used in the cases when Throws/GetterThrows/SetterThrows can be used, to indicate that the only possible exception is NS_ERROR_OUT_OF_MEMORY. r=smaug 2017-01-17 23:52:13 -05:00
Boris Zbarsky
94a9f0d729 Bug 1323721 part 12. Create a separate IDLPromiseType; stop treating Promise as an interface altogether. r=qdot 2016-12-19 15:38:44 -08:00
Boris Zbarsky
6c78cc893a Bug 1323721 part 11. Make isInterface and isGeckoInterface test false for the isPromise() case. r=qdot 2016-12-19 15:38:44 -08:00
Boris Zbarsky
865e7c42eb Bug 1323721 part 5. Move Promise native-to-JS conversion out of the isGeckoInterface section. r=qdot 2016-12-19 15:38:43 -08:00
Boris Zbarsky
83b5a8468f Bug 1324178. Actually enforce the various checks the IDL spec says to do for arguments of constructors and named constructors. r=baku 2016-12-19 15:38:42 -08:00
Boris Zbarsky
f74b8c3888 Bug 1323274. Disallow nullable Promise types. r=qdot 2016-12-16 14:06:54 -05:00