summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-26 00:44:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-26 00:44:06 (GMT)
commit0eb54e11269e9f471efb592132b9bb423447ee43 (patch)
treeb779da759a5c33c981866abdf995f1291f884527 /src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
parentb14536650ace48c962e632ab287c347659091381 (diff)
parent9ef3be5d2e1b2777c2c79074d7d5efd89c653c7e (diff)
downloadQt-0eb54e11269e9f471efb592132b9bb423447ee43.zip
Qt-0eb54e11269e9f471efb592132b9bb423447ee43.tar.gz
Qt-0eb54e11269e9f471efb592132b9bb423447ee43.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-webkit: Updated WebKit to 807157e42add842605ec67d9363dd3f1861748ca
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index 44cc3b5..721aaa6 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -275,8 +275,9 @@ void QWEBKIT_EXPORT qt_drt_evaluateScriptInIsolatedWorld(QWebFrame* qFrame, int
JSC::JSValue result = frame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue();
}
-static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const QPoint& pos)
+bool QWEBKIT_EXPORT qtwebkit_webframe_scrollOverflow(QWebFrame* qFrame, int dx, int dy, const QPoint& pos)
{
+ WebCore::Frame* frame = QWebFramePrivate::core(qFrame);
if (!frame || !frame->document() || !frame->view() || !frame->eventHandler())
return false;
@@ -299,17 +300,24 @@ static bool webframe_scrollOverflow(WebCore::Frame* frame, int dx, int dy, const
bool scrolledHorizontal = false;
bool scrolledVertical = false;
- if (dx > 0)
- scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
- else if (dx < 0)
- scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+ do {
+ if (dx > 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollRight, ScrollByPixel, dx);
+ else if (dx < 0)
+ scrolledHorizontal = renderLayer->scroll(ScrollLeft, ScrollByPixel, qAbs(dx));
+
+ if (dy > 0)
+ scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
+ else if (dy < 0)
+ scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
- if (dy > 0)
- scrolledVertical = renderLayer->scroll(ScrollDown, ScrollByPixel, dy);
- else if (dy < 0)
- scrolledVertical = renderLayer->scroll(ScrollUp, ScrollByPixel, qAbs(dy));
+ if (scrolledHorizontal || scrolledVertical)
+ return true;
- return (scrolledHorizontal || scrolledVertical);
+ renderLayer = renderLayer->parent();
+ } while (renderLayer);
+
+ return false;
}
@@ -325,7 +333,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
if (!qFrame)
return;
- if (webframe_scrollOverflow(QWebFramePrivate::core(qFrame), dx, dy, pos))
+ if (qtwebkit_webframe_scrollOverflow(qFrame, dx, dy, pos))
return;
bool scrollHorizontal = false;
@@ -339,7 +347,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d
if (dy > 0) // scroll down
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical);
- else if (dy < 0) //scroll up
+ else if (dy < 0) //scroll up
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical);
if (scrollHorizontal || scrollVertical) {