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

167 Коммитов

Автор SHA1 Сообщение Дата
Karl Tomlinson b275f554ac Bug 1542932 Remove CustomElementConstructor copy r=bzbarsky
Depends on D26868

Differential Revision: https://phabricator.services.mozilla.com/D26869

--HG--
extra : moz-landing-system : lando
2019-04-10 15:45:57 +00:00
Karl Tomlinson e4131b866f Bug 1542932 Change define() parameter functionConstructor from Function to CustomElementConstructor r=bzbarsky
Depends on D26867

Differential Revision: https://phabricator.services.mozilla.com/D26868

--HG--
extra : moz-landing-system : lando
2019-04-10 15:45:11 +00:00
Karl Tomlinson 9e68172512 bug 1542932 Generate CustomElementConstructor from WebIDL callback definition r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D26867

--HG--
extra : moz-landing-system : lando
2019-04-11 23:05:10 +00:00
Karl Tomlinson 99521124d0 Bug 1542932 align CustomElementConstructor::Construct() parameters with WebIDL bindings conventions r=bzbarsky
Depends on D26865

Differential Revision: https://phabricator.services.mozilla.com/D26866

--HG--
extra : moz-landing-system : lando
2019-04-10 15:25:15 +00:00
Karl Tomlinson 1896b280b5 bug 1542934 Annotate that CustomElementConstructor::Construct() callers can run script r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D26635

--HG--
extra : moz-landing-system : lando
2019-04-10 12:51:15 +00:00
Karl Tomlinson 8591f49e08 Bug 1542934 Mark strong reference members as const to aid CanRunScriptChecker r=smaug
Depends on D26633

Differential Revision: https://phabricator.services.mozilla.com/D26634

--HG--
extra : moz-landing-system : lando
2019-04-09 13:37:23 +00:00
Karl Tomlinson fb212757ff Bug 1542934 strong ref arguments for functions that may run CustomElementConstructor::Construct() r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D26633

--HG--
extra : moz-landing-system : lando
2019-04-10 06:29:56 +00:00
Jeff Walden c40e81a2e9 Bug 1537536 - Move JS::ForOfIterator to its own header. r=arai,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D24257

--HG--
rename : js/src/jsapi.h => js/public/ForOfIterator.h
extra : moz-landing-system : lando
2019-03-26 17:10:44 +00:00
Ryan Hunt 00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Boris Zbarsky 12266da44b Bug 1521907 part 4. Start using CheckedUnwrapStatic/Dynamic in non-binding DOM code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D17884

--HG--
extra : moz-landing-system : lando
2019-02-02 03:24:22 +00:00
Gurzau Raul 44e4d42e8a Backed out 7 changesets (bug 1521907) for failing at unit/test_bug1151385.js on a CLOSED TREE.
Backed out changeset ef04359ccf0d (bug 1521907)
Backed out changeset ac1c61bf61e9 (bug 1521907)
Backed out changeset df09b7be63c5 (bug 1521907)
Backed out changeset 585fa0024d46 (bug 1521907)
Backed out changeset e593c29aaff4 (bug 1521907)
Backed out changeset ac2e180a35b6 (bug 1521907)
Backed out changeset 270b1db9ea81 (bug 1521907)
2019-02-02 00:58:16 +02:00
Boris Zbarsky 76e1fab0c7 Bug 1521907 part 4. Start using CheckedUnwrapStatic/Dynamic in non-binding DOM code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D17884

--HG--
extra : moz-landing-system : lando
2019-02-01 18:48:36 +00:00
Ciure Andrei 63b0f3f854 Backed out 7 changesets (bug 1521907) for JSObject Wrapper.cpp bustages and failures CLOSED TREE
Backed out changeset ce3108090e77 (bug 1521907)
Backed out changeset efd05f4979f1 (bug 1521907)
Backed out changeset 2d0895148907 (bug 1521907)
Backed out changeset 192152fe986a (bug 1521907)
Backed out changeset ca65b46b0d37 (bug 1521907)
Backed out changeset b3daf5ca3d11 (bug 1521907)
Backed out changeset 1b0a09a46c70 (bug 1521907)
2019-02-01 19:38:25 +02:00
Boris Zbarsky b014cb9758 Bug 1521907 part 4. Start using CheckedUnwrapStatic/Dynamic in non-binding DOM code. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D17884

