Backed out changeset dfcc0494fe8d (bug 1839580) for causing wpt and mochitest failures CLOSED TREE

This commit is contained in:
Norisz Fay 2023-06-21 21:23:18 +03:00
Родитель 61c7f9dadd
Коммит 38a938a13c
4 изменённых файлов: 7 добавлений и 17 удалений

Просмотреть файл

@ -190,11 +190,6 @@ class LoadBlockingAsyncEventDispatcher final : public AsyncEventDispatcher {
}
}
// The static version of AsyncEventDispatcher::RunDOMEventWhenSafe should be
// preferred when possible, but for LoadBlockingAsyncEventDispatcher it makes
// sense to expose the helper so that the load event is blocked appropriately.
using AsyncEventDispatcher::RunDOMEventWhenSafe;
LoadBlockingAsyncEventDispatcher(nsINode* aEventNode, dom::Event* aEvent)
: AsyncEventDispatcher(aEventNode, aEvent),
mBlockedDoc(aEventNode->OwnerDoc()) {

Просмотреть файл

@ -431,11 +431,7 @@ void SheetLoadData::ScheduleLoadEventIfNeeded() {
auto* dispatcher = new LoadBlockingAsyncEventDispatcher(
node, mLoadFailed ? u"error"_ns : u"load"_ns, CanBubble::eNo,
ChromeOnlyDispatch::eNo);
if (mMustNotify) {
dispatcher->RunDOMEventWhenSafe();
} else {
dispatcher->PostDOMEvent();
}
dispatcher->PostDOMEvent();
}
nsINode* SheetLoadData::GetRequestingNode() const {
@ -1569,10 +1565,6 @@ void Loader::NotifyObservers(SheetLoadData& aData, nsresult aStatus) {
// StyleSheetLoaded callback.
if (aData.BlocksLoadEvent()) {
DecrementOngoingLoadCount();
if (mPendingLoadCount && mPendingLoadCount == mOngoingLoadCount) {
LOG((" No more loading sheets; starting deferred loads"));
StartDeferredLoads();
}
}
}
if (!aData.mTitle.IsEmpty() && NS_SUCCEEDED(aStatus)) {
@ -1602,7 +1594,10 @@ void Loader::NotifyObservers(SheetLoadData& aData, nsresult aStatus) {
}
}
aData.ScheduleLoadEventIfNeeded();
if (mPendingLoadCount && mPendingLoadCount == mOngoingLoadCount) {
LOG((" No more loading sheets; starting deferred loads"));
StartDeferredLoads();
}
}
/**

Просмотреть файл

@ -164,6 +164,7 @@ void SharedStyleSheetCache::LoadCompletedInternal(
doc->PostStyleSheetApplicableStateChangeEvent(*data->mSheet);
}
}
data->ScheduleLoadEventIfNeeded();
aDatasToNotify.AppendElement(data);
NS_ASSERTION(!data->mParentData || data->mParentData->mPendingChildren != 0,

Просмотреть файл

@ -159,8 +159,7 @@ class SheetLoadData final
// the original function call that started the load has returned.
// This applies only to observer notifications; load/error events
// are fired for any SheetLoadData that has a non-null
// mOwningNodeBeforeLoadEvent (though mMustNotify is used to avoid an event
// loop round-trip in that case).
// mOwningNodeBeforeLoadEvent.
bool mMustNotify : 1;
// mWasAlternate is true if the sheet was an alternate when the load data was