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

114 Коммитов

Автор SHA1 Сообщение Дата
Timothy Guan-tin Chien dc0ecec7d0 Bug 1462703 - Set returned CustomElementDefinition again after script runner is set r=smaug
This would help in the case where it is safe to run script in-place and
the CustomElementDefinition is available before the function exits.

This fixes the tests changed.

MozReview-Commit-ID: Ays91W94WZm

--HG--
extra : rebase_source : 6b0f1f90de9a6bfd7db577f1fb0e76564c3627e7
extra : source : 47c62a1e2f268e1be24c3fddfc006c3ad45ba4ac
2018-05-22 07:30:07 +08:00
Timothy Guan-tin Chien e84b173ee2 Bug 1462806 - Extract is value from nsXMLContentSink r=smaug
Nodes copied from DOMParser document fragment would need to be
created with the proper custom element data.

CustomElementRegistry::IsCustomElementEnabled() is changed to allow
it to run in the test document.

MozReview-Commit-ID: 4GACDR8FIc7

--HG--
extra : rebase_source : 39da41dd1ca56bf62043418c503c526e2895254f
2018-05-20 10:23:46 +08:00
Margareta Eliza Balazs 0bb5e5ba36 Merge inbound to mozilla-central. a=merge 2018-05-19 12:39:28 +03:00
Boris Zbarsky a02a40bdb5 Bug 1462737. Make AsElement() not compile when called on Element or some subclass. r=mccr8
It's just noise if we already have an Element.
2018-05-18 23:37:56 -04:00
Boris Zbarsky 395d320fce Bug 1461711 part 4. Stop unwrapping the custom element prototype when getting the lifecycle callbacsk. r=smaug
There is no reason to do that, apart from allowing Xrays to shoot themselves in the foot....
2018-05-18 16:18:19 -04:00
Boris Zbarsky 4fe32cc96b Bug 1461711 part 3. Fix potential leak of LifecycleCallbacks in CustomElementRegistry::Define. r=smaug 2018-05-18 16:18:19 -04:00
Boris Zbarsky d37ee8aa88 Bug 1461711 part 2. Remove some unnecessary Realm machinery in CustomElementRegistry::Define. r=smaug
1) The passed-in constructor is already same-compartment with the passed-in
   aCx, so there is no need to enter its Realm to work with it.

2) aCx is already in the compartment of constructorProtoUnwrapped when we do
   JS_WrapValue on rootedv, which is initialized to constructorProtoUnwrapped.
   That JS_WrapValue call is not needed.
2018-05-18 16:18:19 -04:00
Boris Zbarsky 9f24750878 Bug 1461711 part 1. Change CustomElementRegistry::Define to just take a JSContext from the caller instead of setting up an AutoJSAPI itself. r=smaug
This more closely matches what should happen with entry/incumbent globals in
the spec.
2018-05-18 16:18:19 -04:00
Boris Zbarsky 2b7be9c25a Bug 1462453. Remove the useless, and incorrect, CheckLifeCycleCallbacks function. r=smaug
This check is already done by the dictionary init method.  This function just
makes us do extra non-spec get operations.

For now this introduces more failures due to bug 1419323 and the spec issue at
<https://github.com/whatwg/html/issues/3580>.  The tests testing for that stuff
were passing due to exceptions getting thrown from CheckLifeCycleCallbacks.
2018-05-18 16:18:19 -04:00
Timothy Guan-tin Chien 08741f30ed Bug 1460962 - Support customized built-in element in XUL r=smaug
This patch enables us to specify a custom element type with |is| attribute
or property when creating a XUL element. Because non-dashed names are valid
custom element names in XUL (bug 1446247), other checks has to modified
accordingly.

The checks I am settling with are
1) Forbids the custom built-in element names to be a non-dashed name.
2) Forbids the custom built-in element to extend a dashed built-in element name.

This also ensures the custom built-in element types don't take on the same
name as the element name it extends.

MozReview-Commit-ID: GCQ9RnfvvrC

--HG--
extra : rebase_source : 2fa13742525d2107580d50872ff5b0fc42539498
extra : source : 2dc5513660d78a4de4801109140743ffc9297f71
2018-05-11 12:44:46 -07:00
Timothy Guan-tin Chien c01a7646b9 Bug 1460815 - Provide a chrome-only callback on CustomElementRegistry so script can define CE lazily r=smaug
This patch creates a chrome-only method
customElements.setElementCreationCallback() so that custom elements migrated
from XBL bindings doesn't have to be define()'d on document loading. With this
method, we will set callbacks and the platform will get back to us when it
encounters a matched custom element type -- and the callback will load the
relevant script.

