Commit Graph

1605 Commits

Author SHA1 Message Date
Boris Zbarsky
753e5af2f1 Bug 1446246 part 1. Use a single handwritten HTMLConstructor implementation, instead of code-generating lots of very similar implementations. r=peterv
The codegen changes are mostly a backout of the changes made in bug 1274159.

The HTMLConstructor implementation is mostly copied from one of the
code-generated ones, with a few modifications:

* Derive the interface name from the proto id instead of hardcoding it.
* Use the proto/constructor ids to get constructor and prototype objects.
* Use ErrorResult instead of FastErrorResult; we don't want the precedent of
  using FastErrorResult in non-generated code.

There will be further changes to combine HTMLConstructor and
CreateXULOrHTMLElement, in a separate changeset.

MozReview-Commit-ID: 44D0qw23ioP
2018-03-27 15:49:02 -04:00
Dave Townsend
c70f34995e Bug 1421070: Always enable custom elements in chrome. r=smaug, rs=MattN
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : 735688061116c633b816f4f9d488712408df11a5
extra : source : 794ee6857d83dfe0b18629c12e96a622fc899586
2017-10-20 11:02:33 -07:00
Boris Zbarsky
a245fdf72d Bug 1448397. Make WebIDL QueryInterface chrome-only. r=qdot 2018-03-26 13:35:04 -04:00
Margareta Eliza Balazs
190225b29c Backed out changeset 794ee6857d83 (bug 1421070) for 15 failures in toolkit/components/payments/test/mochitest/test_ObservedPropertiesMixin.html on a CLOSED TREE
--HG--
extra : amend_source : 0574ce1b5b6a6e8735245684eb8e9ec7b0ac2647
2018-03-23 03:42:25 +02:00
Dave Townsend
2626e1c261 Bug 1421070: Always enable custom elements in chrome. r=smaug
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : b9632de82cf79c1df15be09fadf1d25817c8a894
extra : amend_source : 235a76453d1d6782903d5051ee8e234b965dcc36
2017-10-20 11:02:33 -07:00
Peter Van der Beken
5ad9618d7c Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 4: Convert MessageManager to WebIDL. r=bz.
--HG--
extra : rebase_source : aa7aa3a5f720b5a4f6ff88e41eb9e80ffb9092cd
2017-06-20 11:09:50 +02:00
Peter Van der Beken
ef631ce856 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 1: Add infrastructure to expose 'system' names on a WebIDL global. r=bz.
--HG--
extra : rebase_source : 70d3a641c60968e013f048e6be91f07641e7b81b
2017-07-19 15:04:14 +02:00
Narcis Beleuzu
298d1d55b5 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-03-13 12:36:54 +02:00
Emilio Cobos Álvarez
98e6994aaf Bug 1444416: Make bindings generate appropriate MOZ_KnownLive wrappers. r=bz
MozReview-Commit-ID: DBmgwNYVjTM

--HG--
extra : rebase_source : a0866d03686d5ca8aabd954014bf8abb89a419d9
2018-03-09 21:21:59 +01:00
Boris Zbarsky
aa3ff36ffc Bug 1444880. Stop including jsfriendapi.h in PrototypeList.h. r=mccr8
This way we don't include it in all the binding headers.  We only need
jsfriendapi.h for the static_asserts involving JSJitInfo, so we move those to
PrototypeList.cpp.

MozReview-Commit-ID: 7KOmbjwSBOD
2018-03-13 00:59:23 -04:00
Boris Zbarsky
272ace7ae2 Bug 1444286. Common up the Get*ObjectHandle methods in bindings. r=peterv
This reduces codesize, at the cost of a bit more includes in the binding headers.

MozReview-Commit-ID: 40dLELF36Oh
2018-03-09 16:04:11 -05:00
Sebastian Hengst
3a10644021 Backed out 6 changesets (bug 888600) for beta simulation failures: build bustage on Linux and Windows opt (bug 1442036) and devtools failure browser_net_view-source-debugger.js (bug 1441961). a=backout
Backed out changeset 83c87140dc3d (bug 888600)
Backed out changeset 2efb9b1753f6 (bug 888600)
Backed out changeset af5303781961 (bug 888600)
Backed out changeset 79ef59047e63 (bug 888600)
Backed out changeset 30d568d628dd (bug 888600)
Backed out changeset c7bd4c6c9741 (bug 888600)

--HG--
extra : histedit_source : 791b22f6770f4fead2f909478a93d65d85829fe0%2Cbb387309e90f53e1dde45dcf8cf4ebedcc6e5c5e
2018-03-01 11:51:09 +02:00
Peter Van der Beken
e9ab02acb0 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 4: Convert MessageManager to WebIDL. r=bz.
--HG--
extra : rebase_source : 21a04b112c838f100afe28bc31265130900703da
2017-06-20 11:09:50 +02:00
Peter Van der Beken
615d394604 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 1: Add infrastructure to expose 'system' names on a WebIDL global. r=bz.
--HG--
extra : rebase_source : 6473c862fe98793438c02fa075f3378f8307b45b
2017-07-19 15:04:14 +02:00
Sylvestre Ledru
dc058f0310 Bug 1370794 - Replace some 0 by false in the dom bindings code generation r=Ehsan
MozReview-Commit-ID: IRErUEAlkTc

