Bug 98589 - [EFL][WK2] Provide implementation for PageClientImpl::toolTipChanged()
Summary: [EFL][WK2] Provide implementation for PageClientImpl::toolTipChanged()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Jinwoo Song
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-06 00:30 PDT by Jinwoo Song
Modified: 2012-10-15 13:23 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.62 KB, patch)
2012-10-06 00:33 PDT, Jinwoo Song
no flags Details | Formatted Diff | Diff
Patch (4.69 KB, patch)
2012-10-14 23:38 PDT, Jinwoo Song
kenneth: review+
Details | Formatted Diff | Diff
patch for landing. (4.34 KB, patch)
2012-10-15 00:43 PDT, Jinwoo Song
no flags Details | Formatted Diff | Diff
patch (4.11 KB, patch)
2012-10-15 02:46 PDT, Jinwoo Song
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jinwoo Song 2012-10-06 00:30:02 PDT
Implement PageClientImple::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,
and if tooltip must be actually removed, text will be 0 or '\0'.
Comment 1 Jinwoo Song 2012-10-06 00:33:06 PDT
Created attachment 167446 [details]
Patch
Comment 2 Raphael Kubo da Costa (:rakuco) 2012-10-06 13:23:21 PDT
Comment on attachment 167446 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1080
> + * Emits signal: "tooltip,text,set" with a tooltip string. If tooltip must be actually removed, text will be 0 or '\0'.

Isn't it better to emit a different signal for tooltip removal?
Comment 3 Chris Dumez 2012-10-06 13:50:49 PDT
Comment on attachment 167446 [details]
Patch

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

The use for this seems pretty limited (inexistent?) on mobile devices, isn't it? I mean there is no mouseover so when would we show tooltips?

> Source/WebKit2/ChangeLog:8
> +        Implement PageClientImple::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,

"PageClientImpl"

Why do we emit a signal on the view? It seems to me like the view should be able to take care of drawing tooltips by itself...
Unless there is a good reason to delegate this to the browser, I would rather we keep as much functionality as possible in the view. Otherwise, it becomes painful to write a browser based on WebKit EFL.

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1078
> + * @param text Text to set tooltip.

"Tooltip text to set" ?

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:66
> + * - "tooltip,text,set", const char*: tooltip text is set.

"Requests the given tooltip text to be shown" ? I would also indicate here that NULL will be passed if the tooltip text should be removed.
Comment 4 Kenneth Rohde Christiansen 2012-10-06 22:39:40 PDT
Comment on attachment 167446 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1080
>> + * Emits signal: "tooltip,text,set" with a tooltip string. If tooltip must be actually removed, text will be 0 or '\0'.
> 
> Isn't it better to emit a different signal for tooltip removal?

