Bug 103094 - [EFL][WK2] Add contents,size,changed signal to the ewk_view API
Summary: [EFL][WK2] Add contents,size,changed signal to the ewk_view API
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit EFL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryuan Choi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 16:28 PST by Ryuan Choi
Modified: 2012-12-03 07:51 PST (History)
8 users (show)

See Also:


Attachments
Patch (7.24 KB, patch)
2012-11-22 17:38 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (8.24 KB, patch)
2012-11-22 18:08 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (9.08 KB, patch)
2012-11-25 18:06 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (9.06 KB, patch)
2012-11-25 18:38 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (9.09 KB, patch)
2012-11-29 08:49 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (10.45 KB, patch)
2012-11-29 20:19 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (10.21 KB, patch)
2012-11-29 22:15 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (10.52 KB, patch)
2012-12-03 06:38 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff
Patch (11.34 KB, patch)
2012-12-03 07:40 PST, Ryuan Choi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryuan Choi 2012-11-22 16:28:22 PST
Added signal to let applications know contents size.
Applications can use this signal to give some additional behavior such as minimap, external scroll.
Comment 1 Ryuan Choi 2012-11-22 17:38:24 PST
Created attachment 175719 [details]
Patch
Comment 2 Jinwoo Song 2012-11-22 17:57:46 PST
Please add the callback description in ewk_view.h
Comment 3 Ryuan Choi 2012-11-22 18:08:52 PST
Created attachment 175721 [details]
Patch
Comment 4 Mikhail Pozdnyakov 2012-11-23 02:34:44 PST
Comment on attachment 175721 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:-728
> -    m_pageClient->didChangeContentsSize(size);

how did you come to removing it?

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:727
> +    int contentsSize[2];

Think it's really better to have a size structure

> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:456
> +#if PLATFORM(QT) || PLATFORM(EFL)

why not use #if USE(TILED_BACKING_STORE) here as well?
Comment 5 Chris Dumez 2012-11-23 02:42:17 PST
Comment on attachment 175721 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:-728
>> -    m_pageClient->didChangeContentsSize(size);
> 
> how did you come to removing it?

Odd indeed.

>> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:727
>> +    int contentsSize[2];
> 
> Think it's really better to have a size structure

I definitely agree.

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:893
> +TEST_F(EWK2UnitTestBase, ewk_view_contnets_size_changed)