--HG--
extra : rebase_source : 117e6c696da2829088c63019f3805de77d5609e8
2018-02-07 12:05:45 +01: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
07eaf60521 Bug 1436902 part 5. Change generated event classes to use NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
This makes 23 generated event clases use NS_INLINE_DECL_REFCOUNTING_INHERITED.

MozReview-Commit-ID: 7dyWTc1AUfH
2018-02-12 15:45:51 -05:00
Boris Zbarsky
d6807fd501 Bug 1436902 part 4. Refactor event codegen a bit to make it easier to tell whether the event class needs cycle collection. r=mccr8
I looked at the diff in the generated code, and the only change is that
SpeechRecognitionEvent's unlink impl goes from:

 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SpeechRecognitionEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mResults)
   tmp->mInterpretation.setUndefined();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mEmma)
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END

to:

 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(SpeechRecognitionEvent, Event)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mResults)
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mEmma)
+  tmp->mInterpretation.setUndefined();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END

MozReview-Commit-ID: FISIphljlT6
2018-02-12 15:45:10 -05:00
Markus Stange
7e275b635a Bug 785440 - Add profiler labels to WebIDL bindings: getters / setters / method calls. r=bz
MozReview-Commit-ID: IyhXzv0Chye

--HG--
extra : rebase_source : 6ad1a5bc7f65e157cafa22646c10e56c5f45f90a
extra : source : f38192387128b3e2479c1a3e1654e8339668b34f
2018-01-05 14:40:03 +01:00
Boris Zbarsky
a6fdc48869 Bug 1436276. Bindings should create their return promises in the current compartment even when called over Xrays. r=bholley
These are cases that are implementing the "convert an exception to a Promise"
steps of the Web IDL spec.  Typically the exception is thrown in the current
compartment; the Promise returned should simply match that.  Otherwise we can
end up with a situation in which the promise doesn't actaully have access to
its rejection value, which will cause problems if someone uses then() on the
promise: the return value of the then() call will get a sanitized exception
instead of the real one.

We _could_ try to match the actual compartment of the exception, in theory.
But it's not clear why this would be preferable to using the current
compartment, even if there were cases in which the exception _doesn't_ match
the current compartment.  Which there likely are not.

MozReview-Commit-ID: Ac2BHIHxfvY

--HG--
rename : dom/promise/tests/test_promise_argument.html => dom/promise/tests/test_promise_retval.html
rename : dom/promise/tests/test_promise_argument_xrays.html => dom/promise/tests/test_promise_retval_xrays.html
2018-02-10 01:34:10 -05:00
Tim Taubert
1d2ba2eb2b Bug 1436308 - Generate a ToJSON() method for WebIDL types with records r=bz
We currently don't generate a ::ToJSON() method for WebIDL types with record<K,V>
members. These types should be safe to convert to JSON, as long as type V itself
is. Per spec, type K is always a DOMString, USVString, or ByteString.
2018-02-07 12:01:00 +01:00
Boris Zbarsky
bc7691a8db Bug 1434686 part 2. Use IgnoreErrors() in dom/bindings. r=mystor
MozReview-Commit-ID: G8vxR2s2qUJ
2018-02-01 14:21:14 -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
Coroiu Cristina
c6a942e1bf Merge inbound to mozilla-central r=merge a=merge 2018-01-13 11:55:23 +02:00
Andrew McCreight
4a42e66fbe Bug 1430183 - ClassTypedef from CodeGen.py is unused. r=qdot
This was used in CGPrototypeTraitsClass, but that usage was removed at
some point.

MozReview-Commit-ID: G3bGMma5XTw

--HG--
extra : rebase_source : 89ff19e10bba68a8e3e3392d3695448dfb245d7c
2018-01-12 10:43:39 -08: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
Cameron McCormack
55679ff0a6 Bug 1428531 - Add chrome-only Foo.isInstance static methods to interface objects. r=bz
MozReview-Commit-ID: Kq0xONMnbEO
2018-01-11 13:00:25 +08:00
Boris Zbarsky
4565249361 Bug 1424474 part 2. Add a way to request only non-system subject principals in webidl bindings. r=mystor
MozReview-Commit-ID: 8ObneI0DoH5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu
edb8ba34eb Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky
e2f384f52a Bug 1424474 part 1. Add a way to request only non-system subject principals in webidl bindings. r=mystor 2017-12-20 17:43:18 -05:00
Edgar Chen
5fedbb92b8 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]; r=smaug
MozReview-Commit-ID: HgbFo9ddr0o

