Commit Graph

230 Commits

Author SHA1 Message Date
Csoregi Natalia
7063ab1dad 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
234e37607e 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
2017-12-05 17:56:57 +08:00
Edgar Chen
d9444e4dd3 Bug 1422197 - Add fast path to get DocGroup in binding code for [CEReactions]; r=smaug
MozReview-Commit-ID: HgbFo9ddr0o
2017-11-27 16:10:27 +08:00
Edgar Chen
6b0ee050da Bug 1421544 - Lazy push/pop CustomElementReactionsStack entry; r=smaug
MozReview-Commit-ID: CeSNbp8uCp
2017-11-28 16:58:50 +08:00
Edgar Chen
dcc87696f8 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
2017-11-28 14:52:32 +08:00
Edgar Chen
d9b8564bdd 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
2017-11-29 10:51:54 +08:00
Edgar Chen
cb6d776928 Bug 1416999 - Remove document.registerElement; r=smaug
MozReview-Commit-ID: HiX07Vbljhk
2017-11-16 12:23:15 +08:00
Dave Townsend
7226ceda95 Bug 1404420: Add custom element support to XUL. r=edgar, r=smaug
MozReview-Commit-ID: BietEX2gOoG
2017-10-10 15:25:10 -07:00
John Dai
09c00c4907 Bug 1407669 - Fix custom element creation hides uncatchable exceptions from the constructor. f=echen, r=bz 2017-11-21 20:46:00 -05:00
Edgar Chen
02b2396f11 Bug 1419305 - Part 2: Keep processing remaining elements in ElementQueue even if some of elements are already unlinked; r=smaug
MozReview-Commit-ID: BAoBGoYtiJr
2017-11-03 17:57:46 +08:00
Edgar Chen
955c1e95b1 Bug 1419305 - Part 1: Use MicroTask on CustomElements correctly; r=smaug
MozReview-Commit-ID: EPMfr6hr5fS
2017-11-03 17:38:46 +08:00
Nika Layzell
20ee9a4927 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
a88956b4ad Bug 1396620 - Part 1: Remove created callback for custom elements; r=jdai,smaug
MozReview-Commit-ID: IDovq3OZwgy
2017-10-13 23:36:54 +08:00
John Dai
4833c9a8ec Bug 1406325 - Part 5: Implement try to upgrade. f=echen, r=smaug 2017-11-14 19:25:00 +08:00
John Dai
c0e69c86ed 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
e0b155207d Bug 1413815 - Convert 'observedAttributes' to a sequence<DOMString>; r=bz
MozReview-Commit-ID: 1AYK5RF5GNc
2017-11-03 10:50:05 +08:00
Jonathan Watt
24f1435d8e Bug 1413216 - Fix some missing includes in dom code. r=baku
MozReview-Commit-ID: 25hWPkXF0Wj
2017-10-12 13:50:23 +01:00
Sebastian Hengst
d057827756 merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-10-27 12:45:34 +03:00
Andrew McCreight
2c2e9cbbbe Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL
2017-10-26 15:08:41 -07:00
Edgar Chen
3d27cb86dc Bug 1410790 - Add more assertion in CustomElementData::SetCustomElementDefinition and GetCustomElementDefinition; r=smaug
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.

MozReview-Commit-ID: 2sLP53bAYVV
2017-10-13 11:54:46 +08:00
Jessica Jong
d74deb91b0 Bug 1378079 - Part 3: Complete the steps related to custom elements in "create an element for a token". r=hsivonen,smaug 2017-10-26 14:55:41 +08:00
Edgar Chen
de386de86f Bug 1352290 - Add assertion to CustomElementReactionsStack::Enqueue to ensure upgrade reactions aren't scheduled to BackupQueue; r=smaug 2017-10-17 17:55:08 +08:00
Steve Fink
cb2dda1273 Bug 1406570 - Rooting improvements, r=jonco,bz 2017-10-09 10:59:02 -07:00
Edgar Chen
b142e5383d Bug 1407937 - Move mDefinition from CustomElementReacion to CustomElementUpgradeReaction; f=jdai; r=smaug
MozReview-Commit-ID: 3JweEOgKAeo
2017-10-12 17:01:41 +08:00
John Dai
354d034de3 Bug 1406297 - Fix Document.createElement must report an exception. r=smaug 2017-10-12 04:25:00 -04:00
Edgar Chen
489086c92d Bug 1405335 - Remove custom element attached and detached callbacks validation checks; r=smaug 2017-10-03 22:00:04 +08:00
Nicholas Nethercote
7dbfdaf890 Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP
2017-10-03 09:05:19 +11:00
Olli Pettay
8032dc8d09 Bug 1405821 - Move microtask handling to CycleCollectedJSContext, r=baku 2017-10-05 18:34:12 +03:00
John Dai
60db6a6216 Bug 1121994 - Implement adopted callback for custom elements. r=smaug 2017-10-02 00:42:00 -04:00
Nicholas Nethercote
9fda5528d2 Bug 1400459 (part 2) - Devirtualize nsIAtom. r=heycam.
This patch merges nsAtom into nsIAtom. For the moment, both names can be used
interchangeably due to a typedef. The patch also devirtualizes nsIAtom, by
making it not inherit from nsISupports, removing NS_DECL_NSIATOM, and dropping
the use of NS_IMETHOD_. It also removes nsIAtom's IIDs.

