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

4424 Коммитов

Автор SHA1 Сообщение Дата
Bogdan Tara cd1c3cc5dd Merge mozilla-central to autoland, r=merge a=merge on a CLOSED TREE 2018-01-09 00:16:46 +02:00
Bogdan Tara 73b4d6b26a Merge inbound to mozilla-central r=merge a=merge 2018-01-09 00:05:31 +02:00
Jon Coppeard 3bd056fab8 Bug 1377402 - Add null check in SimpleGlobalObject's class hooks r=sfink 2018-01-08 14:27:50 +00:00
Edgar Chen d6c2c3283e Bug 1428244 - Part 1: Add [CEReactions] in CSSStyleDeclaration; r=smaug
per https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute.

MozReview-Commit-ID: 7QkAZeUOrlh

--HG--
extra : rebase_source : 1431dfd4edebf8140604ac79253c674f3bf4f89d
2017-12-13 10:24:35 -06:00
Valentin Gosu b2e06a6d9b Bug 1426501 - Add nsINetUtil.notImplemented() method that always throws r=mayhemer
MozReview-Commit-ID: Ij3M5Ydtlac

--HG--
extra : rebase_source : f95ea333bad7eeacf7fd753028ac4ead18e70eef
2018-01-08 11:23:53 +01:00
Kyle Machulis a5bf8f2796 Bug 1428229 - Add comments about purposefully uninitialized variables in BindingDeclarations; r=bz
MozReview-Commit-ID: HnWjU3BbwBE

--HG--
extra : rebase_source : a9a5ea5057c8892cb77d02c3873384b20897acd7
2018-01-05 12:37:42 -08:00
Kyle Machulis 0aafef6a46 Bug 1428229 - Partial backout a4094a8fa08d (bug 1406820) due to optimization removals; r=bz
MozReview-Commit-ID: AZDXw8NbgHt

--HG--
extra : rebase_source : 49c0f308120d92ef7e2cb0fcbb8337c006959c9f
2018-01-05 13:44:25 -08:00
Andrea Marchesini d820259403 Bug 1425574 - Fill the feature gap between Console.jsm and Console API - part 1 - Console.createInstance(), r=smaug 2018-01-04 19:19:43 +01:00
Boris Zbarsky 0b411e80c7 Bug 1407858 part 3. Add a literal string state to DOMString. r=smaug
MozReview-Commit-ID: JOuoLoZ2tcR
2017-12-22 13:02:51 -05:00
Boris Zbarsky ca6aad3847 Bug 1407858 part 2. Make DOMString's data model clearer and update various documentation. r=smaug
MozReview-Commit-ID: AaTeI1e7Qnk
2017-12-22 13:02:51 -05:00
Boris Zbarsky 06a6d6e207 Bug 1407858 part 1. Give DOMString setter APIs clearer names. r=smaug
The renaming here is like this:

  SetStringBuffer -> SetKnownLiveStringBuffer
  SetEphemeralStringBuffer -> SetStringBuffer
  SetOwnedString -> SetKnownLiveString
  SetOwnedAtom -> SetKnownLiveAtom

This should make it clearer what the lifetime expectations are on the caller side.

MozReview-Commit-ID: ERHbB3r6paN
2017-12-22 13:02:51 -05:00
Boris Zbarsky 04324f18ad Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05: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 a2696c3c8a Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05: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
Cosmin Sabou b0098afaea Merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-12-13 12:14:29 +02:00
Ben Kelly cfb0e62f7b Bug 1293277 P5 Switch bindings over to new Client and Clients classes. r=baku 2017-12-12 15:44:47 -05:00
Sylvestre Ledru 2e6c383d43 Bug 1424867 - Fix an ignored-qualifiers warning in BindingUtils r=smaug
MozReview-Commit-ID: 2bMNgMZwucN

--HG--
extra : rebase_source : b5b79c47bc02fbd61c775e4749b8c674f7cf260c
2017-12-12 08:13:55 -06:00
Boris Zbarsky 022fdd6e61 Bug 1424362. Change test_exceptionSanitization.html to not depend on feed: protocol bits, because those are going away. r=qdot
MozReview-Commit-ID: ESBwyNuMF9X
2017-12-08 22:01:16 -05:00
Sylvestre Ledru 9bfe27d903 Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium
MozReview-Commit-ID: 7duJk2gSd4m

--HG--
extra : rebase_source : 7312fe276e561e8c034a5f6749774ae812727f9c
2017-12-07 22:09:15 +01:00
Eric Rahm 07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Boris Zbarsky 887ce3941a Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -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 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
Nico Grunbaum b42a174bc8 Bug 1363667 - P3 - RTP Source Observer r=mjf
MozReview-Commit-ID: BwZhi49KlfB

--HG--
extra : rebase_source : b6b9230d07848952a200d2ded956d39439e5dc1e
2017-11-14 10:17:10 -08:00
Byron Campen [:bwc] 5daf41d807 Bug 1290948 - Part 2: webidl for RTCRtpTransceiver and supporting interfaces r+jib, r+ehsan r=ehsan+251051,jib
MozReview-Commit-ID: DmXufKwCAyW

--HG--
extra : rebase_source : 30948762aa31846ac6ae89cd757010a60e6f44db
2017-08-23 15:47:54 -05:00
Brindusan Cristian 9f3bd430c2 Merge inbound to mozilla-central a=merge r=merge 2017-11-28 11:50:57 +02: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
Nika Layzell f1ac9bf744 Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug
MozReview-Commit-ID: DAAm6tLubhJ
2017-11-23 13:12:13 -05:00
Johann Hofmann d28b4dd837 Bug 1374574 - Remove the FlyWeb service and DOM interfaces. r=bz,djvj
MozReview-Commit-ID: 4hp9pLbMh4R

--HG--
extra : rebase_source : 82f417640211ede4fd7aa290c1f2609b07f38025
2017-11-22 15:00:10 +01:00
Kris Maglione 58662abbfe Bug 1415352: Part 1c - Store the subject principal when setting Element.style properties. r=bz
This causes the subject principal that was responsible for setting a CSS
property, or the full cssText of an attribute, to be threaded through the call
chain to the point where CSS parsing happens, so that it can be used as the
triggering principal when loading URLs for that property.

Note that this allows for different properties defined in the same style
attribute to have different triggering principals, depending on the caller
which originally set them, as long as the cssText of that attribute is not
modified. Once it is, all properties revert to the principal of the caller
that modified the CSS text.

MozReview-Commit-ID: ISUyxbqAZMX