--HG--
extra : moz-landing-system : lando
2019-01-31 15:51:52 +00:00
Boris Zbarsky 98f992df34 Bug 1519193 part 3. Convert CustomElementRegistry::Upgrade to using ShadowIncludingTreeIterator. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D16244

--HG--
extra : moz-landing-system : lando
2019-01-12 03:19:27 +00:00
Boris Zbarsky 6b0beea5ef Bug 1519193 part 2. Convert CandidateFinder::Traverse to using ShadowIncludingTreeIterator. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D16243

--HG--
extra : moz-landing-system : lando
2019-01-12 03:18:38 +00:00
Noemi Erli f53cd6172e Backed out 5 changesets (bug 1519193) for build bustages in Document.cpp CLOSED TREE
Backed out changeset e118466df64d (bug 1519193)
Backed out changeset 12d89a7fe296 (bug 1519193)
Backed out changeset 08b0f2b9a96a (bug 1519193)
Backed out changeset 1caa462e7f08 (bug 1519193)
Backed out changeset aae6e06aa88b (bug 1519193)
2019-01-12 00:29:37 +02:00
Boris Zbarsky 05b3aaca59 Bug 1519193 part 3. Convert CustomElementRegistry::Upgrade to using ShadowIncludingTreeIterator. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D16244

--HG--
extra : moz-landing-system : lando
2019-01-10 22:23:33 +00:00
Boris Zbarsky d78e0c4e68 Bug 1519193 part 2. Convert CandidateFinder::Traverse to using ShadowIncludingTreeIterator. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D16243

--HG--
extra : moz-landing-system : lando
2019-01-10 22:21:24 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nika Layzell 2f7bbe21e3 Bug 1477432 - Part 11: Update CustomElementRegistry to not use nsIJSID, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D9733
2018-11-16 17:27:48 -05:00
Timothy Guan-tin Chien af2973ef61 Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

Differential Revision: https://phabricator.services.mozilla.com/D11249

--HG--
extra : moz-landing-system : lando
2018-11-15 06:52:01 +00:00
Andreea Pavel d51566f085 Backed out 2 changesets (bug 1503019) for failing crashtests at dom/base/crashtests/1505811.html on a CLOSED TREE
Backed out changeset 06b12fd41ff1 (bug 1503019)
Backed out changeset 7b845eac9dd7 (bug 1503019)
2018-11-15 01:52:30 +02:00
Timothy Guan-tin Chien c69315234b Bug 1503019 - Part II, Remove dom.webcomponents.customelements.enabled pref r=smaug
This patch removes the following functions:

* nsContentUtils::IsCustomElementsEnabled()
* CustomElementRegistry::IsCustomElementEnabled(JSContext* aCx, JSObject* aObject)
* CustomElementRegistry::IsCustomElementEnabled(nsIDocument* aDoc)

and all references of the pref.

Depends on D11183

Differential Revision: https://phabricator.services.mozilla.com/D11249

--HG--
extra : moz-landing-system : lando
2018-11-14 19:37:42 +00:00
Karl Tomlinson 343e0160ee Bug 1493073 Remove obsolete comment about webidl callback parameter being nulled before use r=kmag
CustomElementRegistryBinding uses RootedCallback and so the constructor cannot
be nulled.

The comment was added to warn about an unrooted callback argument
from nsDocument::RegisterElement(), a caller that no longer exists.

https://bugzilla.mozilla.org/show_bug.cgi?id=1369533#c25
https://hg.mozilla.org/mozilla-central/rev/16d0cd656b05#l6.298

Differential Revision: https://phabricator.services.mozilla.com/D6465

--HG--
extra : moz-landing-system : lando
2018-10-30 19:41:18 +00:00
Boris Zbarsky e6bab07f1b Bug 1496673. Fix crash in custom element data memory reporting code. r=jdai
While iterating the list in CustomElementReactionsStack::InvokeReactions we can
have null pointers in mReactionQueue for reactions that have already been
invoked.

Differential Revision: https://phabricator.services.mozilla.com/D7923

