Bug 108922 - Coordinated Graphics: Make CoordinatedGraphicsScene not know contents size.
Summary: Coordinated Graphics: Make CoordinatedGraphicsScene not know contents size.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dongseong Hwang
URL:
Keywords:
Depends on: 108051
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-05 01:24 PST by Dongseong Hwang
Modified: 2013-02-11 22:28 PST (History)
11 users (show)

See Also:


Attachments
Patch (14.26 KB, patch)
2013-02-05 01:28 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (14.50 KB, patch)
2013-02-05 02:51 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff
Patch (14.50 KB, patch)
2013-02-06 02:26 PST, Dongseong Hwang
noam: review+
noam: commit-queue-
Details | Formatted Diff | Diff
Patch (14.72 KB, patch)
2013-02-11 21:37 PST, Dongseong Hwang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2013-02-05 01:24:46 PST
Currently, CoordinatedGraphicsScene has two methods to know contents size:
setContentsSize() and setVisibleContentsRect(). Contents size is used when
adjusting a scroll position, but adjustment is not needed because
PageViewportController already adjusts a scroll position. So this patch makes
CoordinatedGraphicsScene not know contents size.

In addition, now DrawingAreaProxy::coordinatedLayerTreeHostProxy() is only used
to get CoordinatedGraphicsScene.
Comment 1 Dongseong Hwang 2013-02-05 01:28:05 PST
Created attachment 186573 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2013-02-05 02:23:15 PST
Comment on attachment 186573 [details]
Patch

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

> Source/WebCore/ChangeLog:12
> +        Currently, CoordinatedGraphicsScene has two methods to know contents size:
> +        setContentsSize() and setVisibleContentsRect(). Contents size is used when
> +        adjusting a scroll position, but adjustment is not needed because
> +        PageViewportController already adjusts a scroll position. So this patch makes
> +        CoordinatedGraphicsScene not know contents size.

I guess this is not PageViewportController specific... but more about who has the responsibility.

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:-63
> -static FloatPoint boundedScrollPosition(const FloatPoint& scrollPosition, const FloatRect& visibleContentRect, const FloatSize& contentSize)
> -{
> -    float scrollPositionX = std::max(scrollPosition.x(), 0.0f);
> -    scrollPositionX = std::min(scrollPositionX, contentSize.width() - visibleContentRect.width());
> -
> -    float scrollPositionY = std::max(scrollPosition.y(), 0.0f);
> -    scrollPositionY = std::min(scrollPositionY, contentSize.height() - visibleContentRect.height());
> -    return FloatPoint(scrollPositionX, scrollPositionY);
> -}
> -

This indeed seems like "view specific" code as as the view might implement bouncing etc, I agree that this might not belong here
Comment 3 Dongseong Hwang 2013-02-05 02:36:31 PST
(In reply to comment #2)

Thank you for review!

> (From update of attachment 186573 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=186573&action=review
> 
> > Source/WebCore/ChangeLog:12
> > +        PageViewportController already adjusts a scroll position. So this patch makes
> > +        CoordinatedGraphicsScene not know contents size.
> 
> I guess this is not PageViewportController specific... but more about who has the responsibility.

I'll change the changelog.

> > Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:-63
> This indeed seems like "view specific" code as as the view might implement bouncing etc, I agree that this might not belong here

I think so :)

noam, kenneth agreed. could you review? :)
Comment 4 Mikhail Pozdnyakov 2013-02-05 02:45:19 PST
Comment on attachment 186573 [details]
Patch

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

> Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:192
> +    FloatSize delta = m_scrollPosition - m_renderedContentsScrollPosition;

