Commit Graph

55 Commits

Author SHA1 Message Date
Matt A. Tobin 16dba9a30b Issue #80 - De-unify dom/base
Tag #1375
2020-04-17 07:40:32 -04:00
Matt A. Tobin f605c68f13 Bug 1417829 - Remove unresolved pseudoclass
Tag #1375
2020-04-17 07:38:16 -04:00
Matt A. Tobin 010f37f47b Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]
Tag #1375
2020-04-17 07:29:57 -04:00
Matt A. Tobin 5524318fe7 Bug 1416999 - Remove document.registerElement
Tag #1375
2020-04-17 07:07:09 -04:00
Matt A. Tobin 61e46a6d58 Issue #1375 - Stop largely using the parser service
This is based on Bug 1395828

* Add nsHTMLElement::IsBlock()
* Rename nsHTMLTags methods
* Remove AssertParserServiceIsCorrect()
* Remove most uses of nsIParserService/nsParserService
2020-04-17 06:24:43 -04:00
Gaming4JC 3c70b297c7 Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition
Since we are dealing with the element (nodeInfo->LocalName() and NameAtom() are the same value), we could use nodeInfo->NameAtom() instead.

Tag UXP Issue #1344
2020-01-26 15:50:52 -05:00
Gaming4JC 0cea94242a Bug 1430034 - Fix attributeChangedCallback isn't fired with correct newValue when the attribute value is an empty string;
Tag UXP Issue #1344
2020-01-26 15:50:52 -05:00
Gaming4JC d84323905b Bug 1421544 - Lazy push/pop CustomElementReactionsStack entry;
Tag UXP Issue #1344
2020-01-26 15:50:51 -05:00
Gaming4JC e8f95f974f Bug 1413815 - Convert 'observedAttributes' to a sequence<DOMString>
Tag UXP Issue #1344
2020-01-26 15:50:51 -05:00
Gaming4JC 53319e5df6 Bug 1407669 - Fix custom element creation hides uncatchable exceptions from the constructor.
Tag UXP Issue #1344
2020-01-26 15:50:51 -05:00
Gaming4JC a8bf089e8a Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked
Tag UXP Issue #1344
2020-01-26 15:50:50 -05:00
Gaming4JC 0405d843be Bug 1419305 - Part 1: Use MicroTask on CustomElements correctly
Tag UXP Issue #1344
2020-01-26 15:50:50 -05:00
Gaming4JC 43a8113072 Bug 1405821 - Move microtask handling to CycleCollectedJSContext
Tag UXP Issue #1344
2020-01-26 15:50:49 -05:00
Gaming4JC f576d8f0fe Bug 1396620 - Part 1: Remove created callback for custom elements
Tag UXP Issue #1344
2020-01-26 15:50:48 -05:00
Gaming4JC 37d09da24e Bug 1400762 - Make dom.webcomponents.enabled pref doesn't control CustomElements feature
Tag UXP Issue #1344
2020-01-26 15:50:47 -05:00
Gaming4JC 7e9efb0f27 Bug 1405335 - Remove custom element attached and detached callbacks validation checks
Tag UXP Issue #1344
2020-01-26 15:50:47 -05:00
Gaming4JC 93313b0ce3 Bug 1406325 - Part 5: Implement try to upgrade.
Tag UXP Issue #1344
2020-01-26 15:50:46 -05:00
Gaming4JC fb657f7a1e Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0.
Tag UXP Issue #1344
2020-01-26 15:50:46 -05:00
Gaming4JC a0014ac6e9 Bug 1378079 - Part 3: Complete the steps related to custom elements in "create an element for a token".
With fixup for missing header due to unified builds.

Tag UXP Issue #1344
2020-01-26 15:50:44 -05:00
Gaming4JC b7f890e02e Bug 1410790 - Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition;
This is a follow-up patch for bug 1392970. Since we only set CustomElementDefinition on a custom element which is custom, we could add more assertion to ensure that.

