Commit Graph

262 Commits

Author SHA1 Message Date
Mark Striemer
872f08529b Bug 1899882 - Invoke elementCreationCallback if there are elements to upgrade r=smaug
Co-author/investigator: Tim Giles <tgiles@mozilla.com>

When using SetElementCreationCallback with ESM based custom elements we
are seeing a performance regression vs when we previously required
manually adding a <script type="module"> for the import to the page.

To work around this issue we can delay registering the callback until
the DOMContentLoaded event which improves performance, presumably due to
reduced thrashing from HTML parsing to JS parsing.

With that change however any components that were encountered before the
DOMContentLoaded event will not be loaded or upgraded until the next
time a component of that type is created.

This patch updates the SetElementCreationCallback function to
immediately invoke the callback if there are candidate elements of that
type to upgrade.

Differential Revision: https://phabricator.services.mozilla.com/D212190
2024-06-04 23:18:01 +00:00
Emilio Cobos Álvarez
3bbfb2e943 Bug 1817122 - Make AsyncEventDispatcher(Event) take ownership of the event. r=smaug,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D190059
2023-10-04 19:37:39 +00:00
Markus Stange
fd848139b8 Bug 1852866 - Make LifecycleCallbackArgs::mName a RefPtr<nsAtom>. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D188100
2023-09-13 18:15:02 +00:00
Peter Van der Beken
c10814e75a Bug 1846277 - Remove nsGlobalWindow.h. r=dom-core,necko-reviewers,jesup,farre
Differential Revision: https://phabricator.services.mozilla.com/D184973
2023-08-02 20:41:48 +00:00
keithamus
dbe7b1bc17 Bug 1829335 - Add customElements.getName. r=smaug
This adds the new customElements.getName method which takes a constructor
and returns string if the definition has been registered, otherwise null.

Differential Revision: https://phabricator.services.mozilla.com/D181646
2023-06-27 09:38:01 +00:00
Adam Vandolder
27b8402ea2 Bug 1556358 - Part 1: Add formStateRestore CE lifecycle callback. r=edgar
Depends on D176127

Differential Revision: https://phabricator.services.mozilla.com/D174114
2023-06-13 15:51:46 +00:00
Adam Vandolder
66331f7102 Bug 1663878 - Only process form callbacks for form-associated custom elements. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D167827
2023-01-26 22:26:00 +00:00
Andrew McCreight
718465b79c Bug 1811963 - CustomElementData::Traverse should use NoteXPCOMChild for mElementInternals. r=smaug
ElementInternals is an nsISupports class, so this should use NoteXPCOMChild.

Differential Revision: https://phabricator.services.mozilla.com/D167621
2023-01-24 14:51:33 +00:00
Andrew McCreight
188ac80e29 Bug 1805931, part 2 - Automated removal of uses of ROOT and UNROOT CC macros. r=smaug
As of the prior patch, these are no longer needed. I removed
these with a script, then ran clang-format on the files, then
manually reverted a few unrelated changed from the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D164829
2022-12-15 19:45:01 +00:00
Peter Van der Beken
ec54676d42 Bug 1792444 - Switch some WebIDL APIs from 'any' to a union with 'undefined'. r=edgar,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D158195
2022-09-28 19:10:51 +00:00
Olli Pettay
048bd344c4 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Adam Vandolder
edb3e26639 Bug 1590296 - Gather telemetry on usage of customized built-ins. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D153616
2022-08-23 13:36:37 +00:00
Olli Pettay
292c882e05 Bug 1785109, mark CustomElementRegistry as multizone holder, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D154878
2022-08-22 16:12:26 +00:00
Kagami Sascha Rosylight
419a8cd0b6 Bug 1769290 - Part 7: Apply mozilla-js-handle-rooted-typedef against dom/base r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D148280
2022-06-05 20:54:59 +00:00
Edgar Chen
1adbef4f5f Bug 1749663 - Get rid of dom.webcomponents.formAssociatedCustomElement.enabled pref; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D146743
2022-05-19 08:29:21 +00:00
Edgar Chen
788c838a2e Bug 1745058 - Get rid of dom.webcomponents.disabledFeatures.enabled pref; r=smaug
Depends on D146741

Differential Revision: https://phabricator.services.mozilla.com/D146742
2022-05-19 07:43:01 +00:00
Peter Van der Beken
b6ad8cb91b Bug 1732696 - Improve CustomElementDefinition cycle collection code. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D126670
2021-12-20 10:01:11 +00:00
Edgar Chen
601e4b79df Bug 1556352 - Part 2: Implement formAssociatedCallback; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129197
2021-10-28 10:29:38 +00:00
Edgar Chen
e089ec0b48 Bug 1556363 - Part 3: Implement formDisabledCallback; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129201
2021-10-25 20:43:11 +00:00
Edgar Chen
65932a4f15 Bug 1556354 - Part 5: Implement formResetCallback; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129203
2021-10-25 14:28:05 +00:00
Edgar Chen
7d7fc1054c Bug 1556354 - Part 4: Move CustomElementCallback declaration out of CustomElementRegistry.h; r=smaug
And move CustomElementRegistry::CreateCustomElementCallback to CustomElementCallback::Create.

Differential Revision: https://phabricator.services.mozilla.com/D129191
2021-10-25 14:28:05 +00:00
Edgar Chen
b60f0e846d Bug 1556354 - Part 3: Merge LifecycleCallback*Args; r=smaug
To make adding new callback a bit easier.