Typo "contnets"
Comment 6 Ryuan Choi 2012-11-25 16:27:58 PST
(In reply to comment #4)
> (From update of attachment 175721 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=175721&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:-728
> > -    m_pageClient->didChangeContentsSize(size);
> 
> how did you come to removing it?
> 

After previous refactoring, informContentsSizeChange was only called by PageClientDefaultImpl and PageClientLegacyImpl when TILED_BACKING_STORE is disabled.

So, I believe that this was dead code.

> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:727
> > +    int contentsSize[2];
> 
> Think it's really better to have a size structure
> 
I will change to Evas_Coord_Size.

> > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:456
> > +#if PLATFORM(QT) || PLATFORM(EFL)
> 
> why not use #if USE(TILED_BACKING_STORE) here as well?

I want to send DidChangeContentsSize although TILED_BACKINGSTORE was disabled.

(In reply to comment #5)
> (From update of attachment 175721 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=175721&action=review
> 
> >> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:-728
> >> -    m_pageClient->didChangeContentsSize(size);
> > 
> > how did you come to removing it?
> 
> Odd indeed.
> 
> >> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:727
> >> +    int contentsSize[2];
> > 
> > Think it's really better to have a size structure
> 
> I definitely agree.
> 
> > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:893
> > +TEST_F(EWK2UnitTestBase, ewk_view_contnets_size_changed)
> 
> Typo "contnets"

Oops, I will fix it.

Thanks.
Comment 7 Ryuan Choi 2012-11-25 18:06:18 PST
Created attachment 175906 [details]
Patch
Comment 8 Ryuan Choi 2012-11-25 18:14:54 PST
(In reply to comment #7)
> Created an attachment (id=175906) [details]
> Patch

Applied above comments.

Exceptionally, I created Ewk_Size temporarily instead of Evas_Coord_Size because Evas_Coord_Size is introduced after EFL 1.7.
Comment 9 Jinwoo Song 2012-11-25 18:26:59 PST
Comment on attachment 175906 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:284
> +    Evas_Coord w; /**< x co-ordinate */

comment looks wrong. Not x co-ordinate, but width value.

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:285
> +    Evas_Coord h; /**< y co-ordinate */

ditto.
Comment 10 Ryuan Choi 2012-11-25 18:38:05 PST
Created attachment 175909 [details]
Patch
Comment 11 Ryuan Choi 2012-11-29 08:49:00 PST
Created attachment 176742 [details]
Patch
Comment 12 Ryuan Choi 2012-11-29 08:50:19 PST
(In reply to comment #11)
> Created an attachment (id=176742) [details]
> Patch

rebase because of email.

Christophe, Mikhail,

Could you give me an opinion?
Comment 13 Chris Dumez 2012-11-29 09:00:18 PST
Comment on attachment 176742 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:903
> +    while (sizeChanged)

Am I misreading? Shouldn't is be "while (!sizeChanged)" ?
Comment 14 Mikhail Pozdnyakov 2012-11-29 09:12:34 PST
Comment on attachment 176742 [details]
Patch

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

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:737
>  void EwkViewImpl::informContentsSizeChange(const IntSize& size)

I don't think EwkView needs this method at all.

> Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:740
> +    Ewk_Size contentsSize;

Ewk_Size contentsSize { size.width(), size.height() }, just more compact
Comment 15 Gyuyoung Kim 2012-11-29 19:24:32 PST
Comment on attachment 176742 [details]
Patch

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

> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:448
> +#if USE(TILED_BACKING_STORE)

Are you sure QT port doesn't need to use this code block when TILED_BACKING_STORE is disabled ?
Comment 16 Ryuan Choi 2012-11-29 20:19:43 PST
Created attachment 176893 [details]
Patch
Comment 17 Ryuan Choi 2012-11-29 20:22:15 PST
(In reply to comment #13)
> (From update of attachment 176742 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176742&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp:903
> > +    while (sizeChanged)
> 
> Am I misreading? Shouldn't is be "while (!sizeChanged)" ?

Oops. you're right. fixed.

(In reply to comment #14)
> (From update of attachment 176742 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176742&action=review
> 
> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:737
> >  void EwkViewImpl::informContentsSizeChange(const IntSize& size)
> 
> I don't think EwkView needs this method at all.
> 
I thought smartcall should be in EwkView.
I removed it.

> > Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp:740
> > +    Ewk_Size contentsSize;
> 
> Ewk_Size contentsSize { size.width(), size.height() }, just more compact
Done.


(In reply to comment #15)
> (From update of attachment 176742 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176742&action=review
> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:448
> > +#if USE(TILED_BACKING_STORE)
> 
> Are you sure QT port doesn't need to use this code block when TILED_BACKING_STORE is disabled ?

I heard like that and if disabled TILED_BACKINGSTORE in qt port, previous code make build break because this code is only available when TILED BACKINGSTORE is enabled.
Comment 18 Gyuyoung Kim 2012-11-29 22:06:28 PST
Comment on attachment 176893 [details]
Patch

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

> Source/WebKit2/ChangeLog:23
> +        Sended DidChangeContentsSize message although TILED_BACKINGSTORE is disabled.

It would be good if you say QT port also be influenced on this patch.
Comment 19 Ryuan Choi 2012-11-29 22:15:03 PST
Created attachment 176901 [details]
Patch
Comment 20 Ryuan Choi 2012-11-29 22:16:34 PST
(In reply to comment #18)
> (From update of attachment 176893 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176893&action=review
> 
> > Source/WebKit2/ChangeLog:23
> > +        Sended DidChangeContentsSize message although TILED_BACKINGSTORE is disabled.
> 
> It would be good if you say QT port also be influenced on this patch.

As discussed, I changed patch to match with comment exactly.

Thank you.
Comment 21 Gyuyoung Kim 2012-11-29 23:42:12 PST
Comment on attachment 176893 [details]
Patch

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

> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:448
> +#if USE(TILED_BACKING_STORE)

Kenneth, I wonder if QT port can accept this change. Could you check this ?
Comment 22 Kenneth Rohde Christiansen 2012-11-30 01:08:43 PST
> Kenneth, I wonder if QT port can accept this change. Could you check this ?

Adding Jocelyn
Comment 23 Kenneth Rohde Christiansen 2012-11-30 01:12:13 PST
Comment on attachment 176901 [details]
Patch

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

> Source/WebKit2/ChangeLog:11
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        This patch emits signal to let applications know contents size.
> +
> +        * UIProcess/API/efl/EwkViewCallbacks.h: Added contents,size,changed signal.
> +        * UIProcess/API/efl/EwkViewImpl.cpp: Removed dead code.

You don't explain why apps need to know about this

> Source/WebKit2/UIProcess/API/efl/ewk_view.h:286
> +
> +/**
> + * @brief Structure representing size.
> + * @info This structure will be deprecated after EFL 1.8
> + */
> +struct Ewk_Size {
> +    Evas_Coord w; /**< width */
> +    Evas_Coord h; /**< height */
> +};

So now the question is. Contents size? Is that in css units? device units? Documentation should mention this. Did you test if deviceScaleFactor != 1, say == 2 ?

> Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp:102
> +    // FIXME: It should be changed to Evas_Coord_Size after EFL 1.8
> +    Ewk_Size contentsSize = { size.width(), size.height() };
> +    m_viewImpl->smartCallback<ContentsSizeChanged>().call(&contentsSize);

bug link? Also, why is that more clear? Evas_Coord_Size makes it think this is in UI units. I think even a Ewk_CSS_Size or similar would be more clear, ofcourse such a thing could be a typedef of Evas_Coord_Size if that makes any sense
Comment 24 Jocelyn Turcotte 2012-11-30 01:59:41 PST
Comment on attachment 176893 [details]
Patch

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

>> Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp:448
>> +#if USE(TILED_BACKING_STORE)
> 
> Kenneth, I wonder if QT port can accept this change. Could you check this ?

It's fine to me, fixed layout code also depend on TILED_BACKING_STORE for us.
Comment 25 Ryuan Choi 2012-12-03 06:38:15 PST
Created attachment 177244 [details]
Patch
Comment 26 Ryuan Choi 2012-12-03 06:41:28 PST
(In reply to comment #23)
> (From update of attachment 176901 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176901&action=review
> 
> > Source/WebKit2/ChangeLog:11
> > +
> > +        Reviewed by NOBODY (OOPS!).
> > +
> > +        This patch emits signal to let applications know contents size.
> > +
> > +        * UIProcess/API/efl/EwkViewCallbacks.h: Added contents,size,changed signal.
> > +        * UIProcess/API/efl/EwkViewImpl.cpp: Removed dead code.
> 
> You don't explain why apps need to know about this
> 
I added well-known simple use case.

> > Source/WebKit2/UIProcess/API/efl/ewk_view.h:286
> > +
> > +/**
> > + * @brief Structure representing size.
> > + * @info This structure will be deprecated after EFL 1.8
> > + */
> > +struct Ewk_Size {
> > +    Evas_Coord w; /**< width */
> > +    Evas_Coord h; /**< height */
> > +};
> 
> So now the question is. Contents size? Is that in css units? device units? Documentation should mention this. Did you test if deviceScaleFactor != 1, say == 2 ?
> 
I updated test cases.
In addition, I changed Ewk_Size to Ewk_CSS_Size
It looks better like you mentioned.

> > Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp:102
> > +    // FIXME: It should be changed to Evas_Coord_Size after EFL 1.8
> > +    Ewk_Size contentsSize = { size.width(), size.height() };
> > +    m_viewImpl->smartCallback<ContentsSizeChanged>().call(&contentsSize);
> 
> bug link? Also, why is that more clear? Evas_Coord_Size makes it think this is in UI units. I think even a Ewk_CSS_Size or similar would be more clear, ofcourse such a thing could be a typedef of Evas_Coord_Size if that makes any sense

I thought that it's better to use primilary types.
But, as you mentioned, Ewk_CSS_Size can be typedef when it is available.

So I removed FIXME.

Thank you.
Comment 27 Mikhail Pozdnyakov 2012-12-03 06:42:38 PST
Comment on attachment 177244 [details]
Patch

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

> Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp:100
> +    Ewk_CSS_Size contentsSize = { size.width(), size.height() };

how about adding one more template specialization like CallBack <callbackType, Ewk_CSS_Size*>
it could contain 'call(const WebCore::IntSize& size)' and do the conversion inside
Comment 28 Ryuan Choi 2012-12-03 07:40:00 PST
Created attachment 177253 [details]
Patch
Comment 29 Ryuan Choi 2012-12-03 07:40:43 PST
(In reply to comment #27)
> (From update of attachment 177244 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=177244&action=review
> 
> > Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp:100
> > +    Ewk_CSS_Size contentsSize = { size.width(), size.height() };
> 
> how about adding one more template specialization like CallBack <callbackType, Ewk_CSS_Size*>
> it could contain 'call(const WebCore::IntSize& size)' and do the conversion inside

OK. I tried like you mentioned.
Comment 30 Mikhail Pozdnyakov 2012-12-03 07:44:44 PST
Comment on attachment 177253 [details]
Patch

LGTM, thanks
Comment 31 Ryuan Choi 2012-12-03 07:50:55 PST
Committed r136402: <http://trac.webkit.org/changeset/136402>
Comment 32 Ryuan Choi 2012-12-03 07:51:53 PST
Comment on attachment 177253 [details]
Patch

thank you