summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebKit/chromium/src
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebKit/chromium/src')
-rw-r--r--Source/WebKit/chromium/src/ApplicationCacheHost.cpp3
-rw-r--r--Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp6
-rw-r--r--Source/WebKit/chromium/src/DeviceOrientationClientProxy.h6
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp6
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h1
-rwxr-xr-xSource/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp8
-rw-r--r--Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h1
-rw-r--r--Source/WebKit/chromium/src/InspectorClientImpl.h1
-rw-r--r--Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h2
-rw-r--r--Source/WebKit/chromium/src/WebCompositorImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebDeviceOrientation.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebDeviceOrientationController.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebHistoryItem.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebIDBKey.cpp11
-rw-r--r--Source/WebKit/chromium/src/WebIDBKeyRange.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebIDBMetadata.cpp88
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebImageLayer.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebLayer.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebOptionElement.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.cpp37
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.h5
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp65
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h2
35 files changed, 272 insertions, 47 deletions
diff --git a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
index bbf740dfd..2b6a47707 100644
--- a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -299,7 +299,8 @@ bool ApplicationCacheHost::swapCache()
void ApplicationCacheHost::abort()
{
- // FIXME: See https://bugs.webkit.org/show_bug.cgi?id=76270
+ if (m_internal)
+ m_internal->m_outerHost->abort();
}
bool ApplicationCacheHost::isApplicationCacheEnabled()
diff --git a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
index 29b43ba56..f1f0b33f9 100644
--- a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
+++ b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp
@@ -26,7 +26,7 @@
#include "config.h"
#include "DeviceOrientationClientProxy.h"
-#include "DeviceOrientation.h"
+#include "DeviceOrientationData.h"
#include "WebDeviceOrientation.h"
#include "WebDeviceOrientationController.h"
#include <wtf/OwnPtr.h>
@@ -60,12 +60,12 @@ void DeviceOrientationClientProxy::stopUpdating()
m_client->stopUpdating();
}
-WebCore::DeviceOrientation* DeviceOrientationClientProxy::lastOrientation() const
+WebCore::DeviceOrientationData* DeviceOrientationClientProxy::lastOrientation() const
{
if (!m_client)
return 0;
- // Cache the DeviceOrientation pointer so its reference count does not drop to zero upon return.
+ // Cache the DeviceOrientationData pointer so its reference count does not drop to zero upon return.
m_lastOrientation = m_client->lastOrientation();
return m_lastOrientation.get();
diff --git a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h
index 73fd3e2a0..eddb3d29d 100644
--- a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h
+++ b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h
@@ -26,8 +26,8 @@
#ifndef DeviceOrientationClientProxy_h
#define DeviceOrientationClientProxy_h
-#include "DeviceOrientation.h"
#include "DeviceOrientationClient.h"
+#include "DeviceOrientationData.h"
#include "WebDeviceOrientationClient.h"
#include <wtf/RefPtr.h>
@@ -47,12 +47,12 @@ public:
virtual void setController(WebCore::DeviceOrientationController*) OVERRIDE;
virtual void startUpdating() OVERRIDE;
virtual void stopUpdating() OVERRIDE;
- virtual WebCore::DeviceOrientation* lastOrientation() const OVERRIDE;
+ virtual WebCore::DeviceOrientationData* lastOrientation() const OVERRIDE;
virtual void deviceOrientationControllerDestroyed() OVERRIDE;
private:
WebDeviceOrientationClient* m_client;
- mutable RefPtr<WebCore::DeviceOrientation> m_lastOrientation;
+ mutable RefPtr<WebCore::DeviceOrientationData> m_lastOrientation;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
index 58661ebab..107ec63b3 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
@@ -31,6 +31,7 @@
#include "DOMStringList.h"
#include "IDBCallbacks.h"
#include "IDBDatabaseCallbacks.h"
+#include "IDBMetadata.h"
#include "IDBObjectStoreBackendProxy.h"
#include "IDBTransactionBackendProxy.h"
#include "WebDOMStringList.h"
@@ -60,6 +61,11 @@ IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy()
{
}
+IDBDatabaseMetadata IDBDatabaseBackendProxy::metadata() const
+{
+ return m_webIDBDatabase->metadata();
+}
+
String IDBDatabaseBackendProxy::name() const
{
return m_webIDBDatabase->name();
diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
index e817edf19..b05552ccb 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
@@ -42,6 +42,7 @@ public:
static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>);
virtual ~IDBDatabaseBackendProxy();
+ virtual WebCore::IDBDatabaseMetadata metadata() const;
virtual String name() const;
virtual String version() const;
virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const;
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
index c03b2f13b..9ca777bc9 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
@@ -95,14 +95,6 @@ void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, Pa
m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
-void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
-{
- // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
- // all implementations of IDB interfaces are proxy objects.
- IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- m_webIDBObjectStore->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
-}
-
void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
index 5d6796c64..c6da74cf1 100644
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
@@ -50,7 +50,6 @@ public:
virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
- virtual void deleteFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void deleteFunction(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.h b/Source/WebKit/chromium/src/InspectorClientImpl.h
index 6cb5c5544..5ea6baeb3 100644
--- a/Source/WebKit/chromium/src/InspectorClientImpl.h
+++ b/Source/WebKit/chromium/src/InspectorClientImpl.h
@@ -59,6 +59,7 @@ public:
virtual bool sendMessageToFrontend(const WTF::String&);
+ virtual bool supportsInspectorStateUpdates() const { return true; }
virtual void updateInspectorStateCookie(const WTF::String&);
virtual bool canClearBrowserCache();
diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp
index cd35b2620..0888e3033 100644
--- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp
+++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp
@@ -55,13 +55,13 @@ PassOwnPtr<SpeechRecognitionClientProxy> SpeechRecognitionClientProxy::create(We
return adoptPtr(new SpeechRecognitionClientProxy(recognizer));
}
-void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous)
+void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous, unsigned long maxAlternatives)
{
WebVector<WebSpeechGrammar> webSpeechGrammars(static_cast<size_t>(grammarList->length()));
for (unsigned long i = 0; i < grammarList->length(); ++i)
webSpeechGrammars[i] = grammarList->item(i);
- WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin()));
+ WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, maxAlternatives, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin()));
m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this);
}
diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h
index 0c3ecebaa..8063e71ed 100644
--- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h
+++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h
@@ -46,7 +46,7 @@ public:
static PassOwnPtr<SpeechRecognitionClientProxy> create(WebSpeechRecognizer*);
// WebCore::SpeechRecognitionClient:
- virtual void start(WebCore::SpeechRecognition*, const WebCore::SpeechGrammarList*, const String& lang, bool continuous) OVERRIDE;
+ virtual void start(WebCore::SpeechRecognition*, const WebCore::SpeechGrammarList*, const String& lang, bool continuous, unsigned long maxAlternatives) OVERRIDE;
virtual void stop(WebCore::SpeechRecognition*) OVERRIDE;
virtual void abort(WebCore::SpeechRecognition*) OVERRIDE;
diff --git a/Source/WebKit/chromium/src/WebCompositorImpl.cpp b/Source/WebKit/chromium/src/WebCompositorImpl.cpp
index f4e96e0be..369ae555a 100644
--- a/Source/WebKit/chromium/src/WebCompositorImpl.cpp
+++ b/Source/WebKit/chromium/src/WebCompositorImpl.cpp
@@ -28,6 +28,7 @@
#include "WebCompositorImpl.h"
#include "CCThreadImpl.h"
+#include "GraphicsContext3D.h"
#include "WebKit.h"
#include "platform/WebKitPlatformSupport.h"
#include "WebCompositorClient.h"
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
index edbee1471..6b5247617 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -94,6 +94,7 @@ public:
virtual void bringFrontendToFront();
virtual void highlight();
virtual void hideHighlight();
+ virtual bool supportsInspectorStateUpdates() const { return true; }
virtual void updateInspectorStateCookie(const WTF::String&);
virtual bool sendMessageToFrontend(const WTF::String&);
diff --git a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp
index d7a282f35..24f7bc801 100644
--- a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp
+++ b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp
@@ -26,12 +26,12 @@
#include "config.h"
#include "WebDeviceOrientation.h"
-#include "DeviceOrientation.h"
+#include "DeviceOrientationData.h"
#include <wtf/PassRefPtr.h>
namespace WebKit {
-WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientation* orientation)
+WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientationData* orientation)
{
if (!orientation) {
m_isNull = true;
@@ -57,7 +57,7 @@ WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientation* ori
m_absolute = orientation->absolute();
}
-WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrientation* orientation)
+WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrientationData* orientation)
{
if (!orientation) {
m_isNull = true;
@@ -84,11 +84,11 @@ WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrien
return *this;
}
-WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientation>() const
+WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientationData>() const
{
if (m_isNull)
return 0;
- return WebCore::DeviceOrientation::create(m_canProvideAlpha, m_alpha, m_canProvideBeta, m_beta, m_canProvideGamma, m_gamma, m_canProvideAbsolute, m_absolute);
+ return WebCore::DeviceOrientationData::create(m_canProvideAlpha, m_alpha, m_canProvideBeta, m_beta, m_canProvideGamma, m_gamma, m_canProvideAbsolute, m_absolute);
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp b/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp
index 7d09a6e7d..0b9ee88e9 100644
--- a/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp
+++ b/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp
@@ -26,8 +26,8 @@
#include "config.h"
#include "WebDeviceOrientationController.h"
-#include "DeviceOrientation.h"
#include "DeviceOrientationController.h"
+#include "DeviceOrientationData.h"
#include "WebDeviceOrientation.h"
#include <wtf/PassRefPtr.h>
@@ -35,7 +35,7 @@ namespace WebKit {
void WebDeviceOrientationController::didChangeDeviceOrientation(const WebDeviceOrientation& orientation)
{
- RefPtr<WebCore::DeviceOrientation> deviceOrientation = PassRefPtr<WebCore::DeviceOrientation>(orientation);
+ RefPtr<WebCore::DeviceOrientationData> deviceOrientation = PassRefPtr<WebCore::DeviceOrientationData>(orientation);
m_controller->didChangeDeviceOrientation(deviceOrientation.get());
}
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index 88fd9f61d..8ccec72b1 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1162,7 +1162,7 @@ void WebFrameImpl::replaceSelection(const WebString& text)
{
bool selectReplacement = false;
bool smartReplace = true;
- return frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
+ frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace);
}
void WebFrameImpl::insertText(const WebString& text)
diff --git a/Source/WebKit/chromium/src/WebHistoryItem.cpp b/Source/WebKit/chromium/src/WebHistoryItem.cpp
index 27dbc44c2..db35317ad 100644
--- a/Source/WebKit/chromium/src/WebHistoryItem.cpp
+++ b/Source/WebKit/chromium/src/WebHistoryItem.cpp
@@ -173,7 +173,7 @@ float WebHistoryItem::pageScaleFactor() const
void WebHistoryItem::setPageScaleFactor(float scale)
{
ensureMutable();
- return m_private->setPageScaleFactor(scale);
+ m_private->setPageScaleFactor(scale);
}
bool WebHistoryItem::isTargetItem() const
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index 2662f801f..39803e145 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -32,9 +32,11 @@
#include "IDBCallbacksProxy.h"
#include "IDBDatabaseBackendInterface.h"
#include "IDBDatabaseCallbacksProxy.h"
+#include "IDBMetadata.h"
#include "IDBTransactionBackendInterface.h"
#include "WebIDBCallbacks.h"
#include "WebIDBDatabaseCallbacks.h"
+#include "WebIDBMetadata.h"
#include "WebIDBObjectStoreImpl.h"
#include "WebIDBTransactionImpl.h"
@@ -51,6 +53,11 @@ WebIDBDatabaseImpl::~WebIDBDatabaseImpl()
{
}
+WebIDBMetadata WebIDBDatabaseImpl::metadata() const
+{
+ return m_databaseBackend->metadata();
+}
+
WebString WebIDBDatabaseImpl::name() const
{
return m_databaseBackend->name();
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
index 190d7e2dc..5e989e00e 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -40,6 +40,7 @@ namespace WebKit {
class IDBDatabaseCallbacksProxy;
class WebIDBDatabaseCallbacks;
+class WebIDBDatabaseMetadata;
class WebIDBObjectStore;
class WebIDBTransaction;
@@ -49,6 +50,7 @@ public:
WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>);
virtual ~WebIDBDatabaseImpl();
+ virtual WebIDBMetadata metadata() const;
virtual WebString name() const;
virtual WebString version() const;
virtual WebDOMStringList objectStoreNames() const;
diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp
index 25be6c52f..cfadafbac 100644
--- a/Source/WebKit/chromium/src/WebIDBKey.cpp
+++ b/Source/WebKit/chromium/src/WebIDBKey.cpp
@@ -120,6 +120,8 @@ static PassRefPtr<IDBKey> convertFromWebIDBKeyArray(const WebVector<WebIDBKey>&
keys.append(IDBKey::createNumber(array[i].number()));
break;
case WebIDBKey::InvalidType:
+ keys.append(IDBKey::createInvalid());
+ break;
case WebIDBKey::NullType:
ASSERT_NOT_REACHED();
break;
@@ -149,6 +151,8 @@ static void convertToWebIDBKeyArray(const IDBKey::KeyArray& array, WebVector<Web
keys[i] = WebIDBKey::createNumber(key->number());
break;
case IDBKey::InvalidType:
+ keys[i] = WebIDBKey::createInvalid();
+ break;
case IDBKey::MinType:
ASSERT_NOT_REACHED();
break;
@@ -199,6 +203,13 @@ WebIDBKey::Type WebIDBKey::type() const
return Type(m_private->type());
}
+bool WebIDBKey::isValid() const
+{
+ if (!m_private.get())
+ return false;
+ return m_private->isValid();
+}
+
WebVector<WebIDBKey> WebIDBKey::array() const
{
WebVector<WebIDBKey> keys;
diff --git a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp
index fef0d3c3d..419261c22 100644
--- a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp
+++ b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp
@@ -43,7 +43,7 @@ void WebIDBKeyRange::assign(const WebIDBKeyRange& other)
void WebIDBKeyRange::assign(const WebIDBKey& lower, const WebIDBKey& upper, bool lowerOpen, bool upperOpen)
{
- if (lower.type() == WebIDBKey::InvalidType && upper.type() == WebIDBKey::InvalidType)
+ if (!lower.isValid() && !upper.isValid())
m_private = 0;
else
m_private = IDBKeyRange::create(lower, upper, lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed, upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed);
diff --git a/Source/WebKit/chromium/src/WebIDBMetadata.cpp b/Source/WebKit/chromium/src/WebIDBMetadata.cpp
new file mode 100644
index 000000000..735063ef0
--- /dev/null
+++ b/Source/WebKit/chromium/src/WebIDBMetadata.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebIDBMetadata.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBMetadata.h"
+#include "WebIDBKeyPath.h"
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebIDBMetadata::WebIDBMetadata(const WebCore::IDBDatabaseMetadata& metadata)
+{
+ name = metadata.name;
+ version = metadata.version;
+ objectStores = WebVector<ObjectStore>(static_cast<size_t>(metadata.objectStores.size()));
+
+ size_t i = 0;
+ for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator storeIterator = metadata.objectStores.begin(); storeIterator != metadata.objectStores.end(); ++storeIterator) {
+ const IDBObjectStoreMetadata& objectStore = storeIterator->second;
+ ObjectStore webObjectStore;
+ webObjectStore.name = objectStore.name;
+ webObjectStore.keyPath = objectStore.keyPath;
+ webObjectStore.autoIncrement = objectStore.autoIncrement;
+ webObjectStore.indexes = WebVector<Index>(static_cast<size_t>(objectStore.indexes.size()));
+
+ size_t j = 0;
+ for (IDBObjectStoreMetadata::IndexMap::const_iterator indexIterator = objectStore.indexes.begin(); indexIterator != objectStore.indexes.end(); ++indexIterator) {
+ const IDBIndexMetadata& index = indexIterator->second;
+ Index webIndex;
+ webIndex.name = index.name;
+ webIndex.keyPath = index.keyPath;
+ webIndex.unique = index.unique;
+ webIndex.multiEntry = index.multiEntry;
+ webObjectStore.indexes[j++] = webIndex;
+ }
+ objectStores[i++] = webObjectStore;
+ }
+}
+
+WebIDBMetadata::operator IDBDatabaseMetadata() const
+{
+ IDBDatabaseMetadata db(name, version);
+ for (size_t i = 0; i < objectStores.size(); ++i) {
+ const ObjectStore webObjectStore = objectStores[i];
+ IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.keyPath, webObjectStore.autoIncrement);
+
+ for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) {
+ const Index webIndex = webObjectStore.indexes[j];
+ IDBIndexMetadata index(webIndex.name, webIndex.keyPath, webIndex.unique, webIndex.multiEntry);
+ objectStore.indexes.set(index.name, index);
+ }
+ db.objectStores.set(objectStore.name, objectStore);
+ }
+ return db;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INDEXED_DATABASE)
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index ebd7ae945..4c45be2f9 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -83,11 +83,6 @@ void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const Web
m_objectStore->put(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
}
-void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
-{
- m_objectStore->deleteFunction(key, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
-}
-
void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
m_objectStore->deleteFunction(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index 91aee7833..1bffd562b 100644
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -52,7 +52,6 @@ public:
void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
- void deleteFunction(const WebIDBKey&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebImageLayer.cpp b/Source/WebKit/chromium/src/WebImageLayer.cpp
index 93dbf3930..f76151530 100644
--- a/Source/WebKit/chromium/src/WebImageLayer.cpp
+++ b/Source/WebKit/chromium/src/WebImageLayer.cpp
@@ -42,7 +42,7 @@ WebImageLayer::WebImageLayer(PassRefPtr<WebCore::ImageLayerChromium> layer)
void WebImageLayer::setBitmap(SkBitmap bitmap)
{
- return unwrap<WebCore::ImageLayerChromium>()->setBitmap(bitmap);
+ unwrap<WebCore::ImageLayerChromium>()->setBitmap(bitmap);
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebLayer.cpp b/Source/WebKit/chromium/src/WebLayer.cpp
index 6b1029814..25cb5868c 100644
--- a/Source/WebKit/chromium/src/WebLayer.cpp
+++ b/Source/WebKit/chromium/src/WebLayer.cpp
@@ -187,7 +187,7 @@ bool WebLayer::masksToBounds() const
void WebLayer::setMaskLayer(const WebLayer& maskLayer)
{
WebLayer ref = maskLayer;
- return m_private->setMaskLayer(ref.unwrap<LayerChromium>());
+ m_private->setMaskLayer(ref.unwrap<LayerChromium>());
}
WebLayer WebLayer::maskLayer() const
@@ -270,6 +270,11 @@ void WebLayer::setPreserves3D(bool preserve3D)
m_private->setPreserves3D(preserve3D);
}
+void WebLayer::setUseParentBackfaceVisibility(bool useParentBackfaceVisibility)
+{
+ m_private->setUseParentBackfaceVisibility(useParentBackfaceVisibility);
+}
+
void WebLayer::setBackgroundColor(WebColor color)
{
m_private->setBackgroundColor(color);
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index 47cc88310..356af1de2 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -27,7 +27,9 @@
#include "platform/WebLayerTreeView.h"
#include "GraphicsContext3DPrivate.h"
+#include "LayerChromium.h"
#include "WebLayerTreeViewImpl.h"
+#include "cc/CCGraphicsContext.h"
#include "cc/CCLayerTreeHost.h"
#include "platform/WebLayer.h"
#include "platform/WebPoint.h"
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index 95186dd86..3ca9f5d0f 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -803,11 +803,13 @@ void WebMediaPlayerClientImpl::getSupportedTypes(HashSet<String>& supportedTypes
#if ENABLE(ENCRYPTED_MEDIA)
MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
const String& codecs,
- const String& keySystem)
+ const String& keySystem,
+ const KURL&)
{
#else
MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type,
- const String& codecs)
+ const String& codecs,
+ const KURL&)
{
String keySystem;
#endif
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
index 53a24d666..b3c94fe58 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
@@ -186,10 +186,10 @@ private:
static void getSupportedTypes(WTF::HashSet<WTF::String>&);
#if ENABLE(ENCRYPTED_MEDIA)
static WebCore::MediaPlayer::SupportsType supportsType(
- const WTF::String& type, const WTF::String& codecs, const String& keySystem);
+ const WTF::String& type, const WTF::String& codecs, const String& keySystem, const WebCore::KURL&);
#else
static WebCore::MediaPlayer::SupportsType supportsType(
- const WTF::String& type, const WTF::String& codecs);
+ const WTF::String& type, const WTF::String& codecs, const WebCore::KURL&);
#endif
#if USE(ACCELERATED_COMPOSITING)
bool acceleratedRenderingInUse();
diff --git a/Source/WebKit/chromium/src/WebOptionElement.cpp b/Source/WebKit/chromium/src/WebOptionElement.cpp
index c71f7b565..1d50a053e 100644
--- a/Source/WebKit/chromium/src/WebOptionElement.cpp
+++ b/Source/WebKit/chromium/src/WebOptionElement.cpp
@@ -44,7 +44,7 @@ namespace WebKit {
void WebOptionElement::setValue(const WebString& newValue)
{
- return unwrap<HTMLOptionElement>()->setValue(newValue);
+ unwrap<HTMLOptionElement>()->setValue(newValue);
}
WebString WebOptionElement::value() const
@@ -69,7 +69,7 @@ bool WebOptionElement::defaultSelected() const
void WebOptionElement::setDefaultSelected(bool newSelected)
{
- return unwrap<HTMLOptionElement>()->setAttribute(selectedAttr, newSelected ? "" : 0);
+ unwrap<HTMLOptionElement>()->setAttribute(selectedAttr, newSelected ? "" : 0);
}
WebString WebOptionElement::label() const
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
index e10e0ae81..040eb6384 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -71,6 +71,7 @@
#include "ScrollAnimator.h"
#include "ScrollView.h"
#include "ScrollbarTheme.h"
+#include "TouchEvent.h"
#include "UserGestureIndicator.h"
#include "WebPrintParams.h"
#include "WheelEvent.h"
@@ -185,6 +186,8 @@ void WebPluginContainerImpl::handleEvent(Event* event)
handleWheelEvent(static_cast<WheelEvent*>(event));
else if (event->isKeyboardEvent())
handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
+ else if (eventNames().isTouchEventType(event->type()))
+ handleTouchEvent(static_cast<TouchEvent*>(event));
// FIXME: it would be cleaner if Widget::handleEvent returned true/false and
// HTMLPluginElement called setDefaultHandled or defaultEventHandler.
@@ -461,8 +464,8 @@ void WebPluginContainerImpl::setOpaque(bool opaque)
bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
{
- Page* page = m_element->document()->page();
- if (!page)
+ Frame* frame = m_element->document()->frame();
+ if (!frame)
return false;
// hitTestResultAtPoint() takes a padding rectangle.
@@ -471,14 +474,25 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
LayoutPoint center = documentRect.center();
// Make the rect we're checking (the point surrounded by padding rects) contained inside the requested rect. (Note that -1/2 is 0.)
LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2);
- HitTestResult result =
- page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
+ HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
if (nodes.size() != 1)
return false;
return (nodes.first().get() == m_element);
}
+void WebPluginContainerImpl::setIsAcceptingTouchEvents(bool acceptingTouchEvents)
+{
+ if (m_isAcceptingTouchEvents == acceptingTouchEvents)
+ return;
+ m_isAcceptingTouchEvents = acceptingTouchEvents;
+ if (m_isAcceptingTouchEvents) {
+ m_element->document()->didAddTouchEventHandler();
+ m_element->document()->addListenerType(Document::TOUCH_LISTENER);
+ } else
+ m_element->document()->didRemoveTouchEventHandler();
+}
+
void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response)
{
// Make sure that the plugin receives window geometry before data, or else
@@ -577,11 +591,15 @@ WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme
, m_textureId(0)
, m_ioSurfaceId(0)
#endif
+ , m_isAcceptingTouchEvents(false)
{
}
WebPluginContainerImpl::~WebPluginContainerImpl()
{
+ if (m_isAcceptingTouchEvents)
+ m_element->document()->didRemoveTouchEventHandler();
+
for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i)
m_pluginLoadObservers[i]->clearPluginContainer();
m_webPlugin->destroy();
@@ -683,6 +701,17 @@ void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event)
event->setDefaultHandled();
}
+void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
+{
+ WebTouchEventBuilder webEvent(this, *event);
+ if (webEvent.type == WebInputEvent::Undefined)
+ return;
+ WebCursorInfo cursorInfo;
+ if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+ event->setDefaultHandled();
+ // FIXME: Can a plugin change the cursor from a touch-event callback?
+}
+
void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect,
IntRect& windowRect,
IntRect& clipRect,
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
index 415cc544b..a151f7090 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
@@ -52,6 +52,7 @@ class LayerChromium;
class MouseEvent;
class ResourceError;
class ResourceResponse;
+class TouchEvent;
class WheelEvent;
#if ENABLE(GESTURE_EVENTS)
@@ -109,6 +110,7 @@ public:
virtual void zoomLevelChanged(double zoomLevel);
virtual void setOpaque(bool);
virtual bool isRectTopmost(const WebRect&);
+ virtual void setIsAcceptingTouchEvents(bool);
// This cannot be null.
WebPlugin* plugin() { return m_webPlugin; }
@@ -160,6 +162,7 @@ private:
void handleMouseEvent(WebCore::MouseEvent*);
void handleWheelEvent(WebCore::WheelEvent*);
void handleKeyboardEvent(WebCore::KeyboardEvent*);
+ void handleTouchEvent(WebCore::TouchEvent*);
void calculateGeometry(const WebCore::IntRect& frameRect,
WebCore::IntRect& windowRect,
@@ -186,6 +189,8 @@ private:
// The associated scrollbar group object, created lazily. Used for Pepper
// scrollbars.
OwnPtr<ScrollbarGroup> m_scrollbarGroup;
+
+ bool m_isAcceptingTouchEvents;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
index 5f8776b58..e4d3ad835 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -338,6 +338,11 @@ void WebSettingsImpl::setExperimentalCSSCustomFilterEnabled(bool enabled)
m_settings->setCSSCustomFilterEnabled(enabled);
}
+void WebSettingsImpl::setExperimentalCSSVariablesEnabled(bool enabled)
+{
+ m_settings->setCSSVariablesEnabled(enabled);
+}
+
void WebSettingsImpl::setOpenGLMultisamplingEnabled(bool enabled)
{
m_settings->setOpenGLMultisamplingEnabled(enabled);
@@ -622,5 +627,9 @@ void WebSettingsImpl::setSyncXHRInDocumentsEnabled(bool enabled)
m_settings->setSyncXHRInDocumentsEnabled(enabled);
}
+void WebSettingsImpl::setCookieEnabled(bool enabled)
+{
+ m_settings->setCookieEnabled(enabled);
+}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h
index 2b58c0443..ddd89114f 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.h
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.h
@@ -97,6 +97,7 @@ public:
virtual void setExperimentalCSSRegionsEnabled(bool);
virtual void setExperimentalCSSGridLayoutEnabled(bool);
virtual void setExperimentalCSSCustomFilterEnabled(bool);
+ virtual void setExperimentalCSSVariablesEnabled(bool);
virtual void setOpenGLMultisamplingEnabled(bool);
virtual void setPrivilegedWebGLExtensionsEnabled(bool);
virtual void setWebGLErrorsToConsoleEnabled(bool);
@@ -149,6 +150,7 @@ public:
virtual void setMediaPlaybackRequiresUserGesture(bool);
virtual bool viewportEnabled() const { return m_viewportEnabled; }
virtual void setSyncXHRInDocumentsEnabled(bool);
+ virtual void setCookieEnabled(bool);
bool showFPSCounter() const { return m_showFPSCounter; }
bool showPlatformLayerTree() const { return m_showPlatformLayerTree; }
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 67b7c041e..d2393c31c 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -1351,10 +1351,28 @@ void WebViewImpl::resize(const WebSize& newSize)
{
if (m_shouldAutoResize || m_size == newSize)
return;
+
+ FrameView* view = mainFrameImpl()->frameView();
+ if (!view)
+ return;
+
+ WebSize oldSize = m_size;
+ float oldPageScaleFactor = pageScaleFactor();
+ IntSize oldScrollOffset = view->scrollOffset();
+ int oldFixedLayoutWidth = fixedLayoutSize().width;
+
m_size = newSize;
#if ENABLE(VIEWPORT)
if (settings()->viewportEnabled()) {
+ // Fallback width is used to layout sites designed for desktop. The
+ // conventional size used by all mobile browsers is 980. When a mobile
+ // device has a particularly wide screen (such as a 10" tablet held in
+ // landscape), it can be larger.
+ const int standardFallbackWidth = 980;
+ int dpiIndependentViewportWidth = newSize.width / page()->deviceScaleFactor();
+ settings()->setLayoutFallbackWidth(std::max(standardFallbackWidth, dpiIndependentViewportWidth));
+
ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments();
m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments);
}
@@ -1369,6 +1387,33 @@ void WebViewImpl::resize(const WebSize& newSize)
webFrame->frameView()->resize(newSize.width, newSize.height);
}
+#if ENABLE(VIEWPORT)
+ if (settings()->viewportEnabled()) {
+ // Relayout immediately to obtain the new content width, which is needed
+ // to calculate the minimum scale limit.
+ view->layout();
+ computePageScaleFactorLimits();
+ // When the device rotates:
+ // - If the page width is unchanged, then zoom by new width/old width
+ // such as to keep the same content horizontally onscreen.
+ // - If the page width stretches proportionally to the change in
+ // screen width, then don't zoom at all (assuming the content has
+ // scaled uniformly, then the same content will be horizontally
+ // onscreen).
+ // - If the page width partially stretches, then zoom partially to
+ // make up the difference.
+ // In all cases try to keep the same content at the top of the screen.
+ float viewportWidthRatio = !oldSize.width ? 1 : newSize.width / (float) oldSize.width;
+ float fixedLayoutWidthRatio = !oldFixedLayoutWidth ? 1 : fixedLayoutSize().width / (float) oldFixedLayoutWidth;
+ float scaleMultiplier = viewportWidthRatio / fixedLayoutWidthRatio;
+ if (scaleMultiplier != 1) {
+ IntSize scrollOffsetAtNewScale = oldScrollOffset;
+ scrollOffsetAtNewScale.scale(scaleMultiplier);
+ setPageScaleFactor(oldPageScaleFactor * scaleMultiplier, IntPoint(scrollOffsetAtNewScale));
+ }
+ }
+#endif
+
sendResizeEventAndRepaint();
}
@@ -2086,6 +2131,19 @@ bool WebViewImpl::selectionTextDirection(WebTextDirection& start, WebTextDirecti
return true;
}
+bool WebViewImpl::setEditableSelectionOffsets(int start, int end)
+{
+ const Frame* focused = focusedWebCoreFrame();
+ if (!focused)
+ return false;
+
+ Editor* editor = focused->editor();
+ if (!editor || !editor->canEdit())
+ return false;
+
+ return editor->setSelectionOffsets(start, end);
+}
+
bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length)
{
const Frame* focused = focusedWebCoreFrame();
@@ -2341,6 +2399,11 @@ void WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rect)
frame->view()->scrollElementToRect(elementNode, IntRect(rect.x, rect.y, rect.width, rect.height));
}
+void WebViewImpl::advanceFocus(bool reverse)
+{
+ page()->focusController()->advanceFocus(reverse ? FocusDirectionBackward : FocusDirectionForward, 0);
+}
+
double WebViewImpl::zoomLevel()
{
return m_zoomLevel;
@@ -3479,6 +3542,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
setDeviceScaleFactor(m_deviceScaleInCompositor);
}
+ bool visible = page()->visibilityState() == PageVisibilityStateVisible;
+ m_layerTreeView.setVisible(visible);
m_layerTreeView.setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
if (m_compositorSurfaceReady)
m_layerTreeView.setSurfaceReady();
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 4f5c048d9..d4527da0d 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -150,6 +150,7 @@ public:
virtual bool compositionRange(size_t* location, size_t* length);
virtual WebTextInputInfo textInputInfo();
virtual WebTextInputType textInputType();
+ virtual bool setEditableSelectionOffsets(int start, int end);
virtual bool selectionBounds(WebRect& start, WebRect& end) const;
virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const;
virtual bool caretOrSelectionRange(size_t* location, size_t* length);
@@ -194,6 +195,7 @@ public:
virtual void clearFocusedNode();
virtual void scrollFocusedNodeIntoView();
virtual void scrollFocusedNodeIntoRect(const WebRect&);
+ virtual void advanceFocus(bool reverse);
virtual double zoomLevel();
virtual double setZoomLevel(bool textOnly, double zoomLevel);
virtual void zoomLimitsChanged(double minimumZoomLevel,