Commit Graph
41 Commits
Author SHA1 Message Date
Jessica Jong db69ab73df Bug 1334051 - Part 2: Invoke attributeChangedCallback only if attribute name is in the observed attribute list. f=jdai, r=smaug
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.

MozReview-Commit-ID: LKUY5ibp9RI
* * *
Bug 1334051 - Part 3: Optimize attributeChanged callbacks. r=smaug
2017-08-27 23:25:00 -04:00
Jessica Jong 277e2cdbb6 Bug 1334051 - Part 1: Include namespace in attributeChangedCallback. f=jdai, r=smaug
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

MozReview-Commit-ID: 3K6SeIr3FJX
2017-08-27 23:25:00 -04:00
John Dai 23ec0d3076 Bug 1392790 - Avoid doing [CEReactions] if custom element preference is disabled. r=smaug 2017-08-23 02:36:00 -04:00
johndai1984 ba9e93407a Bug 1299363 - Part 5-2: Implement new upgrade steps. r=bz, r=wchen
MozReview-Commit-ID: 34fIWSKUqyp
2017-08-13 16:40:37 +08:00
Edgar Chen eba1f42c16 Bug 1299363 - Part 5-1: Make the constructor created by document.registerElement() also works with construction stack. r=wchen
So that the old upgrade can also work with new upgrade steps
which will be implemented in part 5-2.

MozReview-Commit-ID: IRyvAPaN19R
2017-03-23 18:21:23 +08:00
Edgar Chen 70ded2239f Bug 1299363 - Part 4: Hold a pointer of ElementQueue in ReactionsStack instead. r=wchen
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.

I hit such problem when running
http://w3c-test.org/custom-elements/CustomElementRegistry.html test.

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

MozReview-Commit-ID: KQ86ZugqsPi
2017-01-09 22:12:57 +08:00
Edgar Chen 9ae1d83500 Bug 1299363 - Part 3: Remove unused argument in UpgradeCandidates. r=bz, r=wchen
MozReview-Commit-ID: 6DtKG5INe8E
2016-12-29 18:25:43 +08:00
Sylvestre Ledru 576cac5ec7 Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL
2017-07-15 19:03:04 +02:00
John Dai 8d7418f13a Bug 1315885 - Part 4: Implement callback reaction for custom element reactions. r=wchen 2017-07-18 20:30:00 -04:00
John Dai 1ae7ce583e Bug 1315885 - Part 3: Transfer the ownership of ReactionQueue's entry due to re-enter CustomElementReactionsStack::InvokeReactions. r=wchen 2017-07-10 01:40:00 -04:00
John Dai 9072a2fff3 Bug 1315885 - Part 2: Avoid rethrowing exception in CustomElementCallback::Call. r=wchen 2017-07-11 02:52:00 -04:00
Mats Palmgren 64658a0f83 Bug 1376498 part 4 - Make all nsClassHashtable::RemoveAndForget() consumers use Remove() instead. r=froydnj
MozReview-Commit-ID: G64YQLlgm6r
2017-07-05 02:01:45 +02:00
Bill McCloskey ce42826bdf Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 238bf154d5 Backed out changeset 4f6302a98ae4 (bug 1372405) 2017-06-21 13:59:26 +02:00
Bill McCloskey 67e8af4720 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book bbe9441993 Backed out changeset 9846de3bd954 (bug 1372405) 2017-06-20 08:27:02 +02:00
Bill McCloskey f69608368b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Mats Palmgren 879454af2e Bug 1372048 - Use LookupForAdd instead of Contains+Get/Put to avoid an unnecessary hashtable lookup. r=froydnj
MozReview-Commit-ID: Anh9DdOjNc1
2017-06-14 16:11:21 +02:00
Edgar Chen 2d469ed3e9 Bug 1325279 - Put the reaction queue in CustomElementData structure instead of using a map; r=wchen
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.

MozReview-Commit-ID: D6PouDu8hkL
2017-03-21 17:02:21 +08:00
Edgar Chen 1e444bd63d Bug 1353647 - Fix the custom elements v0 upgrade inconsistency; r=wchen
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.

