diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/WebKit/chromium/src | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/WebKit/chromium/src')
55 files changed, 834 insertions, 373 deletions
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 403088bc9..0f8442a76 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -93,7 +93,6 @@ #include "WebMediaPlayerClient.h" #include "WebNotificationPresenter.h" #include "WebPageVisibilityState.h" -#include "WebScrollbar.h" #include "WebSettings.h" #include "WebSpeechRecognizerClient.h" #include "WebStorageQuotaError.h" @@ -111,6 +110,7 @@ #include <public/WebFileSystem.h> #include <public/WebFilterOperation.h> #include <public/WebReferrerPolicy.h> +#include <public/WebScrollbar.h> #include <public/WebURLResponse.h> #include <wtf/Assertions.h> #include <wtf/text/StringImpl.h> diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 50c560908..349733919 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -655,7 +655,7 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen // Call the common viewport computing logic in ViewportArguments.cpp. ViewportAttributes computed = computeViewportAttributes( args, settings->layoutFallbackWidth(), deviceRect.width, deviceRect.height, - dpi, IntSize(deviceRect.width, deviceRect.height)); + dpi / ViewportArguments::deprecatedTargetDPI, IntSize(deviceRect.width, deviceRect.height)); if (m_webView->ignoreViewportTagMaximumScale()) { computed.maximumScale = max(computed.maximumScale, m_webView->maxPageScaleFactor); @@ -841,6 +841,9 @@ void ChromeClientImpl::setNewWindowNavigationPolicy(WebNavigationPolicy policy) void ChromeClientImpl::formStateDidChange(const Node* node) { + if (m_webView->client()) + m_webView->client()->didChangeFormState(WebNode(const_cast<Node*>(node))); + // The current history item is not updated yet. That happens lazily when // WebFrame::currentHistoryItem is requested. WebFrameImpl* webframe = WebFrameImpl::fromFrame(node->document()->frame()); diff --git a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp index aada07787..63e16726e 100644 --- a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp @@ -32,19 +32,116 @@ #include "ContextFeaturesClientImpl.h" #include "Document.h" +#include "SecurityOrigin.h" #include "WebDocument.h" #include "WebPermissionClient.h" +using namespace WebCore; + namespace WebKit { -bool ContextFeaturesClientImpl::isEnabled(WebCore::Document* document, WebCore::ContextFeatures::FeatureType type, bool defaultValue) +class ContextFeaturesCache : public Supplement<ScriptExecutionContext> { +public: + class Entry { + public: + enum Value { + IsEnabled, + IsDisabled, + NeedsRefresh + }; + + Entry() + : m_value(NeedsRefresh) + , m_defaultValue(false) + { } + + bool isEnabled() const + { + ASSERT(m_value != NeedsRefresh); + return m_value == IsEnabled; + } + + void set(bool value, bool defaultValue) + { + m_value = value ? IsEnabled : IsDisabled; + m_defaultValue = defaultValue; + } + + bool needsRefresh(bool defaultValue) const + { + return m_value == NeedsRefresh || m_defaultValue != defaultValue; + } + + private: + Value m_value; + bool m_defaultValue; // Needs to be traked as a part of the signature since it can be changed dynamically. + }; + + static const AtomicString& supplementName(); + static ContextFeaturesCache* from(Document*); + + Entry& entryFor(ContextFeatures::FeatureType type) + { + size_t index = static_cast<size_t>(type); + ASSERT(index < ContextFeatures::FeatureTypeSize); + return m_entries[index]; + } + + void validateAgainst(Document*); + +private: + String m_domain; + Entry m_entries[ContextFeatures::FeatureTypeSize]; +}; + +const AtomicString& ContextFeaturesCache::supplementName() +{ + DEFINE_STATIC_LOCAL(AtomicString, name, ("ContextFeaturesCache")); + return name; +} + +ContextFeaturesCache* ContextFeaturesCache::from(Document* document) +{ + ContextFeaturesCache* cache = static_cast<ContextFeaturesCache*>(Supplement<ScriptExecutionContext>::from(document, supplementName())); + if (!cache) { + cache = new ContextFeaturesCache(); + Supplement<ScriptExecutionContext>::provideTo(document, supplementName(), adoptPtr(cache)); + } + + return cache; +} + +void ContextFeaturesCache::validateAgainst(Document* document) +{ + String currentDomain = document->securityOrigin()->domain(); + if (currentDomain == m_domain) + return; + m_domain = currentDomain; + for (size_t i = 0; i < ContextFeatures::FeatureTypeSize; ++i) + m_entries[i] = Entry(); +} + +bool ContextFeaturesClientImpl::isEnabled(Document* document, ContextFeatures::FeatureType type, bool defaultValue) +{ + ContextFeaturesCache::Entry& cache = ContextFeaturesCache::from(document)->entryFor(type); + if (cache.needsRefresh(defaultValue)) + cache.set(askIfIsEnabled(document, type, defaultValue), defaultValue); + return cache.isEnabled(); +} + +void ContextFeaturesClientImpl::urlDidChange(Document* document) +{ + ContextFeaturesCache::from(document)->validateAgainst(document); +} + +bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatures::FeatureType type, bool defaultValue) { if (!m_client) return defaultValue; switch (type) { - case WebCore::ContextFeatures::ShadowDOM: - case WebCore::ContextFeatures::StyleScoped: + case ContextFeatures::ShadowDOM: + case ContextFeatures::StyleScoped: return m_client->allowWebComponents(WebDocument(document), defaultValue); default: return defaultValue; diff --git a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.h b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.h index ea1f9548d..26d993048 100644 --- a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.h +++ b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.h @@ -44,9 +44,12 @@ public: { } virtual bool isEnabled(WebCore::Document*, WebCore::ContextFeatures::FeatureType, bool defaultValue) OVERRIDE; + virtual void urlDidChange(WebCore::Document*) OVERRIDE; void setPermissionClient(WebPermissionClient* client) { m_client = client; } private: + bool askIfIsEnabled(WebCore::Document*, WebCore::ContextFeatures::FeatureType, bool defaultValue); + WebPermissionClient* m_client; }; diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp index 2a62b926f..ca390ba90 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -54,11 +54,6 @@ IDBCursorBackendProxy::~IDBCursorBackendProxy() { } -unsigned short IDBCursorBackendProxy::direction() const -{ - return m_idbCursor->direction(); -} - PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const { return m_idbCursor->key(); diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h index 24a3e42c4..9e4b57008 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -42,7 +42,6 @@ public: static PassRefPtr<WebCore::IDBCursorBackendInterface> create(PassOwnPtr<WebIDBCursor>); virtual ~IDBCursorBackendProxy(); - virtual unsigned short direction() const; virtual PassRefPtr<WebCore::IDBKey> key() const; virtual PassRefPtr<WebCore::IDBKey> primaryKey() const; virtual PassRefPtr<WebCore::SerializedScriptValue> value() const; diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index 107ec63b3..901b55e54 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -66,21 +66,6 @@ IDBDatabaseMetadata IDBDatabaseBackendProxy::metadata() const return m_webIDBDatabase->metadata(); } -String IDBDatabaseBackendProxy::name() const -{ - return m_webIDBDatabase->name(); -} - -String IDBDatabaseBackendProxy::version() const -{ - return m_webIDBDatabase->version(); -} - -PassRefPtr<DOMStringList> IDBDatabaseBackendProxy::objectStoreNames() const -{ - return m_webIDBDatabase->objectStoreNames(); -} - PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, 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/IDBDatabaseBackendProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index b05552ccb..2a93600c6 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -43,9 +43,6 @@ public: virtual ~IDBDatabaseBackendProxy(); virtual WebCore::IDBDatabaseMetadata metadata() const; - virtual String name() const; - virtual String version() const; - virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const; virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 280db881d..60188fd48 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -56,26 +56,6 @@ IDBIndexBackendProxy::~IDBIndexBackendProxy() { } -String IDBIndexBackendProxy::name() -{ - return m_webIDBIndex->name(); -} - -IDBKeyPath IDBIndexBackendProxy::keyPath() -{ - return m_webIDBIndex->keyPath(); -} - -bool IDBIndexBackendProxy::unique() -{ - return m_webIDBIndex->unique(); -} - -bool IDBIndexBackendProxy::multiEntry() -{ - return m_webIDBIndex->multiEntry(); -} - void IDBIndexBackendProxy::openCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, 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/IDBIndexBackendProxy.h b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h index 273405601..1c1c33692 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -42,11 +42,6 @@ public: static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebIDBIndex>); virtual ~IDBIndexBackendProxy(); - virtual String name(); - virtual WebCore::IDBKeyPath keyPath(); - virtual bool unique(); - virtual bool multiEntry(); - virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void openKeyCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void count(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index 9ca777bc9..42f808c85 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -59,26 +59,6 @@ IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy() { } -String IDBObjectStoreBackendProxy::name() const -{ - return m_webIDBObjectStore->name(); -} - -IDBKeyPath IDBObjectStoreBackendProxy::keyPath() const -{ - return m_webIDBObjectStore->keyPath(); -} - -PassRefPtr<DOMStringList> IDBObjectStoreBackendProxy::indexNames() const -{ - return m_webIDBObjectStore->indexNames(); -} - -bool IDBObjectStoreBackendProxy::autoIncrement() const -{ - return m_webIDBObjectStore->autoIncrement(); -} - void IDBObjectStoreBackendProxy::get(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 c6da74cf1..c666c9fc7 100644 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -43,11 +43,6 @@ public: static PassRefPtr<WebCore::IDBObjectStoreBackendInterface> create(PassOwnPtr<WebIDBObjectStore>); virtual ~IDBObjectStoreBackendProxy(); - virtual String name() const; - virtual WebCore::IDBKeyPath keyPath() const; - virtual PassRefPtr<WebCore::DOMStringList> indexNames() const; - virtual bool autoIncrement() const; - 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::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index bfd9808ea..3a21a781b 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -62,9 +62,9 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectSto return IDBObjectStoreBackendProxy::create(objectStore.release()); } -unsigned short IDBTransactionBackendProxy::mode() const +void IDBTransactionBackendProxy::commit() { - return m_webIDBTransaction->mode(); + m_webIDBTransaction->commit(); } void IDBTransactionBackendProxy::abort() diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h index afef0082c..58918f68c 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -42,7 +42,12 @@ public: virtual ~IDBTransactionBackendProxy(); virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(const String& name, WebCore::ExceptionCode&); - virtual unsigned short mode() const; + virtual unsigned short mode() const + { + ASSERT_NOT_REACHED(); + return 0; + } + virtual void commit(); virtual void abort(); virtual bool scheduleTask(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); virtual void didCompleteTaskEvents(); diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index 0970ce6c2..7e9539376 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -62,7 +62,7 @@ NonCompositedContentHost::~NonCompositedContentHost() void NonCompositedContentHost::setBackgroundColor(const WebCore::Color& color) { - m_graphicsLayer->platformLayer()->setBackgroundColor(color); + m_graphicsLayer->platformLayer()->setBackgroundColor(color.rgb()); } void NonCompositedContentHost::setOpaque(bool opaque) diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index 94b26f05a..193b68b3a 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -68,13 +68,15 @@ #if OS(DARWIN) #include <public/mac/WebThemeEngine.h> -#elif OS(UNIX) && !OS(ANDROID) -#include "WebFontInfo.h" +#elif OS(UNIX) #include "WebFontRenderStyle.h" -#include <public/linux/WebThemeEngine.h> -#elif OS(ANDROID) +#if OS(ANDROID) #include <public/android/WebThemeEngine.h> -#endif +#else +#include "WebFontInfo.h" +#include <public/linux/WebThemeEngine.h> +#endif // OS(ANDROID) +#endif // elif OS(UNIX) #include "NativeImageSkia.h" @@ -257,16 +259,20 @@ void PlatformSupport::getFontFamilyForCharacters(const UChar* characters, size_t void PlatformSupport::getRenderStyleForStrike(const char* font, int sizeAndStyle, FontRenderStyle* result) { -#if !OS(ANDROID) WebFontRenderStyle style; - if (WebKit::Platform::current()->sandboxSupport()) +#if OS(ANDROID) + style.setDefaults(); +#else + if (!font || !*font) + style.setDefaults(); // It's probably a webfont. Take the system defaults. + else if (WebKit::Platform::current()->sandboxSupport()) WebKit::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style); else WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style); +#endif style.toFontRenderStyle(result); -#endif } #endif diff --git a/Source/WebKit/chromium/src/ScrollbarGroup.cpp b/Source/WebKit/chromium/src/ScrollbarGroup.cpp index 19fdbade4..0e676cb5f 100644 --- a/Source/WebKit/chromium/src/ScrollbarGroup.cpp +++ b/Source/WebKit/chromium/src/ScrollbarGroup.cpp @@ -29,8 +29,8 @@ #include "FrameView.h" #include "Scrollbar.h" #include "ScrollbarTheme.h" -#include "platform/WebRect.h" -#include "WebScrollbarImpl.h" +#include "WebPluginScrollbarImpl.h" +#include <public/WebRect.h> using namespace WebCore; @@ -50,7 +50,7 @@ ScrollbarGroup::~ScrollbarGroup() ASSERT(!m_verticalScrollbar); } -void ScrollbarGroup::scrollbarCreated(WebScrollbarImpl* scrollbar) +void ScrollbarGroup::scrollbarCreated(WebPluginScrollbarImpl* scrollbar) { bool hadScrollbars = m_horizontalScrollbar || m_verticalScrollbar; if (scrollbar->scrollbar()->orientation() == HorizontalScrollbar) { @@ -69,7 +69,7 @@ void ScrollbarGroup::scrollbarCreated(WebScrollbarImpl* scrollbar) } } -void ScrollbarGroup::scrollbarDestroyed(WebScrollbarImpl* scrollbar) +void ScrollbarGroup::scrollbarDestroyed(WebPluginScrollbarImpl* scrollbar) { if (scrollbar == m_horizontalScrollbar) { willRemoveHorizontalScrollbar(scrollbar->scrollbar()); @@ -93,7 +93,7 @@ void ScrollbarGroup::setLastMousePosition(const IntPoint& point) int ScrollbarGroup::scrollSize(WebCore::ScrollbarOrientation orientation) const { - WebScrollbarImpl* webScrollbar = orientation == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar; + WebPluginScrollbarImpl* webScrollbar = orientation == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar; if (!webScrollbar) return 0; Scrollbar* scrollbar = webScrollbar->scrollbar(); @@ -102,7 +102,7 @@ int ScrollbarGroup::scrollSize(WebCore::ScrollbarOrientation orientation) const int ScrollbarGroup::scrollPosition(Scrollbar* scrollbar) const { - WebScrollbarImpl* webScrollbar = scrollbar->orientation() == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar; + WebPluginScrollbarImpl* webScrollbar = scrollbar->orientation() == HorizontalScrollbar ? m_horizontalScrollbar : m_verticalScrollbar; if (!webScrollbar) return 0; return webScrollbar->scrollOffset(); @@ -225,14 +225,14 @@ IntSize ScrollbarGroup::contentsSize() const else if (m_verticalScrollbar) { size.setWidth(m_verticalScrollbar->scrollbar()->x()); if (m_verticalScrollbar->scrollbar()->isOverlayScrollbar()) - size.expand(WebScrollbar::defaultThickness(), 0); + size.expand(WebPluginScrollbar::defaultThickness(), 0); } if (m_verticalScrollbar) size.setHeight(m_verticalScrollbar->scrollbar()->totalSize()); else if (m_horizontalScrollbar) { size.setHeight(m_horizontalScrollbar->scrollbar()->y()); if (m_horizontalScrollbar->scrollbar()->isOverlayScrollbar()) - size.expand(0, WebScrollbar::defaultThickness()); + size.expand(0, WebPluginScrollbar::defaultThickness()); } return size; } diff --git a/Source/WebKit/chromium/src/ScrollbarGroup.h b/Source/WebKit/chromium/src/ScrollbarGroup.h index aeb44052f..a0479c206 100644 --- a/Source/WebKit/chromium/src/ScrollbarGroup.h +++ b/Source/WebKit/chromium/src/ScrollbarGroup.h @@ -36,15 +36,15 @@ class FrameView; namespace WebKit { -class WebScrollbarImpl; +class WebPluginScrollbarImpl; class ScrollbarGroup : public WebCore::ScrollableArea { public: ScrollbarGroup(WebCore::FrameView*, const WebCore::IntRect& frameRect); ~ScrollbarGroup(); - void scrollbarCreated(WebScrollbarImpl*); - void scrollbarDestroyed(WebScrollbarImpl*); + void scrollbarCreated(WebPluginScrollbarImpl*); + void scrollbarDestroyed(WebPluginScrollbarImpl*); void setLastMousePosition(const WebCore::IntPoint&); void setFrameRect(const WebCore::IntRect&); @@ -79,8 +79,8 @@ private: WebCore::FrameView* m_frameView; WebCore::IntPoint m_lastMousePosition; WebCore::IntRect m_frameRect; - WebScrollbarImpl* m_horizontalScrollbar; - WebScrollbarImpl* m_verticalScrollbar; + WebPluginScrollbarImpl* m_horizontalScrollbar; + WebPluginScrollbarImpl* m_verticalScrollbar; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebAnimation.cpp b/Source/WebKit/chromium/src/WebAnimation.cpp new file mode 100644 index 000000000..7dddfc241 --- /dev/null +++ b/Source/WebKit/chromium/src/WebAnimation.cpp @@ -0,0 +1,101 @@ +/* + * 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 INC. 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 INC. 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 <public/WebAnimation.h> + +#include "AnimationIdVendor.h" +#include "cc/CCActiveAnimation.h" +#include "cc/CCAnimationCurve.h" +#include <public/WebAnimationCurve.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +using WebCore::AnimationIdVendor; +using WebCore::CCActiveAnimation; + +namespace WebKit { + +int WebAnimation::iterations() const +{ + return m_private->iterations(); +} + +void WebAnimation::setIterations(int n) +{ + m_private->setIterations(n); +} + +double WebAnimation::startTime() const +{ + return m_private->startTime(); +} + +void WebAnimation::setStartTime(double monotonicTime) +{ + m_private->setStartTime(monotonicTime); +} + +double WebAnimation::timeOffset() const +{ + return m_private->timeOffset(); +} + +void WebAnimation::setTimeOffset(double monotonicTime) +{ + m_private->setTimeOffset(monotonicTime); +} + +bool WebAnimation::alternatesDirection() const +{ + return m_private->alternatesDirection(); +} + +void WebAnimation::setAlternatesDirection(bool alternates) +{ + m_private->setAlternatesDirection(alternates); +} + +WebAnimation::operator PassOwnPtr<WebCore::CCActiveAnimation>() const +{ + OwnPtr<WebCore::CCActiveAnimation> toReturn(m_private->cloneForImplThread()); + toReturn->setNeedsSynchronizedStartTime(true); + return toReturn.release(); +} + +void WebAnimation::initialize(const WebAnimationCurve& curve, TargetProperty targetProperty) +{ + m_private.reset(CCActiveAnimation::create(curve, + AnimationIdVendor::getNextAnimationId(), + AnimationIdVendor::getNextGroupId(), + static_cast<WebCore::CCActiveAnimation::TargetProperty>(targetProperty)).leakPtr()); +} + +void WebAnimation::destroy() +{ + m_private.reset(0); +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp b/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp new file mode 100644 index 000000000..b5b98b0a3 --- /dev/null +++ b/Source/WebKit/chromium/src/WebAnimationCurveCommon.cpp @@ -0,0 +1,53 @@ +/* + * 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 INC. 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 INC. 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 "WebAnimationCurveCommon.h" + +#include "cc/CCTimingFunction.h" + +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebKit { + +PassOwnPtr<WebCore::CCTimingFunction> createTimingFunction(WebAnimationCurve::TimingFunctionType type) +{ + switch (type) { + case WebAnimationCurve::TimingFunctionTypeEase: + return WebCore::CCEaseTimingFunction::create(); + case WebAnimationCurve::TimingFunctionTypeEaseIn: + return WebCore::CCEaseInTimingFunction::create(); + case WebAnimationCurve::TimingFunctionTypeEaseOut: + return WebCore::CCEaseOutTimingFunction::create(); + case WebAnimationCurve::TimingFunctionTypeEaseInOut: + return WebCore::CCEaseInOutTimingFunction::create(); + case WebAnimationCurve::TimingFunctionTypeLinear: + return nullptr; + } + return nullptr; +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebAnimationCurveCommon.h b/Source/WebKit/chromium/src/WebAnimationCurveCommon.h new file mode 100644 index 000000000..562b6eb8d --- /dev/null +++ b/Source/WebKit/chromium/src/WebAnimationCurveCommon.h @@ -0,0 +1,39 @@ +/* + * 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 INC. 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 INC. 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. + */ + +#ifndef WebAnimationCurveCommon_h +#define WebAnimationCurveCommon_h + +#include <public/WebAnimationCurve.h> +#include <wtf/Forward.h> + +namespace WebCore { +class CCTimingFunction; +} + +namespace WebKit { +PassOwnPtr<WebCore::CCTimingFunction> createTimingFunction(WebAnimationCurve::TimingFunctionType); +} + +#endif // WebAnimationCurveCommon_h diff --git a/Source/WebKit/chromium/src/WebBindings.cpp b/Source/WebKit/chromium/src/WebBindings.cpp index c4f40df3d..b9bbd5d37 100644 --- a/Source/WebKit/chromium/src/WebBindings.cpp +++ b/Source/WebKit/chromium/src/WebBindings.cpp @@ -210,6 +210,8 @@ static bool getRangeImpl(NPObject* object, WebRange* webRange) V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (v8Object.IsEmpty()) + return false; if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8Object))) return false; @@ -221,6 +223,21 @@ static bool getRangeImpl(NPObject* object, WebRange* webRange) return true; } +static bool getNodeImpl(NPObject* object, WebNode* webNode) +{ + if (!object || (object->_class != npScriptObjectClass)) + return false; + + V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); + v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + Node* native = V8Node::HasInstance(v8Object) ? V8Node::toNative(v8Object) : 0; + if (!native) + return false; + + *webNode = WebNode(native); + return true; +} + static bool getElementImpl(NPObject* object, WebElement* webElement) { if (!object || (object->_class != npScriptObjectClass)) @@ -228,6 +245,8 @@ static bool getElementImpl(NPObject* object, WebElement* webElement) V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (v8Object.IsEmpty()) + return false; Element* native = V8Element::HasInstance(v8Object) ? V8Element::toNative(v8Object) : 0; if (!native) return false; @@ -243,6 +262,8 @@ static bool getArrayBufferImpl(NPObject* object, WebArrayBuffer* arrayBuffer) V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (v8Object.IsEmpty()) + return false; ArrayBuffer* native = V8ArrayBuffer::HasInstance(v8Object) ? V8ArrayBuffer::toNative(v8Object) : 0; if (!native) return false; @@ -258,6 +279,8 @@ static bool getArrayBufferViewImpl(NPObject* object, WebArrayBufferView* arrayBu V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (v8Object.IsEmpty()) + return false; ArrayBufferView* native = V8ArrayBufferView::HasInstance(v8Object) ? V8ArrayBufferView::toNative(v8Object) : 0; if (!native) return false; @@ -320,6 +343,16 @@ bool WebBindings::getArrayBufferView(NPObject* arrayBufferView, WebArrayBufferVi #endif } +bool WebBindings::getNode(NPObject* node, WebNode* webNode) +{ +#if USE(V8) + return getNodeImpl(node, webNode); +#else + // Not supported on other ports (JSC, etc.). + return false; +#endif +} + bool WebBindings::getElement(NPObject* element, WebElement* webElement) { #if USE(V8) @@ -373,6 +406,8 @@ v8::Handle<v8::Value> WebBindings::toV8Value(const NPVariant* variant) if (object->_class != npScriptObjectClass) return v8::Undefined(); V8NPObject* v8Object = reinterpret_cast<V8NPObject*>(object); + if (v8Object->v8Object.IsEmpty()) + return v8::Undefined(); return convertNPVariantToV8Object(variant, v8Object->rootObject->frame()->script()->windowScriptNPObject()); } // Safe to pass 0 since we have checked the script object class to make sure the diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp index 8c8122f6b..ecf099a4a 100644 --- a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp +++ b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp @@ -27,6 +27,7 @@ #include "WebContentLayerImpl.h" #include "platform/WebContentLayerClient.h" +#include "platform/WebFloatRect.h" #include "platform/WebRect.h" #include "GraphicsContext.h" #include "platform/WebCanvas.h" @@ -53,11 +54,11 @@ WebContentLayerImpl::~WebContentLayerImpl() clearDelegate(); } -void WebContentLayerImpl::paintContents(SkCanvas* canvas, const IntRect& clip, IntRect& opaque) +void WebContentLayerImpl::paintContents(SkCanvas* canvas, const IntRect& clip, FloatRect& opaque) { if (!m_contentClient) return; - WebRect webOpaque; + WebFloatRect webOpaque; m_contentClient->paintContents(canvas, WebRect(clip), webOpaque); opaque = webOpaque; } diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.h b/Source/WebKit/chromium/src/WebContentLayerImpl.h index 542bd9b8e..97729ea1e 100644 --- a/Source/WebKit/chromium/src/WebContentLayerImpl.h +++ b/Source/WebKit/chromium/src/WebContentLayerImpl.h @@ -41,7 +41,7 @@ protected: virtual ~WebContentLayerImpl(); // ContentLayerDelegate implementation. - virtual void paintContents(SkCanvas*, const WebCore::IntRect& clip, WebCore::IntRect& opaque); + virtual void paintContents(SkCanvas*, const WebCore::IntRect& clip, WebCore::FloatRect& opaque) OVERRIDE; WebContentLayerClient* m_contentClient; bool m_drawsContent; diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 7792cf863..1bd1595b6 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -232,10 +232,12 @@ public: frame->setTextZoomFactor(m_webView->emulatedTextZoomFactor()); ensureOriginalZoomFactor(frame->view()); - frame->setPageAndTextZoomFactors(m_originalZoomFactor, m_webView->emulatedTextZoomFactor()); - Document* doc = frame->document(); - doc->styleResolverChanged(RecalcStyleImmediately); - doc->updateLayout(); + Document* document = frame->document(); + float numerator = document->renderView() ? document->renderView()->viewWidth() : frame->view()->contentsWidth(); + float factor = m_originalZoomFactor * (numerator / m_emulatedFrameSize.width); + frame->setPageAndTextZoomFactors(factor, m_webView->emulatedTextZoomFactor()); + document->styleResolverChanged(RecalcStyleImmediately); + document->updateLayout(); } void webViewResized() diff --git a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp index 24f7bc801..885076921 100644 --- a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp +++ b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp @@ -57,33 +57,6 @@ WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientationData* m_absolute = orientation->absolute(); } -WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrientationData* orientation) -{ - if (!orientation) { - m_isNull = true; - m_canProvideAlpha = false; - m_alpha = 0; - m_canProvideBeta = false; - m_beta = 0; - m_canProvideGamma = false; - m_gamma = 0; - m_canProvideAbsolute = false; - m_absolute = false; - return *this; - } - - m_isNull = false; - m_canProvideAlpha = orientation->canProvideAlpha(); - m_alpha = orientation->alpha(); - m_canProvideBeta = orientation->canProvideBeta(); - m_beta = orientation->beta(); - m_canProvideGamma = orientation->canProvideGamma(); - m_gamma = orientation->gamma(); - m_canProvideAbsolute = orientation->canProvideAbsolute(); - m_absolute = orientation->absolute(); - return *this; -} - WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientationData>() const { if (m_isNull) diff --git a/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp b/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp new file mode 100644 index 000000000..d8cc9bb98 --- /dev/null +++ b/Source/WebKit/chromium/src/WebFloatAnimationCurve.cpp @@ -0,0 +1,72 @@ +/* + * 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 INC. 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 INC. 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 <public/WebFloatAnimationCurve.h> + +#include "WebAnimationCurveCommon.h" +#include "cc/CCKeyframedAnimationCurve.h" +#include "cc/CCTimingFunction.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebKit { + +void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe) +{ + add(keyframe, TimingFunctionTypeEase); +} + +void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe, TimingFunctionType type) +{ + m_private->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); +} + +void WebFloatAnimationCurve::add(const WebFloatKeyframe& keyframe, double x1, double y1, double x2, double y2) +{ + m_private->addKeyframe(WebCore::CCFloatKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); +} + +float WebFloatAnimationCurve::getValue(double time) const +{ + return m_private->getValue(time); +} + +WebFloatAnimationCurve::operator PassOwnPtr<WebCore::CCAnimationCurve>() const +{ + return m_private->clone(); +} + +void WebFloatAnimationCurve::initialize() +{ + m_private.reset(WebCore::CCKeyframedFloatAnimationCurve::create().leakPtr()); +} + +void WebFloatAnimationCurve::destroy() +{ + m_private.reset(0); +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index afe0f99ff..89189eea2 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -978,6 +978,12 @@ void WebFrameImpl::reload(bool ignoreCache) m_frame->loader()->reload(ignoreCache); } +void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreCache) +{ + m_frame->loader()->history()->saveDocumentAndScrollState(); + m_frame->loader()->reloadWithOverrideURL(overrideUrl, ignoreCache); +} + void WebFrameImpl::loadRequest(const WebURLRequest& request) { ASSERT(!request.isNull()); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 3ddfb76d2..9dbf68336 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -136,6 +136,7 @@ public: bool isDirectory); #endif virtual void reload(bool ignoreCache); + virtual void reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreCache); virtual void loadRequest(const WebURLRequest&); virtual void loadHistoryItem(const WebHistoryItem&); virtual void loadData( diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index 31266b1a3..5b5aedf7c 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -92,9 +92,7 @@ void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedSc void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue, const WebIDBKey& key, const WebIDBKeyPath& keyPath) { - // FIXME: proxy to the 3-parameter version when interface lands: - // m_callbacks->onSuccess(serializedScriptValue, key, keyPath);); - ASSERT_NOT_REACHED(); + m_callbacks->onSuccess(serializedScriptValue, key, keyPath); } void WebIDBCallbacksImpl::onSuccessWithContinuation() diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp index 6f10efe9e..e9c0e04af 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -47,11 +47,6 @@ WebIDBCursorImpl::~WebIDBCursorImpl() { } -unsigned short WebIDBCursorImpl::direction() const -{ - return m_idbCursorBackend->direction(); -} - WebIDBKey WebIDBCursorImpl::key() const { return m_idbCursorBackend->key(); diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h index 418675142..f0d387b62 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h @@ -44,7 +44,6 @@ public: WebIDBCursorImpl(WTF::PassRefPtr<WebCore::IDBCursorBackendInterface>); virtual ~WebIDBCursorImpl(); - virtual unsigned short direction() const; virtual WebIDBKey key() const; virtual WebIDBKey primaryKey() const; virtual WebSerializedScriptValue value() const; diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp index e0a031890..94610eba9 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp @@ -46,11 +46,6 @@ WebIDBTransactionImpl::~WebIDBTransactionImpl() { } -int WebIDBTransactionImpl::mode() const -{ - return m_backend->mode(); -} - WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name, ExceptionCode& ec) { RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name, ec); @@ -59,6 +54,11 @@ WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name, Exc return new WebIDBObjectStoreImpl(objectStore); } +void WebIDBTransactionImpl::commit() +{ + m_backend->commit(); +} + void WebIDBTransactionImpl::abort() { m_backend->abort(); diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h index fa1049bd0..323e2be59 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h +++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h @@ -41,8 +41,8 @@ public: WebIDBTransactionImpl(WTF::PassRefPtr<WebCore::IDBTransactionBackendInterface>); virtual ~WebIDBTransactionImpl(); - virtual int mode() const; virtual WebIDBObjectStore* objectStore(const WebString& name, WebExceptionCode&); + virtual void commit(); virtual void abort(); virtual void didCompleteTaskEvents(); virtual void setCallbacks(WebIDBTransactionCallbacks*); diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp index 6106597ae..e41ce228d 100644 --- a/Source/WebKit/chromium/src/WebKit.cpp +++ b/Source/WebKit/chromium/src/WebKit.cpp @@ -32,13 +32,13 @@ #include "WebKit.h" #include "Logging.h" +#include "MutationObserver.h" #include "Page.h" #include "RuntimeEnabledFeatures.h" #include "Settings.h" #include "TextEncoding.h" #include "V8Binding.h" #include "V8RecursionScope.h" -#include "WebKitMutationObserver.h" #include "WebMediaPlayerClientImpl.h" #include "WebSocket.h" #include "WorkerContextExecutionProxy.h" @@ -50,6 +50,7 @@ #include <wtf/Assertions.h> #include <wtf/MainThread.h> #include <wtf/Threading.h> +#include <wtf/UnusedParam.h> #include <wtf/text/AtomicString.h> #if OS(DARWIN) @@ -66,7 +67,7 @@ public: virtual void willProcessTask() { } virtual void didProcessTask() { - WebCore::WebKitMutationObserver::deliverAllMutations(); + WebCore::MutationObserver::deliverAllMutations(); } }; @@ -185,9 +186,13 @@ bool layoutTestMode() void enableLogChannel(const char* name) { +#if !LOG_DISABLED WTFLogChannel* channel = WebCore::getChannelFromName(name); if (channel) channel->state = WTFLogChannelOn; +#else + UNUSED_PARAM(name); +#endif // !LOG_DISABLED } void resetPluginCache(bool reloadPages) diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index 49dcdd98e..14da1d570 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -213,6 +213,11 @@ WebElement WebNode::rootEditableElement() const return WebElement(m_private->rootEditableElement()); } +bool WebNode::focused() const +{ + return m_private->focused(); +} + bool WebNode::hasNonEmptyBoundingBox() const { m_private->document()->updateLayoutIgnorePendingStylesheets(); diff --git a/Source/WebKit/chromium/src/WebPageSerializer.cpp b/Source/WebKit/chromium/src/WebPageSerializer.cpp index 6adac2d6b..1d771fb00 100644 --- a/Source/WebKit/chromium/src/WebPageSerializer.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializer.cpp @@ -165,7 +165,7 @@ void retrieveResourcesForFrame(Frame* frame, frameURLs->append(frameURL); // Now get the resources associated with each node of the document. - RefPtr<HTMLAllCollection> allNodes = frame->document()->all(); + RefPtr<HTMLCollection> allNodes = frame->document()->all(); for (unsigned i = 0; i < allNodes->length(); ++i) { Node* node = allNodes->item(i); // We are only interested in HTML resources. diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp index ac200f1c9..dd4b15ebd 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -476,7 +476,7 @@ void WebPageSerializerImpl::collectTargetFrames() // Get current using document. Document* currentDoc = currentFrame->frame()->document(); // Go through sub-frames. - RefPtr<HTMLAllCollection> all = currentDoc->all(); + RefPtr<HTMLCollection> all = currentDoc->all(); for (unsigned i = 0; Node* node = all->item(i); i++) { if (!node->isHTMLElement()) diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 040eb6384..29489e25a 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -245,6 +245,30 @@ void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) } } +float WebPluginContainerImpl::deviceScaleFactor() +{ + Page* page = m_element->document()->page(); + if (!page) + return 1.0; + return page->deviceScaleFactor(); +} + +float WebPluginContainerImpl::pageScaleFactor() +{ + Page* page = m_element->document()->page(); + if (!page) + return 1.0; + return page->pageScaleFactor(); +} + +float WebPluginContainerImpl::pageZoomFactor() +{ + Frame* frame = m_element->document()->frame(); + if (!frame) + return 1.0; + return frame->pageZoomFactor(); +} + bool WebPluginContainerImpl::supportsPaginatedPrint() const { return m_webPlugin->supportsPaginatedPrint(); diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index a151f7090..4c2aaeb4a 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -116,6 +116,10 @@ public: WebPlugin* plugin() { return m_webPlugin; } void setPlugin(WebPlugin*); + virtual float deviceScaleFactor(); + virtual float pageScaleFactor(); + virtual float pageZoomFactor(); + // Printing interface. The plugin can support custom printing // (which means it controls the layout, number of pages etc). // Whether the plugin supports its own paginated print. The other print diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp index 7a3ea90d6..b0f63a7e4 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp @@ -1,35 +1,29 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * 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: + * 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. * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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. + * THIS SOFTWARE IS PROVIDED BY APPLE INC. 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 INC. 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 "WebScrollbarImpl.h" +#include "WebPluginScrollbarImpl.h" #include "GraphicsContext.h" #include "KeyboardCodes.h" @@ -38,37 +32,37 @@ #include "Scrollbar.h" #include "ScrollbarGroup.h" #include "ScrollbarTheme.h" -#include "platform/WebCanvas.h" #include "WebInputEvent.h" #include "WebInputEventConversion.h" #include "WebPluginContainerImpl.h" -#include "platform/WebRect.h" -#include "WebScrollbarClient.h" -#include "platform/WebVector.h" +#include "WebPluginScrollbarClient.h" #include "WebViewImpl.h" #include "painting/GraphicsContextBuilder.h" +#include <public/WebCanvas.h> +#include <public/WebRect.h> +#include <public/WebVector.h> using namespace std; using namespace WebCore; namespace WebKit { -WebScrollbar* WebScrollbar::createForPlugin(Orientation orientation, - WebPluginContainer* pluginContainer, - WebScrollbarClient* client) +WebPluginScrollbar* WebPluginScrollbar::createForPlugin(Orientation orientation, + WebPluginContainer* pluginContainer, + WebPluginScrollbarClient* client) { WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(pluginContainer); - return new WebScrollbarImpl(orientation, plugin->scrollbarGroup(), client); + return new WebPluginScrollbarImpl(orientation, plugin->scrollbarGroup(), client); } -int WebScrollbar::defaultThickness() +int WebPluginScrollbar::defaultThickness() { return ScrollbarTheme::theme()->scrollbarThickness(); } -WebScrollbarImpl::WebScrollbarImpl(Orientation orientation, +WebPluginScrollbarImpl::WebPluginScrollbarImpl(Orientation orientation, ScrollbarGroup* group, - WebScrollbarClient* client) + WebPluginScrollbarClient* client) : m_group(group) , m_client(client) , m_scrollOffset(0) @@ -80,18 +74,18 @@ WebScrollbarImpl::WebScrollbarImpl(Orientation orientation, m_group->scrollbarCreated(this); } -WebScrollbarImpl::~WebScrollbarImpl() +WebPluginScrollbarImpl::~WebPluginScrollbarImpl() { m_group->scrollbarDestroyed(this); } -void WebScrollbarImpl::setScrollOffset(int scrollOffset) +void WebPluginScrollbarImpl::setScrollOffset(int scrollOffset) { m_scrollOffset = scrollOffset; m_client->valueChanged(this); } -void WebScrollbarImpl::invalidateScrollbarRect(const IntRect& rect) +void WebPluginScrollbarImpl::invalidateScrollbarRect(const IntRect& rect) { WebRect webrect(rect); webrect.x += m_scrollbar->x(); @@ -99,32 +93,37 @@ void WebScrollbarImpl::invalidateScrollbarRect(const IntRect& rect) m_client->invalidateScrollbarRect(this, webrect); } -void WebScrollbarImpl::getTickmarks(Vector<IntRect>& tickmarks) const +void WebPluginScrollbarImpl::getTickmarks(Vector<IntRect>& tickmarks) const { WebVector<WebRect> ticks; - m_client->getTickmarks(const_cast<WebScrollbarImpl*>(this), &ticks); + m_client->getTickmarks(const_cast<WebPluginScrollbarImpl*>(this), &ticks); tickmarks.resize(ticks.size()); for (size_t i = 0; i < ticks.size(); ++i) tickmarks[i] = ticks[i]; } -IntPoint WebScrollbarImpl::convertFromContainingViewToScrollbar(const IntPoint& parentPoint) const +IntPoint WebPluginScrollbarImpl::convertFromContainingViewToScrollbar(const IntPoint& parentPoint) const { IntPoint offset(parentPoint.x() - m_scrollbar->x(), parentPoint.y() - m_scrollbar->y()); return m_scrollbar->Widget::convertFromContainingView(offset); } -void WebScrollbarImpl::scrollbarStyleChanged() +void WebPluginScrollbarImpl::scrollbarStyleChanged() { m_client->overlayChanged(this); } -bool WebScrollbarImpl::isOverlay() const +bool WebPluginScrollbarImpl::isOverlay() const { return m_scrollbar->isOverlayScrollbar(); } -void WebScrollbarImpl::setLocation(const WebRect& rect) +int WebPluginScrollbarImpl::value() const +{ + return m_scrollOffset; +} + +void WebPluginScrollbarImpl::setLocation(const WebRect& rect) { IntRect oldRect = m_scrollbar->frameRect(); m_scrollbar->setFrameRect(rect); @@ -138,24 +137,19 @@ void WebScrollbarImpl::setLocation(const WebRect& rect) m_scrollbar->setProportion(length, m_scrollbar->totalSize()); } -int WebScrollbarImpl::value() const -{ - return m_scrollOffset; -} - -void WebScrollbarImpl::setValue(int position) +void WebPluginScrollbarImpl::setValue(int position) { m_group->scrollToOffsetWithoutAnimation(m_scrollbar->orientation(), static_cast<float>(position)); } -void WebScrollbarImpl::setDocumentSize(int size) +void WebPluginScrollbarImpl::setDocumentSize(int size) { int length = m_scrollbar->orientation() == HorizontalScrollbar ? m_scrollbar->width() : m_scrollbar->height(); m_scrollbar->setEnabled(size > length); m_scrollbar->setProportion(length, size); } -void WebScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) +void WebPluginScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier) { WebCore::ScrollDirection dir; bool horizontal = m_scrollbar->orientation() == HorizontalScrollbar; @@ -167,12 +161,12 @@ void WebScrollbarImpl::scroll(ScrollDirection direction, ScrollGranularity granu m_group->scroll(dir, static_cast<WebCore::ScrollGranularity>(granularity), multiplier); } -void WebScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect) +void WebPluginScrollbarImpl::paint(WebCanvas* canvas, const WebRect& rect) { m_scrollbar->paint(&GraphicsContextBuilder(canvas).context(), rect); } -bool WebScrollbarImpl::handleInputEvent(const WebInputEvent& event) +bool WebPluginScrollbarImpl::handleInputEvent(const WebInputEvent& event) { switch (event.type) { case WebInputEvent::MouseDown: @@ -202,7 +196,7 @@ bool WebScrollbarImpl::handleInputEvent(const WebInputEvent& event) return false; } -bool WebScrollbarImpl::onMouseDown(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onMouseDown(const WebInputEvent& event) { WebMouseEvent mousedown = *static_cast<const WebMouseEvent*>(&event); if (!m_scrollbar->frameRect().contains(mousedown.x, mousedown.y)) @@ -214,7 +208,7 @@ bool WebScrollbarImpl::onMouseDown(const WebInputEvent& event) return true; } -bool WebScrollbarImpl::onMouseUp(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onMouseUp(const WebInputEvent& event) { WebMouseEvent mouseup = *static_cast<const WebMouseEvent*>(&event); if (m_scrollbar->pressedPart() == NoPart) @@ -223,7 +217,7 @@ bool WebScrollbarImpl::onMouseUp(const WebInputEvent& event) return m_scrollbar->mouseUp(PlatformMouseEventBuilder(m_scrollbar.get(), mouseup)); } -bool WebScrollbarImpl::onMouseMove(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onMouseMove(const WebInputEvent& event) { WebMouseEvent mousemove = *static_cast<const WebMouseEvent*>(&event); if (m_scrollbar->frameRect().contains(mousemove.x, mousemove.y) @@ -238,7 +232,7 @@ bool WebScrollbarImpl::onMouseMove(const WebInputEvent& event) return false; } -bool WebScrollbarImpl::onMouseLeave(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onMouseLeave(const WebInputEvent& event) { if (m_scrollbar->hoveredPart() != NoPart) m_scrollbar->mouseExited(); @@ -246,14 +240,14 @@ bool WebScrollbarImpl::onMouseLeave(const WebInputEvent& event) return false; } -bool WebScrollbarImpl::onMouseWheel(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onMouseWheel(const WebInputEvent& event) { WebMouseWheelEvent mousewheel = *static_cast<const WebMouseWheelEvent*>(&event); PlatformWheelEventBuilder platformEvent(m_scrollbar.get(), mousewheel); return m_group->handleWheelEvent(platformEvent); } -bool WebScrollbarImpl::onKeyDown(const WebInputEvent& event) +bool WebPluginScrollbarImpl::onKeyDown(const WebInputEvent& event) { WebKeyboardEvent keyboard = *static_cast<const WebKeyboardEvent*>(&event); int keyCode; diff --git a/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h new file mode 100644 index 000000000..b42cb82fd --- /dev/null +++ b/Source/WebKit/chromium/src/WebPluginScrollbarImpl.h @@ -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 INC. 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 INC. 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. + */ + +#ifndef WebPluginScrollbarImpl_h +#define WebPluginScrollbarImpl_h + +#include "WebPluginScrollbar.h" + +#include <wtf/RefPtr.h> +#include <wtf/Vector.h> + +namespace WebCore { +class IntPoint; +class IntRect; +class Scrollbar; +} + +namespace WebKit { + +class ScrollbarGroup; + +class WebPluginScrollbarImpl : public WebPluginScrollbar { +public: + WebPluginScrollbarImpl(Orientation, + ScrollbarGroup*, + WebPluginScrollbarClient*); + ~WebPluginScrollbarImpl(); + + void setScrollOffset(int); + void invalidateScrollbarRect(const WebCore::IntRect&); + void getTickmarks(Vector<WebCore::IntRect>&) const; + WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::IntPoint& parentPoint) const; + void scrollbarStyleChanged(); + + int scrollOffset() { return m_scrollOffset; } + WebCore::Scrollbar* scrollbar() { return m_scrollbar.get(); } + + // WebKit::WebScrollbar methods + virtual bool isOverlay() const; + virtual int value() const; + + // WebKit::WebPluginScrollbar methods + virtual void setLocation(const WebRect&); + virtual void setValue(int position); + virtual void setDocumentSize(int); + virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier); + virtual void paint(WebCanvas*, const WebRect&); + virtual bool handleInputEvent(const WebInputEvent&); + +private: + bool onMouseDown(const WebInputEvent&); + bool onMouseUp(const WebInputEvent&); + bool onMouseMove(const WebInputEvent&); + bool onMouseLeave(const WebInputEvent&); + bool onMouseWheel(const WebInputEvent&); + bool onKeyDown(const WebInputEvent&); + + ScrollbarGroup* m_group; + WebPluginScrollbarClient* m_client; + + int m_scrollOffset; + RefPtr<WebCore::Scrollbar> m_scrollbar; +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index 03129c54d..491a30311 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -531,4 +531,23 @@ bool WebRuntimeFeatures::isInputTypeDateEnabled() #endif } +void WebRuntimeFeatures::enableDialogElement(bool enable) +{ +#if ENABLE(DIALOG_ELEMENT) + RuntimeEnabledFeatures::setDialogElementEnabled(enable); +#else + UNUSED_PARAM(enable); +#endif +} + +bool WebRuntimeFeatures::isDialogElementEnabled() +{ +#if ENABLE(DIALOG_ELEMENT) + return RuntimeEnabledFeatures::dialogElementEnabled(); +#else + return false; +#endif +} + + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebScriptController.cpp b/Source/WebKit/chromium/src/WebScriptController.cpp index 948da1a48..5d36bbe0d 100644 --- a/Source/WebKit/chromium/src/WebScriptController.cpp +++ b/Source/WebKit/chromium/src/WebScriptController.cpp @@ -48,7 +48,7 @@ void WebScriptController::registerExtension(v8::Extension* extension) void WebScriptController::enableV8SingleThreadMode() { - enableFasterDOMStoreAccess(); + // FIXME: remove this method after all it's usages are gone. } void WebScriptController::flushConsoleMessages() diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.h b/Source/WebKit/chromium/src/WebScrollbarImpl.h deleted file mode 100644 index 644443c1c..000000000 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2010 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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. - */ - -#ifndef WebScrollbarImpl_h -#define WebScrollbarImpl_h - -#include "WebScrollbar.h" - -#include <wtf/RefPtr.h> -#include <wtf/Vector.h> - -namespace WebCore { -class IntPoint; -class IntRect; -class Scrollbar; -} - -namespace WebKit { - -class ScrollbarGroup; - -class WebScrollbarImpl : public WebScrollbar { -public: - WebScrollbarImpl(Orientation, - ScrollbarGroup*, - WebScrollbarClient*); - ~WebScrollbarImpl(); - - void setScrollOffset(int); - void invalidateScrollbarRect(const WebCore::IntRect&); - void getTickmarks(Vector<WebCore::IntRect>&) const; - WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::IntPoint& parentPoint) const; - void scrollbarStyleChanged(); - - int scrollOffset() { return m_scrollOffset; } - WebCore::Scrollbar* scrollbar() { return m_scrollbar.get(); } - - // WebKit::WebScrollbar methods - virtual bool isOverlay() const; - virtual void setLocation(const WebRect&); - virtual int value() const; - virtual void setValue(int position); - virtual void setDocumentSize(int size); - virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier); - virtual void paint(WebCanvas*, const WebRect&); - virtual bool handleInputEvent(const WebInputEvent&); - -private: - bool onMouseDown(const WebInputEvent& event); - bool onMouseUp(const WebInputEvent& event); - bool onMouseMove(const WebInputEvent& event); - bool onMouseLeave(const WebInputEvent& event); - bool onMouseWheel(const WebInputEvent& event); - bool onKeyDown(const WebInputEvent& event); - - ScrollbarGroup* m_group; - WebScrollbarClient* m_client; - - int m_scrollOffset; - RefPtr<WebCore::Scrollbar> m_scrollbar; -}; - -} // namespace WebKit - -#endif diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index e4d3ad835..5c57cf8ca 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -139,9 +139,13 @@ void WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDef m_applyDefaultDeviceScaleFactorInCompositor = applyDefaultDeviceScaleFactorInCompositor; } -void WebSettingsImpl::setFontBoostingEnabled(bool enabled) +void WebSettingsImpl::setTextAutosizingEnabled(bool enabled) { - m_settings->setFontBoostingEnabled(enabled); +#if ENABLE(TEXT_AUTOSIZING) + m_settings->setTextAutosizingEnabled(enabled); +#else + UNUSED_PARAM(enabled); +#endif } void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding) @@ -551,15 +555,6 @@ bool WebSettingsImpl::scrollAnimatorEnabled() const #endif } -void WebSettingsImpl::setHixie76WebSocketProtocolEnabled(bool enabled) -{ -#if ENABLE(WEB_SOCKETS) - m_settings->setUseHixie76WebSocketProtocol(enabled); -#else - UNUSED_PARAM(enabled); -#endif -} - void WebSettingsImpl::setVisualWordMovementEnabled(bool enabled) { m_settings->setVisualWordMovementEnabled(enabled); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index ddd89114f..163862e19 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -56,7 +56,7 @@ public: virtual void setMinimumFontSize(int); virtual void setMinimumLogicalFontSize(int); virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool); - virtual void setFontBoostingEnabled(bool); + virtual void setTextAutosizingEnabled(bool); virtual void setDefaultTextEncodingName(const WebString&); virtual void setDeviceSupportsTouch(bool); virtual void setDeviceSupportsMouse(bool); @@ -139,7 +139,6 @@ public: virtual void setShouldPrintBackgrounds(bool); virtual void setEnableScrollAnimator(bool); virtual bool scrollAnimatorEnabled() const; - virtual void setHixie76WebSocketProtocolEnabled(bool); virtual void setVisualWordMovementEnabled(bool); virtual void setShouldDisplaySubtitles(bool); virtual void setShouldDisplayCaptions(bool); diff --git a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp index e44a1b434..5cf999851 100644 --- a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp +++ b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp @@ -34,9 +34,12 @@ #include "CrossThreadTask.h" #include "DatabaseTask.h" #include "Document.h" +#include "GroupSettings.h" #include "KURL.h" #include "MessageEvent.h" #include "MessagePortChannel.h" +#include "Page.h" +#include "PageGroup.h" #include "PlatformMessagePortChannel.h" #include "SecurityOrigin.h" #include "ScriptExecutionContext.h" @@ -120,7 +123,6 @@ void WebSharedWorkerImpl::initializeLoader(const WebURL& url) m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled()); // FIXME: Settings information should be passed to the Worker process from Browser process when the worker // is created (similar to RenderThread::OnCreateNewView). - m_webView->settings()->setHixie76WebSocketProtocolEnabled(false); m_webView->initializeMainFrame(this); WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); @@ -366,7 +368,13 @@ void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& { initializeLoader(url); WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerContextOnStart : DontPauseWorkerContextOnStart; - setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode, contentSecurityPolicy, + ASSERT(m_loadingDocument->isDocument()); + Document* document = static_cast<Document*>(m_loadingDocument.get()); + GroupSettings* settings = 0; + if (document->page()) + settings = document->page()->group().groupSettings(); + setWorkerThread(SharedWorkerThread::create(name, url, userAgent, settings, + sourceCode, *this, *this, startMode, contentSecurityPolicy, static_cast<WebCore::ContentSecurityPolicy::HeaderType>(policyType))); workerThread()->start(); diff --git a/Source/WebKit/chromium/src/WebSurroundingText.cpp b/Source/WebKit/chromium/src/WebSurroundingText.cpp index 26bb39255..f880676ae 100644 --- a/Source/WebKit/chromium/src/WebSurroundingText.cpp +++ b/Source/WebKit/chromium/src/WebSurroundingText.cpp @@ -40,26 +40,22 @@ using namespace WebCore; namespace WebKit { -void WebSurroundingText::initialize(const WebHitTestResult& hitTestInfo, size_t maxLength) +void WebSurroundingText::initialize(const WebHitTestResult& hitTestResult, size_t maxLength) { - Node* node = hitTestInfo.node().unwrap<Node>(); + Node* node = hitTestResult.node().unwrap<Node>(); if (!node || !node->renderer()) return; - VisiblePosition visiblePosition(node->renderer()->positionForPoint(static_cast<IntPoint>(hitTestInfo.localPoint()))); - if (visiblePosition.isNull()) - return; - - m_private.reset(new SurroundingText(visiblePosition, maxLength)); + m_private.reset(new SurroundingText(VisiblePosition(node->renderer()->positionForPoint(static_cast<IntPoint>(hitTestResult.localPoint()))), maxLength)); } -void WebSurroundingText::initialize(WebNode textNode, size_t offset, size_t maxLength) +void WebSurroundingText::initialize(const WebNode& webNode, const WebPoint& nodePoint, size_t maxLength) { - Node* node = textNode.unwrap<Node>(); - if (!node || !node->isTextNode() || offset >= node->nodeValue().length()) + const Node* node = webNode.constUnwrap<Node>(); + if (!node || !node->renderer()) return; - m_private.reset(new SurroundingText(VisiblePosition(Position(toText(node), offset).parentAnchoredEquivalent(), DOWNSTREAM), maxLength)); + m_private.reset(new SurroundingText(node->renderer()->positionForPoint(static_cast<IntPoint>(nodePoint)), maxLength)); } WebString WebSurroundingText::textContent() const diff --git a/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp b/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp new file mode 100644 index 000000000..ca95fa39e --- /dev/null +++ b/Source/WebKit/chromium/src/WebTransformAnimationCurve.cpp @@ -0,0 +1,72 @@ +/* + * 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 INC. 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 INC. 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 <public/WebTransformAnimationCurve.h> + +#include "WebAnimationCurveCommon.h" +#include "cc/CCKeyframedAnimationCurve.h" +#include "cc/CCTimingFunction.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> + +namespace WebKit { + +void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe) +{ + add(keyframe, TimingFunctionTypeEase); +} + +void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe, TimingFunctionType type) +{ + m_private->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, createTimingFunction(type))); +} + +void WebTransformAnimationCurve::add(const WebTransformKeyframe& keyframe, double x1, double y1, double x2, double y2) +{ + m_private->addKeyframe(WebCore::CCTransformKeyframe::create(keyframe.time, keyframe.value, WebCore::CCCubicBezierTimingFunction::create(x1, y1, x2, y2))); +} + +WebTransformationMatrix WebTransformAnimationCurve::getValue(double time) const +{ + return m_private->getValue(time); +} + +WebTransformAnimationCurve::operator PassOwnPtr<WebCore::CCAnimationCurve>() const +{ + return m_private->clone(); +} + +void WebTransformAnimationCurve::initialize() +{ + m_private.reset(WebCore::CCKeyframedTransformAnimationCurve::create().leakPtr()); +} + +void WebTransformAnimationCurve::destroy() +{ + m_private.reset(0); +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 652e9a616..dd3315ff9 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -164,6 +164,7 @@ #include <wtf/CurrentTime.h> #include <wtf/MainThread.h> #include <wtf/RefPtr.h> +#include <wtf/TemporaryChange.h> #include <wtf/Uint8ClampedArray.h> #if ENABLE(GESTURE_EVENTS) @@ -1760,7 +1761,7 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) if (m_ignoreInputEvents) return false; - m_currentInputEvent = &inputEvent; + TemporaryChange<const WebInputEvent*> currentEventChange(m_currentInputEvent, &inputEvent); #if ENABLE(POINTER_LOCK) if (isPointerLocked() && WebInputEvent::isMouseEventType(inputEvent.type)) { @@ -1798,12 +1799,10 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) node->dispatchMouseEvent( PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)), eventType, static_cast<const WebMouseEvent*>(&inputEvent)->clickCount); - m_currentInputEvent = 0; return true; } bool handled = PageWidgetDelegate::handleInputEvent(m_page.get(), *this, inputEvent); - m_currentInputEvent = 0; return handled; } @@ -1987,7 +1986,7 @@ WebTextInputInfo WebViewImpl::textInputInfo() if (!selection) return info; - Node* node = focusedWebCoreNode(); + Node* node = selection->selection().rootEditableElement(); if (!node) return info; @@ -1995,33 +1994,22 @@ WebTextInputInfo WebViewImpl::textInputInfo() if (info.type == WebTextInputTypeNone) return info; - if (node->hasTagName(HTMLNames::textareaTag)) - info.value = static_cast<HTMLTextAreaElement*>(node)->value(); - else if (node->hasTagName(HTMLNames::inputTag)) - info.value = static_cast<HTMLInputElement*>(node)->value(); - else if (node->shouldUseInputMethod()) - info.value = node->nodeValue(); - else - return info; + info.value = plainText(rangeOfContents(node).get()); if (info.value.isEmpty()) return info; - if (node->hasTagName(HTMLNames::textareaTag) || node->hasTagName(HTMLNames::inputTag)) { - HTMLTextFormControlElement* formElement = static_cast<HTMLTextFormControlElement*>(node); - info.selectionStart = formElement->selectionStart(); - info.selectionEnd = formElement->selectionEnd(); - if (editor->hasComposition()) { - info.compositionStart = formElement->indexForVisiblePosition(Position(editor->compositionNode(), editor->compositionStart())); - info.compositionEnd = formElement->indexForVisiblePosition(Position(editor->compositionNode(), editor->compositionEnd())); - } - } else { - info.selectionStart = selection->start().computeOffsetInContainerNode(); - info.selectionEnd = selection->end().computeOffsetInContainerNode(); - if (editor->hasComposition()) { - info.compositionStart = static_cast<int>(editor->compositionStart()); - info.compositionEnd = static_cast<int>(editor->compositionEnd()); - } + size_t location; + size_t length; + RefPtr<Range> range = selection->selection().firstRange(); + if (range && TextIterator::getLocationAndLengthFromRange(selection->rootEditableElement(), range.get(), location, length)) { + info.selectionStart = location; + info.selectionEnd = location + length; + } + range = editor->compositionRange(); + if (range && TextIterator::getLocationAndLengthFromRange(selection->rootEditableElement(), range.get(), location, length)) { + info.compositionStart = location; + info.compositionEnd = location + length; } return info; @@ -2551,16 +2539,16 @@ void WebViewImpl::setDeviceScaleFactor(float scaleFactor) page()->setDeviceScaleFactor(scaleFactor); + if (!m_layerTreeView.isNull() && m_webSettings->applyDefaultDeviceScaleFactorInCompositor()) { + m_deviceScaleInCompositor = page()->deviceScaleFactor(); + m_layerTreeView.setDeviceScaleFactor(m_deviceScaleInCompositor); + } if (m_deviceScaleInCompositor != 1) { // Don't allow page scaling when compositor scaling is being used, // as they are currently incompatible. This means the deviceScale // needs to match the one in the compositor. ASSERT(scaleFactor == m_deviceScaleInCompositor); } - if (!m_layerTreeView.isNull() && m_webSettings->applyDefaultDeviceScaleFactorInCompositor()) { - m_deviceScaleInCompositor = page()->deviceScaleFactor(); - m_layerTreeView.setDeviceScaleFactor(m_deviceScaleInCompositor); - } } bool WebViewImpl::isFixedLayoutModeEnabled() const diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp index aee7b1df4..80899919b 100644 --- a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp @@ -39,10 +39,13 @@ #include "ErrorEvent.h" #include "Frame.h" #include "FrameLoaderClient.h" +#include "GroupSettings.h" #include "InspectorInstrumentation.h" #include "MessageEvent.h" #include "MessagePort.h" #include "MessagePortChannel.h" +#include "Page.h" +#include "PageGroup.h" #include "ScriptCallStack.h" #include "ScriptExecutionContext.h" #include "Worker.h" @@ -86,7 +89,12 @@ WorkerContextProxy* WebWorkerClientImpl::createWorkerContextProxy(Worker* worker void WebWorkerClientImpl::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode) { - RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode, + ASSERT(m_scriptExecutionContext->isDocument()); + Document* document = static_cast<Document*>(m_scriptExecutionContext.get()); + GroupSettings* settings = 0; + if (document->page()) + settings = document->page()->group().groupSettings(); + RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, settings, sourceCode, *this, *this, startMode, m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeader(), m_scriptExecutionContext->contentSecurityPolicy()->deprecatedHeaderType()); m_proxy->workerThreadCreated(thread); diff --git a/Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp b/Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp index 72db521d5..43c238a69 100644 --- a/Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp +++ b/Source/WebKit/chromium/src/gtk/WebInputEventFactory.cpp @@ -272,6 +272,39 @@ static int gdkEventToWindowsKeyCode(const GdkEventKey* event) return WebCore::windowsKeyCodeForKeyEvent(event->keyval); } +// Normalizes event->state to make it Windows/Mac compatible. Since the way +// of setting modifier mask on X is very different than Windows/Mac as shown +// in http://crbug.com/127142#c8, the normalization is necessary. +static guint normalizeEventState(const GdkEventKey* event) +{ + guint mask = 0; + switch (gdkEventToWindowsKeyCode(event)) { + case WebCore::VKEY_CONTROL: + case WebCore::VKEY_LCONTROL: + case WebCore::VKEY_RCONTROL: + mask = GDK_CONTROL_MASK; + break; + case WebCore::VKEY_SHIFT: + case WebCore::VKEY_LSHIFT: + case WebCore::VKEY_RSHIFT: + mask = GDK_SHIFT_MASK; + break; + case WebCore::VKEY_MENU: + case WebCore::VKEY_LMENU: + case WebCore::VKEY_RMENU: + mask = GDK_MOD1_MASK; + break; + case WebCore::VKEY_CAPITAL: + mask = GDK_LOCK_MASK; + break; + default: + return event->state; + } + if (event->type == GDK_KEY_PRESS) + return event->state | mask; + return event->state & ~mask; +} + // Gets the corresponding control character of a specified key code. See: // http://en.wikipedia.org/wiki/Control_characters // We emulate Windows behavior here. @@ -325,7 +358,7 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(const GdkEventKey* event) WebKeyboardEvent result; result.timeStampSeconds = gdkEventTimeToWebEventTime(event->time); - result.modifiers = gdkStateToWebEventModifiers(event->state); + result.modifiers = gdkStateToWebEventModifiers(normalizeEventState(event)); switch (event->type) { case GDK_KEY_RELEASE: diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js index f7e3810c5..68c6742cc 100644 --- a/Source/WebKit/chromium/src/js/Tests.js +++ b/Source/WebKit/chromium/src/js/Tests.js @@ -649,7 +649,7 @@ TestSuite.prototype.nonAnonymousUISourceCodes_ = function() return !!uiSourceCode.url; } - var uiSourceCodes = WebInspector.panels.scripts._uiSourceCodeProvider.uiSourceCodes(); + var uiSourceCodes = WebInspector.workspace.uiSourceCodes(); return uiSourceCodes.filter(filterOutAnonymous); }; diff --git a/Source/WebKit/chromium/src/linux/WebFontRendering.cpp b/Source/WebKit/chromium/src/linux/WebFontRendering.cpp index 7dc98e667..67d5c2b54 100644 --- a/Source/WebKit/chromium/src/linux/WebFontRendering.cpp +++ b/Source/WebKit/chromium/src/linux/WebFontRendering.cpp @@ -33,7 +33,7 @@ #include "FontPlatformData.h" -#if OS(LINUX) +#if OS(LINUX) && !OS(ANDROID) #include "WebFontInfo.h" #endif @@ -75,7 +75,7 @@ void WebFontRendering::setSubpixelRendering(bool useSubpixelRendering) void WebFontRendering::setSubpixelPositioning(bool useSubpixelPositioning) { FontPlatformData::setSubpixelPositioning(useSubpixelPositioning); -#if OS(LINUX) +#if OS(LINUX) && !OS(ANDROID) WebFontInfo::setSubpixelPositioning(useSubpixelPositioning); #endif } |