summaryrefslogtreecommitdiff
path: root/Source/WebKit/qt/Api
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit/qt/Api
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebKit/qt/Api')
-rw-r--r--Source/WebKit/qt/Api/qwebdatabase_p.h2
-rw-r--r--Source/WebKit/qt/Api/qwebelement.cpp17
-rw-r--r--Source/WebKit/qt/Api/qwebframe.cpp7
-rw-r--r--Source/WebKit/qt/Api/qwebframe_p.h2
-rw-r--r--Source/WebKit/qt/Api/qwebhistory.cpp2
-rw-r--r--Source/WebKit/qt/Api/qwebhistoryinterface.cpp2
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp22
-rw-r--r--Source/WebKit/qt/Api/qwebpage_p.h2
-rw-r--r--Source/WebKit/qt/Api/qwebsettings.cpp2
9 files changed, 26 insertions, 32 deletions
diff --git a/Source/WebKit/qt/Api/qwebdatabase_p.h b/Source/WebKit/qt/Api/qwebdatabase_p.h
index 298470442..80cb804a6 100644
--- a/Source/WebKit/qt/Api/qwebdatabase_p.h
+++ b/Source/WebKit/qt/Api/qwebdatabase_p.h
@@ -22,9 +22,9 @@
#include <QString>
#include <QtCore/qshareddata.h>
-#include "PlatformString.h"
#include "SecurityOrigin.h"
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
class QWebDatabasePrivate : public QSharedData {
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index a208cbc4e..298f6cdc3 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "qwebelement.h"
+#include "APICast.h"
#include "qwebelement_p.h"
#include "CSSComputedStyleDeclaration.h"
#include "CSSParser.h"
@@ -545,7 +546,7 @@ QRect QWebElement::geometry() const
{
if (!m_element)
return QRect();
- return m_element->getPixelSnappedRect();
+ return m_element->pixelSnappedBoundingBox();
}
/*!
@@ -750,16 +751,16 @@ QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
if (!setupScriptContext(m_element, thisValue, state, scriptController))
return QVariant();
- JSC::ScopeChainNode* scopeChain = state->dynamicGlobalObject()->globalScopeChain();
- JSC::UString script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
+ String script(reinterpret_cast_ptr<const UChar*>(scriptSource.data()), scriptSource.length());
JSC::JSValue evaluationException;
- JSC::JSValue evaluationResult = JSC::evaluate(state, scopeChain, JSC::makeSource(script), thisValue, &evaluationException);
+ JSC::JSValue evaluationResult = JSC::evaluate(state, JSC::makeSource(script), thisValue, &evaluationException);
if (evaluationException)
return QVariant();
int distance = 0;
- return JSC::Bindings::convertValueToQVariant(state, evaluationResult, QMetaType::Void, &distance);
+ JSValueRef* ignoredException = 0;
+ return JSC::Bindings::convertValueToQVariant(toRef(state), toRef(state, evaluationResult), QMetaType::Void, &distance, ignoredException);
}
/*!
@@ -1453,7 +1454,7 @@ void QWebElement::render(QPainter* painter, const QRect& clip)
view->updateLayoutAndStyleIfNeededRecursive();
- IntRect rect = e->getPixelSnappedRect();
+ IntRect rect = e->pixelSnappedBoundingBox();
if (rect.size().isEmpty())
return;
@@ -2046,7 +2047,7 @@ Element* QtWebElementRuntime::get(const QWebElement& element)
return element.m_element;
}
-static QVariant convertJSValueToWebElementVariant(JSC::JSObject* object, int *distance, HashSet<JSC::JSObject*>* visitedObjects)
+static QVariant convertJSValueToWebElementVariant(JSC::JSObject* object, int *distance, HashSet<JSObjectRef>* visitedObjects)
{
Element* element = 0;
QVariant ret;
@@ -2055,7 +2056,7 @@ static QVariant convertJSValueToWebElementVariant(JSC::JSObject* object, int *di
*distance = 0;
// Allow other objects to reach this one. This won't cause our algorithm to
// loop since when we find an Element we do not recurse.
- visitedObjects->remove(object);
+ visitedObjects->remove(toRef(object));
} else if (object && object->inherits(&JSDocument::s_info)) {
// To support TestRunnerQt::nodesFromRect(), used in DRT, we do an implicit
// conversion from 'document' to the QWebElement representing the 'document.documentElement'.
diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp
index 22e47c55d..8ac18f8e3 100644
--- a/Source/WebKit/qt/Api/qwebframe.cpp
+++ b/Source/WebKit/qt/Api/qwebframe.cpp
@@ -1406,7 +1406,7 @@ QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const
if (!d->frame->view() || !d->frame->contentRenderer())
return QWebHitTestResult();
- HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+ HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
if (result.scrollbar())
return QWebHitTestResult();
@@ -1534,8 +1534,9 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
if (proxy) {
int distance = 0;
JSC::JSValue v = d->frame->script()->executeScript(ScriptSourceCode(scriptSource)).jsValue();
-
- rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
+ JSC::ExecState* exec = proxy->globalObject(mainThreadNormalWorld())->globalExec();
+ JSValueRef* ignoredException = 0;
+ rc = JSC::Bindings::convertValueToQVariant(toRef(exec), toRef(exec, v), QMetaType::Void, &distance, ignoredException);
}
return rc;
}
diff --git a/Source/WebKit/qt/Api/qwebframe_p.h b/Source/WebKit/qt/Api/qwebframe_p.h
index 3201aaa57..d6779f2bc 100644
--- a/Source/WebKit/qt/Api/qwebframe_p.h
+++ b/Source/WebKit/qt/Api/qwebframe_p.h
@@ -27,7 +27,6 @@
#include "EventHandler.h"
#include "GraphicsContext.h"
#include "KURL.h"
-#include "PlatformString.h"
#if ENABLE(ORIENTATION_EVENTS)
#include "qorientationsensor.h"
#endif // ENABLE(ORIENTATION_EVENTS).
@@ -35,6 +34,7 @@
#include "wtf/RefPtr.h"
#include "Frame.h"
#include "ViewportArguments.h"
+#include <wtf/text/WTFString.h>
#if USE(ACCELERATED_COMPOSITING)
#include "texmap/TextureMapper.h"
diff --git a/Source/WebKit/qt/Api/qwebhistory.cpp b/Source/WebKit/qt/Api/qwebhistory.cpp
index 712c28f88..4bf63583b 100644
--- a/Source/WebKit/qt/Api/qwebhistory.cpp
+++ b/Source/WebKit/qt/Api/qwebhistory.cpp
@@ -29,7 +29,7 @@
#include "KURL.h"
#include "Page.h"
#include "PageGroup.h"
-#include "PlatformString.h"
+#include <wtf/text/WTFString.h>
#include <QSharedData>
#include <QDebug>
diff --git a/Source/WebKit/qt/Api/qwebhistoryinterface.cpp b/Source/WebKit/qt/Api/qwebhistoryinterface.cpp
index 40ff5c99b..305ff6781 100644
--- a/Source/WebKit/qt/Api/qwebhistoryinterface.cpp
+++ b/Source/WebKit/qt/Api/qwebhistoryinterface.cpp
@@ -25,7 +25,7 @@
#include <QCoreApplication>
#include "PageGroup.h"
-#include "PlatformString.h"
+#include <wtf/text/WTFString.h>
static QWebHistoryInterface* default_interface;
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 08e86183a..e1c06515b 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -757,21 +757,13 @@ void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button)
{
#ifndef QT_NO_CLIPBOARD
if (QApplication::clipboard()->supportsSelection()) {
- bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
- Pasteboard::generalPasteboard()->setSelectionMode(true);
WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
- if (button == Qt::LeftButton) {
- if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
- Pasteboard::generalPasteboard()->writeSelection(focusFrame->editor()->selectedRange().get(), focusFrame->editor()->canSmartCopyOrDelete(), focusFrame);
- ev->setAccepted(true);
- }
- } else if (button == Qt::MidButton) {
- if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
- focusFrame->editor()->paste();
+ if (button == Qt::MidButton) {
+ if (focusFrame) {
+ focusFrame->editor()->command(AtomicString("PasteGlobalSelection")).execute();
ev->setAccepted(true);
}
}
- Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
}
#endif
}
@@ -808,7 +800,7 @@ void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button, const QPo
QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
- HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos), false);
+ HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos));
if (result.isContentEditable()) {
QEvent event(QEvent::RequestSoftwareInputPanel);
QApplication::sendEvent(client->ownerWidget(), &event);
@@ -1565,7 +1557,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
int x = touchPoint.x();
int y = touchPoint.y();
- RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding, false /*ignoreClipping*/, false /*allowShadowContent*/);
+ RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding);
if (!intersectedNodes)
return IntPoint();
@@ -1585,7 +1577,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
if (!currentElement || (!isClickableElement(currentElement, 0) && !isValidFrameOwner(currentElement)))
continue;
- IntRect currentElementBoundingRect = currentElement->getPixelSnappedRect();
+ IntRect currentElementBoundingRect = currentElement->pixelSnappedBoundingBox();
currentElementBoundingRect.intersect(touchRect);
if (currentElementBoundingRect.isEmpty())
@@ -3371,7 +3363,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
d->createMainFrame();
WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
- HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
+ HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos));
if (result.scrollbar())
d->hitTestResult = QWebHitTestResult();
else
diff --git a/Source/WebKit/qt/Api/qwebpage_p.h b/Source/WebKit/qt/Api/qwebpage_p.h
index ca3aa94ad..a8e373bca 100644
--- a/Source/WebKit/qt/Api/qwebpage_p.h
+++ b/Source/WebKit/qt/Api/qwebpage_p.h
@@ -34,10 +34,10 @@
#include "IntPoint.h"
#include "KURL.h"
-#include "PlatformString.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
#include "ViewportArguments.h"
diff --git a/Source/WebKit/qt/Api/qwebsettings.cpp b/Source/WebKit/qt/Api/qwebsettings.cpp
index 741457f47..0f504f817 100644
--- a/Source/WebKit/qt/Api/qwebsettings.cpp
+++ b/Source/WebKit/qt/Api/qwebsettings.cpp
@@ -36,7 +36,6 @@
#include "PageCache.h"
#include "Settings.h"
#include "KURL.h"
-#include "PlatformString.h"
#include "IconDatabase.h"
#include "PluginDatabase.h"
#include "Image.h"
@@ -44,6 +43,7 @@
#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
#include "FileSystem.h"
+#include <wtf/text/WTFString.h>
#include <QApplication>
#include <QStandardPaths>