It's important to note that the callback runs after construction of the first
element; it will be upgraded when it's being appended.

MozReview-Commit-ID: 80z72zwXRlf

--HG--
extra : rebase_source : 826188e56bb0b167d1e5bafb7d2a487a32bd9dfa
2018-05-11 11:23:31 -07:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Olli Pettay a7be7cff43 Bug 1460334 - Fix crash caused when attempting to migrate <deck> from a XBL binding to a Custom Element. r=peterv
--HG--
extra : amend_source : 461d41fa51087ce1cefc72df61a00e9cae5605e5
2018-05-10 14:08:00 -04:00
Olli Pettay a055a5fc0d Bug 1444285, let custom element upgrades to use backup queue inside chrome/XBL, r=mrbkap
--HG--
extra : rebase_source : 73d484bf9cae0168c4a1dc478ad8d1ccd5eed93f
2018-04-27 02:08:27 +03:00
Brian Grinstead 6cb530800d Bug 1446247 - Pass namespace into IsCustomElementName to allow for non-dashed XUL elements;r=e7358d9c+590837,smaug
This will make it possible to migrate existing bindings without also needing to
mass-rewrite frontend code at the same time.

MozReview-Commit-ID: IBBqC4eeDDX

--HG--
extra : rebase_source : e901ac665208b3a683668c1bb33a26dcf479580c
2018-03-29 09:34:56 -07:00
Olli Pettay f2340aa57f Bug 1452386 - Add a helper to get the existing nsIWeakReference from nsINode, r=emilio 2018-04-07 20:41:03 +03:00
Olli Pettay 0f16188dd5 Bug 1452074 - improve the performance related to unresolved custom elements, r=emilio 2018-04-07 12:50:01 +03:00
Andreea Pavel 9f9457503a Backed out changeset e220521c6ff6 (bug 1446247) on request a=backout r=smaug 2018-04-06 13:23:59 +03:00
Brian Grinstead 81b95b0b38 Bug 1451340 - Don't attempt to RegisterUnresolvedElement for native anonymous content;r=smaug
The webconsole UI generates a large number of scrollbars, and considering their children as
potential Custom Elements causes a slowdown when setting innerHTML="" when devtools closes.

MozReview-Commit-ID: 2QCcXCnTHA2

--HG--
extra : rebase_source : 5226e5689195a047ebcb9903b4565df13b6b1aa0
2018-04-05 12:01:18 -07:00
Brian Grinstead a5543400b1 Bug 1446247 - Pass namespace into IsCustomElementName to allow for non-dashed XUL elements;r=e7358d9c+590837,smaug
This will make it possible to migrate existing bindings without also needing to
mass-rewrite frontend code at the same time.

MozReview-Commit-ID: IBBqC4eeDDX

--HG--
extra : rebase_source : e901ac665208b3a683668c1bb33a26dcf479580c
2018-03-29 09:34:56 -07:00
Dave Townsend c70f34995e Bug 1421070: Always enable custom elements in chrome. r=smaug, rs=MattN
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : 735688061116c633b816f4f9d488712408df11a5
extra : source : 794ee6857d83dfe0b18629c12e96a622fc899586
2017-10-20 11:02:33 -07:00
Margareta Eliza Balazs 190225b29c Backed out changeset 794ee6857d83 (bug 1421070) for 15 failures in toolkit/components/payments/test/mochitest/test_ObservedPropertiesMixin.html on a CLOSED TREE
--HG--
extra : amend_source : 0574ce1b5b6a6e8735245684eb8e9ec7b0ac2647
2018-03-23 03:42:25 +02:00
Dave Townsend 2626e1c261 Bug 1421070: Always enable custom elements in chrome. r=smaug
This allows custom elements to work in any document in the parent process that
allows XUL and XBL. The test takes the easy option of moving the existing XUL
custom element test to a run with the custom element pref disabled.

MozReview-Commit-ID: CMiLzmp60jA

--HG--
extra : rebase_source : b9632de82cf79c1df15be09fadf1d25817c8a894
extra : amend_source : 235a76453d1d6782903d5051ee8e234b965dcc36
2017-10-20 11:02:33 -07:00
Blake Kaplan b12e3317aa bug 1326028 - Upgrade elements in the right order. r=smaug
MozReview-Commit-ID: 4u5PipUqN0j