--HG--
extra : rebase_source : 04989782fc7c7ce79e0e65b3dc907c9e174a0809
2017-11-27 16:10:27 +08: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
723521145b Bug 1418558 part 1. Add MOZ_CAN_RUN_SCRIPT annotations to most Element methods that call GetPrimaryFrame. r=mystor
MozReview-Commit-ID: LWI1p75EyxB
2017-12-05 11:18:16 -05:00
Dave Townsend
27380b996e Bug 1404420: Add custom element support to XUL. r=edgar, r=smaug
MozReview-Commit-ID: BietEX2gOoG

--HG--
extra : rebase_source : 6fd9a732a21f2c048d37c3f7139cd18503148767
2017-10-10 15:25:10 -07:00
Edgar Chen
bf0a0f5b38 Bug 1415761 - Catch the exception and rethrow it after invoking custom elements reactions; r=bz
The spec was unclear on how CEReactions interact with thrown exceptions; see https://github.com/whatwg/html/issues/3217.
The spec is now being clarified in https://github.com/whatwg/html/pull/3235.

MozReview-Commit-ID: 521HprTRS7k

--HG--
extra : rebase_source : 107d331203d0d16062fa061569e822d3c6d5f2c9
2017-11-17 17:44:18 +08:00
Boris Zbarsky
3dd8d0e9c1 Bug 1379688 part 1. Remove some restrictions on whether an interface that implements QueryInterface can have a non-abstract ancestor. r=smaug
This restriction was put in place back when we automatically added
QueryInterface to all rootmost non-abstract interfaces.  At the time, we needed
to make sure it did NOT end up on EventTarget, because then webidl quickstubs
would replace the QI impl on non-webidl EventTargets with the WebIDL one, which
would not work for them.

Since then, we have removed WebIDL quickstubs and we now explicitly list which
interfaces get QueryInterface, so this check is no longer needed.

MozReview-Commit-ID: 5B13ymdyLp3
2017-11-20 13:59:20 -05:00
Sylvestre Ledru
85d099995a Bug 1416716 - Init deleteSucceeded to silent a -Wmaybe-uninitialized warning r=bz
MozReview-Commit-ID: C3pYuP5dPxI

--HG--
extra : rebase_source : f6a1003ca85b534a43b5efba33bbb4f502532d05
2017-11-13 10:04:59 +01:00
Boris Zbarsky
e95559cd09 Bug 1415234. Annotate HTMLInputElement::Width() as MOZ_CAN_RUN_SCRIPT and plumb through the binding bits needed to make this pass static analysis. r=mystor
This basically marks most of the bindings bits as MOZ_CAN_RUN_SCRIPT.

MozReview-Commit-ID: HcQcYhTR9cb
2017-11-13 10:36:53 -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
Kyle Machulis
b0922aec43 Bug 792059 - Codegen generation of WebIDL constants in C++; r=bz
Generate C++ const definitions for WebIDL interface members with
primitive types.

MozReview-Commit-ID: 4fLtteWZUWA

--HG--
extra : rebase_source : bf45427c6b0e4acfa32ed3431a3cf385972950a0
2017-10-09 19:59:36 -07:00
Tom Schuster
7a6aff2c7e Bug 638054 - Remove watch class-hook and proxy trap r=jorendorff,bz 2017-10-24 20:48:14 +02:00
Boris Zbarsky
6a07397359 Bug 1354730. Disable named property object (aka global scope polluter) behavior for all Xrays. r=kmag
MozReview-Commit-ID: KmbXFfSzH0N
2017-10-16 10:58:09 -04:00
Peter Van der Beken
772f1ee5da Bug 1383059 - Remove instanceof for supplemental interfaces. Part 2: remove support for supplemental interfaces in instanceof code and remove unnecessary ChromeWindow interface. r=bz.
--HG--
extra : rebase_source : e8ce446e7f1844c6d1d352896873cbb865837632
extra : source : 944786dca81aed2e480562694bfabc6e5fbf1266
2017-07-05 23:01:04 +02:00
Jan de Mooij
dbca189324 Bug 1153592 part 2 - Remove JSPROP_SHARED; ensure accessor props don't have slots. r=evilpie 2017-09-26 12:26:50 +02:00
Kris Maglione
f37317cad0 Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values. r=bz
We don't have access to an appropriate context to create the dead wrapper in
when the callback is nuked, so instead, this patch creates a new dead wrapper
in the caller compartment each time the property is accessed. This is the same
behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so
it's consistent with the way we handle these situations elsewhere.

MozReview-Commit-ID: 3cMeR4z8EOe

--HG--
extra : rebase_source : 7e8cf4a195ef64deb7677ce4ac9818d342815667
2017-09-04 17:21:06 -07:00
Jon Coppeard
8bd8591183 Bug 1396613 - Make proxy objects override handler's objectMoved method rather than using class hook r=sfink r=mccr8 r=peterv 2017-09-19 12:31:30 +01:00
Jon Coppeard
1077972535 Bug 1396613 - Update the object moved hook to allow it to be called when tenuring nursery objects r=sfink r=mccr8 2017-09-19 12:31:30 +01:00