Tag UXP Issue #1344
2020-01-26 15:50:39 -05:00
Gaming4JC 1aa6cdcc1d Bug 1352290 - Add assertion to CustomElementReactionsStack::Enqueue to ensure upgrade reactions aren't scheduled to BackupQueue;
Tag UXP Issue #1344
2020-01-26 15:50:32 -05:00
Gaming4JC 2cbd6d3699 Bug 1407937 - Move mDefinition from CustomElementReacion to CustomElementUpgradeReaction;
Tag UXP Issue #1344
2020-01-26 15:50:31 -05:00
Gaming4JC 4dda3f6039 Bug 1406297 - Fix Document.createElement must report an exception.
Tag UXP Issue #1344
2020-01-26 15:50:31 -05:00
Gaming4JC 8e6ce5fae7 Bug 1121994 - Implement adopted callback for custom elements.
Tag UXP Issue #1344
2020-01-26 15:50:30 -05:00
Gaming4JC 6bbb9f062b Bug 1334044: Replace detached callback (v0) with disconnected callback (v1).
Tag UXP Issue #1344
2020-01-26 15:50:29 -05:00
Gaming4JC 3d4c410091 Bug 1334043 - Part 2: Make nsContentUtils::EnqueueLifecycleCallback static.
We make nsContentUtils::EnqueueLifecycleCallback static so that it can be called without a window object. To achive this, we also make CustomElementReaction not taking a CustomElementRegistry in the constructor, as it can call Upgrade statically.

Tag UXP Issue #1344
2020-01-26 15:50:29 -05:00
Gaming4JC 186782301c Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1).
Tag UXP Issue #1344
2020-01-26 15:50:28 -05:00
Gaming4JC 42331663e6 Bug 1392970 - Part 2: Get CustomElementDefinition from CustomElementData when possible.
Tag UXP Issue #1344
2020-01-26 15:50:28 -05:00
Gaming4JC 8573c572fb Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData.
Tag UXP Issue #1344
2020-01-26 15:50:27 -05:00
Gaming4JC f50503df9c Bug 1301024 - Part 2: Implement create an element steps.
Tag UXP Issue #1344
2020-01-26 15:50:27 -05:00
Gaming4JC 49f597e7fb Bug 1332233 - prevent resource leak in CustomElementRegistry::Define.
Tag UXP Issue #1344
2020-01-26 15:50:26 -05:00
Gaming4JC bf004bb63b Bug 1334051 - Part 2: Invoke attributeChangedCallback only if attribute name is in the observed attribute list.
We call attributeChangedCallback in two cases:

1. When any of the attributes in the observed attribute list has changed, appended, removed, or replaced.

2. When upgrading an element, for each attribute in element's attribute list that is in the observed attribute list.

Note: w/ Fixup for not implementing an API Enhancement Bug 1363481.

Tag UXP Issue #1344
2020-01-26 15:50:25 -05:00
Gaming4JC 08fc057471 Bug 1334051 - Part 1: Include namespace in attributeChangedCallback.
Per spec [1], we should include namesapce in attributeChangedCallback argurment list.
[1] https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element, step 3

Tag UXP Issue #1344
2020-01-26 15:50:25 -05:00
Gaming4JC 704318ea0a Bug 1299363 - Part 5-2: Implement new upgrade steps.
Tag UXP Issue #1344
2020-01-26 15:50:25 -05:00
Gaming4JC bbb717ec12 Bug 1299363 - Part 5-1: Make the constructor created by document.registerElement() also works with construction stack.
So that the old upgrade can also work with new upgrade steps which will be implemented in part 5-2.

Tag UXP Issue #1344
2020-01-26 15:50:24 -05:00
Gaming4JC 515c46e695 Bug 1353647 - Fix the custom elements v0 upgrade inconsistency;
There are two places doing prototype setup in old upgrade,
- If definition comes after JS reflector creation, CustomElementRegistry::Upgrade will do prototype swizzling.
- If definition comes before JS reflector creation, Element::WrapObject will set up the prototype.