--HG--
extra : rebase_source : d4173d76d9afed74889269e3bf029abca54a4abb
2017-11-03 21:44:03 -07:00
Adam Gashlin 7404b3ac92 Bug 1369194 - Remove MozWakeLock. r=baku
--HG--
extra : histedit_source : 16cb49cbf3bf39bc2bddc721c002741cd5a953df
2017-11-20 17:14:41 -08: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 b5de3264a2 Bug 1379688 part 2. Make the EventTarget interface constructible. r=smaug
MozReview-Commit-ID: 4xrSSqXna7F
2017-11-20 13:59:22 -05: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
Jon Coppeard a06421a289 Bug 1417123 - Remove or replace inclusion of js/GCAPI.h r=mccr8 2017-11-16 12:21:08 +00:00
Nika Layzell dfe521f9b8 Bug 1416384 - Part 2c: Get nsGlobalWindowInner.cpp building, r=smaug
MozReview-Commit-ID: CmKx5jtvtrT

--HG--
extra : rebase_source : b1c5fe7c140a743d55c462b6d2bcbf8a97950d9c
2017-11-15 11:33:39 -05:00
Jonathan Watt b26557dd95 Bug 1417365 - Unified build issues in dom/bindings. r=baku 2017-10-26 11:12:44 +01: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
Nika Layzell c223b9ff2d Bug 1414974 - Part 6: Change WebIDL bindings to refer to nsGlobalWindowInner rather than nsGlobalWindow, r=bz
MozReview-Commit-ID: KbCpDFoWyTe
2017-11-09 10:44:49 -05:00
Nika Layzell ff8b5bd178 Bug 1414974 - Part 3: Move Get{Inner,Outer}WindowWithId onto the specific subclasses, r=smaug
These were originally exposed directly as static methods on nsGlobalWindow, but
as they are clearly associated with either the inner or outer window, it makes
more sense for them to be called as such.

MozReview-Commit-ID: LFq8EfnhDlo
2017-11-09 10:44:47 -05:00
Nika Layzell 3409141758 Bug 1414974 - Part 2: Switch many consumers to nsGlobalWindow{Inner,Outer}, r=smaug
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.

MozReview-Commit-ID: 99648Lm46T5
2017-11-09 10:44:47 -05:00
Jonathan Watt f10fc1e787 Bug 1413216 - Fix some missing includes in dom code. r=baku
MozReview-Commit-ID: 25hWPkXF0Wj
2017-10-12 13:50:23 +01: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
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
Andrew McCreight 298aa82710 Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL

--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
2017-10-26 15:08:41 -07:00
Sebastian Hengst 24b7b2eb7c merge mozilla-central to autoland. r=merge a=merge 2017-10-24 23:59:14 +02:00
Tom Schuster d3b457113a Bug 638054 - Remove or fix tests outside JS using watch/unwatch. r=bz,fitzgen 2017-10-24 20:48:14 +02:00
Tom Schuster 7a6aff2c7e Bug 638054 - Remove watch class-hook and proxy trap r=jorendorff,bz 2017-10-24 20:48:14 +02:00
Andi-Bogdan Postelnicu a1d1eceab5 Bug 1411030 - memset only the underlying vector from the Array container. r=froydnj
MozReview-Commit-ID: 5R7ZxMEZdRY

--HG--
extra : rebase_source : 4503bffdc0191f8d3279acc0802bbf2e160cab17
2017-10-24 16:52:20 +03:00
Sylvestre Ledru 15f2be4d17 Bug 1411034 - Remove the const to fix the -Wignored-qualifiers warning r=froydnj
MozReview-Commit-ID: 8BIWJpv9Odz

--HG--
extra : rebase_source : cc7222f056c9eeefd57ecd77f776aa35f080b2ff
2017-10-23 22:40:30 +02:00
Francois Marier 7f48d0bdd3 Bug 1385461 - Upgrade to the latest version of the protobuf library. r=dimi,fitzgen,glandium,mattwoodrow,mossop
The tarball that was imported is the 3.4.1 release:

  https://github.com/google/protobuf/releases/tag/v3.4.1
  https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz

This drops all of the customizations that are no longer needed,
which includes a few issues that were fixed upstream:

- r512.patch from bug 892856:

    https://searchfox.org/mozilla-central/rev/bab9dbe9c4ef71f71fb07e53b701fb2dfde277d9/toolkit/components/protobuf/r512.patch
    b04e5cba35/src/google/protobuf/io/zero_copy_stream_impl.cc (L43)

- vs2013.patch, also from bug 892856:

    https://searchfox.org/mozilla-central/rev/bab9dbe9c4ef71f71fb07e53b701fb2dfde277d9/toolkit/components/protobuf/vs2013.patch
    b04e5cba35/src/google/protobuf/wire_format_lite_inl.h (L39)

- sparc64 fixes in m-c-changes.patch from bug 1275204:

    https://hg.mozilla.org/integration/mozilla-inbound/rev/21d692e82582
    b04e5cba35/src/google/protobuf/stubs/platform_macros.h (L68)

The LOGLEVEL_ERROR hack in m-c-changes.patch from bug 1024774 and
bug 1320179 was replaced by a NOGDI define in moz.build as suggested
by upstream:

    https://github.com/google/protobuf/pull/3745/files#r144915445

The other customizations that were dropped came from bug 1024774.

The patch for OpenBSD/32-bit will likely be fixed upstream in a
future release:

    https://github.com/google/protobuf/pull/3747#issuecomment-336581244

Upgrading the protobuf library also required re-generating all
of the existing .pb.h and pb.cc files (they are neither forward
nor backward-compatible) and making adjustments to the build
config to make it compile (and silence warnings).

text_format.cc can now be compiled as part of UNIFIED_SOURCES.

MozReview-Commit-ID: 7F2IqFmwQnN

--HG--
extra : rebase_source : b907a28a8063ecd82bb38530d309faafc7b83175
2017-10-18 15:02:05 -07:00
Masatoshi Kimura dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09: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
Nicholas Nethercote f2d1f3b005 Bug 1407117 - Simplify static atom representation. r=froydnj,bz.
Currently nsAtom::mString points to the interior of an nsStringBuffer. For
static atoms this requires the use of nsFakeStringBuffer, which is pretty
gross.

This patch changes things so that nsAtom::mString points to a static char
buffer for static atoms. This simplifies a number of things:

- nsFakeStringBuffer and CheckStaticAtomSizes are no longer needed.

- FakeBufferRefCountHelper is no longer needed.

- nsAtom's constructor for static atoms is simpler.

- RegisterStaticAtoms() is simpler.

On the flip-side, a couple of things get more complicated.

- nsAtom::ToString() treats static and dynamic atoms differently.

- nsAtom::GetStringBuffer() is now only valid for dynamic atoms. This
  function is only used in two places, both involving DOMString, so those
  locations are updated appropriately. This also requires updating some other
  code assigning nsStrings to DOMStrings, because we can't assume that
  nsStrings are shared.

On Linux64 this change reduces the size of the binary by 8752 B, and moves
81968 B from the .data to the .rodata section, where it can be shared between
processes.

