diff options
author | Steve Block <steveblock@google.com> | 2010-05-26 10:11:43 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-27 11:14:42 +0100 |
commit | e78cbe89e6f337f2f1fe40315be88f742b547151 (patch) | |
tree | d778000b84a04f24bbad50c7fa66244365e960e9 /WebKit/chromium | |
parent | 7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff) | |
download | external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2 |
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebKit/chromium')
40 files changed, 1115 insertions, 178 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 6efc8e5..07e6edb 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,365 @@ +2010-05-21 Tony Chang <tony@chromium.org> + + Reviewed by Ojan Vafai. + + [chromium] if keydown is prevented, don't update the IME and clear the IME state + https://bugs.webkit.org/show_bug.cgi?id=39475 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleCompositionEvent): + +2010-05-23 Roman Gershman <romange@google.com> + + Reviewed by Darin Fisher. + + [Chromium] Suggestion popup is not closed when the view is scrolled. + https://bugs.webkit.org/show_bug.cgi?id=38640 + + This bug appears on both Windows and Linux platforms. + Mac OS, however handles window messages differently and + closes popup menu in RenderWidgetHostViewMac::Destroy(). + + No tests were added because test_shell does not support suggestion + popup. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::invalidateContentsForSlowScroll): + (WebKit::ChromeClientImpl::scroll): + +2010-05-23 Marcus Bulach <bulach@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] Adds Geolocation support to DumpRenderTree. + https://bugs.webkit.org/show_bug.cgi?id=39440 + + Existing LayoutTests/fast/dom/Geolocation/* should pass. + + * public/WebGeolocationServiceMock.h: + * src/WebGeolocationServiceMock.cpp: + (WebKit::WebGeolocationServiceMock::setMockGeolocationPermission): + (WebKit::WebGeolocationServiceMock::requestPermissionForFrame): + (WebKit::WebGeolocationServiceMock::attachBridge): + (WebKit::WebGeolocationServiceMock::detachBridge): + +2010-05-22 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Link resources and load Ahem font for Windows + https://bugs.webkit.org/show_bug.cgi?id=39473 + + * WebKit.gyp: + Add net and webkit resources for Windows. + Copy AHEM____.TTF to DumpRenderTree.exe directory. + +2010-05-21 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Add DeviceOrientation and DeviceOrientationClient + https://bugs.webkit.org/show_bug.cgi?id=39479 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + +2010-05-20 Viet-Trung Luu <viettrungluu@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Don't rely on focused node to route mouse events to plugins. + https://bugs.webkit.org/show_bug.cgi?id=39375 + http://crbug.com/43935 + + On mouse down, do a hit test and check if a plugin was hit. If so, then + save the node for future mouse events (until mouse up or capture lost). + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::mouseDown): + (WebKit::WebViewImpl::handleInputEvent): + (WebKit::WebViewImpl::mouseCaptureLost): + * src/WebViewImpl.h: Remove m_haveMouseCapture; add m_mouseCaptureNode. + +2010-05-20 Dominic Mazzoni <dmazzoni@chromium.org> + + Reviewed by Darin Fisher. + + Add headingLevel and setFocused methods. + + https://bugs.webkit.org/show_bug.cgi?id=39238 + + * public/WebAccessibilityObject.h: + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::headingLevel): + (WebKit::WebAccessibilityObject::setFocused): + +2010-05-20 Zhenyao Mo <zmo@google.com> + + Reviewed by Dimitri Glazkov. + + Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage + https://bugs.webkit.org/show_bug.cgi?id=39077 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::renderbufferStorage): Mapping the enums. + +2010-05-20 Abhishek Arya <inferno@chromium.org> + + Reviewed by Adam Barth. + + Added method to WebSecurityOrigin for invoking + SecurityOrigin::canAccessPasswordManager. + https://bugs.webkit.org/show_bug.cgi?id=38916 + + * public/WebSecurityOrigin.h: + * src/WebSecurityOrigin.cpp: + (WebKit::WebSecurityOrigin::canAccessPasswordManager): + +2010-05-20 Darin Fisher <darin@chromium.org> + + Reviewed by Nate Chapin. + + [chromium] Provide a way to catch exceptions thrown while interacting + with a NPObject via WebBindings methods. + https://bugs.webkit.org/show_bug.cgi?id=39378 + + * public/WebBindings.h: + * src/WebBindings.cpp: + (WebKit::WebBindings::pushExceptionHandler): + (WebKit::WebBindings::popExceptionHandler): + +2010-05-20 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Rename GenericWorkerTask.h to CrossThreadTask.h and move it to dom directory. + https://bugs.webkit.org/show_bug.cgi?id=39135 + + * src/WebSharedWorkerImpl.cpp: + * src/WebWorkerBase.cpp: + * src/WebWorkerClientImpl.cpp: + * src/WebWorkerImpl.cpp: + +2010-05-20 Martin Robinson <mrobinson@webkit.org> + + Reviewed by Ojan Vafai. + + Expose the editing behavior setting in DRT to test all editing code paths + https://bugs.webkit.org/show_bug.cgi?id=38603 + + * public/WebSettings.h: + (WebKit::WebSettings::): Added an enum for EditingBehavior types. + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setEditingBehavior): Added. + * src/WebSettingsImpl.h: + +2010-05-19 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + Modifying WebViewImpl to support new hardware compositing for + LayerChromium layers. + https://bugs.webkit.org/show_bug.cgi?id=38783 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::paint): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::updateRootLayerContents): + (WebKit::WebViewImpl::setRootLayerNeedsDisplay): + +2010-05-19 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] disable spelling suggestions if spellcheck=false + https://bugs.webkit.org/show_bug.cgi?id=39402 + + This is the Chromium fix for bug 25639 that was fixed in the + other ports in r59585. + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + +2010-05-19 Darin Fisher <darin@chromium.org> + + Revert r59790 due to failing Chromium npruntime tests. + + * public/WebBindings.h: + * src/WebBindings.cpp: + +2010-05-19 Darin Fisher <darin@chromium.org> + + Reviewed by Nate Chapin. + + [chromium] Provide a way to catch exceptions thrown while interacting + with a NPObject via WebBindings methods. + https://bugs.webkit.org/show_bug.cgi?id=39378 + + * public/WebBindings.h: + * src/WebBindings.cpp: + (WebKit::WebBindings::pushExceptionHandler): + (WebKit::WebBindings::popExceptionHandler): + +2010-05-19 Dirk Pranke <dpranke@chromium.org> + + Try again to roll out r58765. + + * public/WebNotification.h: + * src/WebNotification.cpp: + +2010-05-19 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r59782. + http://trac.webkit.org/changeset/59782 + https://bugs.webkit.org/show_bug.cgi?id=39379 + + broke DRT build (Requested by dpranke on #webkit). + + * public/WebNotification.h: + * src/WebNotification.cpp: + (WebKit::WebNotification::dir): + (WebKit::WebNotification::replaceId): + +2010-05-18 Dirk Pranke <dpranke@chromium.org> + + Reviewed by Dimitri Glazkov. + + Attempt to revert r58765 to see if it was causing a performance + regression. + + https://bugs.webkit.org/show_bug.cgi?id=39328 + + * public/WebNotification.h: + * src/WebNotification.cpp: + +2010-05-19 Jian Li <jianli@chromium.org> + + Reviewed by Darin Fisher. + + Remove obsolete ChromiumBridge code that routes FileSystem calls to WebKitClient. + https://bugs.webkit.org/show_bug.cgi?id=39332 + + * public/WebKitClient.h: + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::fileExists): + (WebCore::ChromiumBridge::deleteFile): + (WebCore::ChromiumBridge::deleteEmptyDirectory): + (WebCore::ChromiumBridge::getFileSize): + (WebCore::ChromiumBridge::getFileModificationTime): + (WebCore::ChromiumBridge::directoryName): + (WebCore::ChromiumBridge::pathByAppendingComponent): + (WebCore::ChromiumBridge::makeAllDirectories): + (WebCore::ChromiumBridge::getAbsolutePath): + (WebCore::ChromiumBridge::isDirectory): + (WebCore::ChromiumBridge::filePathToURL): + +2010-05-19 Marcus Bulach <bulach@chromium.org> + + Reviewed by Steve Block. + + [chromium] Adds supports for layout tests using GeolocationServiceMock. + https://bugs.webkit.org/show_bug.cgi?id=39081 + + Allows injection of GeolocationServiceMock factory. + Tests: existing fast/dom/Geolocation/* + + * WebKit.gyp: + * public/WebGeolocationServiceMock.h: Added. + * src/WebGeolocationServiceMock.cpp: Added. + (WebCore::GeolocationServiceChromiumMock::create): + (WebCore::GeolocationServiceChromiumMock::GeolocationServiceChromiumMock): + (WebCore::GeolocationServiceChromiumMock::startUpdating): + (WebCore::GeolocationServiceChromiumMock::stopUpdating): + (WebCore::GeolocationServiceChromiumMock::lastPosition): + (WebCore::GeolocationServiceChromiumMock::lastError): + (WebCore::GeolocationServiceChromiumMock::geolocationServicePositionChanged): + (WebCore::GeolocationServiceChromiumMock::geolocationServiceErrorOccurred): + (WebKit::WebGeolocationServiceMock::setMockGeolocationPosition): + (WebKit::WebGeolocationServiceMock::setMockGeolocationError): + +2010-05-17 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Darin Fisher. + + Hook Chromium's WebIndexedDatabaseImpl up to IndexedDatabaseImpl + https://bugs.webkit.org/show_bug.cgi?id=39216 + + Web____Impl is for re-entering the WebKit layer from the browser layer. + Thus the previous IDBCallbacksProxy was mis-named (and should have been + WebIDBCallbacksImpl). This patch renames it and then implements the + proper proxy (which is for going from WebCore to WebKit). + + Also change using security origin strings to using WebSecurityOrigin + objects. + + This patch also implements the glue between WebIndexedDatabaseImpl and + IndexedDatabaseImpl. + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::create): + (WebCore::IDBCallbacksProxy::IDBCallbacksProxy): + (WebCore::IDBCallbacksProxy::onError): + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IndexedDatabaseProxy.cpp: + (WebCore::IndexedDatabaseProxy::open): + * src/IndexedDatabaseProxy.h: + * src/WebIDBCallbacksImpl.cpp: Added. + (WebCore::WebIDBCallbacksImpl::WebIDBCallbacksImpl): + (WebCore::WebIDBCallbacksImpl::~WebIDBCallbacksImpl): + (WebCore::WebIDBCallbacksImpl::onError): + (WebCore::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: Added. + * src/WebIDBDatabaseImpl.cpp: Added. + (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl): + (WebKit::WebIDBDatabaseImpl::~WebIDBDatabaseImpl): + * src/WebIDBDatabaseImpl.h: Added. + * src/WebIndexedDatabaseImpl.cpp: + (WebKit::WebIndexedDatabaseImpl::WebIndexedDatabaseImpl): + (WebKit::WebIndexedDatabaseImpl::open): + * src/WebIndexedDatabaseImpl.h: + +2010-05-18 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Fix a repaint issue and textarea tests + https://bugs.webkit.org/show_bug.cgi?id=39054 + + * DEPS: Update to Chromium r47248 to use a fix for CommandLine assertion + and textAreaResizeCorner.png + * WebKit.gyp: Add textAreaResizeCorner.png as a Mac resource + +2010-05-18 Tony Chang <tony@chromium.org> + + Reviewed by Ojan Vafai. + + [chromium] ignore IME events if the keydown event was prevented + https://bugs.webkit.org/show_bug.cgi?id=37692 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleCompositionEvent): + +2010-05-18 MORITA Hajime <morrita@google.com> + + Reviewed by Kent Tamura. + + [Chromium] Windows: Determinate progress bar should have glossy overlay + https://bugs.webkit.org/show_bug.cgi?id=39269 + + Changed WebThemeEngine::drawProgressBar() signature to delegate + theme implementation detail to the engine. + Chromium side will come to http://crbug.com/44430. + + No new tests, animation effect can be confirmed only manually. + + * public/WebThemeEngine.h: + (WebKit::WebThemeEngine::paintProgressBar): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::paintProgressBar): + 2010-05-16 Mike Belshe <mbelshe@chromium.org> Reviewed by Dimitri Glazkov. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 9e34fe4..c633a79 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '46899', + 'chromium_rev': '47248', 'pthreads-win32_rev': '26716', } diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 8ac5a90..94d7a46 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -47,6 +47,7 @@ 'chromium_src_dir': '../../../..', }], ], + 'ahem_path': '../../WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF', }, 'targets': [ { @@ -126,6 +127,7 @@ 'public/WebFormElement.h', 'public/WebGeolocationService.h', 'public/WebGeolocationServiceBridge.h', + 'public/WebGeolocationServiceMock.h', 'public/WebGlyphCache.h', 'public/WebGLES2Context.h', 'public/WebGraphicsContext3D.h', @@ -337,13 +339,18 @@ 'src/WebFrameImpl.h', 'src/WebGeolocationServiceBridgeImpl.cpp', 'src/WebGeolocationServiceBridgeImpl.h', + 'src/WebGeolocationServiceMock.cpp', 'src/WebGlyphCache.cpp', 'src/WebGraphicsContext3D.cpp', 'src/WebGraphicsContext3DDefaultImpl.cpp', 'src/WebGraphicsContext3DDefaultImpl.h', 'src/WebHistoryItem.cpp', 'src/WebHTTPBody.cpp', + 'src/WebIDBCallbacksImpl.cpp', + 'src/WebIDBCallbacksImpl.h', 'src/WebIDBDatabaseError.cpp', + 'src/WebIDBDatabaseImpl.cpp', + 'src/WebIDBDatabaseImpl.h', 'src/WebImageCG.cpp', 'src/WebImageDecoder.cpp', 'src/WebImageSkia.cpp', @@ -573,11 +580,24 @@ '<@(drt_files)', ], 'conditions': [ + ['OS=="win"', { + 'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'], + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', + ], + 'copies': [{ + 'destination': '<(PRODUCT_DIR)', + 'files': ['<(ahem_path)'], + }], + }], ['OS=="mac"', { 'dependencies': ['LayoutTestHelper'], 'mac_bundle_resources': [ - '../../WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF', + '<(ahem_path)', '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf', '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf', '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf', @@ -587,6 +607,7 @@ '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf', '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf', '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf', + '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png', ], 'actions': [ { diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h index f46c0d8..191d40f 100644 --- a/WebKit/chromium/public/WebAccessibilityObject.h +++ b/WebKit/chromium/public/WebAccessibilityObject.h @@ -94,10 +94,12 @@ public: WebRect boundingBoxRect() const; WebString helpText() const; + int headingLevel() const; WebAccessibilityObject hitTest(const WebPoint&) const; WebString keyboardShortcut() const; bool performDefaultAction() const; WebAccessibilityRole roleValue() const; + void setFocused(bool) const; WebString stringValue() const; WebString title() const; diff --git a/WebKit/chromium/public/WebBindings.h b/WebKit/chromium/public/WebBindings.h index 4e66a8f..0fa3bfd 100644 --- a/WebKit/chromium/public/WebBindings.h +++ b/WebKit/chromium/public/WebBindings.h @@ -117,7 +117,7 @@ public: // NPN_UTF8FromIdentifier WEBKIT_API static NPUTF8* utf8FromIdentifier(NPIdentifier); - // Miscellaneous utility functions ------------------------------------ + // Miscellaneous utility functions ---------------------------------------- // Complement to NPN_Get___Identifier functions. Extracts data from the NPIdentifier data // structure. If isString is true upon return, string will be set but number's value is @@ -138,6 +138,15 @@ public: // Return true (success) if the given npobj is a range object. // If so, return that range as a WebRange object. WEBKIT_API static bool getRange(NPObject* range, WebRange*); + + // Exceptions ------------------------------------------------------------- + + typedef void (ExceptionHandler)(void* data, const NPUTF8* message); + + // The exception handler will be notified of any exceptions thrown while + // operating on a NPObject. + WEBKIT_API static void pushExceptionHandler(ExceptionHandler, void* data); + WEBKIT_API static void popExceptionHandler(); }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebGeolocationServiceMock.h b/WebKit/chromium/public/WebGeolocationServiceMock.h new file mode 100644 index 0000000..285f70c --- /dev/null +++ b/WebKit/chromium/public/WebGeolocationServiceMock.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010, Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebGeolocationServiceMock_h +#define WebGeolocationServiceMock_h + +#include "WebGeolocationService.h" +#include <wtf/HashMap.h> + +namespace WebKit { + +class WebString; + +class WebGeolocationServiceMock : public WebGeolocationService { +public: + static void setMockGeolocationPermission(bool allowed); + static void setMockGeolocationPosition(double latitude, double longitude, double accuracy); + static void setMockGeolocationError(int errorCode, const WebString& message); + + virtual void requestPermissionForFrame(int bridgeId, const WebURL& url); + virtual int attachBridge(WebGeolocationServiceBridge*); + virtual void detachBridge(int bridgeId); + +private: + typedef HashMap<int, WebGeolocationServiceBridge*> IdToBridgeMap; + IdToBridgeMap m_idToBridgeMap; + + static bool s_mockGeolocationPermission; +}; + +} // namespace WebKit + +#endif // WebGeolocationServiceMock_h diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h index 8861456..61b77a0 100644 --- a/WebKit/chromium/public/WebIndexedDatabase.h +++ b/WebKit/chromium/public/WebIndexedDatabase.h @@ -31,12 +31,15 @@ #include "WebCommon.h" #include "WebIDBCallbacks.h" +#include "WebSecurityOrigin.h" +#include "WebString.h" namespace WebKit { class WebFrame; class WebIDBDatabase; class WebString; +class WebSecurityOrigin; // The entry point into the IndexedDatabase API. These classes match their _____Request and // _____Sync counterparts in the spec, but operate only in an async manner. @@ -48,7 +51,17 @@ public: virtual ~WebIndexedDatabase() { } // The WebKit implementation of open ignores the WebFrame* parameter. - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebString& origin, WebFrame*, int& exceptionCode) = 0; + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, + WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode) + { + open(name, description, modifyDatabase, callbacks, origin.toString(), webFrame, exceptionCode); + } + // FIXME: Delete soon. Compatability hack. + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, + WebIDBCallbacks* callbacks, const WebString& origin, WebFrame* webFrame, int& exceptionCode) + { + open(name, description, modifyDatabase, callbacks, WebSecurityOrigin::createFromString(origin), webFrame, exceptionCode); + } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 584679d..d1da883 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -95,23 +95,6 @@ public: const WebURL& url, bool isLocalStorage) { } - // File ---------------------------------------------------------------- - - // Various file/directory related functions. These map 1:1 with - // functions in WebCore's FileSystem.h. - virtual bool fileExists(const WebString& path) { return false; } - virtual bool deleteFile(const WebString& path) { return false; } - virtual bool deleteEmptyDirectory(const WebString& path) { return false; } - virtual bool getFileSize(const WebString& path, long long& result) { return false; } - virtual bool getFileModificationTime(const WebString& path, double& result) { return false; } - virtual WebString directoryName(const WebString& path) { return WebString(); } - virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } - virtual bool makeAllDirectories(const WebString& path) { return false; } - virtual WebString getAbsolutePath(const WebString& path) { return WebString(); } - virtual bool isDirectory(const WebString& path) { return false; } - virtual WebURL filePathToURL(const WebString& path) { return WebURL(); } - - // History ------------------------------------------------------------- // Returns the hash for the given canonicalized URL for use in visited diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index ab747e3..9d64e2a 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -75,9 +75,6 @@ public: WEBKIT_API WebString title() const; WEBKIT_API WebString body() const; - WEBKIT_API WebString dir() const; - WEBKIT_API WebString replaceId() const; - // Called to indicate the notification has been displayed. WEBKIT_API void dispatchDisplayEvent(); diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h index 76012a1..efcb2e9 100644 --- a/WebKit/chromium/public/WebSecurityOrigin.h +++ b/WebKit/chromium/public/WebSecurityOrigin.h @@ -90,7 +90,11 @@ public: // Returns a string representation of this WebSecurityOrigin that can // be used as a file. Should be used in storage APIs only. - WEBKIT_API WebString databaseIdentifier(); + WEBKIT_API WebString databaseIdentifier() const; + + // Returns true if this WebSecurityOrigin can access usernames and + // passwords stored in password manager. + WEBKIT_API bool canAccessPasswordManager() const; #if WEBKIT_IMPLEMENTATION WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 356d9fa..dd31ea0 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -43,6 +43,11 @@ class WebURL; // these functions have a 1:1 mapping with the methods in WebCore/page/settings.h. class WebSettings { public: + enum EditingBehavior { + EditingBehaviorMac, + EditingBehaviorWin + }; + virtual void setStandardFontFamily(const WebString&) = 0; virtual void setFixedFontFamily(const WebString&) = 0; virtual void setSerifFontFamily(const WebString&) = 0; @@ -84,6 +89,7 @@ public: virtual void setOfflineWebApplicationCacheEnabled(bool) = 0; virtual void setExperimentalWebGLEnabled(bool) = 0; virtual void setShowDebugBorders(bool) = 0; + virtual void setEditingBehavior(EditingBehavior) = 0; protected: ~WebSettings() { } diff --git a/WebKit/chromium/public/WebThemeEngine.h b/WebKit/chromium/public/WebThemeEngine.h index 606de09..9638c2f 100644 --- a/WebKit/chromium/public/WebThemeEngine.h +++ b/WebKit/chromium/public/WebThemeEngine.h @@ -77,8 +77,8 @@ public: const WebRect&) = 0; virtual void paintProgressBar( - WebCanvas*, const WebRect& barRect, - int valuePart, const WebRect& valueRect) {} + WebCanvas*, const WebRect& barRect, const WebRect& valueRect, + bool determinate, double animatedSeconds) {} #endif }; diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index e7aeb49..fa7d73a 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -41,6 +41,7 @@ #include "NotificationPresenter.h" #include "PasteboardPrivate.h" #include "PlatformCursor.h" +#include "Settings.h" #include "StringImpl.h" #include "TextAffinity.h" #include "WebAccessibilityObject.h" @@ -52,6 +53,7 @@ #include "WebMediaPlayer.h" #include "WebNotificationPresenter.h" #include "WebScrollbar.h" +#include "WebSettings.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" #include <wtf/Assertions.h> @@ -300,6 +302,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByPage, ScrollByPage); COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByDocument, ScrollByDocument); COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByPixel, ScrollByPixel); +COMPILE_ASSERT_MATCHING_ENUM(WebSettings::EditingBehaviorMac, EditingMacBehavior); +COMPILE_ASSERT_MATCHING_ENUM(WebSettings::EditingBehaviorWin, EditingWindowsBehavior); + COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM); COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM); diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 1a366bc..d54f328 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -500,6 +500,7 @@ void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bo void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate) { + m_webView->hidePopups(); invalidateContentsAndWindow(updateRect, immediate); } @@ -507,6 +508,7 @@ void ChromeClientImpl::scroll( const IntSize& scrollDelta, const IntRect& scrollRect, const IntRect& clipRect) { + m_webView->hidePopups(); if (m_webView->client()) { int dx = scrollDelta.width(); int dy = scrollDelta.height(); diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index d188016..01e91a6 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -278,86 +278,61 @@ void ChromiumBridge::prefetchDNS(const String& hostname) bool ChromiumBridge::fileExists(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->fileExists(path); - return webKitClient()->fileExists(path); + return webKitClient()->fileSystem()->fileExists(path); } bool ChromiumBridge::deleteFile(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->deleteFile(path); - return webKitClient()->deleteFile(path); + return webKitClient()->fileSystem()->deleteFile(path); } bool ChromiumBridge::deleteEmptyDirectory(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->deleteEmptyDirectory(path); - return webKitClient()->deleteEmptyDirectory(path); + return webKitClient()->fileSystem()->deleteEmptyDirectory(path); } bool ChromiumBridge::getFileSize(const String& path, long long& result) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->getFileSize(path, result); - return webKitClient()->getFileSize(path, result); + return webKitClient()->fileSystem()->getFileSize(path, result); } bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) { double modificationTime; - if (webKitClient()->fileSystem()) { - if (!webKitClient()->fileSystem()->getFileModificationTime(path, modificationTime)) - return false; - } else { - if (!webKitClient()->getFileModificationTime(path, modificationTime)) - return false; - } + if (!webKitClient()->fileSystem()->getFileModificationTime(path, modificationTime)) + return false; result = static_cast<time_t>(modificationTime); return true; } String ChromiumBridge::directoryName(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->directoryName(path); - return webKitClient()->directoryName(path); + return webKitClient()->fileSystem()->directoryName(path); } String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->pathByAppendingComponent(path, component); - return webKitClient()->pathByAppendingComponent(path, component); + return webKitClient()->fileSystem()->pathByAppendingComponent(path, component); } bool ChromiumBridge::makeAllDirectories(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->makeAllDirectories(path); - return webKitClient()->makeAllDirectories(path); + return webKitClient()->fileSystem()->makeAllDirectories(path); } String ChromiumBridge::getAbsolutePath(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->getAbsolutePath(path); - return webKitClient()->getAbsolutePath(path); + return webKitClient()->fileSystem()->getAbsolutePath(path); } bool ChromiumBridge::isDirectory(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->isDirectory(path); - return webKitClient()->isDirectory(path); + return webKitClient()->fileSystem()->isDirectory(path); } KURL ChromiumBridge::filePathToURL(const String& path) { - if (webKitClient()->fileSystem()) - return webKitClient()->fileSystem()->filePathToURL(path); - return webKitClient()->filePathToURL(path); + return webKitClient()->fileSystem()->filePathToURL(path); } PlatformFileHandle ChromiumBridge::openFile(const String& path, FileOpenMode mode) @@ -680,10 +655,10 @@ void ChromiumBridge::paintTrackbar( } void ChromiumBridge::paintProgressBar( - GraphicsContext* gc, const IntRect& barRect, int valuePart, const IntRect& valueRect) + GraphicsContext* gc, const IntRect& barRect, const IntRect& valueRect, bool determinate, double animatedSeconds) { webKitClient()->themeEngine()->paintProgressBar( - gc->platformContext()->canvas(), barRect, valuePart, valueRect); + gc->platformContext()->canvas(), barRect, valueRect, determinate, animatedSeconds); } #endif diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp index b6005f9..8dd3393 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -203,7 +203,9 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( data.isEditable = true; if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; - data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); + // Spellchecking might be enabled for the field, but could be disabled on the node. + if (m_webView->focusedWebCoreFrame()->editor()->spellCheckingEnabledInFocusedNode()) + data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); } } diff --git a/WebKit/chromium/src/IDBCallbacksProxy.cpp b/WebKit/chromium/src/IDBCallbacksProxy.cpp index 0346b58..2bdf140 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -29,11 +29,10 @@ #include "config.h" #include "IDBCallbacksProxy.h" -#include "IDBCallbacks.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" #include "WebIDBCallbacks.h" -#include "WebIDBDatabase.h" +#include "WebIDBDatabaseImpl.h" #include "WebIDBDatabaseError.h" #include "WebSerializedScriptValue.h" @@ -41,7 +40,12 @@ namespace WebCore { -IDBCallbacksProxy::IDBCallbacksProxy(PassRefPtr<IDBCallbacks> callbacks) +PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +{ + return new IDBCallbacksProxy(callbacks); +} + +IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -50,21 +54,21 @@ IDBCallbacksProxy::~IDBCallbacksProxy() { } -void IDBCallbacksProxy::onError(const WebKit::WebIDBDatabaseError& error) +void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError) { - m_callbacks->onError(error); + m_callbacks->onError(WebKit::WebIDBDatabaseError(idbDatabaseError)); m_callbacks.clear(); } -void IDBCallbacksProxy::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabase> idbDatabase) { - m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(idbDatabase)); m_callbacks.clear(); } -void IDBCallbacksProxy::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { - m_callbacks->onSuccess(serializedScriptValue); + m_callbacks->onSuccess(WebKit::WebSerializedScriptValue(serializedScriptValue)); m_callbacks.clear(); } diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h index 692b0a3..5d4bc0b 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/WebKit/chromium/src/IDBCallbacksProxy.h @@ -29,33 +29,35 @@ #ifndef IDBCallbacksProxy_h #define IDBCallbacksProxy_h -#include "WebIDBCallbacks.h" +#include "IDBCallbacks.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> #if ENABLE(INDEXED_DATABASE) namespace WebKit { -class WebIDBDatabase; -class WebIDBDatabaseError; -class WebSerializedScriptValue; +class WebIDBCallbacks; } namespace WebCore { -class IDBCallbacks; +class IDBDatabaseError; +class IDBDatabase; +class SerializedScriptValue; -class IDBCallbacksProxy : public WebKit::WebIDBCallbacks { +class IDBCallbacksProxy : public IDBCallbacks { public: - IDBCallbacksProxy(PassRefPtr<IDBCallbacks> callbacks); + static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBCallbacks>); virtual ~IDBCallbacksProxy(); - virtual void onError(const WebKit::WebIDBDatabaseError& error); - virtual void onSuccess(WebKit::WebIDBDatabase* webKitInstance); - virtual void onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue); + virtual void onError(PassRefPtr<IDBDatabaseError>); + virtual void onSuccess(PassRefPtr<IDBDatabase>); + virtual void onSuccess(PassRefPtr<SerializedScriptValue>); private: - RefPtr<IDBCallbacks> m_callbacks; + IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks>); + + OwnPtr<WebKit::WebIDBCallbacks> m_callbacks; }; diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.cpp b/WebKit/chromium/src/IndexedDatabaseProxy.cpp index a4bd0b1..aed7c13 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.cpp +++ b/WebKit/chromium/src/IndexedDatabaseProxy.cpp @@ -29,13 +29,10 @@ #include "config.h" #include "IndexedDatabaseProxy.h" -#include "Document.h" -#include "Frame.h" -#include "IDBCallbacksProxy.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" -#include "SecurityOrigin.h" #include "WebFrameImpl.h" +#include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" #include "WebIndexedDatabase.h" @@ -60,12 +57,12 @@ IndexedDatabaseProxy::~IndexedDatabaseProxy() { } -void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks> callbacks, Frame* frame, ExceptionCode& ec) +void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, ExceptionCode& ec) { if (!frame || !frame->document()) return; WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIndexedDatabase->open(name, description, modifyDatabase, new IDBCallbacksProxy(callbacks), frame->document()->securityOrigin()->toString(), webFrame, ec); + m_webIndexedDatabase->open(name, description, modifyDatabase, new WebIDBCallbacksImpl(callbacks), origin, webFrame, ec); } } // namespace WebCore diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.h b/WebKit/chromium/src/IndexedDatabaseProxy.h index 0c8674a..e372e9a 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.h +++ b/WebKit/chromium/src/IndexedDatabaseProxy.h @@ -42,7 +42,7 @@ public: static PassRefPtr<IndexedDatabase> create(); virtual ~IndexedDatabaseProxy(); - virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks>, Frame*, ExceptionCode&); + virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, ExceptionCode&); private: IndexedDatabaseProxy(); diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp index c386d44..e59a1a2 100644 --- a/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -303,6 +303,15 @@ WebString WebAccessibilityObject::helpText() const return m_private->helpText(); } +int WebAccessibilityObject::headingLevel() const +{ + if (!m_private) + return 0; + + m_private->updateBackingStore(); + return m_private->headingLevel(); +} + WebAccessibilityObject WebAccessibilityObject::hitTest(const WebPoint& point) const { if (!m_private) @@ -368,6 +377,12 @@ WebAccessibilityRole WebAccessibilityObject::roleValue() const return static_cast<WebAccessibilityRole>(m_private->roleValue()); } +void WebAccessibilityObject::setFocused(bool on) const +{ + if (m_private) + m_private->setFocused(on); +} + WebString WebAccessibilityObject::stringValue() const { if (!m_private) diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index 99e82a7..2b20c0a 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -45,6 +45,7 @@ #include "V8DOMWrapper.h" #include "V8Event.h" #include "V8Helpers.h" +#include "V8NPUtils.h" #include "V8Proxy.h" #include "V8Range.h" #elif USE(JSC) @@ -322,4 +323,14 @@ bool WebBindings::getRange(NPObject* range, WebRange* webrange) #endif } +void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) +{ + WebCore::pushExceptionHandler(handler, data); +} + +void WebBindings::popExceptionHandler() +{ + WebCore::popExceptionHandler(); +} + } // namespace WebKit diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp new file mode 100644 index 0000000..2eed352 --- /dev/null +++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebGeolocationServiceMock.h" + +#include "GeolocationService.h" +#include "GeolocationServiceChromium.h" +#include "GeolocationServiceMock.h" +#include "WebString.h" +#include <wtf/CurrentTime.h> + +#if ENABLE(GEOLOCATION) + +using WebCore::Coordinates; +using WebCore::Frame; +using WebCore::Geolocation; +using WebCore::GeolocationServiceBridge; +using WebCore::GeolocationServiceChromium; +using WebCore::GeolocationServiceClient; +using WebCore::GeolocationServiceMock; +using WebCore::Geoposition; +using WebCore::PositionError; +using WebCore::PositionOptions; +using WebCore::String; + +namespace WebCore { +class GeolocationServiceChromiumMock : public GeolocationServiceChromium, public GeolocationServiceClient { +public: + static GeolocationService* create(GeolocationServiceClient*); + virtual bool startUpdating(PositionOptions*); + virtual void stopUpdating(); + virtual Geoposition* lastPosition() const; + virtual PositionError* lastError() const; + + virtual void geolocationServicePositionChanged(GeolocationService*); + virtual void geolocationServiceErrorOccurred(GeolocationService*); + +private: + explicit GeolocationServiceChromiumMock(GeolocationServiceClient*); + + GeolocationServiceClient* m_geolocationServiceClient; + OwnPtr<GeolocationService> m_geolocationServiceMock; +}; + +GeolocationService* GeolocationServiceChromiumMock::create(GeolocationServiceClient* geolocationServiceClient) +{ + return new GeolocationServiceChromiumMock(geolocationServiceClient); +} + +GeolocationServiceChromiumMock::GeolocationServiceChromiumMock(GeolocationServiceClient* geolocationServiceClient) + : GeolocationServiceChromium(geolocationServiceClient), + m_geolocationServiceClient(geolocationServiceClient) +{ + m_geolocationServiceMock.set(GeolocationServiceMock::create(this)); +} + +bool GeolocationServiceChromiumMock::startUpdating(PositionOptions* positionOptions) +{ + GeolocationServiceChromium::startUpdating(positionOptions); + return m_geolocationServiceMock->startUpdating(positionOptions); +} + +void GeolocationServiceChromiumMock::stopUpdating() +{ + GeolocationServiceChromium::stopUpdating(); + m_geolocationServiceMock->stopUpdating(); +} + +Geoposition* GeolocationServiceChromiumMock::lastPosition() const +{ + return m_geolocationServiceMock->lastPosition(); +} + +PositionError* GeolocationServiceChromiumMock::lastError() const +{ + return m_geolocationServiceMock->lastError(); +} + +void GeolocationServiceChromiumMock::geolocationServicePositionChanged(GeolocationService* geolocationService) +{ + ASSERT_UNUSED(geolocationService, geolocationService == m_geolocationServiceMock); + m_geolocationServiceClient->geolocationServicePositionChanged(this); + +} + +void GeolocationServiceChromiumMock::geolocationServiceErrorOccurred(GeolocationService* geolocationService) +{ + ASSERT_UNUSED(geolocationService, geolocationService == m_geolocationServiceMock); + m_geolocationServiceClient->geolocationServiceErrorOccurred(this); +} + +} // namespace WebCore + +namespace WebKit { + +bool WebGeolocationServiceMock::s_mockGeolocationPermission = false; + +void WebGeolocationServiceMock::setMockGeolocationPermission(bool allowed) +{ + s_mockGeolocationPermission = allowed; +} + +void WebGeolocationServiceMock::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +{ + WebCore::GeolocationService::setCustomMockFactory(&WebCore::GeolocationServiceChromiumMock::create); + RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, false, 0, accuracy, true, 0, false, 0, false, 0), currentTime() * 1000.0); + GeolocationServiceMock::setPosition(geoposition); +} + +void WebGeolocationServiceMock::setMockGeolocationError(int errorCode, const WebString& message) +{ + WebCore::GeolocationService::setCustomMockFactory(&WebCore::GeolocationServiceChromiumMock::create); + RefPtr<PositionError> positionError = PositionError::create(static_cast<PositionError::ErrorCode>(errorCode), message); + GeolocationServiceMock::setError(positionError); +} + +void WebGeolocationServiceMock::requestPermissionForFrame(int bridgeId, const WebURL& url) +{ + IdToBridgeMap::iterator iter = m_idToBridgeMap.find(bridgeId); + if (iter == m_idToBridgeMap.end()) + return; + iter->second->setIsAllowed(s_mockGeolocationPermission); +} + +int WebGeolocationServiceMock::attachBridge(WebGeolocationServiceBridge* bridge) +{ + static int nextAvailableWatchId = 1; + // In case of overflow, make sure the ID remains positive, but reuse the ID values. + if (nextAvailableWatchId < 1) + nextAvailableWatchId = 1; + m_idToBridgeMap.set(nextAvailableWatchId, bridge); + return nextAvailableWatchId++; +} + +void WebGeolocationServiceMock::detachBridge(int bridgeId) +{ + m_idToBridgeMap.remove(bridgeId); +} + +} // namespace WebKit + +#endif // ENABLE(GEOLOCATION) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 52bc645..e7e0c32 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -1215,10 +1215,21 @@ void WebGraphicsContext3DDefaultImpl::renderbufferStorage(unsigned long target, unsigned long height) { makeContextCurrent(); - if (internalformat == GL_DEPTH_STENCIL) + switch (internalformat) { + case GL_DEPTH_STENCIL: internalformat = GL_DEPTH24_STENCIL8_EXT; - else if (internalformat == GL_DEPTH_COMPONENT16) + break; + case GL_DEPTH_COMPONENT16: internalformat = GL_DEPTH_COMPONENT; + break; + case GL_RGBA4: + case GL_RGB5_A1: + internalformat = GL_RGBA; + break; + case 0x8D62: // GL_RGB565 + internalformat = GL_RGB; + break; + } glRenderbufferStorageEXT(target, internalformat, width, height); } diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp new file mode 100644 index 0000000..8f88cb6 --- /dev/null +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebIDBCallbacksImpl.h" + +#include "IDBCallbacks.h" +#include "IDBDatabaseError.h" +#include "IDBDatabaseProxy.h" +#include "WebIDBCallbacks.h" +#include "WebIDBDatabase.h" +#include "WebIDBDatabaseError.h" +#include "WebSerializedScriptValue.h" + +#if ENABLE(INDEXED_DATABASE) + +namespace WebCore { + +WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks) + : m_callbacks(callbacks) +{ +} + +WebIDBCallbacksImpl::~WebIDBCallbacksImpl() +{ +} + +void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error) +{ + m_callbacks->onError(error); + m_callbacks.clear(); +} + +void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +{ + m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks.clear(); +} + +void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +{ + m_callbacks->onSuccess(serializedScriptValue); + m_callbacks.clear(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) + diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.h b/WebKit/chromium/src/WebIDBCallbacksImpl.h new file mode 100644 index 0000000..9b53117 --- /dev/null +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBCallbacksImpl_h +#define WebIDBCallbacksImpl_h + +#include "WebIDBCallbacks.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +#if ENABLE(INDEXED_DATABASE) + +namespace WebKit { +class WebIDBDatabase; +class WebIDBDatabaseError; +class WebSerializedScriptValue; +} + +namespace WebCore { + +class IDBCallbacks; + +class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks { +public: + WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks); + virtual ~WebIDBCallbacksImpl(); + + virtual void onError(const WebKit::WebIDBDatabaseError& error); + virtual void onSuccess(WebKit::WebIDBDatabase* webKitInstance); + virtual void onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue); + +private: + RefPtr<IDBCallbacks> m_callbacks; +}; + +} // namespace WebCore + +#endif + +#endif // WebIDBCallbacksImpl_h diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp new file mode 100644 index 0000000..e33edc2 --- /dev/null +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebIDBDatabaseImpl.h" + +#include "IDBDatabase.h" + +#if ENABLE(INDEXED_DATABASE) + +using namespace WebCore; + +namespace WebKit { + +WebIDBDatabaseImpl::WebIDBDatabaseImpl(PassRefPtr<IDBDatabase> idbDatabase) +{ +} + +WebIDBDatabaseImpl::~WebIDBDatabaseImpl() +{ +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h new file mode 100644 index 0000000..758f84a --- /dev/null +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBDatabaseImpl_h +#define WebIDBDatabaseImpl_h + +#include "WebCommon.h" +#include "WebIDBDatabase.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { class IDBDatabase; } + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBDatabaseImpl : public WebIDBDatabase { +public: + WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabase> idbDatabase); + virtual ~WebIDBDatabaseImpl(); + + // FIXME: Implement. + +private: + WTF::RefPtr<WebCore::IDBDatabase> m_idbDatabase; +}; + +} // namespace WebKit + +#endif // WebIDBDatabaseImpl_h diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp index 4820cfb..99aad39 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp @@ -31,11 +31,16 @@ #include "config.h" #include "WebIndexedDatabaseImpl.h" +#include "IDBCallbacksProxy.h" +#include "IndexedDatabaseImpl.h" +#include "SecurityOrigin.h" #include "WebIDBDatabaseError.h" #include <wtf/OwnPtr.h> #if ENABLE(INDEXED_DATABASE) +using namespace WebCore; + namespace WebKit { WebIndexedDatabase* WebIndexedDatabase::create() @@ -43,15 +48,18 @@ WebIndexedDatabase* WebIndexedDatabase::create() return new WebIndexedDatabaseImpl(); } +WebIndexedDatabaseImpl::WebIndexedDatabaseImpl() + : m_indexedDatabase(WebCore::IndexedDatabaseImpl::create()) +{ +} + WebIndexedDatabaseImpl::~WebIndexedDatabaseImpl() { } -void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks* callbacksPtr, const WebString& origin, WebFrame*, int& exceptionCode) +void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, int& exceptionCode) { - OwnPtr<WebIDBCallbacks> callbacks(callbacksPtr); - callbacks->onError(WebIDBDatabaseError(0, "Not implemented")); - // FIXME: Implement for realz. + m_indexedDatabase->open(name, description, modifyDatabase, IDBCallbacksProxy::create(callbacks), origin, 0, exceptionCode); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.h b/WebKit/chromium/src/WebIndexedDatabaseImpl.h index 0402ede..57d20a6 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.h +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.h @@ -30,14 +30,21 @@ #define WebIndexedDatabaseImpl_h #include "WebIndexedDatabase.h" +#include <wtf/RefPtr.h> + +namespace WebCore { class IndexedDatabase; } namespace WebKit { class WebIndexedDatabaseImpl : public WebIndexedDatabase { public: + WebIndexedDatabaseImpl(); virtual ~WebIndexedDatabaseImpl(); - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebString& origin, WebFrame*, int& exceptionCode); + virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, int& exceptionCode); + +private: + WTF::RefPtr<WebCore::IndexedDatabase> m_indexedDatabase; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp index 5ae1557..5200d17 100644 --- a/WebKit/chromium/src/WebNotification.cpp +++ b/WebKit/chromium/src/WebNotification.cpp @@ -94,16 +94,6 @@ WebString WebNotification::body() const return m_private->contents().body(); } -WebString WebNotification::dir() const -{ - return m_private->dir(); -} - -WebString WebNotification::replaceId() const -{ - return m_private->replaceId(); -} - void WebNotification::dispatchDisplayEvent() { RefPtr<Event> event = Event::create("display", false, true); diff --git a/WebKit/chromium/src/WebSecurityOrigin.cpp b/WebKit/chromium/src/WebSecurityOrigin.cpp index bc36be7..8685738 100644 --- a/WebKit/chromium/src/WebSecurityOrigin.cpp +++ b/WebKit/chromium/src/WebSecurityOrigin.cpp @@ -115,12 +115,18 @@ WebString WebSecurityOrigin::toString() const return m_private->toString(); } -WebString WebSecurityOrigin::databaseIdentifier() +WebString WebSecurityOrigin::databaseIdentifier() const { ASSERT(m_private); return m_private->databaseIdentifier(); } +bool WebSecurityOrigin::canAccessPasswordManager() const +{ + ASSERT(m_private); + return m_private->canAccessPasswordManager(); +} + WebSecurityOrigin::WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>& origin) : m_private(static_cast<WebSecurityOriginPrivate*>(origin.releaseRef())) { diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 3adf3ac..5f32346 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -269,4 +269,9 @@ void WebSettingsImpl::setShowDebugBorders(bool show) m_settings->setShowDebugBorders(show); } +void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior) +{ + m_settings->setEditingBehavior(static_cast<WebCore::EditingBehavior>(behavior)); +} + } // namespace WebKit diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index fdc03f0..0a90091 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -85,6 +85,7 @@ public: virtual void setOfflineWebApplicationCacheEnabled(bool); virtual void setExperimentalWebGLEnabled(bool); virtual void setShowDebugBorders(bool); + virtual void setEditingBehavior(EditingBehavior); private: WebCore::Settings* m_settings; diff --git a/WebKit/chromium/src/WebSharedWorkerImpl.cpp b/WebKit/chromium/src/WebSharedWorkerImpl.cpp index 91636d9..51bbf1b 100644 --- a/WebKit/chromium/src/WebSharedWorkerImpl.cpp +++ b/WebKit/chromium/src/WebSharedWorkerImpl.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebSharedWorkerImpl.h" -#include "GenericWorkerTask.h" +#include "CrossThreadTask.h" #include "KURL.h" #include "MessageEvent.h" #include "MessagePortChannel.h" diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 94cf36c..4e8b7c8 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -239,7 +239,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_suggestionsPopup(0) , m_isTransparent(false) , m_tabsToLinks(false) - , m_haveMouseCapture(false) #if USE(ACCELERATED_COMPOSITING) , m_layerRenderer(0) , m_isAcceleratedCompositingActive(false) @@ -255,13 +254,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) m_lastMousePosition = WebPoint(-1, -1); // the page will take ownership of the various clients - m_page.set(new Page(&m_chromeClientImpl, - &m_contextMenuClientImpl, - &m_editorClientImpl, - &m_dragClientImpl, - &m_inspectorClientImpl, - 0, - 0)); + m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0)); m_page->backForwardList()->setClient(&m_backForwardListClientImpl); m_page->setGroupName(pageGroupName); @@ -337,19 +330,23 @@ void WebViewImpl::mouseDown(const WebMouseEvent& event) } m_lastMouseDownPoint = WebPoint(event.x, event.y); - m_haveMouseCapture = true; - // If a text field that has focus is clicked again, we should display the - // suggestions popup. RefPtr<Node> clickedNode; if (event.button == WebMouseEvent::ButtonLeft) { + IntPoint point(event.x, event.y); + point = m_page->mainFrame()->view()->windowToContents(point); + HitTestResult result(m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false)); + Node* hitNode = result.innerNonSharedNode(); + + // Take capture on a mouse down on a plugin so we can send it mouse events. + if (hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObject()) + m_mouseCaptureNode = hitNode; + + // If a text field that has focus is clicked again, we should display the + // suggestions popup. RefPtr<Node> focusedNode = focusedWebCoreNode(); if (focusedNode.get() && toHTMLInputElement(focusedNode.get())) { - IntPoint point(event.x, event.y); - point = m_page->mainFrame()->view()->windowToContents(point); - HitTestResult result(point); - result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false); - if (result.innerNonSharedNode() == focusedNode) { + if (hitNode == focusedNode) { // Already focused text field was clicked, let's remember this. If // focus has not changed after the mouse event is processed, we'll // trigger the autocomplete. @@ -970,12 +967,19 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) // Draw the contents of the root layer. updateRootLayerContents(rect); - // Composite everything into the canvas that's passed to us. -#if PLATFORM(SKIA) - m_layerRenderer->drawLayersInCanvas(static_cast<skia::PlatformCanvas*>(canvas), IntRect(rect)); -#elif PLATFORM(CG) -#error "Need to implement CG version" -#endif + WebFrameImpl* webframe = mainFrameImpl(); + if (!webframe) + return; + FrameView* view = webframe->frameView(); + if (!view) + return; + + // The visibleRect includes scrollbars whereas the contentRect doesn't. + IntRect visibleRect = view->visibleContentRect(true); + IntRect contentRect = view->visibleContentRect(false); + + // Ask the layer compositor to redraw all the layers. + m_layerRenderer->drawLayers(rect, visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY())); } #endif } @@ -994,36 +998,36 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) if (m_ignoreInputEvents) return true; - if (m_haveMouseCapture && WebInputEvent::isMouseEventType(inputEvent.type)) { + if (m_mouseCaptureNode.get() && WebInputEvent::isMouseEventType(inputEvent.type)) { + // Save m_mouseCaptureNode since mouseCaptureLost() will clear it. + RefPtr<Node> node = m_mouseCaptureNode; + // Not all platforms call mouseCaptureLost() directly. if (inputEvent.type == WebInputEvent::MouseUp) mouseCaptureLost(); - Node* node = focusedWebCoreNode(); - if (node && node->renderer() && node->renderer()->isEmbeddedObject()) { - AtomicString eventType; - switch (inputEvent.type) { - case WebInputEvent::MouseMove: - eventType = eventNames().mousemoveEvent; - break; - case WebInputEvent::MouseLeave: - eventType = eventNames().mouseoutEvent; - break; - case WebInputEvent::MouseDown: - eventType = eventNames().mousedownEvent; - break; - case WebInputEvent::MouseUp: - eventType = eventNames().mouseupEvent; - break; - default: - ASSERT_NOT_REACHED(); - } - - node->dispatchMouseEvent( - PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)), - eventType); - return true; + AtomicString eventType; + switch (inputEvent.type) { + case WebInputEvent::MouseMove: + eventType = eventNames().mousemoveEvent; + break; + case WebInputEvent::MouseLeave: + eventType = eventNames().mouseoutEvent; + break; + case WebInputEvent::MouseDown: + eventType = eventNames().mousedownEvent; + break; + case WebInputEvent::MouseUp: + eventType = eventNames().mouseupEvent; + break; + default: + ASSERT_NOT_REACHED(); } + + node->dispatchMouseEvent( + PlatformMouseEventBuilder(mainFrameImpl()->frameView(), *static_cast<const WebMouseEvent*>(&inputEvent)), + eventType); + return true; } // FIXME: Remove m_currentInputEvent. @@ -1090,7 +1094,7 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) void WebViewImpl::mouseCaptureLost() { - m_haveMouseCapture = false; + m_mouseCaptureNode = 0; } void WebViewImpl::setFocus(bool enable) @@ -1178,7 +1182,11 @@ bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command, return false; } - if (command == WebCompositionCommandDiscard) { + // If we're not going to fire a keypress event, then the keydown event was + // canceled. In that case, cancel any existing composition. + // FIXME: Ideally, we would only cancel a single keypress, rather than the + // whole composition. + if ((command == WebCompositionCommandDiscard) || m_suppressNextKeypressEvent) { // A browser process sent an IPC message which does not contain a valid // string, which means an ongoing composition has been canceled. // If the ongoing composition has been canceled, replace the ongoing @@ -2072,9 +2080,13 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) return; if (active) { - m_layerRenderer = LayerRendererChromium::create(); - if (m_layerRenderer) + m_layerRenderer = LayerRendererChromium::create(page()); + if (m_layerRenderer->hardwareCompositing()) m_isAcceleratedCompositingActive = true; + else { + m_layerRenderer.clear(); + m_isAcceleratedCompositingActive = false; + } } else { m_layerRenderer = 0; m_isAcceleratedCompositingActive = false; @@ -2086,6 +2098,12 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) if (!isAcceleratedCompositingActive()) return; + // FIXME: The accelerated compositing path invalidates a 1x1 rect at (0, 0) + // in order to get the renderer to ask the compositor to redraw. This is only + // temporary until we get the compositor to render directly from its own thread. + if (!rect.x && !rect.y && rect.width == 1 && rect.height == 1) + return; + WebFrameImpl* webframe = mainFrameImpl(); if (!webframe) return; @@ -2093,24 +2111,28 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) if (!view) return; - WebRect viewRect = view->frameRect(); - SkIRect scrollFrame; - scrollFrame.set(view->scrollX(), view->scrollY(), view->layoutWidth() + view->scrollX(), view->layoutHeight() + view->scrollY()); - m_layerRenderer->setScrollFrame(scrollFrame); LayerChromium* rootLayer = m_layerRenderer->rootLayer(); if (rootLayer) { IntRect visibleRect = view->visibleContentRect(true); - // Set the backing store size used by the root layer to be the size of the visible - // area. Note that the root layer bounds could be larger than the backing store size, - // but there's no reason to waste memory by allocating backing store larger than the - // visible portion. - rootLayer->setBackingStoreRect(IntSize(visibleRect.width(), visibleRect.height())); + // Update the root layer's backing store to be the size of the dirty rect. + // Unlike other layers the root layer doesn't have persistent storage for its + // contents in system memory. + rootLayer->setBackingStoreSize(IntSize(rect.width, rect.height)); GraphicsContext* rootLayerContext = rootLayer->graphicsContext(); + skia::PlatformCanvas* platformCanvas = rootLayer->platformCanvas(); + + platformCanvas->save(); + + // Bring the canvas into the coordinate system of the paint rect. + platformCanvas->translate(static_cast<SkScalar>(-rect.x), static_cast<SkScalar>(-rect.y)); + rootLayerContext->save(); webframe->paintWithContext(*(rootLayer->graphicsContext()), rect); rootLayerContext->restore(); + + platformCanvas->restore(); } } @@ -2119,8 +2141,10 @@ void WebViewImpl::setRootLayerNeedsDisplay() // FIXME: For now we're posting a repaint event for the entire page which is an overkill. if (WebFrameImpl* webframe = mainFrameImpl()) { if (FrameView* view = webframe->frameView()) { + // FIXME: Temporary hack to invalidate part of the page so that we get called to render + // again. IntRect visibleRect = view->visibleContentRect(true); - m_client->didInvalidateRect(visibleRect); + m_client->didInvalidateRect(IntRect(0, 0, 1, 1)); } } diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index b561e49..d545a42 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -490,7 +490,8 @@ private: NotificationPresenterImpl m_notificationPresenter; #endif - bool m_haveMouseCapture; + // If set, the (plugin) node which has mouse capture. + RefPtr<WebCore::Node> m_mouseCaptureNode; #if USE(ACCELERATED_COMPOSITING) OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer; diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp index 1fedeb2..244cceb 100644 --- a/WebKit/chromium/src/WebWorkerBase.cpp +++ b/WebKit/chromium/src/WebWorkerBase.cpp @@ -31,8 +31,8 @@ #include "config.h" #include "WebWorkerBase.h" +#include "CrossThreadTask.h" #include "DatabaseTask.h" -#include "GenericWorkerTask.h" #include "MessagePortChannel.h" #include "PlatformMessagePortChannel.h" diff --git a/WebKit/chromium/src/WebWorkerClientImpl.cpp b/WebKit/chromium/src/WebWorkerClientImpl.cpp index d0dda8e..13b7fe6 100644 --- a/WebKit/chromium/src/WebWorkerClientImpl.cpp +++ b/WebKit/chromium/src/WebWorkerClientImpl.cpp @@ -33,11 +33,11 @@ #if ENABLE(WORKERS) +#include "CrossThreadTask.h" #include "DedicatedWorkerThread.h" #include "ErrorEvent.h" #include "Frame.h" #include "FrameLoaderClient.h" -#include "GenericWorkerTask.h" #include "MessageEvent.h" #include "MessagePort.h" #include "MessagePortChannel.h" diff --git a/WebKit/chromium/src/WebWorkerImpl.cpp b/WebKit/chromium/src/WebWorkerImpl.cpp index 5b5e053..857c50f 100644 --- a/WebKit/chromium/src/WebWorkerImpl.cpp +++ b/WebKit/chromium/src/WebWorkerImpl.cpp @@ -31,9 +31,9 @@ #include "config.h" #include "WebWorkerImpl.h" +#include "CrossThreadTask.h" #include "DedicatedWorkerContext.h" #include "DedicatedWorkerThread.h" -#include "GenericWorkerTask.h" #include "KURL.h" #include "MessageEvent.h" #include "MessagePort.h" |