Changeset 117069 in webkit
- Timestamp:
- May 15, 2012 8:07:59 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117065 r117069 1 2012-05-15 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 [Qt][WK2] Fix scrolling in touch mode 4 https://bugs.webkit.org/show_bug.cgi?id=75006 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 * page/FrameView.cpp: 9 (WebCore::FrameView::setFixedVisibleContentRect): 10 On changes to fixedVisibleContentRect update scroll-animators position, and 11 recalculate page-step sizes in scrollbars. 12 * platform/ScrollView.cpp: 13 (WebCore::ScrollView::scrollTo): 14 Forward scrolling-request to the host window. 15 (WebCore::ScrollView::updateScrollbars): 16 Allow ScrollViews to have invisible scrollbars when scrolling is delegated. 17 * platform/ScrollView.h: 18 (ScrollView): 19 1 20 2012-05-15 Vsevolod Vlasov <vsevik@chromium.org> 2 21 -
trunk/Source/WebCore/page/FrameView.cpp
r117032 r117069 1723 1723 void FrameView::setFixedVisibleContentRect(const IntRect& visibleContentRect) 1724 1724 { 1725 bool visibleContentSizeDidChange = false; 1725 1726 if (visibleContentRect.size() != this->fixedVisibleContentRect().size()) { 1726 1727 // When the viewport size changes or the content is scaled, we need to … … 1728 1729 if (RenderView* root = rootRenderer(this)) 1729 1730 root->setFixedPositionedObjectsNeedLayout(); 1731 visibleContentSizeDidChange = true; 1730 1732 } 1731 1733 … … 1735 1737 if (m_frame->page()->settings()->acceleratedCompositingForFixedPositionEnabled()) 1736 1738 updateFixedElementsAfterScrolling(); 1739 scrollAnimator()->setCurrentPosition(scrollPosition()); 1737 1740 scrollPositionChanged(); 1741 } 1742 if (visibleContentSizeDidChange) { 1743 // Update the scroll-bars to calculate new page-step size. 1744 updateScrollbars(scrollOffset()); 1738 1745 } 1739 1746 frame()->loader()->client()->didChangeScrollOffset(); -
trunk/Source/WebCore/platform/ScrollView.cpp
r115401 r117069 372 372 373 373 repaintFixedElementsAfterScrolling(); 374 #if USE(TILED_BACKING_STORE) 375 if (delegatesScrolling()) { 376 hostWindow()->delegatedScrollRequested(IntPoint(newOffset)); 377 return; 378 } 379 #endif 374 380 scrollContents(scrollDelta); 375 381 updateFixedElementsAfterScrolling(); … … 454 460 void ScrollView::updateScrollbars(const IntSize& desiredOffset) 455 461 { 456 if (m_inUpdateScrollbars || prohibitsScrolling() || delegatesScrolling() ||platformWidget())462 if (m_inUpdateScrollbars || prohibitsScrolling() || platformWidget()) 457 463 return; 458 464 -
trunk/Source/WebCore/platform/ScrollView.h
r116688 r117069 314 314 virtual bool isFlippedDocument() const { return false; } 315 315 316 // Called to update the scrollbars to accurately reflect the state of the view. 317 void updateScrollbars(const IntSize& desiredOffset); 318 316 319 private: 317 320 RefPtr<Scrollbar> m_horizontalScrollbar; … … 356 359 void destroy(); 357 360 358 // Called to update the scrollbars to accurately reflect the state of the view.359 void updateScrollbars(const IntSize& desiredOffset);360 361 IntRect rectToCopyOnScroll() const; 361 362 -
trunk/Source/WebKit2/ChangeLog
r117061 r117069 1 2012-05-15 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 3 [Qt][WK2] Fix scrolling in touch mode 4 https://bugs.webkit.org/show_bug.cgi?id=75006 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Only handle mouse-wheel events in WebCore to avoid double scrolling, and 9 scale pixels scrolled by wheel events according to viewport transformation. 10 11 * Shared/qt/WebEventFactoryQt.cpp: 12 (WebKit::WebEventFactory::createWebWheelEvent): 13 * UIProcess/qt/QtViewportInteractionEngine.cpp: 14 * UIProcess/qt/QtViewportInteractionEngine.h: 15 (QtViewportInteractionEngine): 16 * UIProcess/qt/QtWebPageEventHandler.cpp: 17 (QtWebPageEventHandler::handleWheelEvent): 18 1 19 2012-05-15 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 20 -
trunk/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
r114917 r117069 28 28 #include "WebEventFactoryQt.h" 29 29 #include <QKeyEvent> 30 #include <QLineF> 30 31 #include <QTransform> 32 #include <WebCore/FloatPoint.h> 33 #include <WebCore/FloatSize.h> 31 34 #include <WebCore/IntPoint.h> 32 #include <WebCore/FloatPoint.h>33 35 #include <WebCore/PlatformKeyboardEvent.h> 34 36 #include <wtf/ASCIICType.h> … … 150 152 deltaY = wheelTicksY * wheelScrollLines * cDefaultQtScrollStep; 151 153 152 return WebWheelEvent(WebEvent::Wheel, fromItemTransform.map(e->posF()).toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp); 154 // Transform the position and the pixel scrolling distance. 155 QLineF transformedScroll = fromItemTransform.map(QLineF(e->posF(), e->posF() + QPointF(deltaX, deltaY))); 156 IntPoint transformedPoint = transformedScroll.p1().toPoint(); 157 IntPoint globalPoint = e->globalPosF().toPoint(); 158 FloatSize transformedDelta(transformedScroll.dx(), transformedScroll.dy()); 159 FloatSize wheelTicks(wheelTicksX, wheelTicksY); 160 return WebWheelEvent(WebEvent::Wheel, transformedPoint, globalPoint, transformedDelta, wheelTicks, granularity, modifiers, timestamp); 153 161 } 154 162 -
trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
r117061 r117069 262 262 } 263 263 264 void QtViewportInteractionEngine::wheelEvent(QWheelEvent* ev)265 {266 if (scrollAnimationActive() || scaleAnimationActive() || pinchGestureActive())267 return; // Ignore.268 269 270 // A normal scroll-tick should have a delta of 120 (1/8) degrees. Convert this to271 // local standard scroll step of 3 lines of 20 pixels.272 static const int cDefaultQtScrollStep = 20;273 static const int wheelScrollLines = 3;274 const int wheelTick = wheelScrollLines * cDefaultQtScrollStep;275 276 int pixelDelta = ev->delta() * (wheelTick / 120.f);277 278 QPointF newPosition = m_viewport->contentPos();279 280 if (ev->orientation() == Qt::Horizontal)281 newPosition.rx() -= pixelDelta;282 else283 newPosition.ry() -= pixelDelta;284 285 QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentsScale());286 287 QPointF currentPosition = m_viewport->contentPos();288 newPosition = boundPosition(endPosRange.topLeft(), newPosition, endPosRange.bottomRight());289 m_viewport->setContentPos(newPosition);290 291 emit contentViewportChanged(currentPosition - newPosition);292 }293 294 264 void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition) 295 265 { -
trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
r117061 r117069 66 66 bool animateItemRectVisible(const QRectF&); 67 67 68 void wheelEvent(QWheelEvent*);69 68 void pagePositionRequest(const QPoint& pos); 70 69 void touchBegin(); -
trunk/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
r115973 r117069 155 155 QTransform fromItemTransform = m_webPage->transformFromItem(); 156 156 m_webPageProxy->handleWheelEvent(NativeWebWheelEvent(ev, fromItemTransform)); 157 // FIXME: Handle whether the page used the wheel event or not.158 if (m_interactionEngine)159 m_interactionEngine->wheelEvent(ev);160 157 } 161 158
Note: See TracChangeset
for help on using the changeset viewer.