--HG--
extra : moz-landing-system : lando
2018-10-05 21:27:14 +00:00
Karl Tomlinson f8377b2dc9 Bug 1493362 Remove obsolete "all wrappers are constructable if they are callable" comment r=edgar
The comment is no longer accurate since
https://hg.mozilla.org/mozilla-central/rev/26b1ee21f365#l2.20

I've left the same behavior because checking that the caller has permission to
access the unwrapped constructor still seems sensible.

The JS::IsConstructor() check could be performed on |constructor| but I
guess it is a touch more efficient on constructorUnwrapped.

Differential Revision: https://phabricator.services.mozilla.com/D6564

--HG--
extra : moz-landing-system : lando
2018-09-24 07:56:13 +00:00
Emilio Cobos Álvarez 27d103ae6b Bug 1484285 - Avoid loading XBL bindings for stuff that is very likely to be a custom-element. r=smaug
This should be more generic than hardcoding the tags, and be enough for our
chrome to avoid regressions as they migrate more stuff to CE, avoiding calling
into the GetComputedStyle machinery..

Differential Revision: https://phabricator.services.mozilla.com/D6537

--HG--
extra : moz-landing-system : lando
2018-09-21 21:29:25 +00:00
Steve Fink 1554c31d8c Bug 1487167 - Various DOM rooting issues. r=bz
--HG--
extra : amend_source : dc5bf09193860ac7a3f01071132284ed10423e97
2018-08-28 21:26:50 -07:00
Neil Deakin 00b778c4e7 Bug 1478372, allow QueryInterface to be used for custom element implemented interfaces, r=bz,bgrins 2018-09-19 06:46:41 -04:00
Boris Zbarsky bd242c33f1 Bug 1486480. Add memory reporting for custom element data. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D4350
2018-08-27 19:20:53 +00:00
Dave Townsend fd8d6b1590 Bug 1480465: Infer the namespace for custom elements at definition time by following the class hierarchy. r=smaug
When a custom element is defined we can check whether its class is an instance
of XULElement or HTMLElement and tag the defintion with a namespace accordingly.
This allows us to know the correct namespace for the custom element when
created.

Differential Revision: https://phabricator.services.mozilla.com/D2680

--HG--
extra : moz-landing-system : lando
2018-08-15 10:31:16 +00:00
Kris Maglione e295c2223a Bug 1480244: Part 0 - Fix unified build bustage. r=me
--HG--
extra : rebase_source : 4966a2166a1d57747d0ca21941e885096850f63f
2018-08-11 15:26:49 -07:00
Nicholas Nethercote b9e071e2e8 Bug 1481998 - Make mozilla::Hash{Map,Set}'s entry storage allocation lazy. r=luke,sfink
Entry storage allocation now occurs on the first lookupForAdd()/put()/putNew().
This removes the need for init() and initialized(), and matches how
PLDHashTable/nsTHashtable work. It also removes the need for init() functions
in a lot of types that are built on top of mozilla::Hash{Map,Set}.

Pros:

- No need for init() calls and subsequent checks.

- No memory allocated for empty tables, which are not that uncommon.

Cons:

- An extra branch in lookup() and lookupForAdd(), but not in put()/putNew(),
  because the existing checkOverloaded() can handle it.

Specifics:

- Construction now can take a length parameter.

- init() is removed. Explicit length-setting, when necessary, now occurs in the
  constructors.

- initialized() is removed.

- capacity() now returns zero when the entry storage is absent.

- lookupForAdd() is no longer `const`, because it can instantiate the storage,
  which requires modifications.

- lookupForAdd() can now return an invalid AddPtr in two cases:

  - old: hashing failure (due to OOM in the hasher)

  - new: OOM while instantiating entry storage

  The existing failure handling paths for the old case work for the new case.

- clear(), finish(), and clearAndShrink() are replaced by clear(), compact(),
  and reserve(). The old compactIfUnderloaded() is also removed.

- Capacity computation code is now in its own functions, bestCapacity() and
  hashShift(). setTableSizeLog2() is removed.

- uint32_t is used throughout for capacities, instead of size_t, for
  consistency with other similar values.

- changeTableSize() now takes a capacity instead of a deltaLog2, and it can now
  handle !mTable.

Measurements:

- Total source code size is reduced by over 900 lines. Also, lots of existing
  lines got shorter (i.e. two checks were reduced to one).

- Executable size barely changed, down by 2 KiB on Linux64. The extra branches
  are compensated for by the lack of init() calls.

- Speed changed negligibly. The instruction count for Bench_Cpp_MozHash
  increased from 2.84 billion to 2.89 billion but any execution time change was
  well below noise.
2018-08-10 18:00:29 +10:00
Jan de Mooij d238731d5e Bug 1472976 part 1 - Unwrap the object before getting its principal in CustomElementRegistry::IsCustomElementEnabled. r=smaug 2018-08-10 11:57:39 +02:00
Jan de Mooij 5824a03a39 Bug 1478359 - Store a global object in nsXPCWrappedJS and use it for realm-entering. r=mccr8
The problem we're solving here: getting/entering the realm/global of a cross-compartment wrapper doesn't make sense once there are multiple realms in a compartment and the CCW will be shared by all of them. Because nsXPCWrappedJS can store a CCW, we will no longer be able to use this JSObject to enter the target realm.

What this patch does: we pass a JSContext* to nsXPCWrappedJS::GetNewOrUsed and we use this to store a global object in nsXPCWrappedJS (with the invariant that the object and global stored in nsXPCWrappedJS are same-compartment). Then when we want to enter the nsXPCWrappedJS's target realm, we use this global object instead of the maybe-CCW object. Because we currently still have one realm per compartment and the objects are same-compartment, this is guaranteed to preserve behavior for now.

nsXPCWrappedJS has some code to deal with weak pointers. Fortunately this applies only to root wrappers and root wrappers always store an unwrapped JSObject, so the extra global we store is guaranteed to be marked by the GC in that case (a global object is never collected when there are live JSObjects belonging to the same realm).
2018-08-07 11:57:41 +02:00
Nicholas Nethercote d0da0b5842 Bug 1478879 - Remove Range/Enum use in dom/. r=mccr8
--HG--
extra : rebase_source : 422301183e7855a0a994c77ee1e4a4aed72fd9c5
2018-07-31 10:31:00 +10:00
Julian Descottes c81dc03e34 Bug 1443923 - part5: Emit chrome-only event customelementdefined for DevTools;r=masayuki
MozReview-Commit-ID: GCFhhpVj5VS

--HG--
extra : rebase_source : 358985aafe8f517c16be5a570fea7ed0ef68b6c3
2018-07-20 11:01:43 +02:00
Olli Pettay 2e08f09ac9 Bug 1477008, remove invalid assertions, r=edgar 2018-07-21 22:59:36 +03:00
Neil Deakin 0cc9fd046c Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 08:38:45 -04:00
Csoregi Natalia 143b18ba60 Backed out 2 changesets (bug 1461742) for build bustage on CustomElementRegistry.cpp:97. CLOSED TREE
Backed out changeset ca5415dbc51a (bug 1461742)
Backed out changeset 30bd77de7bf5 (bug 1461742)
2018-07-19 13:36:31 +03:00
Neil Deakin c2c722be92 Bug 1461742, add a mechanism so that custom elements can implement interfaces akin to XBL implements. This is accomplished by an additional chrome-only callback getCustomInterface that can be implemented by custom elements, r=bz 2018-07-19 06:15:26 -04:00
Olli Pettay d87b0df953 Bug 1331334 - Implement :defined pseudo-class for custom elements, r=emilio
--HG--
extra : rebase_source : 5f95c38166d00ae07ef523ab8ecb5b4cb59eceaf
2018-06-28 14:55:45 +03:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Olli Pettay 5f299f6227 Bug 1443722 - Implement customElements.upgrade(), static void TryUpgrade , r=mrbkap 2018-06-20 02:14:05 +03:00
Olli Pettay d10d7af09d Bug 1443722 - Implement customElements.upgrade() , r=mrbkap
--HG--
extra : rebase_source : b6153841b5cb38d697795564f1e864e46eb96d35
2018-06-20 02:06:33 +03:00
Miko Mynttinen 4c85ef17cc Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 1e7eea4f2d4ec16ec0c559a8afb26976ddbf4d07
2018-06-01 17:59:07 +02:00
arthur.iakab 7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen 8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00