1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 23:18:26 +00:00
Commit Graph

59 Commits

Author SHA1 Message Date
FranklinDM 6781f5b6c5 Issue #1375 - Part 2: customElements.define must upgrade custom element in shadow-including tree order
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1326028
2023-03-02 14:28:30 +08:00
Job Bautista ba1887ff4c Issue #80 - Fix deprot in dom/base.
This regression was introduced by my PR #2015.
Found while building dom/base de-unified.
2022-12-30 09:22:21 +08:00
Job Bautista d367067698 Issue #1375 - Use nsIAtom* instead of nsAtom* for CE Upgrade function.
We haven't refactored nsIAtom* as Mozilla did yet.
2022-10-12 17:20:51 +08:00
Job Bautista bc36c607a9 Issue #1375 - Implement customElements.upgrade.
Backported from Mozilla bug 1443722.
2022-10-12 17:20:32 +08:00
Matt A. Tobin 9fdf69e567 Issue #80 - De-unify dom/base
Tag #1375
2020-04-18 07:06:46 +08:00
Matt A. Tobin 6f7c738266 Bug 1417829 - Remove unresolved pseudoclass
Tag #1375
2020-04-18 07:06:35 +08:00
Matt A. Tobin ca09afd0b0 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]
Tag #1375
2020-04-18 07:06:12 +08:00
Matt A. Tobin cedff6e214 Bug 1416999 - Remove document.registerElement
Tag #1375
2020-04-18 07:05:32 +08:00
Matt A. Tobin 9928baf912 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-18 07:04:57 +08:00
Gaming4JC 57da7a1935 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-31 07:40:59 +08:00
Gaming4JC 2cdd48f819 Bug 1430034 - Fix attributeChangedCallback isn't fired with correct newValue when the attribute value is an empty string;
Tag UXP Issue #1344
2020-01-31 07:40:56 +08:00
Gaming4JC a6339bef90 Bug 1421544 - Lazy push/pop CustomElementReactionsStack entry;
Tag UXP Issue #1344
2020-01-31 07:40:53 +08:00
Gaming4JC a9b3ebace0 Bug 1413815 - Convert 'observedAttributes' to a sequence<DOMString>
Tag UXP Issue #1344
2020-01-31 07:40:51 +08:00
Gaming4JC f64c7135b4 Bug 1407669 - Fix custom element creation hides uncatchable exceptions from the constructor.
Tag UXP Issue #1344
2020-01-31 07:40:48 +08:00
Gaming4JC 506795f384 Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked
Tag UXP Issue #1344
2020-01-31 07:40:45 +08:00
Gaming4JC 8a0e7286e0 Bug 1419305 - Part 1: Use MicroTask on CustomElements correctly
Tag UXP Issue #1344
2020-01-31 07:40:42 +08:00
Gaming4JC fb6f6ec903 Bug 1405821 - Move microtask handling to CycleCollectedJSContext
Tag UXP Issue #1344
2020-01-31 07:40:36 +08:00
Gaming4JC baa035c5c4 Bug 1396620 - Part 1: Remove created callback for custom elements
Tag UXP Issue #1344
2020-01-31 07:40:25 +08:00
Gaming4JC 33693080a5 Bug 1400762 - Make dom.webcomponents.enabled pref doesn't control CustomElements feature
Tag UXP Issue #1344
2020-01-31 07:40:21 +08:00
Gaming4JC b70a9b1d12 Bug 1405335 - Remove custom element attached and detached callbacks validation checks
Tag UXP Issue #1344
2020-01-31 07:39:56 +08:00
Gaming4JC dba59f0317 Bug 1406325 - Part 5: Implement try to upgrade.
Tag UXP Issue #1344
2020-01-31 07:39:51 +08:00
Gaming4JC db3b6b5884 Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0.
Tag UXP Issue #1344
2020-01-31 07:39:47 +08:00
Gaming4JC 5d26d32825 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-31 07:39:34 +08:00
Gaming4JC 76b1eaa538 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-31 07:38:53 +08:00
Gaming4JC c0e1a6e397 Bug 1352290 - Add assertion to CustomElementReactionsStack::Enqueue to ensure upgrade reactions aren't scheduled to BackupQueue;
Tag UXP Issue #1344
2020-01-31 07:37:59 +08:00
Gaming4JC eb9d4bb8df Bug 1407937 - Move mDefinition from CustomElementReacion to CustomElementUpgradeReaction;
Tag UXP Issue #1344
2020-01-31 07:37:56 +08:00
Gaming4JC e925977c0f Bug 1406297 - Fix Document.createElement must report an exception.
Tag UXP Issue #1344
2020-01-31 07:37:52 +08:00
Gaming4JC d35ff2985e Bug 1121994 - Implement adopted callback for custom elements.
Tag UXP Issue #1344
2020-01-31 07:37:46 +08:00
Gaming4JC 659204631b Bug 1334044: Replace detached callback (v0) with disconnected callback (v1).
Tag UXP Issue #1344
2020-01-31 07:37:43 +08:00
Gaming4JC befa1027e3 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-31 07:37:35 +08:00
Gaming4JC 207d5a2e3e Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1).
Tag UXP Issue #1344
2020-01-31 07:37:32 +08:00
Gaming4JC d1a1106760 Bug 1392970 - Part 2: Get CustomElementDefinition from CustomElementData when possible.
Tag UXP Issue #1344
2020-01-31 07:37:28 +08:00
Gaming4JC 7ce1742985 Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData.
Tag UXP Issue #1344
2020-01-31 07:37:25 +08:00
Gaming4JC b0285ef3f7 Bug 1301024 - Part 2: Implement create an element steps.
Tag UXP Issue #1344
2020-01-31 07:37:22 +08:00
Gaming4JC 6f325a61af Bug 1332233 - prevent resource leak in CustomElementRegistry::Define.
Tag UXP Issue #1344
2020-01-31 07:37:10 +08:00
Gaming4JC 2bd8be69ea 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-31 07:37:07 +08:00
Gaming4JC 4408e19e96 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-31 07:37:03 +08:00
Gaming4JC 729ffa53f3 Bug 1299363 - Part 5-2: Implement new upgrade steps.
Tag UXP Issue #1344
2020-01-31 07:37:00 +08:00
Gaming4JC b2e0ae6983 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-31 07:36:57 +08:00
Gaming4JC 3dce7ee1bb 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-31 07:36:54 +08:00
Gaming4JC 005b7118ee 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-31 07:36:52 +08:00
Gaming4JC 9fc88d01e3 Bug 1299363 - Part 3: Remove unused argument in UpgradeCandidates.
Tag UXP Issue #1344
2020-01-31 07:36:49 +08:00
Gaming4JC 34dd7065f5 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-31 07:36:40 +08:00
Gaming4JC 931b14f847 Bug 1315885 - Part 3: Transfer the ownership of ReactionQueue's entry due to re-enter CustomElementReactionsStack::InvokeReactions.
Tag UXP Issue #1344
2020-01-31 07:36:37 +08:00
Gaming4JC b94fadac97 Bug 1315885 - Part 2: Avoid rethrowing exception in CustomElementCallback::Call.
Tag UXP Issue #1344
2020-01-31 07:36:34 +08:00
Gaming4JC b631d9d59c 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-31 07:36:08 +08:00
Gaming4JC cb89330bf3 Bug 1359346 - Implement custom element state;
https://dom.spec.whatwg.org/#concept-element-custom-element-state

Tag UXP Issue #1344
2020-01-31 07:36:01 +08:00
Gaming4JC 979d2bfb96 Bug 1357002 - Part 1: Cache dom.webcomponents.customelements.enabled preference;
Tag UXP Issue #1344
2020-01-31 07:35:56 +08:00
Gaming4JC d662ddd6b6 Bug 1341898 - Make nsDocument::IsWebComponentsEnabled use a cached bool pref;
Note: Minus IPC bit.

Tag UXP Issue #1344
2020-01-31 07:35:53 +08:00
Gaming4JC f7154d573b Bug 1309147 - Part 5: Eliminate performance cliff when accessing CEReactions code.
Tag UXP Issue #1344
2020-01-31 07:35:50 +08:00