--HG--
extra : rebase_source : 0f6fcdec1c525aa66222e208b66a9f9026f69bcb
2017-10-12 10:52:17 +11:00
Sebastian Hengst 373bdd8602 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 9adaYBJ4tlo
2017-10-13 23:37:41 +02:00
Steve Fink 67d7e8dcdc Bug 1406570 - Rooting improvements, r=jonco,bz
--HG--
extra : rebase_source : 48d6fd63e016abe7a6ce22e621d25858560e61f1
2017-10-09 10:59:02 -07:00
Chung-Sheng Fu 6eb3e9c2c9 Bug 967895 - Ask for placeholder data when image extraction is not allowed (Tor 6253). r=jrmuizel
MozReview-Commit-ID: AJ5F6M5S83U

--HG--
extra : rebase_source : 894b16575ebbccc26c5b639d7526cb473501d9d2
2017-08-22 14:23:41 +08:00
Jonathan Watt 84328b84e7 Bug 1406820 part 2. Fix some missing member initialization in dom/bindings code. r=qdot 2017-10-11 00:46:18 +01:00
Jason Orendorff 65e620a4eb Bug 1404107 - Refactor: Move some reparenting complexity into XPConnect. r=mrbkap,r=bz
--HG--
extra : rebase_source : 817ef532b2fe67bc901339aa19d84bf571adfc71
2017-10-05 11:49:43 -05:00
Jason Orendorff f719f95f29 Bug 1404107 - Fix cloning expando chains when reparenting DOM objects. r=bz,r=mrbkap
--HG--
extra : rebase_source : fac045a54af8fba9e3ac46012aaf3b8a4b7b480c
extra : source : 53838f13462feb5db5542ee6d5bc7e24172fb51f
2017-09-29 10:33:13 -05: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
Ehsan Akhgari 7df8d7beeb Bug 1406493 - Remove the rest of the attribute deprecation warnings; r=baku f=annevk 2017-10-09 18:26:11 -04:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Olli Pettay 478b3b1343 Bug 1405821 - Move microtask handling to CycleCollectedJSContext, r=baku 2017-10-05 18:34:12 +03:00
Andrea Marchesini baa04d619a Bug 1120178 - Migrate DOMError to DOMExtension in FileReader, IndexedDB, DOMRequest and so on, r=smaug 2017-08-06 20:47:00 +03: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
Wes Kocher 47b3660c80 Merge m-c to inbound, a=merge
MozReview-Commit-ID: 8wTTCUkrY2i
2017-09-25 16:43:51 -07:00
Jessica Jong 60f43f2bbd Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData. r=smaug
MozReview-Commit-ID: DIQN3JFxkT8
2017-09-25 02:46:00 -04: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
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
Boris Zbarsky 82a08c647e Bug 991271. Restore our assertions about how wrapping failure should mean an exception was thrown. r=mccr8
Now that Gecko controls error reporting and the JS engine is no longer doing
JS_IsRunning checks, we should consistently have exceptions here.

MozReview-Commit-ID: IqBe5ArJc2l
2017-09-18 21:24:37 -04:00
Boris Zbarsky 15194f2f07 Bug 1400275. Ensure we create reflectors for JS-implemented webidl interfaces with the right prototype when those interfaces are subclassed. r=qdot
MozReview-Commit-ID: 5yYD92NVVFQ
2017-09-15 23:45:06 -04:00
Nicholas Nethercote 2ef37710e7 Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.
It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.

--HG--
extra : rebase_source : abbcb8e5001389affbf717092213b898673db07f
2017-09-05 20:19:06 +10:00
Boris Zbarsky 4d16655b25 Bug 1393806 part 3. Change dom::ReparentWrapper to take an ErrorResult. r=peterv
This makes it easier for its consumers to avoid leaving a dangling exception on
the JSContext.

MozReview-Commit-ID: Xep7IkYxSx
2017-09-13 13:34:55 -04:00
Jon Coppeard a3c0357907 Bug 1399141 - Attribute malloc memory when creating reflector object r=baku 2017-09-13 11:21:12 +01:00
Jon Coppeard a4fe4cbe3c Bug 1301863 - Tell the JS engine how much memory blob reflectors hold alive r=baku 2017-09-12 10:46:51 +01:00
Jason Orendorff ce74f6c158 Bug 1363200 - JSAPI for realms: Move mIsContentXBLScope to the CompartmentPrivate. r=mrbkap
In the new order, it will be a compartment-level bit rather than a
realm-level bit, so it does not belong on the Scope.

--HG--
extra : rebase_source : 44aa4620f7fd7f8d253c8c7f09bf8c97c00ff061
extra : source : 5a9c01720d7929e43aa70341d3821bfaa2479592
2017-07-12 15:00:47 -05:00
Eden Chuang 8b1ac2ad9e Bug 1387149 - Remove outdated comment from Codegen.py. r=bz
Remove following outdated comment from Codegen.py
# We don't enforce this for chrome in realease builds to avoid the addon
# compat fallout of making that change. See bug 916644.
2017-08-09 17:31:10 +08:00
Nicolas Silva 8c73d0d120 Bug 1398134 - Fix warning in BindingUtils.h. r=bkelly 2017-09-11 14:50:15 +02:00
Boris Zbarsky b986760665 Bug 1396904. Remove bogus and no longer needed AutoSuppressGCAnalysis. r=mccr8 2017-09-09 04:11:25 -04:00
Kris Maglione d55de0c717 Bug 1396856: Part 3 - Add a WebIDL wrapper class for necko channels. r=ehsan,mixedpuppy
Ehsan, can you please review the DOM bindings, and Shane the request logic?

The bulk of the overhead WebRequest API is in its access to nsIChannel and
friends through XPConnect. Since it's not really feasible to convert channels
to use WebIDL bindings directly, this generic channel wrapper class serves the
same purpose.

MozReview-Commit-ID: 4mNP8HiKWK

--HG--
extra : rebase_source : 111687dd0925619b5d93447aecffacd5d53532ef
2017-09-06 14:38:23 -07:00
Wes Kocher a14d71906d Merge m-c to inbound, a=merge
MozReview-Commit-ID: BJ4WkYrJ9g6
2017-09-06 17:24:48 -07:00
Valentin Gosu 0546c43ed7 Bug 1393837 - Make sure codegen includes all the parent interfaces r=peterv
MozReview-Commit-ID: 5UWExNmYyME

--HG--
extra : rebase_source : 2fa38d0ebaa894a381b3daf0b4de57346a9f911d
2017-09-06 10:33:45 +02:00
Eden Chuang 2638e37728 Bug 1388661 - Support currency validation in PaymentRequet API. r=baku
This patch implements currency validation algorithm according to the spec
    https://w3c.github.io/payment-request/#validity-checkers.

    1. amount.currencySystem must be "urn:iso:std:iso:4217".
    2. amount.currency is valid with following criteria
       1. The currency length must be 3.
       2. The currency contains any character that must be in the range "A" to
          "Z"(U+0041 to U+005A) or the range "a" to "z"(U+0061 to U+007A).

    According to the spec, converting the currency to upper case and save it in
    nsIPaymentRequest.
