Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (252960@main, WPT resync): [ macOS Debug ] imported/w3c/we…
…b-platform-tests/html/semantics/document-metadata/the-style-element/style-load-after-mutate.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=244014 rdar://98757197 Reviewed by Ryosuke Niwa. The test in question starts out with an empty <style> and then adds an @import to it. However, the URL of the @import points to a missing resource. As a result, we first schedule the dispatch of a load event, then an error event. The test makes sure that a load event is fired and times out if none gets fired. The issue was that HTMLStyleElement was using the same EventSender for the load and error events. However, EventSender was storing senders in its queue, not events. The state about whether to send a load or an error event was stored on the HTMLStyleElement instance instead. This meant that we could schedule a load event and then an error event right after one another. The request to send an error event would override the state on the HTMLStyleElement and we would end up sending 2 error events, instead of a load event followed by an error event. To address the issue, I updated EventSender to store the event type in its queue, in addition to the sender. We would have used two separate EventSenders like HTMLLinkElement was doing. However, I worry that ordering between load and error events may be incorrect if we use separate queues. * LayoutTests/platform/mac/TestExpectations: * Source/WebCore/dom/Document.cpp: (WebCore::Document::implicitClose): * Source/WebCore/dom/EventSender.h: (WebCore::EventSender::hasPendingEvents const): (WebCore::Counter>::EventSender): (WebCore::Counter>::dispatchEventSoon): (WebCore::Counter>::cancelEvent): (WebCore::Counter>::dispatchPendingEvents): (WebCore::EventSender::eventType const): Deleted. * Source/WebCore/html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::didAttachRenderers): * Source/WebCore/html/HTMLLinkElement.cpp: (WebCore::linkLoadEventSender): (WebCore::HTMLLinkElement::~HTMLLinkElement): (WebCore::HTMLLinkElement::linkLoaded): (WebCore::HTMLLinkElement::linkLoadingErrored): (WebCore::HTMLLinkElement::dispatchPendingEvent): (WebCore::HTMLLinkElement::notifyLoadedSheetAndAllCriticalSubresources): (WebCore::linkErrorEventSender): Deleted. * Source/WebCore/html/HTMLLinkElement.h: * Source/WebCore/html/HTMLStyleElement.cpp: (WebCore::styleLoadEventSender): (WebCore::HTMLStyleElement::dispatchPendingEvent): (WebCore::HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources): * Source/WebCore/html/HTMLStyleElement.h: * Source/WebCore/html/ImageInputType.cpp: (WebCore::ImageInputType::attach): * Source/WebCore/loader/ImageLoader.cpp: (WebCore::loadEventSender): (WebCore::ImageLoader::ImageLoader): (WebCore::ImageLoader::~ImageLoader): (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent): (WebCore::ImageLoader::updateFromElement): (WebCore::ImageLoader::didUpdateCachedImage): (WebCore::ImageLoader::notifyFinished): (WebCore::ImageLoader::dispatchPendingEvent): (WebCore::ImageLoader::dispatchPendingErrorEvent): (WebCore::beforeLoadEventSender): Deleted. (WebCore::errorEventSender): Deleted. (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent): Deleted. (WebCore::ImageLoader::dispatchPendingBeforeLoadEvents): Deleted. (WebCore::ImageLoader::dispatchPendingErrorEvents): Deleted. * Source/WebCore/loader/ImageLoader.h: (WebCore::ImageLoader::hasPendingBeforeLoadEvent const): Deleted. * Source/WebCore/svg/animation/SVGSMILElement.cpp: (WebCore::smilEventSender): (WebCore::SVGSMILElement::~SVGSMILElement): (WebCore::SVGSMILElement::progress): (WebCore::SVGSMILElement::dispatchPendingEvent): (WebCore::smilBeginEventSender): Deleted. (WebCore::smilEndEventSender): Deleted. * Source/WebCore/svg/animation/SVGSMILElement.h: * Source/WebCore/xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::append): Canonical link: https://commits.webkit.org/256535@main
- Loading branch information
Showing
12 changed files
with
88 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.