The later one does SubsumesConsideringDomain, but the former doesn't not.

This patch is to fix the inconsistency, i.e. the former case should also do SubsumesConsideringDomain.

Tag UXP Issue #1344
2020-01-26 15:50:24 -05:00
Gaming4JC d7e5ad445c Bug 1299363 - Part 4: Hold a pointer of ElementQueue in ReactionsStack instead.
1. It is possible that invoking a reaction triggers pushing a new ElementQueue into ReactionStack (e.g., calling define() in constructor which probably enqueue another upgrade reaction), and the reference of ElementQueue passed to InvokeReactions becomes invalid due to the memmove in nsTArray implementation.

2. And we get another benefit from this is memmove becomes faster.

Tag UXP Issue #1344
2020-01-26 15:50:23 -05:00
Gaming4JC ca596f2823 Bug 1299363 - Part 3: Remove unused argument in UpgradeCandidates.
Tag UXP Issue #1344
2020-01-26 15:50:23 -05:00
Gaming4JC 53c9b77ed4 Bug 1315885 - Part 4: Implement callback reaction for custom element reactions.
Note: Skipped SyncInvokeReactions since it is removed in CE v1, waste of time.

Tag UXP Issue #1344
2020-01-26 15:50:22 -05:00
Gaming4JC e6733c9278 Bug 1315885 - Part 3: Transfer the ownership of ReactionQueue's entry due to re-enter CustomElementReactionsStack::InvokeReactions.
Tag UXP Issue #1344
2020-01-26 15:50:21 -05:00
Gaming4JC 6ff1c0c52f Bug 1315885 - Part 2: Avoid rethrowing exception in CustomElementCallback::Call.
Tag UXP Issue #1344
2020-01-26 15:50:21 -05:00
Gaming4JC a2c7b5f1d9 Bug 1325279 - Put the reaction queue in CustomElementData structure instead of using a map;
Bug 1347446 makes accessing ElementReactionQueue becomes a bit non-trival (have to get it via DocGroup). Since bug 1359346 already refactors the creation time of CustomElementData, ReactionQueue can also be put into CustomElementData, then we can just get ReactionQueue from Element.

Tag UXP Issue #1344
2020-01-26 15:50:17 -05:00
Gaming4JC e86aac28b8 Bug 1359346 - Implement custom element state;
https://dom.spec.whatwg.org/#concept-element-custom-element-state

Tag UXP Issue #1344
2020-01-26 15:50:16 -05:00
Gaming4JC 9abc9b2b78 Bug 1357002 - Part 1: Cache dom.webcomponents.customelements.enabled preference;
Tag UXP Issue #1344
2020-01-26 15:50:15 -05:00
Gaming4JC 859fbc139a Bug 1341898 - Make nsDocument::IsWebComponentsEnabled use a cached bool pref;
Note: Minus IPC bit.

Tag UXP Issue #1344
2020-01-26 15:50:15 -05:00
Gaming4JC d8109fa9a0 Bug 1309147 - Part 5: Eliminate performance cliff when accessing CEReactions code.
Tag UXP Issue #1344
2020-01-26 15:50:15 -05:00
Gaming4JC e055747038 Bug 1309147 - Part 4: Add CEReactions for CustomElementRegistry.
Tag UXP Issue #1344
2020-01-26 15:50:14 -05:00
Gaming4JC 16cd53bd8d Bug 1351979 - Change CustomElementRegistry::Define code to properly propagate out JS exceptions;
Tag UXP Issue #1344
2020-01-26 15:50:12 -05:00
Gaming4JC 25a33c7123 Bug 1347446 - Move custom element reactions stack to DocGroup.
Tag UXP Issue #1344
2020-01-26 15:50:12 -05:00
Gaming4JC 5cf46e2f87 Bug 1341693 - Don't need to check GetDocShell() when creating CustomElementRegistry;
Tag UXP Issue #1344
2020-01-26 15:50:11 -05:00