2017-09-06 14:36:24 +08:00
Kris Maglione e29233744c Bug 1255894: Part 6 - Implement StreamFilter DOM bindings. r=baku,mixedpuppy
MozReview-Commit-ID: 6EaVrIep1gC

--HG--
extra : rebase_source : 0ab8311a87ed6c5bcaa3216a1d84793f76143821
2017-08-27 19:51:36 -07:00
Andrew McCreight 13c3d91b7f Bug 958643, part 3 - Remove always-null second second argument to XPCConvert::NativeInterface2JSObject. r=krizsa
MozReview-Commit-ID: CQvJ1bZBLyS

--HG--
extra : rebase_source : 0da1274aa8d6b3584ac0103ddf8884e993887574
2017-09-20 10:20:48 -07:00
Till Schneidereit fb21cc09de Bug 1384513 - Change all public APIs to take JS::AutoRequireNoGC instead of JS::AutoCheckCannotGC. r=jonco
Additionally, change the base class of AutoSuppressGCAnalysis from AutoAssertNoAlloc to AutoAssertNoGC.

In combination, these chances enable passing either JS::AutoCheckCannotGC or JS::AutoSuppressGCAnalysis, depending on whether suppressing the GC analysis is desired or not.

MozReview-Commit-ID: Eg1cl28ezeJ
* * *
Bug 1384513 - Follow-up to fix bustage from template usage of functions with a changed signature, on a CLOSED TREE. r=bustage

MozReview-Commit-ID: 5SsI4DoDwAT
2017-07-26 12:20:59 +02:00
Boris Zbarsky 056d8fe612 Bug 1395421 part 2. When a get() happens on a JS-implemented maplike, notify the JS implementation so it can take some sort of action (e.g. logging or warning). r=peterv
MozReview-Commit-ID: 9G115wOyzvm
2017-08-31 22:45:53 -04:00
Boris Zbarsky 2697cc0235 Bug 1395421 part 1. Don't codegen JS-implemented-webidl glue for methods that use maplike/setlike/iterable codegen (and hence wouldn't call into that clue anyway). r=peterv
MozReview-Commit-ID: 6voihCBh6wh
2017-08-31 22:45:53 -04:00
Andrew McCreight 78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Jan de Mooij ad11155416 Bug 1393790 part 2 - Remove JS_PropertyStub and JS_StrictPropertyStub. r=jorendorff 2017-08-28 10:40:19 +02:00
Jan de Mooij 3e1a11f41d Bug 1393790 part 1 - Remove JS_STUBGETTER and JS_STUBSETTER. r=jorendorff 2017-08-28 10:39:57 +02:00
Jan de Mooij a5de55dced Bug 1389510 part 3 - Remove getProperty/setProperty hooks from ClassOps. r=evilpie 2017-08-25 10:12:16 +02:00
Benjamin Bouvier b5407c81cc Bug 1391633: Remove the unused JSContext parameter in SetDocumentAndPageUseCounter; r=froydnj
MozReview-Commit-ID: KtVP5JgLIFC

--HG--
extra : rebase_source : 210f0a479cf0919e1d6e589a5857f43fb50fa8c5
extra : histedit_source : 2f08891b3dba80e117e3f5e4a0e0367b51e42606
2017-08-18 16:02:15 +02:00
Jan de Mooij 2cc6df95c3 Bug 1392554 - Port (Async)StatementParams to WebIDL bindings. r=asuth,qdot 2017-08-24 10:52:52 +02:00
Kris Maglione 90f1e3558c Bug 1391110: Part 3 - Add nsIWebBrowserPersistable to FrameLoader bindings. r=smaug
MozReview-Commit-ID: 8mBNbgmrXBV

--HG--
extra : rebase_source : d553bca30c3fa4affc9e6ee9e65e5b4000e0cac2
2017-08-19 14:16:16 -07:00
Kris Maglione 470160f420 Bug 1391110: Part 1 - Convert FrameLoader bindings to WebIDL. r=smaug
XPConnect wrapper overhead for this interface has been showing up heavily in a
lot of my profiles, in some places accounting for 50ms of the 80ms we spend
getting getting <browser> messageManagers. This improves the situation
considerably.

MozReview-Commit-ID: 9d1hCORxsYG

--HG--
rename : dom/base/nsIFrameLoader.idl => dom/webidl/FrameLoader.webidl
extra : rebase_source : d8a1fc1a19632ba36a9fc6f63873f7534671a13b
2017-08-19 00:55:00 -07:00
John Dai b50868f89a Bug 1392790 - Avoid doing [CEReactions] if custom element preference is disabled. r=smaug 2017-08-23 02:36:00 -04:00
Jan de Mooij 3912244f0b Bug 1390489 - Port StatementRow to WebIDL bindings. r=asuth,qdot 2017-08-22 09:25:37 +02:00
Edgar Chen 12bce104dc Bug 1299363 - Part 2: Allow prototype swizzling in html constructor. r=bz
MozReview-Commit-ID: KGVfbAxpbfq

--HG--
extra : rebase_source : f9b5150eb2c988b0d18b44cdcce820bc8d3f4bf3
extra : histedit_source : a6f4f69740f3622959557e1fc0ae44bb05151c37
2017-02-17 18:33:44 +08:00
Edgar Chen 089e114bd5 Bug 1299363 - Part 1: Implement construction stack. r=wchen
MozReview-Commit-ID: F59P9r9sRk

--HG--
extra : rebase_source : 8195ecaba5f27cdd54572b8dab1575d2424a7d64
extra : histedit_source : 0118b2bfaecf4296e5013cc3ee312619fb32c457
2016-12-22 11:47:19 +08:00
Andrea Marchesini cb3c4dda07 Bug 1128959 - Implement the WHATWG Streams spec - part 12 - starting body consuming and passing the JSContext down from the binding entrypoints to where the ReadableStream could be read, r=bz
This patch does 2 things:

. when SetBodyUsed() is called, the pump for the stream reading is activated.

. Just because of the reading of the stream could end up executing JS code, we
  need to pass the JSContext in the correct state down to SetBodyUsed.
2017-08-10 18:04:55 -07:00
Andrea Marchesini 3a14f6c21f Bug 1128959 - Implement the WHATWG Streams spec - part 7 - Response.body, r=bkelly 2017-08-10 18:04:55 -07:00
Andrea Marchesini 3b86092f16 Bug 1128959 - Implement the WHATWG Streams spec - part 4 - Fetch implementation, r=bkelly 2017-08-10 18:04:54 -07:00
Andrea Marchesini 42e07522e8 Bug 1128959 - Implement the WHATWG Streams spec - part 2 - WebIDL Bindings - internal renaming, r=bkelly 2017-08-10 18:04:54 -07: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
Alphan Chen 252278116e Bug 1362075 - Correct window.open() URL failure exception. r=ehsan
--HG--
extra : rebase_source : 6a9e42e6b6528890631c89b14684578cc8475364
2017-08-08 02:07:00 +02:00
Dragana Damjanovic dd.mozilla@gmail.com 23c8b30d23 Bug 1381282 - Change nsScriptErrorBase::InitWithWindowID so that it does not call GetSensitiveInfoHiddenSpec as much as now. r=bz r=valentin 2017-08-07 15:56:30 +02:00
Masatoshi Kimura 49e04cc095 Bug 1149830 - Remove nsIStackFrame::language. r=bz,mccr8
MozReview-Commit-ID: LxTiLFzNJ9Y

