forked from WebKit/WebKit
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate aborted state to dependent signals before firing events
https://bugs.webkit.org/show_bug.cgi?id=278159 Reviewed by NOBODY (OOPS!). The implementation and spec assert that dependent signals are aborted if any of their sources are aborted. However, the intermediate states do not reflect this during the abort process. Since we iterate through all the dependent signals, updating the state and then firing the event. An updated spec is about to land to address this by first propagating the abort state to any dependent signals, and only then run the abort steps (run algorithms and fire events). Worthy notes: - Dependent signals do not themselves have dependent signals, which means it's unnecessary to call "signal abort recursively". - This approach retains the existing event dispatch order while ensuring the abort state is synced before any JS runs. DOM spec PR: whatwg/dom#1295 * LayoutTests/imported/w3c/web-platform-tests/dom/abort/abort-signal-any.any-expected.txt: Rebaselined. * LayoutTests/imported/w3c/web-platform-tests/dom/abort/abort-signal-any.any.worker-expected.txt: Rebaselined. * LayoutTests/imported/w3c/web-platform-tests/dom/abort/resources/abort-signal-any-tests.js: Ported wpt tests from Chromium's PR addressing this same concern. The tests: - `Dependent signals for ${desc} are marked aborted before abort events fire ${suffix}` and - `Dependent signals for ${desc} are aborted correctly for reentrant aborts ${suffix}`. * Source/WebCore/dom/AbortSignal.cpp: (WebCore::AbortSignal::any): `check-webkit-style` did not like the `findIf` with `[whitespace/newline]`. (WebCore::AbortSignal::signalAbort): Collect the dependent signals to abort into a vector, then mark those as aborted, then run the signal's abort steps, and finally run the dependent signals' abort steps. (WebCore::AbortSignal::markAborted): Added this convenience method to set both the `reason` and then `m_aborted` state. (WebCore::AbortSignal::runAbortSteps): * Source/WebCore/dom/AbortSignal.h:
- Loading branch information
Showing
5 changed files
with
81 additions
and
8 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