Differential Revision: https://phabricator.services.mozilla.com/D129190
2021-10-25 14:28:05 +00:00
Edgar Chen
3674a9bcf6 Bug 1556354 - Part 2: Remove unnecessary includes from CustomElementRegistry.h; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129169
2021-10-25 14:28:04 +00:00
Edgar Chen
a6491b96e3 Bug 1556354 - Part 1: Merge WebComponents.webidl into CustomElementRegistry.webidl; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D129139
2021-10-25 14:28:04 +00:00
Andrew McCreight
3fcf223781 Bug 1736707, part 1 - Get rid of nsContentUtils::NameSpaceManager(). r=peterv
Call nsNameSpaceManager::GetInstance() instead.

Differential Revision: https://phabricator.services.mozilla.com/D129033
2021-10-22 16:15:57 +00:00
Edgar Chen
e8e9901ee4 Bug 1736564 - Create a common error message for conversion error; r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D128883
2021-10-20 08:27:55 +00:00
Edgar Chen
b7f93a5d5c Bug 1556351 - Part 9: Implement FACE upgrade; r=smaug
ElementInternal implements nsIFormControl and QueryInterface HTMLElement to a
nsIFormControl would return its associated ElementInternal instead.

Differential Revision: https://phabricator.services.mozilla.com/D125211
2021-10-04 20:51:28 +00:00
Mike Hommey
131ab2341c Bug 1733034 - Fix unreachable-code-loop-increment warning in dom. r=smaug
dom/base/CustomElementRegistry.cpp:580:56: error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
    for (auto iter = mCandidates.Iter(); !iter.Done(); iter.Next()) {
                                                       ^~~~~~~~~~~

Differential Revision: https://phabricator.services.mozilla.com/D126876
2021-09-29 21:44:53 +00:00
Edgar Chen
4a5f7e38ae Bug 1729800 - Convert nsExtendedDOMSlots::mCustomElementData to UniquePtr; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124987
2021-09-09 13:23:03 +00:00
Edgar Chen
fe85f031ea Bug 1723521 - Part 1: Add "precustomized" custom element state; r=smaug
See https://github.com/whatwg/dom/pull/894 and https://github.com/whatwg/html/pull/5909

Differential Revision: https://phabricator.services.mozilla.com/D121564
2021-08-10 15:15:36 +00:00
Edgar Chen
09c3157981 Bug 1723396 - Ship Custom Elements disabledFeatures; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D121491
2021-08-03 15:53:46 +00:00
Tooru Fujisawa
0986662ce6 Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Simon Giesecke
9e995a79e8 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
2161198260 Bug 708901 - Migrate to nsTHashSet in dom/base. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108593
2021-03-24 17:56:46 +00:00
Csoregi Natalia
37fe7677dd Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
f29debc280 Bug 708901 - Migrate to nsTHashSet in dom/base. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108593
2021-03-24 16:58:58 +00:00
Simon Giesecke
9a99ab6d93 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 16:14:58 +00:00
Alexandru Michis
bd8c44a2c8 Backed out changeset fd03162e726d (bug 1695162) for causing bustages in Document.cpp
CLOSED TREE
2021-03-12 17:10:02 +02:00
Simon Giesecke
d9738bc253 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 14:54:08 +00:00
Simon Giesecke
2969e54562 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-05 15:29:49 +00:00
Alexandru Michis
80cf7cc919 Backed out changeset c6b72f3c76ba (bug 1676361) for causing bustages in nsSocketTransportService2.cpp
CLOSED TREE
2021-03-04 23:26:04 +02:00
Simon Giesecke
b68ba311a2 Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 17:30:48 +00:00
Noemi Erli
c351c837d1 Backed out changeset 06452c4c828c (bug 1676361) for causing bustages CLOSED TREE 2021-03-04 19:13:56 +02:00
Simon Giesecke
e46fd72f6f Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 16:14:44 +00:00
smolnar
4a344e2a83 Backed out changeset 9062e17fe15c (bug 1676361) on devs request. CLOSED TREE 2021-03-04 16:51:21 +02:00
Simon Giesecke
fa4029ad0a Bug 1676361 - Move AutoEntryScript to a separate header file to avoid pulling in GeckoProfiler.h everywhere. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D97742
2021-03-04 14:32:15 +00:00
Simon Giesecke
95c38cc6b8 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
2634de766d Bug 1691913 - Rename nsClassHashtable::LookupOrAdd to GetOrInsertNew. r=xpcom-reviewers,nika
It should be called "Get" rather than "Lookup" because it returns
UserDataType. "Add" is called "Insert" in the other methods.

Differential Revision: https://phabricator.services.mozilla.com/D105470
2021-02-22 12:07:47 +00:00
Simon Giesecke
205e59a165 Bug 1693068 - Use function to lazily create a Promise when needed in CustomElementRegistry::WhenDefined. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D105333
2021-02-22 12:07:46 +00:00
Simon Giesecke
9d60f9c227 Bug 1691894 - Simplify uses of WithEntryHandle that only use OrInsert(With) by using GetOrInsertWith. r=xpcom-reviewers,necko-reviewers,jgilbert,nika
Differential Revision: https://phabricator.services.mozilla.com/D104676
2021-02-22 12:07:46 +00:00