Bug 109897 - Add setValue and closePopup methods to PagePopupController
Summary: Add setValue and closePopup methods to PagePopupController
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keishi Hattori
URL:
Keywords:
Depends on:
Blocks: 109439
  Show dependency treegraph
 
Reported: 2013-02-14 23:23 PST by Keishi Hattori
Modified: 2013-02-15 05:38 PST (History)
2 users (show)

See Also:


Attachments
Patch (17.62 KB, patch)
2013-02-14 23:37 PST, Keishi Hattori
no flags Details | Formatted Diff | Diff
changed protector position (17.51 KB, patch)
2013-02-15 03:50 PST, Keishi Hattori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keishi Hattori 2013-02-14 23:23:44 PST
In the new calendar picker, we want to set a value without closing the popup.
Comment 1 Keishi Hattori 2013-02-14 23:37:44 PST
Created attachment 188490 [details]
Patch
Comment 2 Kent Tamura 2013-02-14 23:57:42 PST
Comment on attachment 188490 [details]
Patch

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

> Source/WebKit/chromium/src/DateTimeChooserImpl.cpp:173
> -    RefPtr<DateTimeChooserImpl> protector(this);
>      if (numValue >= 0)
> -        m_client->didChooseValue(stringValue);
> +        setValue(stringValue);
> +    endChooser();
> +}

The protector is required here.  setValue(), which might dispatch some events, can delete 'this'.

> Source/WebKit/chromium/src/DateTimeChooserImpl.cpp:178
> +    RefPtr<DateTimeChooserImpl> protector(this);
> +    m_client->didChooseValue(value);

The protector makes no sense. We do nothing after didChooseValue, which might dispatch some events.
Also, I'm afraid that we have no ways to avoid calendar picker JavaScript code execution after didChooseValue because event handler might delete the page popup.
Comment 3 Keishi Hattori 2013-02-15 03:50:01 PST
Created attachment 188529 [details]
changed protector position
Comment 4 Kent Tamura 2013-02-15 04:56:14 PST
Comment on attachment 188529 [details]
changed protector position

ok
Comment 5 WebKit Review Bot 2013-02-15 05:38:32 PST
Comment on attachment 188529 [details]
changed protector position

Clearing flags on attachment: 188529

Committed r142987: <http://trac.webkit.org/changeset/142987>
Comment 6 WebKit Review Bot 2013-02-15 05:38:35 PST
All reviewed patches have been landed.  Closing bug.