Bug 228577 - Make it possible to cancel an EventLoopTask and use in HTMLDetailsElement
Summary: Make it possible to cancel an EventLoopTask and use in HTMLDetailsElement
Status: RESOLVED LATER
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks: 202843
  Show dependency treegraph
 
Reported: 2021-07-28 22:02 PDT by Ryosuke Niwa
Modified: 2022-01-19 21:21 PST (History)
9 users (show)

See Also:


Attachments
Patch (12.14 KB, patch)
2021-07-28 22:18 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch (12.22 KB, patch)
2021-07-28 22:52 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch (12.42 KB, patch)
2021-07-29 02:04 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch (12.42 KB, patch)
2021-07-29 03:15 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2021-07-28 22:02:57 PDT
Add an identifier for each task so that we can use it to cancel the task later.
Migrate HTMLDetailsElement's toggle event to the event loop using that.
Comment 1 Ryosuke Niwa 2021-07-28 22:18:44 PDT
Created attachment 434494 [details]
Patch
Comment 2 Ryosuke Niwa 2021-07-28 22:52:55 PDT
Created attachment 434496 [details]
Patch
Comment 3 Ryosuke Niwa 2021-07-29 02:04:12 PDT
Created attachment 434504 [details]
Patch
Comment 4 Ryosuke Niwa 2021-07-29 03:15:02 PDT
Created attachment 434509 [details]
Patch
Comment 5 Simon Fraser (smfr) 2021-07-29 09:47:25 PDT
Comment on attachment 434509 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434509&action=review

> Source/WebCore/dom/EventLoop.h:76
> +    enum class TaskIdentifier : uint64_t { Invalid = 0 };

Is there a reason not to use ObjectIdentifier<> ?
Comment 6 Ryosuke Niwa 2021-07-29 14:49:56 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Comment on attachment 434509 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434509&action=review
> 
> > Source/WebCore/dom/EventLoop.h:76
> > +    enum class TaskIdentifier : uint64_t { Invalid = 0 };
> 
> Is there a reason not to use ObjectIdentifier<> ?

ObjectIdentifier will increase the size of EventLoopTask by 8 bytes. I'm avoiding that by using the combination of the pointer value & 16-bit salting.
Comment 7 Radar WebKit Bug Importer 2021-08-04 22:03:18 PDT
<rdar://problem/81549670>
Comment 8 Tim Nguyen (:ntim) 2022-01-19 05:19:52 PST
Does bug 228863 somewhat solve this?
Comment 9 Ryosuke Niwa 2022-01-19 21:21:06 PST
(In reply to Tim Nguyen (:ntim) from comment #8)
> Does bug 228863 somewhat solve this?

It doesn't since the main point of this patch is to add the ability to cancel a task in the event loop but Chris sort of fixed that by adding CancelableTask in https://trac.webkit.org/r278543.

Let's defer this to later.