summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/page/qt/EventHandlerQt.cpp2
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp9
-rw-r--r--Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h2
-rw-r--r--Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp10
-rw-r--r--Source/WebCore/platform/qt/UserAgentQt.cpp2
-rw-r--r--Source/WebCore/platform/text/BidiResolver.h2
-rw-r--r--Source/WebCore/platform/text/BidiRunList.h4
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp11
-rw-r--r--Source/WebCore/rendering/style/SVGRenderStyle.cpp5
-rw-r--r--Source/WebCore/xml/XMLHttpRequest.cpp1
-rw-r--r--Source/WebKit/qt/Api/qwebelement.cpp9
-rw-r--r--Source/WebKit/qt/Api/qwebsecurityorigin.cpp2
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebframe.cpp16
-rw-r--r--Source/WebKit/qt/WidgetApi/qwebpage.cpp2
14 files changed, 57 insertions, 20 deletions
diff --git a/Source/WebCore/page/qt/EventHandlerQt.cpp b/Source/WebCore/page/qt/EventHandlerQt.cpp
index f45f81dc7..4bdf95673 100644
--- a/Source/WebCore/page/qt/EventHandlerQt.cpp
+++ b/Source/WebCore/page/qt/EventHandlerQt.cpp
@@ -52,7 +52,7 @@
namespace WebCore {
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_OSX)
const double EventHandler::TextDragDelay = 0.15;
#else
const double EventHandler::TextDragDelay = 0.0;
diff --git a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index f8a929c3f..a796284c5 100644
--- a/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -196,9 +196,12 @@ void ImageBuffer::putByteArray(Multiply multiplied, Uint8ClampedArray* source, c
static bool encodeImage(const QPixmap& pixmap, const String& format, const double* quality, QByteArray& data)
{
- int compressionQuality = 100;
- if (quality && *quality >= 0.0 && *quality <= 1.0)
- compressionQuality = static_cast<int>(*quality * 100 + 0.5);
+ int compressionQuality = -1;
+ if (format == "jpeg" || format == "webp") {
+ compressionQuality = 100;
+ if (quality && *quality >= 0.0 && *quality <= 1.0)
+ compressionQuality = static_cast<int>(*quality * 100 + 0.5);
+ }
QBuffer buffer(&data);
buffer.open(QBuffer::WriteOnly);
diff --git a/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h b/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
index f447cc206..647c4efa5 100644
--- a/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
+++ b/Source/WebCore/platform/network/qt/SocketStreamHandlePrivate.h
@@ -60,7 +60,7 @@ public Q_SLOTS:
void socketError(QAbstractSocket::SocketError);
void socketClosedCallback();
void socketErrorCallback(int);
-#ifndef QT_NO_OPENSSL
+#ifndef QT_NO_SSL
void socketSslErrors(const QList<QSslError>&);
#endif
public:
diff --git a/Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp b/Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
index ca7b60cd2..cd711907e 100644
--- a/Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
+++ b/Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
@@ -48,7 +48,7 @@ SocketStreamHandlePrivate::SocketStreamHandlePrivate(SocketStreamHandle* streamH
bool isSecure = url.protocolIs("wss");
if (isSecure) {
-#ifndef QT_NO_OPENSSL
+#ifndef QT_NO_SSL
m_socket = new QSslSocket(this);
#endif
} else
@@ -63,7 +63,7 @@ SocketStreamHandlePrivate::SocketStreamHandlePrivate(SocketStreamHandle* streamH
QString host = url.host();
if (isSecure) {
-#ifndef QT_NO_OPENSSL
+#ifndef QT_NO_SSL
static_cast<QSslSocket*>(m_socket)->connectToHostEncrypted(host, port);
#endif
} else
@@ -88,7 +88,7 @@ void SocketStreamHandlePrivate::initConnections()
connect(m_socket, SIGNAL(readyRead()), this, SLOT(socketReadyRead()));
connect(m_socket, SIGNAL(disconnected()), this, SLOT(socketClosed()));
connect(m_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
-#ifndef QT_NO_OPENSSL
+#ifndef QT_NO_SSL
if (qobject_cast<QSslSocket*>(m_socket))
connect(m_socket, SIGNAL(sslErrors(const QList<QSslError>&)), this, SLOT(socketSslErrors(const QList<QSslError>&)));
#endif
@@ -127,7 +127,7 @@ int SocketStreamHandlePrivate::send(const char* data, int len)
void SocketStreamHandlePrivate::close()
{
- if (m_streamHandle && m_streamHandle->m_state == SocketStreamHandleBase::Connecting) {
+ if (m_socket && m_streamHandle && m_streamHandle->m_state == SocketStreamHandleBase::Connecting) {
m_socket->abort();
m_streamHandle->client()->didCloseSocketStream(m_streamHandle);
return;
@@ -176,7 +176,7 @@ void SocketStreamHandlePrivate::socketErrorCallback(int error)
}
}
-#ifndef QT_NO_OPENSSL
+#ifndef QT_NO_SSL
void SocketStreamHandlePrivate::socketSslErrors(const QList<QSslError>& error)
{
QMetaObject::invokeMethod(this, "socketErrorCallback", Qt::QueuedConnection, Q_ARG(int, error[0].error()));
diff --git a/Source/WebCore/platform/qt/UserAgentQt.cpp b/Source/WebCore/platform/qt/UserAgentQt.cpp
index 6f1da23c9..80996a223 100644
--- a/Source/WebCore/platform/qt/UserAgentQt.cpp
+++ b/Source/WebCore/platform/qt/UserAgentQt.cpp
@@ -74,7 +74,7 @@ String UserAgentQt::standardUserAgent(const String &applicationNameForUserAgent,
// Security strength.
QString securityStrength;
-#if defined(QT_NO_OPENSSL)
+#if defined(QT_NO_SSL)
securityStrength = QLatin1String("N; ");
#endif
ua = ua.arg(securityStrength);
diff --git a/Source/WebCore/platform/text/BidiResolver.h b/Source/WebCore/platform/text/BidiResolver.h
index e0649fcb4..d970eaa4d 100644
--- a/Source/WebCore/platform/text/BidiResolver.h
+++ b/Source/WebCore/platform/text/BidiResolver.h
@@ -546,7 +546,7 @@ void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, Vis
m_direction = override == VisualLeftToRightOverride ? LeftToRight : RightToLeft;
appendRun();
m_runs.setLogicallyLastRun(m_runs.lastRun());
- if (override == VisualRightToLeftOverride)
+ if (override == VisualRightToLeftOverride && m_runs.runCount())
m_runs.reverseRuns(0, m_runs.runCount() - 1);
return;
}
diff --git a/Source/WebCore/platform/text/BidiRunList.h b/Source/WebCore/platform/text/BidiRunList.h
index d6db7ee49..c5d6ba648 100644
--- a/Source/WebCore/platform/text/BidiRunList.h
+++ b/Source/WebCore/platform/text/BidiRunList.h
@@ -193,9 +193,7 @@ void BidiRunList<Run>::deleteRuns()
curr = s;
}
- m_firstRun = 0;
- m_lastRun = 0;
- m_runCount = 0;
+ clearWithoutDestroyingRuns();
}
template <class Run>
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 03b81ac9a..355a4f958 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -2680,6 +2680,17 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());
availableHeight = max<LayoutUnit>(0, contentBoxHeight);
}
+ } else if (cbstyle->logicalHeight().isViewportPercentage()) {
+ LayoutUnit heightWithScrollbar = valueForLength(cbstyle->logicalHeight(), 0, view());
+ if (heightWithScrollbar != -1) {
+ LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar);
+ // We need to adjust for min/max height because this method does
+ // not handle the min/max of the current block, its caller does.
+ // So the return value from the recursive call will not have been
+ // adjusted yet.
+ LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight());
+ availableHeight = std::max<LayoutUnit>(0, contentBoxHeight);
+ }
} else if (isOutOfFlowPositionedWithSpecifiedHeight) {
// Don't allow this to affect the block' height() member variable, since this
// can get called while the block is still laying out its kids.
diff --git a/Source/WebCore/rendering/style/SVGRenderStyle.cpp b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
index cbd16cd42..aca245aef 100644
--- a/Source/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/Source/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -183,7 +183,10 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
|| stroke->paintUri != other->stroke->paintUri
|| stroke->miterLimit != other->stroke->miterLimit
|| stroke->dashArray != other->stroke->dashArray
- || stroke->dashOffset != other->stroke->dashOffset)
+ || stroke->dashOffset != other->stroke->dashOffset
+ || stroke->visitedLinkPaintColor != other->stroke->visitedLinkPaintColor
+ || stroke->visitedLinkPaintUri != other->stroke->visitedLinkPaintUri
+ || stroke->visitedLinkPaintType != other->stroke->visitedLinkPaintType)
return StyleDifferenceLayout;
// Only the stroke-opacity case remains, where we only need a repaint.
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index 853ec4756..e854019bc 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -104,6 +104,7 @@ XMLHttpRequestStaticData::XMLHttpRequestStaticData()
m_forbiddenRequestHeaders.add("cookie");
m_forbiddenRequestHeaders.add("cookie2");
m_forbiddenRequestHeaders.add("date");
+ m_forbiddenRequestHeaders.add("dnt");
m_forbiddenRequestHeaders.add("expect");
m_forbiddenRequestHeaders.add("host");
m_forbiddenRequestHeaders.add("keep-alive");
diff --git a/Source/WebKit/qt/Api/qwebelement.cpp b/Source/WebKit/qt/Api/qwebelement.cpp
index 26aedc1f5..8f54d4abc 100644
--- a/Source/WebKit/qt/Api/qwebelement.cpp
+++ b/Source/WebKit/qt/Api/qwebelement.cpp
@@ -740,7 +740,14 @@ static bool setupScriptContext(WebCore::Element* element, ScriptState*& state, S
}
/*!
- Executes \a scriptSource with this element as \c this object.
+ Executes \a scriptSource with this element as \c this object
+ and returns the result of the last executed statement.
+
+ \note This method may be very inefficient if \a scriptSource returns
+ a DOM element as a result. See \l{QWebFrame::evaluateJavaScript()}
+ for more details.
+
+ \sa QWebFrame::evaluateJavaScript()
*/
QVariant QWebElement::evaluateJavaScript(const QString& scriptSource)
{
diff --git a/Source/WebKit/qt/Api/qwebsecurityorigin.cpp b/Source/WebKit/qt/Api/qwebsecurityorigin.cpp
index 58fe79519..a76ee975c 100644
--- a/Source/WebKit/qt/Api/qwebsecurityorigin.cpp
+++ b/Source/WebKit/qt/Api/qwebsecurityorigin.cpp
@@ -224,7 +224,7 @@ QList<QWebDatabase> QWebSecurityOrigin::databases() const
to the \c file: scheme.
Cross domain restrictions depend on the two web settings QWebSettings::LocalContentCanAccessFileUrls
- and QWebSettings::LocalContentCanAccessFileUrls. By default all local schemes are concidered to be
+ and QWebSettings::LocalContentCanAccessRemoteUrls. By default all local schemes are considered to be
in the same security origin, and local schemes can not access remote content.
*/
void QWebSecurityOrigin::addLocalScheme(const QString& scheme)
diff --git a/Source/WebKit/qt/WidgetApi/qwebframe.cpp b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
index e8faab881..dd08725eb 100644
--- a/Source/WebKit/qt/WidgetApi/qwebframe.cpp
+++ b/Source/WebKit/qt/WidgetApi/qwebframe.cpp
@@ -910,7 +910,21 @@ void QWebFrame::print(QPrinter *printer) const
Evaluates the JavaScript defined by \a scriptSource using this frame as context
and returns the result of the last executed statement.
- \sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared()
+ \note This method may be very inefficient if \a scriptSource returns a DOM element
+ as a result. For example, evaluation of the next innocuously looking code may take
+ a lot of CPU and memory to execute:
+
+ \code
+ var img = document.createElement('img');
+ document.getElementById(\"foo\").appendChild(img);
+ \endcode
+
+ This code returns appended DOM element, which is converted to QVariantMap
+ containing all its properties. To avoid this issue you can add "true" after
+ the last statement.
+
+ \sa addToJavaScriptWindowObject(), javaScriptWindowObjectCleared(),
+ QWebElement::evaluateJavaScript()
*/
QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
{
diff --git a/Source/WebKit/qt/WidgetApi/qwebpage.cpp b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
index 02bddebda..863621391 100644
--- a/Source/WebKit/qt/WidgetApi/qwebpage.cpp
+++ b/Source/WebKit/qt/WidgetApi/qwebpage.cpp
@@ -410,7 +410,7 @@ bool QWebPagePrivate::errorPageExtension(QWebPageAdapter::ErrorPageOption *opt,
option.domain = QWebPage::QtNetwork;
else if (opt->domain == QLatin1String("HTTP"))
option.domain = QWebPage::Http;
- else if (opt->domain == QLatin1String("WebKit"))
+ else if (opt->domain == QLatin1String("WebKit") || opt->domain == QLatin1String("WebKitErrorDomain"))
option.domain = QWebPage::WebKit;
else
return false;