Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
AsyncEventDispatcher(dom::EventTarget* aTarget, dom::Event* aEvent) just stores
aEvent with RefPtr. So, this constructor assumes that aEvent->mEvent is always
allocated by dom::Event or its subclasses. For avoiding some callers use
dom::Event instances which are created with Widget*Event or Internal*Event
in the stack and its DuplicatePrivateData() has never been called, this patch
add MOZ_ASSERT to check if aEvent->mEventIsInternal is true.
MozReview-Commit-ID: FrmUK2pVasu
--HG--
extra : rebase_source : d9918e171add3cd2e7eceff7b7283754f90ff4f9
Summary:
document.addEventListener("shadowrootattached", e => {
// Do stuff with composedTarget.
});
I didn't bother to add tests for the event itself since this is going to get
tested in bug 1449333, but I can look into writing a chrome mochitest if you
want.
Test Plan: See above.
Reviewers: smaug
Bug #: 1470545
Differential Revision: https://phabricator.services.mozilla.com/D1777
MozReview-Commit-ID: 55cVMSsznMS
When we send out a prefetch request, we act as if the load came
from one of the possibly many documents containing <link> element
for the given URL. The docgroup assigned to this request is
derived from this document. Later, when the load finishes, the
OnStopRequest code runs in a runnable labeled with this
docgroup. OnStopRequest dispatches a load event to *all* the link
elements, including some that might be in different docgroups
from the OnStopRequest runnable. This generates an assertion.
To fix this, I decided to dispatch the load events
asynchronously. I'm hoping the extra round trip through the event
loop shouldn't hurt us too much since I doubt anyone actually
listens for these events.
MozReview-Commit-ID: FTkjuHO7RFp
When we send out a prefetch request, we act as if the load came
from one of the possibly many documents containing <link> element
for the given URL. The docgroup assigned to this request is
derived from this document. Later, when the load finishes, the
OnStopRequest code runs in a runnable labeled with this
docgroup. OnStopRequest dispatches a load event to *all* the link
elements, including some that might be in different docgroups
from the OnStopRequest runnable. This generates an assertion.
To fix this, I decided to dispatch the load events
asynchronously. I'm hoping the extra round trip through the event
loop shouldn't hurt us too much since I doubt anyone actually
listens for these events.
MozReview-Commit-ID: FTkjuHO7RFp
Also I found that mBubbles are not initialized in the constructor in
AsyncEventDispatcher.cpp. I initialized those bool member variables
directly.
MozReview-Commit-ID: FiU4NKGJjU9
--HG--
extra : rebase_source : 1bcd5808b442eb726763602525977bc064ecc0ee
This patch renames DispatchChromeOnly flag to OnlyChromeDispatch. With
this patch, if OnlyChromeDispatch flag is set, and the target is already
a chrome node, the dispatch path will start from the target. Previously,
even if the target is a chrome node, the dispatch path starts from the
parent target of the owner window of the current node.
--HG--
extra : source : b55e6ebbd1f1f043b8449711c1a3bba9a53a381c