diff options
Diffstat (limited to 'Source/WebKit/chromium/src')
69 files changed, 958 insertions, 590 deletions
diff --git a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp index 2696b2c..3981ee9 100644 --- a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -42,6 +42,7 @@ #include "Page.h" #include "ProgressEvent.h" #include "Settings.h" +#include "WebFrameImpl.h" #include "WebURL.h" #include "WebURLError.h" #include "WebURLResponse.h" @@ -81,7 +82,7 @@ void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, Subst m_internal.set(new ApplicationCacheHostInternal(this)); if (m_internal->m_outerHost) { WrappedResourceRequest wrapped(request); - m_internal->m_outerHost->willStartMainResourceRequest(wrapped); + m_internal->m_outerHost->willStartMainResourceRequest(wrapped, WebFrameImpl::fromFrame(m_documentLoader->frame())); } else m_internal.clear(); @@ -259,7 +260,7 @@ void ApplicationCacheHost::stopDeferringEvents() void ApplicationCacheHost::stopLoadingInFrame(Frame* frame) { - // FIXME: Implement this method. + // N/A to the chromium port } void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 20fbcd5..7baaf8a 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -45,6 +45,7 @@ #include "GeolocationError.h" #include "GeolocationPosition.h" #include "HTMLInputElement.h" +#include "IDBFactoryBackendInterface.h" #include "IDBKey.h" #include "MediaPlayer.h" #include "NotificationPresenter.h" @@ -67,6 +68,7 @@ #include "WebFontDescription.h" #include "WebGeolocationError.h" #include "WebGeolocationPosition.h" +#include "WebIDBFactory.h" #include "WebIDBKey.h" #include "WebInputElement.h" #include "WebMediaPlayer.h" @@ -171,6 +173,10 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTreeItemRole, TreeItemRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDirectory, DirectoryRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleEditableText, EditableTextRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListItem, ListItemRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleParagraph, ParagraphRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLabel, LabelRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDiv, DivRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleForm, FormRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkApplication, LandmarkApplicationRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkBanner, LandmarkBannerRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkComplementary, LandmarkComplementaryRole); @@ -209,6 +215,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::CachedEvent, ApplicationCa COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::ObsoleteEvent, ApplicationCacheHost::OBSOLETE_EVENT); #endif +COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatPlainText, PasteboardPrivate::PlainTextFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatHTML, PasteboardPrivate::HTMLFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatBookmark, PasteboardPrivate::BookmarkFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatSmartPaste, PasteboardPrivate::WebSmartPasteFormat); @@ -377,6 +384,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::DateType, IDBKey::DateType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); +COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::DefaultBackingStore, IDBFactoryBackendInterface::DefaultBackingStore); +COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBackendInterface::LevelDBBackingStore); + #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp index 34a4055..1ca9900 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010, 2011 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 @@ -31,103 +31,206 @@ #include "config.h" #include "AssociatedURLLoader.h" +#include "DocumentThreadableLoader.h" +#include "DocumentThreadableLoaderClient.h" +#include "SubresourceLoader.h" #include "WebApplicationCacheHost.h" #include "WebDataSource.h" #include "WebFrameImpl.h" #include "WebKit.h" #include "WebKitClient.h" +#include "WebURLError.h" +#include "WebURLLoaderClient.h" #include "WebURLRequest.h" +#include "WrappedResourceRequest.h" +#include "WrappedResourceResponse.h" + +using namespace WebCore; +using namespace WebKit; +using namespace WTF; namespace WebKit { -AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) - : m_frameImpl(frameImpl), - m_realLoader(webKitClient()->createURLLoader()), - m_realClient(0) +// This class bridges the interface differences between WebCore and WebKit loader clients. +// It forwards its ThreadableLoaderClient notifications to a WebURLLoaderClient. +class AssociatedURLLoader::ClientAdapter : public DocumentThreadableLoaderClient { +public: + static PassOwnPtr<ClientAdapter> create(AssociatedURLLoader*, WebURLLoaderClient*, bool /*downloadToFile*/); + + virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/); + virtual void willSendRequest(ResourceRequest& /*newRequest*/, const ResourceResponse& /*redirectResponse*/); + + virtual void didReceiveResponse(const ResourceResponse&); + virtual void didReceiveData(const char*, int /*dataLength*/); + virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/); + virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/); + virtual void didFail(const ResourceError&); + + virtual bool isDocumentThreadableLoaderClient() { return true; } + + // This method stops loading and releases the DocumentThreadableLoader as early as possible. + void clearClient() { m_client = 0; } + +private: + ClientAdapter(AssociatedURLLoader*, WebURLLoaderClient*, bool /*downloadToFile*/); + + AssociatedURLLoader* m_loader; + WebURLLoaderClient* m_client; + unsigned long m_downloadLength; + bool m_downloadToFile; +}; + +PassOwnPtr<AssociatedURLLoader::ClientAdapter> AssociatedURLLoader::ClientAdapter::create(AssociatedURLLoader* loader, WebURLLoaderClient* client, bool downloadToFile) { + return adoptPtr(new ClientAdapter(loader, client, downloadToFile)); } -AssociatedURLLoader::~AssociatedURLLoader() +AssociatedURLLoader::ClientAdapter::ClientAdapter(AssociatedURLLoader* loader, WebURLLoaderClient* client, bool downloadToFile) + : m_loader(loader) + , m_client(client) + , m_downloadLength(0) + , m_downloadToFile(downloadToFile) { + ASSERT(m_loader); + ASSERT(m_client); } -void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) +void AssociatedURLLoader::ClientAdapter::willSendRequest(ResourceRequest& newRequest, const ResourceResponse& redirectResponse) { - ASSERT(!m_realClient); - - WebURLRequest requestCopy(request); - prepareRequest(requestCopy); + if (!m_client) + return; - m_realLoader->loadSynchronously(requestCopy, response, error, data); + WrappedResourceRequest wrappedNewRequest(newRequest); + WrappedResourceResponse wrappedRedirectResponse(redirectResponse); + m_client->willSendRequest(m_loader, wrappedNewRequest, wrappedRedirectResponse); } -void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) +void AssociatedURLLoader::ClientAdapter::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) { - ASSERT(!m_realClient); + if (!m_client) + return; - WebURLRequest requestCopy(request); - prepareRequest(requestCopy); + m_client->didSendData(m_loader, bytesSent, totalBytesToBeSent); +} - m_realClient = client; - m_realLoader->loadAsynchronously(requestCopy, this); +void AssociatedURLLoader::ClientAdapter::didReceiveResponse(const ResourceResponse& response) +{ + WrappedResourceResponse wrappedResponse(response); + m_client->didReceiveResponse(m_loader, wrappedResponse); } -void AssociatedURLLoader::cancel() +void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int dataLength) { - m_realLoader->cancel(); + if (!m_client) + return; + + // FIXME(vsevik): add -1 to params once migrated. + m_client->didReceiveData(m_loader, data, dataLength); + m_downloadLength += dataLength; } -void AssociatedURLLoader::setDefersLoading(bool defersLoading) +void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int lengthReceived) { - m_realLoader->setDefersLoading(defersLoading); + if (!m_client) + return; + + m_client->didReceiveCachedMetadata(m_loader, data, lengthReceived); } -void AssociatedURLLoader::prepareRequest(WebURLRequest& request) +void AssociatedURLLoader::ClientAdapter::didFinishLoading(unsigned long identifier, double finishTime) { - WebApplicationCacheHost* applicationCacheHost = m_frameImpl->dataSource()->applicationCacheHost(); - if (applicationCacheHost) - applicationCacheHost->willStartSubResourceRequest(request); - m_frameImpl->dispatchWillSendRequest(request); + if (!m_client) + return; + + if (m_downloadToFile) { + int downloadLength = m_downloadLength <= INT_MAX ? m_downloadLength : INT_MAX; + m_client->didDownloadData(m_loader, downloadLength); + // While the client could have cancelled, continue, since the load finished. + } + + m_client->didFinishLoading(m_loader, finishTime); } -void AssociatedURLLoader::willSendRequest(WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) +void AssociatedURLLoader::ClientAdapter::didFail(const ResourceError& error) { - m_realClient->willSendRequest(this, newRequest, redirectResponse); + if (!m_client) + return; + + WebURLError webError(error); + m_client->didFail(m_loader, webError); } -void AssociatedURLLoader::didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) +AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) + : m_frameImpl(frameImpl) + , m_client(0) { - m_realClient->didSendData(this, bytesSent, totalBytesToBeSent); + ASSERT(m_frameImpl); + + m_options.sniffContent = false; + m_options.allowCredentials = true; + m_options.forcePreflight = false; + m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests. } -void AssociatedURLLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& response) +AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl, const WebURLLoaderOptions& options) + : m_frameImpl(frameImpl) + , m_options(options) + , m_client(0) { - m_realClient->didReceiveResponse(this, response); + ASSERT(m_frameImpl); } -void AssociatedURLLoader::didDownloadData(WebURLLoader*, int dataLength) +AssociatedURLLoader::~AssociatedURLLoader() { - m_realClient->didDownloadData(this, dataLength); + if (m_clientAdapter) + m_clientAdapter->clearClient(); } -void AssociatedURLLoader::didReceiveData(WebURLLoader*, const char* data, int dataLength) +#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ + COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) + +COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl); +COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests); + +void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { - m_realClient->didReceiveData(this, data, dataLength); + ASSERT(0); // Synchronous loading is not supported. } -void AssociatedURLLoader::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) +void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) { - m_realClient->didReceiveCachedMetadata(this, data, dataLength); + ASSERT(!m_client); + + m_client = client; + ASSERT(m_client); + + ThreadableLoaderOptions options; + options.sendLoadCallbacks = true; // Always send callbacks. + options.sniffContent = m_options.sniffContent; + options.allowCredentials = m_options.allowCredentials; + options.forcePreflight = m_options.forcePreflight; + options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy); + + const ResourceRequest& webcoreRequest = request.toResourceRequest(); + Document* webcoreDocument = m_frameImpl->frame()->document(); + m_clientAdapter = ClientAdapter::create(this, m_client, request.downloadToFile()); + + m_loader = DocumentThreadableLoader::create(webcoreDocument, m_clientAdapter.get(), webcoreRequest, options); } -void AssociatedURLLoader::didFinishLoading(WebURLLoader*, double finishTime) +void AssociatedURLLoader::cancel() { - m_realClient->didFinishLoading(this, finishTime); + if (m_loader) { + m_clientAdapter->clearClient(); + m_loader->cancel(); + } } -void AssociatedURLLoader::didFail(WebURLLoader*, const WebURLError& error) +void AssociatedURLLoader::setDefersLoading(bool defersLoading) { - m_realClient->didFail(this, error); + if (m_loader) + m_loader->setDefersLoading(defersLoading); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h index 91cb0bf..ed183e5 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.h +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010, 2011 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 @@ -32,20 +32,22 @@ #define AssociatedURLLoader_h #include "WebURLLoader.h" -#include "WebURLLoaderClient.h" +#include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> #include <wtf/RefPtr.h> +namespace WebCore { class DocumentThreadableLoader; } + namespace WebKit { class WebFrameImpl; // This class is used to implement WebFrame::createAssociatedURLLoader. -// FIXME: Implement in terms of WebCore::SubresourceLoader. -class AssociatedURLLoader : public WebURLLoader, - public WebURLLoaderClient { +class AssociatedURLLoader : public WebURLLoader { + WTF_MAKE_NONCOPYABLE(AssociatedURLLoader); public: AssociatedURLLoader(PassRefPtr<WebFrameImpl>); + AssociatedURLLoader(PassRefPtr<WebFrameImpl>, const WebURLLoaderOptions&); ~AssociatedURLLoader(); // WebURLLoader methods: @@ -54,22 +56,15 @@ public: virtual void cancel(); virtual void setDefersLoading(bool); - // WebURLLoaderClient methods: - virtual void willSendRequest(WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse); - virtual void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); - virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); - virtual void didDownloadData(WebURLLoader*, int dataLength); - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); - virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); - virtual void didFinishLoading(WebURLLoader*, double finishTime); - virtual void didFail(WebURLLoader*, const WebURLError&); - private: - void prepareRequest(WebURLRequest&); + + class ClientAdapter; RefPtr<WebFrameImpl> m_frameImpl; - OwnPtr<WebURLLoader> m_realLoader; - WebURLLoaderClient* m_realClient; + WebURLLoaderOptions m_options; + WebURLLoaderClient* m_client; + OwnPtr<ClientAdapter> m_clientAdapter; + RefPtr<WebCore::DocumentThreadableLoader> m_loader; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp index a483308..6fc51db 100644 --- a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp +++ b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp @@ -98,8 +98,7 @@ void AudioDestinationChromium::stop() double AudioDestination::hardwareSampleRate() { - // FIXME: implement this properly for Chromium. - return 44100.0; + return webKitClient()->audioHardwareSampleRate(); } // Pulls on our provider to get the rendered audio stream. diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 1e639ec..99302cc 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -857,7 +857,7 @@ void ChromeClientImpl::exitFullscreenForNode(WebCore::Node* node) } #if ENABLE(FULLSCREEN_API) -bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element) +bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard) { return m_webView->page()->settings()->fullScreenEnabled(); } diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h index e70b766..f3a48ee 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.h +++ b/Source/WebKit/chromium/src/ChromeClientImpl.h @@ -166,7 +166,7 @@ public: virtual void exitFullscreenForNode(WebCore::Node*); #if ENABLE(FULLSCREEN_API) - virtual bool supportsFullScreenForElement(const WebCore::Element*); + virtual bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard); virtual void enterFullScreenForElement(WebCore::Element*); virtual void exitFullScreenForElement(WebCore::Element*); virtual void fullScreenRendererChanged(WebCore::RenderBox*); diff --git a/Source/WebKit/chromium/src/DebuggerAgentManager.cpp b/Source/WebKit/chromium/src/DebuggerAgentManager.cpp index b76bcfe..368b78c 100644 --- a/Source/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/Source/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -34,7 +34,7 @@ #include "DebuggerAgentImpl.h" #include "Frame.h" #include "PageGroupLoadDeferrer.h" -#include "ScriptDebugServer.h" +#include "PageScriptDebugServer.h" #include "V8Proxy.h" #include "WebDevToolsAgentImpl.h" #include "WebFrameImpl.h" @@ -247,7 +247,7 @@ void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::Messa void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value) { s_exposeV8DebuggerProtocol = value; - WebCore::ScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol); + WebCore::PageScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol); } void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId) diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 38d4f5e..6f2231d 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -54,6 +54,7 @@ #include "WebNode.h" #include "WebPasswordAutocompleteListener.h" #include "WebRange.h" +#include "WebSpellCheckClient.h" #include "WebTextAffinity.h" #include "WebTextCheckingCompletionImpl.h" #include "WebViewClient.h" @@ -856,8 +857,8 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, int spellLength = 0; // Check to see if the provided text is spelled correctly. - if (isContinuousSpellCheckingEnabled() && m_webView->client()) - m_webView->client()->spellCheck(WebString(text, length), spellLocation, spellLength); + if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient()) + m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength); else { spellLocation = 0; spellLength = 0; @@ -873,7 +874,8 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text) { - m_webView->client()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); } String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) @@ -888,7 +890,9 @@ String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& return String(); } - return m_webView->client()->autoCorrectWord(WebString(misspelledWord)); + if (m_webView->spellCheckClient()) + return m_webView->spellCheckClient()->autoCorrectWord(WebString(misspelledWord)); + return String(); } void EditorClientImpl::checkGrammarOfString(const UChar*, int length, @@ -911,20 +915,20 @@ void EditorClientImpl::updateSpellingUIWithGrammarString(const String&, void EditorClientImpl::updateSpellingUIWithMisspelledWord(const String& misspelledWord) { - if (m_webView->client()) - m_webView->client()->updateSpellingUIWithMisspelledWord(WebString(misspelledWord)); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->updateSpellingUIWithMisspelledWord(WebString(misspelledWord)); } void EditorClientImpl::showSpellingUI(bool show) { - if (m_webView->client()) - m_webView->client()->showSpellingUI(show); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->showSpellingUI(show); } bool EditorClientImpl::spellingUIIsShowing() { - if (m_webView->client()) - return m_webView->client()->isShowingSpellingUI(); + if (m_webView->spellCheckClient()) + return m_webView->spellCheckClient()->isShowingSpellingUI(); return false; } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index dc47923..647a70c 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1479,7 +1480,8 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( ObjectContentType FrameLoaderClientImpl::objectContentType( const KURL& url, - const String& explicitMimeType) + const String& explicitMimeType, + bool shouldPreferPlugInsForImages) { // This code is based on Apple's implementation from // WebCoreSupport/WebFrameBridge.mm. @@ -1503,12 +1505,14 @@ ObjectContentType FrameLoaderClientImpl::objectContentType( return ObjectContentFrame; } - if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) - return ObjectContentImage; - // If Chrome is started with the --disable-plugins switch, pluginData is 0. PluginData* pluginData = m_webFrame->frame()->page()->pluginData(); - if (pluginData && pluginData->supportsMimeType(mimeType)) + bool plugInSupportsMIMEType = pluginData && pluginData->supportsMimeType(mimeType); + + if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) + return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? ObjectContentNetscapePlugin : ObjectContentImage; + + if (plugInSupportsMIMEType) return ObjectContentNetscapePlugin; if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index 7abf617..f19c26c 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -197,7 +198,7 @@ public: const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); virtual WebCore::ObjectContentType objectContentType( - const WebCore::KURL& url, const WTF::String& mimeType); + const WebCore::KURL&, const WTF::String& mimeType, bool shouldPreferPlugInsForImages); virtual WTF::String overrideMediaType() const; virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool listen = true); diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 3d937ac..54c18e3 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -82,6 +82,7 @@ namespace WebCore { GraphicsContext3DInternal::GraphicsContext3DInternal() : m_webViewImpl(0) , m_initializedAvailableExtensions(false) + , m_layerComposited(false) #if USE(SKIA) #elif PLATFORM(CG) , m_renderOutput(0) @@ -160,6 +161,24 @@ WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const } #endif +void GraphicsContext3DInternal::markContextChanged() +{ +#if USE(ACCELERATED_COMPOSITING) + platformLayer()->setTextureUpdated(); +#endif + m_layerComposited = false; +} + +void GraphicsContext3DInternal::markLayerComposited() +{ + m_layerComposited = true; +} + +bool GraphicsContext3DInternal::layerComposited() const +{ + return m_layerComposited; +} + void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingContext* context) { HTMLCanvasElement* canvas = context->canvas(); @@ -200,6 +219,16 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon m_impl->readBackFramebuffer(pixels, 4 * m_impl->width() * m_impl->height()); + if (!m_impl->getContextAttributes().premultipliedAlpha) { + size_t bufferSize = 4 * m_impl->width() * m_impl->height(); + + for (size_t i = 0; i < bufferSize; i += 4) { + pixels[i + 0] = std::min(255, pixels[i + 0] * pixels[i + 3] / 255); + pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255); + pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255); + } + } + #if USE(SKIA) if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. @@ -218,6 +247,23 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon #endif } +PassRefPtr<ImageData> GraphicsContext3DInternal::paintRenderingResultsToImageData() +{ + if (m_impl->getContextAttributes().premultipliedAlpha) + return 0; + + RefPtr<ImageData> imageData = ImageData::create(IntSize(m_impl->width(), m_impl->height())); + unsigned char* pixels = imageData->data()->data()->data(); + size_t bufferSize = 4 * m_impl->width() * m_impl->height(); + + m_impl->readBackFramebuffer(pixels, bufferSize); + + for (size_t i = 0; i < bufferSize; i += 4) + std::swap(pixels[i], pixels[i + 2]); + + return imageData.release(); +} + bool GraphicsContext3DInternal::paintsIntoCanvasBuffer() const { // If the gpu compositor is on then skip the readback and software rendering path. @@ -1058,7 +1104,16 @@ DELEGATE_TO_INTERNAL_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboo DELEGATE_TO_INTERNAL_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei) +DELEGATE_TO_INTERNAL(markLayerComposited) +DELEGATE_TO_INTERNAL(markContextChanged) + +bool GraphicsContext3D::layerComposited() const +{ + return m_internal->layerComposited(); +} + DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*) +DELEGATE_TO_INTERNAL_R(paintRenderingResultsToImageData, PassRefPtr<ImageData>) bool GraphicsContext3D::paintsIntoCanvasBuffer() const { diff --git a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h index c8f7c7a..0af291e 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -66,7 +66,12 @@ public: void reshape(int width, int height); IntSize getInternalFramebufferSize(); + void markContextChanged(); + bool layerComposited() const; + void markLayerComposited(); + void paintRenderingResultsToCanvas(CanvasRenderingContext*); + PassRefPtr<ImageData> paintRenderingResultsToImageData(); bool paintsIntoCanvasBuffer() const; void prepareTexture(); @@ -273,6 +278,7 @@ private: bool m_initializedAvailableExtensions; HashSet<String> m_enabledExtensions; HashSet<String> m_requestableExtensions; + bool m_layerComposited; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebGLLayerChromium> m_compositingLayer; #endif diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index ea0f433..727092a 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -35,7 +35,6 @@ #include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" #include "WebIDBDatabaseError.h" -#include "WebIDBIndexImpl.h" #include "WebIDBKey.h" #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" @@ -73,11 +72,6 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backen m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); } -void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBIndexBackendInterface> backend) -{ - m_callbacks->onSuccess(new WebKit::WebIDBIndexImpl(backend)); -} - void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) { m_callbacks->onSuccess(WebKit::WebIDBKey(idbKey)); diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h index 912cb86..6829845 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h @@ -50,7 +50,6 @@ public: virtual void onError(PassRefPtr<IDBDatabaseError>); virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>); virtual void onSuccess(PassRefPtr<IDBKey>); virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>); virtual void onSuccess(PassRefPtr<SerializedScriptValue>); diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 67504a3..9e5ccc0 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -59,13 +59,12 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() { } -void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize) +void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType) { WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebKit::WebIDBFactory::BackingStoreType>(backingStoreType)); } } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) - diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h index 5950a68..593051e 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -45,7 +45,7 @@ public: virtual ~IDBFactoryBackendProxy(); PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize); + virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); private: IDBFactoryBackendProxy(); @@ -59,4 +59,3 @@ private: #endif #endif // IDBFactoryBackendProxy_h - diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp index 35e4de8..b377bdb 100644 --- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp @@ -57,29 +57,40 @@ LocalFileSystem& LocalFileSystem::localFileSystem() return *localFileSystem; } -void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) -{ - ASSERT(context && context->isDocument()); - Document* document = static_cast<Document*>(context); - WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), 0, false, new WebFileSystemCallbacksImpl(callbacks, type)); -} +namespace { -void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +enum CreationFlag { + OpenExisting, + CreateIfNotPresent +}; + +} // namespace + +static void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create) { ASSERT(context); if (context->isDocument()) { Document* document = static_cast<Document*>(context); WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, true, new WebFileSystemCallbacksImpl(callbacks, type)); + webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type)); } else { WorkerContext* workerContext = static_cast<WorkerContext*>(context); WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy(); WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy); - webWorker->openFileSystemForWorker(static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous), synchronous); + webWorker->openFileSystemForWorker(static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous), synchronous); } } +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +{ + openFileSystemHelper(context, type, callbacks, synchronous, 0, OpenExisting); +} + +void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +{ + openFileSystemHelper(context, type, callbacks, synchronous, size, CreateIfNotPresent); +} + } // namespace WebCore #endif // ENABLE(FILE_SYSTEM) diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp index 18f9fb8..35e03c4 100644 --- a/Source/WebKit/chromium/src/LocalizedStrings.cpp +++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp @@ -257,7 +257,7 @@ String contextMenuItemTagNoGuessesFound() { return String(); } String contextMenuItemTagIgnoreSpelling() { return String(); } String contextMenuItemTagLearnSpelling() { return String(); } String contextMenuItemTagSearchWeb() { return String(); } -String contextMenuItemTagLookUpInDictionary() { return String(); } +String contextMenuItemTagLookUpInDictionary(const String&) { return String(); } String contextMenuItemTagOpenLink() { return String(); } String contextMenuItemTagIgnoreGrammar() { return String(); } String contextMenuItemTagSpellingMenu() { return String(); } diff --git a/Source/WebKit/chromium/src/PlatformMessagePortChannel.h b/Source/WebKit/chromium/src/PlatformMessagePortChannel.h index 5416145..9cd7001 100644 --- a/Source/WebKit/chromium/src/PlatformMessagePortChannel.h +++ b/Source/WebKit/chromium/src/PlatformMessagePortChannel.h @@ -46,7 +46,7 @@ namespace WebCore { class MessagePort; // PlatformMessagePortChannel is a platform-dependent interface to the remote side of a message channel. -class PlatformMessagePortChannel : public ThreadSafeShared<PlatformMessagePortChannel>, +class PlatformMessagePortChannel : public ThreadSafeRefCounted<PlatformMessagePortChannel>, public WebKit::WebMessagePortChannelClient { public: static void createChannel(PassRefPtr<MessagePort>, PassRefPtr<MessagePort>); diff --git a/Source/WebKit/chromium/src/ResourceHandle.cpp b/Source/WebKit/chromium/src/ResourceHandle.cpp index 72f60bb..f88a48a 100644 --- a/Source/WebKit/chromium/src/ResourceHandle.cpp +++ b/Source/WebKit/chromium/src/ResourceHandle.cpp @@ -72,7 +72,11 @@ public: virtual void didSendData( WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); + virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived); + + // FIXME(vsevik): remove once not used downstream virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*, double finishTime); virtual void didFail(WebURLLoader*, const WebURLError&); @@ -159,18 +163,20 @@ void ResourceHandleInternal::didReceiveResponse(WebURLLoader*, const WebURLRespo m_client->didReceiveResponse(m_owner, response.toResourceResponse()); } -void ResourceHandleInternal::didReceiveData( - WebURLLoader*, const char* data, int dataLength) +// FIXME(vsevik): remove once not used +void ResourceHandleInternal::didReceiveData(WebURLLoader* webURLLoader, const char* data, int dataLength) +{ + didReceiveData2(webURLLoader, data, dataLength, -1); +} + +void ResourceHandleInternal::didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateReceivingData; - // FIXME(yurys): it looks like lengthReceived is always the same as - // dataLength and that the latter parameter can be eliminated. - // See WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=31019 - m_client->didReceiveData(m_owner, data, dataLength, dataLength); + m_client->didReceiveData(m_owner, data, dataLength, lengthReceived); } void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) diff --git a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp index ec0dbce..ef19b2f 100644 --- a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp +++ b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp @@ -92,6 +92,21 @@ void StorageNamespaceProxy::unlock() // FIXME: Implement. } +void StorageNamespaceProxy::clearOriginForDeletion(SecurityOrigin* origin) +{ + ASSERT_NOT_REACHED(); +} + +void StorageNamespaceProxy::clearAllOriginsForDeletion() +{ + ASSERT_NOT_REACHED(); +} + +void StorageNamespaceProxy::sync() +{ + ASSERT_NOT_REACHED(); +} + } // namespace WebCore #endif // ENABLE(DOM_STORAGE) diff --git a/Source/WebKit/chromium/src/StorageNamespaceProxy.h b/Source/WebKit/chromium/src/StorageNamespaceProxy.h index 28d7a23..9388531 100644 --- a/Source/WebKit/chromium/src/StorageNamespaceProxy.h +++ b/Source/WebKit/chromium/src/StorageNamespaceProxy.h @@ -43,6 +43,11 @@ public: virtual PassRefPtr<StorageNamespace> copy(); virtual void close(); virtual void unlock(); + + virtual void clearOriginForDeletion(SecurityOrigin*); + virtual void clearAllOriginsForDeletion(); + + virtual void sync(); private: OwnPtr<WebKit::WebStorageNamespace> m_storageNamespace; diff --git a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp index 30305bd..8df112a 100644 --- a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -537,6 +537,12 @@ WebString WebAccessibilityObject::computedStyleDisplay() const return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStringValue()); } +bool WebAccessibilityObject::accessibilityIsIgnored() const +{ + m_private->updateBackingStore(); + return m_private->accessibilityIsIgnored(); +} + WebAccessibilityObject::WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>& object) : m_private(static_cast<WebAccessibilityObjectPrivate*>(object.releaseRef())) { diff --git a/Source/WebKit/chromium/src/WebBindings.cpp b/Source/WebKit/chromium/src/WebBindings.cpp index 0882e38..4012d1c 100644 --- a/Source/WebKit/chromium/src/WebBindings.cpp +++ b/Source/WebKit/chromium/src/WebBindings.cpp @@ -35,25 +35,18 @@ #include "npruntime_priv.h" #if USE(V8) -#include "ChromiumDataObject.h" -#include "ClipboardChromium.h" -#include "EventNames.h" -#include "MouseEvent.h" #include "NPV8Object.h" // for PrivateIdentifier #include "Range.h" #include "V8BindingState.h" #include "V8DOMWrapper.h" #include "V8Element.h" -#include "V8Event.h" -#include "V8Helpers.h" -#include "V8HiddenPropertyName.h" #include "V8NPUtils.h" +#include "V8Node.h" #include "V8Proxy.h" #include "V8Range.h" #elif USE(JSC) #include "bridge/c/c_utility.h" #endif -#include "WebDragData.h" #include "WebElement.h" #include "WebRange.h" @@ -65,9 +58,9 @@ using namespace WebCore; namespace WebKit { -bool WebBindings::construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant* result) +bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_Construct(npp, npobj, args, argCount, result); + return _NPN_Construct(npp, object, args, argCount, result); } NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) @@ -75,19 +68,19 @@ NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) return _NPN_CreateObject(npp, npClass); } -bool WebBindings::enumerate(NPP id, NPObject* obj, NPIdentifier** identifier, uint32_t* val) +bool WebBindings::enumerate(NPP npp, NPObject* object, NPIdentifier** identifier, uint32_t* identifierCount) { - return _NPN_Enumerate(id, obj, identifier, val); + return _NPN_Enumerate(npp, object, identifier, identifierCount); } -bool WebBindings::evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result) +bool WebBindings::evaluate(NPP npp, NPObject* object, NPString* script, NPVariant* result) { - return _NPN_Evaluate(npp, npObject, npScript, result); + return _NPN_Evaluate(npp, object, script, result); } -bool WebBindings::evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result) +bool WebBindings::evaluateHelper(NPP npp, bool popupsAllowed, NPObject* object, NPString* script, NPVariant* result) { - return _NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result); + return _NPN_EvaluateHelper(npp, popupsAllowed, object, script, result); } NPIdentifier WebBindings::getIntIdentifier(int32_t number) @@ -95,9 +88,9 @@ NPIdentifier WebBindings::getIntIdentifier(int32_t number) return _NPN_GetIntIdentifier(number); } -bool WebBindings::getProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, NPVariant *result) +bool WebBindings::getProperty(NPP npp, NPObject* object, NPIdentifier property, NPVariant* result) { - return _NPN_GetProperty(npp, obj, propertyName, result); + return _NPN_GetProperty(npp, object, property, result); } NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string) @@ -110,14 +103,14 @@ void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, _NPN_GetStringIdentifiers(names, nameCount, identifiers); } -bool WebBindings::hasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName) +bool WebBindings::hasMethod(NPP npp, NPObject* object, NPIdentifier method) { - return _NPN_HasMethod(npp, npObject, methodName); + return _NPN_HasMethod(npp, object, method); } -bool WebBindings::hasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName) +bool WebBindings::hasProperty(NPP npp, NPObject* object, NPIdentifier property) { - return _NPN_HasProperty(npp, npObject, propertyName); + return _NPN_HasProperty(npp, object, property); } bool WebBindings::identifierIsString(NPIdentifier identifier) @@ -139,19 +132,19 @@ void WebBindings::initializeVariantWithStringCopy(NPVariant* variant, const NPSt #endif } -bool WebBindings::invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) +bool WebBindings::invoke(NPP npp, NPObject* object, NPIdentifier method, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_Invoke(npp, npObject, methodName, arguments, argumentCount, result); + return _NPN_Invoke(npp, object, method, args, argCount, result); } -bool WebBindings::invokeDefault(NPP id, NPObject* obj, const NPVariant* args, uint32_t count, NPVariant* result) +bool WebBindings::invokeDefault(NPP npp, NPObject* object, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_InvokeDefault(id, obj, args, count, result); + return _NPN_InvokeDefault(npp, object, args, argCount, result); } -void WebBindings::releaseObject(NPObject* npObject) +void WebBindings::releaseObject(NPObject* object) { - return _NPN_ReleaseObject(npObject); + return _NPN_ReleaseObject(object); } void WebBindings::releaseVariantValue(NPVariant* variant) @@ -159,30 +152,30 @@ void WebBindings::releaseVariantValue(NPVariant* variant) _NPN_ReleaseVariantValue(variant); } -bool WebBindings::removeProperty(NPP id, NPObject* object, NPIdentifier identifier) +bool WebBindings::removeProperty(NPP npp, NPObject* object, NPIdentifier identifier) { - return _NPN_RemoveProperty(id, object, identifier); + return _NPN_RemoveProperty(npp, object, identifier); } -NPObject* WebBindings::retainObject(NPObject* npObject) +NPObject* WebBindings::retainObject(NPObject* object) { - return _NPN_RetainObject(npObject); + return _NPN_RetainObject(object); } -void WebBindings::setException(NPObject* obj, const NPUTF8* message) +void WebBindings::setException(NPObject* object, const NPUTF8* message) { - _NPN_SetException(obj, message); + _NPN_SetException(object, message); } -bool WebBindings::setProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant* variant) +bool WebBindings::setProperty(NPP npp, NPObject* object, NPIdentifier identifier, const NPVariant* value) { - return _NPN_SetProperty(id, obj, identifier, variant); + return _NPN_SetProperty(npp, object, identifier, value); } -void WebBindings::unregisterObject(NPObject* npObject) +void WebBindings::unregisterObject(NPObject* object) { #if USE(V8) - _NPN_UnregisterObject(npObject); + _NPN_UnregisterObject(object); #endif } @@ -193,116 +186,46 @@ NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier) void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NPUTF8*& string, int32_t& number, bool& isString) { - PrivateIdentifier* priv = static_cast<PrivateIdentifier*>(identifier); - if (!priv) { + PrivateIdentifier* data = static_cast<PrivateIdentifier*>(identifier); + if (!data) { isString = false; number = 0; return; } - isString = priv->isString; + isString = data->isString; if (isString) - string = priv->value.string; + string = data->value.string; else - number = priv->value.number; + number = data->value.number; } #if USE(V8) -static v8::Local<v8::Value> getEvent(const v8::Handle<v8::Context>& context) +static bool getRangeImpl(NPObject* object, WebRange* webRange) { - return context->Global()->GetHiddenValue(V8HiddenPropertyName::event()); -} - -static bool getDragDataImpl(NPObject* npobj, int* eventId, WebDragData* data) -{ - if (!npobj) - return false; - if (npobj->_class != npScriptObjectClass) - return false; - - v8::HandleScope handleScope; - v8::Handle<v8::Context> context = v8::Context::GetEntered(); - if (context.IsEmpty()) - return false; - - // Get the current WebCore event. - v8::Handle<v8::Value> currentEvent(getEvent(context)); - Event* event = V8Event::toNative(v8::Handle<v8::Object>::Cast(currentEvent)); - if (!event) - return false; - - // Check that the given npobj is that event. - V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj); - Event* given = V8Event::toNative(object->v8Object); - if (given != event) - return false; - - // Check the execution frames are same origin. - V8Proxy* current = V8Proxy::retrieve(V8Proxy::retrieveFrameForCurrentContext()); - Frame* frame = V8Proxy::retrieveFrame(context); - if (!current || !V8BindingSecurity::canAccessFrame(V8BindingState::Only(), frame, false)) - return false; - - const EventNames& names(eventNames()); - const AtomicString& eventType(event->type()); - - enum DragTargetMouseEventId { - DragEnterId = 1, DragOverId = 2, DragLeaveId = 3, DropId = 4 - }; - - // The event type should be a drag event. - if (eventType == names.dragenterEvent) - *eventId = DragEnterId; - else if (eventType == names.dragoverEvent) - *eventId = DragOverId; - else if (eventType == names.dragleaveEvent) - *eventId = DragLeaveId; - else if (eventType == names.dropEvent) - *eventId = DropId; - else - return false; - - // Drag events are mouse events and should have a clipboard. - MouseEvent* me = static_cast<MouseEvent*>(event); - Clipboard* clipboard = me->clipboard(); - if (!clipboard) + if (!object || (object->_class != npScriptObjectClass)) return false; - // And that clipboard should be accessible by WebKit policy. - ClipboardChromium* chrome = static_cast<ClipboardChromium*>(clipboard); - HashSet<String> accessible(chrome->types()); - if (accessible.isEmpty()) - return false; - - RefPtr<ChromiumDataObject> dataObject(chrome->dataObject()); - if (dataObject && data) - *data = WebDragData(dataObject); - - return dataObject; -} - -static bool getRangeImpl(NPObject* npobj, WebRange* range) -{ - V8NPObject* v8npobject = reinterpret_cast<V8NPObject*>(npobj); - v8::Handle<v8::Object> v8object(v8npobject->v8Object); - if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8object))) + V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); + v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8Object))) return false; - Range* native = V8Range::toNative(v8object); + Range* native = V8Range::toNative(v8Object); if (!native) return false; - *range = WebRange(native); + *webRange = WebRange(native); return true; } -static bool getElementImpl(NPObject* npObj, WebElement* webElement) +static bool getElementImpl(NPObject* object, WebElement* webElement) { - if (!npObj || (npObj->_class != npScriptObjectClass)) + if (!object || (object->_class != npScriptObjectClass)) return false; - V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(npObj); + V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); Element* native = V8Element::toNative(v8Object); if (!native) @@ -316,7 +239,7 @@ static NPObject* makeIntArrayImpl(const WebVector<int>& data) { v8::HandleScope handleScope; v8::Handle<v8::Array> result = v8::Array::New(data.size()); - for (size_t i = 0; i < data.size(); i++) + for (size_t i = 0; i < data.size(); ++i) result->Set(i, v8::Number::New(data[i])); WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); @@ -334,28 +257,22 @@ static NPObject* makeStringArrayImpl(const WebVector<WebString>& data) return npCreateV8ScriptObject(0, result, window); } -#endif - -bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data) +static NPObject* makeNodeImpl(WebNode data) { -#if USE(V8) - return getDragDataImpl(event, eventId, data); -#else - // Not supported on other ports (JSC, etc). - return false; -#endif + v8::HandleScope handleScope; + if (data.isNull()) + return 0; + v8::Handle<v8::Object> result = V8Node::wrap(data.unwrap<Node>()); + WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); + return npCreateV8ScriptObject(0, result, window); } -bool WebBindings::isDragEvent(NPObject* event) -{ - int eventId; - return getDragData(event, &eventId, 0); -} +#endif -bool WebBindings::getRange(NPObject* range, WebRange* webrange) +bool WebBindings::getRange(NPObject* range, WebRange* webRange) { #if USE(V8) - return getRangeImpl(range, webrange); + return getRangeImpl(range, webRange); #else // Not supported on other ports (JSC, etc). return false; @@ -372,7 +289,7 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement) #endif } -NPObject* WebBindings::makeIntArray(const WebVector<int> & data) +NPObject* WebBindings::makeIntArray(const WebVector<int>& data) { #if USE(V8) return makeIntArrayImpl(data); @@ -392,6 +309,16 @@ NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data) #endif } +NPObject* WebBindings::makeNode(const WebNode& data) +{ +#if USE(V8) + return makeNodeImpl(data); +#else + // Not supported on other ports (JSC, etc.). + return 0; +#endif +} + void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) { WebCore::pushExceptionHandler(handler, data); diff --git a/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp b/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp index bfeae37..1e65888 100644 --- a/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp +++ b/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp @@ -57,24 +57,24 @@ int WebDOMMouseEvent::clientY() const return constUnwrap<MouseEvent>()->clientY(); } -int WebDOMMouseEvent::layerX() const +int WebDOMMouseEvent::layerX() { - return constUnwrap<MouseEvent>()->layerX(); + return unwrap<MouseEvent>()->layerX(); } -int WebDOMMouseEvent::layerY() const +int WebDOMMouseEvent::layerY() { - return constUnwrap<MouseEvent>()->layerY(); + return unwrap<MouseEvent>()->layerY(); } -int WebDOMMouseEvent::offsetX() const +int WebDOMMouseEvent::offsetX() { - return constUnwrap<MouseEvent>()->offsetX(); + return unwrap<MouseEvent>()->offsetX(); } -int WebDOMMouseEvent::offsetY() const +int WebDOMMouseEvent::offsetY() { - return constUnwrap<MouseEvent>()->offsetY(); + return unwrap<MouseEvent>()->offsetY(); } int WebDOMMouseEvent::pageX() const diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp index 65147fa..1366a80 100644 --- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -174,7 +174,7 @@ WebDataSourceImpl::WebDataSourceImpl(const ResourceRequest& request, const Subst // frame, which results in a second data source being created. We want // to wait to attach the WebPluginLoadObserver to that data source. if (!request.url().isEmpty()) { - ASSERT(m_nextPluginLoadObserver->url() == request.url()); + ASSERT(m_nextPluginLoadObserver->url() == WebURL(request.url())); m_pluginLoadObserver.set(m_nextPluginLoadObserver); m_nextPluginLoadObserver = 0; } diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 6329d76..c1a5f9c 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010-2011 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 @@ -40,13 +40,12 @@ #include "InspectorInstrumentation.h" #include "Page.h" #include "PageGroup.h" +#include "PageScriptDebugServer.h" #include "PlatformString.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "ResourceResponse.h" -#include "ScriptDebugServer.h" #include "V8Binding.h" -#include "V8Node.h" #include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" @@ -73,14 +72,14 @@ namespace { static const char kFrontendConnectedFeatureName[] = "frontend-connected"; static const char kInspectorStateFeatureName[] = "inspector-state"; -class ClientMessageLoopAdapter : public ScriptDebugServer::ClientMessageLoop { +class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop { public: static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) { if (s_instance) return; s_instance = new ClientMessageLoopAdapter(client->createClientMessageLoop()); - ScriptDebugServer::shared().setClientMessageLoop(s_instance); + PageScriptDebugServer::shared().setClientMessageLoop(s_instance); } static void inspectedViewClosed(WebViewImpl* view) @@ -93,7 +92,7 @@ public: { // Release render thread if necessary. if (s_instance && s_instance->m_running) - ScriptDebugServer::shared().continueProgram(); + PageScriptDebugServer::shared().continueProgram(); } private: @@ -187,9 +186,6 @@ void WebDevToolsAgentImpl::attach() m_debuggerAgentImpl.set( new DebuggerAgentImpl(m_webViewImpl, this, m_client)); - WebCString debuggerScriptJs = m_client->debuggerScriptSource(); - ScriptDebugServer::shared().setDebuggerScriptSource( - String(debuggerScriptJs.data(), debuggerScriptJs.length())); m_attached = true; } @@ -230,14 +226,6 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) m_webViewImpl->inspectElementAt(point); } -void WebDevToolsAgentImpl::inspectNode(v8::Handle<v8::Value> node) -{ - if (!V8Node::HasInstance(node)) - V8Proxy::setDOMException(TYPE_MISMATCH_ERR); - else - inspectorController()->inspect(V8Node::toNative(v8::Handle<v8::Object>::Cast(node))); -} - void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value) { if (name == kInspectorStateFeatureName) { @@ -260,49 +248,6 @@ Frame* WebDevToolsAgentImpl::mainFrame() return 0; } - -//------- plugin resource load notifications --------------- -void WebDevToolsAgentImpl::identifierForInitialRequest( - unsigned long resourceId, - WebFrame* webFrame, - const WebURLRequest& request) -{ - WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(webFrame); - Frame* frame = webFrameImpl->frame(); - DocumentLoader* loader = frame->loader()->activeDocumentLoader(); - InspectorInstrumentation::identifierForInitialRequest(frame, resourceId, loader, request.toResourceRequest()); -} - -void WebDevToolsAgentImpl::willSendRequest(unsigned long resourceId, WebURLRequest& request) -{ - if (InspectorController* ic = inspectorController()) { - InspectorInstrumentation::willSendRequest(mainFrame(), resourceId, request.toMutableResourceRequest(), ResourceResponse()); - if (ic->hasFrontend() && request.reportLoadTiming()) - request.setReportRawHeaders(true); - } -} - -void WebDevToolsAgentImpl::didReceiveData(unsigned long resourceId, int length) -{ - InspectorInstrumentation::didReceiveContentLength(mainFrame(), resourceId, length); -} - -void WebDevToolsAgentImpl::didReceiveResponse(unsigned long resourceId, const WebURLResponse& response) -{ - InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(mainFrame(), resourceId, response.toResourceResponse()); - InspectorInstrumentation::didReceiveResourceResponse(cookie, resourceId, 0, response.toResourceResponse()); -} - -void WebDevToolsAgentImpl::didFinishLoading(unsigned long resourceId) -{ - InspectorInstrumentation::didFinishLoading(mainFrame(), resourceId, 0); -} - -void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURLError& error) -{ - InspectorInstrumentation::didFailLoading(mainFrame(), resourceId, error); -} - void WebDevToolsAgentImpl::inspectorDestroyed() { // Our lifetime is bound to the WebViewImpl. @@ -374,7 +319,7 @@ void WebDevToolsAgent::debuggerPauseScript() void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d) { - class DebuggerTask : public ScriptDebugServer::Task { + class DebuggerTask : public PageScriptDebugServer::Task { public: DebuggerTask(WebDevToolsAgent::MessageDescriptor* descriptor) : m_descriptor(descriptor) { } virtual ~DebuggerTask() { } @@ -386,7 +331,7 @@ void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d) private: OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor; }; - ScriptDebugServer::interruptAndRun(new DebuggerTask(d)); + PageScriptDebugServer::interruptAndRun(new DebuggerTask(d)); } bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) @@ -395,18 +340,18 @@ bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) return false; return commandName == InspectorBackendDispatcher::Debugger_pauseCmd - || commandName == InspectorBackendDispatcher::Debugger_setJavaScriptBreakpointCmd - || commandName == InspectorBackendDispatcher::Debugger_removeJavaScriptBreakpointCmd - || commandName == InspectorBackendDispatcher::Debugger_activateBreakpointsCmd - || commandName == InspectorBackendDispatcher::Debugger_deactivateBreakpointsCmd - || commandName == InspectorBackendDispatcher::Inspector_startProfilingCmd - || commandName == InspectorBackendDispatcher::Inspector_stopProfilingCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointByUrlCmd + || commandName == InspectorBackendDispatcher::Debugger_removeBreakpointCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointsActiveCmd + || commandName == InspectorBackendDispatcher::Profiler_startCmd + || commandName == InspectorBackendDispatcher::Profiler_stopCmd || commandName == InspectorBackendDispatcher::Profiler_getProfileCmd; } void WebDevToolsAgent::processPendingMessages() { - ScriptDebugServer::shared().runPendingTasks(); + PageScriptDebugServer::shared().runPendingTasks(); } void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler handler) diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h index 2bc197d..33ca232 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -35,7 +35,6 @@ #include "WebDevToolsAgentPrivate.h" -#include <v8.h> #include <wtf/Forward.h> #include <wtf/OwnPtr.h> @@ -76,18 +75,10 @@ public: virtual void didNavigate(); virtual void dispatchOnInspectorBackend(const WebString& message); virtual void inspectElementAt(const WebPoint& point); - virtual void inspectNode(v8::Handle<v8::Value> node); virtual void evaluateInWebInspector(long callId, const WebString& script); virtual void setRuntimeProperty(const WebString& name, const WebString& value); virtual void setTimelineProfilingEnabled(bool enable); - virtual void identifierForInitialRequest(unsigned long, WebFrame*, const WebURLRequest&); - virtual void willSendRequest(unsigned long, WebURLRequest&); - virtual void didReceiveData(unsigned long, int length); - virtual void didReceiveResponse(unsigned long, const WebURLResponse&); - virtual void didFinishLoading(unsigned long); - virtual void didFailLoading(unsigned long, const WebURLError&); - // InspectorClient implementation. virtual void inspectorDestroyed(); virtual void openInspectorFrontend(WebCore::InspectorController*); diff --git a/Source/WebKit/chromium/src/WebDocument.cpp b/Source/WebKit/chromium/src/WebDocument.cpp index a983bf7..0abf307 100644 --- a/Source/WebKit/chromium/src/WebDocument.cpp +++ b/Source/WebKit/chromium/src/WebDocument.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "WebDocument.h" +#include "AXObjectCache.h" #include "Document.h" #include "DocumentType.h" #include "Element.h" @@ -41,6 +42,7 @@ #include "HTMLHeadElement.h" #include "NodeList.h" +#include "WebAccessibilityObject.h" #include "WebDocumentType.h" #include "WebElement.h" #include "WebFrameImpl.h" @@ -129,6 +131,13 @@ WebDocumentType WebDocument::doctype() const return WebDocumentType(constUnwrap<Document>()->doctype()); } +WebAccessibilityObject WebDocument::accessibilityObject() const +{ + const Document* document = constUnwrap<Document>(); + return WebAccessibilityObject( + document->axObjectCache()->getOrCreate(document->renderer())); +} + WebDocument::WebDocument(const PassRefPtr<Document>& elem) : WebNode(elem) { diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index 34daa34..ee7ec09 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -90,6 +90,11 @@ WebString WebElement::innerText() const return constUnwrap<Element>()->innerText(); } +WebNode WebElement::shadowRoot() +{ + return adoptRef(unwrap<Element>()->shadowRoot()); +} + WebString WebElement::computeInheritedLanguage() const { return WebString(constUnwrap<Element>()->computeInheritedLanguage()); diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp index 0c71f80..58d56e9 100644 --- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp @@ -72,6 +72,7 @@ void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& webFileInfo) fileMetadata.modificationTime = webFileInfo.modificationTime; fileMetadata.length = webFileInfo.length; fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); + fileMetadata.platformPath = webFileInfo.platformPath; m_callbacks->didReadMetadata(fileMetadata); delete this; } diff --git a/Source/WebKit/chromium/src/WebFormControlElement.cpp b/Source/WebKit/chromium/src/WebFormControlElement.cpp index d2bc8ab..f00b058 100644 --- a/Source/WebKit/chromium/src/WebFormControlElement.cpp +++ b/Source/WebKit/chromium/src/WebFormControlElement.cpp @@ -43,6 +43,11 @@ bool WebFormControlElement::isEnabled() const return constUnwrap<HTMLFormControlElement>()->isEnabledFormControl(); } +bool WebFormControlElement::isReadOnly() const +{ + return constUnwrap<HTMLFormControlElement>()->readOnly(); +} + WebString WebFormControlElement::formControlName() const { return constUnwrap<HTMLFormControlElement>()->name(); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 53e1d44..fdfb14e 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -1052,11 +1052,17 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) 0, 0, request.toMutableResourceRequest(), response); } +// FIXME: Remove this overload when clients have been changed to pass options. WebURLLoader* WebFrameImpl::createAssociatedURLLoader() { return new AssociatedURLLoader(this); } +WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions& options) +{ + return new AssociatedURLLoader(this, options); +} + void WebFrameImpl::commitDocumentData(const char* data, size_t length) { m_frame->loader()->documentLoader()->commitData(data, length); @@ -1077,11 +1083,6 @@ bool WebFrameImpl::willSuppressOpenerInNewFrame() const return frame()->loader()->suppressOpenerInNewFrame(); } -bool WebFrameImpl::pageDismissalEventBeingDispatched() const -{ - return frame()->loader()->pageDismissalEventBeingDispatched(); -} - void WebFrameImpl::replaceSelection(const WebString& text) { RefPtr<DocumentFragment> fragment = createFragmentFromText( @@ -1583,8 +1584,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, // find an alternative. RefPtr<Range> resultRange(findPlainText(searchRange.get(), searchText, - true, - options.matchCase)); + options.matchCase ? 0 : CaseInsensitive)); if (resultRange->collapsed(ec)) { if (!resultRange->startContainer()->isInShadowTree()) break; @@ -1742,9 +1742,18 @@ WebString WebFrameImpl::contentAsMarkup() const return createFullMarkup(m_frame->document()); } -WebString WebFrameImpl::renderTreeAsText() const +WebString WebFrameImpl::renderTreeAsText(bool showDebugInfo) const { - return externalRepresentation(m_frame); + RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal; + + if (showDebugInfo) { + behavior |= RenderAsTextShowCompositedLayers + | RenderAsTextShowAddresses + | RenderAsTextShowIDAndClass + | RenderAsTextShowLayerNesting; + } + + return externalRepresentation(m_frame, behavior); } WebString WebFrameImpl::counterValueForElementById(const WebString& id) const @@ -1791,7 +1800,7 @@ bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) cons { if (!m_frame) return false; - return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length); + return m_frame->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); } bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time, const WebString& elementId) @@ -1814,11 +1823,11 @@ bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time, #endif } -WebString WebFrameImpl::layerTreeAsText() const +WebString WebFrameImpl::layerTreeAsText(bool showDebugInfo) const { if (!m_frame) return WebString(); - return WebString(m_frame->layerTreeAsText()); + return WebString(m_frame->layerTreeAsText(showDebugInfo)); } // WebFrameImpl public --------------------------------------------------------- diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 179051e..6129de1 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -133,12 +133,13 @@ public: virtual bool isViewSourceModeEnabled() const; virtual void setReferrerForRequest(WebURLRequest&, const WebURL& referrer); virtual void dispatchWillSendRequest(WebURLRequest&); + // FIXME: Remove this overload when clients have been changed to pass options. virtual WebURLLoader* createAssociatedURLLoader(); + virtual WebURLLoader* createAssociatedURLLoader(const WebURLLoaderOptions&); virtual void commitDocumentData(const char* data, size_t length); virtual unsigned unloadListenerCount() const; virtual bool isProcessingUserGesture() const; virtual bool willSuppressOpenerInNewFrame() const; - virtual bool pageDismissalEventBeingDispatched() const; virtual void replaceSelection(const WebString&); virtual void insertText(const WebString&); virtual void setMarkedText(const WebString&, unsigned location, unsigned length); @@ -187,7 +188,7 @@ public: virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; - virtual WebString renderTreeAsText() const; + virtual WebString renderTreeAsText(bool showDebugInfo = false) const; virtual WebString counterValueForElementById(const WebString& id) const; virtual WebString markerTextForListItem(const WebElement&) const; virtual int pageNumberForElementById(const WebString& id, @@ -199,7 +200,7 @@ public: virtual bool pauseSVGAnimation(const WebString& animationId, double time, const WebString& elementId); - virtual WebString layerTreeAsText() const; + virtual WebString layerTreeAsText(bool showDebugInfo = false) const; static PassRefPtr<WebFrameImpl> create(WebFrameClient* client); ~WebFrameImpl(); diff --git a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp index 1ec3dd1..0ad47da 100644 --- a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp +++ b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp @@ -82,6 +82,11 @@ void WebGeolocationClientMock::setPermission(bool allowed) m_clientMock->setPermission(allowed); } +int WebGeolocationClientMock::numberOfPendingPermissionRequests() const +{ + return m_clientMock->numberOfPendingPermissionRequests(); +} + void WebGeolocationClientMock::resetMock() { m_clientMock->reset(); diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index 38ac360..ce307a4 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -30,13 +30,11 @@ #include "IDBCursorBackendProxy.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" -#include "IDBIndexBackendProxy.h" #include "IDBKey.h" #include "IDBTransactionBackendProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" -#include "WebIDBIndex.h" #include "WebIDBKey.h" #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" @@ -74,11 +72,6 @@ void WebIDBCallbacksImpl::onSuccess(const WebKit::WebIDBKey& key) m_callbacks->onSuccess(key); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBIndex* webKitInstance) -{ - m_callbacks->onSuccess(IDBIndexBackendProxy::create(webKitInstance)); -} - void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBTransaction* webKitInstance) { m_callbacks->onSuccess(IDBTransactionBackendProxy::create(webKitInstance)); diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h index 9dd59a5..057aa25 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -45,7 +45,6 @@ public: virtual void onSuccess(WebKit::WebIDBCursor*); virtual void onSuccess(WebKit::WebIDBDatabase*); virtual void onSuccess(const WebKit::WebIDBKey&); - virtual void onSuccess(WebKit::WebIDBIndex*); virtual void onSuccess(WebKit::WebIDBTransaction*); virtual void onSuccess(const WebKit::WebSerializedScriptValue&); virtual void onBlocked(); diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp index a509076..3e21af5 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl() { } -void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize) +void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType backingStoreType) { - m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize); + m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType)); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h index 9ed6e3f..0ffd289 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -42,7 +42,7 @@ public: WebIDBFactoryImpl(); virtual ~WebIDBFactoryImpl(); - virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize); + virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType); private: WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend; diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 9fe6166..56e354d 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -28,6 +28,7 @@ #include "DOMStringList.h" #include "IDBCallbacksProxy.h" +#include "IDBIndexBackendInterface.h" #include "IDBKeyRange.h" #include "IDBObjectStoreBackendInterface.h" #include "WebIDBIndexImpl.h" diff --git a/Source/WebKit/chromium/src/WebInputElement.cpp b/Source/WebKit/chromium/src/WebInputElement.cpp index 548f1bb..3448bb6 100644 --- a/Source/WebKit/chromium/src/WebInputElement.cpp +++ b/Source/WebKit/chromium/src/WebInputElement.cpp @@ -65,16 +65,6 @@ bool WebInputElement::autoComplete() const return constUnwrap<HTMLInputElement>()->autoComplete(); } -bool WebInputElement::isReadOnly() const -{ - return constUnwrap<HTMLInputElement>()->readOnly(); -} - -bool WebInputElement::isEnabledFormControl() const -{ - return constUnwrap<HTMLInputElement>()->isEnabledFormControl(); -} - int WebInputElement::maxLength() const { return constUnwrap<HTMLInputElement>()->maxLength(); @@ -183,7 +173,7 @@ WebInputElement::operator PassRefPtr<HTMLInputElement>() const WebInputElement* toWebInputElement(WebElement* webElement) { - InputElement* inputElement = toInputElement(webElement->unwrap<Element>()); + InputElement* inputElement = webElement->unwrap<Element>()->toInputElement(); if (!inputElement) return 0; diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index a1b428c..abe9cbf 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -183,6 +183,12 @@ float WebMediaPlayerClientImpl::volume() const return 0.0f; } +void WebMediaPlayerClientImpl::playbackStateChanged() +{ + ASSERT(m_mediaPlayer); + m_mediaPlayer->playbackStateChanged(); +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 5d44626..22030b3 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -76,6 +76,7 @@ public: virtual void sizeChanged(); virtual void sawUnsupportedTracks(); virtual float volume() const; + virtual void playbackStateChanged(); // MediaPlayerPrivateInterface methods: virtual void load(const WTF::String& url); diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index e91d1ee..68b6f13 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -145,9 +145,14 @@ bool WebNode::isTextNode() const return m_private->isTextNode(); } +bool WebNode::isFocusable() const +{ + return m_private->isFocusable(); +} + bool WebNode::isContentEditable() const { - return m_private->isContentEditable(); + return m_private->rendererIsEditable(); } bool WebNode::isElementNode() const diff --git a/Source/WebKit/chromium/src/WebPageSerializer.cpp b/Source/WebKit/chromium/src/WebPageSerializer.cpp index 1fda484..c8c7529 100644 --- a/Source/WebKit/chromium/src/WebPageSerializer.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializer.cpp @@ -31,19 +31,152 @@ #include "config.h" #include "WebPageSerializer.h" +#include "DocumentLoader.h" +#include "Element.h" +#include "Frame.h" +#include "HTMLAllCollection.h" +#include "HTMLFrameOwnerElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" #include "KURL.h" +#include "Vector.h" +#include "WebCString.h" #include "WebFrame.h" +#include "WebFrameImpl.h" #include "WebPageSerializerClient.h" #include "WebPageSerializerImpl.h" #include "WebString.h" #include "WebURL.h" #include "WebVector.h" +#include "WebView.h" #include <wtf/text/StringConcatenate.h> using namespace WebCore; +namespace { + +KURL getSubResourceURLFromElement(Element* element) +{ + ASSERT(element); + const QualifiedName* attributeName = 0; + if (element->hasTagName(HTMLNames::imgTag) || element->hasTagName(HTMLNames::scriptTag)) + attributeName = &HTMLNames::srcAttr; + else if (element->hasTagName(HTMLNames::inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(element); + if (input->isImageButton()) + attributeName = &HTMLNames::srcAttr; + } else if (element->hasTagName(HTMLNames::bodyTag) + || element->hasTagName(HTMLNames::tableTag) + || element->hasTagName(HTMLNames::trTag) + || element->hasTagName(HTMLNames::tdTag)) + attributeName = &HTMLNames::backgroundAttr; + else if (element->hasTagName(HTMLNames::blockquoteTag) + || element->hasTagName(HTMLNames::qTag) + || element->hasTagName(HTMLNames::delTag) + || element->hasTagName(HTMLNames::insTag)) + attributeName = &HTMLNames::citeAttr; + else if (element->hasTagName(HTMLNames::linkTag)) { + // If the link element is not css, ignore it. + if (equalIgnoringCase(element->getAttribute(HTMLNames::typeAttr), "text/css")) { + // FIXME: Add support for extracting links of sub-resources which + // are inside style-sheet such as @import, @font-face, url(), etc. + attributeName = &HTMLNames::hrefAttr; + } + } else if (element->hasTagName(HTMLNames::objectTag)) + attributeName = &HTMLNames::dataAttr; + else if (element->hasTagName(HTMLNames::embedTag)) + attributeName = &HTMLNames::srcAttr; + + if (!attributeName) + return KURL(); + + String value = element->getAttribute(*attributeName); + // Ignore javascript content. + if (value.isEmpty() || value.stripWhiteSpace().startsWith("javascript:", false)) + return KURL(); + + return element->document()->completeURL(value); +} + +void retrieveResourcesForElement(Element* element, + Vector<Frame*>* visitedFrames, + Vector<Frame*>* framesToVisit, + Vector<KURL>* frameURLs, + Vector<KURL>* resourceURLs) +{ + // If the node is a frame, we'll process it later in retrieveResourcesForFrame. + if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag) + || element->hasTagName(HTMLNames::objectTag) || element->hasTagName(HTMLNames::embedTag)) + && element->isFrameOwnerElement()) { + Frame* frame = static_cast<HTMLFrameOwnerElement*>(element)->contentFrame(); + if (frame) { + if (!visitedFrames->contains(frame)) + framesToVisit->append(frame); + return; + } + } + + KURL url = getSubResourceURLFromElement(element); + if (url.isEmpty() || !url.isValid()) + return; // No subresource for this node. + + // Ignore URLs that have a non-standard protocols. Since the FTP protocol + // does no have a cache mechanism, we skip it as well. + if (!url.protocolInHTTPFamily() && !url.isLocalFile()) + return; + + if (!resourceURLs->contains(url)) + resourceURLs->append(url); +} + +void retrieveResourcesForFrame(Frame* frame, + const WebKit::WebVector<WebKit::WebCString>& supportedSchemes, + Vector<Frame*>* visitedFrames, + Vector<Frame*>* framesToVisit, + Vector<KURL>* frameURLs, + Vector<KURL>* resourceURLs) +{ + KURL frameURL = frame->loader()->documentLoader()->request().url(); + + // If the frame's URL is invalid, ignore it, it is not retrievable. + if (!frameURL.isValid()) + return; + + // Ignore frames from unsupported schemes. + bool isValidScheme = false; + for (size_t i = 0; i < supportedSchemes.size(); ++i) { + if (frameURL.protocolIs(static_cast<CString>(supportedSchemes[i]).data())) { + isValidScheme = true; + break; + } + } + if (!isValidScheme) + return; + + // If we have already seen that frame, ignore it. + if (visitedFrames->contains(frame)) + return; + visitedFrames->append(frame); + if (!frameURLs->contains(frameURL)) + frameURLs->append(frameURL); + + // Now get the resources associated with each node of the document. + RefPtr<HTMLAllCollection> allNodes = frame->document()->all(); + for (unsigned i = 0; i < allNodes->length(); ++i) { + Node* node = allNodes->item(i); + // We are only interested in HTML resources. + if (!node->isElementNode()) + continue; + retrieveResourcesForElement(static_cast<Element*>(node), + visitedFrames, framesToVisit, + frameURLs, resourceURLs); + } +} + +} // namespace + namespace WebKit { bool WebPageSerializer::serialize(WebFrame* frame, @@ -58,6 +191,48 @@ bool WebPageSerializer::serialize(WebFrame* frame, return serializerImpl.serialize(); } +bool WebPageSerializer::retrieveAllResources(WebView* view, + const WebVector<WebCString>& supportedSchemes, + WebVector<WebURL>* resourceURLs, + WebVector<WebURL>* frameURLs) { + WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(view->mainFrame()); + if (!mainFrame) + return false; + + Vector<Frame*> framesToVisit; + Vector<Frame*> visitedFrames; + Vector<KURL> frameKURLs; + Vector<KURL> resourceKURLs; + + // Let's retrieve the resources from every frame in this page. + framesToVisit.append(mainFrame->frame()); + while (!framesToVisit.isEmpty()) { + Frame* frame = framesToVisit[0]; + framesToVisit.remove(0); + retrieveResourcesForFrame(frame, supportedSchemes, + &visitedFrames, &framesToVisit, + &frameKURLs, &resourceKURLs); + } + + // Converts the results to WebURLs. + WebVector<WebURL> resultResourceURLs(resourceKURLs.size()); + for (size_t i = 0; i < resourceKURLs.size(); ++i) { + resultResourceURLs[i] = resourceKURLs[i]; + // A frame's src can point to the same URL as another resource, keep the + // resource URL only in such cases. + size_t index = frameKURLs.find(resourceKURLs[i]); + if (index != notFound) + frameKURLs.remove(index); + } + *resourceURLs = resultResourceURLs; + WebVector<WebURL> resultFrameURLs(frameKURLs.size()); + for (size_t i = 0; i < frameKURLs.size(); ++i) + resultFrameURLs[i] = frameKURLs[i]; + *frameURLs = resultFrameURLs; + + return true; +} + WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& charset) { return makeString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=", static_cast<const String&>(charset), "\">"); @@ -77,4 +252,4 @@ WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar return makeString("<base href=\".\" target=\"", static_cast<const String&>(baseTarget), "\">"); } -} // namespace WebKit +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index bb1b083..40f8625 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -164,6 +164,7 @@ void WebPluginContainerImpl::handleEvent(Event* event) if (!m_webPlugin->acceptsInputEvents()) return; + RefPtr<WebPluginContainerImpl> protector(this); // The events we pass are defined at: // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/structures5.html#1000000 // Don't take the documentation as truth, however. There are many cases @@ -307,6 +308,22 @@ void WebPluginContainerImpl::reportGeometry() m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); } +void WebPluginContainerImpl::setBackingTextureId(unsigned id) +{ +#if USE(ACCELERATED_COMPOSITING) + unsigned currId = m_platformLayer->textureId(); + if (currId == id) + return; + + m_platformLayer->setTextureId(id); + // If anyone of the IDs is zero we need to switch between hardware + // and software compositing. This is done by triggering a style recalc + // on the container element. + if (!(currId * id)) + m_element->setNeedsStyleRecalc(WebCore::SyntheticStyleChange); +#endif +} + void WebPluginContainerImpl::commitBackingTexture() { #if USE(ACCELERATED_COMPOSITING) @@ -427,15 +444,7 @@ void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver #if USE(ACCELERATED_COMPOSITING) WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const { - // FIXME: In the event of a context lost, the texture needs to be recreated on the compositor's - // context and rebound to the platform layer here. - unsigned backingTextureId = m_webPlugin->getBackingTextureId(); - if (!backingTextureId) - return 0; - - m_platformLayer->setTextureId(backingTextureId); - - return m_platformLayer.get(); + return m_platformLayer->textureId() ? m_platformLayer.get() : 0; } #endif diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index ebe6983..9922932 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -84,6 +84,7 @@ public: virtual void invalidateRect(const WebRect&); virtual void scrollRect(int dx, int dy, const WebRect&); virtual void reportGeometry(); + virtual void setBackingTextureId(unsigned); virtual void commitBackingTexture(); virtual void clearScriptObjects(); virtual NPObject* scriptableObjectForElement(); diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index e3ece6e..256bf56 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -152,6 +152,22 @@ bool WebRuntimeFeatures::isApplicationCacheEnabled() #endif } +void WebRuntimeFeatures::enableDataTransferItems(bool enable) +{ +#if ENABLE(DATA_TRANSFER_ITEMS) + RuntimeEnabledFeatures::setDataTransferItemsEnabled(enable); +#endif +} + +bool WebRuntimeFeatures::isDataTransferItemsEnabled() +{ +#if ENABLE(DATA_TRANSFER_ITEMS) + return RuntimeEnabledFeatures::dataTransferItemsEnabled(); +#else + return false; +#endif +} + void WebRuntimeFeatures::enableGeolocation(bool enable) { #if ENABLE(GEOLOCATION) @@ -200,22 +216,6 @@ bool WebRuntimeFeatures::isWebAudioEnabled() #endif } -void WebRuntimeFeatures::enableWebGL(bool enable) -{ -#if ENABLE(WEBGL) - RuntimeEnabledFeatures::setWebGLEnabled(enable); -#endif -} - -bool WebRuntimeFeatures::isWebGLEnabled() -{ -#if ENABLE(WEBGL) - return RuntimeEnabledFeatures::webGLRenderingContextEnabled(); -#else - return false; -#endif -} - void WebRuntimeFeatures::enablePushState(bool enable) { RuntimeEnabledFeatures::setPushStateEnabled(enable); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index e5d172e..1089af9 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -308,6 +308,11 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) m_settings->setAcceleratedCompositingEnabled(enabled); } +void WebSettingsImpl::setForceCompositingMode(bool enabled) +{ + m_settings->setForceCompositingMode(enabled); +} + void WebSettingsImpl::setCompositeToTextureEnabled(bool enabled) { m_compositeToTextureEnabled = enabled; diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 323a5b3..d0319f8 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -94,6 +94,7 @@ public: virtual bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); + virtual void setForceCompositingMode(bool); virtual void setCompositeToTextureEnabled(bool); virtual bool compositeToTextureEnabled() const { return m_compositeToTextureEnabled; } virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index 2759790..b9e5227 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -43,7 +43,7 @@ static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextChecking { Vector<SpellCheckingResult> coreResults; for (size_t i = 0; i < results.size(); ++i) - coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error()), results[i].position(), results[i].length())); + coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length)); return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 6ae4f35..4efa880 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -77,7 +77,6 @@ #include "PageGroup.h" #include "PageGroupLoadDeferrer.h" #include "Pasteboard.h" -#include "PlatformBridge.h" #include "PlatformContextSkia.h" #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" @@ -93,6 +92,7 @@ #include "Settings.h" #include "SpeechInputClientImpl.h" #include "Timer.h" +#include "TraceEvent.h" #include "TypingCommand.h" #include "UserGestureIndicator.h" #include "Vector.h" @@ -126,6 +126,7 @@ #include <wtf/RefPtr.h> #if PLATFORM(CG) +#include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> #endif @@ -211,13 +212,13 @@ static bool shouldUseExternalPopupMenus = false; // WebView ---------------------------------------------------------------- -WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient) +WebView* WebView::create(WebViewClient* client) { // Keep runtime flag for device motion turned off until it's implemented. WebRuntimeFeatures::enableDeviceMotion(false); // Pass the WebViewImpl's self-reference to the caller. - return adoptRef(new WebViewImpl(client, devToolsClient, autoFillClient)).leakRef(); + return adoptRef(new WebViewImpl(client)).leakRef(); } void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus) @@ -269,9 +270,28 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient) SecurityOrigin::setLocalLoadPolicy(SecurityOrigin::AllowLocalLoadsForLocalOnly); } -WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient) +void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) +{ + if (devToolsClient) + m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); + else + m_devToolsAgent.clear(); +} + +void WebViewImpl::setAutoFillClient(WebAutoFillClient* autoFillClient) +{ + m_autoFillClient = autoFillClient; +} + +void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) +{ + m_spellCheckClient = spellCheckClient; +} + +WebViewImpl::WebViewImpl(WebViewClient* client) : m_client(client) - , m_autoFillClient(autoFillClient) + , m_autoFillClient(0) + , m_spellCheckClient(0) , m_chromeClientImpl(this) , m_contextMenuClientImpl(this) , m_dragClientImpl(this) @@ -290,9 +310,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_suppressNextKeypressEvent(false) , m_initialNavigationPolicy(WebNavigationPolicyIgnore) , m_imeAcceptEvents(true) - , m_dragTargetDispatch(false) - , m_dragIdentity(0) - , m_dropEffect(DropEffectDefault) , m_operationsAllowed(WebDragOperationNone) , m_dragOperation(WebDragOperationNone) , m_autoFillPopupShowing(false) @@ -305,6 +322,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_layerRenderer(0) , m_isAcceleratedCompositingActive(false) , m_compositorCreationFailed(false) + , m_recreatingGraphicsContext(false) #endif #if ENABLE(INPUT_SPEECH) , m_speechInputClient(SpeechInputClientImpl::create(client)) @@ -321,9 +339,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools // set to impossible point so we always get the first mouse pos m_lastMousePosition = WebPoint(-1, -1); - if (devToolsClient) - m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); - Page::PageClients pageClients; pageClients.chromeClient = &m_chromeClientImpl; pageClients.contextMenuClient = &m_contextMenuClientImpl; @@ -962,13 +977,14 @@ void WebViewImpl::resize(const WebSize& newSize) } if (m_client) { - WebRect damagedRect(0, 0, m_size.width, m_size.height); if (isAcceleratedCompositingActive()) { #if USE(ACCELERATED_COMPOSITING) - invalidateRootLayerRect(damagedRect); + updateLayerRendererViewport(); #endif - } else + } else { + WebRect damagedRect(0, 0, m_size.width, m_size.height); m_client->didInvalidateRect(damagedRect); + } } #if USE(ACCELERATED_COMPOSITING) @@ -993,6 +1009,12 @@ void WebViewImpl::animate() void WebViewImpl::layout() { +#if USE(ACCELERATED_COMPOSITING) + // FIXME: RTL style not supported by the compositor yet. + if (isAcceleratedCompositingActive() && pageHasRTLStyle()) + setIsAcceleratedCompositingActive(false); +#endif + WebFrameImpl* webframe = mainFrameImpl(); if (webframe) { // In order for our child HWNDs (NativeWindowWidgets) to update properly, @@ -1057,7 +1079,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) if (canvas) { // Clip rect to the confines of the rootLayerTexture. IntRect resizeRect(rect); - resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->visibleRectSize())); + resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->viewportSize())); doPixelReadbackToCanvas(canvas, resizeRect); } #endif @@ -1081,6 +1103,14 @@ void WebViewImpl::themeChanged() void WebViewImpl::composite(bool finish) { #if USE(ACCELERATED_COMPOSITING) + TRACE_EVENT("WebViewImpl::composite", this, 0); + if (m_recreatingGraphicsContext) { + // reallocateRenderer will request a repaint whether or not it succeeded + // in creating a new context. + reallocateRenderer(); + m_recreatingGraphicsContext = false; + return; + } doComposite(); // Finish if requested. @@ -1091,8 +1121,16 @@ void WebViewImpl::composite(bool finish) m_layerRenderer->present(); GraphicsContext3D* context = m_layerRenderer->context(); - if (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) - reallocateRenderer(); + if (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) { + // Trying to recover the context right here will not work if GPU process + // died. This is because GpuChannelHost::OnErrorMessage will only be + // called at the next iteration of the message loop, reverting our + // recovery attempts here. Instead, we detach the root layer from the + // renderer, recreate the renderer at the next message loop iteration + // and request a repaint yet again. + m_recreatingGraphicsContext = true; + setRootLayerNeedsDisplay(); + } #endif } @@ -1235,7 +1273,7 @@ void WebViewImpl::setFocus(bool enable) Element* element = static_cast<Element*>(focusedNode); if (element->isTextFormControl()) element->updateFocusAppearance(true); - else if (focusedNode->isContentEditable()) { + else if (focusedNode->rendererIsEditable()) { // updateFocusAppearance() selects all the text of // contentseditable DIVs. So we set the selection explicitly // instead. Note that this has the side effect of moving the @@ -1297,7 +1335,7 @@ bool WebViewImpl::setComposition( PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->isContentEditable()) + if (!node || !node->rendererIsEditable()) return false; } @@ -1346,7 +1384,7 @@ bool WebViewImpl::confirmComposition(const WebString& text) PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->isContentEditable()) + if (!node || !node->rendererIsEditable()) return false; } @@ -1755,7 +1793,22 @@ void WebViewImpl::dragSourceSystemDragEnded() } WebDragOperation WebViewImpl::dragTargetDragEnter( - const WebDragData& webDragData, int identity, + const WebDragData& webDragData, int identity, // FIXME: remove identity from this function signature. + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed) +{ + ASSERT(!m_currentDragData.get()); + + m_currentDragData = webDragData; + UNUSED_PARAM(identity); + m_operationsAllowed = operationsAllowed; + + return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); +} + +WebDragOperation WebViewImpl::dragTargetDragEnter( + const WebDragData& webDragData, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) @@ -1763,7 +1816,6 @@ WebDragOperation WebViewImpl::dragTargetDragEnter( ASSERT(!m_currentDragData.get()); m_currentDragData = webDragData; - m_dragIdentity = identity; m_operationsAllowed = operationsAllowed; return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); @@ -1789,14 +1841,12 @@ void WebViewImpl::dragTargetDragLeave() IntPoint(), static_cast<DragOperation>(m_operationsAllowed)); - m_dragTargetDispatch = true; m_page->dragController()->dragExited(&dragData); - m_dragTargetDispatch = false; - m_currentDragData = 0; - m_dropEffect = DropEffectDefault; + // FIXME: why is the drag scroll timer not stopped here? + m_dragOperation = WebDragOperationNone; - m_dragIdentity = 0; + m_currentDragData = 0; } void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, @@ -1822,22 +1872,12 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, screenPoint, static_cast<DragOperation>(m_operationsAllowed)); - m_dragTargetDispatch = true; m_page->dragController()->performDrag(&dragData); - m_dragTargetDispatch = false; - m_currentDragData = 0; - m_dropEffect = DropEffectDefault; m_dragOperation = WebDragOperationNone; - m_dragIdentity = 0; - m_dragScrollTimer->stop(); -} + m_currentDragData = 0; -int WebViewImpl::dragIdentity() -{ - if (m_dragTargetDispatch) - return m_dragIdentity; - return 0; + m_dragScrollTimer->stop(); } WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction) @@ -1850,27 +1890,23 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo screenPoint, static_cast<DragOperation>(m_operationsAllowed)); - m_dropEffect = DropEffectDefault; - m_dragTargetDispatch = true; - DragOperation effect = dragAction == DragEnter ? m_page->dragController()->dragEntered(&dragData) - : m_page->dragController()->dragUpdated(&dragData); - // Mask the operation against the drag source's allowed operations. - if (!(effect & dragData.draggingSourceOperationMask())) - effect = DragOperationNone; - m_dragTargetDispatch = false; - - if (m_dropEffect != DropEffectDefault) { - m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy - : WebDragOperationNone; - } else - m_dragOperation = static_cast<WebDragOperation>(effect); + DragOperation dropEffect; + if (dragAction == DragEnter) + dropEffect = m_page->dragController()->dragEntered(&dragData); + else + dropEffect = m_page->dragController()->dragUpdated(&dragData); + + // Mask the drop effect operation against the drag source's allowed operations. + if (!(dropEffect & dragData.draggingSourceOperationMask())) + dropEffect = DragOperationNone; + + m_dragOperation = static_cast<WebDragOperation>(dropEffect); if (dragAction == DragOver) m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); else m_dragScrollTimer->stop(); - return m_dragOperation; } @@ -2010,15 +2046,6 @@ void WebViewImpl::performCustomContextMenuAction(unsigned action) // WebView -------------------------------------------------------------------- -bool WebViewImpl::setDropEffect(bool accept) -{ - if (m_dragTargetDispatch) { - m_dropEffect = accept ? DropEffectCopy : DropEffectNone; - return true; - } - return false; -} - void WebViewImpl::setIsTransparent(bool isTransparent) { // Set any existing frames to be transparent. @@ -2258,9 +2285,26 @@ bool WebViewImpl::allowsAcceleratedCompositing() return !m_compositorCreationFailed; } +bool WebViewImpl::pageHasRTLStyle() const +{ + if (!page()) + return false; + Document* document = page()->mainFrame()->document(); + if (!document) + return false; + RenderView* renderView = document->renderView(); + if (!renderView) + return false; + RenderStyle* style = renderView->style(); + if (!style) + return false; + return (style->direction() == RTL); +} + void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) { - setIsAcceleratedCompositingActive(layer ? true : false); + // FIXME: RTL style not supported by the compositor yet. + setIsAcceleratedCompositingActive(layer && !pageHasRTLStyle() ? true : false); if (m_layerRenderer) m_layerRenderer->setRootLayer(layer); @@ -2279,6 +2323,7 @@ void WebViewImpl::setRootLayerNeedsDisplay() void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& clipRect) { + updateLayerRendererViewport(); setRootLayerNeedsDisplay(); } @@ -2290,14 +2335,66 @@ void WebViewImpl::invalidateRootLayerRect(const IntRect& rect) return; FrameView* view = page()->mainFrame()->view(); - IntRect contentRect = view->visibleContentRect(false); - IntRect visibleRect = view->visibleContentRect(true); - IntRect dirtyRect = view->windowToContents(rect); - m_layerRenderer->invalidateRootLayerRect(dirtyRect, visibleRect, contentRect); + updateLayerRendererViewport(); + m_layerRenderer->invalidateRootLayerRect(dirtyRect); setRootLayerNeedsDisplay(); } +class WebViewImplContentPainter : public TilePaintInterface { + WTF_MAKE_NONCOPYABLE(WebViewImplContentPainter); +public: + static PassOwnPtr<WebViewImplContentPainter*> create(WebViewImpl* webViewImpl) + { + return adoptPtr(new WebViewImplContentPainter(webViewImpl)); + } + + virtual void paint(GraphicsContext& context, const IntRect& contentRect) + { + Page* page = m_webViewImpl->page(); + if (!page) + return; + FrameView* view = page->mainFrame()->view(); + view->paintContents(&context, contentRect); + } + +private: + explicit WebViewImplContentPainter(WebViewImpl* webViewImpl) + : m_webViewImpl(webViewImpl) + { + } + + WebViewImpl* m_webViewImpl; +}; + +class WebViewImplScrollbarPainter : public TilePaintInterface { + WTF_MAKE_NONCOPYABLE(WebViewImplScrollbarPainter); +public: + static PassOwnPtr<WebViewImplScrollbarPainter> create(WebViewImpl* webViewImpl) + { + return adoptPtr(new WebViewImplScrollbarPainter(webViewImpl)); + } + + virtual void paint(GraphicsContext& context, const IntRect& contentRect) + { + Page* page = m_webViewImpl->page(); + if (!page) + return; + FrameView* view = page->mainFrame()->view(); + + context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); + IntRect windowRect = view->contentsToWindow(contentRect); + view->paintScrollbars(&context, windowRect); + } + +private: + explicit WebViewImplScrollbarPainter(WebViewImpl* webViewImpl) + : m_webViewImpl(webViewImpl) + { + } + + WebViewImpl* m_webViewImpl; +}; void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { @@ -2308,8 +2405,11 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (!active) { m_isAcceleratedCompositingActive = false; + // We need to finish all GL rendering before sending + // didActivateAcceleratedCompositing(false) to prevent + // flickering when compositing turns off. if (m_layerRenderer) - m_layerRenderer->finish(); // finish all GL rendering before we hide the window? + m_layerRenderer->finish(); m_client->didActivateAcceleratedCompositing(false); } else if (m_layerRenderer) { m_isAcceleratedCompositingActive = true; @@ -2324,7 +2424,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (context) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } - m_layerRenderer = LayerRendererChromium::create(context.release()); + + m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); if (m_layerRenderer) { m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; @@ -2339,95 +2440,67 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositingActive); } -class WebViewImplTilePaintInterface : public TilePaintInterface { -public: - explicit WebViewImplTilePaintInterface(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - view->paintContents(&context, contentRect); - } - -private: - WebViewImpl* m_webViewImpl; -}; - - -class WebViewImplScrollbarPaintInterface : public TilePaintInterface { -public: - explicit WebViewImplScrollbarPaintInterface(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - - context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); - IntRect windowRect = view->contentsToWindow(contentRect); - view->paintScrollbars(&context, windowRect); - } - -private: - WebViewImpl* m_webViewImpl; -}; - void WebViewImpl::doComposite() { + ASSERT(m_layerRenderer); + if (!m_layerRenderer) { + setIsAcceleratedCompositingActive(false); + return; + } + ASSERT(isAcceleratedCompositingActive()); if (!page()) return; - FrameView* view = page()->mainFrame()->view(); - - // The visibleRect includes scrollbars whereas the contentRect doesn't. - IntRect visibleRect = view->visibleContentRect(true); - IntRect contentRect = view->visibleContentRect(false); - IntPoint scroll(view->scrollX(), view->scrollY()); - - WebViewImplTilePaintInterface tilePaint(this); - - WebViewImplScrollbarPaintInterface scrollbarPaint(this); m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled()); CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay(); hud->setShowFPSCounter(settings()->showFPSCounter()); hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree()); - m_layerRenderer->updateAndDrawLayers(visibleRect, contentRect, scroll, tilePaint, scrollbarPaint); - - if (m_layerRenderer->isCompositingOffscreen()) - m_layerRenderer->copyOffscreenTextureToDisplay(); + m_layerRenderer->updateAndDrawLayers(); } void WebViewImpl::reallocateRenderer() { - GraphicsContext3D* context = m_layerRenderer->context(); - RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create(context->getContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create( + getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. - RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext); + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. - if (layerRenderer) + if (layerRenderer) { m_layerRenderer->transferRootLayer(layerRenderer.get()); - m_layerRenderer = layerRenderer; - - // Enable or disable accelerated compositing and request a refresh. - setRootGraphicsLayer(m_layerRenderer ? m_layerRenderer->rootLayer() : 0); + m_layerRenderer = layerRenderer; + // FIXME: In MacOS newContext->reshape method needs to be called to + // allocate IOSurfaces. All calls to create a context followed by + // reshape should really be extracted into one function; it is not + // immediately obvious that GraphicsContext3D object will not + // function properly until its reshape method is called. + newContext->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + setRootGraphicsLayer(m_layerRenderer->rootLayer()); + // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so + // that the browser process can reacquire surfaces. + m_client->didActivateAcceleratedCompositing(true); + } else + setRootGraphicsLayer(0); } #endif +void WebViewImpl::updateLayerRendererViewport() +{ + ASSERT(m_layerRenderer); + + if (!page()) + return; + + FrameView* view = page()->mainFrame()->view(); + IntRect contentRect = view->visibleContentRect(false); + IntRect visibleRect = view->visibleContentRect(true); + IntPoint scroll(view->scrollX(), view->scrollY()); + + m_layerRenderer->setViewport(visibleRect, contentRect, scroll); +} WebGraphicsContext3D* WebViewImpl::graphicsContext3D() { diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 2163725..66b2908 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -114,6 +114,9 @@ public: // WebView methods: virtual void initializeMainFrame(WebFrameClient*); + virtual void setDevToolsAgentClient(WebDevToolsAgentClient*); + virtual void setAutoFillClient(WebAutoFillClient*); + virtual void setSpellCheckClient(WebSpellCheckClient*); virtual WebSettings* settings(); virtual WebString pageEncoding() const; virtual void setPageEncoding(const WebString& encoding); @@ -154,7 +157,12 @@ public: WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( - const WebDragData& dragData, int identity, + const WebDragData&, int identity, // FIXME: remove identity from this function signature. + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed); + virtual WebDragOperation dragTargetDragEnter( + const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed); @@ -166,8 +174,6 @@ public: virtual void dragTargetDrop( const WebPoint& clientPoint, const WebPoint& screenPoint); - virtual int dragIdentity(); - virtual bool setDropEffect(bool accept); virtual unsigned long createUniqueIdentifierForRequest(); virtual void inspectElementAt(const WebPoint& point); virtual WebString inspectorSettings() const; @@ -221,6 +227,11 @@ public: return m_autoFillClient; } + WebSpellCheckClient* spellCheckClient() + { + return m_spellCheckClient; + } + // Returns the page object associated with this view. This may be null when // the page is shutting down, but will be valid at all other times. WebCore::Page* page() const @@ -327,6 +338,7 @@ public: #if USE(ACCELERATED_COMPOSITING) bool allowsAcceleratedCompositing(); + bool pageHasRTLStyle() const; void setRootGraphicsLayer(WebCore::PlatformLayer*); void setRootLayerNeedsDisplay(); void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect); @@ -361,7 +373,7 @@ private: DragOver }; - WebViewImpl(WebViewClient*, WebDevToolsAgentClient*, WebAutoFillClient*); + WebViewImpl(WebViewClient*); ~WebViewImpl(); // Returns true if the event was actually processed. @@ -399,10 +411,12 @@ private: void doComposite(); void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); void reallocateRenderer(); + void updateLayerRendererViewport(); #endif WebViewClient* m_client; WebAutoFillClient* m_autoFillClient; + WebSpellCheckClient* m_spellCheckClient; ChromeClientImpl m_chromeClientImpl; ContextMenuClientImpl m_contextMenuClientImpl; @@ -467,22 +481,6 @@ private: // Represents whether or not this object should process incoming IME events. bool m_imeAcceptEvents; - // True while dispatching system drag and drop events to drag/drop targets - // within this WebView. - bool m_dragTargetDispatch; - - // Valid when m_dragTargetDispatch is true; the identity of the drag data - // copied from the WebDropData object sent from the browser process. - int m_dragIdentity; - - // Valid when m_dragTargetDispatch is true. Used to override the default - // browser drop effect with the effects "none" or "copy". - enum DragTargetDropEffect { - DropEffectDefault = -1, - DropEffectNone, - DropEffectCopy - } m_dropEffect; - // The available drag operations (copy, move link...) allowed by the source. WebDragOperation m_operationsAllowed; @@ -531,6 +529,8 @@ private: RefPtr<WebCore::LayerRendererChromium> m_layerRenderer; bool m_isAcceleratedCompositingActive; bool m_compositorCreationFailed; + // If true, the graphics context is being restored. + bool m_recreatingGraphicsContext; #endif static const WebInputEvent* m_currentInputEvent; diff --git a/Source/WebKit/chromium/src/WebWorkerBase.cpp b/Source/WebKit/chromium/src/WebWorkerBase.cpp index b16b6d4..0cd5f41 100644 --- a/Source/WebKit/chromium/src/WebWorkerBase.cpp +++ b/Source/WebKit/chromium/src/WebWorkerBase.cpp @@ -65,7 +65,7 @@ namespace { // This class is used to route the result of the WebWorkerBase::allowDatabase // call back to the worker context. -class AllowDatabaseMainThreadBridge : public ThreadSafeShared<AllowDatabaseMainThreadBridge> { +class AllowDatabaseMainThreadBridge : public ThreadSafeRefCounted<AllowDatabaseMainThreadBridge> { public: static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebWorkerBase* worker, const WTF::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WTF::String& name, const WTF::String& displayName, unsigned long estimatedSize) { @@ -170,7 +170,7 @@ void WebWorkerBase::initializeLoader(const WebURL& url) // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. ASSERT(!m_webView); - m_webView = WebView::create(0, 0, 0); + m_webView = WebView::create(0); m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled()); m_webView->initializeMainFrame(this); @@ -237,7 +237,7 @@ bool WebWorkerBase::allowDatabase(WebFrame*, const WebString& name, const WebStr } #if ENABLE(FILE_SYSTEM) -void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks, bool synchronous) +void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, bool synchronous) { WorkerRunLoop& runLoop = m_workerThread->runLoop(); WorkerScriptController* controller = WorkerScriptController::controllerForContext(); @@ -248,7 +248,7 @@ void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long mode.append(String::number(runLoop.createUniqueId())); RefPtr<WorkerFileSystemCallbacksBridge> bridge = WorkerFileSystemCallbacksBridge::create(this, workerContext, callbacks); - bridge->postOpenFileSystemToMainThread(commonClient(), type, size, mode); + bridge->postOpenFileSystemToMainThread(commonClient(), type, size, create, mode); if (synchronous) { if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) diff --git a/Source/WebKit/chromium/src/WebWorkerBase.h b/Source/WebKit/chromium/src/WebWorkerBase.h index ec73505..8fb032e 100644 --- a/Source/WebKit/chromium/src/WebWorkerBase.h +++ b/Source/WebKit/chromium/src/WebWorkerBase.h @@ -92,7 +92,7 @@ public: virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize); #if ENABLE(FILE_SYSTEM) - void openFileSystemForWorker(WebFileSystem::Type, long long size, WebFileSystemCallbacks*, bool synchronous); + void openFileSystemForWorker(WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*, bool synchronous); #endif // Executes the given task on the main thread. diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp index 6c31221..d05322f 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp @@ -57,6 +57,7 @@ template<> struct CrossThreadCopierBase<false, false, WebKit::WebFileInfo> { newInfo.modificationTime = info.modificationTime; newInfo.length = info.length; newInfo.type = info.type; + newInfo.platformPath.assign(info.platformPath.data(), info.platformPath.length()); return newInfo; } }; @@ -85,7 +86,7 @@ namespace WebKit { class MainThreadFileSystemCallbacks : public WebFileSystemCallbacks { public: // Callbacks are self-destructed and we always return leaked pointer here. - static MainThreadFileSystemCallbacks* createLeakedPtr(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) + static MainThreadFileSystemCallbacks* createLeakedPtr(WorkerFileSystemCallbacksBridge* bridge, const String& mode) { OwnPtr<MainThreadFileSystemCallbacks> callbacks = adoptPtr(new MainThreadFileSystemCallbacks(bridge, mode)); return callbacks.leakPtr(); @@ -126,15 +127,16 @@ public: } private: - MainThreadFileSystemCallbacks(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) + MainThreadFileSystemCallbacks(WorkerFileSystemCallbacksBridge* bridge, const String& mode) : m_bridge(bridge) , m_mode(mode) { - ASSERT(m_bridge.get()); + ASSERT(m_bridge); } friend class WorkerFileSystemCallbacksBridge; - RefPtr<WorkerFileSystemCallbacksBridge> m_bridge; + // The bridge pointer is kept by the bridge itself on the WorkerThread. + WorkerFileSystemCallbacksBridge* m_bridge; const String m_mode; }; @@ -150,9 +152,9 @@ void WorkerFileSystemCallbacksBridge::stop() } } -void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, const String& mode) +void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, const String& mode) { - dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, this, mode)); + dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, create, this, mode)); } void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode) @@ -212,12 +214,12 @@ void WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread(WebFileSyste dispatchTaskToMainThread(createCallbackTask(&readDirectoryOnMainThread, fileSystem, path, this, mode)); } -void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, WorkerFileSystemCallbacksBridge* bridge, const String& mode) +void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WorkerFileSystemCallbacksBridge* bridge, const String& mode) { if (!commonClient) bridge->didFailOnMainThread(WebFileErrorAbort, mode); else { - commonClient->openFileSystem(type, size, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); + commonClient->openFileSystem(type, size, create, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); } } @@ -365,6 +367,7 @@ void WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread(WebCore::ScriptExecu ASSERT(bridge->m_workerContext->isContextThread()); taskToRun->performTask(scriptExecutionContext); bridge->m_callbacksOnWorkerThread = 0; + bridge->stopObserving(); } void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task> task) @@ -379,12 +382,9 @@ void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCor void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode) { ASSERT(isMainThread()); - { // Let go of the mutex before possibly deleting this due to m_selfRef.clear(). - MutexLocker locker(m_mutex); - if (m_worker) - m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef, task), mode); - } - m_selfRef.clear(); + MutexLocker locker(m_mutex); + if (m_worker) + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef.release(), task), mode); } } // namespace WebCore diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index fa57f38..9a869dc 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -66,7 +66,7 @@ struct WebFileSystemEntry; // --> Bridge::didXxxOnWorkerThread is called on WorkerThread // This calls the original callbacks (m_callbacksOnWorkerThread) and // releases a self-reference to the bridge. -class WorkerFileSystemCallbacksBridge : public ThreadSafeShared<WorkerFileSystemCallbacksBridge>, public WebCore::WorkerContext::Observer { +class WorkerFileSystemCallbacksBridge : public ThreadSafeRefCounted<WorkerFileSystemCallbacksBridge>, public WebCore::WorkerContext::Observer { public: ~WorkerFileSystemCallbacksBridge(); @@ -84,7 +84,7 @@ public: } // Methods that create an instance and post an initial request task to the main thread. They must be called on the worker thread. - void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, const String& mode); + void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, const String& mode); void postMoveToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode); void postCopyToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode); void postRemoveToMainThread(WebFileSystem*, const String& path, const String& mode); @@ -107,7 +107,7 @@ private: WorkerFileSystemCallbacksBridge(WebWorkerBase*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacks*); // Methods that are to be called on the main thread. - static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, WorkerFileSystemCallbacksBridge*, const String& mode); + static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, WorkerFileSystemCallbacksBridge*, const String& mode); static void moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode); static void copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode); static void removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode); @@ -138,7 +138,7 @@ private: void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode); - // m_selfRef keeps a reference to itself until a task is created for the worker thread (at which point the task holds the reference). + // m_selfRef keeps a reference to itself while there's a pending callback on the main thread. RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef; Mutex m_mutex; diff --git a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h index 62e333c..7e9795e 100644 --- a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h @@ -38,7 +38,7 @@ #include "WorkerContext.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#include <wtf/ThreadSafeShared.h> +#include <wtf/ThreadSafeRefCounted.h> namespace WebCore { class AsyncFileWriterClient; @@ -79,7 +79,7 @@ class WebWorkerBase; // should call postShutdownToMainThread before dropping its reference to the // bridge. This ensures that the WebFileWriter will be cleared on the main // thread and that no further calls to the WebFileWriterClient will be made. -class WorkerFileWriterCallbacksBridge : public ThreadSafeShared<WorkerFileWriterCallbacksBridge>, public WebCore::WorkerContext::Observer, public WebFileWriterClient { +class WorkerFileWriterCallbacksBridge : public ThreadSafeRefCounted<WorkerFileWriterCallbacksBridge>, public WebCore::WorkerContext::Observer, public WebFileWriterClient { public: ~WorkerFileWriterCallbacksBridge(); diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 03c72d2..7a3eb8d 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -48,7 +48,6 @@ var context = {}; // Used by WebCore's inspector routines. Preferences.onlineDetectionEnabled = false; Preferences.nativeInstrumentationEnabled = true; Preferences.fileSystemEnabled = false; - Preferences.resourceExportEnabled = true; Preferences.showTimingTab = true; Preferences.showCookiesTab = true; })(); diff --git a/Source/WebKit/chromium/src/js/Images/segmentChromium.png b/Source/WebKit/chromium/src/js/Images/segmentChromium.png Binary files differindex f4248e1..a636820 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png b/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png Binary files differindex 0a743d9..0510773 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png b/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png Binary files differindex cf62072..91be9db 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png b/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png Binary files differindex a1f7251..9df447b 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png b/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png Binary files differindex 07641db..abe8db8 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png Binary files differindex 7a760c1..b5a780f 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png Binary files differindex e3bc944..531a3ef 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png Binary files differindex 5ff61d9..c8fbd45 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png Binary files differindex 3c0aeec..668070d 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png |