Changeset 57266 in webkit
- Timestamp:
- Apr 8, 2010 2:13:50 AM (14 years ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebframe.cpp
r56577 r57266 278 278 static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const QPoint& pos) 279 279 { 280 if (!frame || !frame->document() || !frame-> eventHandler())280 if (!frame || !frame->document() || !frame->view() || !frame->eventHandler()) 281 281 return false; 282 282 283 Node* node = frame->document()->elementFromPoint(pos.x(), pos.y()); 283 QPoint contentsPos = frame->view()->windowToContents(pos); 284 Node* node = frame->document()->elementFromPoint(contentsPos.x(), contentsPos.y()); 284 285 if (!node) 285 286 return false; … … 322 323 void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy, const QPoint& pos) 323 324 { 324 Frame* frame = QWebFramePrivate::core(qFrame); 325 326 if (!frame || !frame->view()) 325 if (!qFrame) 327 326 return; 328 329 if (!webframe_scrollOverflow(frame, dx, dy, pos)) { 330 do { 331 bool scrolledHorizontal = false; 332 bool scrolledVertical = false; 333 334 IntSize scrollOffset = frame->view()->scrollOffset(); 335 IntPoint maxScrollOffset = frame->view()->maximumScrollPosition(); 336 337 if (dx > 0) // scroll right 338 scrolledHorizontal = scrollOffset.width() < maxScrollOffset.x(); 339 else if (dx < 0) // scroll left 340 scrolledHorizontal = scrollOffset.width() > 0; 341 342 if (dy > 0) // scroll down 343 scrolledVertical = scrollOffset.height() < maxScrollOffset.y(); 327 328 if (webframe_scrollOverflow(QWebFramePrivate::core(qFrame), dx, dy, pos)) 329 return; 330 331 bool scrollHorizontal = false; 332 bool scrollVertical = false; 333 334 do { 335 if (dx > 0) // scroll right 336 scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) < qFrame->scrollBarMaximum(Qt::Horizontal); 337 else if (dx < 0) // scroll left 338 scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) > qFrame->scrollBarMinimum(Qt::Horizontal); 339 340 if (dy > 0) // scroll down 341 scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical); 344 342 else if (dy < 0) //scroll up 345 scrolledVertical = scrollOffset.height() > 0; 346 347 if (scrolledHorizontal || scrolledVertical) { 348 frame->view()->scrollBy(IntSize(dx, dy)); 349 return; 350 } 351 352 frame = frame->tree()->parent(); 353 } while (frame && frame->view()); 354 } 343 scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical); 344 345 if (scrollHorizontal || scrollVertical) { 346 qFrame->scroll(dx, dy); 347 return; 348 } 349 350 qFrame = qFrame->parentFrame(); 351 } while (qFrame); 355 352 } 356 353 -
trunk/WebKit/qt/ChangeLog
r57210 r57266 1 2010-04-08 Joe Ligman <joseph.ligman@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] qtwebkit_webframe_scrollRecursively scrolls when body.style.overflow="hidden" 6 https://bugs.webkit.org/show_bug.cgi?id=36674 7 8 The scrolling check was based on the frameview's scrolloffset, and 9 maximumScrollPosition, which does not acknowledge the overflow properties. 10 11 I am now basing the scrolling off the scrollbar position. The scrollbars are 12 affected by the overflow properties indicating when not to scroll. The scrollbar 13 positions also continue to work for CSS ::-webkit-scrollbar styles. 14 15 * Api/qwebframe.cpp: 16 (qtwebkit_webframe_scrollRecursively): 17 1 18 2010-04-07 Andrey Kosyakov <caseq@chromium.org> 2 19
Note: See TracChangeset
for help on using the changeset viewer.