this is used for fixed elements positioning while scrolling. Have you checked that your patch does not bring regressions there?
Comment 5 Dongseong Hwang 2013-02-05 02:51:19 PST
Created attachment 186589 [details]
Patch
Comment 6 Dongseong Hwang 2013-02-05 02:55:36 PST
(In reply to comment #4)
> (From update of attachment 186573 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=186573&action=review
> 
> > Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:192
> > +    FloatSize delta = m_scrollPosition - m_renderedContentsScrollPosition;
> 
> this is used for fixed elements positioning while scrolling. Have you checked that your patch does not bring regressions there?

I tested ManualTests/fixed-position.html and ManualTests/nested-fixed-position.html using Qt and EFL Minibrowser.
and I feel the same between before and after.

In theory, it is impossible to make regression, because the major two behaviors are not changed: the way to get m_renderedContentsScrollPosition, and the way to get current scroll position.
Comment 7 Mikhail Pozdnyakov 2013-02-05 03:44:35 PST
> In theory, it is impossible to make regression
Well my experience say that it is always possible :) but since you've checked I'm OK with the patch.
Comment 8 Noam Rosenthal 2013-02-05 05:39:16 PST
I'm ok with the patch as well.
Comment 9 Benjamin Poulain 2013-02-05 21:32:12 PST
Comment on attachment 186589 [details]
Patch

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

I have no problem with this for WK2. Feel free to go ahead with a real review.

> Source/WebCore/ChangeLog:20
> +        Test: ManualTests/fixed-position.html
> +              ManualTests/nested-fixed-position.html

Is there really no ref-test covering this? :)
ManualTests are a very weak tool. If you feel the current ref-tests do not cover everything you need, please improve the test coverage.
Comment 10 Noam Rosenthal 2013-02-05 23:16:47 PST
> Is there really no ref-test covering this? :)
> ManualTests are a very weak tool. If you feel the current ref-tests do not cover everything you need, please improve the test coverage.

There are no current facilities to test things "in motion" in the UI process; E.g. how would you test that during a particular touch sequence there are no flickers/shakes?
Comment 11 Benjamin Poulain 2013-02-05 23:50:03 PST
(In reply to comment #10)
> There are no current facilities to test things "in motion" in the UI process; E.g. how would you test that during a particular touch sequence there are no flickers/shakes?

Yep, not much you can do for those.

Fortunately, such bugs are extremely rare.
Comment 12 Dongseong Hwang 2013-02-06 00:29:42 PST
I wish we can cover this patch automatically. Unfortunately, I couldn't think of a way to test this in an automated fashion.

btw, noam, could you review? :)
Comment 13 Noam Rosenthal 2013-02-06 01:41:12 PST
Comment on attachment 186589 [details]
Patch

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

>> Source/WebCore/ChangeLog:20
>> +              ManualTests/nested-fixed-position.html
> 
> Is there really no ref-test covering this? :)
> ManualTests are a very weak tool. If you feel the current ref-tests do not cover everything you need, please improve the test coverage.

Please state in the changelog that this can only be tested manually since there is no automated testing facilities for in-motion touch.
Comment 14 Dongseong Hwang 2013-02-06 02:26:53 PST
Created attachment 186802 [details]
Patch
Comment 15 Dongseong Hwang 2013-02-06 02:27:41 PST
(In reply to comment #13)
> (From update of attachment 186589 [details])
> Please state in the changelog that this can only be tested manually since there is no automated testing facilities for in-motion touch.

yes, Done. Thank you for improving changelog.
Comment 16 Noam Rosenthal 2013-02-11 00:35:38 PST
Comment on attachment 186802 [details]
Patch

LGTM. Also signed off by Benjamin for WK2. Please run through EWS before committing; currently patch doesn't apply.
Comment 17 Dongseong Hwang 2013-02-11 21:37:14 PST
Created attachment 187769 [details]
Patch
Comment 18 WebKit Review Bot 2013-02-11 22:28:29 PST
Comment on attachment 187769 [details]
Patch

Clearing flags on attachment: 187769

Committed r142579: <http://trac.webkit.org/changeset/142579>
Comment 19 WebKit Review Bot 2013-02-11 22:28:36 PST
All reviewed patches have been landed.  Closing bug.