These changes trigger knock-on changes throughout the codebase, changing the
types of lots of things as follows.

- nsCOMPtr<nsIAtom> --> RefPtr<nsIAtom>

- nsCOMArray<nsIAtom> --> nsTArray<RefPtr<nsIAtom>>
  - Count() --> Length()
  - ObjectAt() --> ElementAt()
  - AppendObject() --> AppendElement()
  - RemoveObjectAt() --> RemoveElementAt()

- ns*Hashtable<nsISupportsHashKey, ...> -->
  ns*Hashtable<nsRefPtrHashKey<nsIAtom>, ...>

- nsInterfaceHashtable<T, nsIAtom> --> nsRefPtrHashtable<T, nsIAtom>
  - This requires adding a Get() method to nsRefPtrHashtable that it lacks but
    nsInterfaceHashtable has.

- nsCOMPtr<nsIMutableArray> --> nsTArray<RefPtr<nsIAtom>>
  - nsArrayBase::Create() --> nsTArray()
  - GetLength() --> Length()
  - do_QueryElementAt() --> operator[]

The patch also has some changes to Rust code that manipulates nsIAtom.

MozReview-Commit-ID: DykOl8aEnUJ
2017-09-26 08:33:21 +10:00
Jessica Jong
4cc291e4f1 Bug 1334044: Replace detached callback (v0) with disconnected callback (v1). r=smaug
MozReview-Commit-ID: 8jxFK1fze15
2017-09-26 13:56:11 +08:00
Jessica Jong
01630916ea Bug 1334043 - Part 2: Make nsContentUtils::EnqueueLifecycleCallback static. r=smaug
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.

MozReview-Commit-ID: 7xUvK0q7Eri
2017-09-26 13:56:00 +08:00
Jessica Jong
a3771e10e6 Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1). r=smaug
MozReview-Commit-ID: 3qQh4viyvBX
2017-09-26 13:55:58 +08:00
Jessica Jong
cb73432f22 Bug 1392970 - Part 2: Get CustomElementDefinition from CustomElementData when possible. r=smaug
MozReview-Commit-ID: L6DCtGXBesX
2017-09-25 02:47:00 -04:00
Jessica Jong
f9802d797f Bug 1392970 - Part 1: Make CustomElementDefinition ref-counted and put it in CustomElementData. r=smaug
MozReview-Commit-ID: DIQN3JFxkT8
2017-09-25 02:46:00 -04:00
John Dai
3453622848 Bug 1301024 - Part 2: Implement create an element steps. r=smaug 2017-09-25 01:33:00 -04:00
Nicholas Nethercote
e8236888ee Bug 1401813 - Rename Null[C]String() as Void[C]String(). r=erahm.
XPCOM's string API doesn't have the notion of a "null string". But it does have
the notion of a "void string" (or "voided string"), and that's what these
functions are returning. So the names should reflect that.
2017-09-22 14:35:46 +10:00
Kris Maglione
1721ba5bed Bug 1369533: Return dead wrappers rather than null for dead CallbackObject values. r=bz
We don't have access to an appropriate context to create the dead wrapper in
when the callback is nuked, so instead, this patch creates a new dead wrapper
in the caller compartment each time the property is accessed. This is the same
behavior we'd get when trying to re-wrap a cross-compartment dead wrapper, so
it's consistent with the way we handle these situations elsewhere.

MozReview-Commit-ID: 3cMeR4z8EOe
2017-09-04 17:21:06 -07:00
Nicholas Nethercote
038eda3f17 Bug 1395828 (part 4) - Remove nsIParserService/nsParserService. r=mrbkap.
It a stateless wrapper around static methods in nsHTMLTags and nsHTMLElement,
and hence an unnecessary layer of indirection that just adds complexity and
slowness. This patch removes it, cutting almost 300 lines of code.

This requires making nsElementTable.h an exported header, to expose the
nsHTMLElement methods.
2017-09-05 20:19:06 +10:00
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