summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/Api
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/Api')
-rw-r--r--WebKit/qt/Api/DerivedSources.pro6
-rw-r--r--WebKit/qt/Api/qwebframe.cpp29
-rw-r--r--WebKit/qt/Api/qwebpage.cpp60
-rw-r--r--WebKit/qt/Api/qwebpage.h2
4 files changed, 87 insertions, 10 deletions
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro
index 389fb5f..22d4c8d 100644
--- a/WebKit/qt/Api/DerivedSources.pro
+++ b/WebKit/qt/Api/DerivedSources.pro
@@ -28,7 +28,7 @@ qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MOD
qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} &&
WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit
-regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)"
+regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)"
for(HEADER, WEBKIT_API_HEADERS) {
# 1. Append to QtWebKit header that includes all other header files
@@ -70,7 +70,7 @@ for(HEADER, WEBKIT_API_HEADERS) {
res = $$find(src, $$regex)
isEmpty(res):break()
- exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1")
+ exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1")
eval($$exp)
CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}"
@@ -87,7 +87,7 @@ for(HEADER, WEBKIT_API_HEADERS) {
# Qt's QRegExp does not support inline non-greedy matching,
# so we'll have to work around it by updating the haystack
- src = $$replace(src, $$regex, "\2")
+ src = $$replace(src, $$regex, "\\2")
src_words = $$join(src, $${LITERAL_WHITESPACE})
}
}
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 4b12545..7a28f83 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -55,6 +55,7 @@
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
#include "Scrollbar.h"
+#include "Settings.h"
#include "SelectionController.h"
#include "SubstituteData.h"
#include "SVGSMILElement.h"
@@ -1079,7 +1080,11 @@ void QWebFrame::render(QPainter* painter)
*/
void QWebFrame::setTextSizeMultiplier(qreal factor)
{
- d->frame->setZoomFactor(factor, ZoomTextOnly);
+ FrameView* view = d->frame->view();
+ if (!view)
+ return;
+
+ view->setZoomFactor(factor, ZoomTextOnly);
}
/*!
@@ -1087,7 +1092,11 @@ void QWebFrame::setTextSizeMultiplier(qreal factor)
*/
qreal QWebFrame::textSizeMultiplier() const
{
- return d->frame->zoomFactor();
+ FrameView* view = d->frame->view();
+ if (!view)
+ return 1;
+
+ return view->zoomFactor();
}
/*!
@@ -1098,12 +1107,24 @@ qreal QWebFrame::textSizeMultiplier() const
void QWebFrame::setZoomFactor(qreal factor)
{
- d->frame->setZoomFactor(factor, d->frame->zoomMode());
+ Page* page = d->frame->page();
+ if (!page)
+ return;
+
+ FrameView* view = d->frame->view();
+ if (!view)
+ return;
+
+ view->setZoomFactor(factor, page->settings()->zoomMode());
}
qreal QWebFrame::zoomFactor() const
{
- return d->frame->zoomFactor();
+ FrameView* view = d->frame->view();
+ if (!view)
+ return 1;
+
+ return view->zoomFactor();
}
/*!
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 1ae8e35..0e9d92f 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -299,7 +299,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
PageGroup::setShouldTrackVisitedLinks(true);
#if ENABLE(NOTIFICATIONS)
- notificationPresenterClient = new NotificationPresenterClientQt();
+ notificationPresenterClient = new NotificationPresenterClientQt(q);
#endif
}
@@ -1220,7 +1220,42 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev
} else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") {
double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble();
q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay);
+ }
+#if ENABLE(TILED_BACKING_STORE)
+ else if (event->propertyName() == "_q_TiledBackingStoreTileSize") {
+ WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
+ if (!frame->tiledBackingStore())
+ return;
+ QSize tileSize = q->property("_q_TiledBackingStoreTileSize").toSize();
+ frame->tiledBackingStore()->setTileSize(tileSize);
+ } else if (event->propertyName() == "_q_TiledBackingStoreTileCreationDelay") {
+ WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
+ if (!frame->tiledBackingStore())
+ return;
+ int tileCreationDelay = q->property("_q_TiledBackingStoreTileCreationDelay").toInt();
+ frame->tiledBackingStore()->setTileCreationDelay(static_cast<double>(tileCreationDelay) / 1000.);
+ } else if (event->propertyName() == "_q_TiledBackingStoreKeepAreaMultiplier") {
+ WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
+ if (!frame->tiledBackingStore())
+ return;
+ FloatSize keepMultiplier;
+ FloatSize coverMultiplier;
+ frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
+ QSizeF qSize = q->property("_q_TiledBackingStoreKeepAreaMultiplier").toSizeF();
+ keepMultiplier = FloatSize(qSize.width(), qSize.height());
+ frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
+ } else if (event->propertyName() == "_q_TiledBackingStoreCoverAreaMultiplier") {
+ WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
+ if (!frame->tiledBackingStore())
+ return;
+ FloatSize keepMultiplier;
+ FloatSize coverMultiplier;
+ frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
+ QSizeF qSize = q->property("_q_TiledBackingStoreCoverAreaMultiplier").toSizeF();
+ coverMultiplier = FloatSize(qSize.width(), qSize.height());
+ frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier);
}
+#endif
}
void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event)
@@ -1543,6 +1578,7 @@ InspectorController* QWebPagePrivate::inspectorController()
\value Back Navigate back in the history of navigated links.
\value Forward Navigate forward in the history of navigated links.
\value Stop Stop loading the current page.
+ \value StopScheduledPageRefresh Stop all pending page refresh/redirect requests.
\value Reload Reload the current page.
\value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6)
\value Cut Cut the content currently selected into the clipboard.
@@ -1948,6 +1984,15 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame)
}
}
+static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list)
+{
+ list << frame->childFrames();
+ QListIterator<QWebFrame*> it(frame->childFrames());
+ while (it.hasNext()) {
+ collectChildFrames(it.next(), list);
+ }
+}
+
/*!
This function can be called to trigger the specified \a action.
It is also called by QtWebKit if the user triggers the action, for example
@@ -2044,6 +2089,16 @@ void QWebPage::triggerAction(WebAction action, bool)
#endif
break;
}
+ case StopScheduledPageRefresh: {
+ QWebFrame* topFrame = mainFrame();
+ topFrame->d->frame->redirectScheduler()->cancel();
+ QList<QWebFrame*> childFrames;
+ collectChildFrames(topFrame, childFrames);
+ QListIterator<QWebFrame*> it(childFrames);
+ while (it.hasNext())
+ it.next()->d->frame->redirectScheduler()->cancel();
+ break;
+ }
default:
command = QWebPagePrivate::editorCommandForWebActions(action);
break;
@@ -2638,8 +2693,7 @@ void QWebPage::setContentEditable(bool editable)
frame->applyEditingStyleToBodyElement();
// FIXME: mac port calls this if there is no selectedDOMRange
//frame->setSelectionFromNone();
- } else
- frame->removeEditingStyleFromBodyElement();
+ }
}
d->updateEditorActions();
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index c085fd7..a4b555a 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -170,6 +170,8 @@ public:
AlignLeft,
AlignRight,
+ StopScheduledPageRefresh,
+
WebActionCount
};