--HG--
extra : rebase_source : d51e63783c156b2ecebbaed98d530a83bcb3f6b8
2018-02-21 16:43:09 -08:00
Andreea Pavel 9b1570bb80 Backed out 3 changesets (bug 1326028) for wpt bustage in custom-elements/CustomElementRegistry.html on a CLOSED TREE
Backed out changeset 38057b774238 (bug 1326028)
Backed out changeset ab4ee52d5a81 (bug 1326028)
Backed out changeset 414efc66b026 (bug 1326028)
2018-03-07 08:07:28 +02:00
Blake Kaplan 3b005f58b3 bug 1326028 - Upgrade elements in the right order. r=smaug
MozReview-Commit-ID: 4u5PipUqN0j

--HG--
extra : rebase_source : 9aa33ff7dddc16ed153ff4673d05fd74bdef9ac6
2018-02-21 16:43:09 -08:00
Olli Pettay 2439836b37 Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Boris Zbarsky e278d7fdb7 Bug 1438326. Don't try to enqueue custom element callbacks when the custom element definition has been unlinked. r=smaug
MozReview-Commit-ID: FLf6CJcpcVQ
2018-03-01 12:32:32 -05:00
Csoregi Natalia 1fd0486e23 Backed out 7 changesets (bug 1193394) for browser-chrome failures on browser_ext_popup_background.js. CLOSED TREE
Backed out changeset 9683f24ff8ec (bug 1193394)
Backed out changeset 0e7140a7c841 (bug 1193394)
Backed out changeset a0e26f6b2784 (bug 1193394)
Backed out changeset 29e1fceaf48d (bug 1193394)
Backed out changeset b8632bbbd273 (bug 1193394)
Backed out changeset a54ef2d8f896 (bug 1193394)
Backed out changeset 55c94c05c57f (bug 1193394)
2018-03-01 16:29:02 +02:00
Olli Pettay b7726493fb Bug 1193394 - Part 1: Microtasks and promises scheduling. r=bevis 2017-11-17 11:01:27 +08:00
Edgar Chen 084a83413d Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition; r=smaug
Since we are dealing with the element (nodeInfo->LocalName() and NameAtom() are the same value),
we could use nodeInfo->NameAtom() instead.

MozReview-Commit-ID: 4vIBDEM1Nwv

--HG--
extra : rebase_source : 150d5ea982363eb2ef4c5039fae67be1e08884ba
2018-01-17 14:55:13 +08:00
Boris Zbarsky 478687c2e8 Bug 1434686 part 4. Use IgnoreErrors() in dom/. r=mystor
MozReview-Commit-ID: GwVDrTLPTOb
2018-02-01 14:21:14 -05:00
Edgar Chen 4281f3eea3 Bug 1430034 - Fix attributeChangedCallback isn't fired with correct newValue when the attribute value is an empty string; r=smaug
MozReview-Commit-ID: L3RvNPNDfUC

--HG--
extra : rebase_source : dbe1d825beaec044ebb91d00a45b6feececfc46b
2018-01-15 15:24:41 +08:00
Edgar Chen fd3cbab671 Bug 1417829 - Remove unresolved pseudoclass; r=heycam,smaug
MozReview-Commit-ID: JHfYVnh1SET

--HG--
extra : rebase_source : 287a967f4f354999ab8af93eb696e81727289b12
2017-12-04 17:49:41 +08:00
Csoregi Natalia ce986a196a Backed out changeset 760107333833 (bug 1420178) for assertion failure at dom/base/CustomElementRegistry.cpp:1065 in browser-chrome on Windows. r=backout on a CLOSED TREE 2018-01-10 11:27:26 +02:00
Edgar Chen 4a910281dc Bug 1420178 - Add assertion to ensure the custom element reactions aren't scheduled to BackupQueue if they are from author code; r=smaug
MozReview-Commit-ID: BSna1j1NBSX

--HG--
extra : rebase_source : 0a76832477429c146ade2c597a2e13f83835bc2a
2017-12-05 17:56:57 +08:00
Edgar Chen 5fedbb92b8 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]; r=smaug
MozReview-Commit-ID: HgbFo9ddr0o

--HG--
extra : rebase_source : 04989782fc7c7ce79e0e65b3dc907c9e174a0809
2017-11-27 16:10:27 +08:00
Edgar Chen 158a96884b Bug 1421544 - Lazy push/pop CustomElementReactionsStack entry; r=smaug
MozReview-Commit-ID: CeSNbp8uCp

--HG--
extra : rebase_source : be2941d8cad82d2a0230ee0217fba41277fa0b48
2017-11-28 16:58:50 +08:00
Edgar Chen 0c779a0480 Bug 1421170 - Move the declarations of CustomElementUpgradeReaction and CustomElementCallbackReaction to CustomElementRegistry.cpp; r=smaug
The CustomElementUpgradeReaction and CustomElementCallbackReaction are only used inside CustomElementRegistry.cpp,
so we don't need to expose them in header file.