--HG--
extra : rebase_source : 98ca14aa59a62309dcbe0c9ed3e961c730ff9db9
2017-08-03 15:50:07 +09:00
Christoph Kerschbaumer 432d6fc782 Bug 1366695: Convert dom/bindings/test/test_barewordGetsWindow.html to comply with new data: URI inheritance model. r=smaug 2017-08-03 21:00:41 +02:00
Nicholas Nethercote f5c5231809 Bug 1382955 (part 1) - Remove MozPowerManager and related things. r=bz,gsvelto.
This includes the FactoryReset stuff.
2017-08-02 10:04:36 +10:00
Jan de Mooij bbe72b0768 Backed out changeset 78859e22ce17 (bug 1384513) for perf regressions.
--HG--
extra : rebase_source : fd6063fc8c2f0b9677e5dee4fbbe1c85c210dd7c
2017-08-01 10:41:43 +02:00
Kyle Machulis 2533883d04 Bug 1279218 - Rename HTMLSharedObjectElement to HTMLEmbedElement; r=bz
MozReview-Commit-ID: KkvRkFXAX30

--HG--
rename : dom/html/HTMLSharedObjectElement.cpp => dom/html/HTMLEmbedElement.cpp
rename : dom/html/HTMLSharedObjectElement.h => dom/html/HTMLEmbedElement.h
extra : rebase_source : 460c2a018e2a737b6397e8306127d73bc017d8da
2017-07-28 21:35:43 -07:00
Kyle Machulis ffa9be1bed Bug 1279218 - Remove Applet tag; r=bz
Removes applet tag interfaces, and changes HTML5 parser to output
HTMLUnknownElement when tag is found. Removes tag process from various
places in the browser.

MozReview-Commit-ID: 2zHhK2U2esX

--HG--
extra : rebase_source : d06ecaffd1cb656301e29b900bafde4c68a4606e
2017-07-10 16:00:30 -07:00
Nazım Can Altınova 0598921a5f Bug 1365900 - Extract CSSFontFeatureValuesRule base class r=xidorn
Extract CSSFontFeatureValuesRule from nsCSSFontFeatureValuesRule
class. This is necessary because we will create a FontFeatureValues
rule for Servo side.

MozReview-Commit-ID: GKy5wa6JLv9

--HG--
extra : rebase_source : 015f13da9a776c4ece8aa13655395afbb347b870
2017-07-24 16:12:57 -07:00
Carsten "Tomcat" Book d360d49d2a merge mozilla-inbound to mozilla-central a=merge 2017-07-27 10:57:25 +02:00
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Nathan Froyd a5c3b22cad Bug 1378965 - silently include codegen.pp for DOM bindings; r=chmanchester
codegen.pp isn't available immediately (there's a rule to generate it),
and so make warns when it's initially not found.  But since this is a
depends file, like other dependency files generated by the build
process, we should silently include it so make doesn't even warn about
it.
2017-07-25 11:17:32 -04:00
Jan de Mooij 7e5724db61 Bug 1383775 - Clean up function toString/toSource code, remove remnants of source decompiler. r=anba 2017-07-25 13:22:11 +02:00
Ting-Yu Chou a4c77b8ab9 Bug 1363959 - Compare jsid equality instead of string comparison in XrayResolveOwnProperty(). r=bholley
MozReview-Commit-ID: LFK5hR2RBGF

--HG--
extra : rebase_source : 1aa34b9998840302574f23c00d15ec713f70dcde
2017-07-20 15:12:03 +08:00
Till Schneidereit 6f4ae4701b Bug 1384513 - Follow-up to fix bustage from template usage of functions with a changed signature, on a CLOSED TREE. r=bustage
MozReview-Commit-ID: 5SsI4DoDwAT
2017-07-26 15:02:01 +02:00
Boris Zbarsky d226db3321 Bug 1371259 followup. Fix rooting analysis hazards in UnwrapObjectInternal. r=peterv pending 2017-07-10 18:04:49 -04:00
Boris Zbarsky 66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky 9cdb2834a8 Bug 1371259 part 8. Get rid of nsIXPConnect::GetNativeOfWrapper. r=peterv
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.

The other changes are as follows:

* In nsDOMClassInfo, we really care whether we have a window, so we can just
  UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
  bindings now.  Also, the weird compartment check hasn't been needed ever since
  GetNativeOfWrapper stopped returning things off the passed-in object's
  prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
  can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
2017-07-10 16:05:25 -04:00
Boris Zbarsky cdd8fe10d4 Bug 1371259 part 4. Stop using UnwrapArg to unwrap this values. r=peterv 2017-07-10 16:05:25 -04:00
Boris Zbarsky 5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Boris Zbarsky 5fd161c633 Bug 1371259 part 2. Change union conversions for non-owning unions to pass a MutableHandle through to the underlying conversion code. r=peterv 2017-07-10 16:05:24 -04:00
Boris Zbarsky 6ed5936b6b Bug 1371259 part 1. Pass maybe-mutable Value handles, not JSObject*, into CastableObjectUnwrapper. r=peterv
The idea is that CastableObjectUnwrapper will want to have a MutableHandle for
the thing it's unwrapping whenever its target is a raw pointer.  Since we have
convenient MutableHandle<Value> in most cases, it's easier to switch
CastableObjectUnwrapper to working with MutableHandle<Value> or Handle<Value>
instead of trying to get MutableHandle<JSObject*> in the right places.

There are basically two changes here:

1) Make CastableObjectUnwrapper work with at thing that looks like a Value.
2) Change various callsites to pass in MutableHandle<Value>, in addition to a
   Handle<Value>, into the JS-to-C++ conversion templates.  The
   MutableHandle<Value> is passed as ${maybeMutableVal}.  It may not actually
   end up being a MutableHandle in some cases.

The reason for passing both a Handle and a MutableHandle is that when the thing
we actually have is a Rooted named "foo" the Handle will be "foo" but the
MutableHandle is most naturally written as "&foo".  This is not a problem if
you're just passing it through, but if you want to test whether it's an object,
say, you have a problem.  Writing "foo.isObject()" is ok, but "&foo.isObject()"
is not, and neither is "(&foo).isObject()".  This could be worked around by
passing the MutableHandle as "JS::MutableHandle<JS::Value>(&foo)" or something,
and then "JS::MutableHandle<JS::Value>(&foo).isObject()" does work.  But it
makes the code very hard to read.

