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
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.
--HG--
extra : rebase_source : 4e3f982e0873877174a08a25413595ff66f7d20e
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
--HG--
extra : rebase_source : 7e8cf4a195ef64deb7677ce4ac9818d342815667
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.
--HG--
extra : rebase_source : abbcb8e5001389affbf717092213b898673db07f
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
So that the old upgrade can also work with new upgrade steps
which will be implemented in part 5-2.
MozReview-Commit-ID: IRyvAPaN19R
--HG--
extra : rebase_source : 2385608f4857401a37f76070eadb643b1016dd15
extra : histedit_source : 4f33007ed262d001782399f6f70ced0c22f47d66
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
--HG--
extra : rebase_source : b5e5c6b45fa79143094f7a337386a4bb57b777be
extra : histedit_source : 70fec53d07b1f693f91db2c1870af3284a47729e
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
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
--HG--
extra : rebase_source : 5e2081e470473cd1a1f642a2dc693127cb9486ca