MozReview-Commit-ID: 9lYwHeFIODi

--HG--
extra : rebase_source : 099821b680b171b0c354c34ebd91ba5963536dc1
2017-11-28 14:52:32 +08:00
Edgar Chen 3a109e4f15 Bug 1416999 - Remove the custom elements prototype and document order stored in CustomElementDefinition; r=smaug
They are used for old spec, and we don't need them after removing document.registerElement

MozReview-Commit-ID: EqzB1PJJtrg

--HG--
extra : rebase_source : 5eaa1343bc749d172eb782e063d74099f856f9da
2017-11-29 10:51:54 +08:00
Edgar Chen 9f4324f41e Bug 1416999 - Remove document.registerElement; r=smaug
MozReview-Commit-ID: HiX07Vbljhk

--HG--
rename : dom/base/test/chrome/registerElement_ep.js => dom/base/test/chrome/custom_element_ep.js
rename : dom/base/test/chrome/frame_registerElement_content.html => dom/base/test/chrome/frame_custom_element_content.html
rename : dom/base/test/chrome/test_registerElement_content.xul => dom/base/test/chrome/test_custom_element_content.xul
rename : dom/base/test/chrome/test_registerElement_ep.xul => dom/base/test/chrome/test_custom_element_ep.xul
rename : dom/base/test/test_document_register.html => dom/base/test/test_custom_element.html
rename : dom/tests/mochitest/webcomponents/test_document_register.html => dom/tests/mochitest/webcomponents/test_custom_element_define.html
rename : dom/tests/mochitest/webcomponents/test_document_register_parser.html => dom/tests/mochitest/webcomponents/test_custom_element_define_parser.html
rename : dom/tests/mochitest/webcomponents/test_template_custom_elements.html => dom/tests/mochitest/webcomponents/test_custom_element_template.html
extra : rebase_source : cd2ebf166e8bd9c49910387c9136d7b83b51598d
2017-11-16 12:23:15 +08:00
Dave Townsend 27380b996e Bug 1404420: Add custom element support to XUL. r=edgar, r=smaug
MozReview-Commit-ID: BietEX2gOoG

--HG--
extra : rebase_source : 6fd9a732a21f2c048d37c3f7139cd18503148767
2017-10-10 15:25:10 -07:00
John Dai 05cb887de2 Bug 1407669 - Fix custom element creation hides uncatchable exceptions from the constructor. f=echen, r=bz
--HG--
extra : rebase_source : 6d871d6b4c959e0e9fbc34bd8d14d45678badd35
2017-11-21 20:46:00 -05:00
Edgar Chen e8e6e85590 Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked; r=smaug
MozReview-Commit-ID: BAoBGoYtiJr

--HG--
extra : rebase_source : 5df57004ec6756cbf584180efa95d5bde049b234
2017-11-03 17:57:46 +08:00
Edgar Chen 7cfc82e138 Bug 1419305 - Part 1: Use MicroTask on CustomElements correctly; r=smaug
MozReview-Commit-ID: EPMfr6hr5fS

--HG--
extra : rebase_source : 51784f7d8b74978847901f57f23730fb0f547ce5
2017-11-03 17:38:46 +08:00
Nika Layzell f1ac9bf744 Bug 1419597 - Part 18: Remove IsInnerWindow and IsOuterWindow methods, r=smaug
MozReview-Commit-ID: DAAm6tLubhJ
2017-11-23 13:12:13 -05:00
Edgar Chen 698fdbc62e Bug 1396620 - Part 1: Remove created callback for custom elements; r=jdai,smaug
MozReview-Commit-ID: IDovq3OZwgy

--HG--
extra : rebase_source : bae891833d4f8139fed2ed31af85173694c7eb11
2017-10-13 23:36:54 +08:00
John Dai a710f595fa Bug 1406325 - Part 5: Implement try to upgrade. f=echen, r=smaug 2017-11-14 19:25:00 +08:00
John Dai d1400ac8b1 Bug 1406325 - Part 4: Use mType for LookupCustomElementDefinition and also removing parts of v0. f=echen, r=smaug 2017-11-14 19:23:00 +08:00
Edgar Chen 91920b5742 Bug 1413815 - Convert 'observedAttributes' to a sequence<DOMString>; r=bz
MozReview-Commit-ID: 1AYK5RF5GNc

--HG--
extra : rebase_source : ec8bb2091f9163dc11a6cd52c0201f2007bc795f
2017-11-03 10:50:05 +08:00