So we just pass both things along; ${val} should be used for readonly access and
${maybeMutableVal} any time you really want a MutableHandle.
2017-07-10 16:05:24 -04:00
L. David Baron c59666d841 Bug 1343715 - Split nsTSubstring::mFlags into separate variables for class and data flags. r=dmajor
MozReview-Commit-ID: JW1p5BxpHKA

--HG--
extra : transplant_source : %20e%CF%FA%60%A2%1Bn%1A%C6%A2%DBAy%3C%E0b%0C%077
2017-07-10 12:23:10 -07:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Ehsan Akhgari f2eb6c6f8d Bug 1378042 - Part 2: Make WebIDLNameTableKey::mHash PLDHashNumber; r=baku 2017-07-04 11:06:52 -04:00
Boris Zbarsky d471a06f87 Bug 1376954 part 2. Support nursery allocation of DOM proxy objects. r=smaug,jonco 2017-06-30 10:15:52 -07:00
Boris Zbarsky 239e1057ca Bug 1376954 part 1. Ensure that we don't try to nursery-allocate non-wrappercached DOM objects. r=smaug 2017-06-30 10:15:51 -07:00
Ting-Yu Chou 8f144f6221 Bug 1348099 part 3 - Fix the codegen so the methods for clearing cached attribute values are not unforgeable. r=bz
Current codegen list the methods for clearing cached attribute values in both
chrome only unforgeable methods and chrome only normal methods, but they should
exist only in the normal ones.

MozReview-Commit-ID: Il2JvCLZ2v3

--HG--
extra : rebase_source : 21b9c715c921c4ac7f6ed4c235ee79a3628162bd
2017-06-29 17:54:20 +08:00
Ting-Yu Chou a1814c7263 Bug 1348099 part 2 - Add tests for DOM Xrays that properties are exposed to only proper object types. r=bz
MozReview-Commit-ID: Iu86lAviFJK

--HG--
extra : rebase_source : ac0df64b504212a090934427e2c091eb40641877
2017-06-22 14:43:11 +08:00
Ting-Yu Chou 2a8c9b7ffd Bug 1348099 part 1 - Binary search property id when resolve DOM Xrays own property. r=bz
Currently we resolve a property by iterating every prefable and check whether it
is enabled.  If it is, we linear search the ids that it manages.  This patch
changes that to binary searching to find whether the id being resolved is
present first, and checking whether its prefable is enabled only when we find
it.  This improves the performance of property resolution, especially when the
property is not present.

The patch stores all the property ids a NativePropertiesN owns in a single array
of PropertyInfo structs.  Each struct contains an id and the information needed
to find the corresponding Prefable for the enabled check, as well as the
information needed to find the correct property descriptor in the Prefable.  We
also store an array of indices into the PropertyInfo array, sorted by bits of
the corresponding jsid.  Given a jsid, this allows us to binary search for the
index of the corresponding PropertyInfo, if any.  The index array requires 2
bytes for each property, which is ~20k across all our bindings.  The extra
information stored in each PropertyInfo requires 4 bytes for each property,
which is about 40k across all our bindings in 32-bit builds, or 80k in 64-bit
builds due to alignment requirements on PropertyInfo.  However we save a bit of
memory from changing NativePropertiesN's trios to duos.

The array of unsorted ids is kept because XrayOwnPropertyKeys() includes only
properties that are enabled.  Without it, we will need to check every single
property to know whether its prefable is enabled or not, which is inefficient.

With this patch, initializing property ids takes longer because of the sorting.
I measured also insertion sort because I thought the ids should be nearly sorted
as they are generated sequentially at run time, but that's not the case and
NS_QuickSort() runs faster.

MozReview-Commit-ID: Lc4Z1ui3t0o

--HG--
extra : rebase_source : 314efe467a14428c57f90af2ecc0ec5c47a31993
2017-06-12 12:13:38 +08:00
Boris Zbarsky 165cfab86b Bug 1371424 - Trace the right thing in TypedArray's TraceSelf implementation. r=mccr8 2017-06-08 16:56:43 -04:00
Boris Zbarsky b87612bde1 Bug 1374119. Use a bool pref cache for interface object enablement conditions instead of calling GetBool. r=qdot 2017-06-19 23:52:04 -04:00
Thomas Wisniewski 3646a5cbe9 Bug 1036659 - Don't call mozilla::DropJSObjects() in CallbackObject::DropJSObjects(). r=mccr8
MozReview-Commit-ID: AbD1NUqCvFD
2017-06-16 17:15:32 -04:00
Mats Palmgren ea75194536 Bug 1372031 - Use EnsureInserted instead of Contains+PutEntry to avoid unnecessary hashtable lookups. r=froydnj
MozReview-Commit-ID: 2ZG2qX3dyGa
2017-06-17 00:06:04 +02:00
Boris Chiou f8dbd6bb32 Bug 1339690 - Part 3: Drop spacing mode. r=birtles,smaug
MozReview-Commit-ID: 1c7jpzWQjVP

--HG--
extra : rebase_source : 7850e290abb5fd87684c99710666c881eb777eb4
2017-06-13 15:09:19 +08:00
Jan de Mooij bf6aed7a06 Bug 1370608 part 3 - Use JS_NewEnumerateStandardClasses outside js/src. r=bz 2017-06-14 10:39:11 +02:00
Jan de Mooij 83f290de99 Bug 1370608 part 1 - Move newEnumerate hook from ObjectOps to ClassOps. r=evilpie,bz 2017-06-14 10:37:44 +02:00
Peter Van der Beken 3455c5b415 Bug 1252211 - Convert TreeContentView to WebIDL. r=bz.
--HG--
extra : rebase_source : 78b770df8863b8165639c4a7a0eaabd5463c1090
2017-06-08 21:04:02 +02:00
Peter Van der Beken ae390ac4ca Bug 1252211 - Convert XUL template builders to WebIDL. r=bz.
--HG--
rename : layout/xul/tree/nsITreeView.idl => dom/webidl/TreeView.webidl
rename : dom/xul/templates/nsIXULTemplateBuilder.idl => dom/webidl/XULTemplateBuilder.webidl
extra : rebase_source : ccfc87c460e20027a4ea6b3cc04efe14802dc41e
2017-05-24 11:51:10 +02:00
Peter Van der Beken 9b9495bf79 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : 5a24af4928dbd7754850c6e3ceff6646bfe58c93
2017-05-18 09:07:25 +02:00
Carsten "Tomcat" Book 4a5a3d9f30 Backed out changeset 2c51cdd42834 (bug 1252211) for bustage 2017-06-13 12:20:33 +02:00
Carsten "Tomcat" Book 3ef39f1665 Backed out changeset 82c5f20d6ee2 (bug 1252211) 2017-06-13 12:20:16 +02:00
Carsten "Tomcat" Book dc97c12485 Backed out changeset 629ace67da3b (bug 1252211) 2017-06-13 12:20:14 +02:00
Peter Van der Beken d34f37d164 Bug 1252211 - Convert TreeContentView to WebIDL. r=bz.
--HG--
extra : rebase_source : 246c1dda3db15ed0332af895485853e6e5d1ffa4
extra : intermediate-source : 0312d6ff0792f8d9cb20f2e06cbae59d5bbf690a
extra : source : 7b808c16e93cbd395a9f57bda4a9206e11a6df69
2017-06-08 21:04:02 +02:00
Peter Van der Beken 7c1c7552a6 Bug 1252211 - Convert XUL template builders to WebIDL. r=bz.
--HG--
rename : layout/xul/tree/nsITreeView.idl => dom/webidl/TreeView.webidl
rename : dom/xul/templates/nsIXULTemplateBuilder.idl => dom/webidl/XULTemplateBuilder.webidl
extra : rebase_source : 6788542d65fe446e851eebd4804d7dba428c8c84
extra : source : 599f27e86cb7ba543b4014c91be89c67225064ec
2017-05-24 11:51:10 +02:00
Peter Van der Beken 9d549d2f23 Bug 1252211 - Remove DOMCI for TreeSelection, XULCommandDispatcher and XULControllers. r=bz.
--HG--
extra : rebase_source : db24985f7e8f6d4ca4df13015d565ec0063ba355
extra : source : f361697cb50b47dc4db94a6730b6604ab69217f5
2017-05-18 09:07:25 +02:00
Boris Zbarsky d7ec8ed805 Bug 1372371. Fix enumerability handling in the window resolve hook. r=qdot 2017-06-12 22:17:03 -04:00
Samuel Vargas 901459a071 Bug 1325113 - Implement support for WEBGL_compressed_texture_s3tc_srgb - r=jgilbert,qdot
MozReview-Commit-ID: mI4dlB2lK
2017-06-08 14:54:37 -07:00
Boris Zbarsky 2f1f31e6d0 Bug 1370640. Get rid of ProtoAndIfaceCache::EntrySlotIfExists. r=peterv 2017-06-07 12:56:27 -04:00
Boris Zbarsky 40b47041ab Bug 1370614. Replace some uses of ProtoAndIfaceCache::EntrySlotIfExists with a faster boolean-returning test function. r=froydnj 2017-06-07 12:56:27 -04:00
Boris Zbarsky febf0f30d6 Bug 1364816 part 5. Make getting window names a bit faster by avoiding various intermediate strings. r=qdot,jandem 2017-06-06 21:21:45 -04:00
Boris Zbarsky 60d80c3c4e Bug 1364816 part 3. Switch NeedResolve bindings to using a newResolve hook instead of a resolve hook. r=qdot,jandem 2017-06-06 21:21:44 -04:00
Boris Zbarsky 2a310b9f3b Bug 1364816 part 2. Add a way to ask the WebIDLGlobalNameHash for only the names that have not yet been resolved on the given window. r=qdot 2017-06-06 21:21:44 -04:00
Boris Zbarsky 1002ea42f3 Bug 1364816 part 1. Store the relevant constructor id in the entries in the WebIDLGlobalNameHash. r=qdot 2017-06-06 21:21:43 -04:00
Kris Maglione 761a458cda Bug 1356546: Part 1 - Add a StructuredCloneHolder JS helper to hold opaque structured clone blobs. r=billm
There are several places in the WebExtensions framework where we currently
need to repeatedly serialize and deserialize structured clone data as it
passes through message managers, which can lead to significant performance
issues.

This helper class lets us serialize a value directly from the source extension
context into an opaque blob, and then directly deserialize it into the target
context on the other end, with no X-ray overhead or clones into privileged
scopes in-between.

MozReview-Commit-ID: 4QzHi89onxc

--HG--
extra : rebase_source : 2ec196ca9ce9be90b7eadf136c938373ac7d3fdd
2017-05-20 15:09:24 -07:00
Kris Maglione 02c1b0890c Bug 1368102: Part 2 - Add WebExtensionContentScript bindings. r=billm,mixedpuppy
Bill, can you please review the binding code? Shane and zombie, can you please
review the content script matching?

MozReview-Commit-ID: IJB5s0a7r7S

--HG--
extra : rebase_source : 4026105b8c04e6b88c9be8cf76898fca26f1c3e0
2017-06-03 22:03:19 -07:00
Kris Maglione d9d83b9f73 Bug 1322235: Part 4 - Add initial native WebExtensionPolicy bindings. r=billm,aswan
Bill, can you please review the binding code and the general sanity of the
platform code? Andrew and zombie, can you please review the policy logic and
tests?

As in part 1, this aims to reduce the overhead of our extension policy logic
by making it directly available to native code with as little JS and XPConnect
overhead as possible.

MozReview-Commit-ID: 40m1wSEYtBo

--HG--
extra : rebase_source : c03834791707f78431440af9b88035ab03dc9564
2017-05-24 15:58:19 -07:00
Kris Maglione 186924219b Bug 1322235: Part 1 - Add native MatchPattern and MatchGlob bindings. r=billm,aswan
Bill, can you please review the binding code, and the general sanity of the
platform code. Andrew and zombie, can you please matching algorithms and
tests.

Change summary:

The existing JavaScript matching code works well overall, but it needs to be
called a lot, particularly from hot code paths. In most cases, the overhead of
the matching code on its own adds up enough to cause a problem. When we have
to call out to JavaScript via XPConnect to make a policy decision, it adds up
even more.

These classes solve both of these problems by a) being very fast, and b) being
accessible directly from C++. They are particularly optimized for the common
cases where only literal or prefix matches are required, and they take special
steps to avoid virtual calls wherever possible, and caching computed URL
values so that they can be reused across many match operations without
additional overhead.

MozReview-Commit-ID: BZzPZDQRnl

--HG--
rename : toolkit/modules/tests/xpcshell/test_MatchPattern.js => toolkit/components/extensions/test/xpcshell/test_MatchPattern.js
extra : rebase_source : c93c4c6c36460eb5ad0fc3aa86ad42a72e76bb6c
2017-05-24 14:57:29 -07:00
Boris Zbarsky 0396c9b2f2 Bug 1369367. DOM callbacks can now store a null object; teach codegen to handle that. r=qdot 2017-06-02 16:37:02 -04:00
Andrea Marchesini 31b48170ed Bug 1368296 - Renaming WorkerProxyToMainThreadRunnable::RunBackOnWorkerThread to RunBackOnWorkerThreadForCleanup and improving the description for this method, r=asuth 2017-06-02 11:05:27 +02:00
Xidorn Quan ae513f0ff4 Bug 1352968 part 1 - Add separate CSSImportRule base class. r=heycam
MozReview-Commit-ID: 5h6dmij1elX

