Title: [143195] trunk/Source/WebKit2
Revision
143195
Author
[email protected]
Date
2013-02-18 04:54:03 -0800 (Mon, 18 Feb 2013)

Log Message

[Qt][WK2] Changing WebView.contentY and WebView.contentX does not redraw content
https://bugs.webkit.org/show_bug.cgi?id=108337

Reviewed by Jocelyn Turcotte.

We should not ignore content position changes unless pinch zoom or bounce-back
animation is ongoing.
This way we notify the web process about visible rect changes if the contentX
and contentY properties are used to programmatically scroll the content from QML.
One important usecase for this is when implementing scrollbars.

* UIProcess/qt/PageViewportControllerClientQt.cpp:
(WebKit::PageViewportControllerClientQt::PageViewportControllerClientQt):
(WebKit::PageViewportControllerClientQt::flickMoveStarted):
(WebKit::PageViewportControllerClientQt::flickMoveEnded):
(WebKit::PageViewportControllerClientQt::pageItemPositionChanged):
(WebKit::PageViewportControllerClientQt::scaleAnimationStateChanged):
(WebKit::PageViewportControllerClientQt::pinchGestureStarted):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (143194 => 143195)


--- trunk/Source/WebKit2/ChangeLog	2013-02-18 12:11:58 UTC (rev 143194)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-18 12:54:03 UTC (rev 143195)
@@ -1,3 +1,24 @@
+2013-02-18  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] Changing WebView.contentY and WebView.contentX does not redraw content
+        https://bugs.webkit.org/show_bug.cgi?id=108337
+
+        Reviewed by Jocelyn Turcotte.
+
+        We should not ignore content position changes unless pinch zoom or bounce-back
+        animation is ongoing.
+        This way we notify the web process about visible rect changes if the contentX
+        and contentY properties are used to programmatically scroll the content from QML.
+        One important usecase for this is when implementing scrollbars.
+
+        * UIProcess/qt/PageViewportControllerClientQt.cpp:
+        (WebKit::PageViewportControllerClientQt::PageViewportControllerClientQt):
+        (WebKit::PageViewportControllerClientQt::flickMoveStarted):
+        (WebKit::PageViewportControllerClientQt::flickMoveEnded):
+        (WebKit::PageViewportControllerClientQt::pageItemPositionChanged):
+        (WebKit::PageViewportControllerClientQt::scaleAnimationStateChanged):
+        (WebKit::PageViewportControllerClientQt::pinchGestureStarted):
+
 2013-02-18  Grzegorz Czajkowski  <[email protected]>
 
         [WK2][EFL] Unified text checker implementation

Modified: trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp (143194 => 143195)


--- trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2013-02-18 12:11:58 UTC (rev 143194)
+++ trunk/Source/WebKit2/UIProcess/qt/PageViewportControllerClientQt.cpp	2013-02-18 12:54:03 UTC (rev 143195)
@@ -46,7 +46,7 @@
     , m_lastCommittedScale(-1)
     , m_zoomOutScale(0)
     , m_isUserInteracting(false)
-    , m_ignoreViewportChanges(true)
+    , m_ignoreViewportChanges(false)
 {
     m_scaleAnimation->setDuration(kScaleAnimationDurationMillis);
     m_scaleAnimation->setEasingCurve(QEasingCurve::OutCubic);
@@ -124,15 +124,12 @@
     m_controller->suspendContent();
 
     m_lastScrollPosition = m_viewportItem->contentPos();
-
-    m_ignoreViewportChanges = false;
 }
 
 void PageViewportControllerClientQt::flickMoveEnded()
 {
     // This method is called on the end of the pan or pan kinetic animation.
 
-    m_ignoreViewportChanges = true;
     if (!m_isUserInteracting)
         m_controller->resumeContent();
 }
@@ -153,10 +150,12 @@
 {
     switch (newState) {
     case QAbstractAnimation::Running:
+        m_ignoreViewportChanges = true;
         m_viewportItem->cancelFlick();
         m_controller->suspendContent();
         break;
     case QAbstractAnimation::Stopped:
+        m_ignoreViewportChanges = false;
         m_controller->resumeContent();
         break;
     default:
@@ -318,8 +317,8 @@
 void PageViewportControllerClientQt::setViewportPosition(const FloatPoint& contentsPoint)
 {
     QPointF newPosition((m_pageItem->position() + QPointF(contentsPoint)) * m_pageItem->contentsScale());
+    // The contentX and contentY property changes trigger a visible rect update.
     m_viewportItem->setContentPos(newPosition);
-    updateViewportController();
 }
 
 void PageViewportControllerClientQt::setPageScaleFactor(float localScale)
@@ -423,6 +422,7 @@
 
     clearRelativeZoomState();
 
+    m_ignoreViewportChanges = true;
     m_controller->suspendContent();
 
     m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
@@ -457,6 +457,7 @@
     if (!m_controller->allowsUserScaling())
         return;
 
+    m_ignoreViewportChanges = false;
     m_pinchStartScale = -1;
 
     // This will take care of resuming the content, even if no animation was performed.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to