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

591 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 0fc236f464 Bug 1451516 part 5. Stop code-generating generic cross-origin getters. r=qdot 2018-04-05 20:29:41 -04:00
Boris Zbarsky 96880eb840 Bug 1451516 part 4. Stop code-generating generic lenient getters. r=qdot 2018-04-05 20:29:41 -04:00
Boris Zbarsky d6f68586ee Bug 1451516 part 3. Stop code-generating generic getters for maybe-global objects. r=qdot 2018-04-05 20:29:40 -04:00
Boris Zbarsky e5888e7298 Bug 1451516 part 2. Refactor GenericBindingGetter to make it easier to use in more cases. r=qdot 2018-04-05 20:29:40 -04:00
Boris Zbarsky aa63116f80 Bug 1085062 followup. Actually address the review comments. r=peterv 2018-04-04 14:43:41 -04:00
Boris Zbarsky fe15e92e6b Bug 1085062. Remove hasXPConnectImpls support from bindings codegen. r=peterv 2018-04-04 14:39:52 -04:00
Boris Zbarsky 4373a04574 Bug 1446246 part 2. Combine HTMLConstructor and CreateXULOrHTMLElement into a single function. r=peterv
This fixes an observable bug we had due to doing the steps in a different order
from the spec: the 'prototype' get can have side-effects so needs to happen
after some of the other sanity checks.

MozReview-Commit-ID: 83zNhqfqFRu
2018-03-27 15:49:02 -04:00
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
Tom Schuster 2bf6212869 Bug 1255800 - Remove JS_THIS_OBJECT from dom/xpconnect. r=bz
--HG--
extra : rebase_source : dcaa891010e25e10079db853fe4eb1a7fe261e47
2018-03-07 14:35:22 +01:00
Peter Van der Beken e673e5f508 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
The change in browser_net_view-source-debugger.js is needed because we now use WebIDL callbacks for MessageListener, and they add async creation stack frames.

--HG--
extra : rebase_source : 0adb349b40a0c51bb3d8f4b9b7d98106a3929cbd
extra : source : a88d94ec010a12c1d829708aaf59a85609478477
2017-07-19 14:59:02 +02: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
Kannan Vijayan 627eb6ae9a Bug 1411415 - r=bz r=fitzgen 2018-03-05 19:27:02 -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 fc804325a9 Bug 888600 - Move ContentFrameMessageManager to WebIDL. Part 5: Convert MessageManager globals to WebIDL. r=bz.
The change in browser_net_view-source-debugger.js is needed because we now use WebIDL callbacks for MessageListener, and they add async creation stack frames.

--HG--
extra : rebase_source : d7c026d8a77634ef2566feba78168beb8a66a552
2017-07-19 14:59:02 +02:00
Boris Zbarsky 891566df26 Bug 1437255. Use a null prototype for @@unscopables objects in the DOM. r=qdot
MozReview-Commit-ID: 9YjnPHe78Tg
2018-02-12 15:46:11 -05: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
Andrea Marchesini 8cdf705535 Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
Boris Zbarsky f60fd673d6 Bug 1432186 part 19. Remove the nsIDOMNode::*_NODE constants. r=mccr8
MozReview-Commit-ID: KvKjeKIOB9K
2018-01-29 23:10:53 -05: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
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
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
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 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 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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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