--HG--
extra : source : 5205d8d42a0f9e8f0c013c13a23cf5d85cc37f2f
2017-05-30 11:10:25 +10:00
Eden Chuang 68cf4559f8 Bug 1345361 - PaymentRequest constructor implementation. r=baku 2017-05-26 01:50:32 +08:00
Ryan VanderMeulen df9dd3967c Backed out changeset 437d6df1859c (bug 1345361) for ESLint failures. 2017-05-25 18:05:15 -04:00
Eden Chuang 80717194b1 Bug 1345361 - PaymentRequest constructor implementation. r=baku 2017-05-26 01:50:32 +08:00
Boris Zbarsky 7c6c40e506 Bug 1366032. Align IDL record to C++ conversion with the spec when Symbol-named properties are involved. r=qdot 2017-05-24 08:50:30 -04:00
Ryan VanderMeulen 9f0c23d7c6 Merge m-c to inbound. a=merge 2017-05-19 12:25:23 -04:00
Boris Zbarsky 682fe478ec Bug 1237503. Add support for [Cached] and [StoreInSlot] things on DOM proxies. r=qdot
The only difference between proxies and non-proxies is that proxies only support
up to MAX_FIXED_SLOTS slots all told (reserved plus private slot).  SpiderMonkey
already has static asserts to make sure we don't ask for too many reserved slots
on a proxy.
2017-05-19 09:24:30 -04:00
Xidorn Quan f5f29c5f7b Bug 1345697 part 2 - Add CSSKeyframesRule and CSSKeyframeRule base class. r=heycam
MozReview-Commit-ID: GZzZIV3eYgo

--HG--
extra : source : a97464201a12620b28bea580ad7e911fd64f8599
2017-05-19 16:12:34 +10:00
Boris Zbarsky bd29adfa95 Bug 1189822 part 5. Remove the now-unnecessary DOMProxyHandler::ClearExternalRefsForWrapperRelease function. r=peterv
All DOMProxyHandler::ClearExternalRefsForWrapperRelease now does is clear a backpointer to the expando, and that's handled during reflector finalization already.
2017-05-17 00:52:53 -04:00
Boris Zbarsky 0c1348b3ef Bug 1189822 part 4. Fix finalization for DOM overridebuildins proxies to not clear the expando if it's for a different reflector. r=peterv, sfink
This is something that should have happened in bug 1352430 but was missed there.
2017-05-17 00:52:53 -04:00
Boris Zbarsky 9f3244d605 Bug 1189822 part 3. Stop using EnsureExpandoObject in codegen code when we just want to preserver the wrapper for a DOM proxy. r=peterv 2017-05-17 00:52:53 -04:00
Boris Zbarsky 17e91105ca Bug 1189822 part 1. Switch DOMProxyHandler::EnsureExpandoObject to using normal wrapper preservation instead of RegisterDOMExpandoObject. r=peterv 2017-05-17 00:52:52 -04:00
Xidorn Quan 6f168c437d Bug 1328319 part 1 - Move nsCSSCounterStyleRule into a separate header file. r=heycam
MozReview-Commit-ID: Lm1GiKNsgI0

--HG--
extra : rebase_source : 8b792236cf6c89a7469df26cfc57dd66f35f9eef
2017-05-09 21:52:06 +10:00
Boris Zbarsky 742751837a Bug 1363874. Disallow [Cached] and [StoreInSlot] on static attributes for now. r=qdot 2017-05-12 11:15:12 -04:00
Fernando Jimenez Moreno 74d09d6ab3 Bug 1361994 - Part 1: Add separate CSSDocumentRule class. r=xidorn
MozReview-Commit-ID: DMDOHvBWLHX

--HG--
extra : rebase_source : 5602924c03eb0821d304bae264f73f1db7ea8591
2017-05-11 14:11:15 +02:00
Edgar Chen be79c5bdce Bug 1359346 - Implement custom element state; r=wchen
https://dom.spec.whatwg.org/#concept-element-custom-element-state

MozReview-Commit-ID: TpGVfTEXPj

--HG--
extra : rebase_source : 26c65a4c83eb4f3c0ccb60a3598336c4afcb0247
2016-12-28 11:43:29 +08:00
btian 145c7af3f9 Bug 1338059 - Part 1: Generate cycle collection related code for WebIDL type Promise, r=bz
MozReview-Commit-ID: 1wQFBCur0Uy

--HG--
extra : rebase_source : 055cbc34525cbf8d67f143f56528ff6165a61786
2017-05-05 10:12:40 +08:00
Boris Zbarsky 45a20c4074 Bug 1358596. Restore check for sanity of slot indices on DOM objects that got lost. r=qdot 2017-05-02 01:55:47 -04: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
Jan de Mooij 8ddc231e13 Bug 1360523 - Define number of reserved slots explicitly for each proxy js::Class. r=bz 2017-04-29 14:41:49 +02:00
Wes Kocher 63e9b2a680 Merge m-c to inbound, a=merge
MozReview-Commit-ID: DEm2JLplowg
2017-04-28 16:46:56 -07:00
Xidorn Quan 1489bc2c0e Bug 1355394 part 1 - Add separate CSSSupportsRule base class. r=heycam
MozReview-Commit-ID: 3rCRn6YQ8Gx

--HG--
extra : rebase_source : 657d41029e65c647f7ea92c2cb34126496015e88
2017-04-26 16:55:36 +08:00
Jan de Mooij f480e9ecdf Bug 1237504 - Refactor proxy slot layout to allow proxies to have more than 2 slots. r=bz,jonco
The patch makes the following proxy changes:

* The number of slots in ProxyValueArray is now dynamic and depends on the number of reserved slots we get from the Class.
* "Extra slots" was renamed to "Reserved slots" to make this clearer.
* All proxy Classes now have 2 reserved slots, but it should be easy to change that for proxy Classes that need more than 2 slots.
* Proxies now store a pointer to these slots and this means GetReservedSlot and SetReservedSlot can be used on proxies as well. We no longer need GetReservedOrProxyPrivateSlot and SetReservedOrProxyPrivateSlot.

And some changes to make DOM Proxies work with this:

* We now store the C++ object in the first reserved slot (DOM_OBJECT_SLOT) instead of in the proxy's private slot. This is pretty nice because it matches what we do for non-proxy DOM objects.
* We now store the expando in the proxy's private slot so I removed GetDOMProxyExpandoSlot and changed the IC code to get the expando from the private slot instead.
2017-04-28 14:12:28 +02:00
Wes Kocher c90904f9bf Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: 9HQViJrDT6S
2017-04-26 17:30:31 -07:00
Jon Coppeard eb3c9870bf Bug 1352430 - Add barrier to wrapper cache to clear dying objects that have not yet been finalized r=bz r=sfink
* * *
Code review followup

--HG--
extra : rebase_source : 10c1fd603c2dd1ac2ff5770ae9aec2e9131681ce
2017-04-26 11:18:39 +01:00
Jon Coppeard d7e0c83dcc Bug 1359001 - Make AutoAssertGCCallback a no-op in opt builds r=sfink 2017-04-25 10:56:34 +01:00