Bug 90547 - [Qt][WK2] Improve visible content rect update
Summary: [Qt][WK2] Improve visible content rect update
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andras Becsi
URL:
Keywords:
Depends on:
Blocks: 90550
  Show dependency treegraph
 
Reported: 2012-07-04 05:50 PDT by Andras Becsi
Modified: 2014-02-03 03:21 PST (History)
9 users (show)

See Also:


Attachments
Patch (6.97 KB, patch)
2012-07-04 05:52 PDT, Andras Becsi
kenneth: review-
Details | Formatted Diff | Diff
updated patch (10.52 KB, patch)
2012-07-06 06:06 PDT, Andras Becsi
gyuyoung.kim: commit-queue-
Details | Formatted Diff | Diff
updated patch (10.36 KB, patch)
2012-07-06 06:27 PDT, Andras Becsi
gyuyoung.kim: commit-queue-
Details | Formatted Diff | Diff
updated patch (10.35 KB, patch)
2012-07-06 06:41 PDT, Andras Becsi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Becsi 2012-07-04 05:50:25 PDT
[Qt][WK2] Improve visible content rect update
Comment 1 Andras Becsi 2012-07-04 05:52:32 PDT
Created attachment 150780 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2012-07-04 19:31:25 PDT
Comment on attachment 150780 [details]
Patch

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

> Source/WebKit2/UIProcess/qt/QtViewportHandler.cpp:715
> +    // A zero trajectoryVector indicates that tiles all around the viewport are requested.
> +    if (!trajectoryVector.isNull() && m_lastVisibleContentsRect == currentVisibleContentsRect)

Good catch

> Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1230
>  
> +    IntSize currentVisibleContentSize;
> +    if (const FrameView* view = m_frame->coreFrame()->view())
> +        currentVisibleContentSize = view->visibleContentRect().size();
> +

So what if the current page is zoomed in, then this wont be correct for the new loaded one.

If you know about the viewport meta at this point you can calculate the first visible contents rect given the real viewport rect

> Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1239
> +        // The HistoryController will update the scroll position later if needed.
> +        m_frame->coreFrame()->view()->setFixedVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));

Sure, but doesnt that mean that we can be smarter here? probably doesnt matter

> Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:515
> -    if (trajectoryVector != FloatPoint::zero())
> -        toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
> +    toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);

Add comment that it can be zero here?
Comment 3 Andras Becsi 2012-07-06 06:06:39 PDT
Created attachment 151070 [details]
updated patch
Comment 4 Gyuyoung Kim 2012-07-06 06:13:15 PDT
Comment on attachment 151070 [details]
updated patch

Attachment 151070 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13145446
Comment 5 Andras Becsi 2012-07-06 06:27:00 PDT
Created attachment 151073 [details]
updated patch

Fixed Gtk and EFL builds.
Comment 6 Gyuyoung Kim 2012-07-06 06:32:10 PDT
Comment on attachment 151073 [details]
updated patch

Attachment 151073 [details] did not pass efl-ews (efl):
Output: http://queues.webkit.org/results/13143448
Comment 7 Build Bot 2012-07-06 06:33:19 PDT
Comment on attachment 151073 [details]
updated patch

Attachment 151073 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/13145448
Comment 8 Build Bot 2012-07-06 06:37:44 PDT
Comment on attachment 151073 [details]
updated patch

Attachment 151073 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/13153308
Comment 9 Andras Becsi 2012-07-06 06:41:36 PDT
Created attachment 151077 [details]
updated patch

Another attempt to fix the build on non-Qt platforms.
Comment 10 Andras Becsi 2012-07-06 07:03:09 PDT
(In reply to comment #2)
> (From update of attachment 150780 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=150780&action=review
[snip]
> > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1230
> >  
> > +    IntSize currentVisibleContentSize;
> > +    if (const FrameView* view = m_frame->coreFrame()->view())
> > +        currentVisibleContentSize = view->visibleContentRect().size();
> > +
> 
> So what if the current page is zoomed in, then this wont be correct for the new loaded one.
> 
> If you know about the viewport meta at this point you can calculate the first visible contents rect given the real viewport rect
>

Fixed. At this point during page load the only way I could get the actual viewport size was through WebPage, so I had to remove the TILED_BACKING_STORE guards from the needed functions. I also checked ViewportArguments which is empty here, so is there another way of getting the viewport size?

> > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:1239
> > +        // The HistoryController will update the scroll position later if needed.
> > +        m_frame->coreFrame()->view()->setFixedVisibleContentRect(IntRect(IntPoint::zero(), currentVisibleContentSize));
> 
> Sure, but doesnt that mean that we can be smarter here? probably doesnt matter

Setting a position here would be wrong, since (except when reloading) the loaded page could be a completely new one, so HistoryController should do the positioning if needed.

> 
> > Source/WebKit2/WebProcess/WebPage/LayerTreeCoordinator/LayerTreeCoordinator.cpp:515
> > -    if (trajectoryVector != FloatPoint::zero())
> > -        toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
> > +    toWebGraphicsLayer(m_nonCompositedContentLayer.get())->setVisibleContentRectTrajectoryVector(trajectoryVector);
> 
> Add comment that it can be zero here?
Done.
Comment 11 Andras Becsi 2012-08-01 08:44:05 PDT
Comment on attachment 151077 [details]
updated patch

Remove patch from review queue, since part of it already landed in bug 92750 and the patch landed for bug 90550 seems to have fixed my test case. Trying to find a new one.
Comment 12 Jocelyn Turcotte 2014-02-03 03:21:33 PST
=== Bulk closing of Qt bugs ===

If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary.

If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines.