Bug 227493 - Support <dialog> element close event
Summary: Support <dialog> element close event
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Nguyen (:ntim)
URL:
Keywords: InRadar
Depends on:
Blocks: dialog-element 227915
  Show dependency treegraph
 
Reported: 2021-06-29 10:54 PDT by Tim Nguyen (:ntim)
Modified: 2021-07-13 12:50 PDT (History)
12 users (show)

See Also:


Attachments
Patch (61.96 KB, patch)
2021-06-30 01:39 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff
Patch (76.98 KB, patch)
2021-06-30 02:32 PDT, Tim Nguyen (:ntim)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Radar WebKit Bug Importer 2021-06-29 23:55:16 PDT
<rdar://problem/79952910>
Comment 2 Tim Nguyen (:ntim) 2021-06-30 01:39:02 PDT
Created attachment 432575 [details]
Patch
Comment 3 Antti Koivisto 2021-06-30 01:56:49 PDT
Comment on attachment 432575 [details]
Patch

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

> Source/WebCore/html/HTMLDialogElement.h:28
> +#include "EventSender.h"

You can forward declare EventSender with

template<typename T> class EventSender;

so you don't need this include in the header (slightly reducing header bloat and so improving compile times). See the other EventSenders.

> Source/WebCore/html/HTMLDialogElement.h:33
> +typedef EventSender<HTMLDialogElement> DialogEventSender;

Modern replacement for typedef is using:

using DialogEventSender = EventSender<HTMLDialogElement>;

I find it more readable.

> Source/WebCore/html/HTMLDialogElement.h:57
> -    void toggleOpen();
> +    void toggleOpen(bool newValue);

This should be renamed to setOpen since it is now a setter rather than a toggle.
No need for parameter name, it is obvious from context.
Comment 4 Tim Nguyen (:ntim) 2021-06-30 02:32:31 PDT
Created attachment 432578 [details]
Patch
Comment 5 EWS 2021-06-30 03:18:34 PDT
Committed r279406 (239271@main): <https://commits.webkit.org/239271@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 432578 [details].
Comment 6 Darin Adler 2021-07-01 14:02:42 PDT
Comment on attachment 432575 [details]
Patch

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

>> Source/WebCore/html/HTMLDialogElement.h:28
>> +#include "EventSender.h"
> 
> You can forward declare EventSender with
> 
> template<typename T> class EventSender;
> 
> so you don't need this include in the header (slightly reducing header bloat and so improving compile times). See the other EventSenders.

In fact, can do this:

    template<typename> class EventSender;