MozReview-Commit-ID: G3gVsaEa0YF
2017-04-04 23:42:22 +08:00
Edgar Chen 51055b0e77 Bug 1359346 - Implement custom element state; r=wchen
https://dom.spec.whatwg.org/#concept-element-custom-element-state

MozReview-Commit-ID: TpGVfTEXPj
2016-12-28 11:43:29 +08:00
Edgar Chen c6ae645e0b Bug 1357002 - Part 1: Cache "dom.webcomponents.customelements.enabled" preference; r=wchen
MozReview-Commit-ID: HMsvOmYJvjX
2017-04-07 18:48:16 +08:00
John Dai b3a9d12e96 Bug 1309147 - Part 5: Eliminate performance cliff when accessing CEReactions code. r=bz
MozReview-Commit-ID: 61A5YNtJQXF
2017-03-30 17:35:59 +08:00
John Dai 107dac4471 Bug 1309147 - Part 4: Add CEReactions for CustomElementRegistry. r=bz
MozReview-Commit-ID: ID2TIL9C47R
2017-03-30 18:58:48 +08:00
Edgar Chen a75c6085d3 Bug 1351979 - Change CustomElementRegistry::Define code to properly propagate out JS exceptions; r=wchen 2017-03-30 11:44:09 +08:00
John Dai 786ba84ced Bug 1347446 - Move custom element reactions stack to DocGroup. r=wchen 2017-03-21 00:42:00 -04:00
Edgar Chen 1cea6cca52 Bug 1341693 - Don't need to check GetDocShell() when creating CustomElementRegistry; r=wchen
MozReview-Commit-ID: 7k3MQBEMpnV
2017-02-23 18:24:05 +08:00
Ehsan Akhgari 7965288852 Bug 1341898 - Make nsDocument::IsWebComponentsEnabled use a cached bool pref; r=baku 2017-02-23 13:25:21 -05:00
Carsten "Tomcat" Book bb42ee701b Merge mozilla-central to autoland 2017-01-19 17:00:25 +01:00
Kris Maglione db3d847dec Bug 1273251: Part 3 - Allow CallbackObject to contain a null callable. r=peterv
MozReview-Commit-ID: FCXVHouhG3I
2016-11-14 21:25:37 -08:00
Andi-Bogdan Postelnicu 234df5a77b Bug 1332233 - prevent resource leak in CustomElementRegistry::Define. r=baku
MozReview-Commit-ID: AzXgls3lKCA
2017-01-19 14:31:33 +02:00
John Dai e8dc9f825d Bug 1309184 - Implement upgrade reaction for custom element reactions. r=wchen 2017-01-05 18:38:00 -05:00
Olli Pettay 3898f7d882 Bug 1326507, remove NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS, r=mccr8 2017-01-03 21:47:55 +02:00
Edgar Chen f573936589 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
Edgar Chen 4ba285ef83 Bug 1274159 - Part 1: Support looking up definitions by using constructor as a key; r=wchen,jonco
MozReview-Commit-ID: Bj5fNNETT3w
2016-09-07 17:55:21 +08:00
Edgar Chen 513d9e2f6e Bug 1318630 - Part 1: Fix missing control pref checks for custom element feature; r=wchen
MozReview-Commit-ID: F9EJMk0kVEA
2016-12-08 09:22:46 -10:00
Sebastian Hengst 9d88e0d519 Backed out changeset 33c69deecb7a (bug 1274159) for frequently failing test_custom_element_htmlconstructor.html on Android 4.3 debug. r=backout 2016-12-14 13:28:03 +01:00
Sebastian Hengst 7a7aca4272 Backed out changeset f2a5fc3e8c4e (bug 1274159) 2016-12-14 13:27:22 +01:00
Edgar Chen b22063fb71 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
Edgar Chen 7cf36a3ecc Bug 1274159 - Part 1: Support looking up definitions by using constructor as a key; r=wchen,jonco
MozReview-Commit-ID: Bj5fNNETT3w
2016-09-07 17:55:21 +08:00
John Dai 3aaae2af88 Bug 1309140 - Rename CustomElementsRegistry to CustomElementRegistry. r=wchen, r=smaug
MozReview-Commit-ID: 3gYTaRVcV0y
2016-10-12 15:26:02 +08:00