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

562 Коммитов

Автор SHA1 Сообщение Дата
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
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
Boris Zbarsky 2f1f31e6d0 Bug 1370640. Get rid of ProtoAndIfaceCache::EntrySlotIfExists. r=peterv 2017-06-07 12:56:27 -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
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
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
John Dai b32e4c240b Bug 1309147 - Part 3: Implement the support for CEReactions in Codegen. r=bz
MozReview-Commit-ID: F1mxKzlru9s

--HG--
extra : rebase_source : a5e52ef2f3168028dec2c3186e857941953ad517
extra : histedit_source : 2336479daf177cb7ca55ee517c8317852bed09ef
2017-03-08 17:11:48 +08:00
Jan de Mooij 76f56574e3 Bug 1342439 part 1 - Replace macros to check for overrecursion with functions. r=luke 2017-02-25 16:07:56 +01:00
Jessica Jong cf17189117 Bug 1340086 - Remove uses of AnimationsPaused() since it is always false after bug 1316330. r=mrbkap 2017-02-22 01:00:00 -05:00
Boris Zbarsky 2816ec4748 Bug 1339540 part 2. Move the three ErrorResult-internal NS_ERROR_DOM_* values over to the ErrorResult error module. r=smaug 2017-02-15 00:02:35 -05:00
Boris Zbarsky a449ccb8fa Bug 1333045. Update Location object properties to current spec. r=qdot
Specifically, three changes:

1) valueOf should be non-enumerable.
2) valueOf should be === to Object.prototype.valueOf.
3) There should be no toJSON.

The tests come directly from https://github.com/w3c/web-platform-tests/pull/4623
so not much need to review them.
2017-02-15 00:01:48 -05:00
Boris Zbarsky 90896220ac Bug 1330699 part 11. Add ConvertJSValueTo*String functions that just take a value and hand out a string, without extra complications. r=qdot 2017-02-15 00:01:37 -05:00
Andrea Marchesini 16bc4a8d06 Bug 1334564 - Deprecate URL.createObjectURL(mediastream), r=smaug, r=rjesup 2017-02-07 08:58:35 +01:00
Boris Zbarsky da79ef55fe Bug 1335368 part 8. Stop using IsCallerChrome in UnwrapArgImpl. r=bholley 2017-02-01 15:43:37 -05:00
Boris Zbarsky 39d50c2647 Bug 1332713 part 4. Make Promise-returning getters return a rejected Promise on exception instead of throwing. r=qdot 2017-01-27 18:53:37 -05:00
Yury Delendik 994e1a0538 Bug 1333796 - Set descriptor value as undefined in XrayResolveAttribute. r=evilpie
When property getter is specified the desc's value must the set to undefined --
the desc can be re-used by a caller, so it must be done to preserve this
PropertyDescriptor invariant. We also do this in NativeGetOwnPropertyDescriptor.

MozReview-Commit-ID: 39MCwplbzL3

--HG--
extra : rebase_source : c39e3c6808bed3bcb8a1aa9a8194a89e58338a55
2017-01-25 16:15:09 -06:00
Edgar Chen 881cbd80bd Bug 1274159 - Part 2-2: Support HTMLConstructor WebIDL extended attribute for custom elements; r=bz,wchen
MozReview-Commit-ID: 6egmavfTmFT
2016-11-17 23:31:50 +08:00
Till Schneidereit 95b8398292 Bug 1322920 - Remove DOM Promise implementation. r=bz
MozReview-Commit-ID: 1zzd0x2LNNb
2016-12-14 17:11:48 +01:00
Sebastian Hengst 5e1b29b9c0 Backed out changeset f2a5fc3e8c4e (bug 1274159) 2016-12-14 13:27:22 +01:00
Edgar Chen da0139302c Bug 1274159 - Part 2-2: Support HTMLConstructor WebIDL extended attribute for custom elements; r=bz,wchen
MozReview-Commit-ID: 6egmavfTmFT

--HG--
extra : rebase_source : 07436a4b8dfc1960f0cc24b67b8cc5d1e2ffd5cd
2016-11-17 23:31:50 +08:00
Boris Zbarsky d9af26b7e0 Bug 1321879 part 1. Add an API on GlobalObject to get the caller type, for use in things like WebIDL constructors. r=bholley 2016-12-06 23:41:52 -10:00
Tomislav Jurin 348bfffc19 Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj 2016-12-02 13:46:53 -08:00
Andrea Marchesini 8524257019 Bug 1290021 - Implement a prototype version of Houdini "Worklets Level 1" spec - part 2 - WorkletGlobalScope, r=smaug 2016-11-06 09:54:29 +01:00
Boris Zbarsky 1ef30fd1e4 Bug 1021289 another followup. Make sure that we don't leave an uninitialized opresult when deleting things on DOM objects via Xrays. r=bustage and CLOSED TREE 2016-11-04 15:58:32 -04:00
Boris Zbarsky 598f3f4180 Bug 1021289 part 4. Implement support for WebIDL deleters over Xrays. r=peterv 2016-11-04 12:41:26 -04:00
Ben Kelly 0983850a63 Bug 1303167 P6 Rename new suspend and freeze methods to final names. r=smaug 2016-10-26 10:20:16 -07:00
Ben Kelly bf0ca72f77 Bug 1303167 P2 Use new window suspend and freeze methods. r=smaug
* * *
Bug 1303167 P2 interdiff 0001 Review feedback
2016-10-26 10:20:15 -07:00
Boris Zbarsky 13514334ba Bug 946906 part 8. When getting a cacheable property off a DOM Xray, cache it on the Xray's expando object. r=bholley 2016-10-10 18:16:26 -04:00
Boris Zbarsky 8070de70a2 Bug 946906 part 5. Use the codegenned JSClass, if available, when creating Xray expando objects. r=bholley 2016-10-10 18:16:26 -04:00