So what about info that you get a temporary string and that it must be copied or so? We dont document such things?
Comment 5 Chris Dumez 2012-10-06 23:05:39 PDT
(In reply to comment #4)
> (From update of attachment 167446 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167446&action=review
> 
> >> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1080
> >> + * Emits signal: "tooltip,text,set" with a tooltip string. If tooltip must be actually removed, text will be 0 or '\0'.
> > 
> > Isn't it better to emit a different signal for tooltip removal?
> 
> So what about info that you get a temporary string and that it must be copied or so? We dont document such things?

I dont 't think this is an issue. The string will be available in the callback. If the app wants to keep the string after the callback is executed then its needs to strdup it. I think this is common practice.
Comment 6 Jinwoo Song 2012-10-12 07:47:59 PDT
(In reply to comment #2)
> (From update of attachment 167446 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167446&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1080
> > + * Emits signal: "tooltip,text,set" with a tooltip string. If tooltip must be actually removed, text will be 0 or '\0'.
> 
> Isn't it better to emit a different signal for tooltip removal?

From the application side, different signal may be preferable as they do not need to check the text. I'll change as your suggestion.
Comment 7 Jinwoo Song 2012-10-14 21:25:16 PDT
Comment on attachment 167446 [details]
Patch

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

>> Source/WebKit2/ChangeLog:8
>> +        Implement PageClientImple::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,
> 
> "PageClientImpl"
> 
> Why do we emit a signal on the view? It seems to me like the view should be able to take care of drawing tooltips by itself...
> Unless there is a good reason to delegate this to the browser, I would rather we keep as much functionality as possible in the view. Otherwise, it becomes painful to write a browser based on WebKit EFL.

In my thought, tooltip is a kind of UI element such as toolbar or status bar. Applications may want their own tooltip UX or even they do not want to show it.
Also, I think applications can easily draw the tooltip with elm_object_tooltip_set() so it is not too painful.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1078
>> + * @param text Text to set tooltip.
> 
> "Tooltip text to set" ?

I'll fix it.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.h:66
>> + * - "tooltip,text,set", const char*: tooltip text is set.
> 
> "Requests the given tooltip text to be shown" ? I would also indicate here that NULL will be passed if the tooltip text should be removed.

I'll add a "toolip,text,unset' signal for NULL case following Raphael's suggestion.
Comment 8 Jinwoo Song 2012-10-14 23:38:39 PDT
Created attachment 168632 [details]
Patch
Comment 9 Kenneth Rohde Christiansen 2012-10-14 23:46:25 PDT
Comment on attachment 168632 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1131
> + * Reports that the tooltip text was changed.
> + *
> + * Emits signal: "tooltip,text,set" with a tooltip text to set.
> + *               "tooltip,text,unset" if tooltip must be actually removed.

I dont think we normally have to document internal methods. Internal methods tend to change so documentation becomes stale
Comment 10 Chris Dumez 2012-10-14 23:56:44 PDT
(In reply to comment #7)
> (From update of attachment 167446 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=167446&action=review
> 
> >> Source/WebKit2/ChangeLog:8
> >> +        Implement PageClientImple::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,
> > 
> > "PageClientImpl"
> > 
> > Why do we emit a signal on the view? It seems to me like the view should be able to take care of drawing tooltips by itself...
> > Unless there is a good reason to delegate this to the browser, I would rather we keep as much functionality as possible in the view. Otherwise, it becomes painful to write a browser based on WebKit EFL.
> 
> In my thought, tooltip is a kind of UI element such as toolbar or status bar. Applications may want their own tooltip UX or even they do not want to show it.
> Also, I think applications can easily draw the tooltip with elm_object_tooltip_set() so it is not too painful.

If you would use smart functions instead of signals, this would allow apps to draw tooltips by themselves if they want to and we could fallback to a "default" tooltip drawing behavior in ewk_view.
Comment 11 Chris Dumez 2012-10-14 23:59:38 PDT
Comment on attachment 168632 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1135
> +    if (text && text[0] != '\0')

if (text && *text) ?

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:68
> + * - "tooltip,text,unset", void: tooltip text must be actaully removed.

"actually"
Comment 12 Jinwoo Song 2012-10-15 00:41:08 PDT
Comment on attachment 167446 [details]
Patch

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

>>>> Source/WebKit2/ChangeLog:8
>>>> +        Implement PageClientImple::toolTipChanged() to emit signal 'tooltip,text,set' with a tooltip text,
>>> 
>>> "PageClientImpl"
>>> 
>>> Why do we emit a signal on the view? It seems to me like the view should be able to take care of drawing tooltips by itself...
>>> Unless there is a good reason to delegate this to the browser, I would rather we keep as much functionality as possible in the view. Otherwise, it becomes painful to write a browser based on WebKit EFL.
>> 
>> In my thought, tooltip is a kind of UI element such as toolbar or status bar. Applications may want their own tooltip UX or even they do not want to show it.
>> Also, I think applications can easily draw the tooltip with elm_object_tooltip_set() so it is not too painful.
> 
> If you would use smart functions instead of signals, this would allow apps to draw tooltips by themselves if they want to and we could fallback to a "default" tooltip drawing behavior in ewk_view.

Yes I know I can use the smart function if we want to support the tooltip in the webkit but it seems that tooltip is not an essential feature to support the fallback.
Comment 13 Jinwoo Song 2012-10-15 00:41:26 PDT
Comment on attachment 168632 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1131
>> + *               "tooltip,text,unset" if tooltip must be actually removed.
> 
> I dont think we normally have to document internal methods. Internal methods tend to change so documentation becomes stale

I see your point. I just added the document following the previous things.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1135
>> +    if (text && text[0] != '\0')
> 
> if (text && *text) ?

I'll fix.

>> Source/WebKit2/UIProcess/API/efl/ewk_view.h:68
>> + * - "tooltip,text,unset", void: tooltip text must be actaully removed.
> 
> "actually"

I'll fix typo.
Comment 14 Jinwoo Song 2012-10-15 00:43:28 PDT
Created attachment 168642 [details]
patch for landing.
Comment 15 Kenneth Rohde Christiansen 2012-10-15 01:49:49 PDT
Comment on attachment 168642 [details]
patch for landing.

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1131
> + * Reports that the tooltip text was changed.
> + *
> + * Emits signal: "tooltip,text,set" with a tooltip text to set.
> + *               "tooltip,text,unset" if tooltip must be actually removed.

I would just remove this documentation.

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:68
> + * - "tooltip,text,unset", void: tooltip text must be actually removed.

bad english: tooltip was unset?

 * - "tooltip,text,set", const char*: tooltip was set.
 * - "tooltip,text,unset", void: tooltip was unset.
Comment 16 Jinwoo Song 2012-10-15 02:45:25 PDT
(In reply to comment #15)
> (From update of attachment 168642 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=168642&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:1131
> > + * Reports that the tooltip text was changed.
> > + *
> > + * Emits signal: "tooltip,text,set" with a tooltip text to set.
> > + *               "tooltip,text,unset" if tooltip must be actually removed.
> 
> I would just remove this documentation.
> 
Done.
> > Source/WebKit2/UIProcess/API/efl/ewk_view.h:68
> > + * - "tooltip,text,unset", void: tooltip text must be actually removed.
> 
> bad english: tooltip was unset?
> 
>  * - "tooltip,text,set", const char*: tooltip was set.
>  * - "tooltip,text,unset", void: tooltip was unset.
Fixed.
Comment 17 Jinwoo Song 2012-10-15 02:46:44 PDT
Created attachment 168657 [details]
patch

Applied the comments by Kenneth.
Comment 18 WebKit Review Bot 2012-10-15 13:23:52 PDT
Comment on attachment 168657 [details]
patch

Clearing flags on attachment: 168657

Committed r131347: <http://trac.webkit.org/changeset/131347>
Comment 19 WebKit Review Bot 2012-10-15 13:23:58 PDT
All reviewed patches have been landed.  Closing bug.