diff options
Diffstat (limited to 'WebKit')
269 files changed, 5943 insertions, 3070 deletions
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 75181e6..92976db 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,31 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebKit.xcodeproj/project.pbxproj: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebKit.xcodeproj/project.pbxproj: + +2010-08-03 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 5 - Refactor Quota Management in WebSecurityOrigin into Managers + + * WebKit.xcodeproj/project.pbxproj: Add new Quota Managers, remove old SecurityOrigin subclasses. + 2010-07-31 David Kilzer <ddkilzer@apple.com> <http://webkit.org/b/43307> Make sure all private headers are copied to PrivateHeaders directory diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj index e447b7f..bad03b6 100644 --- a/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/WebKit/WebKit.xcodeproj/project.pbxproj @@ -313,13 +313,14 @@ 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */; }; 93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; }; 93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; }; + A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A57E2F22120749E600048DF3 /* WebQuotaManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */; }; A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */; }; A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A5DEFC0F11D5343E00885273 /* WebDatabaseSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */; }; - A5DEFC1011D5343E00885273 /* WebDatabaseSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */; }; - A5DEFC1311D5344B00885273 /* WebApplicationCacheSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */; }; - A5DEFC1411D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */; }; + A5DEFC0F11D5343E00885273 /* WebDatabaseQuotaManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0D11D5343E00885273 /* WebDatabaseQuotaManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0E11D5343E00885273 /* WebDatabaseQuotaManager.mm */; }; + A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC1111D5344B00885273 /* WebApplicationCacheQuotaManager.h */; }; + A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC1211D5344B00885273 /* WebApplicationCacheQuotaManager.mm */; }; A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A70936AD0B5608DC00CDB48E /* WebDragClient.h */; }; A70936B00B5608DC00CDB48E /* WebDragClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = A70936AE0B5608DC00CDB48E /* WebDragClient.mm */; }; A7D3C5BC0B5773C5002CA450 /* WebPasteboardHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */; }; @@ -608,13 +609,14 @@ 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRendererFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFramePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; + A57E2F22120749E600048DF3 /* WebQuotaManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebQuotaManager.h; sourceTree = "<group>"; }; A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; }; A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; }; A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginPrivate.h; sourceTree = "<group>"; }; - A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseSecurityOrigin.h; sourceTree = "<group>"; }; - A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseSecurityOrigin.mm; sourceTree = "<group>"; }; - A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCacheSecurityOrigin.h; sourceTree = "<group>"; }; - A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCacheSecurityOrigin.mm; sourceTree = "<group>"; }; + A5DEFC0D11D5343E00885273 /* WebDatabaseQuotaManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseQuotaManager.h; sourceTree = "<group>"; }; + A5DEFC0E11D5343E00885273 /* WebDatabaseQuotaManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseQuotaManager.mm; sourceTree = "<group>"; }; + A5DEFC1111D5344B00885273 /* WebApplicationCacheQuotaManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCacheQuotaManager.h; sourceTree = "<group>"; }; + A5DEFC1211D5344B00885273 /* WebApplicationCacheQuotaManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCacheQuotaManager.mm; sourceTree = "<group>"; }; A70936AD0B5608DC00CDB48E /* WebDragClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebDragClient.h; sourceTree = "<group>"; }; A70936AE0B5608DC00CDB48E /* WebDragClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClient.mm; sourceTree = "<group>"; }; A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPasteboardHelper.h; sourceTree = "<group>"; }; @@ -969,6 +971,7 @@ F508946A02B71D59018A9CD4 /* WebNSViewExtras.m */, 9345DDAE0365FB27008635CE /* WebNSWindowExtras.h */, 9345DDAF0365FB27008635CE /* WebNSWindowExtras.m */, + A57E2F22120749E600048DF3 /* WebQuotaManager.h */, F59668C802AD2923018635CA /* WebStringTruncator.h */, F59668C902AD2923018635CA /* WebStringTruncator.mm */, DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */, @@ -1020,8 +1023,8 @@ 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */, 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */, 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */, - A5DEFC0D11D5343E00885273 /* WebDatabaseSecurityOrigin.h */, - A5DEFC0E11D5343E00885273 /* WebDatabaseSecurityOrigin.mm */, + A5DEFC0D11D5343E00885273 /* WebDatabaseQuotaManager.h */, + A5DEFC0E11D5343E00885273 /* WebDatabaseQuotaManager.mm */, 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */, 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */, ); @@ -1238,8 +1241,8 @@ children = ( B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */, B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */, - A5DEFC1111D5344B00885273 /* WebApplicationCacheSecurityOrigin.h */, - A5DEFC1211D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm */, + A5DEFC1111D5344B00885273 /* WebApplicationCacheQuotaManager.h */, + A5DEFC1211D5344B00885273 /* WebApplicationCacheQuotaManager.mm */, 51CBFCAC0D10E6C5002DBF51 /* WebCachedFramePlatformData.h */, 14D8252D0AF955090004F057 /* WebChromeClient.h */, 14D8252E0AF955090004F057 /* WebChromeClient.mm */, @@ -1569,8 +1572,9 @@ 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */, A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */, A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */, - A5DEFC0F11D5343E00885273 /* WebDatabaseSecurityOrigin.h in Headers */, - A5DEFC1311D5344B00885273 /* WebApplicationCacheSecurityOrigin.h in Headers */, + A5DEFC0F11D5343E00885273 /* WebDatabaseQuotaManager.h in Headers */, + A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */, + A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1612,6 +1616,7 @@ isa = PBXProject; buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; compatibilityVersion = "Xcode 2.4"; + developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -1930,8 +1935,8 @@ 0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */, 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */, A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */, - A5DEFC1011D5343E00885273 /* WebDatabaseSecurityOrigin.mm in Sources */, - A5DEFC1411D5344B00885273 /* WebApplicationCacheSecurityOrigin.mm in Sources */, + A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.mm in Sources */, + A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 9a33ade..1486694 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,700 @@ +2010-08-10 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: get rid of utility context + https://bugs.webkit.org/show_bug.cgi?id=43787 + + * public/WebDevToolsAgentClient.h: + * src/DebuggerAgentImpl.cpp: + * src/DebuggerAgentImpl.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::~WebDevToolsAgentImpl): + (WebKit::WebDevToolsAgentImpl::attach): + (WebKit::WebDevToolsAgentImpl::detach): + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + (WebKit::WebDevToolsAgentImpl::setRuntimeFeatureEnabled): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + * src/WebDevToolsAgentImpl.h: + +2010-08-10 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector, Chromium: reloading of inspected page hits assert in InspectorController::enableDebuggerFromFrontend() + https://bugs.webkit.org/show_bug.cgi?id=43780 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setRuntimeFeatureEnabled): + +2010-08-10 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Implement chromium WebDeviceOrientationClient wrapper and have WebViewImpl get it from WebViewClient. + https://bugs.webkit.org/show_bug.cgi?id=43258 + + Provide a DeviceOrientationClient to Page by means of a + DeviceOrientationClientProxy that proxies calls to + a WebDeviceOrientationClient, an interface that can be implemented + in the WebKit or Chromium layer. An implementation to be used for + layout tests, wrapping DeviceOrientationClientMock, is provided. + + + * WebKit.gyp: + * public/WebDeviceOrientation.h: Added. + (WebKit::WebDeviceOrientation::WebDeviceOrientation): + * public/WebDeviceOrientationClient.h: Added. + (WebKit::WebDeviceOrientationClient::~WebDeviceOrientationClient): + * public/WebDeviceOrientationClientMock.h: Added. + (WebKit::WebDeviceOrientationClientMock::WebDeviceOrientationClientMock): + (WebKit::WebDeviceOrientationClientMock::~WebDeviceOrientationClientMock): + * public/WebDeviceOrientationController.h: Added. + (WebKit::WebDeviceOrientationController::WebDeviceOrientationController): + * public/WebViewClient.h: + (WebKit::WebViewClient::deviceOrientationClient): + * src/DeviceOrientationClientProxy.cpp: Added. + (WebKit::DeviceOrientationClientProxy::setController): + (WebKit::DeviceOrientationClientProxy::startUpdating): + (WebKit::DeviceOrientationClientProxy::stopUpdating): + (WebKit::DeviceOrientationClientProxy::lastOrientation): + * src/DeviceOrientationClientProxy.h: Added. + (WebKit::DeviceOrientationClientProxy::DeviceOrientationClientProxy): + * src/WebDeviceOrientation.cpp: Added. + (WebKit::WebDeviceOrientation::WebDeviceOrientation): + (WebKit::WebDeviceOrientation::operator=): + (WebKit::WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientation>): + * src/WebDeviceOrientationClientMock.cpp: Added. + (WebKit::WebDeviceOrientationClientMock::setController): + (WebKit::WebDeviceOrientationClientMock::startUpdating): + (WebKit::WebDeviceOrientationClientMock::stopUpdating): + (WebKit::WebDeviceOrientationClientMock::lastOrientation): + (WebKit::WebDeviceOrientationClientMock::setOrientation): + (WebKit::WebDeviceOrientationClientMock::initialize): + (WebKit::WebDeviceOrientationClientMock::reset): + * src/WebDeviceOrientationController.cpp: Added. + (WebKit::WebDeviceOrientationController::didChangeDeviceOrientation): + (WebKit::WebDeviceOrientationController::controller): + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-08-10 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r64988. + http://trac.webkit.org/changeset/64988 + https://bugs.webkit.org/show_bug.cgi?id=43775 + + "It seems to break chromium's ui_tests" (Requested by hamaji + on #webkit). + + * public/WebFrameClient.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::detachedFromParent3): + +2010-08-10 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Remove references to deleted header InspectorFrontend.h + + * src/WebDevToolsAgentImpl.cpp: + +2010-08-10 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix Chromium compilation. + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + +2010-08-09 Gavin Barraclough <barraclough@apple.com> + + Speculative chromium build fix V. + + * tests/KURLTest.cpp: + (ComponentCase::TEST): + +2010-08-09 Gavin Barraclough <barraclough@apple.com> + + Speculative chromium build fix IV. + + * src/WebPageSerializerImpl.h: + +2010-08-09 Gavin Barraclough <barraclough@apple.com> + + Speculative chromium build fix II. + + * src/AssertMatchingEnums.cpp: + +2010-08-09 Gavin Barraclough <barraclough@apple.com> + + Speculative chromium build fix. + + * public/WebCString.h: + +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * public/WebCString.h: + * public/WebString.h: + * src/DOMUtilitiesPrivate.h: + * src/DebuggerAgentImpl.h: + * src/DebuggerAgentManager.h: + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsFrontendImpl.h: + * src/WebPageSerializerImpl.h: + +2010-08-09 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Dimitri Glazkov. + + Skip the slow software rendering path of GraphicsContext3D if accelerated + compositing is active. This fixes an issue with WebGL and the compositor + in which the software rendering of WebGL would cause the current GL context + to change while the compositor was processing layers. Tested by running + several WebGL samples both with the compositor enabled and disabled. + https://bugs.webkit.org/show_bug.cgi?id=43644 + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::initialize): + (WebCore::GraphicsContext3DInternal::beginPaint): + +2010-08-06 James Hawkins <jhawkins@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Notify the WebFrameClient when the frame is detached from + the view. This is used to clear the cached frame in the FormManager. + Eventually this will be removed once handling forms is moved into + WebCore. + https://bugs.webkit.org/show_bug.cgi?id=43648 + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::frameDetached): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::detachedFromParent3): + +2010-08-09 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: Chromium tests fix. + + Chromium: provisional interactive ui tests fix. + + * src/js/Tests.js: + (.TestSuite.prototype.testShowStoragePanel.this): + (.TestSuite.prototype.testShowStoragePanel): + +2010-08-09 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed. Chromium tests fix. + + Disable runtime switch for device motion in chromium. + https://bugs.webkit.org/show_bug.cgi?id=43717 + + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + +2010-08-09 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium: Remove temporary device motion fix. + + https://bugs.webkit.org/show_bug.cgi?id=43713 + + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableDeviceOrientation): + +2010-08-07 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Eric Seidel. + + Removed unecessary focus code. + https://bugs.webkit.org/show_bug.cgi?id=43542 + + * src/ChromiumBridge.cpp: + +2010-08-06 Victor Wang <victorw@chromium.org> + + Reviewed by Kent Tamura. + + [Chromium] Add dllimport/dllexport to WebSpeechInputControllerMock::create + so it works for windows dll build. + + https://bugs.webkit.org/show_bug.cgi?id=43627 + + * public/WebSpeechInputControllerMock.h: + +2010-08-06 James Robinson <jamesr@chromium.org> + + Reviewed by Simon Fraser. + + Composited canvas should be treated the same by the compositor and not be WebGL specific + https://bugs.webkit.org/show_bug.cgi?id=43589 + + Initializes the platformLayer as a CanvasLayerChromium, not a WebGLLayerChromium. + The layer itself isn't WebGL-specific. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::initialize): + (WebCore::GraphicsContext3DInternal::platformLayer): + (WebCore::GraphicsContext3D::platformLayer): + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * public/WebCString.h: + * public/WebString.h: + * src/DOMUtilitiesPrivate.h: + * src/DebuggerAgentImpl.h: + * src/DebuggerAgentManager.h: + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsFrontendImpl.h: + * src/WebPageSerializerImpl.h: + +2010-08-06 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium: disable device motion by default. + + https://bugs.webkit.org/show_bug.cgi?id=43623 + + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableDeviceMotion): + (WebKit::WebRuntimeFeatures::isDeviceMotionEnabled): + (WebKit::WebRuntimeFeatures::enableDeviceOrientation): + +2010-08-06 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Joseph Pecoraro. + + Web Inspector: Remove "Online/Offline" icon for Chrome's appcache devtools UI. + https://bugs.webkit.org/show_bug.cgi?id=43450 + + * src/js/DevTools.js: + (WebInspector.loaded): + +2010-08-05 Marcus Bulach <bulach@chromium.org> + + Reviewed by Jeremy Orlow. + + Initial bindings and plumbing for IDBCursor. + https://bugs.webkit.org/show_bug.cgi?id=41888 + + Test: storage/indexeddb/idb-opencursor.html + + * WebKit.gyp: + * public/WebIDBCallbacks.h: + (WebKit::WebIDBCallbacks::onSuccess): + * public/WebIDBCursor.h: Added. + (WebKit::WebIDBCursor::~WebIDBCursor): + (WebKit::WebIDBCursor::direction): + (WebKit::WebIDBCursor::key): + (WebKit::WebIDBCursor::value): + (WebKit::WebIDBCursor::update): + (WebKit::WebIDBCursor::continueFunction): + (WebKit::WebIDBCursor::remove): + * public/WebIDBKeyRange.h: Added. + (WebKit::WebIDBKeyRange::~WebIDBKeyRange): + (WebKit::WebIDBKeyRange::WebIDBKeyRange): + * public/WebIDBObjectStore.h: + (WebKit::WebIDBObjectStore::openCursor): + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: Added. + (WebCore::IDBCursorBackendProxy::create): + (WebCore::IDBCursorBackendProxy::IDBCursorBackendProxy): + (WebCore::IDBCursorBackendProxy::~IDBCursorBackendProxy): + (WebCore::IDBCursorBackendProxy::direction): + (WebCore::IDBCursorBackendProxy::key): + (WebCore::IDBCursorBackendProxy::value): + (WebCore::IDBCursorBackendProxy::update): + (WebCore::IDBCursorBackendProxy::continueFunction): + (WebCore::IDBCursorBackendProxy::remove): + * src/IDBCursorBackendProxy.h: Added. + * src/IDBObjectStoreProxy.cpp: + (WebCore::IDBObjectStoreProxy::openCursor): + * src/IDBObjectStoreProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebCore::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: Added. + (WebKit::WebIDBCursorImpl::WebIDBCursorImpl): + (WebKit::WebIDBCursorImpl::~WebIDBCursorImpl): + (WebKit::WebIDBCursorImpl::direction): + (WebKit::WebIDBCursorImpl::key): + (WebKit::WebIDBCursorImpl::value): + (WebKit::WebIDBCursorImpl::update): + (WebKit::WebIDBCursorImpl::continueFunction): + (WebKit::WebIDBCursorImpl::remove): + * src/WebIDBCursorImpl.h: Added. + * src/WebIDBKeyRange.cpp: Added. + (WebKit::WebIDBKeyRange::WebIDBKeyRange): + (WebKit::WebIDBKeyRange::assign): + (WebKit::WebIDBKeyRange::reset): + (WebKit::WebIDBKeyRange::left): + (WebKit::WebIDBKeyRange::right): + (WebKit::WebIDBKeyRange::flags): + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::openCursor): + * src/WebIDBObjectStoreImpl.h: + +2010-08-05 Andrei Popescu <andreip@dhcp-172-16-14-12.lon.corp.google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] IndexedDB is missing the Transaction interface. + https://bugs.webkit.org/show_bug.cgi?id=42970 + + Add IDBTransaction boilerplate. + + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::transaction): + * src/IDBDatabaseProxy.h: + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * public/WebCString.h: + * public/WebString.h: + * src/DOMUtilitiesPrivate.h: + * src/DebuggerAgentImpl.h: + * src/DebuggerAgentManager.h: + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsFrontendImpl.h: + * src/WebPageSerializerImpl.h: + +2010-08-05 Brett Wilson <brettw@chromium.org> + + Reviewed by Nate Chapin. + + Make the webkit unit tests depend on test_support_base + https://bugs.webkit.org/show_bug.cgi?id=43584 + + * WebKit.gyp: + +2010-08-04 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Style cleanups in WebGL + https://bugs.webkit.org/show_bug.cgi?id=38761 + + Cleaned up all style violations in WebGL-related files reported by + check-webkit-style. No logic or other changes. Built WebKit and + Chromium and ran WebGL layout tests. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + * src/WebGraphicsContext3DDefaultImpl.cpp: + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-08-05 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Unify blob related feature defines to ENABLE(BLOB). + https://bugs.webkit.org/show_bug.cgi?id=43081 + + * features.gypi: + * src/WebHTTPBody.cpp: + (WebKit::WebHTTPBody::elementAt): + (WebKit::WebHTTPBody::appendFileRange): + +2010-08-05 Nico Weber <thakis@chromium.org> + + Reviewed by Jeremy Orlow. + + Remove useless const on return-by-value (fixes a clang warning) + https://bugs.webkit.org/show_bug.cgi?id=43491 + + * src/WebInputEventConversion.cpp: + (WebKit::toPlatformKeyboardEventType): + +2010-08-05 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Add speech input controller mock in WebKit and a layout test. + https://bugs.webkit.org/show_bug.cgi?id=43477 + + * WebKit.gyp: + * public/WebSpeechInputControllerMock.h: Added WebKit speech input controller mock interface. + * src/WebSpeechInputControllerMockImpl.cpp: Added implementation of the above mock. + (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl): + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording): + (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition): + (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition): + (WebKit::WebSpeechInputControllerMockImpl::stopRecording): + (WebKit::WebSpeechInputControllerMock::create): + +2010-08-05 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: [REGRESSION] Frame navigation is not handled in devtools. + + https://bugs.webkit.org/show_bug.cgi?id=43556 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::detach): + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + (WebKit::WebDevToolsAgentImpl::setRuntimeFeatureEnabled): + +2010-08-05 John Gregg <johnnyg@google.com> + + Reviewed by Darin Fisher. + + [chromium] WebFileChooserParams should have default constructor + https://bugs.webkit.org/show_bug.cgi?id=43435 + + * public/WebFileChooserParams.h: + (WebKit::WebFileChooserParams::WebFileChooserParams): + +2010-08-05 Victoria Kirst <vrk@google.com> + + Reviewed by David Levin. + + Added a repaint request so that VideoLayerChromium does not have + a flickering problem when playing video. + https://bugs.webkit.org/show_bug.cgi?id=43101 + + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::repaint): + +2010-08-05 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + DevTools: get rid of delayed command dispatching on front-end side. + + https://bugs.webkit.org/show_bug.cgi?id=43479 + + * public/WebDevToolsFrontendClient.h: + (WebKit::WebDevToolsFrontendClient::sendFrontendLoaded): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::attach): + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend): + (WebKit::WebDevToolsFrontendImpl::frontendLoaded): + * src/WebDevToolsFrontendImpl.h: + * src/js/DevTools.js: + (WebInspector.doLoadedDone): + * src/js/Tests.js: + (.uiTests.runTest): + (.): + +2010-08-02 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Port Chromium's accelerated compositing to Mac OS X + https://bugs.webkit.org/show_bug.cgi?id=43398 + + * public/WebGLES2Context.h: + - Added resizeOnscreenContent, needed on Mac OS X to report + window size changes. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + - Send resize notification to the WebGLES2Context. + (WebKit::WebViewImpl::updateRootLayerContents): + - Ported to Core Graphics. + (WebKit::WebViewImpl::gles2Context): + - Added initial size notification upon context creation. + +2010-08-04 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + DevTools: get rid of delayed command dispatching on front-end side. + + https://bugs.webkit.org/show_bug.cgi?id=43479 + + * public/WebDevToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::frontendLoaded): + * src/WebDevToolsAgentImpl.h: + +2010-08-03 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + Move WebGL-specific code out of GraphicsContext3D so that G3D can be used as a generic accelerated drawing API + https://bugs.webkit.org/show_bug.cgi?id=43221 + + Implements functions in term of Platform3DObjects instead of WebGL types. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DInternal::beginPaint): + (WebCore::GraphicsContext3DInternal::bindAttribLocation): + (WebCore::GraphicsContext3DInternal::getActiveAttrib): + (WebCore::GraphicsContext3DInternal::getActiveUniform): + (WebCore::GraphicsContext3DInternal::getAttribLocation): + (WebCore::GraphicsContext3DInternal::getProgramInfoLog): + (WebCore::GraphicsContext3DInternal::getShaderInfoLog): + (WebCore::GraphicsContext3DInternal::getShaderSource): + (WebCore::GraphicsContext3DInternal::getUniformLocation): + (WebCore::GraphicsContext3DInternal::shaderSource): + +2010-08-03 Dimitri Glazkov <dglazkov@chromium.org> + + Unreviewed, build fix. + + Roll chromium to 54723 to unbreak the builds. + + * DEPS: + +2010-08-03 Andrei Popescu <andreip@google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] IDBObjectStoreRequest should be called IDBObjectStore + https://bugs.webkit.org/show_bug.cgi?id=43420 + + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::objectStore): + * src/IDBDatabaseProxy.h: + * src/IDBObjectStoreProxy.cpp: + (WebCore::IDBObjectStoreProxy::create): + * src/IDBObjectStoreProxy.h: + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::WebIDBObjectStoreImpl): + * src/WebIDBObjectStoreImpl.h: + +2010-08-03 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix Chromium interactive UI tests. + + * src/js/Tests.js: + (.TestSuite.prototype.testResourceHeaders): + +2010-07-30 Andrei Popescu <andreip@dhcp-172-16-14-12.lon.corp.google.com> + + Reviewed by Jeremy Orlow. + + Rename IDBDatabaseRequest to IDBDatabase + https://bugs.webkit.org/show_bug.cgi?id=43250 + + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::create): + * src/IDBDatabaseProxy.h: + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl): + (WebKit::WebIDBDatabaseImpl::name): + (WebKit::WebIDBDatabaseImpl::description): + (WebKit::WebIDBDatabaseImpl::version): + (WebKit::WebIDBDatabaseImpl::objectStores): + (WebKit::WebIDBDatabaseImpl::createObjectStore): + (WebKit::WebIDBDatabaseImpl::objectStore): + (WebKit::WebIDBDatabaseImpl::removeObjectStore): + * src/WebIDBDatabaseImpl.h: + +2010-08-02 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: Get rid of DevTools RPC. + + https://bugs.webkit.org/show_bug.cgi?id=43335 + + * WebKit.gyp: + * public/WebDevToolsAgent.h: + * public/WebDevToolsAgentClient.h: + (WebKit::WebDevToolsAgentClient::sendMessageToInspectorFrontend): + (WebKit::WebDevToolsAgentClient::sendDebuggerOutput): + (WebKit::WebDevToolsAgentClient::sendDispatchToAPU): + * public/WebDevToolsFrontend.h: + * public/WebDevToolsFrontendClient.h: + (WebKit::WebDevToolsFrontendClient::sendMessageToBackend): + * public/WebDevToolsMessageData.h: Removed. + * public/WebDevToolsMessageTransport.h: Removed. + * src/APUAgentDelegate.h: Removed. + * src/DebuggerAgent.h: Removed. + * src/DebuggerAgentImpl.cpp: + (WebKit::DebuggerAgentImpl::DebuggerAgentImpl): + (WebKit::DebuggerAgentImpl::debuggerOutput): + * src/DebuggerAgentImpl.h: + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::debugDetach): + (WebKit::DebuggerAgentManager::onV8DebugMessage): + (WebKit::DebuggerAgentManager::executeDebuggerCommand): + (WebKit::DebuggerAgentManager::sendCommandToV8): + (WebKit::DebuggerAgentManager::sendContinueCommandToV8): + * src/DevToolsRPC.h: Removed. + * src/DevToolsRPCJS.h: Removed. + * src/InspectorClientImpl.cpp: + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::sendMessageToBackend): + * src/ProfilerAgent.h: Removed. + * src/ProfilerAgentImpl.cpp: Removed. + * src/ProfilerAgentImpl.h: Removed. + * src/ToolsAgent.h: Removed. + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::WebDevToolsAgentImpl): + (WebKit::WebDevToolsAgentImpl::attach): + (WebKit::WebDevToolsAgentImpl::didClearWindowObject): + (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorBackend): + (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient): + (WebKit::WebDevToolsAgentImpl::sendMessageToFrontend): + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl): + (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend): + (WebKit::WebDevToolsFrontendImpl::frontendLoaded): + (WebKit::WebDevToolsFrontendImpl::executeScript): + * src/WebDevToolsFrontendImpl.h: + * src/js/DevTools.js: + (devtools.dispatch): + (devtools.ToolsAgent): + * src/js/DevToolsHostStub.js: + * src/js/ProfilerAgent.js: + (devtools.ProfilerAgent): + (devtools.ProfilerAgent.prototype._getNextLogLines.else.delayedRequest): + (devtools.ProfilerAgent.prototype._getNextLogLines): + (devtools.ProfilerAgent.prototype._didGetProfilerLogLines): + * src/js/ProfilerProcessor.js: + (devtools.profiler.Processor.prototype.printError): + +2010-08-02 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Remove dependencies to some Chromium headers + https://bugs.webkit.org/show_bug.cgi?id=43396 + + * DEPS: Update Chromium revision to 54649 in order to have a + webkit_support change (r54646) + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 7c7d7e7..d7afc77 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': '53434', + 'chromium_rev': '54723', } deps = { diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 10f01e5..eb5abbe 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -142,8 +142,10 @@ 'public/WebDevToolsAgentClient.h', 'public/WebDevToolsFrontend.h', 'public/WebDevToolsFrontendClient.h', - 'public/WebDevToolsMessageData.h', - 'public/WebDevToolsMessageTransport.h', + 'public/WebDeviceOrientation.h', + 'public/WebDeviceOrientationClient.h', + 'public/WebDeviceOrientationClientMock.h', + 'public/WebDeviceOrientationController.h', 'public/WebDocument.h', 'public/WebDocumentType.h', 'public/WebDragData.h', @@ -176,9 +178,11 @@ 'public/WebImage.h', 'public/WebImageDecoder.h', 'public/WebIDBCallbacks.h', + 'public/WebIDBCursor.h', 'public/WebIDBDatabase.h', 'public/WebIDBDatabaseError.h', 'public/WebIDBFactory.h', + 'public/WebIDBKeyRange.h', 'public/WebIDBIndex.h', 'public/WebIDBKey.h', 'public/WebIDBObjectStore.h', @@ -242,6 +246,7 @@ 'public/WebSocketStreamHandle.h', 'public/WebSocketStreamHandleClient.h', 'public/WebSpeechInputController.h', + 'public/WebSpeechInputControllerMock.h', 'public/WebSpeechInputListener.h', 'public/WebStorageArea.h', 'public/WebStorageEventDispatcher.h', @@ -271,7 +276,6 @@ 'public/win/WebSandboxSupport.h', 'public/win/WebScreenInfoFactory.h', 'public/win/WebScreenInfoFactory.h', - 'src/APUAgentDelegate.h', 'src/ApplicationCacheHost.cpp', 'src/ApplicationCacheHostInternal.h', 'src/AssertMatchingEnums.cpp', @@ -292,13 +296,12 @@ 'src/ContextMenuClientImpl.cpp', 'src/ContextMenuClientImpl.h', 'src/DatabaseObserver.cpp', - 'src/DebuggerAgent.h', 'src/DebuggerAgentImpl.cpp', 'src/DebuggerAgentImpl.h', 'src/DebuggerAgentManager.cpp', 'src/DebuggerAgentManager.h', - 'src/DevToolsRPC.h', - 'src/DevToolsRPCJS.h', + 'src/DeviceOrientationClientProxy.cpp', + 'src/DeviceOrientationClientProxy.h', 'src/DOMUtilitiesPrivate.cpp', 'src/DOMUtilitiesPrivate.h', 'src/DragClientImpl.cpp', @@ -319,6 +322,8 @@ 'src/gtk/WebInputEventFactory.cpp', 'src/IDBCallbacksProxy.cpp', 'src/IDBCallbacksProxy.h', + 'src/IDBCursorBackendProxy.cpp', + 'src/IDBCursorBackendProxy.h', 'src/IDBDatabaseProxy.cpp', 'src/IDBDatabaseProxy.h', 'src/IDBFactoryBackendProxy.cpp', @@ -343,9 +348,6 @@ 'src/NotificationPresenterImpl.cpp', 'src/PlatformMessagePortChannel.cpp', 'src/PlatformMessagePortChannel.h', - 'src/ProfilerAgent.h', - 'src/ProfilerAgentImpl.cpp', - 'src/ProfilerAgentImpl.h', 'src/ResourceHandle.cpp', 'src/SharedWorkerRepository.cpp', 'src/SocketStreamHandle.cpp', @@ -359,7 +361,6 @@ 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', 'src/TemporaryGlue.h', - 'src/ToolsAgent.h', 'src/WebAccessibilityCache.cpp', 'src/WebAccessibilityCacheImpl.cpp', 'src/WebAccessibilityCacheImpl.h', @@ -383,6 +384,9 @@ 'src/WebDevToolsAgentImpl.h', 'src/WebDevToolsFrontendImpl.cpp', 'src/WebDevToolsFrontendImpl.h', + 'src/WebDeviceOrientation.cpp', + 'src/WebDeviceOrientationClientMock.cpp', + 'src/WebDeviceOrientationController.cpp', 'src/WebDocument.cpp', 'src/WebDocumentType.cpp', 'src/WebDragData.cpp', @@ -414,6 +418,8 @@ 'src/WebHTTPBody.cpp', 'src/WebIDBCallbacksImpl.cpp', 'src/WebIDBCallbacksImpl.h', + 'src/WebIDBCursorImpl.cpp', + 'src/WebIDBCursorImpl.h', 'src/WebIDBDatabaseError.cpp', 'src/WebIDBDatabaseImpl.cpp', 'src/WebIDBDatabaseImpl.h', @@ -422,6 +428,7 @@ 'src/WebIDBIndexImpl.cpp', 'src/WebIDBIndexImpl.h', 'src/WebIDBKey.cpp', + 'src/WebIDBKeyRange.cpp', 'src/WebIDBObjectStoreImpl.cpp', 'src/WebIDBObjectStoreImpl.h', 'src/WebImageCG.cpp', @@ -473,6 +480,8 @@ 'src/WebSettingsImpl.h', 'src/WebSharedWorkerImpl.cpp', 'src/WebSharedWorkerImpl.h', + 'src/WebSpeechInputControllerMockImpl.cpp', + 'src/WebSpeechInputControllerMockImpl.h', 'src/WebStorageAreaImpl.cpp', 'src/WebStorageAreaImpl.h', 'src/WebStorageEventDispatcherImpl.cpp', @@ -695,6 +704,7 @@ '<(chromium_src_dir)/testing/gtest.gyp:gtest', '<(chromium_src_dir)/base/base.gyp:base', '<(chromium_src_dir)/base/base.gyp:base_i18n', + '<(chromium_src_dir)/base/base.gyp:test_support_base', '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', ], 'include_dirs': [ diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 559ebd8..9b758f9 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -40,7 +40,7 @@ # features_override.gypi inline documentation for more details. 'feature_defines%': [ 'ENABLE_3D_CANVAS=1', - 'ENABLE_BLOB_SLICE=1', + 'ENABLE_BLOB=1', 'ENABLE_CHANNEL_MESSAGING=1', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', @@ -49,7 +49,6 @@ 'ENABLE_DIRECTORY_UPLOAD=1', 'ENABLE_DOM_STORAGE=1', 'ENABLE_EVENTSOURCE=1', - 'ENABLE_FILE_READER=1', 'ENABLE_FILE_WRITER=1', 'ENABLE_FILE_SYSTEM=1', 'ENABLE_FILTERS=1', diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h index 2c1e137..0320eb6 100644 --- a/WebKit/chromium/public/WebCString.h +++ b/WebKit/chromium/public/WebCString.h @@ -34,11 +34,15 @@ #include "WebCommon.h" #if WEBKIT_IMPLEMENTATION -namespace WTF { class CString; } +#include <wtf/Forward.h> #else #include <string> #endif +namespace WTF { +class CString; +} + namespace WebKit { class WebCStringPrivate; diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index 0e26cc9..4fd1cbd 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -51,10 +51,11 @@ public: virtual void attach() = 0; virtual void detach() = 0; + virtual void frontendLoaded() = 0; virtual void didNavigate() = 0; - virtual void dispatchMessageFromFrontend(const WebDevToolsMessageData&) = 0; + virtual void dispatchOnInspectorBackend(const WebString& message) = 0; virtual void inspectElementAt(const WebPoint&) = 0; @@ -72,8 +73,6 @@ public: // Asynchronously request debugger to pause immediately. WEBKIT_API static void debuggerPauseScript(); - WEBKIT_API static bool dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport*, const WebDevToolsMessageData&); - typedef void (*MessageLoopDispatchHandler)(); // Installs dispatch handle that is going to be called periodically diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h index 91fd3e8..ec013ac 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -40,7 +40,9 @@ struct WebDevToolsMessageData; class WebDevToolsAgentClient { public: - virtual void sendMessageToFrontend(const WebDevToolsMessageData&) { } + virtual void sendMessageToInspectorFrontend(const WebString&) { } + virtual void sendDebuggerOutput(const WebString&) { } + virtual void sendDispatchToAPU(const WebString&) { } // Invalidates widget which leads to the repaint. virtual void forceRepaint() { } @@ -52,7 +54,6 @@ public: virtual void runtimeFeatureStateChanged(const WebString& feature, bool enabled) { } virtual WebCString injectedScriptSource() { return WebCString(); } - virtual WebCString injectedScriptDispatcherSource() { return WebCString(); } virtual WebCString debuggerScriptSource() { return WebCString(); } class WebKitClientMessageLoop { diff --git a/WebKit/chromium/public/WebDevToolsFrontend.h b/WebKit/chromium/public/WebDevToolsFrontend.h index d95f35a..0325f92 100644 --- a/WebKit/chromium/public/WebDevToolsFrontend.h +++ b/WebKit/chromium/public/WebDevToolsFrontend.h @@ -38,7 +38,6 @@ namespace WebKit { class WebDevToolsFrontendClient; class WebString; class WebView; -struct WebDevToolsMessageData; // WebDevToolsFrontend represents DevTools client sitting in the Glue. It provides // direct and delegate Apis to the host. @@ -50,7 +49,7 @@ public: virtual ~WebDevToolsFrontend() {} - virtual void dispatchMessageFromAgent(const WebDevToolsMessageData&) = 0; + virtual void dispatchOnInspectorFrontend(const WebString&) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebDevToolsFrontendClient.h b/WebKit/chromium/public/WebDevToolsFrontendClient.h index 159a3cd..df34dc5 100644 --- a/WebKit/chromium/public/WebDevToolsFrontendClient.h +++ b/WebKit/chromium/public/WebDevToolsFrontendClient.h @@ -40,7 +40,8 @@ class WebDevToolsFrontendClient { public: WebDevToolsFrontendClient() { } - virtual void sendMessageToAgent(const WebDevToolsMessageData&) { } + virtual void sendFrontendLoaded() { } + virtual void sendMessageToBackend(const WebString&) { } virtual void sendDebuggerCommandToAgent(const WebString& command) { } virtual void sendDebuggerPauseScript() { } diff --git a/WebKit/chromium/public/WebDevToolsMessageData.h b/WebKit/chromium/public/WebDevToolsMessageData.h deleted file mode 100644 index 9bf9acd..0000000 --- a/WebKit/chromium/public/WebDevToolsMessageData.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 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 WebDevToolsMessageData_h -#define WebDevToolsMessageData_h - -#include "WebCommon.h" -#include "WebString.h" -#include "WebVector.h" - -namespace WebKit { - -struct WebDevToolsMessageData { - WebString className; - WebString methodName; - WebVector<WebString> arguments; -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/public/WebDeviceOrientation.h b/WebKit/chromium/public/WebDeviceOrientation.h new file mode 100644 index 0000000..7e8aa72 --- /dev/null +++ b/WebKit/chromium/public/WebDeviceOrientation.h @@ -0,0 +1,88 @@ +/* + * 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. + * + * 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 WebDeviceOrientation_h +#define WebDeviceOrientation_h + +#if WEBKIT_IMPLEMENTATION +namespace WTF { template <typename T> class PassRefPtr; } +namespace WebCore { class DeviceOrientation; } +#endif + +namespace WebKit { + +class WebDeviceOrientation { +public: + WebDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) + : m_isNull(false), + m_canProvideAlpha(canProvideAlpha), + m_alpha(alpha), + m_canProvideBeta(canProvideBeta), + m_beta(beta), + m_canProvideGamma(canProvideGamma), + m_gamma(gamma) + { + } + + static WebDeviceOrientation nullOrientation() { return WebDeviceOrientation(); } + + bool isNull() { return m_isNull; } + bool canProvideAlpha() { return m_canProvideAlpha; } + double alpha() { return m_alpha; } + bool canProvideBeta() { return m_canProvideBeta; } + double beta() { return m_beta; } + bool canProvideGamma() { return m_canProvideGamma; } + double gamma() { return m_gamma; } + +#if WEBKIT_IMPLEMENTATION + WebDeviceOrientation(const WTF::PassRefPtr<WebCore::DeviceOrientation>&); + WebDeviceOrientation& operator=(const WTF::PassRefPtr<WebCore::DeviceOrientation>&); + operator WTF::PassRefPtr<WebCore::DeviceOrientation>() const; +#endif + +private: + WebDeviceOrientation() + : m_isNull(true), + m_canProvideAlpha(false), + m_alpha(0), + m_canProvideBeta(false), + m_beta(0), + m_canProvideGamma(false), + m_gamma(0) + { + } + + bool m_isNull; + bool m_canProvideAlpha; + double m_alpha; + bool m_canProvideBeta; + double m_beta; + bool m_canProvideGamma; + double m_gamma; +}; + +} // namespace WebKit + +#endif // WebDeviceOrientation_h diff --git a/WebKit/chromium/public/WebDeviceOrientationClient.h b/WebKit/chromium/public/WebDeviceOrientationClient.h new file mode 100644 index 0000000..4df8665 --- /dev/null +++ b/WebKit/chromium/public/WebDeviceOrientationClient.h @@ -0,0 +1,47 @@ +/* + * 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. + * + * 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 WebDeviceOrientationClient_h +#define WebDeviceOrientationClient_h + +namespace WebKit { + +class WebDeviceOrientation; +class WebDeviceOrientationController; + +class WebDeviceOrientationClient { +public: + virtual ~WebDeviceOrientationClient() {} + + virtual void setController(WebDeviceOrientationController*) = 0; + virtual void startUpdating() = 0; + virtual void stopUpdating() = 0; + + virtual WebDeviceOrientation lastOrientation() const = 0; +}; + +} // namespace WebKit + +#endif // WebDeviceOrientationClient_h diff --git a/WebKit/chromium/public/WebDeviceOrientationClientMock.h b/WebKit/chromium/public/WebDeviceOrientationClientMock.h new file mode 100644 index 0000000..fce964b --- /dev/null +++ b/WebKit/chromium/public/WebDeviceOrientationClientMock.h @@ -0,0 +1,57 @@ +/* + * 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. + * + * 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 WebDeviceOrientationClientMock_h +#define WebDeviceOrientationClientMock_h + +#include "WebCommon.h" +#include "WebDeviceOrientationClient.h" + +namespace WebCore { class DeviceOrientationClientMock; } + +namespace WebKit { + +class WebDeviceOrientationClientMock : public WebDeviceOrientationClient { +public: + WebDeviceOrientationClientMock() { initialize(); } + ~WebDeviceOrientationClientMock() { reset(); } + + virtual void setController(WebDeviceOrientationController*); + virtual void startUpdating(); + virtual void stopUpdating(); + virtual WebDeviceOrientation lastOrientation() const; + + WEBKIT_API void setOrientation(WebDeviceOrientation&); + +private: + WEBKIT_API void initialize(); + WEBKIT_API void reset(); + + WebCore::DeviceOrientationClientMock* m_clientMock; +}; + +} // namespace WebKit + +#endif // WebDeviceOrientationClientMock_h diff --git a/WebKit/chromium/public/WebDeviceOrientationController.h b/WebKit/chromium/public/WebDeviceOrientationController.h new file mode 100644 index 0000000..ef843ee --- /dev/null +++ b/WebKit/chromium/public/WebDeviceOrientationController.h @@ -0,0 +1,56 @@ +/* + * 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. + * + * 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 WebDeviceOrientationController_h +#define WebDeviceOrientationController_h + +#include "WebCommon.h" + +namespace WebCore { class DeviceOrientationController; } + +namespace WebKit { + +class WebDeviceOrientation; + +class WebDeviceOrientationController { +public: + WebDeviceOrientationController(WebCore::DeviceOrientationController* c) + : m_controller(c) + { + } + + WEBKIT_API void didChangeDeviceOrientation(const WebDeviceOrientation&); + +#if WEBKIT_IMPLEMENTATION + WebCore::DeviceOrientationController* controller() const; +#endif + +private: + WebCore::DeviceOrientationController* m_controller; +}; + +} // namespace WebKit + +#endif // WebDeviceOrientationController_h diff --git a/WebKit/chromium/public/WebFileChooserParams.h b/WebKit/chromium/public/WebFileChooserParams.h index 2a30944..8e56d70 100644 --- a/WebKit/chromium/public/WebFileChooserParams.h +++ b/WebKit/chromium/public/WebFileChooserParams.h @@ -59,6 +59,12 @@ struct WebFileChooserParams { // - replacing with other files // before opening a file chooser dialog. WebVector<WebString> selectedFiles; + + WebFileChooserParams() + : multiSelect(false) + , directory(false) + { + } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h index c67faf2..45184aa 100644 --- a/WebKit/chromium/public/WebGLES2Context.h +++ b/WebKit/chromium/public/WebGLES2Context.h @@ -58,6 +58,12 @@ public: // Returns the ID of the texture used for offscreen rendering in the context of the parent. virtual unsigned getOffscreenContentParentTextureId() = 0; + + // The following function is used only on Mac OS X and is needed + // in order to report window size changes. +#if defined(__APPLE__) + virtual void resizeOnscreenContent(const WebSize&) = 0; +#endif }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBCallbacks.h b/WebKit/chromium/public/WebIDBCallbacks.h index cee8612..2e2c4d2 100644 --- a/WebKit/chromium/public/WebIDBCallbacks.h +++ b/WebKit/chromium/public/WebIDBCallbacks.h @@ -30,6 +30,7 @@ namespace WebKit { +class WebIDBCursor; class WebIDBDatabase; class WebIDBDatabaseError; class WebIDBKey; @@ -45,6 +46,7 @@ public: // For the rest, pass ownership to the callee via a pointer. virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } // For "null". + virtual void onSuccess(WebIDBCursor*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(WebIDBIndex*) { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h new file mode 100644 index 0000000..27eb924 --- /dev/null +++ b/WebKit/chromium/public/WebIDBCursor.h @@ -0,0 +1,78 @@ +/* + * 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. + * + * 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 WebIDBCursor_h +#define WebIDBCursor_h + +#include "WebCommon.h" +#include "WebIDBCallbacks.h" +#include "WebIDBKey.h" +#include "WebSerializedScriptValue.h" +#include "WebString.h" + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBCursor { +public: + virtual ~WebIDBCursor() { } + + virtual unsigned short direction() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return 0; + } + + virtual WebIDBKey key() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return WebIDBKey(""); + } + + virtual WebSerializedScriptValue value() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return WebSerializedScriptValue(); + } + + virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*) + { + WEBKIT_ASSERT_NOT_REACHED(); + } + + virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*) + { + WEBKIT_ASSERT_NOT_REACHED(); + } + + virtual void remove(WebIDBCallbacks*) + { + WEBKIT_ASSERT_NOT_REACHED(); + } +}; + +} // namespace WebKit + +#endif // WebIDBCursor_h diff --git a/WebKit/chromium/public/WebIDBKeyRange.h b/WebKit/chromium/public/WebIDBKeyRange.h new file mode 100644 index 0000000..82953ce --- /dev/null +++ b/WebKit/chromium/public/WebIDBKeyRange.h @@ -0,0 +1,66 @@ +/* + * 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. + * + * 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 WebIDBKeyRange_h +#define WebIDBKeyRange_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" + +namespace WebCore { class IDBKeyRange; } + +namespace WebKit { + +class WebIDBKey; +class WebString; + +class WebIDBKeyRange { +public: + ~WebIDBKeyRange() { reset(); } + + WebIDBKeyRange(const WebIDBKeyRange& keyRange) { assign(keyRange); } + WebIDBKeyRange(const WebIDBKey& left, const WebIDBKey& right, unsigned short flags) { assign(left, right, flags); } + + WEBKIT_API WebIDBKey left() const; + WEBKIT_API WebIDBKey right() const; + WEBKIT_API unsigned short flags() const; + + WEBKIT_API void assign(const WebIDBKeyRange&); + WEBKIT_API void assign(const WebIDBKey& left, const WebIDBKey& right, unsigned short flags); + WEBKIT_API void reset(); + +#if WEBKIT_IMPLEMENTATION + WebIDBKeyRange(const WTF::PassRefPtr<WebCore::IDBKeyRange>&); + WebIDBKeyRange& operator=(const WTF::PassRefPtr<WebCore::IDBKeyRange>&); + operator WTF::PassRefPtr<WebCore::IDBKeyRange>() const; +#endif + +private: + WebPrivatePtr<WebCore::IDBKeyRange> m_private; +}; + +} // namespace WebKit + +#endif // WebIDBKeyRange_h diff --git a/WebKit/chromium/public/WebIDBObjectStore.h b/WebKit/chromium/public/WebIDBObjectStore.h index fb81fb9..7452be9 100755 --- a/WebKit/chromium/public/WebIDBObjectStore.h +++ b/WebKit/chromium/public/WebIDBObjectStore.h @@ -33,6 +33,8 @@ namespace WebKit { +class WebIDBKeyRange; + // See comment in WebIndexedDatabase for a high level overview these classes. class WebIDBObjectStore { public: @@ -79,6 +81,10 @@ public: { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) + { + WEBKIT_ASSERT_NOT_REACHED(); + } // FIXME: finish. }; diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h index 517aad5..9aa1f4f 100644 --- a/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/WebKit/chromium/public/WebRuntimeFeatures.h @@ -77,6 +77,9 @@ public: WEBKIT_API static void enableTouch(bool); WEBKIT_API static bool isTouchEnabled(); + WEBKIT_API static void enableDeviceMotion(bool); + WEBKIT_API static bool isDeviceMotionEnabled(); + WEBKIT_API static void enableDeviceOrientation(bool); WEBKIT_API static bool isDeviceOrientationEnabled(); diff --git a/WebKit/chromium/public/WebDevToolsMessageTransport.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h index 54c07f1..9a26235 100644 --- a/WebKit/chromium/public/WebDevToolsMessageTransport.h +++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h @@ -28,19 +28,23 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebDevToolsMessageTransport_h -#define WebDevToolsMessageTransport_h +#ifndef WebSpeechInputControllerMock_h +#define WebSpeechInputControllerMock_h -#include "WebCString.h" -#include "WebCommon.h" +#include "WebSpeechInputController.h" namespace WebKit { -struct WebDevToolsMessageData; -class WebDevToolsMessageTransport { +class WebString; +class WebSpeechInputListener; + +class WebSpeechInputControllerMock : public WebSpeechInputController { public: - virtual ~WebDevToolsMessageTransport() { } - virtual void sendMessageToFrontendOnIOThread(const WebDevToolsMessageData&) = 0; + WEBKIT_API static WebSpeechInputControllerMock* create( + WebSpeechInputListener* listener); + virtual ~WebSpeechInputControllerMock() { } + + virtual void setMockRecognitionResult(const WebString& result) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebString.h b/WebKit/chromium/public/WebString.h index 2c9664e..4d5e502 100644 --- a/WebKit/chromium/public/WebString.h +++ b/WebKit/chromium/public/WebString.h @@ -34,10 +34,7 @@ #include "WebCommon.h" #if WEBKIT_IMPLEMENTATION -namespace WebCore { -class String; -class AtomicString; -} +#include <wtf/Forward.h> #else #include <base/nullable_string16.h> #include <base/string16.h> @@ -102,13 +99,13 @@ public: } #if WEBKIT_IMPLEMENTATION - WebString(const WebCore::String&); - WebString& operator=(const WebCore::String&); - operator WebCore::String() const; + WebString(const WTF::String&); + WebString& operator=(const WTF::String&); + operator WTF::String() const; - WebString(const WebCore::AtomicString&); - WebString& operator=(const WebCore::AtomicString&); - operator WebCore::AtomicString() const; + WebString(const WTF::AtomicString&); + WebString& operator=(const WTF::AtomicString&); + operator WTF::AtomicString() const; #else WebString(const string16& s) : m_private(0) diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 4628c2f..c64418b 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -44,6 +44,7 @@ namespace WebKit { class WebAccessibilityObject; +class WebDeviceOrientationClient; class WebDragData; class WebElement; class WebFileChooserCompletion; @@ -341,6 +342,11 @@ public: virtual WebSpeechInputController* speechInputController( WebSpeechInputListener*) { return 0; } + // Device Orientation -------------------------------------------------- + + // Access the embedder API for device orientation services. + virtual WebDeviceOrientationClient* deviceOrientationClient() { return 0; } + protected: ~WebViewClient() { } }; diff --git a/WebKit/chromium/src/APUAgentDelegate.h b/WebKit/chromium/src/APUAgentDelegate.h deleted file mode 100644 index 70be702..0000000 --- a/WebKit/chromium/src/APUAgentDelegate.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef APUAgentDelegate_h -#define APUAgentDelegate_h - -#include "DevToolsRPC.h" - -namespace WebKit { - -#define APU_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, MEHTOD4, METHOD5) \ - /* Sends a json object to apu. */ \ - METHOD1(dispatchToApu, String /* data */) - -DEFINE_RPC_CLASS(ApuAgentDelegate, APU_AGENT_DELEGATE_STRUCT) - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 093ac11..bcd7931 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -69,6 +69,12 @@ #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), mismatching_enums) +// These constants are in WTF, bring them into WebCore so the ASSERT still works for them! +namespace WebCore { + using WTF::TextCaseSensitive; + using WTF::TextCaseInsensitive; +}; + COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUnknown, UnknownRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleButton, ButtonRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleRadioButton, RadioButtonRole); diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h index 223cf16..a946e34 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.h +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h @@ -73,11 +73,11 @@ public: virtual void valueChanged(unsigned listIndex, bool fireEvents = true); virtual void selectionChanged(unsigned, bool); virtual void selectionCleared(); - virtual WebCore::String itemText(unsigned listIndex) const; - virtual WebCore::String itemLabel(unsigned listIndex) const; - virtual WebCore::String itemIcon(unsigned listIndex) const; - virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); } - virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); } + virtual WTF::String itemText(unsigned listIndex) const; + virtual WTF::String itemLabel(unsigned listIndex) const; + virtual WTF::String itemIcon(unsigned listIndex) const; + virtual WTF::String itemToolTip(unsigned lastIndex) const { return WTF::String(); } + virtual WTF::String itemAccessibilityText(unsigned lastIndex) const { return WTF::String(); } virtual bool itemIsEnabled(unsigned listIndex) const { return true; } virtual WebCore::PopupMenuStyle itemStyle(unsigned listIndex) const; virtual WebCore::PopupMenuStyle menuStyle() const; @@ -131,9 +131,9 @@ private: void setSelectedIndex(int index) { m_selectedIndex = index; } // The names, labels and icons that make up the contents of the menu items. - Vector<WebCore::String> m_names; - Vector<WebCore::String> m_labels; - Vector<WebCore::String> m_icons; + Vector<WTF::String> m_names; + Vector<WTF::String> m_labels; + Vector<WTF::String> m_icons; Vector<int> m_uniqueIDs; // The index of the separator. -1 if there is no separator. diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 2a5c32e..405fbf6 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -616,7 +616,7 @@ void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileCh chooserCompletion->didChooseFile(WebVector<WebString>()); } -void ChromeClientImpl::chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*) +void ChromeClientImpl::chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*) { notImplemented(); } diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h index 7f3febf..8763def 100644 --- a/WebKit/chromium/src/ChromeClientImpl.h +++ b/WebKit/chromium/src/ChromeClientImpl.h @@ -86,18 +86,18 @@ public: virtual void setResizable(bool); virtual void addMessageToConsole( WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel, - const WebCore::String& message, unsigned lineNumber, - const WebCore::String& sourceID); + const WTF::String& message, unsigned lineNumber, + const WTF::String& sourceID); virtual bool canRunBeforeUnloadConfirmPanel(); virtual bool runBeforeUnloadConfirmPanel( - const WebCore::String& message, WebCore::Frame*); + const WTF::String& message, WebCore::Frame*); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); virtual bool runJavaScriptPrompt( - WebCore::Frame*, const WebCore::String& message, - const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String& message); + WebCore::Frame*, const WTF::String& message, + const WTF::String& defaultValue, WTF::String& result); + virtual void setStatusbarText(const WTF::String& message); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; virtual WebCore::IntRect windowResizerRect() const; @@ -116,10 +116,10 @@ public: virtual void scrollbarsModeDidChange() const; virtual void mouseDidMoveOverElement( const WebCore::HitTestResult& result, unsigned modifierFlags); - virtual void setToolTip(const WebCore::String& tooltipText, WebCore::TextDirection); + virtual void setToolTip(const WTF::String& tooltipText, WebCore::TextDirection); virtual void print(WebCore::Frame*); virtual void exceededDatabaseQuota( - WebCore::Frame*, const WebCore::String& databaseName); + WebCore::Frame*, const WTF::String& databaseName); #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); @@ -130,7 +130,7 @@ public: virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void setCursor(const WebCore::Cursor&) { } virtual void formStateDidChange(const WebCore::Node*); virtual PassOwnPtr<WebCore::HTMLParserQuirks> createHTMLParserQuirks() { return 0; } diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 397ea17..a43109c 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -862,13 +862,6 @@ void ChromiumBridge::widgetSetCursor(Widget* widget, const Cursor& cursor) client->setCursor(WebCursorInfo(cursor)); } -void ChromiumBridge::widgetSetFocus(Widget* widget) -{ - ChromeClientImpl* client = toChromeClientImpl(widget); - if (client) - client->focus(); -} - WorkerContextProxy* WorkerContextProxy::create(Worker* worker) { return WebWorkerClientImpl::createWorkerContextProxy(worker); diff --git a/WebKit/chromium/src/ContextMenuClientImpl.h b/WebKit/chromium/src/ContextMenuClientImpl.h index 4191fad..97ea967 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.h +++ b/WebKit/chromium/src/ContextMenuClientImpl.h @@ -51,7 +51,7 @@ public: virtual void lookUpInDictionary(WebCore::Frame*) {} virtual void searchWithGoogle(const WebCore::Frame*) {} virtual bool shouldIncludeInspectElementItem() { return false; } - virtual void speak(const WebCore::String&) {} + virtual void speak(const WTF::String&) {} virtual void stopSpeaking() {} private: void populateCustomMenuItems(WebCore::ContextMenu*, WebContextMenuData*); diff --git a/WebKit/chromium/src/DOMUtilitiesPrivate.h b/WebKit/chromium/src/DOMUtilitiesPrivate.h index 253ab3f..f5d03a5 100644 --- a/WebKit/chromium/src/DOMUtilitiesPrivate.h +++ b/WebKit/chromium/src/DOMUtilitiesPrivate.h @@ -31,6 +31,8 @@ #ifndef DOMUtilitiesPrivate_h #define DOMUtilitiesPrivate_h +#include <wtf/Forward.h> + namespace WebCore { class Element; class HTMLInputElement; @@ -39,7 +41,6 @@ class HTMLMetaElement; class HTMLOptionElement; class Node; class QualifiedName; -class String; } // This file is an aggregate of useful WebCore operations. @@ -53,7 +54,7 @@ WebCore::HTMLMetaElement* toHTMLMetaElement(WebCore::Node*); WebCore::HTMLOptionElement* toHTMLOptionElement(WebCore::Node*); // FIXME: Deprecate. Use WebInputElement::nameForAutofill instead. -WebCore::String nameOfInputElement(WebCore::HTMLInputElement*); +WTF::String nameOfInputElement(WebCore::HTMLInputElement*); // For img, script, iframe, frame element, when attribute name is src, // for link, a, area element, when attribute name is href, diff --git a/WebKit/chromium/src/DebuggerAgent.h b/WebKit/chromium/src/DebuggerAgent.h deleted file mode 100644 index 17cde11..0000000 --- a/WebKit/chromium/src/DebuggerAgent.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef DebuggerAgent_h -#define DebuggerAgent_h - -#include "DevToolsRPC.h" - -namespace WebKit { - -#define DEBUGGER_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Requests global context id of the inspected tab. */ \ - METHOD0(getContextId) \ - \ - /* Request v8 to process all debug commands in the queue. */ \ - METHOD0(processDebugCommands) - -DEFINE_RPC_CLASS(DebuggerAgent, DEBUGGER_AGENT_STRUCT) - -#define DEBUGGER_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - METHOD1(debuggerOutput, String /* output text */) \ - \ - /* Pushes debugger context id into the client. */ \ - METHOD1(setContextId, int /* context id */) - -DEFINE_RPC_CLASS(DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/DebuggerAgentImpl.cpp b/WebKit/chromium/src/DebuggerAgentImpl.cpp index dde9e1d..46c6e7c 100644 --- a/WebKit/chromium/src/DebuggerAgentImpl.cpp +++ b/WebKit/chromium/src/DebuggerAgentImpl.cpp @@ -32,32 +32,21 @@ #include "DebuggerAgentImpl.h" #include "DebuggerAgentManager.h" -#include "Document.h" -#include "Frame.h" -#include "Page.h" -#include "ScriptDebugServer.h" -#include "V8Binding.h" +#include "WebDevToolsAgentClient.h" #include "WebDevToolsAgentImpl.h" #include "WebViewImpl.h" -#include <wtf/HashSet.h> -#include <wtf/RefPtr.h> -#include <wtf/Vector.h> -using WebCore::DOMWindow; -using WebCore::Document; -using WebCore::Frame; -using WebCore::Page; -using WebCore::String; +using WTF::String; namespace WebKit { DebuggerAgentImpl::DebuggerAgentImpl( WebViewImpl* webViewImpl, - DebuggerAgentDelegate* delegate, - WebDevToolsAgentImpl* webdevtoolsAgent) + WebDevToolsAgentImpl* webdevtoolsAgent, + WebDevToolsAgentClient* webdevtoolsAgentClient) : m_webViewImpl(webViewImpl) - , m_delegate(delegate) , m_webdevtoolsAgent(webdevtoolsAgent) + , m_webdevtoolsAgentClient(webdevtoolsAgentClient) , m_autoContinueOnException(false) { DebuggerAgentManager::debugAttach(this); @@ -68,75 +57,12 @@ DebuggerAgentImpl::~DebuggerAgentImpl() DebuggerAgentManager::debugDetach(this); } -void DebuggerAgentImpl::getContextId() -{ - m_delegate->setContextId(m_webdevtoolsAgent->hostId()); -} - -void DebuggerAgentImpl::processDebugCommands() -{ - DebuggerAgentManager::UtilityContextScope utilityScope; - v8::Debug::ProcessDebugMessages(); -} - void DebuggerAgentImpl::debuggerOutput(const String& command) { - m_delegate->debuggerOutput(command); + m_webdevtoolsAgentClient->sendDebuggerOutput(command); m_webdevtoolsAgent->forceRepaint(); } -String DebuggerAgentImpl::executeUtilityFunction( - v8::Handle<v8::Context> context, - int callId, - const char* object, - const String &functionName, - const String& jsonArgs, - bool async, - String* exception) -{ - v8::HandleScope scope; - ASSERT(!context.IsEmpty()); - if (context.IsEmpty()) { - *exception = "No window context."; - return ""; - } - v8::Context::Scope contextScope(context); - - DebuggerAgentManager::UtilityContextScope utilityScope; - - v8::Handle<v8::Object> dispatchObject = v8::Handle<v8::Object>::Cast( - context->Global()->Get(v8::String::New(object))); - - v8::Handle<v8::Value> dispatchFunction = dispatchObject->Get(v8::String::New("dispatch")); - ASSERT(dispatchFunction->IsFunction()); - v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction); - - v8::Handle<v8::String> functionNameWrapper = v8::Handle<v8::String>( - v8::String::New(functionName.utf8().data())); - v8::Handle<v8::String> jsonArgsWrapper = v8::Handle<v8::String>( - v8::String::New(jsonArgs.utf8().data())); - v8::Handle<v8::Number> callIdWrapper = v8::Handle<v8::Number>( - v8::Number::New(async ? callId : 0)); - - v8::Handle<v8::Value> args[] = { - functionNameWrapper, - jsonArgsWrapper, - callIdWrapper - }; - - v8::TryCatch tryCatch; - v8::Handle<v8::Value> resObj = function->Call(context->Global(), 3, args); - if (tryCatch.HasCaught()) { - v8::Local<v8::Message> message = tryCatch.Message(); - if (message.IsEmpty()) - *exception = "Unknown exception"; - else - *exception = WebCore::toWebCoreString(message->Get()); - return ""; - } - return WebCore::toWebCoreStringWithNullCheck(resObj); -} - WebCore::Page* DebuggerAgentImpl::page() { return m_webViewImpl->page(); diff --git a/WebKit/chromium/src/DebuggerAgentImpl.h b/WebKit/chromium/src/DebuggerAgentImpl.h index 0e6e6af..a8fcc4e 100644 --- a/WebKit/chromium/src/DebuggerAgentImpl.h +++ b/WebKit/chromium/src/DebuggerAgentImpl.h @@ -31,55 +31,31 @@ #ifndef DebuggerAgentImpl_h #define DebuggerAgentImpl_h -#include "DebuggerAgent.h" - -#include <v8.h> -#include <wtf/HashSet.h> -#include <wtf/Noncopyable.h> +#include <wtf/Forward.h> namespace WebCore { -class Document; -class Frame; -class Node; class Page; -class String; } namespace WebKit { +class WebDevToolsAgentClient; class WebDevToolsAgentImpl; class WebViewImpl; -class DebuggerAgentImpl : public DebuggerAgent { +class DebuggerAgentImpl { public: DebuggerAgentImpl(WebKit::WebViewImpl* webViewImpl, - DebuggerAgentDelegate* delegate, - WebDevToolsAgentImpl* webdevtoolsAgent); + WebDevToolsAgentImpl* webdevtoolsAgent, + WebDevToolsAgentClient* webdevtoolsAgentClient); virtual ~DebuggerAgentImpl(); - // DebuggerAgent implementation. - virtual void getContextId(); - virtual void processDebugCommands(); - - void debuggerOutput(const WebCore::String& out); + void debuggerOutput(const WTF::String& out); void setAutoContinueOnException(bool autoContinue) { m_autoContinueOnException = autoContinue; } bool autoContinueOnException() { return m_autoContinueOnException; } - // Executes function with the given name in the utility context. Passes node - // and json args as parameters. Note that the function called must be - // implemented in the inject_dispatch.js file. - WebCore::String executeUtilityFunction( - v8::Handle<v8::Context> context, - int callId, - const char* object, - const WebCore::String& functionName, - const WebCore::String& jsonArgs, - bool async, - WebCore::String* exception); - - WebCore::Page* page(); WebDevToolsAgentImpl* webdevtoolsAgent() { return m_webdevtoolsAgent; } @@ -87,8 +63,8 @@ public: private: WebKit::WebViewImpl* m_webViewImpl; - DebuggerAgentDelegate* m_delegate; WebDevToolsAgentImpl* m_webdevtoolsAgent; + WebDevToolsAgentClient* m_webdevtoolsAgentClient; bool m_autoContinueOnException; }; diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp index 1cc6740..1df7172 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -157,7 +157,7 @@ void DebuggerAgentManager::debugDetach(DebuggerAgentImpl* debuggerAgent) } } else { // Remove all breakpoints set by the agent. - String clearBreakpointGroupCmd = String::format( + WTF::String clearBreakpointGroupCmd = WTF::String::format( "{\"seq\":1,\"type\":\"request\",\"command\":\"clearbreakpointgroup\"," "\"arguments\":{\"groupId\":%d}}", hostId); @@ -176,7 +176,7 @@ void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message) { v8::HandleScope scope; v8::String::Value value(message.GetJSON()); - String out(reinterpret_cast<const UChar*>(*value), value.length()); + WTF::String out(reinterpret_cast<const UChar*>(*value), value.length()); // If callerData is not 0 the message is a response to a debugger command. if (v8::Debug::ClientData* callerData = message.GetClientData()) { @@ -248,7 +248,7 @@ void DebuggerAgentManager::pauseScript() v8::Debug::DebugBreak(); } -void DebuggerAgentManager::executeDebuggerCommand(const String& command, int callerId) +void DebuggerAgentManager::executeDebuggerCommand(const WTF::String& command, int callerId) { sendCommandToV8(command, new CallerIdWrapper(callerId)); } @@ -286,14 +286,14 @@ void DebuggerAgentManager::onNavigate() DebuggerAgentManager::sendContinueCommandToV8(); } -void DebuggerAgentManager::sendCommandToV8(const String& cmd, v8::Debug::ClientData* data) +void DebuggerAgentManager::sendCommandToV8(const WTF::String& cmd, v8::Debug::ClientData* data) { v8::Debug::SendCommand(reinterpret_cast<const uint16_t*>(cmd.characters()), cmd.length(), data); } void DebuggerAgentManager::sendContinueCommandToV8() { - String continueCmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\"}"); + WTF::String continueCmd("{\"seq\":1,\"type\":\"request\",\"command\":\"continue\"}"); sendCommandToV8(continueCmd, new CallerIdWrapper()); } diff --git a/WebKit/chromium/src/DebuggerAgentManager.h b/WebKit/chromium/src/DebuggerAgentManager.h index dbb600a..300cada 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.h +++ b/WebKit/chromium/src/DebuggerAgentManager.h @@ -34,6 +34,7 @@ #include "WebCString.h" #include "WebDevToolsAgent.h" #include <v8-debug.h> +#include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/Noncopyable.h> #include <wtf/Vector.h> @@ -41,7 +42,6 @@ namespace WebCore { class Page; class PageGroupLoadDeferrer; -class String; } namespace WebKit { @@ -68,7 +68,7 @@ public: static void debugAttach(DebuggerAgentImpl* debuggerAgent); static void debugDetach(DebuggerAgentImpl* debuggerAgent); static void pauseScript(); - static void executeDebuggerCommand(const WebCore::String& command, int callerId); + static void executeDebuggerCommand(const WTF::String& command, int callerId); static void setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler); static void setExposeV8DebuggerProtocol(bool); @@ -103,7 +103,7 @@ private: static void debugHostDispatchHandler(); static void onV8DebugMessage(const v8::Debug::Message& message); - static void sendCommandToV8(const WebCore::String& cmd, + static void sendCommandToV8(const WTF::String& cmd, v8::Debug::ClientData* data); static void sendContinueCommandToV8(); diff --git a/WebKit/chromium/src/DevToolsRPC.h b/WebKit/chromium/src/DevToolsRPC.h deleted file mode 100644 index 7176821..0000000 --- a/WebKit/chromium/src/DevToolsRPC.h +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// DevTools RPC subsystem is a simple string serialization-based rpc -// implementation. The client is responsible for defining the Rpc-enabled -// interface in terms of its macros: -// -// #define MYAPI_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3) -// METHOD0(Method1) -// METHOD1(Method3, int) -// (snippet above should be multiline macro, add trailing backslashes) -// -// DEFINE_RPC_CLASS(MyApi, MYAPI_STRUCT) -// -// The snippet above will generate three classes: MyApi, MyApiStub and -// MyApiDispatch. -// -// 1. For each method defined in the marco MyApi will have a -// pure virtual function generated, so that MyApi would look like: -// -// class MyApi { -// private: -// MyApi() { } -// ~MyApi() { } -// virtual void method1() = 0; -// virtual void method2( -// int param1, -// const String& param2, -// const Value& param3) = 0; -// virtual void method3(int param1) = 0; -// }; -// -// 2. MyApiStub will implement MyApi interface and would serialize all calls -// into the string-based calls of the underlying transport: -// -// DevToolsRPC::Delegate* transport; -// myApi = new MyApiStub(transport); -// myApi->method1(); -// myApi->method3(2); -// -// 3. MyApiDelegate is capable of dispatching the calls and convert them to the -// calls to the underlying MyApi methods: -// -// MyApi* realObject; -// MyApiDispatch::dispatch(realObject, rawStringCallGeneratedByStub); -// -// will make corresponding calls to the real object. - -#ifndef DevToolsRPC_h -#define DevToolsRPC_h - -#include "PlatformString.h" -#include "Vector.h" -#include "WebDevToolsMessageData.h" - -#include <wtf/Noncopyable.h> - -namespace WebCore { -class String; -} - -using WebCore::String; -using WTF::Vector; - -namespace WebKit { - -/////////////////////////////////////////////////////// -// RPC dispatch macro - -template<typename T> -struct RpcTypeTrait { - typedef T ApiType; -}; - -template<> -struct RpcTypeTrait<bool> { - typedef bool ApiType; - static bool parse(const WebCore::String& t) - { - return t == "true"; - } - static WebCore::String toString(bool b) - { - return b ? "true" : "false"; - } -}; - -template<> -struct RpcTypeTrait<int> { - typedef int ApiType; - static int parse(const WebCore::String& t) - { - bool success; - int i = t.toIntStrict(&success); - ASSERT(success); - return i; - } - static WebCore::String toString(int i) - { - return WebCore::String::number(i); - } -}; - -template<> -struct RpcTypeTrait<String> { - typedef const String& ApiType; - static String parse(const WebCore::String& t) - { - return t; - } - static WebCore::String toString(const String& t) - { - return t; - } -}; - -/////////////////////////////////////////////////////// -// RPC Api method declarations - -#define TOOLS_RPC_API_METHOD0(Method) \ - virtual void Method() = 0; - -#define TOOLS_RPC_API_METHOD1(Method, T1) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1) = 0; - -#define TOOLS_RPC_API_METHOD2(Method, T1, T2) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2) = 0; - -#define TOOLS_RPC_API_METHOD3(Method, T1, T2, T3) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3) = 0; - -#define TOOLS_RPC_API_METHOD4(Method, T1, T2, T3, T4) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3, \ - RpcTypeTrait<T4>::ApiType t4) = 0; - -#define TOOLS_RPC_API_METHOD5(Method, T1, T2, T3, T4, T5) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3, \ - RpcTypeTrait<T4>::ApiType t4, \ - RpcTypeTrait<T5>::ApiType t5) = 0; - -/////////////////////////////////////////////////////// -// RPC stub method implementations - -#define TOOLS_RPC_STUB_METHOD0(Method) \ - virtual void Method() { \ - Vector<String> args; \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -#define TOOLS_RPC_STUB_METHOD1(Method, T1) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1) { \ - Vector<String> args(1); \ - args[0] = RpcTypeTrait<T1>::toString(t1); \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -#define TOOLS_RPC_STUB_METHOD2(Method, T1, T2) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2) { \ - Vector<String> args(2); \ - args[0] = RpcTypeTrait<T1>::toString(t1); \ - args[1] = RpcTypeTrait<T2>::toString(t2); \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -#define TOOLS_RPC_STUB_METHOD3(Method, T1, T2, T3) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3) { \ - Vector<String> args(3); \ - args[0] = RpcTypeTrait<T1>::toString(t1); \ - args[1] = RpcTypeTrait<T2>::toString(t2); \ - args[2] = RpcTypeTrait<T3>::toString(t3); \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -#define TOOLS_RPC_STUB_METHOD4(Method, T1, T2, T3, T4) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3, \ - RpcTypeTrait<T4>::ApiType t4) { \ - Vector<String> args(4); \ - args[0] = RpcTypeTrait<T1>::toString(t1); \ - args[1] = RpcTypeTrait<T2>::toString(t2); \ - args[2] = RpcTypeTrait<T3>::toString(t3); \ - args[3] = RpcTypeTrait<T4>::toString(t4); \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -#define TOOLS_RPC_STUB_METHOD5(Method, T1, T2, T3, T4, T5) \ - virtual void Method(RpcTypeTrait<T1>::ApiType t1, \ - RpcTypeTrait<T2>::ApiType t2, \ - RpcTypeTrait<T3>::ApiType t3, \ - RpcTypeTrait<T4>::ApiType t4, \ - RpcTypeTrait<T5>::ApiType t5) { \ - Vector<String> args(5); \ - args[0] = RpcTypeTrait<T1>::toString(t1); \ - args[1] = RpcTypeTrait<T2>::toString(t2); \ - args[2] = RpcTypeTrait<T3>::toString(t3); \ - args[3] = RpcTypeTrait<T4>::toString(t4); \ - args[4] = RpcTypeTrait<T5>::toString(t5); \ - this->sendRpcMessage(m_className, #Method, args); \ - } - -/////////////////////////////////////////////////////// -// RPC dispatch method implementations - -#define TOOLS_RPC_DISPATCH0(Method) \ -if (methodName == #Method) { \ - delegate->Method(); \ - return true; \ -} - -#define TOOLS_RPC_DISPATCH1(Method, T1) \ -if (methodName == #Method) { \ - delegate->Method(RpcTypeTrait<T1>::parse(args[0])); \ - return true; \ -} - -#define TOOLS_RPC_DISPATCH2(Method, T1, T2) \ -if (methodName == #Method) { \ - delegate->Method( \ - RpcTypeTrait<T1>::parse(args[0]), \ - RpcTypeTrait<T2>::parse(args[1]) \ - ); \ - return true; \ -} - -#define TOOLS_RPC_DISPATCH3(Method, T1, T2, T3) \ -if (methodName == #Method) { \ - delegate->Method( \ - RpcTypeTrait<T1>::parse(args[0]), \ - RpcTypeTrait<T2>::parse(args[1]), \ - RpcTypeTrait<T3>::parse(args[2]) \ - ); \ - return true; \ -} - -#define TOOLS_RPC_DISPATCH4(Method, T1, T2, T3, T4) \ -if (methodName == #Method) { \ - delegate->Method( \ - RpcTypeTrait<T1>::parse(args[0]), \ - RpcTypeTrait<T2>::parse(args[1]), \ - RpcTypeTrait<T3>::parse(args[2]), \ - RpcTypeTrait<T4>::parse(args[3]) \ - ); \ - return true; \ -} - -#define TOOLS_RPC_DISPATCH5(Method, T1, T2, T3, T4, T5) \ -if (methodName == #Method) { \ - delegate->Method( \ - RpcTypeTrait<T1>::parse(args[0]), \ - RpcTypeTrait<T2>::parse(args[1]), \ - RpcTypeTrait<T3>::parse(args[2]), \ - RpcTypeTrait<T4>::parse(args[3]), \ - RpcTypeTrait<T5>::parse(args[4]) \ - ); \ - return true; \ -} - -#define TOOLS_END_RPC_DISPATCH() \ -} - -// This macro defines three classes: Class with the Api, ClassStub that is -// serializing method calls and ClassDispatch that is capable of dispatching -// the serialized message into its delegate. -#define DEFINE_RPC_CLASS(Class, STRUCT) \ -class Class : public Noncopyable {\ -public: \ - Class() \ - { \ - m_className = #Class; \ - } \ - virtual ~Class() { } \ - \ - STRUCT( \ - TOOLS_RPC_API_METHOD0, \ - TOOLS_RPC_API_METHOD1, \ - TOOLS_RPC_API_METHOD2, \ - TOOLS_RPC_API_METHOD3, \ - TOOLS_RPC_API_METHOD4, \ - TOOLS_RPC_API_METHOD5) \ - WebCore::String m_className; \ -}; \ -\ -class Class##Stub \ - : public Class \ - , public DevToolsRPC { \ -public: \ - explicit Class##Stub(Delegate* delegate) : DevToolsRPC(delegate) { } \ - virtual ~Class##Stub() { } \ - typedef Class CLASS; \ - STRUCT( \ - TOOLS_RPC_STUB_METHOD0, \ - TOOLS_RPC_STUB_METHOD1, \ - TOOLS_RPC_STUB_METHOD2, \ - TOOLS_RPC_STUB_METHOD3, \ - TOOLS_RPC_STUB_METHOD4, \ - TOOLS_RPC_STUB_METHOD5) \ -}; \ -\ -class Class##Dispatch : public Noncopyable { \ -public: \ - Class##Dispatch() { } \ - virtual ~Class##Dispatch() { } \ - \ - static bool dispatch(Class* delegate, \ - const WebKit::WebDevToolsMessageData& data) { \ - String className = data.className; \ - if (className != #Class) \ - return false; \ - String methodName = data.methodName; \ - Vector<String> args; \ - for (size_t i = 0; i < data.arguments.size(); i++) \ - args.append(data.arguments[i]); \ - typedef Class CLASS; \ - STRUCT( \ - TOOLS_RPC_DISPATCH0, \ - TOOLS_RPC_DISPATCH1, \ - TOOLS_RPC_DISPATCH2, \ - TOOLS_RPC_DISPATCH3, \ - TOOLS_RPC_DISPATCH4, \ - TOOLS_RPC_DISPATCH5) \ - return false; \ - } \ -}; - -/////////////////////////////////////////////////////// -// RPC base class -class DevToolsRPC { -public: - class Delegate { - public: - Delegate() { } - virtual ~Delegate() { } - virtual void sendRpcMessage(const WebKit::WebDevToolsMessageData& data) = 0; - }; - - explicit DevToolsRPC(Delegate* delegate) : m_delegate(delegate) { } - virtual ~DevToolsRPC() { }; - -protected: - void sendRpcMessage(const String& className, - const String& methodName, - const Vector<String>& args) { - WebKit::WebVector<WebKit::WebString> webArgs(args.size()); - for (size_t i = 0; i < args.size(); i++) - webArgs[i] = args[i]; - WebKit::WebDevToolsMessageData data; - data.className = className; - data.methodName = methodName; - data.arguments.swap(webArgs); - this->m_delegate->sendRpcMessage(data); - } - - Delegate* m_delegate; -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/DevToolsRPCJS.h b/WebKit/chromium/src/DevToolsRPCJS.h deleted file mode 100644 index 8ae279f..0000000 --- a/WebKit/chromium/src/DevToolsRPCJS.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -// Additional set of macros for the JS RPC. - -#ifndef DevToolsRPCJS_h -#define DevToolsRPCJS_h - -// Do not remove this one although it is not used. -#include "BoundObject.h" -#include "DevToolsRPC.h" -#include "WebFrame.h" -#include <wtf/Noncopyable.h> -#include <wtf/OwnPtr.h> - -namespace WebKit { - -/////////////////////////////////////////////////////// -// JS RPC binds and stubs - -#define TOOLS_RPC_JS_BIND_METHOD0(Method) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_BIND_METHOD1(Method, T1) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_BIND_METHOD2(Method, T1, T2) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_BIND_METHOD3(Method, T1, T2, T3) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_BIND_METHOD4(Method, T1, T2, T3, T4) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_BIND_METHOD5(Method, T1, T2, T3, T4, T5) \ - boundObj.addProtoFunction(#Method, OCLASS::js##Method); - -#define TOOLS_RPC_JS_STUB_METHOD0(Method) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 0); \ - return v8::Undefined(); \ - } - -#define TOOLS_RPC_JS_STUB_METHOD1(Method, T1) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 1); \ - return v8::Undefined(); \ - } - -#define TOOLS_RPC_JS_STUB_METHOD2(Method, T1, T2) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 2); \ - return v8::Undefined(); \ - } - -#define TOOLS_RPC_JS_STUB_METHOD3(Method, T1, T2, T3) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 3); \ - return v8::Undefined(); \ - } - -#define TOOLS_RPC_JS_STUB_METHOD4(Method, T1, T2, T3, T4) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 4); \ - return v8::Undefined(); \ - } - -#define TOOLS_RPC_JS_STUB_METHOD5(Method, T1, T2, T3, T4, T5) \ - static v8::Handle<v8::Value> js##Method(const v8::Arguments& args) { \ - sendRpcMessageFromJS(#Method, args, 5); \ - return v8::Undefined(); \ - } - -/////////////////////////////////////////////////////// -// JS RPC main obj macro - -#define DEFINE_RPC_JS_BOUND_OBJ(Class, STRUCT, DClass, DELEGATE_STRUCT) \ -class JS##Class##BoundObj : public Class##Stub { \ -public: \ - JS##Class##BoundObj(Delegate* rpcDelegate, \ - v8::Handle<v8::Context> context, \ - const char* classname) \ - : Class##Stub(rpcDelegate) { \ - BoundObject boundObj(context, this, classname); \ - STRUCT( \ - TOOLS_RPC_JS_BIND_METHOD0, \ - TOOLS_RPC_JS_BIND_METHOD1, \ - TOOLS_RPC_JS_BIND_METHOD2, \ - TOOLS_RPC_JS_BIND_METHOD3, \ - TOOLS_RPC_JS_BIND_METHOD4, \ - TOOLS_RPC_JS_BIND_METHOD5) \ - boundObj.build(); \ - } \ - virtual ~JS##Class##BoundObj() { } \ - typedef JS##Class##BoundObj OCLASS; \ - STRUCT( \ - TOOLS_RPC_JS_STUB_METHOD0, \ - TOOLS_RPC_JS_STUB_METHOD1, \ - TOOLS_RPC_JS_STUB_METHOD2, \ - TOOLS_RPC_JS_STUB_METHOD3, \ - TOOLS_RPC_JS_STUB_METHOD4, \ - TOOLS_RPC_JS_STUB_METHOD5) \ -private: \ - static void sendRpcMessageFromJS(const char* method, \ - const v8::Arguments& jsArguments, \ - size_t argsCount) \ - { \ - Vector<String> args(argsCount); \ - for (size_t i = 0; i < argsCount; i++) \ - args[i] = WebCore::toWebCoreStringWithNullCheck(jsArguments[i]); \ - void* selfPtr = v8::External::Cast(*jsArguments.Data())->Value(); \ - JS##Class##BoundObj* self = static_cast<JS##Class##BoundObj*>(selfPtr); \ - self->sendRpcMessage(#Class, method, args); \ - } \ -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/DeviceOrientationClientProxy.cpp b/WebKit/chromium/src/DeviceOrientationClientProxy.cpp new file mode 100644 index 0000000..f4a0dd9 --- /dev/null +++ b/WebKit/chromium/src/DeviceOrientationClientProxy.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. + * + * 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 "DeviceOrientationClientProxy.h" + +#include "DeviceOrientation.h" +#include "WebDeviceOrientation.h" +#include "WebDeviceOrientationController.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { +class DeviceOrientationController; +} + +namespace WebKit { + +void DeviceOrientationClientProxy::setController(WebCore::DeviceOrientationController* c) +{ + if (!m_client) // FIXME: Get rid of these null checks once device orientation is enabled by default. + return; + m_client->setController(new WebDeviceOrientationController(c)); +} + +void DeviceOrientationClientProxy::startUpdating() +{ + if (!m_client) + return; + m_client->startUpdating(); +} + +void DeviceOrientationClientProxy::stopUpdating() +{ + if (!m_client) + return; + m_client->stopUpdating(); +} + +WebCore::DeviceOrientation* DeviceOrientationClientProxy::lastOrientation() const +{ + if (!m_client) + return 0; + + // Cache the DeviceOrientation pointer so its reference count does not drop to zero upon return. + m_lastOrientation = m_client->lastOrientation(); + + return m_lastOrientation.get(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/DeviceOrientationClientProxy.h b/WebKit/chromium/src/DeviceOrientationClientProxy.h new file mode 100644 index 0000000..2d3a7dc --- /dev/null +++ b/WebKit/chromium/src/DeviceOrientationClientProxy.h @@ -0,0 +1,59 @@ +/* + * 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. + * + * 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 DeviceOrientationClientProxy_h +#define DeviceOrientationClientProxy_h + +#include "DeviceOrientation.h" +#include "DeviceOrientationClient.h" +#include "WebDeviceOrientationClient.h" +#include <wtf/RefPtr.h> + +namespace WebCore { +class DeviceOrientationController; +} + +namespace WebKit { + +class DeviceOrientationClientProxy : public WebCore::DeviceOrientationClient { +public: + DeviceOrientationClientProxy(WebDeviceOrientationClient* client) + : m_client(client) + { + } + + void setController(WebCore::DeviceOrientationController*); + void startUpdating(); + void stopUpdating(); + WebCore::DeviceOrientation* lastOrientation() const; + +private: + WebDeviceOrientationClient* m_client; + mutable RefPtr<WebCore::DeviceOrientation> m_lastOrientation; +}; + +} // namespace WebKit + +#endif // DeviceOrientationClientProxy_h diff --git a/WebKit/chromium/src/DragClientImpl.h b/WebKit/chromium/src/DragClientImpl.h index fc4c608..dac7acd 100644 --- a/WebKit/chromium/src/DragClientImpl.h +++ b/WebKit/chromium/src/DragClientImpl.h @@ -63,7 +63,7 @@ public: WebCore::Frame* frame, bool isLinkDrag = false); virtual WebCore::DragImageRef createDragImageForLink( - WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); + WebCore::KURL&, const WTF::String& label, WebCore::Frame*); virtual void dragControllerDestroyed(); private: diff --git a/WebKit/chromium/src/EditorClientImpl.h b/WebKit/chromium/src/EditorClientImpl.h index 549a512..b05a592 100644 --- a/WebKit/chromium/src/EditorClientImpl.h +++ b/WebKit/chromium/src/EditorClientImpl.h @@ -61,7 +61,7 @@ public: virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldDeleteRange(WebCore::Range*); virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, @@ -92,8 +92,8 @@ public: virtual bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*); virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); @@ -101,13 +101,13 @@ public: WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String& word, - WTF::Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String& word, + WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h index 25be623..3a8a714 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -99,7 +99,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String& title); + virtual void dispatchDidReceiveTitle(const WTF::String& title); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -110,8 +110,8 @@ public: virtual void dispatchDidFirstVisuallyNonEmptyLayout(); virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); - virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction function, const WebCore::String& mime_type, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState> form_state, const WebCore::String& frame_name); + virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction function, const WTF::String& mime_type, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState> form_state, const WTF::String& frame_name); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState> form_state); virtual void cancelPolicyCheck(); virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&); @@ -148,9 +148,9 @@ public: virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); virtual bool shouldFallBack(const WebCore::ResourceError&); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; - virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; + virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(WebCore::HistoryItem*); virtual void restoreViewState(); @@ -159,8 +159,8 @@ public: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader( const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); @@ -170,25 +170,25 @@ public: const WebCore::ResourceRequest& initialRequest, const WebCore::ResourceResponse&); virtual PassRefPtr<WebCore::Frame> createFrame( - const WebCore::KURL& url, const WebCore::String& name, + const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, - const WebCore::String& referrer, bool allowsScrolling, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); virtual PassRefPtr<WebCore::Widget> createPlugin( const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, - const Vector<WebCore::String>&, const Vector<WebCore::String>&, - const WebCore::String&, bool loadManually); + const Vector<WTF::String>&, const Vector<WTF::String>&, + const WTF::String&, bool loadManually); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget( const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& /* base_url */, - const Vector<WebCore::String>& paramNames, - const Vector<WebCore::String>& paramValues); + const Vector<WTF::String>& paramNames, + const Vector<WTF::String>& paramValues); virtual WebCore::ObjectContentType objectContentType( - const WebCore::KURL& url, const WebCore::String& mimeType); - virtual WebCore::String overrideMediaType() const; + const WebCore::KURL& url, const WTF::String& mimeType); + virtual WTF::String overrideMediaType() const; virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool listen = true); virtual void didChangeScrollOffset(); diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index fec0b20..5b5afef 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -35,24 +35,18 @@ #include "GraphicsContext3D.h" #include "CachedImage.h" +#include "CanvasLayerChromium.h" +#include "CanvasRenderingContext.h" #include "Chrome.h" #include "ChromeClientImpl.h" +#include "Float32Array.h" #include "HTMLCanvasElement.h" #include "HTMLImageElement.h" #include "ImageBuffer.h" #include "ImageData.h" -#include "WebGLBuffer.h" -#include "Int8Array.h" -#include "Float32Array.h" -#include "WebGLFramebuffer.h" #include "Int32Array.h" -#include "WebGLProgram.h" -#include "WebGLRenderbuffer.h" -#include "WebGLRenderingContext.h" -#include "WebGLShader.h" -#include "WebGLTexture.h" +#include "Int8Array.h" #include "Uint8Array.h" -#include "WebGLLayerChromium.h" #include "WebGraphicsContext3D.h" #include "WebGraphicsContext3DDefaultImpl.h" #include "WebKit.h" @@ -94,8 +88,6 @@ namespace WebCore { // Uncomment this to render to a separate window for debugging // #define RENDER_TO_DEBUGGING_WINDOW -#define EXTRACT(val) (!val ? 0 : val->object()) - class GraphicsContext3DInternal { public: GraphicsContext3DInternal(); @@ -112,14 +104,14 @@ public: void reshape(int width, int height); - void paintRenderingResultsToCanvas(WebGLRenderingContext* context); - void beginPaint(WebGLRenderingContext* context); + void paintRenderingResultsToCanvas(CanvasRenderingContext* context); + void beginPaint(CanvasRenderingContext* context); void endPaint(); void prepareTexture(); #if USE(ACCELERATED_COMPOSITING) - WebGLLayerChromium* platformLayer() const; + CanvasLayerChromium* platformLayer() const; #endif bool isGLES2Compliant() const; @@ -127,12 +119,12 @@ public: // Entry points for WebGL. // void activeTexture(unsigned long texture); - void attachShader(WebGLProgram* program, WebGLShader* shader); - void bindAttribLocation(WebGLProgram*, unsigned long index, const String& name); - void bindBuffer(unsigned long target, WebGLBuffer*); - void bindFramebuffer(unsigned long target, WebGLFramebuffer*); - void bindRenderbuffer(unsigned long target, WebGLRenderbuffer*); - void bindTexture(unsigned long target, WebGLTexture* texture); + void attachShader(Platform3DObject program, Platform3DObject shader); + void bindAttribLocation(Platform3DObject, unsigned long index, const String& name); + void bindBuffer(unsigned long target, Platform3DObject); + void bindFramebuffer(unsigned long target, Platform3DObject); + void bindRenderbuffer(unsigned long target, Platform3DObject); + void bindTexture(unsigned long target, Platform3DObject texture); void blendColor(double red, double green, double blue, double alpha); void blendEquation(unsigned long mode); void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha); @@ -151,7 +143,7 @@ public: void clearDepth(double depth); void clearStencil(long s); void colorMask(bool red, bool green, bool blue, bool alpha); - void compileShader(WebGLShader*); + void compileShader(Platform3DObject); void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border); void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height); @@ -159,7 +151,7 @@ public: void depthFunc(unsigned long func); void depthMask(bool flag); void depthRange(double zNear, double zFar); - void detachShader(WebGLProgram*, WebGLShader*); + void detachShader(Platform3DObject, Platform3DObject); void disable(unsigned long cap); void disableVertexAttribArray(unsigned long index); void drawArrays(unsigned long mode, long first, long count); @@ -169,17 +161,17 @@ public: void enableVertexAttribArray(unsigned long index); void finish(); void flush(); - void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer*); - void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture*, long level); + void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject); + void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level); void frontFace(unsigned long mode); void generateMipmap(unsigned long target); - bool getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo&); - bool getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo&); + bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&); + bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&); - void getAttachedShaders(WebGLProgram* program, int maxCount, int* count, unsigned int* shaders); + void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders); - int getAttribLocation(WebGLProgram*, const String& name); + int getAttribLocation(Platform3DObject, const String& name); void getBooleanv(unsigned long pname, unsigned char* value); @@ -195,26 +187,26 @@ public: void getIntegerv(unsigned long pname, int* value); - void getProgramiv(WebGLProgram* program, unsigned long pname, int* value); + void getProgramiv(Platform3DObject program, unsigned long pname, int* value); - String getProgramInfoLog(WebGLProgram*); + String getProgramInfoLog(Platform3DObject); void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value); - void getShaderiv(WebGLShader*, unsigned long pname, int* value); + void getShaderiv(Platform3DObject, unsigned long pname, int* value); - String getShaderInfoLog(WebGLShader*); + String getShaderInfoLog(Platform3DObject); - String getShaderSource(WebGLShader*); + String getShaderSource(Platform3DObject); String getString(unsigned long name); void getTexParameterfv(unsigned long target, unsigned long pname, float* value); void getTexParameteriv(unsigned long target, unsigned long pname, int* value); - void getUniformfv(WebGLProgram* program, long location, float* value); - void getUniformiv(WebGLProgram* program, long location, int* value); + void getUniformfv(Platform3DObject program, long location, float* value); + void getUniformiv(Platform3DObject program, long location, int* value); - long getUniformLocation(WebGLProgram*, const String& name); + long getUniformLocation(Platform3DObject, const String& name); void getVertexAttribfv(unsigned long index, unsigned long pname, float* value); void getVertexAttribiv(unsigned long index, unsigned long pname, int* value); @@ -222,15 +214,15 @@ public: long getVertexAttribOffset(unsigned long index, unsigned long pname); void hint(unsigned long target, unsigned long mode); - bool isBuffer(WebGLBuffer*); + bool isBuffer(Platform3DObject); bool isEnabled(unsigned long cap); - bool isFramebuffer(WebGLFramebuffer*); - bool isProgram(WebGLProgram*); - bool isRenderbuffer(WebGLRenderbuffer*); - bool isShader(WebGLShader*); - bool isTexture(WebGLTexture*); + bool isFramebuffer(Platform3DObject); + bool isProgram(Platform3DObject); + bool isRenderbuffer(Platform3DObject); + bool isShader(Platform3DObject); + bool isTexture(Platform3DObject); void lineWidth(double); - void linkProgram(WebGLProgram*); + void linkProgram(Platform3DObject); void pixelStorei(unsigned long pname, long param); void polygonOffset(double factor, double units); @@ -240,7 +232,7 @@ public: void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height); void sampleCoverage(double value, bool invert); void scissor(long x, long y, unsigned long width, unsigned long height); - void shaderSource(WebGLShader*, const String& string); + void shaderSource(Platform3DObject, const String& string); void stencilFunc(unsigned long func, long ref, unsigned long mask); void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask); void stencilMask(unsigned long mask); @@ -277,8 +269,8 @@ public: void uniformMatrix3fv(long location, bool transpose, float* value, int size); void uniformMatrix4fv(long location, bool transpose, float* value, int size); - void useProgram(WebGLProgram*); - void validateProgram(WebGLProgram*); + void useProgram(Platform3DObject); + void validateProgram(Platform3DObject); void vertexAttrib1f(unsigned long indx, float x); void vertexAttrib1fv(unsigned long indx, float* values); @@ -311,8 +303,9 @@ public: private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; + WebKit::WebViewImpl* m_webViewImpl; #if USE(ACCELERATED_COMPOSITING) - RefPtr<WebGLLayerChromium> m_compositingLayer; + RefPtr<CanvasLayerChromium> m_compositingLayer; #endif #if PLATFORM(SKIA) // If the width and height of the Canvas's backing store don't @@ -329,9 +322,10 @@ private: }; GraphicsContext3DInternal::GraphicsContext3DInternal() + : m_webViewImpl(0) #if PLATFORM(SKIA) #elif PLATFORM(CG) - : m_renderOutput(0) + , m_renderOutput(0) #else #error Must port to your platform #endif @@ -362,18 +356,18 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, Chrome* chrome = static_cast<Chrome*>(hostWindow); WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(chrome->client()); - WebKit::WebViewImpl* webView = chromeClientImpl->webView(); + m_webViewImpl = chromeClientImpl->webView(); - if (!webView) + if (!m_webViewImpl) return false; - if (!webContext->initialize(webAttributes, webView)) { + if (!webContext->initialize(webAttributes, m_webViewImpl)) { delete webContext; return false; } m_impl.set(webContext); #if USE(ACCELERATED_COMPOSITING) - m_compositingLayer = WebGLLayerChromium::create(0); + m_compositingLayer = CanvasLayerChromium::create(0); #endif return true; } @@ -394,13 +388,13 @@ void GraphicsContext3DInternal::prepareTexture() } #if USE(ACCELERATED_COMPOSITING) -WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const +CanvasLayerChromium* GraphicsContext3DInternal::platformLayer() const { return m_compositingLayer.get(); } #endif -void GraphicsContext3DInternal::paintRenderingResultsToCanvas(WebGLRenderingContext* context) +void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingContext* context) { HTMLCanvasElement* canvas = context->canvas(); ImageBuffer* imageBuffer = canvas->buffer(); @@ -422,9 +416,8 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(WebGLRenderingCont m_resizingBitmap.setConfig(SkBitmap::kARGB_8888_Config, m_impl->width(), m_impl->height()); - if (!m_resizingBitmap.allocPixels()) { + if (!m_resizingBitmap.allocPixels()) return; - } } readbackBitmap = &m_resizingBitmap; } @@ -459,8 +452,12 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(WebGLRenderingCont #endif } -void GraphicsContext3DInternal::beginPaint(WebGLRenderingContext* context) +void GraphicsContext3DInternal::beginPaint(CanvasRenderingContext* context) { + // If the gpu compositor is on then skip the readback and software rendering path. + if (m_webViewImpl->isAcceleratedCompositingActive()) + return; + paintRenderingResultsToCanvas(context); } @@ -508,42 +505,18 @@ void GraphicsContext3DInternal::name(t1 a1) \ m_impl->name(a1); \ } -#define DELEGATE_TO_IMPL_1_X(name, t1) \ -void GraphicsContext3DInternal::name(t1 a1) \ -{ \ - m_impl->name(EXTRACT(a1)); \ -} - #define DELEGATE_TO_IMPL_1R(name, t1, rt) \ rt GraphicsContext3DInternal::name(t1 a1) \ { \ return m_impl->name(a1); \ } -#define DELEGATE_TO_IMPL_1R_X(name, t1, rt) \ -rt GraphicsContext3DInternal::name(t1 a1) \ -{ \ - return m_impl->name(EXTRACT(a1)); \ -} - #define DELEGATE_TO_IMPL_2(name, t1, t2) \ void GraphicsContext3DInternal::name(t1 a1, t2 a2) \ { \ m_impl->name(a1, a2); \ } -#define DELEGATE_TO_IMPL_2_X12(name, t1, t2) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2) \ -{ \ - m_impl->name(EXTRACT(a1), EXTRACT(a2)); \ -} - -#define DELEGATE_TO_IMPL_2_X2(name, t1, t2) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2) \ -{ \ - m_impl->name(a1, EXTRACT(a2)); \ -} - #define DELEGATE_TO_IMPL_2R(name, t1, t2, rt) \ rt GraphicsContext3DInternal::name(t1 a1, t2 a2) \ { \ @@ -556,12 +529,6 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3) \ m_impl->name(a1, a2, a3); \ } -#define DELEGATE_TO_IMPL_3_X1(name, t1, t2, t3) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3) \ -{ \ - m_impl->name(EXTRACT(a1), a2, a3); \ -} - #define DELEGATE_TO_IMPL_3R(name, t1, t2, t3, rt) \ rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3) \ { \ @@ -574,30 +541,12 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ m_impl->name(a1, a2, a3, a4); \ } -#define DELEGATE_TO_IMPL_4_X1(name, t1, t2, t3, t4) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ -{ \ - m_impl->name(EXTRACT(a1), a2, a3, a4); \ -} - -#define DELEGATE_TO_IMPL_4_X4(name, t1, t2, t3, t4) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ -{ \ - m_impl->name(a1, a2, a3, EXTRACT(a4)); \ -} - #define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5) \ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \ { \ m_impl->name(a1, a2, a3, a4, a5); \ } -#define DELEGATE_TO_IMPL_5_X4(name, t1, t2, t3, t4, t5) \ -void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \ -{ \ - m_impl->name(a1, a2, a3, EXTRACT(a4), a5); \ -} - #define DELEGATE_TO_IMPL_5R(name, t1, t2, t3, t4, t5, rt) \ rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \ { \ @@ -649,43 +598,17 @@ bool GraphicsContext3DInternal::isGLES2Compliant() const } DELEGATE_TO_IMPL_1(activeTexture, unsigned long) -DELEGATE_TO_IMPL_2_X12(attachShader, WebGLProgram*, WebGLShader*) +DELEGATE_TO_IMPL_2(attachShader, Platform3DObject, Platform3DObject) -void GraphicsContext3DInternal::bindAttribLocation(WebGLProgram* program, unsigned long index, const String& name) +void GraphicsContext3DInternal::bindAttribLocation(Platform3DObject program, unsigned long index, const String& name) { - m_impl->bindAttribLocation(EXTRACT(program), index, name.utf8().data()); -} - -DELEGATE_TO_IMPL_2_X2(bindBuffer, unsigned long, WebGLBuffer*) -DELEGATE_TO_IMPL_2_X2(bindFramebuffer, unsigned long, WebGLFramebuffer*) -DELEGATE_TO_IMPL_2_X2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*) - -static const int kTextureWrapR = 0x8072; - -// If we didn't have to hack GL_TEXTURE_WRAP_R for cube maps, -// we could just use: -// DELEGATE_TO_IMPL_2_X2(bindTexture, unsigned long, WebGLTexture*) -void GraphicsContext3DInternal::bindTexture(unsigned long target, - WebGLTexture* texture) -{ - unsigned int textureObject = EXTRACT(texture); - - m_impl->bindTexture(target, textureObject); - - // FIXME: GL_TEXTURE_WRAP_R isn't exposed in the OpenGL ES 2.0 - // API. On desktop OpenGL implementations it seems necessary to - // set this wrap mode to GL_CLAMP_TO_EDGE to get correct behavior - // of cube maps. - if (texture) - if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) { - if (!texture->isCubeMapRWrapModeInitialized()) { - m_impl->texParameteri(GraphicsContext3D::TEXTURE_CUBE_MAP, kTextureWrapR, GraphicsContext3D::CLAMP_TO_EDGE); - texture->setCubeMapRWrapModeInitialized(true); - } - } else - texture->setCubeMapRWrapModeInitialized(false); + m_impl->bindAttribLocation(program, index, name.utf8().data()); } +DELEGATE_TO_IMPL_2(bindBuffer, unsigned long, Platform3DObject) +DELEGATE_TO_IMPL_2(bindFramebuffer, unsigned long, Platform3DObject) +DELEGATE_TO_IMPL_2(bindRenderbuffer, unsigned long, Platform3DObject) +DELEGATE_TO_IMPL_2(bindTexture, unsigned long, Platform3DObject) DELEGATE_TO_IMPL_4(blendColor, double, double, double, double) DELEGATE_TO_IMPL_1(blendEquation, unsigned long) DELEGATE_TO_IMPL_2(blendEquationSeparate, unsigned long, unsigned long) @@ -723,7 +646,7 @@ DELEGATE_TO_IMPL_4(clearColor, double, double, double, double) DELEGATE_TO_IMPL_1(clearDepth, double) DELEGATE_TO_IMPL_1(clearStencil, long) DELEGATE_TO_IMPL_4(colorMask, bool, bool, bool, bool) -DELEGATE_TO_IMPL_1_X(compileShader, WebGLShader*) +DELEGATE_TO_IMPL_1(compileShader, Platform3DObject) DELEGATE_TO_IMPL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long) DELEGATE_TO_IMPL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long) @@ -731,7 +654,7 @@ DELEGATE_TO_IMPL_1(cullFace, unsigned long) DELEGATE_TO_IMPL_1(depthFunc, unsigned long) DELEGATE_TO_IMPL_1(depthMask, bool) DELEGATE_TO_IMPL_2(depthRange, double, double) -DELEGATE_TO_IMPL_2_X12(detachShader, WebGLProgram*, WebGLShader*) +DELEGATE_TO_IMPL_2(detachShader, Platform3DObject, Platform3DObject) DELEGATE_TO_IMPL_1(disable, unsigned long) DELEGATE_TO_IMPL_1(disableVertexAttribArray, unsigned long) DELEGATE_TO_IMPL_3(drawArrays, unsigned long, long, long) @@ -741,15 +664,15 @@ DELEGATE_TO_IMPL_1(enable, unsigned long) DELEGATE_TO_IMPL_1(enableVertexAttribArray, unsigned long) DELEGATE_TO_IMPL(finish) DELEGATE_TO_IMPL(flush) -DELEGATE_TO_IMPL_4_X4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*) -DELEGATE_TO_IMPL_5_X4(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long) +DELEGATE_TO_IMPL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject) +DELEGATE_TO_IMPL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long) DELEGATE_TO_IMPL_1(frontFace, unsigned long) DELEGATE_TO_IMPL_1(generateMipmap, unsigned long) -bool GraphicsContext3DInternal::getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo& info) +bool GraphicsContext3DInternal::getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo& info) { WebKit::WebGraphicsContext3D::ActiveInfo webInfo; - if (!m_impl->getActiveAttrib(EXTRACT(program), index, webInfo)) + if (!m_impl->getActiveAttrib(program, index, webInfo)) return false; info.name = webInfo.name; info.type = webInfo.type; @@ -757,10 +680,10 @@ bool GraphicsContext3DInternal::getActiveAttrib(WebGLProgram* program, unsigned return true; } -bool GraphicsContext3DInternal::getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo& info) +bool GraphicsContext3DInternal::getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo& info) { WebKit::WebGraphicsContext3D::ActiveInfo webInfo; - if (!m_impl->getActiveUniform(EXTRACT(program), index, webInfo)) + if (!m_impl->getActiveUniform(program, index, webInfo)) return false; info.name = webInfo.name; info.type = webInfo.type; @@ -768,11 +691,11 @@ bool GraphicsContext3DInternal::getActiveUniform(WebGLProgram* program, unsigned return true; } -DELEGATE_TO_IMPL_4_X1(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*) +DELEGATE_TO_IMPL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*) -int GraphicsContext3DInternal::getAttribLocation(WebGLProgram* program, const String& name) +int GraphicsContext3DInternal::getAttribLocation(Platform3DObject program, const String& name) { - return m_impl->getAttribLocation(EXTRACT(program), name.utf8().data()); + return m_impl->getAttribLocation(program, name.utf8().data()); } DELEGATE_TO_IMPL_2(getBooleanv, unsigned long, unsigned char*) @@ -799,25 +722,25 @@ DELEGATE_TO_IMPL_4(getFramebufferAttachmentParameteriv, unsigned long, unsigned DELEGATE_TO_IMPL_2(getIntegerv, unsigned long, int*) -DELEGATE_TO_IMPL_3_X1(getProgramiv, WebGLProgram*, unsigned long, int*) +DELEGATE_TO_IMPL_3(getProgramiv, Platform3DObject, unsigned long, int*) -String GraphicsContext3DInternal::getProgramInfoLog(WebGLProgram* program) +String GraphicsContext3DInternal::getProgramInfoLog(Platform3DObject program) { - return m_impl->getProgramInfoLog(EXTRACT(program)); + return m_impl->getProgramInfoLog(program); } DELEGATE_TO_IMPL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*) -DELEGATE_TO_IMPL_3_X1(getShaderiv, WebGLShader*, unsigned long, int*) +DELEGATE_TO_IMPL_3(getShaderiv, Platform3DObject, unsigned long, int*) -String GraphicsContext3DInternal::getShaderInfoLog(WebGLShader* shader) +String GraphicsContext3DInternal::getShaderInfoLog(Platform3DObject shader) { - return m_impl->getShaderInfoLog(EXTRACT(shader)); + return m_impl->getShaderInfoLog(shader); } -String GraphicsContext3DInternal::getShaderSource(WebGLShader* shader) +String GraphicsContext3DInternal::getShaderSource(Platform3DObject shader) { - return m_impl->getShaderSource(EXTRACT(shader)); + return m_impl->getShaderSource(shader); } String GraphicsContext3DInternal::getString(unsigned long name) @@ -828,12 +751,12 @@ String GraphicsContext3DInternal::getString(unsigned long name) DELEGATE_TO_IMPL_3(getTexParameterfv, unsigned long, unsigned long, float*) DELEGATE_TO_IMPL_3(getTexParameteriv, unsigned long, unsigned long, int*) -DELEGATE_TO_IMPL_3_X1(getUniformfv, WebGLProgram*, long, float*) -DELEGATE_TO_IMPL_3_X1(getUniformiv, WebGLProgram*, long, int*) +DELEGATE_TO_IMPL_3(getUniformfv, Platform3DObject, long, float*) +DELEGATE_TO_IMPL_3(getUniformiv, Platform3DObject, long, int*) -long GraphicsContext3DInternal::getUniformLocation(WebGLProgram* program, const String& name) +long GraphicsContext3DInternal::getUniformLocation(Platform3DObject program, const String& name) { - return m_impl->getUniformLocation(EXTRACT(program), name.utf8().data()); + return m_impl->getUniformLocation(program, name.utf8().data()); } DELEGATE_TO_IMPL_3(getVertexAttribfv, unsigned long, unsigned long, float*) @@ -842,15 +765,15 @@ DELEGATE_TO_IMPL_3(getVertexAttribiv, unsigned long, unsigned long, int*) DELEGATE_TO_IMPL_2R(getVertexAttribOffset, unsigned long, unsigned long, long) DELEGATE_TO_IMPL_2(hint, unsigned long, unsigned long) -DELEGATE_TO_IMPL_1R_X(isBuffer, WebGLBuffer*, bool) +DELEGATE_TO_IMPL_1R(isBuffer, Platform3DObject, bool) DELEGATE_TO_IMPL_1R(isEnabled, unsigned long, bool) -DELEGATE_TO_IMPL_1R_X(isFramebuffer, WebGLFramebuffer*, bool) -DELEGATE_TO_IMPL_1R_X(isProgram, WebGLProgram*, bool) -DELEGATE_TO_IMPL_1R_X(isRenderbuffer, WebGLRenderbuffer*, bool) -DELEGATE_TO_IMPL_1R_X(isShader, WebGLShader*, bool) -DELEGATE_TO_IMPL_1R_X(isTexture, WebGLTexture*, bool) +DELEGATE_TO_IMPL_1R(isFramebuffer, Platform3DObject, bool) +DELEGATE_TO_IMPL_1R(isProgram, Platform3DObject, bool) +DELEGATE_TO_IMPL_1R(isRenderbuffer, Platform3DObject, bool) +DELEGATE_TO_IMPL_1R(isShader, Platform3DObject, bool) +DELEGATE_TO_IMPL_1R(isTexture, Platform3DObject, bool) DELEGATE_TO_IMPL_1(lineWidth, double) -DELEGATE_TO_IMPL_1_X(linkProgram, WebGLProgram*) +DELEGATE_TO_IMPL_1(linkProgram, Platform3DObject) DELEGATE_TO_IMPL_2(pixelStorei, unsigned long, long) DELEGATE_TO_IMPL_2(polygonOffset, double, double) DELEGATE_TO_IMPL_7(readPixels, long, long, unsigned long, unsigned long, unsigned long, unsigned long, void*) @@ -859,9 +782,9 @@ DELEGATE_TO_IMPL_4(renderbufferStorage, unsigned long, unsigned long, unsigned l DELEGATE_TO_IMPL_2(sampleCoverage, double, bool) DELEGATE_TO_IMPL_4(scissor, long, long, unsigned long, unsigned long) -void GraphicsContext3DInternal::shaderSource(WebGLShader* shader, const String& string) +void GraphicsContext3DInternal::shaderSource(Platform3DObject shader, const String& string) { - m_impl->shaderSource(EXTRACT(shader), string.utf8().data()); + m_impl->shaderSource(shader, string.utf8().data()); } DELEGATE_TO_IMPL_3(stencilFunc, unsigned long, long, unsigned long) @@ -957,8 +880,8 @@ void GraphicsContext3DInternal::uniformMatrix4fv(long location, bool transpose, m_impl->uniformMatrix4fv(location, size, transpose, value); } -DELEGATE_TO_IMPL_1_X(useProgram, WebGLProgram*) -DELEGATE_TO_IMPL_1_X(validateProgram, WebGLProgram*) +DELEGATE_TO_IMPL_1(useProgram, Platform3DObject) +DELEGATE_TO_IMPL_1(validateProgram, Platform3DObject) DELEGATE_TO_IMPL_2(vertexAttrib1f, unsigned long, float) DELEGATE_TO_IMPL_2(vertexAttrib1fv, unsigned long, float*) @@ -1129,9 +1052,9 @@ void GraphicsContext3D::prepareTexture() #if USE(ACCELERATED_COMPOSITING) PlatformLayer* GraphicsContext3D::platformLayer() const { - WebGLLayerChromium* webGLLayer = m_internal->platformLayer(); - webGLLayer->setContext(this); - return webGLLayer; + CanvasLayerChromium* canvasLayer = m_internal->platformLayer(); + canvasLayer->setContext(this); + return canvasLayer; } #endif @@ -1140,13 +1063,13 @@ DELEGATE_TO_INTERNAL_1R(sizeInBytes, int, int) DELEGATE_TO_INTERNAL_2(reshape, int, int) DELEGATE_TO_INTERNAL_1(activeTexture, unsigned long) -DELEGATE_TO_INTERNAL_2(attachShader, WebGLProgram*, WebGLShader*) -DELEGATE_TO_INTERNAL_3(bindAttribLocation, WebGLProgram*, unsigned long, const String&) +DELEGATE_TO_INTERNAL_2(attachShader, Platform3DObject, Platform3DObject) +DELEGATE_TO_INTERNAL_3(bindAttribLocation, Platform3DObject, unsigned long, const String&) -DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, WebGLBuffer*) -DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, WebGLFramebuffer*) -DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, WebGLRenderbuffer*) -DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, WebGLTexture*) +DELEGATE_TO_INTERNAL_2(bindBuffer, unsigned long, Platform3DObject) +DELEGATE_TO_INTERNAL_2(bindFramebuffer, unsigned long, Platform3DObject) +DELEGATE_TO_INTERNAL_2(bindRenderbuffer, unsigned long, Platform3DObject) +DELEGATE_TO_INTERNAL_2(bindTexture, unsigned long, Platform3DObject) DELEGATE_TO_INTERNAL_4(blendColor, double, double, double, double) DELEGATE_TO_INTERNAL_1(blendEquation, unsigned long) DELEGATE_TO_INTERNAL_2(blendEquationSeparate, unsigned long, unsigned long) @@ -1165,7 +1088,7 @@ DELEGATE_TO_INTERNAL_4(clearColor, double, double, double, double) DELEGATE_TO_INTERNAL_1(clearDepth, double) DELEGATE_TO_INTERNAL_1(clearStencil, long) DELEGATE_TO_INTERNAL_4(colorMask, bool, bool, bool, bool) -DELEGATE_TO_INTERNAL_1(compileShader, WebGLShader*) +DELEGATE_TO_INTERNAL_1(compileShader, Platform3DObject) DELEGATE_TO_INTERNAL_8(copyTexImage2D, unsigned long, long, unsigned long, long, long, unsigned long, unsigned long, long) DELEGATE_TO_INTERNAL_8(copyTexSubImage2D, unsigned long, long, long, long, long, long, unsigned long, unsigned long) @@ -1173,7 +1096,7 @@ DELEGATE_TO_INTERNAL_1(cullFace, unsigned long) DELEGATE_TO_INTERNAL_1(depthFunc, unsigned long) DELEGATE_TO_INTERNAL_1(depthMask, bool) DELEGATE_TO_INTERNAL_2(depthRange, double, double) -DELEGATE_TO_INTERNAL_2(detachShader, WebGLProgram*, WebGLShader*) +DELEGATE_TO_INTERNAL_2(detachShader, Platform3DObject, Platform3DObject) DELEGATE_TO_INTERNAL_1(disable, unsigned long) DELEGATE_TO_INTERNAL_1(disableVertexAttribArray, unsigned long) DELEGATE_TO_INTERNAL_3(drawArrays, unsigned long, long, long) @@ -1183,17 +1106,17 @@ DELEGATE_TO_INTERNAL_1(enable, unsigned long) DELEGATE_TO_INTERNAL_1(enableVertexAttribArray, unsigned long) DELEGATE_TO_INTERNAL(finish) DELEGATE_TO_INTERNAL(flush) -DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, WebGLRenderbuffer*) -DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, WebGLTexture*, long) +DELEGATE_TO_INTERNAL_4(framebufferRenderbuffer, unsigned long, unsigned long, unsigned long, Platform3DObject) +DELEGATE_TO_INTERNAL_5(framebufferTexture2D, unsigned long, unsigned long, unsigned long, Platform3DObject, long) DELEGATE_TO_INTERNAL_1(frontFace, unsigned long) DELEGATE_TO_INTERNAL_1(generateMipmap, unsigned long) -DELEGATE_TO_INTERNAL_3R(getActiveAttrib, WebGLProgram*, unsigned long, ActiveInfo&, bool) -DELEGATE_TO_INTERNAL_3R(getActiveUniform, WebGLProgram*, unsigned long, ActiveInfo&, bool) +DELEGATE_TO_INTERNAL_3R(getActiveAttrib, Platform3DObject, unsigned long, ActiveInfo&, bool) +DELEGATE_TO_INTERNAL_3R(getActiveUniform, Platform3DObject, unsigned long, ActiveInfo&, bool) -DELEGATE_TO_INTERNAL_4(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*) +DELEGATE_TO_INTERNAL_4(getAttachedShaders, Platform3DObject, int, int*, unsigned int*) -DELEGATE_TO_INTERNAL_2R(getAttribLocation, WebGLProgram*, const String&, int) +DELEGATE_TO_INTERNAL_2R(getAttribLocation, Platform3DObject, const String&, int) DELEGATE_TO_INTERNAL_2(getBooleanv, unsigned long, unsigned char*) @@ -1209,26 +1132,26 @@ DELEGATE_TO_INTERNAL_4(getFramebufferAttachmentParameteriv, unsigned long, unsig DELEGATE_TO_INTERNAL_2(getIntegerv, unsigned long, int*) -DELEGATE_TO_INTERNAL_3(getProgramiv, WebGLProgram*, unsigned long, int*) +DELEGATE_TO_INTERNAL_3(getProgramiv, Platform3DObject, unsigned long, int*) -DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, WebGLProgram*, String) +DELEGATE_TO_INTERNAL_1R(getProgramInfoLog, Platform3DObject, String) DELEGATE_TO_INTERNAL_3(getRenderbufferParameteriv, unsigned long, unsigned long, int*) -DELEGATE_TO_INTERNAL_3(getShaderiv, WebGLShader*, unsigned long, int*) +DELEGATE_TO_INTERNAL_3(getShaderiv, Platform3DObject, unsigned long, int*) -DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, WebGLShader*, String) +DELEGATE_TO_INTERNAL_1R(getShaderInfoLog, Platform3DObject, String) -DELEGATE_TO_INTERNAL_1R(getShaderSource, WebGLShader*, String) +DELEGATE_TO_INTERNAL_1R(getShaderSource, Platform3DObject, String) DELEGATE_TO_INTERNAL_1R(getString, unsigned long, String) DELEGATE_TO_INTERNAL_3(getTexParameterfv, unsigned long, unsigned long, float*) DELEGATE_TO_INTERNAL_3(getTexParameteriv, unsigned long, unsigned long, int*) -DELEGATE_TO_INTERNAL_3(getUniformfv, WebGLProgram*, long, float*) -DELEGATE_TO_INTERNAL_3(getUniformiv, WebGLProgram*, long, int*) +DELEGATE_TO_INTERNAL_3(getUniformfv, Platform3DObject, long, float*) +DELEGATE_TO_INTERNAL_3(getUniformiv, Platform3DObject, long, int*) -DELEGATE_TO_INTERNAL_2R(getUniformLocation, WebGLProgram*, const String&, long) +DELEGATE_TO_INTERNAL_2R(getUniformLocation, Platform3DObject, const String&, long) DELEGATE_TO_INTERNAL_3(getVertexAttribfv, unsigned long, unsigned long, float*) DELEGATE_TO_INTERNAL_3(getVertexAttribiv, unsigned long, unsigned long, int*) @@ -1236,15 +1159,15 @@ DELEGATE_TO_INTERNAL_3(getVertexAttribiv, unsigned long, unsigned long, int*) DELEGATE_TO_INTERNAL_2R(getVertexAttribOffset, unsigned long, unsigned long, long) DELEGATE_TO_INTERNAL_2(hint, unsigned long, unsigned long) -DELEGATE_TO_INTERNAL_1R(isBuffer, WebGLBuffer*, bool) +DELEGATE_TO_INTERNAL_1R(isBuffer, Platform3DObject, bool) DELEGATE_TO_INTERNAL_1R(isEnabled, unsigned long, bool) -DELEGATE_TO_INTERNAL_1R(isFramebuffer, WebGLFramebuffer*, bool) -DELEGATE_TO_INTERNAL_1R(isProgram, WebGLProgram*, bool) -DELEGATE_TO_INTERNAL_1R(isRenderbuffer, WebGLRenderbuffer*, bool) -DELEGATE_TO_INTERNAL_1R(isShader, WebGLShader*, bool) -DELEGATE_TO_INTERNAL_1R(isTexture, WebGLTexture*, bool) +DELEGATE_TO_INTERNAL_1R(isFramebuffer, Platform3DObject, bool) +DELEGATE_TO_INTERNAL_1R(isProgram, Platform3DObject, bool) +DELEGATE_TO_INTERNAL_1R(isRenderbuffer, Platform3DObject, bool) +DELEGATE_TO_INTERNAL_1R(isShader, Platform3DObject, bool) +DELEGATE_TO_INTERNAL_1R(isTexture, Platform3DObject, bool) DELEGATE_TO_INTERNAL_1(lineWidth, double) -DELEGATE_TO_INTERNAL_1(linkProgram, WebGLProgram*) +DELEGATE_TO_INTERNAL_1(linkProgram, Platform3DObject) DELEGATE_TO_INTERNAL_2(pixelStorei, unsigned long, long) DELEGATE_TO_INTERNAL_2(polygonOffset, double, double) @@ -1254,7 +1177,7 @@ DELEGATE_TO_INTERNAL(releaseShaderCompiler) DELEGATE_TO_INTERNAL_4(renderbufferStorage, unsigned long, unsigned long, unsigned long, unsigned long) DELEGATE_TO_INTERNAL_2(sampleCoverage, double, bool) DELEGATE_TO_INTERNAL_4(scissor, long, long, unsigned long, unsigned long) -DELEGATE_TO_INTERNAL_2(shaderSource, WebGLShader*, const String&) +DELEGATE_TO_INTERNAL_2(shaderSource, Platform3DObject, const String&) DELEGATE_TO_INTERNAL_3(stencilFunc, unsigned long, long, unsigned long) DELEGATE_TO_INTERNAL_4(stencilFuncSeparate, unsigned long, unsigned long, long, unsigned long) DELEGATE_TO_INTERNAL_1(stencilMask, unsigned long) @@ -1287,8 +1210,8 @@ DELEGATE_TO_INTERNAL_4(uniformMatrix2fv, long, bool, float*, int) DELEGATE_TO_INTERNAL_4(uniformMatrix3fv, long, bool, float*, int) DELEGATE_TO_INTERNAL_4(uniformMatrix4fv, long, bool, float*, int) -DELEGATE_TO_INTERNAL_1(useProgram, WebGLProgram*) -DELEGATE_TO_INTERNAL_1(validateProgram, WebGLProgram*) +DELEGATE_TO_INTERNAL_1(useProgram, Platform3DObject) +DELEGATE_TO_INTERNAL_1(validateProgram, Platform3DObject) DELEGATE_TO_INTERNAL_2(vertexAttrib1f, unsigned long, float) DELEGATE_TO_INTERNAL_2(vertexAttrib1fv, unsigned long, float*) @@ -1302,8 +1225,8 @@ DELEGATE_TO_INTERNAL_6(vertexAttribPointer, unsigned long, int, int, bool, unsig DELEGATE_TO_INTERNAL_4(viewport, long, long, unsigned long, unsigned long) -DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, WebGLRenderingContext*) -DELEGATE_TO_INTERNAL_1(beginPaint, WebGLRenderingContext*) +DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*) +DELEGATE_TO_INTERNAL_1(beginPaint, CanvasRenderingContext*) DELEGATE_TO_INTERNAL(endPaint) DELEGATE_TO_INTERNAL_R(createBuffer, unsigned) diff --git a/WebKit/chromium/src/IDBCallbacksProxy.cpp b/WebKit/chromium/src/IDBCallbacksProxy.cpp index 4489e9b..3eab622 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -32,6 +32,7 @@ #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" #include "WebIDBCallbacks.h" +#include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" #include "WebIDBDatabaseError.h" #include "WebIDBIndexImpl.h" @@ -69,9 +70,15 @@ void IDBCallbacksProxy::onSuccess() m_callbacks.clear(); } -void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabase> idbDatabase) +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend) { - m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(idbDatabase)); + m_callbacks->onSuccess(new WebKit::WebIDBCursorImpl(idbCursorBackend)); + m_callbacks.clear(); +} + +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend) +{ + m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); m_callbacks.clear(); } @@ -87,9 +94,9 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) m_callbacks.clear(); } -void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBObjectStore> idbObjectStore) +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBObjectStoreBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBObjectStoreImpl(idbObjectStore)); + m_callbacks->onSuccess(new WebKit::WebIDBObjectStoreImpl(backend)); m_callbacks.clear(); } diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h index 10fc31a..506dbb0 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/WebKit/chromium/src/IDBCallbacksProxy.h @@ -49,10 +49,11 @@ public: virtual void onError(PassRefPtr<IDBDatabaseError>); virtual void onSuccess(); // For "null". - virtual void onSuccess(PassRefPtr<IDBDatabase>); + virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); + virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>); virtual void onSuccess(PassRefPtr<IDBKey>); - virtual void onSuccess(PassRefPtr<IDBObjectStore>); + virtual void onSuccess(PassRefPtr<IDBObjectStoreBackendInterface>); virtual void onSuccess(PassRefPtr<SerializedScriptValue>); private: diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/WebKit/chromium/src/IDBCursorBackendProxy.cpp new file mode 100644 index 0000000..fff00b7 --- /dev/null +++ b/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -0,0 +1,86 @@ +/* + * 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. + * + * 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 "IDBCursorBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBAny.h" +#include "IDBCallbacks.h" +#include "SerializedScriptValue.h" +#include "WebIDBCallbacksImpl.h" +#include "WebIDBKey.h" + +namespace WebCore { + +PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +{ + return adoptRef(new IDBCursorBackendProxy(idbCursor)); +} + +IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) + : m_idbCursor(idbCursor) +{ +} + +IDBCursorBackendProxy::~IDBCursorBackendProxy() +{ +} + +unsigned short IDBCursorBackendProxy::direction() const +{ + return m_idbCursor->direction(); +} + +PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const +{ + return m_idbCursor->key(); +} + +PassRefPtr<IDBAny> IDBCursorBackendProxy::value() const +{ + RefPtr<SerializedScriptValue> value = PassRefPtr<SerializedScriptValue>(m_idbCursor->value()); + return IDBAny::create(value.get()); +} + +void IDBCursorBackendProxy::update(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBCallbacks> callbacks) +{ + m_idbCursor->update(value, new WebIDBCallbacksImpl(callbacks)); +} + +void IDBCursorBackendProxy::continueFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks) +{ + m_idbCursor->continueFunction(key, new WebIDBCallbacksImpl(callbacks)); +} + +void IDBCursorBackendProxy::remove(PassRefPtr<IDBCallbacks> callbacks) +{ + m_idbCursor->remove(new WebIDBCallbacksImpl(callbacks)); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.h b/WebKit/chromium/src/IDBCursorBackendProxy.h new file mode 100644 index 0000000..d8b621a --- /dev/null +++ b/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -0,0 +1,62 @@ +/* + * 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. + * + * 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 IDBCursorBackendProxy_h +#define IDBCursorBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBCursorBackendInterface.h" +#include "WebIDBCursor.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { + +class IDBCursorBackendProxy : public IDBCursorBackendInterface { +public: + static PassRefPtr<IDBCursorBackendInterface> create(PassOwnPtr<WebKit::WebIDBCursor>); + virtual ~IDBCursorBackendProxy(); + + virtual unsigned short direction() const; + virtual PassRefPtr<IDBKey> key() const; + virtual PassRefPtr<IDBAny> value() const; + virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>); + virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>); + virtual void remove(PassRefPtr<IDBCallbacks>); + +private: + IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor>); + + OwnPtr<WebKit::WebIDBCursor> m_idbCursor; +}; + +} // namespace WebCore + +#endif + +#endif // IDBCursorBackendProxy_h diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp index 9d009c0..d11d182 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp @@ -29,6 +29,7 @@ #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBObjectStoreProxy.h" +#include "IDBTransactionBackendInterface.h" #include "WebFrameImpl.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" @@ -39,7 +40,7 @@ namespace WebCore { -PassRefPtr<IDBDatabase> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) +PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) { return adoptRef(new IDBDatabaseProxy(database)); } @@ -78,7 +79,7 @@ void IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPa m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, new WebIDBCallbacksImpl(callbacks)); } -PassRefPtr<IDBObjectStore> IDBDatabaseProxy::objectStore(const String& name, unsigned short mode) +PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::objectStore(const String& name, unsigned short mode) { WebKit::WebIDBObjectStore* objectStore = m_webIDBDatabase->objectStore(name, mode); if (!objectStore) @@ -91,6 +92,13 @@ void IDBDatabaseProxy::removeObjectStore(const String& name, PassRefPtr<IDBCallb m_webIDBDatabase->removeObjectStore(name, new WebIDBCallbacksImpl(callbacks)); } +PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout) +{ + // FIXME: plumb to the browser process, etc etc. + ASSERT_NOT_REACHED(); + return 0; +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h index 36588f0..ed2016a 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/WebKit/chromium/src/IDBDatabaseProxy.h @@ -26,7 +26,7 @@ #ifndef IDBDatabaseProxy_h #define IDBDatabaseProxy_h -#include "IDBDatabase.h" +#include "IDBDatabaseBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> @@ -37,9 +37,9 @@ namespace WebKit { class WebIDBDatabase; } namespace WebCore { -class IDBDatabaseProxy : public IDBDatabase { +class IDBDatabaseProxy : public IDBDatabaseBackendInterface { public: - static PassRefPtr<IDBDatabase> create(PassOwnPtr<WebKit::WebIDBDatabase>); + static PassRefPtr<IDBDatabaseBackendInterface> create(PassOwnPtr<WebKit::WebIDBDatabase>); virtual ~IDBDatabaseProxy(); virtual String name() const; @@ -50,8 +50,9 @@ public: // FIXME: Add transaction and setVersion. virtual void createObjectStore(const String& name, const String& keyPath, bool autoIncrement, PassRefPtr<IDBCallbacks>); - virtual PassRefPtr<IDBObjectStore> objectStore(const String& name, unsigned short mode); + virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, unsigned short mode); virtual void removeObjectStore(const String& name, PassRefPtr<IDBCallbacks>); + virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, unsigned long timeout); private: IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>); diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/WebKit/chromium/src/IDBObjectStoreProxy.cpp index 858ed20..ad27fa3 100755 --- a/WebKit/chromium/src/IDBObjectStoreProxy.cpp +++ b/WebKit/chromium/src/IDBObjectStoreProxy.cpp @@ -29,7 +29,9 @@ #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBIndexBackendProxy.h" +#include "IDBKeyRange.h" #include "WebIDBCallbacksImpl.h" +#include "WebIDBKeyRange.h" #include "WebIDBIndex.h" #include "WebIDBKey.h" #include "WebIDBObjectStore.h" @@ -39,7 +41,7 @@ namespace WebCore { -PassRefPtr<IDBObjectStore> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) { return adoptRef(new IDBObjectStoreProxy(objectStore)); } @@ -101,6 +103,11 @@ void IDBObjectStoreProxy::removeIndex(const String& name, PassRefPtr<IDBCallback m_webIDBObjectStore->removeIndex(name, new WebIDBCallbacksImpl(callbacks)); } +void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks) +{ + m_webIDBObjectStore->openCursor(range, direction, new WebIDBCallbacksImpl(callbacks)); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBObjectStoreProxy.h b/WebKit/chromium/src/IDBObjectStoreProxy.h index b380bdc..a334572 100755 --- a/WebKit/chromium/src/IDBObjectStoreProxy.h +++ b/WebKit/chromium/src/IDBObjectStoreProxy.h @@ -26,7 +26,7 @@ #ifndef IDBObjectStoreProxy_h #define IDBObjectStoreProxy_h -#include "IDBObjectStore.h" +#include "IDBObjectStoreBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> @@ -37,9 +37,9 @@ namespace WebKit { class WebIDBObjectStore; } namespace WebCore { -class IDBObjectStoreProxy : public IDBObjectStore { +class IDBObjectStoreProxy : public IDBObjectStoreBackendInterface { public: - static PassRefPtr<IDBObjectStore> create(PassOwnPtr<WebKit::WebIDBObjectStore>); + static PassRefPtr<IDBObjectStoreBackendInterface> create(PassOwnPtr<WebKit::WebIDBObjectStore>); ~IDBObjectStoreProxy(); String name() const; @@ -54,6 +54,8 @@ public: PassRefPtr<IDBIndexBackendInterface> index(const String& name); void removeIndex(const String& name, PassRefPtr<IDBCallbacks>); + virtual void openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks>); + private: IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore>); diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp index cf491f7..76acbb2 100644 --- a/WebKit/chromium/src/InspectorClientImpl.cpp +++ b/WebKit/chromium/src/InspectorClientImpl.cpp @@ -36,7 +36,6 @@ #include "NotImplemented.h" #include "Page.h" #include "WebDevToolsAgentImpl.h" -#include "WebDevToolsMessageData.h" #include "WebRect.h" #include "WebURL.h" #include "WebURLRequest.h" @@ -94,7 +93,7 @@ void InspectorClientImpl::storeSetting(const String& key, const String& value) agent->storeSetting(key, value); } -bool InspectorClientImpl::sendMessageToFrontend(const WebCore::String& message) +bool InspectorClientImpl::sendMessageToFrontend(const WTF::String& message) { if (WebDevToolsAgentImpl* agent = devToolsAgent()) return agent->sendMessageToFrontend(message); diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h index 0605ccd..34fcdc3 100644 --- a/WebKit/chromium/src/InspectorClientImpl.h +++ b/WebKit/chromium/src/InspectorClientImpl.h @@ -53,10 +53,10 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); virtual void resourceTrackingWasEnabled(); virtual void resourceTrackingWasDisabled(); diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp index 870bdee..46f2cb6 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp @@ -40,6 +40,7 @@ #include "V8Proxy.h" #include "WebDevToolsFrontendClient.h" #include "WebDevToolsFrontendImpl.h" +#include "WebString.h" using namespace WebCore; @@ -126,13 +127,7 @@ void InspectorFrontendClientImpl::inspectedURLChanged(const String& url) void InspectorFrontendClientImpl::sendMessageToBackend(const String& message) { - WebDevToolsMessageData messageData; - messageData.className = "ToolsAgent"; - messageData.methodName = "dispatchOnInspectorController"; - WebVector<WebString> args(static_cast<size_t>(1)); - args[0] = message; - messageData.arguments.swap(args); - m_client->sendMessageToAgent(messageData); + m_client->sendMessageToBackend(message); } } // namespace WebKit diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.h b/WebKit/chromium/src/InspectorFrontendClientImpl.h index f7174ce..1507bf2 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.h +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.h @@ -56,8 +56,8 @@ public: virtual void moveWindowBy(float x, float y); - virtual WebCore::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String localizedStringsURL(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -66,9 +66,9 @@ public: virtual void requestDetachWindow(); virtual void changeAttachedWindowHeight(unsigned); - virtual void inspectedURLChanged(const WebCore::String&); + virtual void inspectedURLChanged(const WTF::String&); - virtual void sendMessageToBackend(const WebCore::String&); + virtual void sendMessageToBackend(const WTF::String&); private: WebCore::Page* m_frontendPage; WebDevToolsFrontendClient* m_client; diff --git a/WebKit/chromium/src/ProfilerAgent.h b/WebKit/chromium/src/ProfilerAgent.h deleted file mode 100644 index 52337b8..0000000 --- a/WebKit/chromium/src/ProfilerAgent.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ProfilerAgent_h -#define ProfilerAgent_h - -#include "DevToolsRPC.h" - -namespace WebKit { - -// Profiler agent provides API for retrieving profiler data. -// These methods are handled on the IO thread, so profiler can -// operate while a script on a page performs heavy work. -#define PROFILER_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Requests current profiler state. */ \ - METHOD0(getActiveProfilerModules) \ - \ - /* Retrieves portion of profiler log. */ \ - METHOD1(getLogLines, int /* position */) - -DEFINE_RPC_CLASS(ProfilerAgent, PROFILER_AGENT_STRUCT) - -#define PROFILER_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Response to getActiveProfilerModules. */ \ - METHOD1(didGetActiveProfilerModules, int /* flags */) \ - \ - /* Response to getLogLines. */ \ - METHOD2(didGetLogLines, int /* position */, String /* log */) - -DEFINE_RPC_CLASS(ProfilerAgentDelegate, PROFILER_AGENT_DELEGATE_STRUCT) - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/ToolsAgent.h b/WebKit/chromium/src/ToolsAgent.h deleted file mode 100644 index 937fcf0..0000000 --- a/WebKit/chromium/src/ToolsAgent.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef ToolsAgent_h -#define ToolsAgent_h - -#include "DevToolsRPC.h" - -namespace WebKit { - -// Tools agent provides API for enabling / disabling other agents as well as -// API for auxiliary UI functions such as dom elements highlighting. -#define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Dispatches given function on the InspectorController object */ \ - METHOD1(dispatchOnInspectorController, String /* message */) \ - -DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT) - -#define TOOLS_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Response to the DispatchOn*. */ \ - METHOD3(didDispatchOn, int /* call_id */, String /* result */, String /* exception */) \ - \ - /* Sends InspectorFrontend message to be dispatched on client. */ \ - METHOD1(dispatchOnClient, String /* data */) - -DEFINE_RPC_CLASS(ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT) - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 1a65bfe..4de5624 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -31,36 +31,23 @@ #include "config.h" #include "WebDevToolsAgentImpl.h" -#include "BoundObject.h" #include "DebuggerAgentImpl.h" #include "DebuggerAgentManager.h" -#include "Document.h" -#include "EventListener.h" #include "InjectedScriptHost.h" -#include "InspectorBackend.h" #include "InspectorBackendDispatcher.h" #include "InspectorController.h" -#include "InspectorFrontend.h" -#include "InspectorResource.h" -#include "Node.h" #include "Page.h" #include "PageGroup.h" #include "PlatformString.h" -#include "ProfilerAgentImpl.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "ResourceResponse.h" #include "ScriptDebugServer.h" -#include "ScriptObject.h" -#include "ScriptState.h" -#include "ScriptValue.h" #include "V8Binding.h" #include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" #include "WebDevToolsAgentClient.h" -#include "WebDevToolsMessageData.h" -#include "WebDevToolsMessageTransport.h" #include "WebFrameImpl.h" #include "WebRect.h" #include "WebString.h" @@ -73,24 +60,16 @@ #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> -using WebCore::Document; using WebCore::DocumentLoader; using WebCore::FrameLoader; using WebCore::InjectedScriptHost; -using WebCore::InspectorBackend; using WebCore::InspectorController; -using WebCore::InspectorFrontend; -using WebCore::InspectorResource; using WebCore::Node; using WebCore::Page; using WebCore::ResourceError; using WebCore::ResourceRequest; using WebCore::ResourceResponse; -using WebCore::SafeAllocation; -using WebCore::ScriptObject; -using WebCore::ScriptState; -using WebCore::ScriptValue; -using WebCore::String; +using WTF::String; using WebCore::V8DOMWrapper; using WebCore::V8Proxy; @@ -98,32 +77,11 @@ namespace WebKit { namespace { -void InspectorBackendWeakReferenceCallback(v8::Persistent<v8::Value> object, void* parameter) -{ - InspectorBackend* backend = static_cast<InspectorBackend*>(parameter); - backend->deref(); - object.Dispose(); -} - +static const char kFrontendConnectedFeatureName[] = "frontend-connected"; static const char kResourceTrackingFeatureName[] = "resource-tracking"; static const char kTimelineFeatureName[] = "timeline-profiler"; static const char kApuAgentFeatureName[] = "apu-agent"; -class IORPCDelegate : public DevToolsRPC::Delegate, public Noncopyable { -public: - IORPCDelegate() : m_transport(0) { } - explicit IORPCDelegate(WebDevToolsMessageTransport* transport) : m_transport(transport) { } - virtual ~IORPCDelegate() { } - virtual void sendRpcMessage(const WebDevToolsMessageData& data) - { - if (m_transport) - m_transport->sendMessageToFrontendOnIOThread(data); - } - -private: - WebDevToolsMessageTransport* m_transport; -}; - class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop { public: static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) @@ -222,24 +180,12 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl( { DebuggerAgentManager::setExposeV8DebuggerProtocol( client->exposeV8DebuggerProtocol()); - m_debuggerAgentDelegateStub.set(new DebuggerAgentDelegateStub(this)); - m_toolsAgentDelegateStub.set(new ToolsAgentDelegateStub(this)); - m_apuAgentDelegateStub.set(new ApuAgentDelegateStub(this)); } WebDevToolsAgentImpl::~WebDevToolsAgentImpl() { DebuggerAgentManager::onWebViewClosed(m_webViewImpl); ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); - disposeUtilityContext(); -} - -void WebDevToolsAgentImpl::disposeUtilityContext() -{ - if (!m_utilityContext.IsEmpty()) { - m_utilityContext.Dispose(); - m_utilityContext.Clear(); - } } void WebDevToolsAgentImpl::attach() @@ -251,42 +197,44 @@ void WebDevToolsAgentImpl::attach() ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client); m_debuggerAgentImpl.set( - new DebuggerAgentImpl(m_webViewImpl, - m_debuggerAgentDelegateStub.get(), - this)); - createInspectorFrontendProxy(); - - // Allow controller to send messages to the frontend. - InspectorController* ic = inspectorController(); + new DebuggerAgentImpl(m_webViewImpl, this, m_client)); + WebCString debuggerScriptJs = m_client->debuggerScriptSource(); + WebCore::ScriptDebugServer::shared().setDebuggerScriptSource( + WTF::String(debuggerScriptJs.data(), debuggerScriptJs.length())); - { // TODO(yurys): the source should have already been pushed by the frontend. - v8::HandleScope scope; - v8::Context::Scope contextScope(m_utilityContext); - v8::Handle<v8::Value> constructorValue = m_utilityContext->Global()->Get( - v8::String::New("injectedScriptConstructor")); - if (constructorValue->IsFunction()) { - String source = WebCore::toWebCoreString(constructorValue); - ic->injectedScriptHost()->setInjectedScriptSource("(" + source + ")"); - } + // TODO(yurys): the source should have already been pushed by the frontend. + WebCString injectedScriptJs = m_client->injectedScriptSource(); + String injectedScriptSource = String::fromUTF8(injectedScriptJs.data(), injectedScriptJs.length()); + const char* varDefinition = "var injectedScriptConstructor = "; + int pos = injectedScriptSource.find(varDefinition); + if (pos == -1) { + ASSERT_NOT_REACHED(); + return; } - - setInspectorFrontendProxyToInspectorController(); + pos += String(varDefinition).length(); + injectedScriptSource = injectedScriptSource.substring(pos); + inspectorController()->injectedScriptHost()->setInjectedScriptSource(injectedScriptSource); m_attached = true; } void WebDevToolsAgentImpl::detach() { // Prevent controller from sending messages to the frontend. - InspectorController* ic = m_webViewImpl->page()->inspectorController(); + InspectorController* ic = inspectorController(); ic->disconnectFrontend(); ic->hideHighlight(); ic->close(); - disposeUtilityContext(); m_debuggerAgentImpl.set(0); m_attached = false; m_apuAgentEnabled = false; } +void WebDevToolsAgentImpl::frontendLoaded() +{ + inspectorController()->connectFrontend(); + m_client->runtimeFeatureStateChanged(kFrontendConnectedFeatureName, true); +} + void WebDevToolsAgentImpl::didNavigate() { ClientMessageLoopAdapter::didNavigate(); @@ -296,10 +244,6 @@ void WebDevToolsAgentImpl::didNavigate() void WebDevToolsAgentImpl::didClearWindowObject(WebFrameImpl* webframe) { DebuggerAgentManager::setHostId(webframe, m_hostId); - if (m_attached) { - // Push context id into the client if it is already attached. - m_debuggerAgentDelegateStub->setContextId(m_hostId); - } } void WebDevToolsAgentImpl::forceRepaint() @@ -307,23 +251,11 @@ void WebDevToolsAgentImpl::forceRepaint() m_client->forceRepaint(); } -void WebDevToolsAgentImpl::dispatchOnInspectorController(const String& message) +void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message) { inspectorController()->inspectorBackendDispatcher()->dispatch(message); } -void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const WebDevToolsMessageData& data) -{ - if (ToolsAgentDispatch::dispatch(this, data)) - return; - - if (!m_attached) - return; - - if (m_debuggerAgentImpl.get() && DebuggerAgentDispatch::dispatch(m_debuggerAgentImpl.get(), data)) - return; -} - void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) { m_webViewImpl->inspectElementAt(point); @@ -336,67 +268,19 @@ void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& feature, bo else if (feature == kTimelineFeatureName) setTimelineProfilingEnabled(enabled); else if (feature == kResourceTrackingFeatureName) { - InspectorController* ic = m_webViewImpl->page()->inspectorController(); + InspectorController* ic = inspectorController(); if (enabled) ic->enableResourceTracking(false /* not sticky */, false /* no reload */); else ic->disableResourceTracking(false /* not sticky */); - } -} - -void WebDevToolsAgentImpl::sendRpcMessage(const WebDevToolsMessageData& data) -{ - m_client->sendMessageToFrontend(data); -} - -void WebDevToolsAgentImpl::compileUtilityScripts() -{ - v8::HandleScope handleScope; - v8::Context::Scope contextScope(m_utilityContext); - // Inject javascript into the context. - WebCString injectedScriptJs = m_client->injectedScriptSource(); - v8::Script::Compile(v8::String::New( - injectedScriptJs.data(), - injectedScriptJs.length()))->Run(); - WebCString injectDispatchJs = m_client->injectedScriptDispatcherSource(); - v8::Script::Compile(v8::String::New( - injectDispatchJs.data(), - injectDispatchJs.length()))->Run(); -} - -void WebDevToolsAgentImpl::initDevToolsAgentHost() -{ - BoundObject devtoolsAgentHost(m_utilityContext, this, "DevToolsAgentHost"); - devtoolsAgentHost.addProtoFunction( - "dispatch", - WebDevToolsAgentImpl::jsDispatchOnClient); - devtoolsAgentHost.build(); -} - -void WebDevToolsAgentImpl::createInspectorFrontendProxy() -{ - disposeUtilityContext(); - m_utilityContext = v8::Context::New(); - compileUtilityScripts(); - initDevToolsAgentHost(); - WebCString debuggerScriptJs = m_client->debuggerScriptSource(); - WebCore::ScriptDebugServer::shared().setDebuggerScriptSource( - WebCore::String(debuggerScriptJs.data(), debuggerScriptJs.length())); -} - -void WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController() -{ - v8::HandleScope scope; - ScriptState* state = ScriptState::forContext( - v8::Local<v8::Context>::New(m_utilityContext)); - InspectorController* ic = inspectorController(); - ic->connectFrontend(ScriptObject(state, m_utilityContext->Global())); + } else if (feature == kFrontendConnectedFeatureName && enabled && !inspectorController()->hasFrontend()) + frontendLoaded(); } void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) { m_apuAgentEnabled = enabled; - InspectorController* ic = m_webViewImpl->page()->inspectorController(); + InspectorController* ic = inspectorController(); if (enabled) { m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); ic->startTimelineProfiler(); @@ -417,32 +301,6 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) enabled); } -// static -v8::Handle<v8::Value> WebDevToolsAgentImpl::jsDispatchOnClient(const v8::Arguments& args) -{ - v8::TryCatch exceptionCatcher; - String message = WebCore::toWebCoreStringWithNullCheck(args[0]); - if (message.isEmpty() || exceptionCatcher.HasCaught()) - return v8::Undefined(); - - WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value()); - - if (!agent->m_apuAgentEnabled) { - agent->m_toolsAgentDelegateStub->dispatchOnClient(message); - return v8::Undefined(); - } - - String method = WebCore::toWebCoreStringWithNullCheck(args[1]); - if (method.isEmpty() || exceptionCatcher.HasCaught()) - return v8::Undefined(); - - if (method != "addRecordToTimeline" && method != "updateResource" && method != "addResource") - return v8::Undefined(); - - agent->m_apuAgentDelegateStub->dispatchToApu(message); - return v8::Undefined(); -} - WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController() { if (Page* page = m_webViewImpl->page()) @@ -537,24 +395,18 @@ void WebDevToolsAgentImpl::storeSetting(const String& key, const String& value) m_webViewImpl->setInspectorSetting(key, value); } -bool WebDevToolsAgentImpl::sendMessageToFrontend(const WebCore::String& message) +bool WebDevToolsAgentImpl::sendMessageToFrontend(const WTF::String& message) { WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_webViewImpl->devToolsAgent()); if (!devToolsAgent) return false; - if (devToolsAgent->m_apuAgentEnabled && devToolsAgent->m_apuAgentDelegateStub) { - devToolsAgent->m_apuAgentDelegateStub->dispatchToApu(message); + if (devToolsAgent->m_apuAgentEnabled) { + m_client->sendDispatchToAPU(message); return true; } - WebVector<WebString> arguments(size_t(1)); - arguments[0] = message; - WebDevToolsMessageData data; - data.className = "ToolsAgentDelegate"; - data.methodName = "dispatchOnClient"; - data.arguments.swap(arguments); - devToolsAgent->sendRpcMessage(data); + m_client->sendMessageToInspectorFrontend(message); return true; } @@ -608,12 +460,4 @@ void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler DebuggerAgentManager::setMessageLoopDispatchHandler(handler); } -bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport* transport, const WebDevToolsMessageData& data) -{ - IORPCDelegate delegate(transport); - ProfilerAgentDelegateStub stub(&delegate); - ProfilerAgentImpl agent(&stub); - return ProfilerAgentDispatch::dispatch(&agent, data); -} - } // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index c8e22b0..a0d2647 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -33,12 +33,10 @@ #include "InspectorClient.h" -#include "APUAgentDelegate.h" -#include "DevToolsRPC.h" -#include "ToolsAgent.h" #include "WebDevToolsAgentPrivate.h" #include <v8.h> +#include <wtf/Forward.h> #include <wtf/OwnPtr.h> namespace WebCore { @@ -46,12 +44,10 @@ class Document; class InspectorClient; class InspectorController; class Node; -class String; } namespace WebKit { -class DebuggerAgentDelegateStub; class DebuggerAgentImpl; class WebDevToolsAgentClient; class WebFrame; @@ -64,24 +60,20 @@ struct WebURLError; struct WebDevToolsMessageData; class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate, - public ToolsAgent, - public DevToolsRPC::Delegate, public WebCore::InspectorClient { public: WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client); virtual ~WebDevToolsAgentImpl(); - // ToolsAgent implementation. - virtual void dispatchOnInspectorController(const WebCore::String& message); - // WebDevToolsAgentPrivate implementation. virtual void didClearWindowObject(WebFrameImpl* frame); // WebDevToolsAgent implementation. virtual void attach(); virtual void detach(); + virtual void frontendLoaded(); virtual void didNavigate(); - virtual void dispatchMessageFromFrontend(const WebDevToolsMessageData& data); + virtual void dispatchOnInspectorBackend(const WebString& message); virtual void inspectElementAt(const WebPoint& point); virtual void evaluateInWebInspector(long callId, const WebString& script); virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled); @@ -99,30 +91,19 @@ public: virtual void openInspectorFrontend(WebCore::InspectorController*); virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); virtual void resourceTrackingWasEnabled(); virtual void resourceTrackingWasDisabled(); virtual void timelineProfilerWasStarted(); virtual void timelineProfilerWasStopped(); - virtual bool sendMessageToFrontend(const WebCore::String&); - - // DevToolsRPC::Delegate implementation. - virtual void sendRpcMessage(const WebDevToolsMessageData& data); + virtual bool sendMessageToFrontend(const WTF::String&); void forceRepaint(); int hostId() { return m_hostId; } private: - static v8::Handle<v8::Value> jsDispatchOnClient(const v8::Arguments& args); - - void disposeUtilityContext(); - - void compileUtilityScripts(); - void initDevToolsAgentHost(); - void createInspectorFrontendProxy(); - void setInspectorFrontendProxyToInspectorController(); void setApuAgentEnabled(bool enabled); WebCore::InspectorController* inspectorController(); @@ -130,16 +111,10 @@ private: int m_hostId; WebDevToolsAgentClient* m_client; WebViewImpl* m_webViewImpl; - OwnPtr<DebuggerAgentDelegateStub> m_debuggerAgentDelegateStub; - OwnPtr<ToolsAgentDelegateStub> m_toolsAgentDelegateStub; OwnPtr<DebuggerAgentImpl> m_debuggerAgentImpl; - OwnPtr<ApuAgentDelegateStub> m_apuAgentDelegateStub; bool m_apuAgentEnabled; bool m_resourceTrackingWasEnabled; bool m_attached; - // TODO(pfeldman): This should not be needed once GC styles issue is fixed - // for matching rules. - v8::Persistent<v8::Context> m_utilityContext; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index 592a532..c1b09c4 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -35,8 +35,6 @@ #include "ContextMenuController.h" #include "ContextMenuItem.h" #include "DOMWindow.h" -#include "DebuggerAgent.h" -#include "DevToolsRPCJS.h" #include "Document.h" #include "Event.h" #include "Frame.h" @@ -48,10 +46,8 @@ #include "Page.h" #include "Pasteboard.h" #include "PlatformString.h" -#include "ProfilerAgent.h" #include "SecurityOrigin.h" #include "Settings.h" -#include "ToolsAgent.h" #include "V8Binding.h" #include "V8DOMWrapper.h" #include "V8InspectorFrontendHost.h" @@ -78,10 +74,6 @@ static v8::Local<v8::String> ToV8String(const String& s) return v8::String::New(reinterpret_cast<const uint16_t*>(s.characters()), s.length()); } -DEFINE_RPC_JS_BOUND_OBJ(DebuggerAgent, DEBUGGER_AGENT_STRUCT, DebuggerAgentDelegate, DEBUGGER_AGENT_DELEGATE_STRUCT) -DEFINE_RPC_JS_BOUND_OBJ(ProfilerAgent, PROFILER_AGENT_STRUCT, ProfilerAgentDelegate, PROFILER_AGENT_DELEGATE_STRUCT) -DEFINE_RPC_JS_BOUND_OBJ(ToolsAgent, TOOLS_AGENT_STRUCT, ToolsAgentDelegate, TOOLS_AGENT_DELEGATE_STRUCT) - WebDevToolsFrontend* WebDevToolsFrontend::create( WebView* view, WebDevToolsFrontendClient* client, @@ -113,16 +105,9 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( v8::HandleScope scope; v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame()); - m_debuggerAgentObj.set(new JSDebuggerAgentBoundObj(this, frameContext, "RemoteDebuggerAgent")); - m_profilerAgentObj.set(new JSProfilerAgentBoundObj(this, frameContext, "RemoteProfilerAgent")); - m_toolsAgentObj.set(new JSToolsAgentBoundObj(this, frameContext, "RemoteToolsAgent")); - // Debugger commands should be sent using special method. BoundObject debuggerCommandExecutorObj(frameContext, this, "RemoteDebuggerCommandExecutor"); debuggerCommandExecutorObj.addProtoFunction( - "DebuggerCommand", - WebDevToolsFrontendImpl::jsDebuggerCommand); - debuggerCommandExecutorObj.addProtoFunction( "DebuggerPauseScript", WebDevToolsFrontendImpl::jsDebuggerPauseScript); debuggerCommandExecutorObj.build(); @@ -132,33 +117,7 @@ WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() { } -void WebDevToolsFrontendImpl::dispatchMessageFromAgent(const WebDevToolsMessageData& data) -{ - Vector<String> v; - v.append(data.className); - v.append(data.methodName); - for (size_t i = 0; i < data.arguments.size(); i++) - v.append(data.arguments[i]); - if (!m_loaded) { - m_pendingIncomingMessages.append(v); - return; - } - executeScript(v); -} - -void WebDevToolsFrontendImpl::frontendLoaded() -{ - m_loaded = true; - - for (Vector<Vector<String> >::iterator it = m_pendingIncomingMessages.begin(); - it != m_pendingIncomingMessages.end(); - ++it) { - executeScript(*it); - } - m_pendingIncomingMessages.clear(); -} - -void WebDevToolsFrontendImpl::executeScript(const Vector<String>& v) +void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& message) { WebFrameImpl* frame = m_webViewImpl->mainFrameImpl(); v8::HandleScope scope; @@ -168,24 +127,15 @@ void WebDevToolsFrontendImpl::executeScript(const Vector<String>& v) ASSERT(dispatchFunction->IsFunction()); v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction); Vector< v8::Handle<v8::Value> > args; - for (size_t i = 0; i < v.size(); i++) - args.append(ToV8String(v.at(i))); + args.append(ToV8String(message)); v8::TryCatch tryCatch; tryCatch.SetVerbose(true); function->Call(frameContext->Global(), args.size(), args.data()); } -void WebDevToolsFrontendImpl::sendRpcMessage(const WebDevToolsMessageData& data) -{ - m_client->sendMessageToAgent(data); -} - -v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerCommand(const v8::Arguments& args) +void WebDevToolsFrontendImpl::frontendLoaded() { - WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value()); - WebString command = WebCore::toWebCoreStringWithNullCheck(args[0]); - frontend->m_client->sendDebuggerCommandToAgent(command); - return v8::Undefined(); + m_client->sendFrontendLoaded(); } v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerPauseScript(const v8::Arguments& args) diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.h b/WebKit/chromium/src/WebDevToolsFrontendImpl.h index fa4707d..e4f22fe 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.h +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.h @@ -31,9 +31,10 @@ #ifndef WebDevToolsFrontendImpl_h #define WebDevToolsFrontendImpl_h -#include "DevToolsRPC.h" +#include "PlatformString.h" #include "WebDevToolsFrontend.h" #include <v8.h> +#include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> @@ -44,20 +45,17 @@ namespace WebCore { class ContextMenuItem; class Node; class Page; -class String; } namespace WebKit { -class JSDebuggerAgentBoundObj; -class JSProfilerAgentBoundObj; -class JSToolsAgentBoundObj; class WebDevToolsClientDelegate; class WebViewImpl; struct WebDevToolsMessageData; +using WTF::String; + class WebDevToolsFrontendImpl : public WebKit::WebDevToolsFrontend - , public DevToolsRPC::Delegate , public Noncopyable { public: WebDevToolsFrontendImpl( @@ -66,28 +64,18 @@ public: const String& applicationLocale); virtual ~WebDevToolsFrontendImpl(); - // DevToolsRPC::Delegate implementation. - virtual void sendRpcMessage(const WebKit::WebDevToolsMessageData& data); - // WebDevToolsFrontend implementation. - virtual void dispatchMessageFromAgent(const WebKit::WebDevToolsMessageData& data); + virtual void dispatchOnInspectorFrontend(const WebString& message); void frontendLoaded(); private: - void executeScript(const Vector<String>& v); - - static v8::Handle<v8::Value> jsDebuggerCommand(const v8::Arguments& args); static v8::Handle<v8::Value> jsDebuggerPauseScript(const v8::Arguments& args); WebKit::WebViewImpl* m_webViewImpl; WebKit::WebDevToolsFrontendClient* m_client; String m_applicationLocale; - OwnPtr<JSDebuggerAgentBoundObj> m_debuggerAgentObj; - OwnPtr<JSProfilerAgentBoundObj> m_profilerAgentObj; - OwnPtr<JSToolsAgentBoundObj> m_toolsAgentObj; bool m_loaded; - Vector<Vector<String> > m_pendingIncomingMessages; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebDeviceOrientation.cpp b/WebKit/chromium/src/WebDeviceOrientation.cpp new file mode 100644 index 0000000..47f6bd1 --- /dev/null +++ b/WebKit/chromium/src/WebDeviceOrientation.cpp @@ -0,0 +1,86 @@ +/* + * 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. + * + * 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 "WebDeviceOrientation.h" + +#include "DeviceOrientation.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +WebDeviceOrientation::WebDeviceOrientation(const PassRefPtr<WebCore::DeviceOrientation>& orientation) +{ + if (!orientation) { + m_isNull = true; + m_canProvideAlpha = false; + m_alpha = 0; + m_canProvideBeta = false; + m_beta = 0; + m_canProvideGamma = false; + m_gamma = 0; + return; + } + + m_isNull = false; + m_canProvideAlpha = orientation->canProvideAlpha(); + m_alpha = orientation->alpha(); + m_canProvideBeta = orientation->canProvideBeta(); + m_beta = orientation->beta(); + m_canProvideGamma = orientation->canProvideGamma(); + m_gamma = orientation->gamma(); +} + +WebDeviceOrientation& WebDeviceOrientation::operator=(const PassRefPtr<WebCore::DeviceOrientation>& orientation) +{ + if (!orientation) { + m_isNull = true; + m_canProvideAlpha = false; + m_alpha = 0; + m_canProvideBeta = false; + m_beta = 0; + m_canProvideGamma = false; + m_gamma = 0; + return *this; + } + + m_isNull = false; + m_canProvideAlpha = orientation->canProvideAlpha(); + m_alpha = orientation->alpha(); + m_canProvideBeta = orientation->canProvideBeta(); + m_beta = orientation->beta(); + m_canProvideGamma = orientation->canProvideGamma(); + m_gamma = orientation->gamma(); + return *this; +} + +WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientation>() const +{ + if (m_isNull) + return 0; + return WebCore::DeviceOrientation::create(m_canProvideAlpha, m_alpha, m_canProvideBeta, m_beta, m_canProvideGamma, m_gamma); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp new file mode 100644 index 0000000..4011d12 --- /dev/null +++ b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp @@ -0,0 +1,71 @@ +/* + * 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. + * + * 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 "WebDeviceOrientationClientMock.h" + +#include "DeviceOrientationClientMock.h" +#include "WebDeviceOrientation.h" +#include "WebDeviceOrientationController.h" + +namespace WebKit { + +void WebDeviceOrientationClientMock::setController(WebDeviceOrientationController* controller) +{ + m_clientMock->setController(controller->controller()); +} + +void WebDeviceOrientationClientMock::startUpdating() +{ + m_clientMock->startUpdating(); +} + +void WebDeviceOrientationClientMock::stopUpdating() +{ + m_clientMock->stopUpdating(); +} + +WebDeviceOrientation WebDeviceOrientationClientMock::lastOrientation() const +{ + return WebDeviceOrientation(m_clientMock->lastOrientation()); +} + +void WebDeviceOrientationClientMock::setOrientation(WebDeviceOrientation& orientation) +{ + m_clientMock->setOrientation(orientation); +} + +void WebDeviceOrientationClientMock::initialize() +{ + m_clientMock = new WebCore::DeviceOrientationClientMock(); +} + +void WebDeviceOrientationClientMock::reset() +{ + delete m_clientMock; + m_clientMock = 0; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDeviceOrientationController.cpp b/WebKit/chromium/src/WebDeviceOrientationController.cpp new file mode 100644 index 0000000..aa9249f --- /dev/null +++ b/WebKit/chromium/src/WebDeviceOrientationController.cpp @@ -0,0 +1,47 @@ +/* + * 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. + * + * 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 "WebDeviceOrientationController.h" + +#include "DeviceOrientation.h" +#include "DeviceOrientationController.h" +#include "WebDeviceOrientation.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +void WebDeviceOrientationController::didChangeDeviceOrientation(const WebDeviceOrientation& orientation) +{ + PassRefPtr<WebCore::DeviceOrientation> deviceOrientation(orientation); + m_controller->didChangeDeviceOrientation(deviceOrientation.get()); +} + +WebCore::DeviceOrientationController* WebDeviceOrientationController::controller() const +{ + return m_controller; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp index 665d8d9..30b619b 100644 --- a/WebKit/chromium/src/WebEntities.cpp +++ b/WebKit/chromium/src/WebEntities.cpp @@ -52,7 +52,7 @@ namespace { namespace WebKit { -void populateMap(WTF::HashMap<int, WebCore::String>& map, +void populateMap(WTF::HashMap<int, WTF::String>& map, const Entity* entities, size_t entitiesCount, bool standardHTML) diff --git a/WebKit/chromium/src/WebEntities.h b/WebKit/chromium/src/WebEntities.h index ad3c310..a01cc5d 100644 --- a/WebKit/chromium/src/WebEntities.h +++ b/WebKit/chromium/src/WebEntities.h @@ -59,12 +59,12 @@ public: // entity name. If yes, return the entity notation. If not, returns an // empty string. Parameter isHTML indicates check the code in html entity // map or in xml entity map. - WebCore::String entityNameByCode(int code) const; + WTF::String entityNameByCode(int code) const; // Returns a new string with corresponding entity names replaced. - WebCore::String convertEntitiesInString(const WebCore::String&) const; + WTF::String convertEntitiesInString(const WTF::String&) const; private: - typedef HashMap<int, WebCore::String> EntitiesMapType; + typedef HashMap<int, WTF::String> EntitiesMapType; // An internal object that maps the Unicode character to corresponding // entity notation. EntitiesMapType m_entitiesMap; diff --git a/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp b/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp index 4152dc5..ef2409c 100644 --- a/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp +++ b/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp @@ -48,7 +48,7 @@ void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fil m_fileChooser->chooseFile(fileNames[0]); else { // This clause handles a case of file_names.size()==0 too. - Vector<WebCore::String> paths; + Vector<WTF::String> paths; for (size_t i = 0; i < fileNames.size(); ++i) paths.append(fileNames[i]); m_fileChooser->chooseFiles(paths); diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index 2511fce..00e8ecb 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -285,7 +285,7 @@ private: // It is not necessary if the frame is invisible, for example, or if this // is a repeat search that already returned nothing last time the same prefix // was searched. - bool shouldScopeMatches(const WebCore::String& searchText); + bool shouldScopeMatches(const WTF::String& searchText); // Queue up a deferred call to scopeStringMatches. void scopeStringMatchesSoon( @@ -336,7 +336,7 @@ private: // short-circuiting searches in the following scenarios: When a frame has // been searched and returned 0 results, we don't need to search that frame // again if the user is just adding to the search (making it more specific). - WebCore::String m_lastSearchString; + WTF::String m_lastSearchString; // Keeps track of how many matches this frame has found so far, so that we // don't loose count between scoping efforts, and is also used (in conjunction diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp index 265ef4f..3c3a1db 100644 --- a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp @@ -58,7 +58,7 @@ using WebCore::GeolocationServiceClient; using WebCore::Geoposition; using WebCore::PositionError; using WebCore::PositionOptions; -using WebCore::String; +using WTF::String; namespace WebKit { diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp index 00d819b..2a10c96 100644 --- a/WebKit/chromium/src/WebGeolocationServiceMock.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp @@ -50,7 +50,7 @@ using WebCore::GeolocationServiceMock; using WebCore::Geoposition; using WebCore::PositionError; using WebCore::PositionOptions; -using WebCore::String; +using WTF::String; namespace WebCore { class GeolocationServiceChromiumMock : public GeolocationServiceChromium, public GeolocationServiceClient { diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 47bb5a0..410ac3b 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -32,13 +32,13 @@ #if ENABLE(3D_CANVAS) -#include <stdio.h> -#include <string.h> - #include "WebGraphicsContext3DDefaultImpl.h" #include "NotImplemented.h" +#include <stdio.h> +#include <string.h> + #if OS(LINUX) #include <dlfcn.h> #endif diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index e409bf5..8223a1c 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -325,8 +325,8 @@ private: static bool s_initializedGLEW; #if OS(WINDOWS) - HWND m_canvasWindow; - HDC m_canvasDC; + HWND m_canvasWindow; + HDC m_canvasDC; HGLRC m_contextObj; #elif PLATFORM(CG) CGLPBufferObj m_pbuffer; diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp index d062576..fa75387 100644 --- a/WebKit/chromium/src/WebHTTPBody.cpp +++ b/WebKit/chromium/src/WebHTTPBody.cpp @@ -79,7 +79,7 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const result.type = Element::TypeData; result.data.assign(element.m_data.data(), element.m_data.size()); result.filePath.reset(); -#if ENABLE(BLOB_SLICE) +#if ENABLE(BLOB) result.fileStart = 0; result.fileLength = 0; result.fileInfo.modificationTime = 0.0; @@ -89,7 +89,7 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const result.type = Element::TypeFile; result.data.reset(); result.filePath = element.m_filename; -#if ENABLE(BLOB_SLICE) +#if ENABLE(BLOB) result.fileStart = element.m_fileStart; result.fileLength = element.m_fileLength; result.fileInfo.modificationTime = element.m_expectedFileModificationTime; @@ -123,7 +123,7 @@ void WebHTTPBody::appendFile(const WebString& filePath) void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo) { -#if ENABLE(BLOB_SLICE) +#if ENABLE(BLOB) ensureMutable(); m_private->appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime); #endif diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index dbf7d85..e543123 100644 --- a/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -27,6 +27,7 @@ #include "WebIDBCallbacksImpl.h" #include "IDBCallbacks.h" +#include "IDBCursorBackendProxy.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" #include "IDBIndexBackendProxy.h" @@ -65,6 +66,12 @@ void WebIDBCallbacksImpl::onSuccess() m_callbacks.clear(); } +void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBCursor* cursor) +{ + m_callbacks->onSuccess(IDBCursorBackendProxy::create(cursor)); + m_callbacks.clear(); +} + void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) { m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.h b/WebKit/chromium/src/WebIDBCallbacksImpl.h index a4d53b5..1835c60 100644 --- a/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -43,6 +43,7 @@ public: virtual void onError(const WebKit::WebIDBDatabaseError&); virtual void onSuccess(); // For "null". + virtual void onSuccess(WebKit::WebIDBCursor*); virtual void onSuccess(WebKit::WebIDBDatabase*); virtual void onSuccess(const WebKit::WebIDBKey&); virtual void onSuccess(WebKit::WebIDBIndex*); diff --git a/WebKit/chromium/src/WebIDBCursorImpl.cpp b/WebKit/chromium/src/WebIDBCursorImpl.cpp new file mode 100644 index 0000000..1ade687 --- /dev/null +++ b/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -0,0 +1,78 @@ +/* + * 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. + * + * 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 "WebIDBCursorImpl.h" + +#include "IDBAny.h" +#include "IDBCallbacksProxy.h" +#include "IDBCursorBackendInterface.h" +#include "IDBKey.h" +#include "WebIDBKey.h" + +using namespace WebCore; + +namespace WebKit { + +WebIDBCursorImpl::WebIDBCursorImpl(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend) + : m_idbCursorBackend(idbCursorBackend) +{ +} + +WebIDBCursorImpl::~WebIDBCursorImpl() +{ +} + +unsigned short WebIDBCursorImpl::direction() const +{ + return m_idbCursorBackend->direction(); +} + +WebIDBKey WebIDBCursorImpl::key() const +{ + return WebIDBKey(m_idbCursorBackend->key()); +} + +WebSerializedScriptValue WebIDBCursorImpl::value() const +{ + return m_idbCursorBackend->value()->serializedScriptValue(); +} + +void WebIDBCursorImpl::update(const WebSerializedScriptValue& value, WebIDBCallbacks* callbacks) +{ + m_idbCursorBackend->update(value, IDBCallbacksProxy::create(callbacks)); +} + +void WebIDBCursorImpl::continueFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks) +{ + m_idbCursorBackend->continueFunction(key, IDBCallbacksProxy::create(callbacks)); +} + +void WebIDBCursorImpl::remove(WebIDBCallbacks* callbacks) +{ + m_idbCursorBackend->remove(IDBCallbacksProxy::create(callbacks)); +} + +} // namespace WebCore diff --git a/WebKit/chromium/src/WebIDBCursorImpl.h b/WebKit/chromium/src/WebIDBCursorImpl.h new file mode 100644 index 0000000..565e86a --- /dev/null +++ b/WebKit/chromium/src/WebIDBCursorImpl.h @@ -0,0 +1,57 @@ +/* + * 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. + * + * 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 WebIDBCursorImpl_h +#define WebIDBCursorImpl_h + +#include "WebCommon.h" +#include "WebIDBCursor.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { class IDBCursorBackendInterface; } + +namespace WebKit { + +// See comment in WebIndexedObjectStore for a high level overview these classes. +class WebIDBCursorImpl : public WebIDBCursor { +public: + WebIDBCursorImpl(WTF::PassRefPtr<WebCore::IDBCursorBackendInterface>); + virtual ~WebIDBCursorImpl(); + + virtual unsigned short direction() const; + virtual WebIDBKey key() const; + virtual WebSerializedScriptValue value() const; + virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*); + virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*); + virtual void remove(WebIDBCallbacks*); + + private: + WTF::RefPtr<WebCore::IDBCursorBackendInterface> m_idbCursorBackend; +}; + +} // namespace WebKit + +#endif // WebIDBCursorImpl_h diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index e2f771a..8c8e30a 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -28,7 +28,7 @@ #include "DOMStringList.h" #include "IDBCallbacksProxy.h" -#include "IDBDatabase.h" +#include "IDBDatabaseBackendInterface.h" #include "WebIDBCallbacks.h" #include "WebIDBObjectStoreImpl.h" @@ -38,8 +38,8 @@ using namespace WebCore; namespace WebKit { -WebIDBDatabaseImpl::WebIDBDatabaseImpl(PassRefPtr<IDBDatabase> database) - : m_database(database) +WebIDBDatabaseImpl::WebIDBDatabaseImpl(PassRefPtr<IDBDatabaseBackendInterface> databaseBackend) + : m_databaseBackend(databaseBackend) { } @@ -49,32 +49,32 @@ WebIDBDatabaseImpl::~WebIDBDatabaseImpl() WebString WebIDBDatabaseImpl::name() const { - return m_database->name(); + return m_databaseBackend->name(); } WebString WebIDBDatabaseImpl::description() const { - return m_database->description(); + return m_databaseBackend->description(); } WebString WebIDBDatabaseImpl::version() const { - return m_database->version(); + return m_databaseBackend->version(); } WebDOMStringList WebIDBDatabaseImpl::objectStores() const { - return m_database->objectStores(); + return m_databaseBackend->objectStores(); } void WebIDBDatabaseImpl::createObjectStore(const WebString& name, const WebString& keyPath, bool autoIncrement, WebIDBCallbacks* callbacks) { - m_database->createObjectStore(name, keyPath, autoIncrement, IDBCallbacksProxy::create(callbacks)); + m_databaseBackend->createObjectStore(name, keyPath, autoIncrement, IDBCallbacksProxy::create(callbacks)); } WebIDBObjectStore* WebIDBDatabaseImpl::objectStore(const WebString& name, unsigned short mode) { - RefPtr<IDBObjectStore> objectStore = m_database->objectStore(name, mode); + RefPtr<IDBObjectStoreBackendInterface> objectStore = m_databaseBackend->objectStore(name, mode); if (!objectStore) return 0; return new WebIDBObjectStoreImpl(objectStore); @@ -82,7 +82,7 @@ WebIDBObjectStore* WebIDBDatabaseImpl::objectStore(const WebString& name, unsign void WebIDBDatabaseImpl::removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks) { - m_database->removeObjectStore(name, IDBCallbacksProxy::create(callbacks)); + m_databaseBackend->removeObjectStore(name, IDBCallbacksProxy::create(callbacks)); } } // namespace WebCore diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h index c83d8d7..46a6609 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -31,7 +31,7 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { class IDBDatabase; } +namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { @@ -40,7 +40,7 @@ class WebIDBObjectStore; // See comment in WebIndexedDatabase for a high level overview these classes. class WebIDBDatabaseImpl : public WebIDBDatabase { public: - WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabase> database); + WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>); virtual ~WebIDBDatabaseImpl(); virtual WebString name() const; @@ -53,7 +53,7 @@ public: virtual void removeObjectStore(const WebString& name, WebIDBCallbacks* callbacks); private: - WTF::RefPtr<WebCore::IDBDatabase> m_database; + WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebIDBKeyRange.cpp b/WebKit/chromium/src/WebIDBKeyRange.cpp new file mode 100644 index 0000000..4ce9452 --- /dev/null +++ b/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -0,0 +1,83 @@ +/* + * 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. + * + * 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 "WebIDBKeyRange.h" + +#include "IDBKey.h" +#include "IDBKeyRange.h" +#include "WebIDBKey.h" + +using WebCore::IDBKeyRange; + +namespace WebKit { + +void WebIDBKeyRange::assign(const WebIDBKeyRange& other) +{ + m_private = other.m_private; +} + +void WebIDBKeyRange::assign(const WebIDBKey& left, const WebIDBKey& right, unsigned short flags) +{ + m_private = IDBKeyRange::create(left, right, flags); +} + +void WebIDBKeyRange::reset() +{ + m_private.reset(); +} + +WebIDBKey WebIDBKeyRange::left() const +{ + return m_private->left(); +} + +WebIDBKey WebIDBKeyRange::right() const +{ + return m_private->right(); +} + +unsigned short WebIDBKeyRange::flags() const +{ + return m_private->flags(); +} + +WebIDBKeyRange::WebIDBKeyRange(const PassRefPtr<IDBKeyRange>& value) + : m_private(value) +{ +} + +WebIDBKeyRange& WebIDBKeyRange::operator=(const PassRefPtr<IDBKeyRange>& value) +{ + m_private = value; + return *this; +} + +WebIDBKeyRange::operator PassRefPtr<IDBKeyRange>() const +{ + return m_private.get(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 7b6a32a..1ad1d9f 100755 --- a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -28,9 +28,11 @@ #include "DOMStringList.h" #include "IDBCallbacksProxy.h" -#include "IDBObjectStore.h" +#include "IDBKeyRange.h" +#include "IDBObjectStoreBackendInterface.h" #include "WebIDBIndexImpl.h" #include "WebIDBKey.h" +#include "WebIDBKeyRange.h" #include "WebSerializedScriptValue.h" #if ENABLE(INDEXED_DATABASE) @@ -39,7 +41,7 @@ using namespace WebCore; namespace WebKit { -WebIDBObjectStoreImpl::WebIDBObjectStoreImpl(PassRefPtr<IDBObjectStore> objectStore) +WebIDBObjectStoreImpl::WebIDBObjectStoreImpl(PassRefPtr<IDBObjectStoreBackendInterface> objectStore) : m_objectStore(objectStore) { } @@ -96,6 +98,11 @@ void WebIDBObjectStoreImpl::removeIndex(const WebString& name, WebIDBCallbacks* m_objectStore->removeIndex(name, IDBCallbacksProxy::create(callbacks)); } +void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks) +{ + m_objectStore->openCursor(IDBKeyRange::create(keyRange.left(), keyRange.right(), keyRange.flags()), direction, IDBCallbacksProxy::create(callbacks)); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 4064b7f..9f31369 100755 --- a/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -31,7 +31,7 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { class IDBObjectStore; } +namespace WebCore { class IDBObjectStoreBackendInterface; } namespace WebKit { @@ -40,7 +40,7 @@ class WebIDBIndex; // See comment in WebIndexedObjectStore for a high level overview these classes. class WebIDBObjectStoreImpl : public WebIDBObjectStore { public: - WebIDBObjectStoreImpl(WTF::PassRefPtr<WebCore::IDBObjectStore> objectStore); + WebIDBObjectStoreImpl(WTF::PassRefPtr<WebCore::IDBObjectStoreBackendInterface>); ~WebIDBObjectStoreImpl(); WebString name() const; @@ -55,8 +55,10 @@ public: WebIDBIndex* index(const WebString& name); void removeIndex(const WebString& name, WebIDBCallbacks* callbacks); + void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*); + private: - WTF::RefPtr<WebCore::IDBObjectStore> m_objectStore; + WTF::RefPtr<WebCore::IDBObjectStoreBackendInterface> m_objectStore; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp index 1c6d59c..f47a4e8 100644 --- a/WebKit/chromium/src/WebInputEventConversion.cpp +++ b/WebKit/chromium/src/WebInputEventConversion.cpp @@ -104,7 +104,7 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo // MakePlatformKeyboardEvent -------------------------------------------------- -static inline const PlatformKeyboardEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type) +static inline PlatformKeyboardEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type) { switch (type) { case WebInputEvent::KeyUp: diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp index 8346ef8..1d717ea 100644 --- a/WebKit/chromium/src/WebKit.cpp +++ b/WebKit/chromium/src/WebKit.cpp @@ -57,7 +57,7 @@ void initialize(WebKitClient* webKitClient) WTF::initializeThreading(); WTF::initializeMainThread(); - WebCore::AtomicString::init(); + WTF::AtomicString::init(); // Chromium sets the minimum interval timeout to 4ms, overriding the // default of 10ms. We'd like to go lower, however there are poorly diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index 2b0c9a7..8f210a0 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -126,6 +126,10 @@ void WebMediaPlayerClientImpl::timeChanged() void WebMediaPlayerClientImpl::repaint() { ASSERT(m_mediaPlayer); +#if USE(ACCELERATED_COMPOSITING) + if (m_videoLayer.get() && supportsAcceleratedRendering()) + m_videoLayer->setNeedsDisplay(FloatRect(0, 0, m_videoLayer->bounds().width(), m_videoLayer->bounds().height())); +#endif m_mediaPlayer->repaint(); } diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 0faac26..df179a8 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -70,7 +70,7 @@ public: virtual float volume() const; // MediaPlayerPrivateInterface methods: - virtual void load(const WebCore::String& url); + virtual void load(const WTF::String& url); virtual void cancelLoad(); #if USE(ACCELERATED_COMPOSITING) virtual WebCore::PlatformLayer* platformLayer() const; @@ -114,9 +114,9 @@ private: WebMediaPlayerClientImpl(); static WebCore::MediaPlayerPrivateInterface* create(WebCore::MediaPlayer*); - static void getSupportedTypes(WTF::HashSet<WebCore::String>&); + static void getSupportedTypes(WTF::HashSet<WTF::String>&); static WebCore::MediaPlayer::SupportsType supportsType( - const WebCore::String& type, const WebCore::String& codecs); + const WTF::String& type, const WTF::String& codecs); WebCore::MediaPlayer* m_mediaPlayer; OwnPtr<WebMediaPlayer> m_webMediaPlayer; diff --git a/WebKit/chromium/src/WebPageSerializerImpl.h b/WebKit/chromium/src/WebPageSerializerImpl.h index 8f6a99f..03f0a3b 100644 --- a/WebKit/chromium/src/WebPageSerializerImpl.h +++ b/WebKit/chromium/src/WebPageSerializerImpl.h @@ -32,10 +32,11 @@ #define WebPageSerializerImpl_h #include "PlatformString.h" -#include "StringBuilder.h" #include "StringHash.h" +#include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/Vector.h> +#include "StringBuilder.h" #include "WebEntities.h" #include "WebPageSerializer.h" @@ -47,7 +48,6 @@ namespace WebCore { class Document; class Element; class Node; -class String; class TextEncoding; } @@ -93,7 +93,7 @@ private: WebPageSerializerClient* m_client; // This hash map is used to map resource URL of original link to its local // file path. - typedef HashMap<WebCore::String, WebCore::String> LinkLocalPathMap; + typedef HashMap<WTF::String, WTF::String> LinkLocalPathMap; // local_links_ include all pair of local resource path and corresponding // original link. LinkLocalPathMap m_localLinks; @@ -107,7 +107,7 @@ private: // serialized or not; bool m_framesCollected; // Local directory name of all local resource files. - WebCore::String m_localDirectoryName; + WTF::String m_localDirectoryName; // Vector for saving all frames which need to be serialized. Vector<WebFrameImpl*> m_frames; @@ -124,7 +124,7 @@ private: // Document object of current frame. WebCore::Document* doc; // Local directory name of all local resource files. - const WebCore::String& directoryName; + const WTF::String& directoryName; // Flag indicates current doc is html document or not. It's a cache value // of Document.isHTMLDocument(). @@ -151,31 +151,31 @@ private: SerializeDomParam(const WebCore::KURL& currentFrameURL, const WebCore::TextEncoding& textEncoding, WebCore::Document* doc, - const WebCore::String& directoryName); + const WTF::String& directoryName); }; // Collect all target frames which need to be serialized. void collectTargetFrames(); // Before we begin serializing open tag of a element, we give the target // element a chance to do some work prior to add some additional data. - WebCore::String preActionBeforeSerializeOpenTag(const WebCore::Element* element, + WTF::String preActionBeforeSerializeOpenTag(const WebCore::Element* element, SerializeDomParam* param, bool* needSkip); // After we finish serializing open tag of a element, we give the target // element a chance to do some post work to add some additional data. - WebCore::String postActionAfterSerializeOpenTag(const WebCore::Element* element, + WTF::String postActionAfterSerializeOpenTag(const WebCore::Element* element, SerializeDomParam* param); // Before we begin serializing end tag of a element, we give the target // element a chance to do some work prior to add some additional data. - WebCore::String preActionBeforeSerializeEndTag(const WebCore::Element* element, + WTF::String preActionBeforeSerializeEndTag(const WebCore::Element* element, SerializeDomParam* param, bool* needSkip); // After we finish serializing end tag of a element, we give the target // element a chance to do some post work to add some additional data. - WebCore::String postActionAfterSerializeEndTag(const WebCore::Element* element, + WTF::String postActionAfterSerializeEndTag(const WebCore::Element* element, SerializeDomParam* param); // Save generated html content to data buffer. - void saveHTMLContentToBuffer(const WebCore::String& content, + void saveHTMLContentToBuffer(const WTF::String& content, SerializeDomParam* param); // Flushes the content buffer by encoding and sending the content to the // WebPageSerializerClient. Content is not flushed if the buffer is not full diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp index 217553b..9e21d58 100644 --- a/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -226,6 +226,16 @@ bool WebRuntimeFeatures::isTouchEnabled() #endif } +void WebRuntimeFeatures::enableDeviceMotion(bool enable) +{ + RuntimeEnabledFeatures::setDeviceMotionEnabled(enable); +} + +bool WebRuntimeFeatures::isDeviceMotionEnabled() +{ + return RuntimeEnabledFeatures::deviceMotionEnabled(); +} + void WebRuntimeFeatures::enableDeviceOrientation(bool enable) { RuntimeEnabledFeatures::setDeviceOrientationEnabled(enable); diff --git a/WebKit/chromium/src/ProfilerAgentImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 07570df..6b04320 100644 --- a/WebKit/chromium/src/ProfilerAgentImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -29,24 +29,58 @@ */ #include "config.h" -#include "ProfilerAgentImpl.h" +#include "WebSpeechInputControllerMockImpl.h" -#include <v8.h> +#include "PlatformString.h" +#include "SpeechInputClientMock.h" namespace WebKit { -void ProfilerAgentImpl::getActiveProfilerModules() +WebSpeechInputControllerMock* WebSpeechInputControllerMock::create(WebSpeechInputListener* listener) { - m_delegate->didGetActiveProfilerModules(v8::V8::GetActiveProfilerModules()); + return new WebSpeechInputControllerMockImpl(listener); } -void ProfilerAgentImpl::getLogLines(int position) +WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl( + WebSpeechInputListener* listener) + : m_webcoreMock(new WebCore::SpeechInputClientMock()) + , m_listener(listener) { - static char buffer[65536]; - const int readSize = v8::V8::GetLogLines(position, buffer, sizeof(buffer) - 1); - buffer[readSize] = '\0'; - position += readSize; - m_delegate->didGetLogLines(position, buffer); +} + +void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result) +{ + m_webcoreMock->setRecognitionResult(result); +} + +void WebSpeechInputControllerMockImpl::didCompleteRecording() +{ + m_listener->didCompleteRecording(); +} + +void WebSpeechInputControllerMockImpl::didCompleteRecognition() +{ + m_listener->didCompleteRecognition(); +} + +void WebSpeechInputControllerMockImpl::setRecognitionResult(const WTF::String& result) +{ + m_listener->setRecognitionResult(result); +} + +bool WebSpeechInputControllerMockImpl::startRecognition() +{ + return m_webcoreMock->startRecognition(this); +} + +void WebSpeechInputControllerMockImpl::cancelRecognition() +{ + m_webcoreMock->cancelRecognition(); +} + +void WebSpeechInputControllerMockImpl::stopRecording() +{ + m_webcoreMock->stopRecording(); } } // namespace WebKit diff --git a/WebKit/chromium/src/ProfilerAgentImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index d38f57c..046abf3 100644 --- a/WebKit/chromium/src/ProfilerAgentImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -28,30 +28,45 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ProfilerAgentImpl_h -#define ProfilerAgentImpl_h +#ifndef WebSpeechInputControllerMockImpl_h +#define WebSpeechInputControllerMockImpl_h -#include "ProfilerAgent.h" +#include "SpeechInputListener.h" +#include "WebSpeechInputControllerMock.h" +#include "WebSpeechInputListener.h" +#include "WebString.h" +#include <wtf/OwnPtr.h> + +namespace WebCore { +class SpeechInputClientMock; +} namespace WebKit { -class ProfilerAgentImpl : public ProfilerAgent { +class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener + , public WebSpeechInputControllerMock { public: - ProfilerAgentImpl(ProfilerAgentDelegate* delegate) : m_delegate(delegate) { } - virtual ~ProfilerAgentImpl() { } + WebSpeechInputControllerMockImpl(WebSpeechInputListener*); - // ProfilerAgent implementation. + // WebCore::SpeechInputListener methods. + void didCompleteRecording(); + void didCompleteRecognition(); + void setRecognitionResult(const WTF::String& result); - // This method is called on IO thread. - virtual void getActiveProfilerModules(); + // WebSpeechInputController methods. + bool startRecognition(); + void cancelRecognition(); + void stopRecording(); - // This method is called on IO thread. - virtual void getLogLines(int position); + // WebSpeechInputControllerMock methods. + void setMockRecognitionResult(const WebString& result); private: - ProfilerAgentDelegate* m_delegate; + OwnPtr<WebCore::SpeechInputClientMock> m_webcoreMock; + WebSpeechInputListener* m_listener; }; } // namespace WebKit -#endif +#endif // WebSpeechInputControllerMockImpl_h + diff --git a/WebKit/chromium/src/WebStorageNamespaceImpl.cpp b/WebKit/chromium/src/WebStorageNamespaceImpl.cpp index 5fc6e16..53b4a75 100644 --- a/WebKit/chromium/src/WebStorageNamespaceImpl.cpp +++ b/WebKit/chromium/src/WebStorageNamespaceImpl.cpp @@ -61,7 +61,7 @@ WebStorageNamespaceImpl::~WebStorageNamespaceImpl() WebStorageArea* WebStorageNamespaceImpl::createStorageArea(const WebString& originString) { - WebCore::String originWebCoreString = originString; + WTF::String originWebCoreString = originString; if (originWebCoreString == "file://") { // FIXME: We should really be passing around WebSecurityOrigin objects // to represent security origins instead of strings. One issue diff --git a/WebKit/chromium/src/WebString.cpp b/WebKit/chromium/src/WebString.cpp index a61a059..bbbe9ce 100644 --- a/WebKit/chromium/src/WebString.cpp +++ b/WebKit/chromium/src/WebString.cpp @@ -39,7 +39,7 @@ namespace WebKit { -class WebStringPrivate : public WebCore::StringImpl { +class WebStringPrivate : public WTF::StringImpl { }; void WebString::reset() @@ -58,7 +58,7 @@ void WebString::assign(const WebString& other) void WebString::assign(const WebUChar* data, size_t length) { assign(static_cast<WebStringPrivate*>( - WebCore::StringImpl::create(data, length).get())); + WTF::StringImpl::create(data, length).get())); } size_t WebString::length() const @@ -73,17 +73,17 @@ const WebUChar* WebString::data() const WebCString WebString::utf8() const { - return WebCore::String(m_private).utf8(); + return WTF::String(m_private).utf8(); } WebString WebString::fromUTF8(const char* data, size_t length) { - return WebCore::String::fromUTF8(data, length); + return WTF::String::fromUTF8(data, length); } WebString WebString::fromUTF8(const char* data) { - return WebCore::String::fromUTF8(data); + return WTF::String::fromUTF8(data); } bool WebString::equals(const WebString& s) const @@ -91,39 +91,39 @@ bool WebString::equals(const WebString& s) const return equal(m_private, s.m_private); } -WebString::WebString(const WebCore::String& s) +WebString::WebString(const WTF::String& s) : m_private(static_cast<WebStringPrivate*>(s.impl())) { if (m_private) m_private->ref(); } -WebString& WebString::operator=(const WebCore::String& s) +WebString& WebString::operator=(const WTF::String& s) { assign(static_cast<WebStringPrivate*>(s.impl())); return *this; } -WebString::operator WebCore::String() const +WebString::operator WTF::String() const { return m_private; } -WebString::WebString(const WebCore::AtomicString& s) +WebString::WebString(const WTF::AtomicString& s) : m_private(0) { assign(s.string()); } -WebString& WebString::operator=(const WebCore::AtomicString& s) +WebString& WebString::operator=(const WTF::AtomicString& s) { assign(s.string()); return *this; } -WebString::operator WebCore::AtomicString() const +WebString::operator WTF::AtomicString() const { - return WebCore::AtomicString(static_cast<WebCore::StringImpl *>(m_private)); + return WTF::AtomicString(static_cast<WTF::StringImpl *>(m_private)); } void WebString::assign(WebStringPrivate* p) diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 691f143..8733a2a 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -41,6 +41,7 @@ #include "CSSStyleSelector.h" #include "CSSValueKeywords.h" #include "Cursor.h" +#include "DeviceOrientationClientProxy.h" #include "Document.h" #include "DocumentLoader.h" #include "DOMUtilitiesPrivate.h" @@ -177,8 +178,8 @@ static const PopupContainerSettings autoFillPopupSettings = { WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient) { - // Keep runtime flag for device orientation turned off until it's implemented. - WebRuntimeFeatures::enableDeviceOrientation(false); + // 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)).leakRef(); @@ -266,6 +267,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_speechInputClient(client) #endif , m_gles2Context(0) + , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0)) { // WebKit/win/WebView.cpp does the same thing, except they call the // KJS specific wrapper around this method. We need to have threading @@ -288,9 +290,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools #if ENABLE(INPUT_SPEECH) pageClients.speechInputClient = &m_speechInputClient; #endif - m_page.set(new Page(pageClients)); + pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get(); - // the page will take ownership of the various clients + m_page.set(new Page(pageClients)); m_page->backForwardList()->setClient(&m_backForwardListClientImpl); m_page->setGroupName(pageGroupName); @@ -911,6 +913,13 @@ void WebViewImpl::resize(const WebSize& newSize) WebRect damagedRect(0, 0, m_size.width, m_size.height); m_client->didInvalidateRect(damagedRect); } + +#if OS(DARWIN) + if (m_gles2Context) { + m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width), + std::max(1, m_size.height))); + } +#endif } void WebViewImpl::layout() @@ -2154,6 +2163,22 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) rootLayerContext->restore(); platformCanvas->restore(); +#elif PLATFORM(CG) + CGContextRef cgContext = rootLayerContext->platformContext(); + + CGContextSaveGState(cgContext); + + // Bring the CoreGraphics context into the coordinate system of the paint rect. + CGContextTranslateCTM(cgContext, -rect.x, -rect.y); + + rootLayerContext->save(); + + webframe->paintWithContext(*rootLayerContext, rect); + rootLayerContext->restore(); + + CGContextRestoreGState(cgContext); +#else +#error Must port to your platform #endif } } @@ -2203,6 +2228,11 @@ WebGLES2Context* WebViewImpl::gles2Context() m_gles2Context.clear(); return 0; } + +#if OS(DARWIN) + m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width), + std::max(1, m_size.height))); +#endif } return m_gles2Context.get(); } diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index 530fbf5..c296121 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -71,6 +71,7 @@ namespace WebKit { class AutocompletePopupMenuClient; class AutoFillPopupMenuClient; class ContextMenuClientImpl; +class DeviceOrientationClientProxy; class DragScrollTimer; class WebAccessibilityObject; class WebDevToolsAgentClient; @@ -496,7 +497,7 @@ private: // Inspector settings. WebString m_inspectorSettings; - typedef HashMap<WebCore::String, WebCore::String> SettingsMap; + typedef HashMap<WTF::String, WTF::String> SettingsMap; OwnPtr<SettingsMap> m_inspectorSettingsMap; OwnPtr<DragScrollTimer> m_dragScrollTimer; @@ -519,6 +520,8 @@ private: #endif OwnPtr<WebGLES2Context> m_gles2Context; + + OwnPtr<DeviceOrientationClientProxy> m_deviceOrientationClientProxy; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp index 9593f5f..42f41d2 100644 --- a/WebKit/chromium/src/WebWorkerBase.cpp +++ b/WebKit/chromium/src/WebWorkerBase.cpp @@ -63,7 +63,7 @@ namespace { // call back to the worker context. class AllowDatabaseMainThreadBridge : public ThreadSafeShared<AllowDatabaseMainThreadBridge> { public: - static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebWorkerBase* worker, const WebCore::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String& name, const WebCore::String& displayName, unsigned long estimatedSize) + 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) { return adoptRef(new AllowDatabaseMainThreadBridge(worker, mode, commonClient, frame, name, displayName, estimatedSize)); } @@ -89,14 +89,14 @@ public: } private: - AllowDatabaseMainThreadBridge(WebWorkerBase* worker, const WebCore::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String& name, const WebCore::String& displayName, unsigned long estimatedSize) + AllowDatabaseMainThreadBridge(WebWorkerBase* worker, const WTF::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WTF::String& name, const WTF::String& displayName, unsigned long estimatedSize) : m_worker(worker) , m_mode(mode) { worker->dispatchTaskToMainThread(createCallbackTask(&allowDatabaseTask, commonClient, frame, String(name), String(displayName), estimatedSize, this)); } - static void allowDatabaseTask(WebCore::ScriptExecutionContext* context, WebCommonWorkerClient* commonClient, WebFrame* frame, const WebCore::String name, const WebCore::String displayName, unsigned long estimatedSize, PassRefPtr<AllowDatabaseMainThreadBridge> bridge) + static void allowDatabaseTask(WebCore::ScriptExecutionContext* context, WebCommonWorkerClient* commonClient, WebFrame* frame, const WTF::String name, const WTF::String displayName, unsigned long estimatedSize, PassRefPtr<AllowDatabaseMainThreadBridge> bridge) { if (!commonClient) bridge->signalCompleted(false); @@ -112,7 +112,7 @@ private: bool m_result; Mutex m_mutex; WebWorkerBase* m_worker; - WebCore::String m_mode; + WTF::String m_mode; }; } diff --git a/WebKit/chromium/src/WebWorkerBase.h b/WebKit/chromium/src/WebWorkerBase.h index 15e8013..22711f9 100644 --- a/WebKit/chromium/src/WebWorkerBase.h +++ b/WebKit/chromium/src/WebWorkerBase.h @@ -70,10 +70,10 @@ public: PassRefPtr<WebCore::SerializedScriptValue>, PassOwnPtr<WebCore::MessagePortChannelArray>); virtual void postExceptionToWorkerObject( - const WebCore::String&, int, const WebCore::String&); + const WTF::String&, int, const WTF::String&); virtual void postConsoleMessageToWorkerObject( WebCore::MessageSource, WebCore::MessageType, - WebCore::MessageLevel, const WebCore::String&, int, const WebCore::String&); + WebCore::MessageLevel, const WTF::String&, int, const WTF::String&); virtual void confirmMessageFromWorkerObject(bool); virtual void reportPendingActivity(bool); virtual void workerContextClosed(); @@ -82,7 +82,7 @@ public: // WebCore::WorkerLoaderProxy methods: virtual void postTaskToLoader(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); virtual void postTaskForModeToWorkerContext( - PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const WebCore::String& mode); + PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const WTF::String& mode); // WebFrameClient methods to support resource loading thru the 'shadow page'. virtual void didCreateDataSource(WebFrame*, WebDataSource*); @@ -115,23 +115,23 @@ private: static void postMessageTask( WebCore::ScriptExecutionContext* context, WebWorkerBase* thisPtr, - WebCore::String message, + WTF::String message, PassOwnPtr<WebCore::MessagePortChannelArray> channels); static void postExceptionTask( WebCore::ScriptExecutionContext* context, WebWorkerBase* thisPtr, - const WebCore::String& message, + const WTF::String& message, int lineNumber, - const WebCore::String& sourceURL); + const WTF::String& sourceURL); static void postConsoleMessageTask( WebCore::ScriptExecutionContext* context, WebWorkerBase* thisPtr, int source, int type, int level, - const WebCore::String& message, + const WTF::String& message, int lineNumber, - const WebCore::String& sourceURL); + const WTF::String& sourceURL); static void confirmMessageTask( WebCore::ScriptExecutionContext* context, WebWorkerBase* thisPtr, diff --git a/WebKit/chromium/src/WebWorkerClientImpl.h b/WebKit/chromium/src/WebWorkerClientImpl.h index 758c376..741d606 100644 --- a/WebKit/chromium/src/WebWorkerClientImpl.h +++ b/WebKit/chromium/src/WebWorkerClientImpl.h @@ -64,8 +64,8 @@ public: // process, this will be the main WebKit thread. In the worker process, this // will be the thread of the executing worker (not the main WebKit thread). virtual void startWorkerContext(const WebCore::KURL&, - const WebCore::String&, - const WebCore::String&); + const WTF::String&, + const WTF::String&); virtual void terminateWorkerContext(); virtual void postMessageToWorkerContext( PassRefPtr<WebCore::SerializedScriptValue> message, @@ -108,14 +108,14 @@ private: // These tasks are dispatched on the WebKit thread. static void startWorkerContextTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr, - const WebCore::String& scriptURL, - const WebCore::String& userAgent, - const WebCore::String& sourceCode); + const WTF::String& scriptURL, + const WTF::String& userAgent, + const WTF::String& sourceCode); static void terminateWorkerContextTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr); static void postMessageToWorkerContextTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr, - const WebCore::String& message, + const WTF::String& message, PassOwnPtr<WebCore::MessagePortChannelArray> channels); static void workerObjectDestroyedTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr); @@ -125,21 +125,21 @@ private: // worker process). static void postMessageToWorkerObjectTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr, - const WebCore::String& message, + const WTF::String& message, PassOwnPtr<WebCore::MessagePortChannelArray> channels); static void postExceptionToWorkerObjectTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr, - const WebCore::String& message, + const WTF::String& message, int lineNumber, - const WebCore::String& sourceURL); + const WTF::String& sourceURL); static void postConsoleMessageToWorkerObjectTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr, int sourceId, int messageType, int messageLevel, - const WebCore::String& message, + const WTF::String& message, int lineNumber, - const WebCore::String& sourceURL); + const WTF::String& sourceURL); static void confirmMessageFromWorkerObjectTask(WebCore::ScriptExecutionContext* context, WebWorkerClientImpl* thisPtr); static void reportPendingActivityTask(WebCore::ScriptExecutionContext* context, diff --git a/WebKit/chromium/src/WebWorkerImpl.h b/WebKit/chromium/src/WebWorkerImpl.h index bec96cd..d2fd016 100644 --- a/WebKit/chromium/src/WebWorkerImpl.h +++ b/WebKit/chromium/src/WebWorkerImpl.h @@ -69,7 +69,7 @@ private: static void postMessageToWorkerContextTask( WebCore::ScriptExecutionContext* context, WebWorkerImpl* thisPtr, - const WebCore::String& message, + const WTF::String& message, PassOwnPtr<WebCore::MessagePortChannelArray> channels); WebWorkerClient* m_client; diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 674f1d7..895c68b 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -41,44 +41,22 @@ * @prama {string} methodName * @param {string} param1, param2, param3 Arguments to dispatch. */ -devtools$$dispatch = function(remoteName, methodName, param1, param2, param3) +devtools$$dispatch = function(message) { - remoteName = "Remote" + remoteName.substring(0, remoteName.length - 8); - var agent = window[remoteName]; - if (!agent) { - debugPrint("No remote agent '" + remoteName + "' found."); - return; - } - var method = agent[methodName]; - if (!method) { - debugPrint("No method '" + remoteName + "." + methodName + "' found."); - return; - } - method.call(this, param1, param2, param3); + var args = typeof message === "string" ? JSON.parse(message) : message; + var methodName = args[0]; + var parameters = args.slice(1); + WebInspector[methodName].apply(WebInspector, parameters); }; devtools.ToolsAgent = function() { - RemoteToolsAgent.didDispatchOn = WebInspector.Callback.processCallback; - RemoteToolsAgent.dispatchOnClient = this.dispatchOnClient_.bind(this); this.profilerAgent_ = new devtools.ProfilerAgent(); }; /** - * @param {string} script Script exression to be evaluated in the context of the - * inspected page. - * @param {function(Object|string, boolean):undefined} opt_callback Function to - * call with the result. - */ -devtools.ToolsAgent.prototype.evaluateJavaScript = function(script, opt_callback) -{ - InspectorBackend.evaluate(script, opt_callback || function() {}); -}; - - -/** * @return {devtools.ProfilerAgent} Profiler agent instance. */ devtools.ToolsAgent.prototype.getProfilerAgent = function() @@ -87,38 +65,6 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function() }; -/** - * @param {string} message Serialized call to be dispatched on WebInspector. - * @private - */ -devtools.ToolsAgent.prototype.dispatchOnClient_ = function(message) -{ - var args = typeof message === "string" ? JSON.parse(message) : message; - var methodName = args[0]; - var parameters = args.slice(1); - WebInspector[methodName].apply(WebInspector, parameters); -}; - - -/** - * Evaluates js expression. - * @param {string} expr - */ -devtools.ToolsAgent.prototype.evaluate = function(expr) -{ - RemoteToolsAgent.evaluate(expr); -}; - - -/** - * Prints string to the inspector console or shows alert if the console doesn't - * exist. - * @param {string} text - */ -function debugPrint(text) { - WebInspector.log(text); -} - /** * Global instance of the tools agent. @@ -142,13 +88,15 @@ var context = {}; // Used by WebCore's inspector routines. } if ("page" in WebInspector._paramsObject) { WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page); - WebInspector.socket.onmessage = function(message) { eval(message.data); } + WebInspector.socket.onmessage = function(message) { devtools$$dispatch(message.data); } WebInspector.socket.onerror = function(error) { console.err(error); } WebInspector.socket.onopen = function() { WebInspector.socketOpened = true; if (WebInspector.loadedDone) WebInspector.doLoadedDone(); }; + InspectorFrontendHost.sendMessageToBackend = WebInspector.socket.send.bind(WebInspector.socket); + InspectorFrontendHost.loaded = WebInspector.socket.send.bind(WebInspector.socket, "loaded"); } })(); /////////////////////////////////////////////////////////////////////////////// @@ -165,7 +113,7 @@ WebInspector.loaded = function() Preferences.debuggerAlwaysEnabled = true; Preferences.profilerAlwaysEnabled = true; Preferences.canEditScriptSource = true; - + Preferences.onlineDetectionEnabled = false; if ("page" in WebInspector._paramsObject) { WebInspector.loadedDone = true; if (WebInspector.socketOpened) @@ -177,7 +125,6 @@ WebInspector.loaded = function() WebInspector.doLoadedDone = function() { oldLoaded.call(this); - InspectorFrontendHost.loaded(); } devtools.domContentLoaded = function() diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js index 52b28bb..d3333e2 100644 --- a/WebKit/chromium/src/js/DevToolsHostStub.js +++ b/WebKit/chromium/src/js/DevToolsHostStub.js @@ -35,8 +35,4 @@ if (!window["RemoteDebuggerCommandExecutor"]) { window["RemoteDebuggerCommandExecutor"] = {}; - window["RemoteProfilerAgent"] = {}; - window["RemoteToolsAgent"] = { - dispatchOnInspectorController: function() {} - }; } diff --git a/WebKit/chromium/src/js/ProfilerAgent.js b/WebKit/chromium/src/js/ProfilerAgent.js index 0b65ace..7f74595 100644 --- a/WebKit/chromium/src/js/ProfilerAgent.js +++ b/WebKit/chromium/src/js/ProfilerAgent.js @@ -37,8 +37,6 @@ */ devtools.ProfilerAgent = function() { - RemoteProfilerAgent.didGetActiveProfilerModules = this._didGetActiveProfilerModules.bind(this); - RemoteProfilerAgent.didGetLogLines = this._didGetLogLines.bind(this); /** * Profiler log position. @@ -92,10 +90,17 @@ devtools.ProfilerAgent.prototype._getNextLogLines = function(immediately) if (this._lastRequestedLogPosition == this._logPosition) return; var pos = this._lastRequestedLogPosition = this._logPosition; + + var callId = WebInspector.Callback.wrap(this._didGetProfilerLogLines.bind(this)); if (immediately) - RemoteProfilerAgent.getLogLines(pos); - else - setTimeout(function() { RemoteProfilerAgent.getLogLines(pos); }, 500); + InspectorBackend.getProfilerLogLines(callId, pos); + else { + function delayedRequest() + { + InspectorBackend.getProfilerLogLines(callId, pos); + } + setTimeout(delayedRequest, 500); + } }; @@ -114,20 +119,11 @@ devtools.ProfilerAgent.prototype.startProfiling = function(modules) /** - * Handles current profiler status. - * @param {number} modules List of active (started) modules. - */ -devtools.ProfilerAgent.prototype._didGetActiveProfilerModules = function(modules) -{ -}; - - -/** * Handles a portion of a profiler log retrieved by getLogLines call. * @param {number} pos Current position in log. * @param {string} log A portion of profiler log. */ -devtools.ProfilerAgent.prototype._didGetLogLines = function(pos, log) +devtools.ProfilerAgent.prototype._didGetProfilerLogLines = function(pos, log) { this._logPosition = pos; if (log.length > 0) { @@ -138,3 +134,5 @@ devtools.ProfilerAgent.prototype._didGetLogLines = function(pos, log) this._lastRequestedLogPosition = this._logPosition - 1; } }; + +WebInspector.didGetProfilerLogLines = WebInspector.Callback.processCallback; diff --git a/WebKit/chromium/src/js/ProfilerProcessor.js b/WebKit/chromium/src/js/ProfilerProcessor.js index f678d2c..61714e8 100644 --- a/WebKit/chromium/src/js/ProfilerProcessor.js +++ b/WebKit/chromium/src/js/ProfilerProcessor.js @@ -281,7 +281,7 @@ devtools.profiler.Processor.prototype.__proto__ = devtools.profiler.LogReader.pr */ devtools.profiler.Processor.prototype.printError = function(str) { - debugPrint(str); + WebInspector.log(str); }; diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index e2ab3b3..764f624 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -261,10 +261,10 @@ TestSuite.prototype.testEnableResourcesTab = function() var test = this; this.addSniffer(WebInspector, "updateResource", - function(identifier, payload) { + function(payload) { test.assertEquals("simple_page.html", payload.lastPathComponent); WebInspector.panels.resources.refresh(); - WebInspector.panels.resources.revealAndSelectItem(WebInspector.resources[identifier]); + WebInspector.panels.resources.revealAndSelectItem(WebInspector.resources[payload.id]); test.releaseControl(); }); @@ -289,10 +289,10 @@ TestSuite.prototype.testResourceContentLength = function() var png = false; var html = false; this.addSniffer(WebInspector, "updateResource", - function(identifier, payload) { + function(payload) { if (!payload.didLengthChange) return; - var resource = WebInspector.resources[identifier]; + var resource = WebInspector.resources[payload.id]; if (!resource || !resource.url) return; if (resource.url.search("image.html") !== -1) { @@ -346,8 +346,8 @@ TestSuite.prototype.testResourceHeaders = function() var timingOk = false; this.addSniffer(WebInspector, "updateResource", - function(identifier, payload) { - var resource = this.resources[identifier]; + function(payload) { + var resource = this.resources[payload.id]; if (!resource || resource.mainResource) { // We are only interested in secondary resources in this test. return; @@ -393,8 +393,8 @@ TestSuite.prototype.testCachedResourceMimeType = function() var hasReloaded = false; this.addSniffer(WebInspector, "updateResource", - function(identifier, payload) { - var resource = this.resources[identifier]; + function(payload) { + var resource = this.resources[payload.id]; if (!resource || resource.mainResource) { // We are only interested in secondary resources in this test. return; @@ -1845,8 +1845,37 @@ uiTests.runAllTests = function() */ uiTests.runTest = function(name) { - new TestSuite().runTest(name); + if (uiTests._populatedInterface) + new TestSuite().runTest(name); + else + uiTests._pendingTestName = name; }; +(function() { + +function runTests() +{ + uiTests._populatedInterface = true; + var name = uiTests._pendingTestName; + delete uiTests._pendingTestName; + if (name) + new TestSuite().runTest(name); +} + +var oldShowElementsPanel = WebInspector.showElementsPanel; +WebInspector.showElementsPanel = function() +{ + oldShowElementsPanel.call(this); + runTests(); +} + +var oldShowPanel = WebInspector.showPanel; +WebInspector.showPanel = function(name) +{ + oldShowPanel.call(this, name); + runTests(); +} + +})(); } diff --git a/WebKit/chromium/tests/KURLTest.cpp b/WebKit/chromium/tests/KURLTest.cpp index 6be4966..c46da2a 100644 --- a/WebKit/chromium/tests/KURLTest.cpp +++ b/WebKit/chromium/tests/KURLTest.cpp @@ -40,7 +40,7 @@ namespace { // Output stream operator so gTest's macros work with WebCore strings. -std::ostream& operator<<(std::ostream& out, const WebCore::String& str) +std::ostream& operator<<(std::ostream& out, const WTF::String& str) { return str.isEmpty() ? out : out << str.utf8().data(); } @@ -95,7 +95,7 @@ TEST(KURLTest, SameGetters) EXPECT_EQ(cases[i].hasRef, kurl.hasFragmentIdentifier()); // UTF-16 - WebCore::String utf16(cases[i].url); + WTF::String utf16(cases[i].url); kurl = WebCore::KURL(WebCore::ParsedURLString, utf16); EXPECT_EQ(cases[i].protocol, kurl.protocol()); @@ -144,7 +144,7 @@ TEST(KURLTest, DifferentGetters) EXPECT_EQ(cases[i].query, kurl.query()); // Want to compare UCS-16 refs (or to null). if (cases[i].ref) - EXPECT_EQ(WebCore::String::fromUTF8(cases[i].ref), kurl.fragmentIdentifier()); + EXPECT_EQ(WTF::String::fromUTF8(cases[i].ref), kurl.fragmentIdentifier()); else EXPECT_TRUE(kurl.fragmentIdentifier().isNull()); } @@ -156,23 +156,23 @@ TEST(KURLTest, UTF8) { const char asciiURL[] = "http://foo/bar#baz"; WebCore::KURL asciiKURL(WebCore::ParsedURLString, asciiURL); - EXPECT_TRUE(asciiKURL.string() == WebCore::String(asciiURL)); + EXPECT_TRUE(asciiKURL.string() == WTF::String(asciiURL)); // When the result is ASCII, we should get an ASCII String. Some // code depends on being able to compare the result of the .string() // getter with another String, and the isASCIIness of the two // strings must match for these functions (like equalIgnoringCase). - EXPECT_TRUE(WebCore::equalIgnoringCase(asciiKURL, WebCore::String(asciiURL))); + EXPECT_TRUE(WTF::equalIgnoringCase(asciiKURL, WTF::String(asciiURL))); // Reproduce code path in FrameLoader.cpp -- equalIgnoringCase implicitly // expects gkurl.protocol() to have been created as ascii. WebCore::KURL mailto(WebCore::ParsedURLString, "mailto:foo@foo.com"); - EXPECT_TRUE(WebCore::equalIgnoringCase(mailto.protocol(), "mailto")); + EXPECT_TRUE(WTF::equalIgnoringCase(mailto.protocol(), "mailto")); const char utf8URL[] = "http://foo/bar#\xe4\xbd\xa0\xe5\xa5\xbd"; WebCore::KURL utf8KURL(WebCore::ParsedURLString, utf8URL); - EXPECT_TRUE(utf8KURL.string() == WebCore::String::fromUTF8(utf8URL)); + EXPECT_TRUE(utf8KURL.string() == WTF::String::fromUTF8(utf8URL)); } TEST(KURLTest, Setters) @@ -281,20 +281,20 @@ TEST(KURLTest, Decode) }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(decodeCases); i++) { - WebCore::String input(decodeCases[i].input); - WebCore::String str = WebCore::decodeURLEscapeSequences(input); + WTF::String input(decodeCases[i].input); + WTF::String str = WebCore::decodeURLEscapeSequences(input); EXPECT_STREQ(decodeCases[i].output, str.utf8().data()); } // Our decode should decode %00 - WebCore::String zero = WebCore::decodeURLEscapeSequences("%00"); + WTF::String zero = WebCore::decodeURLEscapeSequences("%00"); EXPECT_STRNE("%00", zero.utf8().data()); // Test the error behavior for invalid UTF-8 (we differ from WebKit here). - WebCore::String invalid = WebCore::decodeURLEscapeSequences( + WTF::String invalid = WebCore::decodeURLEscapeSequences( "%e4%a0%e5%a5%bd"); char16 invalidExpectedHelper[4] = { 0x00e4, 0x00a0, 0x597d, 0 }; - WebCore::String invalidExpected( + WTF::String invalidExpected( reinterpret_cast<const ::UChar*>(invalidExpectedHelper), 3); EXPECT_EQ(invalidExpected, invalid); @@ -305,20 +305,20 @@ TEST(KURLTest, Encode) { // Also test that it gets converted to UTF-8 properly. char16 wideInputHelper[3] = { 0x4f60, 0x597d, 0 }; - WebCore::String wideInput( + WTF::String wideInput( reinterpret_cast<const ::UChar*>(wideInputHelper), 2); - WebCore::String wideReference("\xe4\xbd\xa0\xe5\xa5\xbd", 6); - WebCore::String wideOutput = + WTF::String wideReference("\xe4\xbd\xa0\xe5\xa5\xbd", 6); + WTF::String wideOutput = WebCore::encodeWithURLEscapeSequences(wideInput); EXPECT_EQ(wideReference, wideOutput); // Our encode only escapes NULLs for safety (see the implementation for // more), so we only bother to test a few cases. - WebCore::String input( + WTF::String input( "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 16); - WebCore::String reference( + WTF::String reference( "%00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f", 18); - WebCore::String output = WebCore::encodeWithURLEscapeSequences(input); + WTF::String output = WebCore::encodeWithURLEscapeSequences(input); EXPECT_EQ(reference, output); } @@ -395,7 +395,7 @@ TEST(KURLTest, Path) WebCore::KURL kurl(WebCore::ParsedURLString, initial); // Clear by setting a null string. - WebCore::String nullString; + WTF::String nullString; EXPECT_TRUE(nullString.isNull()); kurl.setPath(nullString); EXPECT_STREQ("http://www.google.com/", kurl.string().utf8().data()); @@ -409,14 +409,14 @@ TEST(KURLTest, Query) WebCore::KURL kurl(WebCore::ParsedURLString, initial); // Clear by setting a null string. - WebCore::String nullString; + WTF::String nullString; EXPECT_TRUE(nullString.isNull()); kurl.setQuery(nullString); EXPECT_STREQ("http://www.google.com/search", kurl.string().utf8().data()); // Clear by setting an empty string. kurl = WebCore::KURL(WebCore::ParsedURLString, initial); - WebCore::String emptyString(""); + WTF::String emptyString(""); EXPECT_FALSE(emptyString.isNull()); kurl.setQuery(emptyString); EXPECT_STREQ("http://www.google.com/search?", kurl.string().utf8().data()); @@ -456,10 +456,10 @@ TEST(KURLTest, Ref) // Setting the ref to the null string will clear it altogether. cur = WebCore::KURL(WebCore::ParsedURLString, "http://foo/bar"); - cur.setFragmentIdentifier(WebCore::String()); + cur.setFragmentIdentifier(WTF::String()); EXPECT_STREQ("http://foo/bar", cur.string().utf8().data()); cur = kurl; - cur.setFragmentIdentifier(WebCore::String()); + cur.setFragmentIdentifier(WTF::String()); EXPECT_STREQ("http://foo/bar", cur.string().utf8().data()); } @@ -485,7 +485,7 @@ TEST(KURLTest, Empty) EXPECT_TRUE(kurl2.string().isEmpty()); // Resolve the null URL on a null string. - WebCore::KURL kurl22(kurl, WebCore::String()); + WebCore::KURL kurl22(kurl, WTF::String()); EXPECT_FALSE(kurl22.isNull()); EXPECT_TRUE(kurl22.isEmpty()); EXPECT_FALSE(kurl22.isValid()); diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt index 0701d22..f6b96fd 100644 --- a/WebKit/efl/CMakeListsEfl.txt +++ b/WebKit/efl/CMakeListsEfl.txt @@ -10,6 +10,7 @@ LIST(APPEND WebKit_LINK_FLAGS LIST(APPEND WebKit_INCLUDE_DIRECTORIES "${WEBKIT_DIR}/efl/ewk" "${WEBKIT_DIR}/efl/WebCoreSupport" + "${WEBCORE_DIR}/platform/efl" ${Cairo_INCLUDE_DIRS} ${ECORE_X_INCLUDE_DIRS} ${EDJE_INCLUDE_DIRS} diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog index 80595aa..0a627e7 100644 --- a/WebKit/efl/ChangeLog +++ b/WebKit/efl/ChangeLog @@ -1,3 +1,46 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/InspectorClientEfl.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/InspectorClientEfl.h: + +2010-08-03 Leandro Pereira <leandro@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + Implement HTML5 slider theme (using the scrollbar theme as base). + https://bugs.webkit.org/show_bug.cgi?id=43430 + + * DefaultTheme/default.edc: Include slider.edc. + * DefaultTheme/widget/slider/slider.edc: Added. + * DefaultTheme/widget/slider/slider_h.png: Copied from WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png. + * DefaultTheme/widget/slider/slider_hilight.png: Copied from WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png. + * DefaultTheme/widget/slider/slider_knob_h.png: Copied from WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png. + * DefaultTheme/widget/slider/slider_knob_v.png: Copied from WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png. + * DefaultTheme/widget/slider/slider_v.png: Copied from WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png. + +2010-08-03 ryuan choi <ryuan.choi@samsung.com> + + Reviewed by Darin Adler. + + [EFL] REGRESSION(64425) need to fix build break + https://bugs.webkit.org/show_bug.cgi?id=43322 + + just add include path missed after r64425 + + * CMakeListsEfl.txt: + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/efl/DefaultTheme/default.edc b/WebKit/efl/DefaultTheme/default.edc index 7e0fe48..82b6882 100644 --- a/WebKit/efl/DefaultTheme/default.edc +++ b/WebKit/efl/DefaultTheme/default.edc @@ -73,4 +73,5 @@ collections { #include "widget/search/field/search_field.edc" #include "widget/search/cancel/search_cancel.edc" #include "widget/search/decoration/search_decoration.edc" +#include "widget/slider/slider.edc" } diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider.edc b/WebKit/efl/DefaultTheme/widget/slider/slider.edc new file mode 100644 index 0000000..6c1f6a5 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider.edc @@ -0,0 +1,221 @@ +/* + Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009,2010 ProFUSION embedded systems + Copyright (C) 2009,2010 Samsung Electronics + + This file is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +group { + name: "webkit/widget/slider/vertical"; + + min: 10 0; /* if > 0, this is the minimum size that will be allocated. + * If wants to draw on top, just overflow usign edje's rel1/rel2 + */ + + images { + image: "widget/slider/slider_v.png" COMP; + image: "widget/slider/slider_knob_v.png" COMP; + } + + script { + public message(Msg_Type:type, id, ...) { + if ((id == 0) && (type == MSG_FLOAT_SET)) { + new Float:vy, Float:sy; + + vy = getfarg(2); + sy = getfarg(3); + + if (vy >= 0.0) { + set_drag_size(PART:"img.knob", 1.0, sy); + set_drag(PART:"img.knob", 0.0, vy); + } + } + } + + public update_drag_pos() { + new Float:x, Float:y; + get_drag(PART:"img.knob", x, y); + send_message(MSG_FLOAT, 1, y); + } + } + + parts { + part { + name: "rect.base"; + type: RECT; + description { + min: 10 0; + max: 10 999999; + state: "default" 0.0; + color: 255 255 255 0; + } + } + part { + name: "rect.clipper"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + + part { + name: "img.slider"; + type: IMAGE; + mouse_events: 0; + clip_to: "rect.clipper"; + description { + state: "default" 0.0; + image { + normal: "widget/slider/slider_v.png"; + border: 0 0 6 6; + } + } + } + + part { + name: "img.knob"; + type: IMAGE; + mouse_events: 1; + clip_to: "rect.clipper"; + dragable { + x: 0 0 0; + y: 1 1 0; + confine: "rect.base"; + } + description { + state: "default" 0.0; + min: 10 10; + max: 10 999999; + image { + normal: "widget/slider/slider_knob_v.png"; + border: 0 0 6 6; + } + } + } + } + programs { + program { + name: "dragged"; + signal: "drag"; + source: "img.knob"; + script { + update_drag_pos(); + } + } + } +} + +group { + name: "webkit/widget/slider/horizontal"; + + min: 0 10; /* if > 0, this is the minimum size that will be allocated. + * If wants to draw on top, just overflow usign edje's rel1/rel2 + */ + + images { + image: "widget/slider/slider_h.png" COMP; + image: "widget/slider/slider_knob_h.png" COMP; + } + + script { + public message(Msg_Type:type, id, ...) { + if ((id == 0) && (type == MSG_FLOAT_SET)) { + new Float:vx, Float:sx; + + vx = getfarg(2); + sx = getfarg(3); + + if (vx >= 0.0) { + set_drag_size(PART:"img.knob", sx, 1.0); + set_drag(PART:"img.knob", vx, 0.0); + } + } + } + + public update_drag_pos() { + new Float:x, Float:y; + get_drag(PART:"img.knob", x, y); + send_message(MSG_FLOAT, 1, x); + } + } + + parts { + part { + name: "rect.base"; + type: RECT; + description { + state: "default" 0.0; + min: 0 10; + max: 999999 10; + color: 255 255 255 0; + } + } + part { + name: "rect.clipper"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 255; + } + } + + part { + name: "img.slider"; + type: IMAGE; + mouse_events: 0; + clip_to: "rect.clipper"; + description { + state: "default" 0.0; + image { + normal: "widget/slider/slider_h.png"; + border: 6 6 0 0; + } + } + } + + part { + name: "img.knob"; + type: IMAGE; + mouse_events: 1; + clip_to: "rect.clipper"; + dragable { + x: 1 1 0; + y: 0 0 0; + confine: "rect.base"; + } + description { + state: "default" 0.0; + min: 10 10; + image { + normal: "widget/slider/slider_knob_h.png"; + border: 6 6 0 0; + } + } + } + } + programs { + program { + name: "dragged"; + signal: "drag"; + source: "img.knob"; + script { + update_drag_pos(); + } + } + } +} diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_h.png Binary files differnew file mode 100644 index 0000000..6e55557 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_h.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png b/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png Binary files differnew file mode 100644 index 0000000..1116f4e --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png Binary files differnew file mode 100644 index 0000000..bc65102 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png Binary files differnew file mode 100644 index 0000000..db3c685 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_v.png Binary files differnew file mode 100644 index 0000000..9ebdac2 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_v.png diff --git a/WebKit/efl/WebCoreSupport/DragClientEfl.h b/WebKit/efl/WebCoreSupport/DragClientEfl.h index 40bb6ad..f73116c 100644 --- a/WebKit/efl/WebCoreSupport/DragClientEfl.h +++ b/WebKit/efl/WebCoreSupport/DragClientEfl.h @@ -45,7 +45,7 @@ public: virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String& label, WebCore::Frame*); virtual void dragControllerDestroyed(); }; diff --git a/WebKit/efl/WebCoreSupport/InspectorClientEfl.h b/WebKit/efl/WebCoreSupport/InspectorClientEfl.h index 1ca646d..0c283d8 100644 --- a/WebKit/efl/WebCoreSupport/InspectorClientEfl.h +++ b/WebKit/efl/WebCoreSupport/InspectorClientEfl.h @@ -33,11 +33,11 @@ #define InspectorClientEfl_h #include "InspectorClient.h" +#include <wtf/Forward.h> namespace WebCore { class Node; class Page; -class String; class InspectorClientEfl : public WebCore::InspectorClient { public: diff --git a/WebKit/efl/ewk/ewk_contextmenu.cpp b/WebKit/efl/ewk/ewk_contextmenu.cpp index 9daf27c..7461359 100644 --- a/WebKit/efl/ewk/ewk_contextmenu.cpp +++ b/WebKit/efl/ewk/ewk_contextmenu.cpp @@ -112,7 +112,7 @@ Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_ WebCore::ContextMenuItemType type = static_cast<WebCore::ContextMenuItemType>(item->type); // Don't care about title and submenu as they're not used after this point. - WebCore::ContextMenuItem core(type, action, WebCore::String()); + WebCore::ContextMenuItem core(type, action, WTF::String()); menu->controller->contextMenuItemSelected(&core); return EINA_TRUE; } diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index ca76f02..fcf5ed3 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -335,7 +335,7 @@ void ewk_frame_theme_set(Evas_Object* o, const char* path) if (!eina_stringshare_replace(&sd->theme, path)) return; if (sd->frame && sd->frame->view()) { - sd->frame->view()->setEdjeTheme(WebCore::String(path)); + sd->frame->view()->setEdjeTheme(WTF::String(path)); sd->frame->page()->theme()->themeChanged(); } } @@ -406,8 +406,8 @@ Evas_Object* ewk_frame_child_find(Evas_Object* o, const char* name) EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(name, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, 0); - WebCore::String s = WebCore::String::fromUTF8(name); - return kit(sd->frame->tree()->find(WebCore::AtomicString(s))); + WTF::String s = WTF::String::fromUTF8(name); + return kit(sd->frame->tree()->find(WTF::AtomicString(s))); } /** @@ -419,7 +419,7 @@ Evas_Object* ewk_frame_child_find(Evas_Object* o, const char* name) Eina_Bool ewk_frame_uri_set(Evas_Object* o, const char* uri) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); - WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(uri)); + WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(uri)); WebCore::ResourceRequest req(kurl); WebCore::FrameLoader* loader = sd->frame->loader(); loader->load(req, false); @@ -474,7 +474,7 @@ const char* ewk_frame_name_get(const Evas_Object* o) return 0; } - WebCore::String s = sd->frame->tree()->name(); + WTF::String s = sd->frame->tree()->name(); WTF::CString cs = s.utf8(); sd->name = eina_stringshare_add_length(cs.data(), cs.length()); return sd->name; @@ -515,18 +515,18 @@ static Eina_Bool _ewk_frame_contents_set_internal(Ewk_Frame_Smart_Data *sd, cons if (!base_uri) base_uri = "about:blank"; - WebCore::KURL baseKURL(WebCore::KURL(), WebCore::String::fromUTF8(base_uri)); + WebCore::KURL baseKURL(WebCore::KURL(), WTF::String::fromUTF8(base_uri)); WebCore::KURL unreachableKURL; if (unreachable_uri) - unreachableKURL = WebCore::KURL(WebCore::KURL(), WebCore::String::fromUTF8(unreachable_uri)); + unreachableKURL = WebCore::KURL(WebCore::KURL(), WTF::String::fromUTF8(unreachable_uri)); else unreachableKURL = WebCore::KURL(); WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(contents, contents_size); WebCore::SubstituteData substituteData (buffer.release(), - WebCore::String::fromUTF8(mime_type), - WebCore::String::fromUTF8(encoding), + WTF::String::fromUTF8(mime_type), + WTF::String::fromUTF8(encoding), baseKURL, unreachableKURL); WebCore::ResourceRequest request(baseKURL); @@ -601,7 +601,7 @@ Eina_Bool ewk_frame_script_execute(Evas_Object* o, const char* script) EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EINA_SAFETY_ON_FALSE_RETURN_VAL(sd->frame, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(script, EINA_FALSE); - sd->frame->script()->executeScript(WebCore::String::fromUTF8(script), true); + sd->frame->script()->executeScript(WTF::String::fromUTF8(script), true); return EINA_TRUE; } @@ -658,7 +658,7 @@ char* ewk_frame_selection_get(const Evas_Object* o) static inline Eina_Bool _ewk_frame_editor_command(Ewk_Frame_Smart_Data* sd, const char* command) { - return sd->frame->editor()->command(WebCore::String::fromUTF8(command)).execute(); + return sd->frame->editor()->command(WTF::String::fromUTF8(command)).execute(); } /** @@ -750,7 +750,7 @@ Eina_Bool ewk_frame_text_search(const Evas_Object* o, const char* string, Eina_B EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE); - return sd->frame->findString(WebCore::String::fromUTF8(string), forward, case_sensitive, wrap, true); + return sd->frame->findString(WTF::String::fromUTF8(string), forward, case_sensitive, wrap, true); } /** @@ -771,7 +771,7 @@ unsigned int ewk_frame_text_matches_mark(Evas_Object* o, const char* string, Ein EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); sd->frame->setMarkedTextMatchesAreHighlighted(highlight); - return sd->frame->markAllMatchesForText(WebCore::String::fromUTF8(string), case_sensitive, limit); + return sd->frame->markAllMatchesForText(WTF::String::fromUTF8(string), case_sensitive, limit); } /** @@ -1560,7 +1560,7 @@ Eina_Bool ewk_frame_init(Evas_Object* o, Evas_Object* view, WebCore::Frame* fram return EINA_FALSE; } -Evas_Object* ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer) +Evas_Object* ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String& name, const WebCore::KURL& url, const WTF::String& referrer) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, 0); char buf[256]; @@ -1690,8 +1690,8 @@ void ewk_frame_view_state_save(Evas_Object *o, WebCore::HistoryItem* item) const char *title = ewk_frame_title_get(o); const char *uri = ewk_frame_uri_get(o); - item->setTitle(WebCore::String::fromUTF8(title)); - item->setURLString(WebCore::String::fromUTF8(uri)); + item->setTitle(WTF::String::fromUTF8(title)); + item->setURLString(WTF::String::fromUTF8(uri)); evas_object_smart_callback_call(o, "state,save", 0); } @@ -1946,7 +1946,7 @@ void ewk_frame_force_layout(Evas_Object* o) view->forceLayout(true); } -WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually) +WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::StringWTF::String& mimeType, bool loadManually) { return 0; } diff --git a/WebKit/efl/ewk/ewk_history.cpp b/WebKit/efl/ewk/ewk_history.cpp index da48c33..8387da1 100644 --- a/WebKit/efl/ewk/ewk_history.cpp +++ b/WebKit/efl/ewk/ewk_history.cpp @@ -415,8 +415,8 @@ Eina_Bool ewk_history_limit_set(const Ewk_History* history, int limit) */ Ewk_History_Item* ewk_history_item_new(const char* uri, const char* title) { - WebCore::String u = WebCore::String::fromUTF8(uri); - WebCore::String t = WebCore::String::fromUTF8(title); + WTF::String u = WTF::String::fromUTF8(uri); + WTF::String t = WTF::String::fromUTF8(title); WTF::RefPtr<WebCore::HistoryItem> core = WebCore::HistoryItem::create(u, t, 0); Ewk_History_Item* item = _ewk_history_item_new(core.release().releaseRef()); return item; @@ -507,7 +507,7 @@ void ewk_history_item_title_alternate_set(Ewk_History_Item* item, const char* ti EWK_HISTORY_ITEM_CORE_GET_OR_RETURN(item, core); if (!eina_stringshare_replace(&item->alternate_title, title)) return; - core->setAlternateTitle(WebCore::String::fromUTF8(title)); + core->setAlternateTitle(WTF::String::fromUTF8(title)); } /** diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index 2096e76..f69f46c 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -97,9 +97,9 @@ void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame); WebCore::Page *ewk_view_core_page_get(const Evas_Object *o); -WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer); +WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Object *frame, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WTF::String& referrer); -WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually); +WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually); void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect); void ewk_view_viewport_set(Evas_Object *o, float w, float h, float init_scale, float max_scale, float min_scale, float user_scalable); @@ -119,7 +119,7 @@ Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeat Evas_Object *ewk_frame_add(Evas *e); Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame); -Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer); +Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WTF::String& name, const WebCore::KURL& url, const WTF::String& referrer); WebCore::Frame *ewk_frame_core_get(const Evas_Object *o); void ewk_frame_core_gone(Evas_Object *o); @@ -146,7 +146,7 @@ void ewk_frame_view_create_for_view(Evas_Object *o, Evas_Object *view); Eina_Bool ewk_frame_uri_changed(Evas_Object *o); void ewk_frame_force_layout(Evas_Object *o); -WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually); +WTF::PassRefPtr<WebCore::Widget> ewk_frame_plugin_create(Evas_Object* o, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually); #ifdef __cplusplus diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp index e775ac9..6d2be05 100644 --- a/WebKit/efl/ewk/ewk_settings.cpp +++ b/WebKit/efl/ewk/ewk_settings.cpp @@ -67,7 +67,7 @@ uint64_t ewk_settings_web_database_default_quota_get() void ewk_settings_web_database_path_set(const char *path) { #if ENABLE(DATABASE) - WebCore::String corePath = WebCore::String::fromUTF8(path); + WTF::String corePath = WTF::String::fromUTF8(path); WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(corePath); #endif } @@ -82,7 +82,7 @@ void ewk_settings_web_database_path_set(const char *path) const char *ewk_settings_web_database_path_get() { #if ENABLE(DATABASE) - WebCore::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); + WTF::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); return strdup(path.utf8().data()); #else return 0; @@ -121,7 +121,7 @@ Eina_Bool ewk_settings_icon_database_path_set(const char *directory) } WebCore::iconDatabase()->setEnabled(true); - WebCore::iconDatabase()->open(WebCore::String::fromUTF8(directory)); + WebCore::iconDatabase()->open(WTF::String::fromUTF8(directory)); } else { WebCore::iconDatabase()->setEnabled(false); WebCore::iconDatabase()->close(); @@ -144,7 +144,7 @@ char* ewk_settings_icon_database_path_get(void) if (!WebCore::iconDatabase()->isOpen()) return 0; - WebCore::String path = WebCore::iconDatabase()->databasePath(); + WTF::String path = WebCore::iconDatabase()->databasePath(); if (path.isEmpty()) return 0; return strdup(path.utf8().data()); @@ -184,7 +184,7 @@ cairo_surface_t* ewk_settings_icon_database_icon_surface_get(const char *url) { EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); - WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url)); + WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); WebCore::Image *icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); if (!icon) { @@ -216,7 +216,7 @@ Evas_Object* ewk_settings_icon_database_icon_object_add(const char* url, Evas* c EINA_SAFETY_ON_NULL_RETURN_VAL(url, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(canvas, 0); - WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(url)); + WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(url)); WebCore::Image* icon = WebCore::iconDatabase()->iconForPageURL(kurl.string(), WebCore::IntSize(16, 16)); cairo_surface_t* surface; diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index ed6fb4d..c030c1c 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -511,7 +511,7 @@ static WTF::PassRefPtr<WebCore::Frame> _ewk_view_core_frame_new(Ewk_View_Smart_D CRITICAL("Could not create frame loader client."); return 0; } - flc->setCustomUserAgent(WebCore::String::fromUTF8(priv->settings.user_agent)); + flc->setCustomUserAgent(WTF::String::fromUTF8(priv->settings.user_agent)); return WebCore::Frame::create(priv->page, owner, flc); } @@ -522,7 +522,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) { Ewk_View_Private_Data* priv = (Ewk_View_Private_Data*)calloc(1, sizeof(Ewk_View_Private_Data)); - WebCore::AtomicString s; + WTF::AtomicString s; WebCore::KURL url; if (!priv) { @@ -1331,7 +1331,7 @@ Eina_Bool ewk_view_text_search(const Evas_Object* o, const char* string, Eina_Bo else direction = WebCore::FindDirectionBackward; - return priv->page->findString(WebCore::String::fromUTF8(string), sensitive, direction, wrap); + return priv->page->findString(WTF::String::fromUTF8(string), sensitive, direction, wrap); } /** @@ -1357,7 +1357,7 @@ unsigned int ewk_view_text_matches_mark(Evas_Object* o, const char* string, Eina else sensitive = WebCore::TextCaseInsensitive; - return priv->page->markAllMatchesForText(WebCore::String::fromUTF8(string), sensitive, highlight, limit); + return priv->page->markAllMatchesForText(WTF::String::fromUTF8(string), sensitive, highlight, limit); } /** @@ -1435,7 +1435,7 @@ char* ewk_view_selection_get(const Evas_Object* o) static Eina_Bool _ewk_view_editor_command(Ewk_View_Private_Data* priv, const char* command) { - return priv->page->focusController()->focusedOrMainFrame()->editor()->command(WebCore::String::fromUTF8(command)).execute(); + return priv->page->focusController()->focusedOrMainFrame()->editor()->command(WTF::String::fromUTF8(command)).execute(); } /** @@ -2190,7 +2190,7 @@ Eina_Bool ewk_view_setting_user_agent_set(Evas_Object* o, const char* user_agent EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.user_agent, user_agent)) { WebCore::FrameLoaderClientEfl* client = static_cast<WebCore::FrameLoaderClientEfl*>(priv->main_frame->loader()->client()); - client->setCustomUserAgent(WebCore::String::fromUTF8(user_agent)); + client->setCustomUserAgent(WTF::String::fromUTF8(user_agent)); } return EINA_TRUE; } @@ -2207,7 +2207,7 @@ Eina_Bool ewk_view_setting_user_stylesheet_set(Evas_Object* o, const char* uri) EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.user_stylesheet, uri)) { - WebCore::KURL kurl(WebCore::KURL(), WebCore::String::fromUTF8(uri)); + WebCore::KURL kurl(WebCore::KURL(), WTF::String::fromUTF8(uri)); priv->page_settings->setUserStyleSheetLocation(kurl); } return EINA_TRUE; @@ -2380,7 +2380,7 @@ const char* ewk_view_setting_encoding_custom_get(const Evas_Object* o) Evas_Object* main_frame = ewk_view_frame_main_get(o); WebCore::Frame* core_frame = ewk_frame_core_get(main_frame); - WebCore::String overrideEncoding = core_frame->loader()->documentLoader()->overrideEncoding(); + WTF::String overrideEncoding = core_frame->loader()->documentLoader()->overrideEncoding(); if (overrideEncoding.isEmpty()) return 0; @@ -2405,7 +2405,7 @@ Eina_Bool ewk_view_setting_encoding_custom_set(Evas_Object* o, const char *encod WebCore::Frame* core_frame = ewk_frame_core_get(main_frame); DBG("%s", encoding); eina_stringshare_replace(&priv->settings.encoding_custom, encoding); - core_frame->loader()->reloadWithOverrideEncoding(WebCore::String::fromUTF8(encoding)); + core_frame->loader()->reloadWithOverrideEncoding(WTF::String::fromUTF8(encoding)); return EINA_TRUE; } @@ -2422,7 +2422,7 @@ Eina_Bool ewk_view_setting_encoding_default_set(Evas_Object* o, const char* enco EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.encoding_default, encoding)) - priv->page_settings->setDefaultTextEncodingName(WebCore::String::fromUTF8(encoding)); + priv->page_settings->setDefaultTextEncodingName(WTF::String::fromUTF8(encoding)); return EINA_TRUE; } @@ -2510,7 +2510,7 @@ Eina_Bool ewk_view_setting_font_standard_set(Evas_Object* o, const char* family) EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_standard, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setStandardFontFamily(s); } return EINA_TRUE; @@ -2528,7 +2528,7 @@ Eina_Bool ewk_view_setting_font_cursive_set(Evas_Object* o, const char* family) EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_cursive, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicStringWTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setCursiveFontFamily(s); } return EINA_TRUE; @@ -2546,7 +2546,7 @@ Eina_Bool ewk_view_setting_font_fantasy_set(Evas_Object* o, const char* family) EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_fantasy, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setFantasyFontFamily(s); } return EINA_TRUE; @@ -2564,7 +2564,7 @@ Eina_Bool ewk_view_setting_font_monospace_set(Evas_Object* o, const char* family EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_monospace, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setFixedFontFamily(s); } return EINA_TRUE; @@ -2582,7 +2582,7 @@ Eina_Bool ewk_view_setting_font_serif_set(Evas_Object* o, const char* family) EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_serif, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setSerifFontFamily(s); } return EINA_TRUE; @@ -2600,7 +2600,7 @@ Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object* o, const char* famil EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); if (eina_stringshare_replace(&priv->settings.font_sans_serif, family)) { - WebCore::AtomicString s = WebCore::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setSansSerifFontFamily(s); } return EINA_TRUE; @@ -3671,7 +3671,7 @@ WebCore::Page* ewk_view_core_page_get(const Evas_Object* o) * * Emits "frame,created" with the new frame object on success. */ -WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Object* frame, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WebCore::String& referrer) +WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Object* frame, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::KURL& url, const WTF::String& referrer) { DBG("o=%p, frame=%p, name=%s, ownerElement=%p, url=%s, referrer=%s", o, frame, name.utf8().data(), ownerElement, @@ -3703,7 +3703,7 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object* o, Evas_Objec return cf.release(); } -WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually) +WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually) { DBG("o=%p, frame=%p, size=%dx%d, element=%p, url=%s, mimeType=%s", o, frame, pluginSize.width(), pluginSize.height(), element, diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index 3d3436f..dbba4a9 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,123 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/InspectorClientGtk.h: + +2010-08-09 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [gtk] gtk_im_context_focus_in() should only be called when an input-able element has focus + https://bugs.webkit.org/show_bug.cgi?id=43602 + + Only call gtk_im_context_focus_in() when we focus a frame which is currently in + an editable node. + + * webkit/webkitwebview.cpp: + (webkit_web_view_focus_in_event): Conditionalize call to gtk_im_context_focus_in(). + +2010-08-06 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Xan Lopez. + + Use the new paths, and also fix the path for localizedStrings. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + (WebKit::InspectorFrontendClient::localizedStringsURL): + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/InspectorClientGtk.h: + +2010-08-05 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Use correct path for Inspector data files in GTK+3.x builds + https://bugs.webkit.org/show_bug.cgi?id=43445 + + Use the right data path for inspector files when building with + GTK+ 3.x. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-03 Daniel Bates <dbates@rim.com> + + Fix misspelled word 'teh' in the description of the XSS Auditor setting. + + * webkit/webkitwebsettings.cpp: + (webkit_web_settings_class_init): + +2010-08-03 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Fix DOM event dispatch + https://bugs.webkit.org/show_bug.cgi?id=40847 + + Test DOM event dispatch. + + * tests/testdomdomwindow.c: + (load_event_callback): + (test_dom_domview_signals): + (clicked_cb): + (load_status_callback): + (test_dom_domview_dispatch_event): + (main): + +2010-08-03 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Xan Lopez. + + [GTK] Does not paint the node highlight used by the inspector + https://bugs.webkit.org/show_bug.cgi?id=43429 + + Implement highlighting the nodes when using the inspector. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::highlight): + (WebKit::InspectorClient::hideHighlight): + * webkit/webkitwebview.cpp: + (webkit_web_view_expose_event): + +2010-08-03 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + Update unit tests now that string parameters are 'const char*'. + + * tests/testdomdocument.c: + (test_dom_document_title): + (test_dom_document_get_elements_by_tag_name): + (test_dom_document_get_elements_by_class_name): + (test_dom_document_get_element_by_id): + * tests/testdomnode.c: + (test_dom_node_insertion): + +2010-08-02 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] DRT implement execCommand() + https://bugs.webkit.org/show_bug.cgi?id=35351 + + * webkit/webkitprivate.h: Add some private methods for the DRT which enable + LayoutTestController.execCommand and LayoutTestController.isCommandEnabled: + webkit_web_view_execute_core_command_by_name and webkit_web_view_is_command_enabled. + * webkit/webkitwebview.cpp: + (webkit_web_view_execute_core_command_by_name): added. + (webkit_web_view_is_command_enabled): Added. + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. @@ -120,7 +240,6 @@ * WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::reachedApplicationCacheOriginQuota): * WebCoreSupport/ChromeClientGtk.h: - 2010-07-26 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 081c942..a06d637 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -277,12 +277,12 @@ bool ChromeClient::canRunBeforeUnloadConfirmPanel() return true; } -bool ChromeClient::runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame) +bool ChromeClient::runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame) { return runJavaScriptConfirm(frame, message); } -void ChromeClient::addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceId) +void ChromeClient::addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceId) { gboolean retval; g_signal_emit_by_name(m_webView, "console-message", message.utf8().data(), lineNumber, sourceId.utf8().data(), &retval); @@ -596,7 +596,7 @@ void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser) gtk_widget_destroy(dialog); } -void ChromeClient::chooseIconForFiles(const Vector<WebCore::String>& filenames, WebCore::FileChooser* chooser) +void ChromeClient::chooseIconForFiles(const Vector<WTF::String>& filenames, WebCore::FileChooser* chooser) { chooser->iconLoaded(Icon::createIconForFiles(filenames)); } diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h index 8c667c4..e3be1c2 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h @@ -77,18 +77,18 @@ namespace WebKit { virtual void setResizable(bool); virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, - WebCore::MessageLevel level, const WebCore::String& message, - unsigned int lineNumber, const WebCore::String& sourceID); + WebCore::MessageLevel level, const WTF::String& message, + unsigned int lineNumber, const WTF::String& sourceID); virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String&); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result); + virtual void setStatusbarText(const WTF::String&); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; @@ -107,18 +107,18 @@ namespace WebKit { virtual void scrollbarsModeDidChange() const; virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); - virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); + virtual void setToolTip(const WTF::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); + virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String&); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); #endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void formStateDidChange(const WebCore::Node*) { } diff --git a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h index d320c0e..07a022c 100644 --- a/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h @@ -50,7 +50,7 @@ namespace WebKit { virtual void copyImageToClipboard(const WebCore::HitTestResult&); virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); - virtual void speak(const WebCore::String&); + virtual void speak(const WTF::String&); virtual void stopSpeaking(); virtual bool isSpeaking(); diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h index 6604940..514852e 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h @@ -47,7 +47,7 @@ namespace WebKit { virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String& label, WebCore::Frame*); virtual void dragControllerDestroyed(); diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h index 93f56ce..2688629 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h @@ -86,7 +86,7 @@ namespace WebKit { virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting); virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*); @@ -120,16 +120,16 @@ namespace WebKit { virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, WTF::Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String&, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h index 2eeeb35..33e9ee5 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h @@ -81,7 +81,7 @@ namespace WebKit { virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String&); + virtual void dispatchDidReceiveTitle(const WTF::String&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -94,8 +94,8 @@ namespace WebKit { virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); - virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); + virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>, const WTF::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, WTF::PassRefPtr<WebCore::FormState>); virtual void cancelPolicyCheck(); @@ -112,20 +112,20 @@ namespace WebKit { virtual void postProgressEstimateChangedNotification(); virtual void postProgressFinishedNotification(); - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); - virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WebCore::String>&, const WTF::Vector<WebCore::String>&, const WebCore::String&, bool); + virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const WTF::Vector<WTF::String>&, const WTF::Vector<WTF::String>&, const WTF::String&, bool); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); - virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues); - virtual WebCore::String overrideMediaType() const; + virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues); + virtual WTF::String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool); - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType); virtual void setMainFrameDocumentReady(bool); @@ -159,9 +159,9 @@ namespace WebKit { virtual bool shouldFallBack(const WebCore::ResourceError&); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String&) const; - virtual bool representationExistsForURLScheme(const WebCore::String&) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String&) const; + virtual bool canShowMIMEType(const WTF::String&) const; + virtual bool representationExistsForURLScheme(const WTF::String&) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String&) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(WebCore::HistoryItem*); @@ -171,9 +171,9 @@ namespace WebKit { virtual void prepareForDataSourceReplacement(); virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index 616834b..1256000 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -23,6 +23,7 @@ #include "webkitwebview.h" #include "webkitwebinspector.h" #include "webkitprivate.h" +#include "webkitversion.h" #include "InspectorController.h" #include "NotImplemented.h" #include "PlatformString.h" @@ -84,8 +85,10 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller) GOwnPtr<gchar> currentDirectory(g_get_current_dir()); GOwnPtr<gchar> fullPath(g_strdup_printf("%s/WebCore/inspector/front-end/inspector.html", currentDirectory.get())); inspectorURI.set(g_filename_to_uri(fullPath.get(), NULL, NULL)); - } else - inspectorURI.set(g_filename_to_uri(DATA_DIR"/webkit-1.0/webinspector/inspector.html", NULL, NULL)); + } else { + GOwnPtr<gchar> dataPath(g_strdup_printf(DATA_DIR"/webkitgtk-%.1f/webinspector/inspector.html", WEBKITGTK_API_VERSION)); + inspectorURI.set(g_filename_to_uri(dataPath.get(), NULL, NULL)); + } webkit_web_view_load_uri(inspectorWebView, inspectorURI.get()); @@ -101,14 +104,18 @@ void InspectorClient::releaseFrontendPage() m_frontendPage = 0; } -void InspectorClient::highlight(Node* node) +void InspectorClient::highlight(Node*) { - notImplemented(); + hideHighlight(); } void InspectorClient::hideHighlight() { - notImplemented(); + // FIXME: we should be able to only invalidate the actual rects of + // the new and old nodes. We need to track the nodes, and take the + // actual highlight size into account when calculating the damage + // rect. + gtk_widget_queue_draw(GTK_WIDGET(m_inspectedWebView)); } void InspectorClient::populateSetting(const String& key, String* value) @@ -198,8 +205,10 @@ String InspectorFrontendClient::localizedStringsURL() GOwnPtr<gchar> currentDirectory(g_get_current_dir()); GOwnPtr<gchar> fullPath(g_strdup_printf("%s/WebCore/English.lproj/localizedStrings.js", currentDirectory.get())); URL.set(g_filename_to_uri(fullPath.get(), NULL, NULL)); - } else - URL.set(g_filename_to_uri(DATA_DIR"/webkit-1.0/webinspector/localizedStrings.js", NULL, NULL)); + } else { + GOwnPtr<gchar> localizedStringsPath(g_strdup_printf(DATA_DIR"/webkitgtk-%.1f/webinspector/localizedStrings.js", WEBKITGTK_API_VERSION)); + URL.set(g_filename_to_uri(localizedStringsPath.get(), NULL, NULL)); + } // FIXME: support l10n of localizedStrings.js return String::fromUTF8(URL.get()); diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h index fc9b6d8..b72bc82 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.h @@ -33,11 +33,11 @@ #include "InspectorFrontendClientLocal.h" #include "webkitwebview.h" #include "webkitwebinspector.h" +#include <wtf/Forward.h> namespace WebCore { class Node; class Page; - class String; } namespace WebKit { @@ -58,10 +58,10 @@ namespace WebKit { virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); void releaseFrontendPage(); @@ -79,9 +79,9 @@ namespace WebKit { void destroyInspectorWindow(); - virtual WebCore::String localizedStringsURL(); + virtual WTF::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -91,7 +91,7 @@ namespace WebKit { virtual void setAttachedWindowHeight(unsigned height); - virtual void inspectedURLChanged(const WebCore::String& newURL); + virtual void inspectedURLChanged(const WTF::String& newURL); private: virtual ~InspectorFrontendClient(); diff --git a/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/WebKit/gtk/gdom/ConvertToGCharPrivate.h index dd8c65e..ef42b08 100644 --- a/WebKit/gtk/gdom/ConvertToGCharPrivate.h +++ b/WebKit/gtk/gdom/ConvertToGCharPrivate.h @@ -25,7 +25,7 @@ #include "PlatformString.h" #include <wtf/text/CString.h> -inline gchar* copyAsGchar(WebCore::String const& s) +inline gchar* copyAsGchar(WTF::String const& s) { return g_strdup(s.utf8().data()); } @@ -40,7 +40,7 @@ inline gchar* copyAsGchar(const JSC::UString& s) return g_strdup(s.UTF8String().c_str()); } -inline gchar* copyAsGchar(WebCore::AtomicString const& s) +inline gchar* copyAsGchar(WTF::AtomicString const& s) { return g_strdup(s.string().utf8().data()); } diff --git a/WebKit/gtk/po/ChangeLog b/WebKit/gtk/po/ChangeLog index aac3c0c..f088275 100644 --- a/WebKit/gtk/po/ChangeLog +++ b/WebKit/gtk/po/ChangeLog @@ -1,3 +1,11 @@ +2010-08-03 Jorge González <aloriel@gmail.com> + + Reviewed by Gustavo Noronha. + + Spanish translation update. + + * es.po: Updated. + 2010-07-13 Alejandro G. Castro <alex@igalia.com> Reviewed by Gustavo Noronha. diff --git a/WebKit/gtk/po/es.po b/WebKit/gtk/po/es.po index b06ba1b..433c9de 100644 --- a/WebKit/gtk/po/es.po +++ b/WebKit/gtk/po/es.po @@ -1,21 +1,20 @@ -# translation of webkit.webkit.HEAD.es.po.po to Español +# translation of webkit.po to Español # This file is put in the public domain. +# Jorge González <jorgegonz@svn.gnome.org>, 2010. # -# Jacinto Capote Robles <fastangel@gmail.com>, 2009. -# Jorge González <jorgegonz@svn.gnome.org>, 2009. msgid "" msgstr "" -"Project-Id-Version: webkit.webkit.HEAD.es.po\n" +"Project-Id-Version: webkit\n" "Report-Msgid-Bugs-To: http://bugs.webkit.org/\n" "POT-Creation-Date: 2010-02-25 15:53-0300\n" -"PO-Revision-Date: 2009-06-11 15:36+0200\n" +"PO-Revision-Date: 2010-05-01 11:18+0200\n" "Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n" "Language-Team: Español <gnome-es-list@gnome.org>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535 msgid "Upload File" @@ -73,35 +72,35 @@ msgstr "_Insertar un carácter de control Unicode" #: WebKit/gtk/webkit/webkitdownload.cpp:266 msgid "Network Request" -msgstr "" +msgstr "Solicitud de red" #: WebKit/gtk/webkit/webkitdownload.cpp:267 msgid "The network request for the URI that should be downloaded" -msgstr "" +msgstr "La solicitud de red para el URI que se debe descargar" #: WebKit/gtk/webkit/webkitdownload.cpp:281 msgid "Network Response" -msgstr "" +msgstr "Respuesta de red" #: WebKit/gtk/webkit/webkitdownload.cpp:282 msgid "The network response for the URI that should be downloaded" -msgstr "" +msgstr "La respuesta de red para el URI que se debería descargar" #: WebKit/gtk/webkit/webkitdownload.cpp:296 msgid "Destination URI" -msgstr "" +msgstr "URI de destino" #: WebKit/gtk/webkit/webkitdownload.cpp:297 msgid "The destination URI where to save the file" -msgstr "" +msgstr "El URI de destino donde guardar el archivo" #: WebKit/gtk/webkit/webkitdownload.cpp:311 msgid "Suggested Filename" -msgstr "" +msgstr "Nombre de archivo sugerido" #: WebKit/gtk/webkit/webkitdownload.cpp:312 msgid "The filename suggested as default when saving" -msgstr "" +msgstr "El nombre de archivo sugerido como predeterminado al guardar" #: WebKit/gtk/webkit/webkitdownload.cpp:329 msgid "Progress" @@ -109,7 +108,7 @@ msgstr "Progreso" #: WebKit/gtk/webkit/webkitdownload.cpp:330 msgid "Determines the current progress of the download" -msgstr "" +msgstr "Determina el progreso actual de la descarga" #: WebKit/gtk/webkit/webkitdownload.cpp:343 msgid "Status" @@ -125,7 +124,7 @@ msgstr "Tamaño actual" #: WebKit/gtk/webkit/webkitdownload.cpp:360 msgid "The length of the data already downloaded" -msgstr "" +msgstr "El tamaño de los datos ya descargados" #: WebKit/gtk/webkit/webkitdownload.cpp:374 msgid "Total Size" @@ -133,20 +132,20 @@ msgstr "Tamaño total" #: WebKit/gtk/webkit/webkitdownload.cpp:375 msgid "The total size of the file" -msgstr "" +msgstr "El tamaño total del archivo" #: WebKit/gtk/webkit/webkitdownload.cpp:526 msgid "User cancelled the download" -msgstr "" +msgstr "El usuario canceló la descarga" #: WebKit/gtk/webkit/webkitsoupauthdialog.c:248 #, c-format msgid "A username and password are being requested by the site %s" -msgstr "" +msgstr "El sitio %s está solicitando un usuario y una contraseña" #: WebKit/gtk/webkit/webkitsoupauthdialog.c:278 msgid "Server message:" -msgstr "" +msgstr "Mensaje del servidor:" #: WebKit/gtk/webkit/webkitsoupauthdialog.c:291 msgid "Username:" @@ -157,9 +156,8 @@ msgid "Password:" msgstr "Contraseña:" #: WebKit/gtk/webkit/webkitsoupauthdialog.c:302 -#, fuzzy msgid "_Remember password" -msgstr "Recordar contraseña" +msgstr "_Recordar contraseña" #: WebKit/gtk/webkit/webkitwebframe.cpp:298 msgid "Name" @@ -167,7 +165,7 @@ msgstr "Nombre" #: WebKit/gtk/webkit/webkitwebframe.cpp:299 msgid "The name of the frame" -msgstr "" +msgstr "El nombre del marco" #: WebKit/gtk/webkit/webkitwebframe.cpp:305 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146 @@ -177,7 +175,7 @@ msgstr "Título" #: WebKit/gtk/webkit/webkitwebframe.cpp:306 msgid "The document title of the frame" -msgstr "" +msgstr "El nombre de documento del marco" #: WebKit/gtk/webkit/webkitwebframe.cpp:312 #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178 @@ -187,29 +185,32 @@ msgstr "URI" #: WebKit/gtk/webkit/webkitwebframe.cpp:313 msgid "The current URI of the contents displayed by the frame" -msgstr "" +msgstr "El URI actual del contenido mostrado en el marco" #: WebKit/gtk/webkit/webkitwebframe.cpp:344 msgid "Horizontal Scrollbar Policy" -msgstr "" +msgstr "Directiva de la barra de desplazamiento horizontal" #: WebKit/gtk/webkit/webkitwebframe.cpp:345 msgid "" "Determines the current policy for the horizontal scrollbar of the frame." msgstr "" +"Determina la política actual para la barra de desplazamiento horizontal del " +"marco." #: WebKit/gtk/webkit/webkitwebframe.cpp:362 msgid "Vertical Scrollbar Policy" -msgstr "" +msgstr "Directiva de la barra de desplazamiento vertical" #: WebKit/gtk/webkit/webkitwebframe.cpp:363 -#, fuzzy msgid "Determines the current policy for the vertical scrollbar of the frame." -msgstr "Determina el estado actual de la descarga" +msgstr "" +"Determina la política actual para la barra de desplazamiento vertical del " +"marco." #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147 msgid "The title of the history item" -msgstr "" +msgstr "El título del elemento del histórico" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162 msgid "Alternate Title" @@ -217,28 +218,28 @@ msgstr "Título alternativo" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163 msgid "The alternate title of the history item" -msgstr "" +msgstr "El título alternativo del elemento del histórico" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179 msgid "The URI of the history item" -msgstr "" +msgstr "El URI del elemento del histórico" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194 #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173 msgid "Original URI" -msgstr "" +msgstr "URI original" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195 msgid "The original URI of the history item" -msgstr "" +msgstr "El URI original del elemento del histórico" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210 msgid "Last visited Time" -msgstr "" +msgstr "Hora de la última visita" #: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211 msgid "The time at which the history item was last visited" -msgstr "" +msgstr "La hora en la que se vió el elemento del histórico por última vez" #: WebKit/gtk/webkit/webkitwebinspector.cpp:268 msgid "Web View" @@ -246,23 +247,23 @@ msgstr "Vista web" #: WebKit/gtk/webkit/webkitwebinspector.cpp:269 msgid "The Web View that renders the Web Inspector itself" -msgstr "" +msgstr "La vista de web que renderiza el inspector web en sí" #: WebKit/gtk/webkit/webkitwebinspector.cpp:282 msgid "Inspected URI" -msgstr "" +msgstr "URI inspeccionada" #: WebKit/gtk/webkit/webkitwebinspector.cpp:283 msgid "The URI that is currently being inspected" -msgstr "" +msgstr "El URI que actualmente está siendo inspeccionado" #: WebKit/gtk/webkit/webkitwebinspector.cpp:299 msgid "Enable JavaScript profiling" -msgstr "" +msgstr "Activar perfilado de JavaScript" #: WebKit/gtk/webkit/webkitwebinspector.cpp:300 msgid "Profile the executed JavaScript." -msgstr "" +msgstr "Perfilar el JavaScript ejecutado." #: WebKit/gtk/webkit/webkitwebinspector.cpp:315 msgid "Enable Timeline profiling" @@ -278,11 +279,11 @@ msgstr "Razón" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159 msgid "The reason why this navigation is occurring" -msgstr "" +msgstr "La razón por la cuál está ocurriendo esta navegación" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174 msgid "The URI that was requested as the target for the navigation" -msgstr "" +msgstr "El URI solicitado como el objetivo para la navegación" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188 msgid "Button" @@ -290,23 +291,24 @@ msgstr "Botón" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189 msgid "The button used to click" -msgstr "" +msgstr "El botón usado para pulsar" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204 msgid "Modifier state" -msgstr "" +msgstr "Estado del modificador" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205 msgid "A bitmask representing the state of the modifier keys" msgstr "" +"Una máscara de bits que representa el estado de las teclas modificadoras" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220 msgid "Target frame" -msgstr "" +msgstr "Marco de destino" #: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221 msgid "The target frame for the navigation" -msgstr "" +msgstr "El marco de destino para la navegación" #: WebKit/gtk/webkit/webkitwebsettings.cpp:237 msgid "Default Encoding" @@ -314,55 +316,59 @@ msgstr "Codificación predeterminada" #: WebKit/gtk/webkit/webkitwebsettings.cpp:238 msgid "The default encoding used to display text." -msgstr "" +msgstr "La codificación predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:246 msgid "Cursive Font Family" -msgstr "" +msgstr "Tipografía cursiva" #: WebKit/gtk/webkit/webkitwebsettings.cpp:247 msgid "The default Cursive font family used to display text." msgstr "" +"La familia tipográfica cursiva predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:255 msgid "Default Font Family" -msgstr "" +msgstr "Tipografía predeterminada" #: WebKit/gtk/webkit/webkitwebsettings.cpp:256 msgid "The default font family used to display text." -msgstr "" +msgstr "La familia tipográfica predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:264 msgid "Fantasy Font Family" -msgstr "" +msgstr "Familia de tipografía fantasía" #: WebKit/gtk/webkit/webkitwebsettings.cpp:265 msgid "The default Fantasy font family used to display text." msgstr "" +"La familia tipográfica fantasía predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:273 msgid "Monospace Font Family" -msgstr "" +msgstr "Tipografía Monospace" #: WebKit/gtk/webkit/webkitwebsettings.cpp:274 msgid "The default font family used to display monospace text." msgstr "" +"La familia tipográfica predeterminada usada para mostrar texto monoespaciado." #: WebKit/gtk/webkit/webkitwebsettings.cpp:282 msgid "Sans Serif Font Family" -msgstr "" +msgstr "Tipografía Sans Serif" #: WebKit/gtk/webkit/webkitwebsettings.cpp:283 msgid "The default Sans Serif font family used to display text." msgstr "" +"La familia tipográfica Sans Serif predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:291 msgid "Serif Font Family" -msgstr "" +msgstr "Tipografía Serif" #: WebKit/gtk/webkit/webkitwebsettings.cpp:292 msgid "The default Serif font family used to display text." -msgstr "" +msgstr "La familia tipográfica Serif predeterminada usada para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:300 msgid "Default Font Size" @@ -370,15 +376,17 @@ msgstr "Tamaño de predeterminado de tipografía" #: WebKit/gtk/webkit/webkitwebsettings.cpp:301 msgid "The default font size used to display text." -msgstr "" +msgstr "El tamaño de tipografía predeterminado usado para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:309 msgid "Default Monospace Font Size" -msgstr "" +msgstr "Tipografía predeterminada Monospace" #: WebKit/gtk/webkit/webkitwebsettings.cpp:310 msgid "The default font size used to display monospace text." msgstr "" +"El tamaño de tipografía predeterminado usado para mostrar texto " +"monoespaciado." #: WebKit/gtk/webkit/webkitwebsettings.cpp:318 msgid "Minimum Font Size" @@ -386,55 +394,55 @@ msgstr "Tamaño mínimo de tipografía" #: WebKit/gtk/webkit/webkitwebsettings.cpp:319 msgid "The minimum font size used to display text." -msgstr "" +msgstr "El mínimo tamaño de tipografía usado para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:327 msgid "Minimum Logical Font Size" -msgstr "" +msgstr "Tamaño mínimo lógico de tipografía" #: WebKit/gtk/webkit/webkitwebsettings.cpp:328 msgid "The minimum logical font size used to display text." -msgstr "" +msgstr "El tamaño mínimo lógico de tipografía usado para mostrar texto." #: WebKit/gtk/webkit/webkitwebsettings.cpp:347 msgid "Enforce 96 DPI" -msgstr "" +msgstr "Forzar 96 DPI" #: WebKit/gtk/webkit/webkitwebsettings.cpp:348 msgid "Enforce a resolution of 96 DPI" -msgstr "" +msgstr "Forzar una resolución de 96 DPI" #: WebKit/gtk/webkit/webkitwebsettings.cpp:356 msgid "Auto Load Images" -msgstr "" +msgstr "Cargar imágenes automáticamente" #: WebKit/gtk/webkit/webkitwebsettings.cpp:357 msgid "Load images automatically." -msgstr "" +msgstr "Cargar imágenes automáticamente." #: WebKit/gtk/webkit/webkitwebsettings.cpp:365 msgid "Auto Shrink Images" -msgstr "" +msgstr "Autoencoger imágenes" #: WebKit/gtk/webkit/webkitwebsettings.cpp:366 msgid "Automatically shrink standalone images to fit." -msgstr "" +msgstr "Encoger imágenes independientes para ajustarlas." #: WebKit/gtk/webkit/webkitwebsettings.cpp:374 msgid "Print Backgrounds" -msgstr "" +msgstr "Imprimir fondos" #: WebKit/gtk/webkit/webkitwebsettings.cpp:375 msgid "Whether background images should be printed." -msgstr "" +msgstr "Indica si se deben imprimir las imágenes de fondo." #: WebKit/gtk/webkit/webkitwebsettings.cpp:383 msgid "Enable Scripts" -msgstr "" +msgstr "Activar scripts" #: WebKit/gtk/webkit/webkitwebsettings.cpp:384 msgid "Enable embedded scripting languages." -msgstr "" +msgstr "Activar lenguajes de scrpting empotrados" #: WebKit/gtk/webkit/webkitwebsettings.cpp:392 msgid "Enable Plugins" @@ -442,15 +450,15 @@ msgstr "Activar complementos" #: WebKit/gtk/webkit/webkitwebsettings.cpp:393 msgid "Enable embedded plugin objects." -msgstr "" +msgstr "Activar objetos de complemento empotrados." #: WebKit/gtk/webkit/webkitwebsettings.cpp:401 msgid "Resizable Text Areas" -msgstr "" +msgstr "Áreas de texto redimensionables" #: WebKit/gtk/webkit/webkitwebsettings.cpp:402 msgid "Whether text areas are resizable." -msgstr "" +msgstr "Indica si las áreas de texto son redimensionables." #: WebKit/gtk/webkit/webkitwebsettings.cpp:409 msgid "User Stylesheet URI" @@ -458,47 +466,49 @@ msgstr "URI de la hoja de estilo del usuario" #: WebKit/gtk/webkit/webkitwebsettings.cpp:410 msgid "The URI of a stylesheet that is applied to every page." -msgstr "" +msgstr "El URI de una hoja de estilo que se aplica a cada página." #: WebKit/gtk/webkit/webkitwebsettings.cpp:425 msgid "Zoom Stepping Value" -msgstr "" +msgstr "Valor del paso de la ampliación" #: WebKit/gtk/webkit/webkitwebsettings.cpp:426 msgid "The value by which the zoom level is changed when zooming in or out." msgstr "" +"El valor por el cuál el nivel de ampliación se cambia al ampliar o reducir." #: WebKit/gtk/webkit/webkitwebsettings.cpp:444 msgid "Enable Developer Extras" -msgstr "" +msgstr "Activar extras para desarrolladores" #: WebKit/gtk/webkit/webkitwebsettings.cpp:445 msgid "Enables special extensions that help developers" -msgstr "" +msgstr "Activa extensiones especiales para ayudar a los desarrolladores" #: WebKit/gtk/webkit/webkitwebsettings.cpp:465 msgid "Enable Private Browsing" -msgstr "" +msgstr "Activar navegación privada" #: WebKit/gtk/webkit/webkitwebsettings.cpp:466 msgid "Enables private browsing mode" -msgstr "" +msgstr "Activa el modo de navegación privado" #: WebKit/gtk/webkit/webkitwebsettings.cpp:481 msgid "Enable Spell Checking" -msgstr "" +msgstr "Activar revisión ortográfica" #: WebKit/gtk/webkit/webkitwebsettings.cpp:482 msgid "Enables spell checking while typing" -msgstr "" +msgstr "Activa la revisión ortográfica al escribir" #: WebKit/gtk/webkit/webkitwebsettings.cpp:505 msgid "Languages to use for spell checking" -msgstr "" +msgstr "Idiomas que usar para la revisión ortográfica" #: WebKit/gtk/webkit/webkitwebsettings.cpp:506 msgid "Comma separated list of languages to use for spell checking" msgstr "" +"Lista separada por comas de los idiomas que usar para la revisión ortográfica" #: WebKit/gtk/webkit/webkitwebsettings.cpp:520 msgid "Enable Caret Browsing" @@ -510,11 +520,11 @@ msgstr "" #: WebKit/gtk/webkit/webkitwebsettings.cpp:536 msgid "Enable HTML5 Database" -msgstr "" +msgstr "Activar la base de datos de HTML5" #: WebKit/gtk/webkit/webkitwebsettings.cpp:537 msgid "Whether to enable HTML5 database support" -msgstr "" +msgstr "Indica si se debe activar el soporte para la base de datos de HTML5" #: WebKit/gtk/webkit/webkitwebsettings.cpp:552 msgid "Enable HTML5 Local Storage" @@ -526,11 +536,11 @@ msgstr "" #: WebKit/gtk/webkit/webkitwebsettings.cpp:567 msgid "Enable XSS Auditor" -msgstr "" +msgstr "Activar el auditor de XSS" #: WebKit/gtk/webkit/webkitwebsettings.cpp:568 msgid "Whether to enable teh XSS auditor" -msgstr "" +msgstr "Indica si se debe activar el auditor de XSS" #: WebKit/gtk/webkit/webkitwebsettings.cpp:586 msgid "User Agent" @@ -608,15 +618,15 @@ msgstr "" #: WebKit/gtk/webkit/webkitwebsettings.cpp:763 msgid "Enable page cache" -msgstr "" +msgstr "Activar caché de páginas" #: WebKit/gtk/webkit/webkitwebsettings.cpp:764 msgid "Whether the page cache should be used" -msgstr "" +msgstr "Indica si se debería usar la caché de páginas" #: WebKit/gtk/webkit/webkitwebsettings.cpp:784 msgid "Auto Resize Window" -msgstr "" +msgstr "Autoredimensionar ventana" #: WebKit/gtk/webkit/webkitwebsettings.cpp:785 msgid "Automatically resize the toplevel window when a page requests it" @@ -624,19 +634,21 @@ msgstr "" #: WebKit/gtk/webkit/webkitwebsettings.cpp:817 msgid "Enable Java Applet" -msgstr "" +msgstr "Activar la miniaplicación de Java" #: WebKit/gtk/webkit/webkitwebsettings.cpp:818 msgid "Whether Java Applet support through <applet> should be enabled" msgstr "" +"Indica si se debería activar el soporte de miniaplicaciones Java a través de " +"<applet>" #: WebKit/gtk/webkit/webkitwebview.cpp:2319 msgid "Returns the @web_view's document title" -msgstr "" +msgstr "Devuelve el título del documento de @web_view" #: WebKit/gtk/webkit/webkitwebview.cpp:2333 msgid "Returns the current URI of the contents displayed by the @web_view" -msgstr "" +msgstr "Devuelve el contenido actual del URI mostrado en @web_view" #: WebKit/gtk/webkit/webkitwebview.cpp:2346 msgid "Copy target list" @@ -645,6 +657,8 @@ msgstr "Copiar la lista de destinos" #: WebKit/gtk/webkit/webkitwebview.cpp:2347 msgid "The list of targets this web view supports for clipboard copying" msgstr "" +"La lista de objetivos que esta vista web soporta para copiar desde el " +"portapapeles" #: WebKit/gtk/webkit/webkitwebview.cpp:2360 msgid "Paste target list" @@ -653,6 +667,8 @@ msgstr "Pegar la lista de destinos" #: WebKit/gtk/webkit/webkitwebview.cpp:2361 msgid "The list of targets this web view supports for clipboard pasting" msgstr "" +"La lista de objetivos que esta vista web soporta para pegar desde el " +"portapapeles" #: WebKit/gtk/webkit/webkitwebview.cpp:2367 msgid "Settings" @@ -660,7 +676,7 @@ msgstr "Ajustes" #: WebKit/gtk/webkit/webkitwebview.cpp:2368 msgid "An associated WebKitWebSettings instance" -msgstr "" +msgstr "Una instancia asociada de WebKitWebSettings" #: WebKit/gtk/webkit/webkitwebview.cpp:2381 msgid "Web Inspector" @@ -668,7 +684,7 @@ msgstr "Inspector web" #: WebKit/gtk/webkit/webkitwebview.cpp:2382 msgid "The associated WebKitWebInspector instance" -msgstr "" +msgstr "La instanacia aosiciada de WebKitWebInspector" #: WebKit/gtk/webkit/webkitwebview.cpp:2402 msgid "Editable" @@ -676,7 +692,7 @@ msgstr "Editable" #: WebKit/gtk/webkit/webkitwebview.cpp:2403 msgid "Whether content can be modified by the user" -msgstr "" +msgstr "Indica si el usuario puede modificar el contenido" #: WebKit/gtk/webkit/webkitwebview.cpp:2409 msgid "Transparent" @@ -684,7 +700,7 @@ msgstr "Transparente" #: WebKit/gtk/webkit/webkitwebview.cpp:2410 msgid "Whether content has a transparent background" -msgstr "" +msgstr "Indica si el contenido tiene un fondo transparente" #: WebKit/gtk/webkit/webkitwebview.cpp:2423 msgid "Zoom level" @@ -696,11 +712,11 @@ msgstr "El nivel de ampliación del contenido" #: WebKit/gtk/webkit/webkitwebview.cpp:2439 msgid "Full content zoom" -msgstr "" +msgstr "Ampliación completa del contenido" #: WebKit/gtk/webkit/webkitwebview.cpp:2440 msgid "Whether the full content is scaled when zooming" -msgstr "" +msgstr "Indica si el contenido completo se escala al ampliar" #: WebKit/gtk/webkit/webkitwebview.cpp:2453 msgid "Encoding" @@ -712,15 +728,15 @@ msgstr "La codificación predeterminada de la vista web" #: WebKit/gtk/webkit/webkitwebview.cpp:2467 msgid "Custom Encoding" -msgstr "" +msgstr "Codificación personalizada" #: WebKit/gtk/webkit/webkitwebview.cpp:2468 msgid "The custom encoding of the web view" -msgstr "" +msgstr "La codificación de caracteres personalizada de la vista de la web" #: WebKit/gtk/webkit/webkitwebview.cpp:2520 msgid "Icon URI" -msgstr "" +msgstr "Icono de URI" #: WebKit/gtk/webkit/webkitwebview.cpp:2521 msgid "The URI for the favicon for the #WebKitWebView." @@ -738,6 +754,8 @@ msgstr "Restablecer" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70 msgid "This is a searchable index. Enter search keywords: " msgstr "" +"Es un índice en el que se puede buscar. Introduzca palabras clave de " +"búsqueda:" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75 msgid "Choose File" @@ -781,7 +799,7 @@ msgstr "Re_cargar" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183 msgid "No Guesses Found" -msgstr "" +msgstr "No se encontró ninguna sugerencia" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188 msgid "_Ignore Spelling" @@ -797,7 +815,7 @@ msgstr "_Buscar en la web" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203 msgid "_Look Up in Dictionary" -msgstr "" +msgstr "_Buscar en diccionario" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208 msgid "_Open Link" @@ -817,19 +835,19 @@ msgstr "_Mostrar ortografía y gramática" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223 msgid "_Hide Spelling and Grammar" -msgstr "" +msgstr "_Ocultar ortografía y grámatica" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228 msgid "_Check Document Now" -msgstr "" +msgstr "_Comprobar documento ahora" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233 msgid "Check Spelling While _Typing" -msgstr "" +msgstr "Comprobar ortografía al _escribir" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238 msgid "Check _Grammar With Spelling" -msgstr "" +msgstr "Comprobar gra_mática y ortografía" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243 msgid "_Font" @@ -837,7 +855,7 @@ msgstr "_Tipografía" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266 msgid "_Outline" -msgstr "" +msgstr "C_ontorno" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271 msgid "Inspect _Element" @@ -865,7 +883,7 @@ msgstr "definición" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301 msgid "press" -msgstr "" +msgstr "pulsar" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306 msgid "select" @@ -897,23 +915,23 @@ msgstr "Desconocido" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364 msgid "Loading..." -msgstr "" +msgstr "Cargando…" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369 msgid "Live Broadcast" -msgstr "" +msgstr "En directo" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375 msgid "audio element controller" -msgstr "" +msgstr "controlador de elemento de sonido" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377 msgid "video element controller" -msgstr "" +msgstr "controlador de elemento de vídeo" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379 msgid "mute" -msgstr "" +msgstr "silenciar" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381 msgid "unmute" @@ -921,15 +939,15 @@ msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383 msgid "play" -msgstr "" +msgstr "play" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385 msgid "pause" -msgstr "" +msgstr "pause" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387 msgid "movie time" -msgstr "" +msgstr "tiempo de la película" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389 msgid "timeline slider thumb" @@ -937,28 +955,27 @@ msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391 msgid "back 30 seconds" -msgstr "" +msgstr "atrás 30 segundos" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393 msgid "return to realtime" -msgstr "" +msgstr "volver a tiempo real" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395 msgid "elapsed time" -msgstr "" +msgstr "tiempo transcurrido" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397 msgid "remaining time" -msgstr "" +msgstr "tiempo restante" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399 -#, fuzzy msgid "status" -msgstr "Estado" +msgstr "estado" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401 msgid "fullscreen" -msgstr "" +msgstr "pantalla completa" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403 msgid "fast forward" @@ -1026,7 +1043,7 @@ msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442 msgid "current movie status" -msgstr "" +msgstr "estado actual de la película" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444 msgid "seek quickly back" @@ -1049,9 +1066,8 @@ msgid "stop displaying closed captions" msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461 -#, fuzzy msgid "indefinite time" -msgstr "definición" +msgstr "tiempo indefinido" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491 msgid "value missing" @@ -1067,7 +1083,7 @@ msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507 msgid "too long" -msgstr "" +msgstr "demasiado largo" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512 msgid "range underflow" @@ -1080,6 +1096,3 @@ msgstr "" #: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522 msgid "step mismatch" msgstr "" - -#~ msgid "_Searchable Index" -#~ msgstr "Índice buscable" diff --git a/WebKit/gtk/tests/testdomdocument.c b/WebKit/gtk/tests/testdomdocument.c index 4c677ea..ec2f579 100644 --- a/WebKit/gtk/tests/testdomdocument.c +++ b/WebKit/gtk/tests/testdomdocument.c @@ -75,7 +75,7 @@ static void test_dom_document_title(DomDocumentFixture* fixture, gconstpointer d g_assert(title); g_assert_cmpstr(title, ==, "This is the title"); g_free(title); - webkit_dom_document_set_title(document, (gchar*)"This is the second title"); + webkit_dom_document_set_title(document, "This is the second title"); title = webkit_dom_document_get_title(document); g_assert(title); g_assert_cmpstr(title, ==, "This is the second title"); @@ -89,7 +89,7 @@ static void test_dom_document_get_elements_by_tag_name(DomDocumentFixture* fixtu g_assert(view); WebKitDOMDocument* document = webkit_web_view_get_dom_document(view); g_assert(document); - WebKitDOMNodeList* list = webkit_dom_document_get_elements_by_tag_name(document, (gchar*)"li"); + WebKitDOMNodeList* list = webkit_dom_document_get_elements_by_tag_name(document, "li"); g_assert(list); gulong length = webkit_dom_node_list_get_length(list); g_assert_cmpint(length, ==, 3); @@ -116,7 +116,7 @@ static void test_dom_document_get_elements_by_class_name(DomDocumentFixture* fix g_assert(view); WebKitDOMDocument* document = webkit_web_view_get_dom_document(view); g_assert(document); - WebKitDOMNodeList* list = webkit_dom_document_get_elements_by_class_name(document, (gchar*)"test"); + WebKitDOMNodeList* list = webkit_dom_document_get_elements_by_class_name(document, "test"); g_assert(list); gulong length = webkit_dom_node_list_get_length(list); g_assert_cmpint(length, ==, 2); @@ -139,17 +139,17 @@ static void test_dom_document_get_element_by_id(DomDocumentFixture* fixture, gco g_assert(view); WebKitDOMDocument* document = webkit_web_view_get_dom_document(view); g_assert(document); - WebKitDOMElement* element = webkit_dom_document_get_element_by_id(document, (gchar*)"testok"); + WebKitDOMElement* element = webkit_dom_document_get_element_by_id(document, "testok"); g_assert(element); - element = webkit_dom_document_get_element_by_id(document, (gchar*)"this-id-does-not-exist"); + element = webkit_dom_document_get_element_by_id(document, "this-id-does-not-exist"); g_assert(element == 0); /* The DOM spec says the return value is undefined when there's * more than one element with the same id; in our case the first * one will be returned */ - element = webkit_dom_document_get_element_by_id(document, (gchar*)"testbad"); + element = webkit_dom_document_get_element_by_id(document, "testbad"); g_assert(element); WebKitDOMHTMLElement* htmlElement = (WebKitDOMHTMLElement*)element; - g_assert_cmpstr(webkit_dom_html_element_get_inner_text(htmlElement), ==, (gchar*)"first"); + g_assert_cmpstr(webkit_dom_html_element_get_inner_text(htmlElement), ==, "first"); } static void test_dom_document_get_links(DomDocumentFixture* fixture, gconstpointer data) diff --git a/WebKit/gtk/tests/testdomdomwindow.c b/WebKit/gtk/tests/testdomdomwindow.c index 1796057..a52bca5 100644 --- a/WebKit/gtk/tests/testdomdomwindow.c +++ b/WebKit/gtk/tests/testdomdomwindow.c @@ -26,7 +26,7 @@ #if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) -#define HTML_DOCUMENT "<html><head><title>This is the title</title></head><body></body></html>" +#define HTML_DOCUMENT "<html><head><title>This is the title</title></head><body><p id='test'>test</p></body></html>" typedef struct { GtkWidget* webView; @@ -108,7 +108,7 @@ static void load_event_callback(WebKitWebView* webView, GParamSpec* spec, DomDom g_signal_connect(fixture->domWindow, "click-event", G_CALLBACK(clickedCallback), fixture); g_assert(fixture->clicked == FALSE); - gtk_test_widget_click (GTK_WIDGET(fixture->webView), 1, 0); + gtk_test_widget_click(GTK_WIDGET(fixture->webView), 1, 0); } } @@ -132,12 +132,69 @@ static void test_dom_domview_signals(DomDomviewFixture* fixture, gconstpointer d gtk_widget_show_all(fixture->window); gtk_window_present(GTK_WINDOW(fixture->window)); - g_main_loop_run (fixture->loop); + g_main_loop_run(fixture->loop); g_assert(fixture->loaded); g_assert(fixture->clicked); } +static gboolean +clicked_cb(WebKitDOMEventTarget* target, WebKitDOMEvent* event, DomDomviewFixture* fixture) +{ + g_assert(fixture->clicked == FALSE); + fixture->clicked = TRUE; + finish_loading(fixture); + return FALSE; +} + +static void load_status_callback(WebKitWebView* webView, GParamSpec* spec, DomDomviewFixture* fixture) +{ + WebKitLoadStatus status = webkit_web_view_get_load_status(webView); + if (status == WEBKIT_LOAD_FINISHED) { + WebKitDOMDocument* document; + WebKitDOMDOMWindow* domWindow; + WebKitDOMElement* element; + WebKitDOMEvent* event; + glong clientX, clientY; + + document = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(fixture->webView)); + g_assert(document); + domWindow = webkit_dom_document_get_default_view(document); + g_assert(domWindow); + fixture->domWindow = domWindow; + + element = webkit_dom_document_get_element_by_id(document, "test"); + g_assert(element); + event = webkit_dom_document_create_event(document, "MouseEvent", NULL); + g_assert(event); + g_assert(WEBKIT_DOM_IS_EVENT(event)); + g_assert(WEBKIT_DOM_IS_MOUSE_EVENT(event)); + clientX = webkit_dom_element_get_client_left(element); + clientY = webkit_dom_element_get_client_top(element); + webkit_dom_mouse_event_init_mouse_event(WEBKIT_DOM_MOUSE_EVENT(event), + "click", TRUE, TRUE, + fixture->domWindow, 0, 0, 0, clientX, clientY, + FALSE, FALSE, FALSE, FALSE, + 1, WEBKIT_DOM_EVENT_TARGET(element)); + g_signal_connect(element, "click-event", G_CALLBACK(clicked_cb), fixture); + g_assert(fixture->clicked == FALSE); + webkit_dom_event_target_dispatch_event(WEBKIT_DOM_EVENT_TARGET(element), event, NULL); + } + +} + +static void test_dom_domview_dispatch_event(DomDomviewFixture* fixture, gconstpointer data) +{ + g_signal_connect(fixture->window, "map-event", G_CALLBACK(map_event_cb), fixture); + g_signal_connect(fixture->webView, "notify::load-status", G_CALLBACK(load_status_callback), fixture); + + gtk_widget_show_all(fixture->window); + gtk_window_present(GTK_WINDOW(fixture->window)); + + g_main_loop_run (fixture->loop); + g_assert(fixture->clicked); +} + int main(int argc, char** argv) { if (!g_thread_supported()) @@ -153,6 +210,12 @@ int main(int argc, char** argv) test_dom_domview_signals, dom_domview_fixture_teardown); + g_test_add("/webkit/domdomview/dispatch_event", + DomDomviewFixture, HTML_DOCUMENT, + dom_domview_fixture_setup, + test_dom_domview_dispatch_event, + dom_domview_fixture_teardown); + return g_test_run(); } diff --git a/WebKit/gtk/tests/testdomnode.c b/WebKit/gtk/tests/testdomnode.c index b253d1d..c6056d6 100644 --- a/WebKit/gtk/tests/testdomnode.c +++ b/WebKit/gtk/tests/testdomnode.c @@ -138,7 +138,7 @@ static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body)) == FALSE); /* Insert one P element */ - p = webkit_dom_document_create_element(document, (char*)"P", NULL); + p = webkit_dom_document_create_element(document, "P", NULL); webkit_dom_node_append_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(p), NULL); /* Now it should have one, the same that we inserted */ @@ -150,7 +150,7 @@ static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); /* Replace the P tag with a DIV tag */ - div = webkit_dom_document_create_element(document, (char*)"DIV", NULL); + div = webkit_dom_document_create_element(document, "DIV", NULL); webkit_dom_node_replace_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE(p), NULL); g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); list = webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body)); diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 3ce77e6..aa19bec 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -273,6 +273,12 @@ extern "C" { void webkit_web_view_set_tooltip_text(WebKitWebView*, const char*); + WEBKIT_API void + webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const gchar* name, const gchar* value); + + WEBKIT_API gboolean + webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar* name); + WebKitDownload* webkit_download_new_with_handle(WebKitNetworkRequest* request, WebCore::ResourceHandle* handle, const WebCore::ResourceResponse& response); diff --git a/WebKit/gtk/webkit/webkitsecurityorigin.cpp b/WebKit/gtk/webkit/webkitsecurityorigin.cpp index 0ab0a9c..de074ae 100644 --- a/WebKit/gtk/webkit/webkitsecurityorigin.cpp +++ b/WebKit/gtk/webkit/webkitsecurityorigin.cpp @@ -233,7 +233,7 @@ G_CONST_RETURN gchar* webkit_security_origin_get_protocol(WebKitSecurityOrigin* g_return_val_if_fail(WEBKIT_IS_SECURITY_ORIGIN(securityOrigin), NULL); WebKitSecurityOriginPrivate* priv = securityOrigin->priv; - WebCore::String protocol = priv->coreOrigin->protocol(); + WTF::String protocol = priv->coreOrigin->protocol(); if (!priv->protocol) priv->protocol = g_strdup(protocol.utf8().data()); @@ -256,7 +256,7 @@ G_CONST_RETURN gchar* webkit_security_origin_get_host(WebKitSecurityOrigin* secu g_return_val_if_fail(WEBKIT_IS_SECURITY_ORIGIN(securityOrigin), NULL); WebKitSecurityOriginPrivate* priv = securityOrigin->priv; - WebCore::String host = priv->coreOrigin->host(); + WTF::String host = priv->coreOrigin->host(); if (!priv->host) priv->host = g_strdup(host.utf8().data()); @@ -364,7 +364,7 @@ GList* webkit_security_origin_get_all_web_databases(WebKitSecurityOrigin* securi #if ENABLE(DATABASE) WebCore::SecurityOrigin* coreOrigin = core(securityOrigin); - Vector<WebCore::String> databaseNames; + Vector<WTF::String> databaseNames; if (!WebCore::DatabaseTracker::tracker().databaseNamesForOrigin(coreOrigin, databaseNames)) return NULL; diff --git a/WebKit/gtk/webkit/webkitversion.h.in b/WebKit/gtk/webkit/webkitversion.h.in index 5eb9426..ce6b569 100644 --- a/WebKit/gtk/webkit/webkitversion.h.in +++ b/WebKit/gtk/webkit/webkitversion.h.in @@ -30,6 +30,7 @@ G_BEGIN_DECLS #define WEBKIT_MICRO_VERSION (@WEBKIT_MICRO_VERSION@) #define WEBKIT_USER_AGENT_MAJOR_VERSION (@WEBKIT_USER_AGENT_MAJOR_VERSION@) #define WEBKIT_USER_AGENT_MINOR_VERSION (@WEBKIT_USER_AGENT_MINOR_VERSION@) +#define WEBKITGTK_API_VERSION (@WEBKITGTK_API_VERSION@) #define WEBKIT_CHECK_VERSION(major, minor, micro) \ (WEBKIT_MAJOR_VERSION > (major) || \ diff --git a/WebKit/gtk/webkit/webkitwebdatabase.cpp b/WebKit/gtk/webkit/webkitwebdatabase.cpp index e92c400..d4f6198 100644 --- a/WebKit/gtk/webkit/webkitwebdatabase.cpp +++ b/WebKit/gtk/webkit/webkitwebdatabase.cpp @@ -331,7 +331,7 @@ G_CONST_RETURN gchar* webkit_web_database_get_display_name(WebKitWebDatabase* we #if ENABLE(DATABASE) WebKitWebDatabasePrivate* priv = webDatabase->priv; WebCore::DatabaseDetails details = WebCore::DatabaseTracker::tracker().detailsForNameAndOrigin(priv->name, core(priv->origin)); - WebCore::String displayName = details.displayName(); + WTF::String displayName = details.displayName(); if (displayName.isEmpty()) return ""; @@ -408,8 +408,8 @@ G_CONST_RETURN gchar* webkit_web_database_get_filename(WebKitWebDatabase* webDat #if ENABLE(DATABASE) WebKitWebDatabasePrivate* priv = webDatabase->priv; - WebCore::String coreName = WebCore::String::fromUTF8(priv->name); - WebCore::String corePath = WebCore::DatabaseTracker::tracker().fullPathForDatabase(core(priv->origin), coreName); + WTF::String coreName = WTF::String::fromUTF8(priv->name); + WTF::String corePath = WebCore::DatabaseTracker::tracker().fullPathForDatabase(core(priv->origin), coreName); if (corePath.isEmpty()) return""; @@ -470,7 +470,7 @@ void webkit_remove_all_web_databases() G_CONST_RETURN gchar* webkit_get_web_database_directory_path() { #if ENABLE(DATABASE) - WebCore::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); + WTF::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); if (path.isEmpty()) return ""; @@ -495,7 +495,7 @@ G_CONST_RETURN gchar* webkit_get_web_database_directory_path() void webkit_set_web_database_directory_path(const gchar* path) { #if ENABLE(DATABASE) - WebCore::String corePath = WebCore::String::fromUTF8(path); + WTF::String corePath = WTF::String::fromUTF8(path); WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(corePath); g_free(webkit_database_directory_path); diff --git a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp index 5177c4c..8a9153c 100644 --- a/WebKit/gtk/webkit/webkitwebhistoryitem.cpp +++ b/WebKit/gtk/webkit/webkitwebhistoryitem.cpp @@ -301,7 +301,7 @@ WebKitWebHistoryItem* webkit_web_history_item_new_with_data(const gchar* uri, co WebKitWebHistoryItemPrivate* priv = webHistoryItem->priv; WebCore::KURL historyUri(WebCore::KURL(), uri); - WebCore::String historyTitle = WebCore::String::fromUTF8(title); + WTF::String historyTitle = WTF::String::fromUTF8(title); RefPtr<WebCore::HistoryItem> item = WebCore::HistoryItem::create(historyUri, historyTitle, 0); priv->historyItem = item.release().releaseRef(); webkit_history_item_add(webHistoryItem, priv->historyItem); @@ -365,7 +365,7 @@ void webkit_web_history_item_set_alternate_title(WebKitWebHistoryItem* webHistor WebCore::HistoryItem* item = core(webHistoryItem); - item->setAlternateTitle(WebCore::String::fromUTF8(title)); + item->setAlternateTitle(WTF::String::fromUTF8(title)); g_object_notify(G_OBJECT(webHistoryItem), "alternate-title"); } diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp index d61f3ff..71a338c 100644 --- a/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -569,7 +569,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass) PROP_ENABLE_XSS_AUDITOR, g_param_spec_boolean("enable-xss-auditor", _("Enable XSS Auditor"), - _("Whether to enable teh XSS auditor"), + _("Whether to enable the XSS auditor"), TRUE, flags)); /** diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 8747d42..58d91ea 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -549,6 +549,11 @@ static gboolean webkit_web_view_expose_event(GtkWidget* widget, GdkEventExpose* ctx.restore(); } } + + ctx.save(); + ctx.clip(static_cast<IntRect>(event->area)); + frame->page()->inspectorController()->drawNodeHighlight(ctx); + ctx.restore(); } return FALSE; @@ -792,7 +797,8 @@ static gboolean webkit_web_view_focus_in_event(GtkWidget* widget, GdkEventFocus* else focusController->setFocusedFrame(core(webView)->mainFrame()); - gtk_im_context_focus_in(webView->priv->imContext); + if (focusController->focusedFrame()->editor()->canEdit()) + gtk_im_context_focus_in(webView->priv->imContext); } return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_in_event(widget, event); } @@ -4658,3 +4664,20 @@ WebKitCacheModel webkit_get_cache_model() webkit_init(); return cacheModel; } + +void webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const gchar* name, const gchar* value) +{ + g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView)); + g_return_if_fail(name); + g_return_if_fail(value); + + core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).execute(value); +} + +gboolean webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar* name) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_VIEW(webView), FALSE); + g_return_val_if_fail(name, FALSE); + + return core(webView)->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled(); +} diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog index 9e2e24d..986b00f 100644 --- a/WebKit/haiku/ChangeLog +++ b/WebKit/haiku/ChangeLog @@ -1,3 +1,22 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientHaiku.h: + * WebCoreSupport/InspectorClientHaiku.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/FrameLoaderClientHaiku.h: + * WebCoreSupport/InspectorClientHaiku.h: + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h index 8201fae..6a5b381 100644 --- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h +++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h @@ -99,7 +99,7 @@ namespace WebCore { bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); bool shouldInterruptJavaScript(); - void setStatusbarText(const WebCore::String&); + void setStatusbarText(const WTF::String&); bool tabsToLinks() const; IntRect windowResizerRect() const; diff --git a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h index 073c0c3..dfe5747 100644 --- a/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h +++ b/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h @@ -33,6 +33,7 @@ #include "FrameLoaderClient.h" #include "KURL.h" #include "ResourceResponse.h" +#include <wtf/Forward.h> class BMessenger; class WebView; @@ -44,7 +45,6 @@ namespace WebCore { class FormState; class NavigationAction; class ResourceLoader; - class String; struct LoadErrorResetToken; diff --git a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h index 3828d04..d6df4c6 100644 --- a/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h +++ b/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h @@ -31,12 +31,11 @@ #define InspectorClientHaiku_h #include "InspectorClient.h" - +#include <wtf/Forward.h> namespace WebCore { class Node; class Page; - class String; class InspectorClientHaiku : public InspectorClient { public: @@ -47,10 +46,10 @@ namespace WebCore { virtual void highlight(Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); }; } // namespace WebCore diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index bb42e9d..269110f 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,172 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-04 MORITA Hajime <morrita@google.com> + + Reviewed by Tony Chang. + + Pasting should fire textInput event. + https://bugs.webkit.org/show_bug.cgi?id=42958 + + On paste, invoke Editor instead of direct command invocation, + which allows dispatching events before actual paste. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _pasteWithPasteboard:allowPlainText:]): + +2010-08-06 Yongjun Zhang <yongjun_zhang@apple.com> + + Reviewed by Eric Seidel. + + add "const" to WebChromeClient::webView(). + https://bugs.webkit.org/show_bug.cgi?id=43631 + + Change WebChromeClient::webView() to be const because ChromeClient::didReceiveViewportArguments + is const method now, and calling webView() inside port-specific didReceiveViewportArguments + implementation fails compiling if webView() is not const. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::webView): + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-05 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Remove Invalid Asserts for Application Cache Quotas + https://bugs.webkit.org/show_bug.cgi?id=43585 + + Removed Invalid ASSERTs that would always happen for quotas + that were not noQuota(). + + * WebView/WebPreferences.mm: + (-[WebPreferences applicationCacheTotalQuota]): + (-[WebPreferences applicationCacheDefaultOriginQuota]): + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/WebBaseNetscapePluginView.h: + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebIconDatabaseClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebView/WebViewInternal.h: + +2010-08-05 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + Unify blob related feature defines to ENABLE(BLOB). + https://bugs.webkit.org/show_bug.cgi?id=43081 + + * Configurations/FeatureDefines.xcconfig: + +2010-08-03 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 6 - LayoutTest and Cleanup + + * WebCoreSupport/WebApplicationCache.h: + * WebCoreSupport/WebApplicationCache.mm: + (+[WebApplicationCache setMaximumSize:]): refactor out deleting the application caches. + (+[WebApplicationCache deleteAllApplicationCaches]): delete application caches. + +2010-08-03 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by David Kilzer. + + Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas) + https://bugs.webkit.org/show_bug.cgi?id=40627 + + Part 5 - Refactor Quota Management in WebSecurityOrigin into Managers + + Per-Origin quotas exist for Databases and Application Caches. Clients + given a WebSecurityOrigin have the ability to set the quota for any + per-origin quota type. This puts quota management into an interface + and WebSecurityOrigin allows access to quota managers for the + different types of quotas. + + This also deprecates the old methods on WebSecurityOrigin. They are + left in for now to prevent breaking older clients. + + The WebQuotaManager interface allows querying and modifying a + per-origin quota. This is implemented for both Databases and + Application Caches. + + * Misc/WebQuotaManager.h: Added. Interface for quota management (usage, quota, setQuota). + * Storage/WebDatabaseQuotaManager.h: Added. + * Storage/WebDatabaseQuotaManager.mm: Added. + (-[WebDatabaseQuotaManager origin]): + (-[WebDatabaseQuotaManager usage]): + (-[WebDatabaseQuotaManager quota]): + (-[WebDatabaseQuotaManager setQuota:]): + * Storage/WebDatabaseSecurityOrigin.h: Removed. + * Storage/WebDatabaseSecurityOrigin.mm: Removed. + * WebCoreSupport/WebApplicationCacheQuotaManager.h: Added. + * WebCoreSupport/WebApplicationCacheQuotaManager.mm: Added. + (-[WebApplicationCacheQuotaManager origin]): + (-[WebApplicationCacheQuotaManager usage]): + (-[WebApplicationCacheQuotaManager quota]): + (-[WebApplicationCacheQuotaManager setQuota:]): + * WebCoreSupport/WebSecurityOriginPrivate.h: Added a category to access managers. Deprecated old methods. + + Remove the WebSecurityOrigin sub-classes. Managers are better. + + * WebCoreSupport/WebApplicationCacheSecurityOrigin.h: Removed. + * WebCoreSupport/WebApplicationCacheSecurityOrigin.mm: Removed. + + Create the managers lazily. Change old style calls to make use + of the managers. + + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::exceededDatabaseQuota): + (WebChromeClient::reachedApplicationCacheOriginQuota): + * WebCoreSupport/WebSecurityOrigin.mm: + (-[WebSecurityOrigin applicationCacheQuotaManager]): + (-[WebSecurityOrigin databaseQuotaManager]): + (-[WebSecurityOrigin dealloc]): release the managers if they exist. + +2010-08-03 Alex Milowski <alex@milowski.com> + + Reviewed by Beth Dakin. + + Changed the ENABLE_MATHML value to enable MathML by default. + + * Configurations/FeatureDefines.xcconfig: + 2010-08-02 Brady Eidson <beidson@apple.com> Reviewed by Anders Carlsson. diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 9810cf7..f2b4c09 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -46,8 +46,8 @@ ENABLE_3D_RENDERING_macosx_1050 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_macosx_1060 = ENABLE_3D_RENDERING; ENABLE_3D_RENDERING_macosx_1070 = ENABLE_3D_RENDERING; -ENABLE_BLOB_SLICE = $(ENABLE_BLOB_SLICE_$(REAL_PLATFORM_NAME)); -ENABLE_BLOB_SLICE_macosx = ENABLE_BLOB_SLICE; +ENABLE_BLOB = $(ENABLE_BLOB_$(REAL_PLATFORM_NAME)); +ENABLE_BLOB_macosx = ENABLE_BLOB; ENABLE_CHANNEL_MESSAGING = $(ENABLE_CHANNEL_MESSAGING_$(REAL_PLATFORM_NAME)); ENABLE_CHANNEL_MESSAGING_macosx = ENABLE_CHANNEL_MESSAGING; @@ -69,9 +69,6 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = $(ENABLE_FILTERS_$(REAL_PLATFORM_NAME)); ENABLE_FILTERS_macosx = ENABLE_FILTERS; -ENABLE_FILE_READER = $(ENABLE_FILE_READER_$(REAL_PLATFORM_NAME)); -ENABLE_FILE_READER_macosx = ENABLE_FILE_READER; - ENABLE_FILE_WRITER = ; ENABLE_FILE_SYSTEM = ; ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; @@ -83,7 +80,7 @@ ENABLE_IMAGE_RESIZER = ; ENABLE_INDEXED_DATABASE = ; ENABLE_INPUT_SPEECH = ; ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; -ENABLE_MATHML = ; +ENABLE_MATHML = ENABLE_MATHML; ENABLE_METER_TAG = ENABLE_METER_TAG; ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; @@ -123,4 +120,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_WRITER) $(ENABLE_FILE_SYSTEM) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index cc30ce9..deb52b6 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 5; +MINOR_VERSION = 6; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/Misc/WebQuotaManager.h b/WebKit/mac/Misc/WebQuotaManager.h new file mode 100644 index 0000000..45074e4 --- /dev/null +++ b/WebKit/mac/Misc/WebQuotaManager.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 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 met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * 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. + */ + +@class WebSecurityOrigin; + +/*! + @protocol WebQuotaManager + @discussion This protocol is used to view and manipulate a per-origin storage quota. +*/ +@protocol WebQuotaManager + +/*! + @method initWithOrigin: + @param The security origin this will manage. + @result A new WebQuotaManager object. +*/ +- (id)initWithOrigin:(WebSecurityOrigin *)origin; + +/*! + @method origin + @result The security origin this manager is managing. +*/ +- (WebSecurityOrigin *)origin; + +/*! + @method usage + @result The current total usage of all relevant items in this security origin in bytes. +*/ +- (unsigned long long)usage; + +/*! + @method quota + @result The current quota of security origin in bytes. +*/ +- (unsigned long long)quota; + +/*! + @method setQuota: + @param Sets a new quota, in bytes, on this security origin. +*/ +- (void)setQuota:(unsigned long long)quota; + +@end diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h index e1f02ac..b88f1a4 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h @@ -44,28 +44,28 @@ class NetscapePluginHostManager { public: static NetscapePluginHostManager& shared(); - PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); + PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); void pluginHostDied(NetscapePluginHostProxy*); - static void createPropertyListFile(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture); + static void createPropertyListFile(const WTF::String& pluginPath, cpu_type_t pluginArchitecture); void didCreateWindow(); private: - NetscapePluginHostProxy* hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, bool useProxiedOpenPanel); + NetscapePluginHostProxy* hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const WTF::String& bundleIdentifier, bool useProxiedOpenPanel); NetscapePluginHostManager(); ~NetscapePluginHostManager(); - bool spawnPluginHost(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); + bool spawnPluginHost(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); bool initializeVendorPort(); mach_port_t m_pluginVendorPort; // FIXME: This should really be a HashMap of RetainPtrs, but that doesn't work right now. - typedef HashMap<WebCore::String, NetscapePluginHostProxy*> PluginHostMap; + typedef HashMap<WTF::String, NetscapePluginHostProxy*> PluginHostMap; PluginHostMap m_pluginHosts; }; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm index baec6ba..22874df 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm @@ -70,7 +70,7 @@ NetscapePluginHostManager::~NetscapePluginHostManager() { } -NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel) +NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WTF::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel) { pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(pluginPath, 0); diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 9ca5b5a..3081120 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -32,16 +32,13 @@ #include <WebCore/Timer.h> #include <WebKit/npapi.h> #include <wtf/Deque.h> +#include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> #include <wtf/RetainPtr.h> #include "WebKitPluginHostTypes.h" -namespace WebCore { - class String; -} - namespace JSC { namespace Bindings { class Instance; @@ -112,7 +109,7 @@ public: bool getPluginElementNPObject(uint32_t& objectID); bool forgetBrowserObjectID(uint32_t objectID); // Will fail if the ID is being sent to plug-in right now (i.e., retain/release calls aren't balanced). - bool evaluate(uint32_t objectID, const WebCore::String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups); + bool evaluate(uint32_t objectID, const WTF::String& script, data_t& resultData, mach_msg_type_number_t& resultLength, bool allowPopups); bool invoke(uint32_t objectID, const JSC::Identifier& methodName, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool invokeDefault(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); bool construct(uint32_t objectID, data_t argumentsData, mach_msg_type_number_t argumentsLength, data_t& resultData, mach_msg_type_number_t& resultLength); @@ -170,7 +167,7 @@ public: void didDraw(); void privateBrowsingModeDidChange(bool isPrivateBrowsingEnabled); - static void setGlobalException(const WebCore::String&); + static void setGlobalException(const WTF::String&); static void moveGlobalExceptionToExecState(JSC::ExecState*); // Reply structs diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h index 4c8ea84..9a29cc2 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.h +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.h @@ -31,6 +31,7 @@ #import "WebNetscapePluginPackage.h" #import "WebPluginContainerCheck.h" +#import <wtf/Forward.h> #import <wtf/OwnPtr.h> #import <wtf/PassRefPtr.h> #import <wtf/RefPtr.h> @@ -41,10 +42,6 @@ @class WebFrame; @class WebView; -namespace WTF { - class CString; -} - namespace WebCore { class HTMLPlugInElement; } diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.h b/WebKit/mac/Plugins/WebBasePluginPackage.h index ca2ddcd..a42a82e 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.h +++ b/WebKit/mac/Plugins/WebBasePluginPackage.h @@ -57,7 +57,7 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); { NSMutableSet *pluginDatabases; - WebCore::String path; + WTF::String path; WebCore::PluginInfo pluginInfo; RetainPtr<CFBundleRef> cfBundle; @@ -73,16 +73,16 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); - (BOOL)load; - (void)unload; -- (const WebCore::String&)path; +- (const WTF::String&)path; - (const WebCore::PluginInfo&)pluginInfo; -- (WebCore::String)bundleIdentifier; +- (WTF::String)bundleIdentifier; -- (BOOL)supportsExtension:(const WebCore::String&)extension; -- (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType; +- (BOOL)supportsExtension:(const WTF::String&)extension; +- (BOOL)supportsMIMEType:(const WTF::String&)MIMEType; -- (NSString *)MIMETypeForExtension:(const WebCore::String&)extension; +- (NSString *)MIMETypeForExtension:(const WTF::String&)extension; - (BOOL)isQuickTimePlugIn; - (BOOL)isJavaPlugIn; diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm index 70e5889..78b0a7f 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.mm +++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -303,7 +303,7 @@ static NSString *pathByResolvingSymlinksAndAliases(NSString *thePath) return NO; } -- (BOOL)supportsMIMEType:(const WebCore::String&)mimeType +- (BOOL)supportsMIMEType:(const WTF::String&)mimeType { ASSERT(mimeType.lower() == mimeType); @@ -445,7 +445,7 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) [pluginDatabases removeObject:database]; } -- (WebCore::String)bundleIdentifier +- (WTF::String)bundleIdentifier { return CFBundleGetIdentifier(cfBundle.get()); } diff --git a/WebKit/mac/Plugins/WebNetscapePluginStream.h b/WebKit/mac/Plugins/WebNetscapePluginStream.h index 8ee9e7f..20beee2 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginStream.h +++ b/WebKit/mac/Plugins/WebNetscapePluginStream.h @@ -90,7 +90,7 @@ private: void deliverDataToFile(NSData *data); void deliverData(); - void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, const WebCore::String& mimeType, NSData *headers); + void startStream(NSURL *, long long expectedContentLength, NSDate *lastModifiedDate, const WTF::String& mimeType, NSData *headers); NSError *pluginCancelledConnectionError() const; diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h b/WebKit/mac/Storage/WebDatabaseQuotaManager.h index 09c0610..8219da4 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.h +++ b/WebKit/mac/Storage/WebDatabaseQuotaManager.h @@ -23,7 +23,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebSecurityOriginInternal.h" +#import "WebQuotaManager.h" + +@interface WebDatabaseQuotaManager : NSObject <WebQuotaManager> { + WebSecurityOrigin *_origin; +} -@interface WebApplicationCacheSecurityOrigin : WebSecurityOrigin @end diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm b/WebKit/mac/Storage/WebDatabaseQuotaManager.mm index a0c3529..e26ae33 100644 --- a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.mm +++ b/WebKit/mac/Storage/WebDatabaseQuotaManager.mm @@ -23,15 +23,56 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebDatabaseSecurityOrigin.h" -#import <WebCore/SecurityOrigin.h> +#import "WebDatabaseQuotaManager.h" + +#import "WebSecurityOriginInternal.h" +#import <WebCore/DatabaseTracker.h> using namespace WebCore; -@implementation WebDatabaseSecurityOrigin +@implementation WebDatabaseQuotaManager + +- (id)initWithOrigin:(WebSecurityOrigin *)origin +{ + self = [super init]; + if (!self) + return nil; + + _origin = origin; + return self; +} + +- (WebSecurityOrigin *)origin +{ + return _origin; +} + +- (unsigned long long)usage +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().usageForOrigin([_origin _core]); +#else + return 0; +#endif +} + +- (unsigned long long)quota +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().quotaForOrigin([_origin _core]); +#else + return 0; +#endif +} -// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 -// Proper steps should be taken to have subclass implementations of SecurityOrigin's -// origin, quota, and setQuota methods. +// If the quota is set to a value lower than the current usage, that quota will +// "stick" but no data will be purged to meet the new quota. This will simply +// prevent new data from being added to databases in that origin. +- (void)setQuota:(unsigned long long)quota +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().setQuota([_origin _core], quota); +#endif +} @end diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.h b/WebKit/mac/Storage/WebDatabaseTrackerClient.h index d06cfe9..cbb5eb7 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.h +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.h @@ -36,7 +36,7 @@ public: virtual ~WebDatabaseTrackerClient(); virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*); - virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseIdentifier); + virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WTF::String& databaseIdentifier); private: WebDatabaseTrackerClient(); }; diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.h b/WebKit/mac/WebCoreSupport/WebApplicationCache.h index 78b06b7..976ce18 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.h +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.h @@ -33,4 +33,6 @@ + (long long)defaultOriginQuota; + (void)setDefaultOriginQuota:(long long)size; ++ (void)deleteAllApplicationCaches; + @end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm index 5c2a208..45f0703 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCache.mm +++ b/WebKit/mac/WebCoreSupport/WebApplicationCache.mm @@ -39,8 +39,7 @@ using namespace WebCore; + (void)setMaximumSize:(long long)size { - cacheStorage().empty(); - cacheStorage().vacuumDatabaseFile(); + [WebApplicationCache deleteAllApplicationCaches]; cacheStorage().setMaximumSize(size); } @@ -54,6 +53,12 @@ using namespace WebCore; cacheStorage().setDefaultOriginQuota(size); } ++ (void)deleteAllApplicationCaches +{ + cacheStorage().empty(); + cacheStorage().vacuumDatabaseFile(); +} + @end #endif diff --git a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.h index a06ca3d..6d30148 100644 --- a/WebKit/mac/Storage/WebDatabaseSecurityOrigin.h +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.h @@ -23,7 +23,10 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebSecurityOriginInternal.h" +#import "WebQuotaManager.h" + +@interface WebApplicationCacheQuotaManager : NSObject <WebQuotaManager> { + WebSecurityOrigin *_origin; +} -@interface WebDatabaseSecurityOrigin : WebSecurityOrigin @end diff --git a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm index dac41ae..562bb29 100644 --- a/WebKit/mac/WebCoreSupport/WebApplicationCacheSecurityOrigin.mm +++ b/WebKit/mac/WebCoreSupport/WebApplicationCacheQuotaManager.mm @@ -23,19 +23,35 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -#import "WebApplicationCacheSecurityOrigin.h" +#import "WebApplicationCacheQuotaManager.h" +#import "WebSecurityOriginInternal.h" #import <WebCore/ApplicationCacheStorage.h> using namespace WebCore; -@implementation WebApplicationCacheSecurityOrigin +@implementation WebApplicationCacheQuotaManager + +- (id)initWithOrigin:(WebSecurityOrigin *)origin +{ + self = [super init]; + if (!self) + return nil; + + _origin = origin; + return self; +} + +- (WebSecurityOrigin *)origin +{ + return _origin; +} - (unsigned long long)usage { #if ENABLE(OFFLINE_WEB_APPLICATIONS) long long usage; - if (cacheStorage().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private), usage)) + if (cacheStorage().usageForOrigin([_origin _core], usage)) return usage; return 0; #else @@ -47,7 +63,7 @@ using namespace WebCore; { #if ENABLE(OFFLINE_WEB_APPLICATIONS) long long quota; - if (cacheStorage().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota)) + if (cacheStorage().quotaForOrigin([_origin _core], quota)) return quota; return 0; #else @@ -58,7 +74,7 @@ using namespace WebCore; - (void)setQuota:(unsigned long long)quota { #if ENABLE(OFFLINE_WEB_APPLICATIONS) - cacheStorage().storeUpdatedQuotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private), quota); + cacheStorage().storeUpdatedQuotaForOrigin([_origin _core], quota); #endif } diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index 50c159c..e5de14d 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -36,7 +36,7 @@ class WebChromeClient : public WebCore::ChromeClient { public: WebChromeClient(WebView *webView); - WebView *webView() { return m_webView; } + WebView *webView() const { return m_webView; } virtual void chromeDestroyed(); @@ -75,16 +75,16 @@ public: virtual void setResizable(bool); - virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned int lineNumber, const WebCore::String& sourceURL); + virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WTF::String& message, unsigned int lineNumber, const WTF::String& sourceURL); virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; @@ -102,18 +102,18 @@ public: virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&) const; virtual void scrollRectIntoView(const WebCore::IntRect&, const WebCore::ScrollView*) const; - virtual void setStatusbarText(const WebCore::String&); + virtual void setStatusbarText(const WTF::String&); virtual void scrollbarsModeDidChange() const { } virtual bool shouldMissingPluginMessageBeButton() const; virtual void missingPluginButtonClicked(WebCore::Element*) const; virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); - virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); + virtual void setToolTip(const WTF::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName); + virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String& databaseName); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); @@ -126,13 +126,13 @@ public: #endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void setCursor(const WebCore::Cursor&); - virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WebCore::AtomicString& type, + virtual WebCore::FloatRect customHighlightRect(WebCore::Node*, const WTF::AtomicString& type, const WebCore::FloatRect& lineRect); - virtual void paintCustomHighlight(WebCore::Node*, const WebCore::AtomicString& type, + virtual void paintCustomHighlight(WebCore::Node*, const WTF::AtomicString& type, const WebCore::FloatRect& boxRect, const WebCore::FloatRect& lineRect, bool behindText, bool entireLine); @@ -143,8 +143,8 @@ public: virtual void willPopUpMenu(NSMenu *); - virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename); - virtual WebCore::String generateReplacementFile(const WebCore::String& path); + virtual bool shouldReplaceWithGeneratedFileForUpload(const WTF::String& path, WTF::String &generatedFilename); + virtual WTF::String generateReplacementFile(const WTF::String& path); virtual void formStateDidChange(const WebCore::Node*) { } diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 1a3736e..c80721f 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -30,8 +30,6 @@ #import "WebChromeClient.h" #import "DOMNodeInternal.h" -#import "WebApplicationCacheSecurityOrigin.h" -#import "WebDatabaseSecurityOrigin.h" #import "WebDefaultUIDelegate.h" #import "WebDelegateImplementationCaching.h" #import "WebElementDictionary.h" @@ -43,6 +41,7 @@ #import "WebKitSystemInterface.h" #import "WebNSURLRequestExtras.h" #import "WebPlugin.h" +#import "WebQuotaManager.h" #import "WebSecurityOriginInternal.h" #import "WebUIDelegatePrivate.h" #import "WebView.h" @@ -559,11 +558,11 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database { BEGIN_BLOCK_OBJC_EXCEPTIONS; - WebDatabaseSecurityOrigin *webOrigin = [[WebDatabaseSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; + WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:frame->document()->securityOrigin()]; // FIXME: remove this workaround once shipping Safari has the necessary delegate implemented. if (WKAppVersionCheckLessThan(@"com.apple.Safari", -1, 3.1)) { const unsigned long long defaultQuota = 5 * 1024 * 1024; // 5 megabytes should hopefully be enough to test storage support. - [webOrigin setQuota:defaultQuota]; + [[webOrigin databaseQuotaManager] setQuota:defaultQuota]; } else CallUIDelegate(m_webView, @selector(webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:), kit(frame), webOrigin, (NSString *)databaseName); [webOrigin release]; @@ -582,7 +581,7 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin) { BEGIN_BLOCK_OBJC_EXCEPTIONS; - WebApplicationCacheSecurityOrigin *webOrigin = [[WebApplicationCacheSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]; + WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]; CallUIDelegate(m_webView, @selector(webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:), webOrigin); [webOrigin release]; diff --git a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h index c3ff4dd..077cd16 100644 --- a/WebKit/mac/WebCoreSupport/WebContextMenuClient.h +++ b/WebKit/mac/WebCoreSupport/WebContextMenuClient.h @@ -43,7 +43,7 @@ public: virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); virtual bool isSpeaking(); - virtual void speak(const WebCore::String&); + virtual void speak(const WTF::String&); virtual void stopSpeaking(); virtual void searchWithSpotlight(); diff --git a/WebKit/mac/WebCoreSupport/WebDragClient.h b/WebKit/mac/WebCoreSupport/WebDragClient.h index 234090e..216a2fb 100644 --- a/WebKit/mac/WebCoreSupport/WebDragClient.h +++ b/WebKit/mac/WebCoreSupport/WebDragClient.h @@ -36,7 +36,7 @@ public: virtual void dragControllerDestroyed(); virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WebCore::String& label, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WTF::String& label, WebCore::Frame*); virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*); private: WebView* m_webView; diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h index 1cb2a59..e6426aa 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.h +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h @@ -57,7 +57,7 @@ public: virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); virtual bool shouldInsertNode(WebCore::Node*, WebCore::Range*, WebCore::EditorInsertAction); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual bool shouldChangeSelectedRange(WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity, bool stillSelecting); virtual bool shouldApplyStyle(WebCore::CSSStyleDeclaration*, WebCore::Range*); @@ -116,17 +116,17 @@ public: virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, WTF::Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String&, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); private: diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h index d750a10..d932e66 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h @@ -43,7 +43,6 @@ namespace WebCore { class CachedFrame; class HistoryItem; class ProtectionSpace; - class String; class ResourceLoader; class ResourceRequest; } @@ -102,7 +101,7 @@ private: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String& title); + virtual void dispatchDidReceiveTitle(const WTF::String& title); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -116,9 +115,9 @@ private: virtual void dispatchShow(); virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, - const WebCore::String& MIMEType, const WebCore::ResourceRequest&); + const WTF::String& MIMEType, const WebCore::ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, - const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); + const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WTF::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>); virtual void cancelPolicyCheck(); @@ -170,16 +169,16 @@ private: virtual bool shouldFallBack(const WebCore::ResourceError&); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; - virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; + virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void saveViewStateToItem(WebCore::HistoryItem*); @@ -189,27 +188,27 @@ private: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); - virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, - const Vector<WebCore::String>&, const WebCore::String&, bool); + virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, + const Vector<WTF::String>&, const WTF::String&, bool); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, - const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues); + const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) virtual PassRefPtr<WebCore::Widget> createMediaPlayerProxyPlugin(const WebCore::IntSize&, WebCore::HTMLMediaElement*, const WebCore::KURL&, - const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&); + const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&); virtual void hideMediaPlayerProxyPlugin(WebCore::Widget*); virtual void showMediaPlayerProxyPlugin(WebCore::Widget*); #endif - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); - virtual WebCore::String overrideMediaType() const; + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType); + virtual WTF::String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h index e908242..3f9df13 100644 --- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h +++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.h @@ -27,14 +27,11 @@ */ #import <WebCore/IconDatabaseClient.h> - -namespace WebCore { - class String; -} +#import <wtf/Forward.h> class WebIconDatabaseClient : public WebCore::IconDatabaseClient { public: virtual bool performImport(); virtual void dispatchDidRemoveAllIcons(); - virtual void dispatchDidAddIconForPageURL(const WebCore::String& pageURL); + virtual void dispatchDidAddIconForPageURL(const WTF::String& pageURL); }; diff --git a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm index 1b0c834..3651dea 100644 --- a/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm +++ b/WebKit/mac/WebCoreSupport/WebIconDatabaseClient.mm @@ -48,7 +48,7 @@ void WebIconDatabaseClient::dispatchDidRemoveAllIcons() [pool drain]; } -void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WebCore::String& pageURL) +void WebIconDatabaseClient::dispatchDidAddIconForPageURL(const WTF::String& pageURL) { // This is a quick notification that is likely to fire in a rapidly iterating loop // Therefore we let WebCore handle autorelease by draining its pool "from time to time" diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.h b/WebKit/mac/WebCoreSupport/WebInspectorClient.h index bd52954..d33e3b9 100644 --- a/WebKit/mac/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.h @@ -59,10 +59,10 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); void releaseFrontendPage(); @@ -79,8 +79,8 @@ public: virtual void frontendLoaded(); - virtual WebCore::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String localizedStringsURL(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -89,12 +89,12 @@ public: virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); - virtual void inspectedURLChanged(const WebCore::String& newURL); + virtual void inspectedURLChanged(const WTF::String& newURL); private: void updateWindowTitle() const; WebView* m_inspectedWebView; RetainPtr<WebInspectorWindowController> m_windowController; - WebCore::String m_inspectedURL; + WTF::String m_inspectedURL; }; diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h index 7092157..2aa37a6 100644 --- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h +++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h @@ -34,8 +34,8 @@ class WebPasteboardHelper : public WebCore::PasteboardHelper { public: WebPasteboardHelper(WebHTMLView* view) : m_view(view) {} - virtual WebCore::String urlFromPasteboard(NSPasteboard*, WebCore::String* title) const; - virtual WebCore::String plainTextFromPasteboard(NSPasteboard*) const; + virtual WTF::String urlFromPasteboard(NSPasteboard*, WTF::String* title) const; + virtual WTF::String plainTextFromPasteboard(NSPasteboard*) const; virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const; virtual NSArray* insertablePasteboardTypes() const; private: diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h index 3d34dbe..53f39f8 100644 --- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h @@ -48,108 +48,108 @@ private: virtual void getPluginInfo(Vector<WebCore::PluginInfo>&); // WebCore::LocalizationStrategy - virtual WebCore::String inputElementAltText(); - virtual WebCore::String resetButtonDefaultLabel(); - virtual WebCore::String searchableIndexIntroduction(); - virtual WebCore::String submitButtonDefaultLabel(); - virtual WebCore::String fileButtonChooseFileLabel(); - virtual WebCore::String fileButtonNoFileSelectedLabel(); - virtual WebCore::String copyImageUnknownFileLabel(); + virtual WTF::String inputElementAltText(); + virtual WTF::String resetButtonDefaultLabel(); + virtual WTF::String searchableIndexIntroduction(); + virtual WTF::String submitButtonDefaultLabel(); + virtual WTF::String fileButtonChooseFileLabel(); + virtual WTF::String fileButtonNoFileSelectedLabel(); + virtual WTF::String copyImageUnknownFileLabel(); #if ENABLE(CONTEXT_MENUS) - virtual WebCore::String contextMenuItemTagOpenLinkInNewWindow(); - virtual WebCore::String contextMenuItemTagDownloadLinkToDisk(); - virtual WebCore::String contextMenuItemTagCopyLinkToClipboard(); - virtual WebCore::String contextMenuItemTagOpenImageInNewWindow(); - virtual WebCore::String contextMenuItemTagDownloadImageToDisk(); - virtual WebCore::String contextMenuItemTagCopyImageToClipboard(); - virtual WebCore::String contextMenuItemTagOpenFrameInNewWindow(); - virtual WebCore::String contextMenuItemTagCopy(); - virtual WebCore::String contextMenuItemTagGoBack(); - virtual WebCore::String contextMenuItemTagGoForward(); - virtual WebCore::String contextMenuItemTagStop(); - virtual WebCore::String contextMenuItemTagReload(); - virtual WebCore::String contextMenuItemTagCut(); - virtual WebCore::String contextMenuItemTagPaste(); - virtual WebCore::String contextMenuItemTagNoGuessesFound(); - virtual WebCore::String contextMenuItemTagIgnoreSpelling(); - virtual WebCore::String contextMenuItemTagLearnSpelling(); - virtual WebCore::String contextMenuItemTagSearchWeb(); - virtual WebCore::String contextMenuItemTagLookUpInDictionary(); - virtual WebCore::String contextMenuItemTagOpenLink(); - virtual WebCore::String contextMenuItemTagIgnoreGrammar(); - virtual WebCore::String contextMenuItemTagSpellingMenu(); - virtual WebCore::String contextMenuItemTagShowSpellingPanel(bool show); - virtual WebCore::String contextMenuItemTagCheckSpelling(); - virtual WebCore::String contextMenuItemTagCheckSpellingWhileTyping(); - virtual WebCore::String contextMenuItemTagCheckGrammarWithSpelling(); - virtual WebCore::String contextMenuItemTagFontMenu(); - virtual WebCore::String contextMenuItemTagBold(); - virtual WebCore::String contextMenuItemTagItalic(); - virtual WebCore::String contextMenuItemTagUnderline(); - virtual WebCore::String contextMenuItemTagOutline(); - virtual WebCore::String contextMenuItemTagWritingDirectionMenu(); - virtual WebCore::String contextMenuItemTagTextDirectionMenu(); - virtual WebCore::String contextMenuItemTagDefaultDirection(); - virtual WebCore::String contextMenuItemTagLeftToRight(); - virtual WebCore::String contextMenuItemTagRightToLeft(); - virtual WebCore::String contextMenuItemTagSearchInSpotlight(); - virtual WebCore::String contextMenuItemTagShowFonts(); - virtual WebCore::String contextMenuItemTagStyles(); - virtual WebCore::String contextMenuItemTagShowColors(); - virtual WebCore::String contextMenuItemTagSpeechMenu(); - virtual WebCore::String contextMenuItemTagStartSpeaking(); - virtual WebCore::String contextMenuItemTagStopSpeaking(); - virtual WebCore::String contextMenuItemTagCorrectSpellingAutomatically(); - virtual WebCore::String contextMenuItemTagSubstitutionsMenu(); - virtual WebCore::String contextMenuItemTagShowSubstitutions(bool show); - virtual WebCore::String contextMenuItemTagSmartCopyPaste(); - virtual WebCore::String contextMenuItemTagSmartQuotes(); - virtual WebCore::String contextMenuItemTagSmartDashes(); - virtual WebCore::String contextMenuItemTagSmartLinks(); - virtual WebCore::String contextMenuItemTagTextReplacement(); - virtual WebCore::String contextMenuItemTagTransformationsMenu(); - virtual WebCore::String contextMenuItemTagMakeUpperCase(); - virtual WebCore::String contextMenuItemTagMakeLowerCase(); - virtual WebCore::String contextMenuItemTagCapitalize(); - virtual WebCore::String contextMenuItemTagChangeBack(const WebCore::String& replacedString); - virtual WebCore::String contextMenuItemTagInspectElement(); + virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); + virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); + virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadImageToDisk(); + virtual WTF::String contextMenuItemTagCopyImageToClipboard(); + virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); + virtual WTF::String contextMenuItemTagCopy(); + virtual WTF::String contextMenuItemTagGoBack(); + virtual WTF::String contextMenuItemTagGoForward(); + virtual WTF::String contextMenuItemTagStop(); + virtual WTF::String contextMenuItemTagReload(); + virtual WTF::String contextMenuItemTagCut(); + virtual WTF::String contextMenuItemTagPaste(); + virtual WTF::String contextMenuItemTagNoGuessesFound(); + virtual WTF::String contextMenuItemTagIgnoreSpelling(); + virtual WTF::String contextMenuItemTagLearnSpelling(); + virtual WTF::String contextMenuItemTagSearchWeb(); + virtual WTF::String contextMenuItemTagLookUpInDictionary(); + virtual WTF::String contextMenuItemTagOpenLink(); + virtual WTF::String contextMenuItemTagIgnoreGrammar(); + virtual WTF::String contextMenuItemTagSpellingMenu(); + virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); + virtual WTF::String contextMenuItemTagCheckSpelling(); + virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); + virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); + virtual WTF::String contextMenuItemTagFontMenu(); + virtual WTF::String contextMenuItemTagBold(); + virtual WTF::String contextMenuItemTagItalic(); + virtual WTF::String contextMenuItemTagUnderline(); + virtual WTF::String contextMenuItemTagOutline(); + virtual WTF::String contextMenuItemTagWritingDirectionMenu(); + virtual WTF::String contextMenuItemTagTextDirectionMenu(); + virtual WTF::String contextMenuItemTagDefaultDirection(); + virtual WTF::String contextMenuItemTagLeftToRight(); + virtual WTF::String contextMenuItemTagRightToLeft(); + virtual WTF::String contextMenuItemTagSearchInSpotlight(); + virtual WTF::String contextMenuItemTagShowFonts(); + virtual WTF::String contextMenuItemTagStyles(); + virtual WTF::String contextMenuItemTagShowColors(); + virtual WTF::String contextMenuItemTagSpeechMenu(); + virtual WTF::String contextMenuItemTagStartSpeaking(); + virtual WTF::String contextMenuItemTagStopSpeaking(); + virtual WTF::String contextMenuItemTagCorrectSpellingAutomatically(); + virtual WTF::String contextMenuItemTagSubstitutionsMenu(); + virtual WTF::String contextMenuItemTagShowSubstitutions(bool show); + virtual WTF::String contextMenuItemTagSmartCopyPaste(); + virtual WTF::String contextMenuItemTagSmartQuotes(); + virtual WTF::String contextMenuItemTagSmartDashes(); + virtual WTF::String contextMenuItemTagSmartLinks(); + virtual WTF::String contextMenuItemTagTextReplacement(); + virtual WTF::String contextMenuItemTagTransformationsMenu(); + virtual WTF::String contextMenuItemTagMakeUpperCase(); + virtual WTF::String contextMenuItemTagMakeLowerCase(); + virtual WTF::String contextMenuItemTagCapitalize(); + virtual WTF::String contextMenuItemTagChangeBack(const WTF::String& replacedString); + virtual WTF::String contextMenuItemTagInspectElement(); #endif // ENABLE(CONTEXT_MENUS) - virtual WebCore::String searchMenuNoRecentSearchesText(); - virtual WebCore::String searchMenuRecentSearchesText(); - virtual WebCore::String searchMenuClearRecentSearchesText(); - virtual WebCore::String AXWebAreaText(); - virtual WebCore::String AXLinkText(); - virtual WebCore::String AXListMarkerText(); - virtual WebCore::String AXImageMapText(); - virtual WebCore::String AXHeadingText(); - virtual WebCore::String AXDefinitionListTermText(); - virtual WebCore::String AXDefinitionListDefinitionText(); - virtual WebCore::String AXARIAContentGroupText(const WebCore::String& ariaType); - virtual WebCore::String AXButtonActionVerb(); - virtual WebCore::String AXRadioButtonActionVerb(); - virtual WebCore::String AXTextFieldActionVerb(); - virtual WebCore::String AXCheckedCheckBoxActionVerb(); - virtual WebCore::String AXUncheckedCheckBoxActionVerb(); - virtual WebCore::String AXMenuListActionVerb(); - virtual WebCore::String AXMenuListPopupActionVerb(); - virtual WebCore::String AXLinkActionVerb(); - virtual WebCore::String missingPluginText(); - virtual WebCore::String crashedPluginText(); - virtual WebCore::String multipleFileUploadText(unsigned numberOfFiles); - virtual WebCore::String unknownFileSizeText(); - virtual WebCore::String imageTitle(const WebCore::String& filename, const WebCore::IntSize& size); - virtual WebCore::String mediaElementLoadingStateText(); - virtual WebCore::String mediaElementLiveBroadcastStateText(); - virtual WebCore::String localizedMediaControlElementString(const WebCore::String&); - virtual WebCore::String localizedMediaControlElementHelpText(const WebCore::String&); - virtual WebCore::String localizedMediaTimeDescription(float); - virtual WebCore::String validationMessageValueMissingText(); - virtual WebCore::String validationMessageTypeMismatchText(); - virtual WebCore::String validationMessagePatternMismatchText(); - virtual WebCore::String validationMessageTooLongText(); - virtual WebCore::String validationMessageRangeUnderflowText(); - virtual WebCore::String validationMessageRangeOverflowText(); - virtual WebCore::String validationMessageStepMismatchText(); + virtual WTF::String searchMenuNoRecentSearchesText(); + virtual WTF::String searchMenuRecentSearchesText(); + virtual WTF::String searchMenuClearRecentSearchesText(); + virtual WTF::String AXWebAreaText(); + virtual WTF::String AXLinkText(); + virtual WTF::String AXListMarkerText(); + virtual WTF::String AXImageMapText(); + virtual WTF::String AXHeadingText(); + virtual WTF::String AXDefinitionListTermText(); + virtual WTF::String AXDefinitionListDefinitionText(); + virtual WTF::String AXARIAContentGroupText(const WTF::String& ariaType); + virtual WTF::String AXButtonActionVerb(); + virtual WTF::String AXRadioButtonActionVerb(); + virtual WTF::String AXTextFieldActionVerb(); + virtual WTF::String AXCheckedCheckBoxActionVerb(); + virtual WTF::String AXUncheckedCheckBoxActionVerb(); + virtual WTF::String AXMenuListActionVerb(); + virtual WTF::String AXMenuListPopupActionVerb(); + virtual WTF::String AXLinkActionVerb(); + virtual WTF::String missingPluginText(); + virtual WTF::String crashedPluginText(); + virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); + virtual WTF::String unknownFileSizeText(); + virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize& size); + virtual WTF::String mediaElementLoadingStateText(); + virtual WTF::String mediaElementLiveBroadcastStateText(); + virtual WTF::String localizedMediaControlElementString(const WTF::String&); + virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); + virtual WTF::String localizedMediaTimeDescription(float); + virtual WTF::String validationMessageValueMissingText(); + virtual WTF::String validationMessageTypeMismatchText(); + virtual WTF::String validationMessagePatternMismatchText(); + virtual WTF::String validationMessageTooLongText(); + virtual WTF::String validationMessageRangeUnderflowText(); + virtual WTF::String validationMessageRangeOverflowText(); + virtual WTF::String validationMessageStepMismatchText(); // WebCore::VisitedLinkStrategy virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); diff --git a/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h b/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h index a0d398d..ed4ff11 100644 --- a/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h +++ b/WebKit/mac/WebCoreSupport/WebPluginHalterClient.h @@ -24,10 +24,10 @@ */ #import <WebCore/PluginHalterClient.h> +#import <wtf/Forward.h> namespace WebCore { class Node; - class String; } @class WebView; @@ -36,7 +36,7 @@ class WebPluginHalterClient : public WebCore::PluginHalterClient { public: WebPluginHalterClient(WebView *); - virtual bool shouldHaltPlugin(WebCore::Node*, bool, const WebCore::String&) const; + virtual bool shouldHaltPlugin(WebCore::Node*, bool, const WTF::String&) const; virtual bool enabled() const; private: diff --git a/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm index 0d49445..f19dcb5 100644 --- a/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm +++ b/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm @@ -28,9 +28,12 @@ #import "WebSecurityOriginInternal.h" +#import "WebApplicationCacheQuotaManager.h" +#import "WebDatabaseQuotaManager.h" +#import "WebQuotaManager.h" #import <WebCore/KURL.h> -#import <WebCore/SecurityOrigin.h> #import <WebCore/DatabaseTracker.h> +#import <WebCore/SecurityOrigin.h> using namespace WebCore; @@ -69,38 +72,6 @@ using namespace WebCore; return reinterpret_cast<SecurityOrigin*>(_private)->port(); } -// FIXME: https://bugs.webkit.org/show_bug.cgi?id=40627 -// Proper steps should be taken to have subclass implementations of SecurityOrigin's -// origin, quota, and setQuota methods. - -- (unsigned long long)usage -{ -#if ENABLE(DATABASE) - return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); -#else - return 0; -#endif -} - -- (unsigned long long)quota -{ -#if ENABLE(DATABASE) - return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); -#else - return 0; -#endif -} - -// If the quota is set to a value lower than the current usage, that quota will -// "stick" but no data will be purged to meet the new quota. This will simply -// prevent new data from being added to databases in that origin -- (void)setQuota:(unsigned long long)quota -{ -#if ENABLE(DATABASE) - DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); -#endif -} - - (BOOL)isEqual:(id)anObject { if (![anObject isMemberOfClass:[WebSecurityOrigin class]]) { @@ -114,6 +85,10 @@ using namespace WebCore; { if (_private) reinterpret_cast<SecurityOrigin*>(_private)->deref(); + if (_applicationCacheQuotaManager) + [(NSObject *)_applicationCacheQuotaManager release]; + if (_databaseQuotaManager) + [(NSObject *)_databaseQuotaManager release]; [super dealloc]; } @@ -147,3 +122,62 @@ using namespace WebCore; } @end + + +#pragma mark - +#pragma mark WebQuotaManagers + +@implementation WebSecurityOrigin (WebQuotaManagers) + +- (id<WebQuotaManager>)applicationCacheQuotaManager +{ + if (!_applicationCacheQuotaManager) + _applicationCacheQuotaManager = [[WebApplicationCacheQuotaManager alloc] initWithOrigin:self]; + return _applicationCacheQuotaManager; +} + +- (id<WebQuotaManager>)databaseQuotaManager +{ + if (!_databaseQuotaManager) + _databaseQuotaManager = [[WebDatabaseQuotaManager alloc] initWithOrigin:self]; + return _databaseQuotaManager; +} + +@end + + +#pragma mark - +#pragma mark Deprecated + +// FIXME: The following methods are deprecated and should removed later. +// Clients should instead get a WebQuotaManager, and query / set the quota via the Manager. +// NOTE: the <WebCore/DatabaseTracker.h> #include should be removed as well. + +@implementation WebSecurityOrigin (Deprecated) + +- (unsigned long long)usage +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif +} + +- (unsigned long long)quota +{ +#if ENABLE(DATABASE) + return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif +} + +- (void)setQuota:(unsigned long long)quota +{ +#if ENABLE(DATABASE) + DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); +#endif +} + +@end diff --git a/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h index 6518a16..2973d92 100644 --- a/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h +++ b/WebKit/mac/WebCoreSupport/WebSecurityOriginPrivate.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,9 +27,12 @@ */ @class WebSecurityOriginPrivate; +@protocol WebQuotaManager; @interface WebSecurityOrigin : NSObject { WebSecurityOriginPrivate *_private; + id<WebQuotaManager> _applicationCacheQuotaManager; + id<WebQuotaManager> _databaseQuotaManager; } - (id)initWithURL:(NSURL *)url; @@ -40,16 +43,17 @@ // Returns zero if the port is the default port for the protocol, non-zero otherwise. - (unsigned short)port; -// Meant to be implemented in a subclass. -// Returns the current total usage of all relevant items in this security origin in bytes. -- (unsigned long long)usage; +@end -// Meant to be implemented in a subclass. -// Returns the quota of this security origin in bytes. -- (unsigned long long)quota; +@interface WebSecurityOrigin (WebQuotaManagers) +- (id<WebQuotaManager>)applicationCacheQuotaManager; +- (id<WebQuotaManager>)databaseQuotaManager; +@end -// Meant to be implemented in a subclass. -// Sets the storage quota in bytes. +// FIXME: The following methods are deprecated and should removed later. +// Clients should instead get a WebQuotaManager, and query / set the quota via the Manager. +@interface WebSecurityOrigin (Deprecated) +- (unsigned long long)usage; +- (unsigned long long)quota; - (void)setQuota:(unsigned long long)quota; - @end diff --git a/WebKit/mac/WebView/WebFrameInternal.h b/WebKit/mac/WebView/WebFrameInternal.h index 586b4c3..240b09c 100644 --- a/WebKit/mac/WebView/WebFrameInternal.h +++ b/WebKit/mac/WebView/WebFrameInternal.h @@ -92,8 +92,8 @@ WebView *getWebView(WebFrame *webFrame); @interface WebFrame (WebInternal) -+ (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; -+ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WebCore::String&)name frameView:(WebFrameView *)frameView; ++ (void)_createMainFrameWithPage:(WebCore::Page*)page frameName:(const WTF::String&)name frameView:(WebFrameView *)frameView; ++ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(WebCore::HTMLFrameOwnerElement*)ownerElement frameName:(const WTF::String&)name frameView:(WebFrameView *)frameView; - (id)_initWithWebFrameView:(WebFrameView *)webFrameView webView:(WebView *)webView; - (void)_clearCoreFrame; diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 58ce124..0e559b4 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -849,11 +849,12 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) [webView _setInsertionPasteboard:pasteboard]; DOMRange *range = [self _selectedRange]; + Frame* coreFrame = core([self _frame]); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted]) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); #else // Mail is ignoring the frament passed to the delegate and creates a new one. // We want to avoid creating the fragment twice. @@ -861,12 +862,12 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) if ([self _shouldInsertFragment:nil replacingDOMRange:range givenAction:WebViewInsertActionPasted]) { DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); } } else { DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:pasteboard inContext:range allowPlainText:allowPlainText]; if (fragment && [self _shouldInsertFragment:fragment replacingDOMRange:range givenAction:WebViewInsertActionPasted]) - [[self _frame] _replaceSelectionWithFragment:fragment selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard] matchStyle:NO]; + coreFrame->editor()->pasteAsFragment(core(fragment), [self _canSmartReplaceWithPasteboard:pasteboard], false); } #endif [webView _setInsertionPasteboard:nil]; diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 7ec2439..c46dca7 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -998,7 +998,6 @@ static WebCacheModel cacheModelForMainBundle(void) - (int64_t)applicationCacheTotalQuota { - ASSERT([self _longLongValueForKey:WebKitApplicationCacheTotalQuota] == [WebApplicationCache maximumSize]); return [self _longLongValueForKey:WebKitApplicationCacheTotalQuota]; } @@ -1012,7 +1011,6 @@ static WebCacheModel cacheModelForMainBundle(void) - (int64_t)applicationCacheDefaultOriginQuota { - ASSERT([self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota] == [WebApplicationCache defaultOriginQuota]); return [self _longLongValueForKey:WebKitApplicationCacheDefaultOriginQuota]; } diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h index d097c4c..3b80a89 100644 --- a/WebKit/mac/WebView/WebViewData.h +++ b/WebKit/mac/WebView/WebViewData.h @@ -79,7 +79,7 @@ extern int pluginDatabaseClientCount; float zoomMultiplier; NSString *applicationNameForUserAgent; - WebCore::String userAgent; + WTF::String userAgent; BOOL userAgentOverridden; WebPreferences *preferences; diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h index f95d3d3..71a2660 100644 --- a/WebKit/mac/WebView/WebViewInternal.h +++ b/WebKit/mac/WebView/WebViewInternal.h @@ -36,8 +36,9 @@ #ifdef __cplusplus #import <WebCore/WebCoreKeyboardUIMode.h> +#include <wtf/Forward.h> + namespace WebCore { - class String; class Frame; class KURL; class KeyboardEvent; diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 53c1494..47ab82a 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -241,7 +241,7 @@ QGraphicsWebView::QGraphicsWebView(QGraphicsItem* parent) : QGraphicsWidget(parent) , d(new QGraphicsWebViewPrivate(this)) { -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); #endif setAcceptDrops(true); @@ -417,7 +417,7 @@ void QGraphicsWebViewPrivate::detachCurrentPage() if (!page) return; -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) page->d->view.clear(); #else page->d->view = 0; diff --git a/WebKit/qt/Api/qwebdatabase_p.h b/WebKit/qt/Api/qwebdatabase_p.h index 9ae8fc8..ec03ea5 100644 --- a/WebKit/qt/Api/qwebdatabase_p.h +++ b/WebKit/qt/Api/qwebdatabase_p.h @@ -29,7 +29,7 @@ class QWebDatabasePrivate : public QSharedData { public: - WebCore::String name; + WTF::String name; WTF::RefPtr<WebCore::SecurityOrigin> origin; }; diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index e90367e..0bb6922 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -36,6 +36,7 @@ #include "GraphicsContext.h" #include "HTMLMetaElement.h" #include "HitTestResult.h" +#include "HTTPParsers.h" #include "IconDatabase.h" #include "InspectorController.h" #include "JSDOMBinding.h" @@ -178,7 +179,7 @@ void QWEBKIT_EXPORT qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int d QWebFrameData::QWebFrameData(WebCore::Page* parentPage, WebCore::Frame* parentFrame, WebCore::HTMLFrameOwnerElement* ownerFrameElement, - const WebCore::String& frameName) + const WTF::String& frameName) : name(frameName) , ownerElement(ownerFrameElement) , page(parentPage) @@ -753,7 +754,7 @@ void QWebFrame::load(const QNetworkRequest &req, case QNetworkAccessManager::PostOperation: request.setHTTPMethod("POST"); break; -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case QNetworkAccessManager::DeleteOperation: request.setHTTPMethod("DELETE"); break; @@ -808,7 +809,7 @@ void QWebFrame::setHtml(const QString &html, const QUrl &baseUrl) WebCore::ResourceRequest request(kurl); const QByteArray utf8 = html.toUtf8(); WTF::RefPtr<WebCore::SharedBuffer> data = WebCore::SharedBuffer::create(utf8.constData(), utf8.length()); - WebCore::SubstituteData substituteData(data, WebCore::String("text/html"), WebCore::String("utf-8"), KURL()); + WebCore::SubstituteData substituteData(data, WTF::String("text/html"), WTF::String("utf-8"), KURL()); d->frame->loader()->load(request, substituteData, false); } @@ -830,10 +831,15 @@ void QWebFrame::setContent(const QByteArray &data, const QString &mimeType, cons KURL kurl(baseUrl); WebCore::ResourceRequest request(kurl); WTF::RefPtr<WebCore::SharedBuffer> buffer = WebCore::SharedBuffer::create(data.constData(), data.length()); - QString actualMimeType = mimeType; - if (actualMimeType.isEmpty()) + QString actualMimeType; + WTF::String encoding; + if (mimeType.isEmpty()) actualMimeType = QLatin1String("text/html"); - WebCore::SubstituteData substituteData(buffer, WebCore::String(actualMimeType), WebCore::String(), KURL()); + else { + actualMimeType = extractMIMETypeFromMediaType(mimeType); + encoding = extractCharsetFromMediaType(mimeType); + } + WebCore::SubstituteData substituteData(buffer, WTF::String(actualMimeType), encoding, KURL()); d->frame->loader()->load(request, substituteData, false); } diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h index 62bd59e..15b0549 100644 --- a/WebKit/qt/Api/qwebframe_p.h +++ b/WebKit/qt/Api/qwebframe_p.h @@ -44,16 +44,16 @@ class QWebFrameData { public: QWebFrameData(WebCore::Page*, WebCore::Frame* parentFrame = 0, WebCore::HTMLFrameOwnerElement* = 0, - const WebCore::String& frameName = WebCore::String()); + const WTF::String& frameName = WTF::String()); WebCore::KURL url; - WebCore::String name; + WTF::String name; WebCore::HTMLFrameOwnerElement* ownerElement; WebCore::Page* page; RefPtr<WebCore::Frame> frame; WebCore::FrameLoaderClientQt* frameLoaderClient; - WebCore::String referrer; + WTF::String referrer; bool allowsScrolling; int marginWidth; int marginHeight; diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h index 32d22d4..3c56c98 100644 --- a/WebKit/qt/Api/qwebkitplatformplugin.h +++ b/WebKit/qt/Api/qwebkitplatformplugin.h @@ -81,6 +81,20 @@ Q_SIGNALS: void notificationClosed(); }; +class QWebHapticFeedbackPlayer +{ +public: + enum HapticStrength { + None, Weak, Medium, Strong + }; + + enum HapticEvent { + Press, Release + }; + + virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; +}; + class QWebKitPlatformPlugin { public: @@ -88,15 +102,17 @@ public: enum Extension { MultipleSelections, - Notifications + Notifications, + Haptics }; virtual bool supportsExtension(Extension extension) const = 0; virtual QWebSelectMethod* createSelectInputMethod() const = 0; virtual QWebNotificationPresenter* createNotificationPresenter() const = 0; + virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0; }; -Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.2"); +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3"); #endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index a8bd06a..516ebc9 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -252,7 +252,7 @@ static inline Qt::DropAction dragOpToDropAction(unsigned actions) QWebPagePrivate::QWebPagePrivate(QWebPage *qq) : q(qq) , client(0) -#if QT_VERSION < 0x040600 +#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0) , view(0) #endif , clickCausedFocus(false) @@ -1131,7 +1131,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) { WebCore::Frame *frame = page->focusController()->focusedOrMainFrame(); WebCore::Editor *editor = frame->editor(); -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, 0, 0, QVariant()); #endif @@ -1172,7 +1172,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) } break; } -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case QInputMethodEvent::Selection: { selection = a; hasSelection = true; @@ -1190,7 +1190,7 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) // 3. populated preedit with a selection attribute, and start/end of 0 or non-0 updates selection of supplied preedit text // 4. otherwise event is updating supplied pre-edit text QString preedit = ev->preeditString(); -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) if (hasSelection) { QString text = (renderTextControl) ? QString(renderTextControl->text()) : QString(); if (preedit.isEmpty() && selection.start + selection.length > 0) @@ -1473,7 +1473,7 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const return QVariant(); } -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) case Qt::ImAnchorPosition: { if (renderTextControl) { if (editor->hasComposition()) { @@ -1978,7 +1978,7 @@ void QWebPage::setView(QWidget* view) */ QWidget *QWebPage::view() const { -#if QT_VERSION < 0x040600 +#if QT_VERSION < QT_VERSION_CHECK(4, 6, 0) return d->view; #else return d->view.data(); diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index f0d2438..14f3b8b 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -217,6 +217,7 @@ public: inline qreal initialScaleFactor() const { return m_initialScaleFactor; }; inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; }; inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; }; + inline int targetDensityDpi() const { return m_targetDensityDpi; }; inline bool isUserScalable() const { return m_isUserScalable; }; inline bool isValid() const { return m_isValid; }; inline QSize size() const { return m_size; }; @@ -226,6 +227,7 @@ public: qreal m_initialScaleFactor; qreal m_minimumScaleFactor; qreal m_maximumScaleFactor; + int m_targetDensityDpi; bool m_isUserScalable; bool m_isValid; QSize m_size; diff --git a/WebKit/qt/Api/qwebview.cpp b/WebKit/qt/Api/qwebview.cpp index 773c79a..5e7265f 100644 --- a/WebKit/qt/Api/qwebview.cpp +++ b/WebKit/qt/Api/qwebview.cpp @@ -349,7 +349,7 @@ void QWebViewPrivate::detachCurrentPage() return; if (page) { -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) page->d->view.clear(); #else page->d->view = 0; diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index b49385a..4f2845f 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,226 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-08 Ariya Hidayat <ariya@sencha.com> + + Reviewed by Antonio Gomes. + + Inconsistent Qt version checks + https://bugs.webkit.org/show_bug.cgi?id=43695 + + Use QT_VERSION_CHECK macro instead of encoded hex. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::QGraphicsWebView): + (QGraphicsWebViewPrivate::detachCurrentPage): + * Api/qwebframe.cpp: + (QWebFrame::load): + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + (QWebPage::view): + * Api/qwebview.cpp: + (QWebViewPrivate::detachCurrentPage): + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createPlugin): + * WebCoreSupport/PageClientQt.cpp: + * WebCoreSupport/PageClientQt.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-06 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Move Qt's popup menu implementation from WebCore to WebKit layer + https://bugs.webkit.org/show_bug.cgi?id=43427 + + After PopupMenu changes in bug 42592 class QtAbstractWebPopup became unecessary and + there is no need to keep any Qt specific code for popup menus in WebCore/platform/qt. + + PopupMenuQt has been moved from WebCore/platform/qt to WebKit/qt/WebCoreSupport and + assumed the responsibilities of QtAbstractWebPopup. SearchPopupMenuQt has been moved + to WebKit/qt/WebCoreSupport as well. + + All classes that previously inherited from QtAbstractWebPopup now inherit from + QWebSelectMethod and QtPlatformPlugin's method createSelectInputMethod now returns an + instance of class QWebSelectMethod instead of QtAbstractWebPopup. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + (WebCore::ChromeClientQt::createPopupMenu): + (WebCore::ChromeClientQt::createSearchPopupMenu): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/PopupMenuQt.cpp: Added. + (SelectData::SelectData): + (SelectData::itemText): + (SelectData::itemToolTip): + (SelectData::itemIsEnabled): + (SelectData::itemCount): + (SelectData::itemIsSelected): + (SelectData::multiple): + (SelectData::itemType): + (WebCore::PopupMenuQt::PopupMenuQt): + (WebCore::PopupMenuQt::~PopupMenuQt): + (WebCore::PopupMenuQt::disconnectClient): + (WebCore::PopupMenuQt::show): + (WebCore::PopupMenuQt::didHide): + (WebCore::PopupMenuQt::hide): + (WebCore::PopupMenuQt::updateFromElement): + (WebCore::PopupMenuQt::selectItem): + * WebCoreSupport/PopupMenuQt.h: Added. + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::populate): + (WebCore::QtFallbackWebPopup::activeChanged): + (WebCore::QtFallbackWebPopup::pageClient): + * WebCoreSupport/QtFallbackWebPopup.h: + (WebCore::QtFallbackWebPopup::setGeometry): + (WebCore::QtFallbackWebPopup::geometry): + (WebCore::QtFallbackWebPopup::setFont): + (WebCore::QtFallbackWebPopup::font): + * WebCoreSupport/QtMaemoWebPopup.cpp: + (WebCore::Maemo5Popup::populateList): + (WebCore::QtMaemoWebPopup::QtMaemoWebPopup): + (WebCore::QtMaemoWebPopup::createSingleSelectionPopup): + (WebCore::QtMaemoWebPopup::createMultipleSelectionPopup): + (WebCore::QtMaemoWebPopup::createPopup): + (WebCore::QtMaemoWebPopup::show): + (WebCore::QtMaemoWebPopup::popupClosed): + (WebCore::QtMaemoWebPopup::itemClicked): + (WebCore::Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup): + (WebCore::Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup): + * WebCoreSupport/QtMaemoWebPopup.h: + (WebCore::Maemo5Popup::Maemo5Popup): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createSelectInputMethod): + * WebCoreSupport/QtPlatformPlugin.h: + * WebCoreSupport/SearchPopupMenuQt.cpp: Added. + (WebCore::SearchPopupMenuQt::SearchPopupMenuQt): + (WebCore::SearchPopupMenuQt::popupMenu): + (WebCore::SearchPopupMenuQt::saveRecentSearches): + (WebCore::SearchPopupMenuQt::loadRecentSearches): + (WebCore::SearchPopupMenuQt::enabled): + * WebCoreSupport/SearchPopupMenuQt.h: Added. + +2010-08-06 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Add support for the Android viewport meta tag extensions. + http://webkit.org/b/43567 + + * Api/qwebpage.h: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::didReceiveViewportArguments): + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebCoreSupport/FrameLoaderClientQt.h: + * WebCoreSupport/InspectorClientQt.h: + +2010-08-05 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Tor Arne Vestbø. + + [Qt] Clean up the input method handling + https://bugs.webkit.org/show_bug.cgi?id=43545 + + Replace the way of individually setting input method hints by + many calls to QWidget::setInputMethodHints with one single call. + + This is more efficient by requiring less updates in the input + method hint. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQWidget::setInputMethodHints): + (WebCore::PageClientQGraphicsWidget::setInputMethodHints): + * WebCoreSupport/PageClientQt.h: + +2010-08-05 David Leong <david.leong@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Input mode states are not reset after entering a password field + https://bugs.webkit.org/show_bug.cgi?id=43530 + + Input mode hints are not reset if clicking on password <input> elements then + clicking on <textarea> elements + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + * tests/qwebview/resources/input_types.html: + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): + + +2010-08-04 Pierre Rossi <pierre.rossi@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt] QWebFrame::setContent() does not respect charset provided in the mimeType + https://bugs.webkit.org/show_bug.cgi?id=43125 + + * Api/qwebframe.cpp: + (QWebFrame::setContent): + * tests/qwebframe/tst_qwebframe.cpp: + +2010-08-03 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Edits to bridge documentation + https://bugs.webkit.org/show_bug.cgi?id=43012 + + * docs/qtwebkit-bridge.qdoc: + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: + (wrapInFunction): + +2010-08-03 Kim Grönholm <kim.1.gronholm@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Platform plugin interface for Haptics + https://bugs.webkit.org/show_bug.cgi?id=43143 + + Platform plugin interface for playing haptic feedback + + * Api/qwebkitplatformplugin.h: + (QWebHapticFeedbackPlayer::): + (QWebKitPlatformPlugin::): + * examples/platformplugin/WebPlugin.h: + (WebPlugin::createHapticFeedbackPlayer): + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebHapticFeedbackPlayer::): + (QWebKitPlatformPlugin::): + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index a0bac72..0b77ea6 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -591,16 +591,16 @@ IntRect ChromeClientQt::visibleRectForTiledBackingStore() const } #endif -QtAbstractWebPopup* ChromeClientQt::createSelectPopup() +QWebSelectMethod* ChromeClientQt::createSelectPopup() const { - QtAbstractWebPopup* result = m_platformPlugin.createSelectInputMethod(); + QWebSelectMethod* result = m_platformPlugin.createSelectInputMethod(); if (result) return result; #if defined(Q_WS_MAEMO_5) return new QtMaemoWebPopup; #elif !defined(QT_NO_COMBOBOX) - return new QtFallbackWebPopup; + return new QtFallbackWebPopup(this); #else return 0; #endif @@ -620,6 +620,7 @@ void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArg hints.m_initialScaleFactor = arguments.initialScale; hints.m_minimumScaleFactor = arguments.minimumScale; hints.m_maximumScaleFactor = arguments.maximumScale; + hints.m_targetDensityDpi = arguments.targetDensityDpi; hints.m_isUserScalable = isUserScalable; emit m_webPage->viewportChangeRequested(hints); @@ -632,12 +633,12 @@ bool ChromeClientQt::selectItemWritingDirectionIsNatural() PassRefPtr<PopupMenu> ChromeClientQt::createPopupMenu(PopupMenuClient* client) const { - return adoptRef(new PopupMenuQt(client)); + return adoptRef(new PopupMenuQt(client, this)); } PassRefPtr<SearchPopupMenu> ChromeClientQt::createSearchPopupMenu(PopupMenuClient* client) const { - return adoptRef(new SearchPopupMenuQt(client)); + return adoptRef(new SearchPopupMenuQt(createPopupMenu(client))); } } // namespace WebCore diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h index aab2813..55edc50 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -174,21 +174,21 @@ namespace WebCore { virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; - QtAbstractWebPopup* createSelectPopup(); + QWebSelectMethod* createSelectPopup() const; virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const; QWebPage* m_webPage; WebCore::KURL lastHoverURL; - WebCore::String lastHoverTitle; - WebCore::String lastHoverContent; + WTF::String lastHoverTitle; + WTF::String lastHoverContent; bool toolBarsVisible; bool statusBarVisible; bool menuBarVisible; QEventLoop* m_eventLoop; - QtPlatformPlugin m_platformPlugin; + mutable QtPlatformPlugin m_platformPlugin; }; } diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 54993b1..0a9a0ea 100644 --- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -595,7 +595,9 @@ void EditorClientQt::setInputMethodState(bool active) { QWebPageClient* webPageClient = m_page->d->client; if (webPageClient) { -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + Qt::InputMethodHints hints; + HTMLInputElement* inputElement = 0; Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); if (frame && frame->document() && frame->document()->focusedNode()) @@ -604,24 +606,29 @@ void EditorClientQt::setInputMethodState(bool active) if (inputElement) { // Set input method hints for "number", "tel", "email", "url" and "password" input elements. - webPageClient->setInputMethodHint(Qt::ImhDialableCharactersOnly, inputElement->isTelephoneField()); - webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); - webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); - webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); + if (inputElement->isTelephoneField()) + hints |= Qt::ImhDialableCharactersOnly; + if (inputElement->isNumberField()) + hints |= Qt::ImhDigitsOnly; + if (inputElement->isEmailField()) + hints |= Qt::ImhEmailCharactersOnly; + if (inputElement->isUrlField()) + hints |= Qt::ImhUrlCharactersOnly; // Setting the Qt::WA_InputMethodEnabled attribute true and Qt::ImhHiddenText flag // for password fields. The Qt platform is responsible for determining which widget // will receive input method events for password fields. - bool isPasswordField = inputElement->isPasswordField(); - webPageClient->setInputMethodHint(Qt::ImhHiddenText, isPasswordField); - if (isPasswordField) + if (inputElement->isPasswordField()) { active = true; + hints |= Qt::ImhHiddenText; + } } #if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN) // disables auto-uppercase and predictive text for mobile devices - webPageClient->setInputMethodHint(Qt::ImhNoAutoUppercase, true); - webPageClient->setInputMethodHint(Qt::ImhNoPredictiveText, true); + hints |= Qt::ImhNoAutoUppercase; + hints |= Qt::ImhNoPredictiveText; #endif // Q_WS_MAEMO_5 || Q_WS_MAEMO_6 || Q_OS_SYMBIAN + webPageClient->setInputMethodHints(hints); #endif // QT_VERSION check webPageClient->setInputMethodEnabled(active); } diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 9fe66d9..cf76dae 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -1067,7 +1067,7 @@ WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage() return newPage->mainFrame()->d->frame; } -void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WebCore::String& MIMEType, const WebCore::ResourceRequest&) +void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WTF::String& MIMEType, const WebCore::ResourceRequest&) { // we need to call directly here const ResourceResponse& response = m_frame->loader()->activeDocumentLoader()->response(); @@ -1079,7 +1079,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForMIMEType(FramePolicyFunction fu callPolicyFunction(function, PolicyDownload); } -void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WebCore::String&) +void FrameLoaderClientQt::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState>, const WTF::String&) { Q_ASSERT(m_webFrame); QNetworkRequest r(request.toNetworkRequest(m_webFrame)); @@ -1321,7 +1321,7 @@ private: } }; -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) class QtPluginGraphicsWidget: public Widget { public: @@ -1439,7 +1439,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, w->setFrameRect(IntRect(0, 0, 0, 0)); return w; } -#if QT_VERSION >= 0x040600 +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object); if (graphicsWidget) { QGraphicsObject* parentWidget = 0; diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h index ec672f5..00a073f 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h @@ -40,6 +40,7 @@ #include "ResourceResponse.h" #include <QUrl> #include <qobject.h> +#include <wtf/Forward.h> class QWebFrame; namespace WebCore { @@ -49,7 +50,6 @@ class DocumentLoader; class Element; class FormState; class NavigationAction; -class String; class ResourceLoader; struct LoadErrorResetToken; @@ -121,8 +121,8 @@ public: virtual WebCore::Frame* dispatchCreatePage(); virtual void dispatchShow(); - virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WebCore::String&, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>, const WebCore::String&); + virtual void dispatchDecidePolicyForMIMEType(FramePolicyFunction function, const WTF::String&, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>, const WTF::String&); virtual void dispatchDecidePolicyForNavigationAction(FramePolicyFunction function, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<FormState>); virtual void cancelPolicyCheck(); diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.h b/WebKit/qt/WebCoreSupport/InspectorClientQt.h index c996f55..9526c88 100644 --- a/WebKit/qt/WebCoreSupport/InspectorClientQt.h +++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.h @@ -35,6 +35,7 @@ #include "OwnPtr.h" #include "PassOwnPtr.h" #include <QtCore/QString> +#include <wtf/Forward.h> class QWebPage; class QWebView; @@ -42,7 +43,6 @@ class QWebView; namespace WebCore { class Node; class Page; -class String; class InspectorClientQt : public InspectorClient { public: diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp index 90a5a63..62f48ff 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -48,13 +48,10 @@ bool PageClientQWidget::inputMethodEnabled() const return view->testAttribute(Qt::WA_InputMethodEnabled); } -#if QT_VERSION >= 0x040600 -void PageClientQWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable) +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) +void PageClientQWidget::setInputMethodHints(Qt::InputMethodHints hints) { - if (enable) - view->setInputMethodHints(view->inputMethodHints() | hint); - else - view->setInputMethodHints(view->inputMethodHints() & ~hint); + view->setInputMethodHints(hints); } #endif @@ -232,13 +229,10 @@ bool PageClientQGraphicsWidget::inputMethodEnabled() const #endif } -#if QT_VERSION >= 0x040600 -void PageClientQGraphicsWidget::setInputMethodHint(Qt::InputMethodHint hint, bool enable) +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) +void PageClientQGraphicsWidget::setInputMethodHints(Qt::InputMethodHints hints) { - if (enable) - view->setInputMethodHints(view->inputMethodHints() | hint); - else - view->setInputMethodHints(view->inputMethodHints() & ~hint); + view->setInputMethodHints(hints); } #endif diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h index 1204afc..65ee849 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.h +++ b/WebKit/qt/WebCoreSupport/PageClientQt.h @@ -58,8 +58,8 @@ public: virtual void update(const QRect& dirtyRect); virtual void setInputMethodEnabled(bool enable); virtual bool inputMethodEnabled() const; -#if QT_VERSION >= 0x040600 - virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable); +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + virtual void setInputMethodHints(Qt::InputMethodHints hints); #endif #ifndef QT_NO_CURSOR @@ -146,8 +146,8 @@ public: virtual void update(const QRect& dirtyRect); virtual void setInputMethodEnabled(bool enable); virtual bool inputMethodEnabled() const; -#if QT_VERSION >= 0x040600 - virtual void setInputMethodHint(Qt::InputMethodHint hint, bool enable); +#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) + virtual void setInputMethodHints(Qt::InputMethodHints hints); #endif #ifndef QT_NO_CURSOR diff --git a/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp b/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp new file mode 100644 index 0000000..56a0fac --- /dev/null +++ b/WebKit/qt/WebCoreSupport/PopupMenuQt.cpp @@ -0,0 +1,158 @@ +/* + * This file is part of the popup menu implementation for <select> elements in WebCore. + * + * Copyright (C) 2008, 2009, 2010 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2006 Apple Computer, Inc. + * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com + * Coypright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#include "config.h" +#include "PopupMenuQt.h" + +#include "ChromeClientQt.h" +#include "FrameView.h" +#include "PopupMenuClient.h" +#include "QtFallbackWebPopup.h" + +#include "qwebkitplatformplugin.h" + +class SelectData : public QWebSelectData { +public: + SelectData(WebCore::PopupMenuClient*& data) : d(data) {} + + virtual ItemType itemType(int) const; + virtual QString itemText(int idx) const { return QString(d ? d->itemText(idx) : ""); } + virtual QString itemToolTip(int idx) const { return QString(d ? d->itemToolTip(idx) : ""); } + virtual bool itemIsEnabled(int idx) const { return d ? d->itemIsEnabled(idx) : false; } + virtual int itemCount() const { return d ? d->listSize() : 0; } + virtual bool itemIsSelected(int idx) const { return d ? d->itemIsSelected(idx) : false; } + virtual bool multiple() const; + +private: + WebCore::PopupMenuClient*& d; +}; + +bool SelectData::multiple() const +{ + if (!d) + return false; + +#if ENABLE(NO_LISTBOX_RENDERING) + WebCore::ListPopupMenuClient* client = static_cast<WebCore::ListPopupMenuClient*>(d); + return client && client->multiple(); +#else + return false; +#endif +} + +SelectData::ItemType SelectData::itemType(int idx) const +{ + if (!d) + return SelectData::Option; + + if (d->itemIsSeparator(idx)) + return SelectData::Separator; + if (d->itemIsLabel(idx)) + return SelectData::Group; + return SelectData::Option; +} + +namespace WebCore { + +PopupMenuQt::PopupMenuQt(PopupMenuClient* client, const ChromeClientQt* chromeClient) + : m_popupClient(client) + , m_popup(0) + , m_selectData(0) + , m_chromeClient(chromeClient) +{ +} + +PopupMenuQt::~PopupMenuQt() +{ + delete m_selectData; + delete m_popup; +} + +void PopupMenuQt::disconnectClient() +{ + m_popupClient = 0; +} + +void PopupMenuQt::show(const IntRect& rect, FrameView* view, int index) +{ + if (!m_popupClient) + return; + + if (!m_popup) { + m_popup = m_chromeClient->createSelectPopup(); + connect(m_popup, SIGNAL(didHide()), this, SLOT(didHide())); + connect(m_popup, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool))); + } + + if (QtFallbackWebPopup* fallback = qobject_cast<QtFallbackWebPopup*>(m_popup)) { + QRect geometry(rect); + geometry.moveTopLeft(view->contentsToWindow(rect.topLeft())); + fallback->setGeometry(geometry); + fallback->setFont(m_popupClient->menuStyle().font().font()); + } + + if (m_selectData) + delete m_selectData; + m_selectData = new SelectData(m_popupClient); + m_popup->show(*m_selectData); +} + +void PopupMenuQt::didHide() +{ + if (m_popupClient) + m_popupClient->popupDidHide(); +} + +void PopupMenuQt::hide() +{ + if (!m_popup) + m_popup->hide(); +} + +void PopupMenuQt::updateFromElement() +{ + if (m_popupClient) + m_popupClient->setTextFromItem(m_popupClient->selectedIndex()); +} + +void PopupMenuQt::selectItem(int index, bool ctrl, bool shift) +{ + if (!m_popupClient) + return; + +#if ENABLE(NO_LISTBOX_RENDERING) + ListPopupMenuClient* client = static_cast<ListPopupMenuClient*>(m_popupClient); + if (client) { + client->listBoxSelectItem(index, ctrl, shift); + return; + } +#endif + + m_popupClient->valueChanged(index); +} + +} + +// vim: ts=4 sw=4 et diff --git a/WebKit/qt/WebCoreSupport/PopupMenuQt.h b/WebKit/qt/WebCoreSupport/PopupMenuQt.h new file mode 100644 index 0000000..837f323 --- /dev/null +++ b/WebKit/qt/WebCoreSupport/PopupMenuQt.h @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef PopupMenuQt_h +#define PopupMenuQt_h + +#include "PopupMenu.h" +#include <QObject> + +class QWebSelectData; +class QWebSelectMethod; + +namespace WebCore { + +class ChromeClientQt; +class FrameView; +class PopupMenuClient; + +class PopupMenuQt : public QObject, public PopupMenu { + Q_OBJECT +public: + PopupMenuQt(PopupMenuClient*, const ChromeClientQt*); + ~PopupMenuQt(); + + virtual void show(const IntRect&, FrameView*, int index); + virtual void hide(); + virtual void updateFromElement(); + virtual void disconnectClient(); + +private slots: + void didHide(); + void selectItem(int index, bool ctrl, bool shift); + +private: + PopupMenuClient* m_popupClient; + QWebSelectMethod* m_popup; + QWebSelectData* m_selectData; + const ChromeClientQt* m_chromeClient; +}; + +} + +#endif // PopupMenuQt_h diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp index 59ac87b..21678c7 100644 --- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp +++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp @@ -23,8 +23,7 @@ #ifndef QT_NO_COMBOBOX -#include "HostWindow.h" -#include "PopupMenuClient.h" +#include "ChromeClientQt.h" #include "QWebPageClient.h" #include "qgraphicswebview.h" #include <QAbstractItemView> @@ -79,7 +78,7 @@ void QtFallbackWebPopupCombo::hidePopup() return; m_ownerPopup.m_popupVisible = false; - m_ownerPopup.popupDidHide(); + emit m_ownerPopup.didHide(); m_ownerPopup.destroyPopup(); } @@ -97,10 +96,10 @@ bool QtFallbackWebPopupCombo::eventFilter(QObject* watched, QEvent* event) // QtFallbackWebPopup -QtFallbackWebPopup::QtFallbackWebPopup() - : QtAbstractWebPopup() - , m_popupVisible(false) +QtFallbackWebPopup::QtFallbackWebPopup(const ChromeClientQt* chromeClient) + : m_popupVisible(false) , m_combo(0) + , m_chromeClient(chromeClient) { } @@ -109,7 +108,7 @@ QtFallbackWebPopup::~QtFallbackWebPopup() destroyPopup(); } -void QtFallbackWebPopup::show() +void QtFallbackWebPopup::show(const QWebSelectData& data) { if (!pageClient()) return; @@ -123,8 +122,7 @@ void QtFallbackWebPopup::show() connect(m_combo, SIGNAL(activated(int)), SLOT(activeChanged(int)), Qt::QueuedConnection); - populate(); - m_combo->setCurrentIndex(currentIndex()); + populate(data); QRect rect = geometry(); if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) { @@ -212,7 +210,7 @@ void QtFallbackWebPopup::destroyPopup() } } -void QtFallbackWebPopup::populate() +void QtFallbackWebPopup::populate(const QWebSelectData& data) { QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model()); Q_ASSERT(model); @@ -220,21 +218,28 @@ void QtFallbackWebPopup::populate() #if !defined(Q_WS_S60) m_combo->setFont(font()); #endif - for (int i = 0; i < itemCount(); ++i) { - switch (itemType(i)) { - case Separator: + + int currentIndex = -1; + for (int i = 0; i < data.itemCount(); ++i) { + switch (data.itemType(i)) { + case QWebSelectData::Separator: m_combo->insertSeparator(i); break; - case Group: - m_combo->insertItem(i, itemText(i)); + case QWebSelectData::Group: + m_combo->insertItem(i, data.itemText(i)); model->item(i)->setEnabled(false); break; - case Option: - m_combo->insertItem(i, itemText(i)); - model->item(i)->setEnabled(itemIsEnabled(i)); + case QWebSelectData::Option: + m_combo->insertItem(i, data.itemText(i)); + model->item(i)->setEnabled(data.itemIsEnabled(i)); + if (data.itemIsSelected(i)) + currentIndex = i; break; } } + + if (currentIndex >= 0) + m_combo->setCurrentIndex(currentIndex); } void QtFallbackWebPopup::activeChanged(int index) @@ -242,7 +247,12 @@ void QtFallbackWebPopup::activeChanged(int index) if (index < 0) return; - valueChanged(index); + emit selectItem(index, false, false); +} + +QWebPageClient* QtFallbackWebPopup::pageClient() const +{ + return m_chromeClient->platformPageClient(); } } diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h index e6c371f..7c98fb4 100644 --- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h +++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h @@ -20,7 +20,9 @@ #ifndef QtFallbackWebPopup_h #define QtFallbackWebPopup_h -#include "QtAbstractWebPopup.h" +#include "Platform.h" +#include "qwebkitplatformplugin.h" + #include <QComboBox> #ifndef QT_NO_COMBOBOX @@ -29,21 +31,30 @@ QT_BEGIN_NAMESPACE class QGraphicsProxyWidget; QT_END_NAMESPACE +class QWebPageClient; + namespace WebCore { +class ChromeClientQt; class QtFallbackWebPopupCombo; -class QtFallbackWebPopup : public QObject, public QtAbstractWebPopup { +class QtFallbackWebPopup : public QWebSelectMethod { Q_OBJECT public: - QtFallbackWebPopup(); + QtFallbackWebPopup(const ChromeClientQt*); ~QtFallbackWebPopup(); - virtual void show(); + virtual void show(const QWebSelectData&); virtual void hide(); void destroyPopup(); + void setGeometry(const QRect& rect) { m_geometry = rect; } + QRect geometry() const { return m_geometry; } + + void setFont(const QFont& font) { m_font = font; } + QFont font() const { return m_font; } + private slots: void activeChanged(int); @@ -51,8 +62,13 @@ private: friend class QtFallbackWebPopupCombo; bool m_popupVisible; QtFallbackWebPopupCombo* m_combo; + const ChromeClientQt* m_chromeClient; + QRect m_geometry; + QFont m_font; + + QWebPageClient* pageClient() const; - void populate(); + void populate(const QWebSelectData&); #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) void showS60BrowserDialog(); #endif diff --git a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp index 29a16cb..90af0c6 100644 --- a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp +++ b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.cpp @@ -41,11 +41,11 @@ void Maemo5Popup::populateList() { QListWidgetItem* listItem; for (int i = 0; i < m_data.itemCount(); ++i) { - if (m_data.itemType(i) == QtAbstractWebPopup::Option) { + if (m_data.itemType(i) == QWebSelectData::Option) { listItem = new QListWidgetItem(m_data.itemText(i)); m_list->addItem(listItem); listItem->setSelected(m_data.itemIsSelected(i)); - } else if (m_data.itemType(i) == QtAbstractWebPopup::Group) { + } else if (m_data.itemType(i) == QWebSelectData::Group) { listItem = new QListWidgetItem(m_data.itemText(i)); m_list->addItem(listItem); listItem->setSelected(false); @@ -62,8 +62,7 @@ void Maemo5Popup::onItemSelected(QListWidgetItem* item) } QtMaemoWebPopup::QtMaemoWebPopup() - : QtAbstractWebPopup() - , m_popup(0) + : m_popup(0) { } @@ -73,30 +72,30 @@ QtMaemoWebPopup::~QtMaemoWebPopup() m_popup->deleteLater(); } -Maemo5Popup* QtMaemoWebPopup::createSingleSelectionPopup() +Maemo5Popup* QtMaemoWebPopup::createSingleSelectionPopup(const QWebSelectData& data) { - return new Maemo5SingleSelectionPopup(*this); + return new Maemo5SingleSelectionPopup(data); } -Maemo5Popup* QtMaemoWebPopup::createMultipleSelectionPopup() +Maemo5Popup* QtMaemoWebPopup::createMultipleSelectionPopup(const QWebSelectData& data) { - return new Maemo5MultipleSelectionPopup(*this); + return new Maemo5MultipleSelectionPopup(data); } -Maemo5Popup* QtMaemoWebPopup::createPopup() +Maemo5Popup* QtMaemoWebPopup::createPopup(const QWebSelectData& data) { - Maemo5Popup* result = multiple() ? createMultipleSelectionPopup() : createSingleSelectionPopup(); + Maemo5Popup* result = data.multiple() ? createMultipleSelectionPopup(data) : createSingleSelectionPopup(data); connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed())); connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int))); return result; } -void QtMaemoWebPopup::show() +void QtMaemoWebPopup::show(const QWebSelectData& data) { - if (!pageClient() || m_popup) + if (m_popup) return; - m_popup = createPopup(); + m_popup = createPopup(data); m_popup->show(); } @@ -115,15 +114,15 @@ void QtMaemoWebPopup::popupClosed() m_popup->deleteLater(); m_popup = 0; - popupDidHide(); + emit didHide(); } void QtMaemoWebPopup::itemClicked(int idx) { - selectItem(idx, true, false); + emit selectItem(idx, true, false); } -Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup(QtAbstractWebPopup& data) +Maemo5SingleSelectionPopup::Maemo5SingleSelectionPopup(const QWebSelectData& data) : Maemo5Popup(data) { // we try to get the standard list title the web browser is using @@ -170,7 +169,7 @@ private: QPixmap tickMark; }; -Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup(QtAbstractWebPopup& data) +Maemo5MultipleSelectionPopup::Maemo5MultipleSelectionPopup(const QWebSelectData& data) : Maemo5Popup(data) { // we try to get the standard list title the web browser is using diff --git a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h index a163a20..5433b75 100644 --- a/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h +++ b/WebKit/qt/WebCoreSupport/QtMaemoWebPopup.h @@ -20,7 +20,7 @@ #ifndef QtMaemoWebPopup_h #define QtMaemoWebPopup_h -#include "QtAbstractWebPopup.h" +#include "qwebkitplatformplugin.h" #include <QDialog> @@ -33,7 +33,7 @@ namespace WebCore { class Maemo5Popup : public QDialog { Q_OBJECT public: - Maemo5Popup(QtAbstractWebPopup& data) : m_data(data) {} + Maemo5Popup(const QWebSelectData& data) : m_data(data) {} signals: void itemClicked(int idx); @@ -44,18 +44,18 @@ protected slots: protected: void populateList(); - QtAbstractWebPopup& m_data; + const QWebSelectData& m_data; QListWidget* m_list; }; -class QtMaemoWebPopup : public QObject, public QtAbstractWebPopup { +class QtMaemoWebPopup : public QWebSelectMethod { Q_OBJECT public: QtMaemoWebPopup(); ~QtMaemoWebPopup(); - virtual void show(); + virtual void show(const QWebSelectData& data); virtual void hide(); private slots: @@ -65,23 +65,23 @@ private slots: private: Maemo5Popup* m_popup; - Maemo5Popup* createPopup(); - Maemo5Popup* createSingleSelectionPopup(); - Maemo5Popup* createMultipleSelectionPopup(); + Maemo5Popup* createPopup(const QWebSelectData& data); + Maemo5Popup* createSingleSelectionPopup(const QWebSelectData& data); + Maemo5Popup* createMultipleSelectionPopup(const QWebSelectData& data); }; class Maemo5SingleSelectionPopup : public Maemo5Popup { Q_OBJECT public: - Maemo5SingleSelectionPopup(QtAbstractWebPopup& data); + Maemo5SingleSelectionPopup(const QWebSelectData& data); }; class Maemo5MultipleSelectionPopup : public Maemo5Popup { Q_OBJECT public: - Maemo5MultipleSelectionPopup(QtAbstractWebPopup& data); + Maemo5MultipleSelectionPopup(const QWebSelectData& data); }; } diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp index cccb07c..fd86e91 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -29,70 +29,6 @@ namespace WebCore { -class SelectData : public QWebSelectData { -public: - SelectData(QtAbstractWebPopup* data) : d(data) {} - - virtual ItemType itemType(int) const; - virtual QString itemText(int index) const { return d->itemText(index); } - virtual QString itemToolTip(int index) const { return d->itemToolTip(index); } - virtual bool itemIsEnabled(int index) const { return d->itemIsEnabled(index); } - virtual int itemCount() const { return d->itemCount(); } - virtual bool itemIsSelected(int index) const { return d->itemIsSelected(index); } - virtual bool multiple() const { return d->multiple(); } - -private: - QtAbstractWebPopup* d; -}; - -QWebSelectData::ItemType SelectData::itemType(int index) const -{ - switch (d->itemType(index)) { - case QtAbstractWebPopup::Separator: return Separator; - case QtAbstractWebPopup::Group: return Group; - default: return Option; - } -} - -SelectInputMethodWrapper::SelectInputMethodWrapper(QWebSelectMethod* plugin) - : m_plugin(plugin) - , m_selectData(0) -{ - m_plugin->setParent(this); - connect(m_plugin, SIGNAL(didHide()), this, SLOT(didHide())); - connect(m_plugin, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool))); -} - -SelectInputMethodWrapper::~SelectInputMethodWrapper() -{ - delete m_selectData; -} - -void SelectInputMethodWrapper::show() -{ - if (m_selectData) - delete m_selectData; - m_selectData = new SelectData(this); - m_plugin->show(*m_selectData); -} - -void SelectInputMethodWrapper::hide() -{ - m_plugin->hide(); -} - -void SelectInputMethodWrapper::selectItem(int index, bool allowMultiplySelections, bool shift) -{ - QtAbstractWebPopup::selectItem(index, allowMultiplySelections, shift); -} - -void SelectInputMethodWrapper::didHide() -{ - QtAbstractWebPopup::popupDidHide(); -} - -// QtPlatformPlugin - bool QtPlatformPlugin::load(const QString& file) { m_loader.setFileName(file); @@ -152,17 +88,10 @@ QWebKitPlatformPlugin* QtPlatformPlugin::plugin() return m_plugin; } -QtAbstractWebPopup* QtPlatformPlugin::createSelectInputMethod() +QWebSelectMethod* QtPlatformPlugin::createSelectInputMethod() { QWebKitPlatformPlugin* p = plugin(); - if (!p) - return 0; - - QWebSelectMethod* selector = p->createSelectInputMethod(); - if (!selector) - return 0; - - return new SelectInputMethodWrapper(selector); + return p ? p->createSelectInputMethod() : 0; } diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h index 2de4859..9bdab75 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -21,8 +21,6 @@ #ifndef QtPlatformPlugin_h #define QtPlatformPlugin_h -#include "QtAbstractWebPopup.h" -#include <QObject> #include <QPluginLoader> class QWebSelectMethod; @@ -32,30 +30,12 @@ class QWebSelectData; namespace WebCore { -class SelectInputMethodWrapper : public QObject, public QtAbstractWebPopup { - Q_OBJECT -public: - SelectInputMethodWrapper(QWebSelectMethod* plugin); - ~SelectInputMethodWrapper(); - - virtual void show(); - virtual void hide(); - -private Q_SLOTS: - void selectItem(int index, bool allowMultiplySelections, bool shift); - void didHide(); - -private: - QWebSelectMethod* m_plugin; - QWebSelectData* m_selectData; -}; - class QtPlatformPlugin { public: QtPlatformPlugin() : m_loaded(false), m_plugin(0) {} ~QtPlatformPlugin(); - QtAbstractWebPopup* createSelectInputMethod(); + QWebSelectMethod* createSelectInputMethod(); QWebNotificationPresenter* createNotificationPresenter(); QWebKitPlatformPlugin* plugin(); diff --git a/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp b/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp new file mode 100644 index 0000000..63437cf --- /dev/null +++ b/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.cpp @@ -0,0 +1,49 @@ +/* + * Copyright C 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "SearchPopupMenuQt.h" + +namespace WebCore { + +SearchPopupMenuQt::SearchPopupMenuQt(PassRefPtr<PopupMenu> popup) + : m_popup(popup) +{ +} + +PopupMenu* SearchPopupMenuQt::popupMenu() +{ + return m_popup.get(); +} + +void SearchPopupMenuQt::saveRecentSearches(const AtomicString&, const Vector<String>&) +{ +} + +void SearchPopupMenuQt::loadRecentSearches(const AtomicString&, Vector<String>&) +{ +} + +bool SearchPopupMenuQt::enabled() +{ + return true; +} + +} diff --git a/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h b/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h new file mode 100644 index 0000000..11a9641 --- /dev/null +++ b/WebKit/qt/WebCoreSupport/SearchPopupMenuQt.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef SearchPopupMenuQt_h +#define SearchPopupMenuQt_h + +#include "SearchPopupMenu.h" + +namespace WebCore { + +class SearchPopupMenuQt : public SearchPopupMenu { +public: + SearchPopupMenuQt(PassRefPtr<PopupMenu> popup); + + virtual PopupMenu* popupMenu(); + virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems); + virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems); + virtual bool enabled(); + +private: + RefPtr<PopupMenu> m_popup; +}; + +} + +#endif // SearchPopupMenuQt_h diff --git a/WebKit/qt/docs/qtwebkit-bridge.qdoc b/WebKit/qt/docs/qtwebkit-bridge.qdoc index c2a38fd..0947a0a 100644 --- a/WebKit/qt/docs/qtwebkit-bridge.qdoc +++ b/WebKit/qt/docs/qtwebkit-bridge.qdoc @@ -7,69 +7,66 @@ \section2 The technology The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native - objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection, - a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment, - for example \l{QObject} properties map directly to JavaScript properties. - - For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter - pair under one name. + objects represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection, + a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment. + For example \l{QObject} properties map directly to JavaScript properties. \section2 Use Cases - There are two main use cases for the QtWebKit bridge. Web content in a native application, and Thin Clients. + There are two main use cases for the QtWebKit bridge: web content in native applications and thin clients. - \section3 Web Content in a Native Application + \section3 Web Content in Native Applications This is a common use case in classic Qt application, and a design pattern used by several modern - applications. For example, an application that contains a media-player, playlist manager, and music store. + applications like an application that contains a media-player, playlist manager, and music store. The playlist manager is usually best authored as a classic desktop application, - with the native-looking robust \l{QWidget}s helping with producing that application. - The media-player control, which usually looks custom, can be written using the \l{Graphics View framework} - or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content - from the internet and gets modified rapidly, is best authored in HTML and maintained on the server. + with the native-looking robust \l{QWidget}s as the application's backbone. + The media-player control usually has a custom look and feel and is best written using the \l{Graphics View framework} + or \l{QtDeclarative}. The music store, which shows dynamic content + from the Internet and gets modified rapidly, is best authored in HTML and maintained on the server. - With the QtWebKit bridge, that music store component can interact with native parts of the application, - for example, if a file needs to be saved to a specific location. + With the QtWebKit bridge, the music store component can interact with native parts of the application, + for example, when a file needs to be saved to a specific location. - \section3 Thin Client + \section3 Thin Clients - Another use case is using Qt as a native backend to a full web application, - referred to here as a thin client. In this use-case, the entire UI is driven by - HTML, JavaScript and CSS, and native Qt-based components are used to allow that application - access to native features not usually exposed to the web, or to enable helper components that - are best written with C++. + The use case uses Qt as a native backend of a full web application, + a so-called thin client. In this use case, the entire UI is driven by + HTML, JavaScript and CSS. Additionally, it uses Qt-based components to + access native features usually not exposed to the web, or to enable helper + components that are best written in C++. An example for such a client is a UI for a video-on-demand service on a TV. The entire content and - UI can be kept on the server, served dynamically through HTTP and rendered with WebKit, with additional - native components for accessing hardware-specific features like extracting the list of images - out of the video. + UI can be kept on the server, served dynamically through HTTP and rendered with WebKit. Additional + native components are used to access hardware-specific features like extracting a list of images + out of a video stream. \section2 Difference from Other Bridge Technologies - Of course QtWebKit is not the only bridge technology out there. NPAPI, for example, - is a long-time standard or web-native bridging. Due to Qt's meta-object system, full applications - built partially with web-technologies are much easier to develop. NPAPI, however, is more geared - towards cross-browser plugins, due to it being an accepted standard. + Of course, QtWebKit is not the only bridge technology out there. NPAPI, for example, + is a long-time standard for web-native bridging. Due to Qt's meta-object system, full applications + leveraging web technologies are much easier to develop with the QtWebKit bridge than with NPAPI. NPAPI, however, is better + for cross-browser plugins, due to it being an accepted standard. When developing a plugin for a browser, NPAPI is recommended. When developing a full application - that utilizes HTML-rendering, the QtWebKit bridge is recommended. + utilizing HTML-rendering, the QtWebKit bridge is recommended. \section2 Relationship with QtScript - The QtWebKit bridge is similar to \l{QtScript}, especially to some of the features described in the - \l{Making Applications Scriptable} page. However, as of Qt 4.7, full QtScript API is not supported for web applications. - That is planned as an enhancement for future versions. You might notice that some of the features + The QtWebKit bridge is similar to \l{QtScript}, especially for some of the features described in the + \l{Making Applications Scriptable} page. However, Qt 4.7 does not provide the full QtScript API for web applications. + Full support is planned for future versions. You might notice that some of the features described here are an exact copy of the ones described in the \l{Making Applications Scriptable} page. That is because the QtWebKit bridge is a subset of that functionality, and this page tries to capture the full capabilities available through the QtWebKit bridge specifically. \section1 Accessing QObjects - \section2 Creating the link via QWebFrame + \section2 Making QObjects known to JavaScript via QWebFrame By default, no QObjects are accessible through the web environment, for security reasons. - To enable web content access for a native QObject, the application must explicitly grant it access, - using the following call: + When a web application wants to access a native QObject, it must explicitly grant access + to this QObject, using the following call: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 0 @@ -83,13 +80,11 @@ \list \i \bold{Hybrid C++/script}: C++ application code connects a - signal to a script function. For example, the script function can be - a function that the user has typed in, or one that you have read from a - file. This approach is useful if you have a QObject but don't want - to expose the object itself to the scripting environment; you just - want a script to be able to define how a signal should be reacted - to, and leave it up to the C++ side of your application to establish - the connection. + signal to a script function. This approach is useful if you have + a QObject but don't want to expose the object itself to the scripting + environment. You just want to define how the script responds to a + signal and leave it up to the C++ side of your application to establish + the connection between the C++ signal and the JavaScript slot. \i \bold{Hybrid script/C++}: A script can connect signals and slots to establish connections between pre-defined objects that the @@ -109,27 +104,24 @@ \section3 Signal to Function Connections - \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 6 - - In this form of connection, the argument to \c{connect()} is the - function to connect to the signal. - \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 7 - The argument can be a JavaScript function, as in the above - example, or it can be a QObject slot, as in - the following example: + The call to \c{connect()} establishes a connection between the signal + \c{somethingChanged} and the slot \c{myInterestingScriptFunction}. + Whenever the object \c{myObject} emits the signal \c{somethingChanged}, + the slot \c{myInterestingScriptFunction} gets called automatically. + + The argument of \c{connect()} can be any JavaScript function as in the above + example or a slot of a QObject as in the following example: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 8 - When the argument is a QObject slot, the argument types of the - signal and slot do not necessarily have to be compatible; - If necessary, the QtWebKit bridge will, perform conversion of the signal - arguments to match the argument types of the slot. + When the argument is a slot of a QObject, the argument types of the + signal and the slot do not have to be compatible. If possible, the QtWebKit + bridge converts the signal arguments such that they match the slot argument. - To disconnect from a signal, you invoke the signal's - \c{disconnect()} function, passing the function to disconnect - as argument: + To disconnect a slot from a signal, you call the signal's + \c{disconnect()} function with the slot as its argument: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 9 @@ -140,18 +132,24 @@ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 10 - In this form of the \c{connect()} function, the first argument - is the object that will be bound to the variable, \c this, when - the function specified using the second argument is invoked. + The call to \c{connect() establishes a connection between the signal + \c{somethingChanged} and the slot \c{function}. Whenever the object + \c{myObject} emits the signal \c{somethingChanged}, the slot \c{function} + of the object \c{thisObject} gets called automatically. Let's illustrate + this with an example. - If you have a push button in a form, you typically want to do - something involving the form in response to the button's - \c{clicked} signal; passing the form as the \c this object - makes sense in such a case. + If you have a push button in a form, you typically want the form + to do something in response to the button's \c{clicked} signal. The + call to \c{connect()} makes sure that the function \c{onClicked()} is + called whenever you click on the push button, that is, whenever the + the signal \c{clicked()} is emitted by \c{myButton}. The slot \c{onClicked()} + prints the value of \c{x} as stored in the \c{form}. \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 11 - To disconnect from the signal, pass the same arguments to \c{disconnect()}: + To disconnect a slot from a signal, you pass the same arguments to + \c{disconnect()} as you passed to \c{connect()}. In general, this looks + as follows: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 12 @@ -159,19 +157,19 @@ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 14 - This form of the \c{connect()} function requires that the first argument is - the object that will be bound to the variable \c{this} when a function is - invoked in response to the signal. The second argument specifies the - name of a function that is connected to the signal, and this refers to a - member function of the object passed as the first argument (thisObject - in the above scheme). + This form of the \c{connect()} function requires that the first argument \c{thisObject} is + the object that will be bound to \c{this} when the function \c{functionName} is + invoked in response to the signal \c{somethingChanged}. The second argument \c{functionName} specifies the + name of a function that is connected to the signal. It refers to a + member function of the object \c{thisObject}. Note that the function is resolved when the connection is made, not when the signal is emitted. \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 15 - To disconnect from the signal, pass the same arguments to \c{disconnect()}: + To disconnect from the signal, pass the same arguments to \c{disconnect()} + as you passed to \c{connect}: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 17 @@ -220,17 +218,17 @@ \section3 Invokable Methods - Both slots and signals are invokable from script by default. In addition, it's also - possible to define a method that's invokable from script without it being a signal or a slot. + Both slots and signals are invokable from scripts by default. In addition, it is also + possible to define a method that is invokable from scripts, although the method is neither a signal nor a slot. This is especially useful for functions with return types, as slots normally do not return anything - (it would be meaningless to return values from a slot, as the connected signals don't handle the returned data). + (it would be meaningless to return a value from a slot, as the connected signals cannot handle return values). To make a non-slot method invokable, simply add the Q_INVOKABLE macro before its definition: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 22 \section2 Accessing Properties - The properties of the QObject are available as properties + The properties of a QObject are available as properties of the corresponding JavaScript object. When you manipulate a property in script code, the C++ get/set method for that property will automatically be invoked. For example, if your @@ -244,8 +242,8 @@ \section2 Accessing Child QObjects - Every named child of the QObject (that is, for which - QObject::objectName() is not an empty string) is by default available as + Every named child of a QObject (that is, every child for which + QObject::objectName() does not return the empty string) is by default available as a property of the JavaScript wrapper object. For example, if you have a QDialog with a child widget whose \c{objectName} property is \c{"okButton"}, you can access this object in script code through @@ -253,8 +251,8 @@ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 25 - Since \c{objectName} is itself a Q_PROPERTY, you can manipulate - the name in script code to, for example, rename an object: + Because \c{objectName} is itself a Q_PROPERTY, you can manipulate + the name in script code to rename an object. For example: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 26 @@ -270,16 +268,15 @@ \section3 Numbers All Qt numeric data types are converted to or from a JavaScript number. These include int, short, float, - double, and the porable Qt types (qreal, qint etc). A special case is \l{QChar}; - If a slot expects a QChar, the QtWebKit bridge would use the unicode value in case of a number, - or the first character in a string. + double, and the portable Qt types (qreal, qint etc). A special case is \l{QChar}. + If a slot expects a QChar, the QtWebKit bridge uses the Unicode value in case of a number and the first character in case of a string. - Note that non-standard (typedefed) number types are not automatically converted to - or from a JavaScript number - it's advised to use standard number types for signal, slots + Note that non-standard (typedef'ed) number types are not automatically converted to + or from a JavaScript number - we suggest to use standard number types for signals, slots and properties. When a non-number is passed as an argument to a method or property that expects a number, - the appropriate JavaScript conversion function (parseInt / parseFloat) would be used. + the appropriate JavaScript conversion function (parseInt / parseFloat) is used. \section3 Strings @@ -287,42 +284,41 @@ will automatically convert the value to a string (if it is not already a string), using the built-in JavaScript toString method. - When a QString is passed to JavaScript from a signal or a property, The QtWebKit bridge will - convert it into a JavaScript string. + When a QString is passed to JavaScript from a signal or a property, the QtWebKit bridge + converts it into a JavaScript string. \section3 Date & Time Both \l{QDate}, \l{QTime} and \l{QDateTime} are automatically translated to or from the JavaScript - Date object. If a number were passed as an argument to a method that expects one of the date/time - types, the QtWebKit bridge would treat it as a timestamp. If a sting is passed, QtWebKit would - try different Qt date parsing functions to find the right one. + Date object. If a number is passed as an argument to a method that expects one of the date/time + types, the QtWebKit bridge treats it as a timestamp. If a sting is passed, QtWebKit + tries the different Qt date parsing functions to perform the right translation. \section3 Regular Expressions - The QtWebKit bridge would automatically convert JavaScript RegEx object to a \l{QRegExp}. - If a string is passed to a method expecting a \l{QRegExp}, the string would be converted - to that \l{QRegExp}. + The QtWebKit bridge automatically converts a JavaScript RegEx object to a \l{QRegExp}. + If a string is passed to a method expecting a \l{QRegExp}, the string is converted + to a \l{QRegExp}. \section3 Lists The QtWebKit bridge treats several types of lists in a special way: \l{QVariantList}, \l{QStringList}, \l{QObjectList} and \l{QList}<int>. When a slot or property expects one of those list types, - the QtWebKit bridge would try to convert a JavaScript array into that type, converting each of + the QtWebKit bridge tries to convert a JavaScript array into that type, converting each of the array's elements to the single-element type of the list. - The most useful type of list is perhaps \l{QVariantList}, which can be converted to from any + The most useful type of list is \l{QVariantList}, which can be converted to and from any JavaScript array. \section3 Compound (JSON) objects JavaScript compound objects, also known as JSON objects, are variables that hold a list of key-value pairs, where all the keys are strings and the values can have any type. - This translates very well to \l{QVariantMap}, which is nothing more than a \l{QMap} of \l{QString} + This translates very well to \l{QVariantMap}, which is nothing more than a \l{QMap} from \l{QString} to \l{QVariant}. The seamless conversion between JSON objects and \l{QVariantMap} allows for a very convenient - way of passing arbitrary structured data between C++ and the JavaScript environment. The native \l{QObject} has - to make sure that compound values are converted to \l{QVariantMap}s and \l{QVariantList}s, and JavaScript is + way of passing arbitrary structured data between C++ and the JavaScript environment. If the native \l{QObject} makes sure that compound values are converted to \l{QVariantMap}s and \l{QVariantList}s, JavaScript is guaranteed to receive them in a meaningful way. Note that types that are not supported by JSON, such as JavaScript functions and getters/setters, @@ -330,22 +326,22 @@ \section3 QVariants - When a slot or property accepts a \l{QVariant}, the QtWebKit bridge would create a \l{QVariant} that best - matches the argument passed by JavaScript. A string, for example, would become a \l{QVariant} holding a \l{QString}, - a normal JSON object would become a \l{QVariantMap}, and a JavaScript array would become a \l{QVariantList}. + When a slot or property accepts a \l{QVariant}, the QtWebKit bridge creates a \l{QVariant} that best + matches the argument passed by JavaScript. A string, for example, becomes a \l{QVariant} holding a \l{QString}, + a normal JSON object becomes a \l{QVariantMap}, and a JavaScript array becomes a \l{QVariantList}. Using \l{QVariant}s generously in C++ in that way makes C++ programming feel a bit more like JavaScript programming, - as it adds another level of indirection. Passing \l{QVariant}s around like this q is very flexible, as the program can figure out - the type of argument in runtime just like JavaScript would do, but it also takes away from the type-safety and robust - nature of C++. It's recommended to use \l{QVariant}s only for convenience high-level functions, and to keep most of your - \l{QObject}s somewhat type-safe. + as it adds another level of indirection. Passing \l{QVariant}s around like this is very flexible. The program can figure out + the type of argument at runtime just like JavaScript would do. But doing so also takes away the type safety and robustness of C++. + We recommended to use \l{QVariant}s only for high-level functions, and to keep most of your + \l{QObject}s type-safe. \section3 QObjects - A pointer to a \l{QObject} or a \l{QWidget} can be passed as payload in signals, slots and properties. That object - can then be used like an object that's exposed directly; i.e. its slots can be invoked, its signals connected to etc. + Pointers to a \l{QObject} or a \l{QWidget} can be used in signals, slots and properties. This object + can then be used like an object that is exposed directly. Its slots can be invoked, its signals connected to, etc. However, this functionality is fairly limited - the type used has to be \l{QObject}* or \l{QWidget}*. If the type - specified is a pointer to a non-\l{QWidget} subclass of \l{QObject}, the QtWebKit bridge would not recognize it to be + specified is a pointer to a non-\l{QWidget} subclass of \l{QObject}, the QtWebKit bridge does not recognize it as a \l{QObject}. In general its advised to use care when passing \l{QObject}s as arguments, as those objects don't become owned by @@ -358,14 +354,14 @@ The QtWebKit bridge handles \l{QPixmap}s and \l{QImage}s in a special way. Since QtWebKit stores \l{QPixmap}s to represent HTML images, \l{QPixmap}s coming from the native environment can be used directly inside WebKit. - A \l{QImage} or a \l{QPixmap} coming from the Qt environment would convert to an intermediate JavaScript object, - that can be represented like this: + A \l{QImage} or a \l{QPixmap} coming from Qt is converted to an intermediate JavaScript object, + which can be represented like this: \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 1 - The JavaScript environment can then use the pixmap it gets from Qt and display it inside the HTML environment, - by assigning it to an existing <img /> element using assignToHTMLImageElement. It can also use the toDataURL() function, - which allows using the pixmap as the src attribute of an image or as a background-image url. Note that the toDataURL() + The JavaScript environment can then use the pixmap from Qt and display it inside the HTML environment, + by assigning it to an existing \c{<img>} element with \c{assignToHTMLImageElement()}. It can also use the \c{toDataURL()} function, + which allows using the pixmap as the \c{src} attribute of an image or as a \c{background-image} URL. Note that the \c{toDataURL()} function is costly and should be used with caution. Example code: @@ -394,30 +390,30 @@ \snippet webkitsnippets/qtwebkit_bridge_snippets.cpp 5 This is specifically useful to create custom renderers or extensions to the web environment. Instead of forcing Qt - to select the element, the web environment already selects the element and then send the selected element directly to Qt. + to select the element, the web environment selects the element and then sends the selected element directly to Qt. Note that \l{QWebElement}s are not thread safe - an object handling them has to live in the UI thread. - \section1 Architecture issues + \section1 Architecture Issues \section2 Limiting the Scope of the Hybrid Layer When using QtWebKit's hybrid features, it is a common pitfall to make the API exposed to JavaScript very rich and - use all its features. This, however, leads to complexity and can create bugs that are hard to trace. + use all its features. This, however, leads to complexity and can create bugs that are hard to find. Instead, it is advisable to keep the hybrid layer small and manageable: create a gate only when there's an actual need for it, i.e. there's a new native enabler that requires a direct interface to the application layer. Sometimes new functionality is better handled internally in the native layer or in the web layer; simplicity is your friend. This usually becomes more apparent when the hybrid layer can create or destroy objects, or uses - signals slots or properties with a \l{QObject}* argument. It is advised to be very careful and to treat + signals, slots or properties with a \l{QObject}* argument. It is advised to be very careful and to treat an exposed \l{QObject} as a system - with careful attention to memory management and object ownership. \section2 Internet Security - When exposing native object to an open web environment, it is importwhichant to understand the security - implications. Think whether the exposed object enables the web environment access to things that - shouldn't be open, and whether the web content loaded by that web page comes from a trusted. In general, when + When exposing native objects to an open web environment, it is important to understand the security + implications. Think whether the exposed object enables the web environment access things that + shouldn't be open, and whether the web content loaded by that web page comes from a trusted source. In general, when exposing native QObjects that give the web environment access to private information or to functionality that's potentially harmful to the client, such exposure should be balanced by limiting the web page's access to trusted URLs only with HTTPS, and by utilizing other measures as part of a security strategy. diff --git a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp index 6a517c2..75aa0a9 100644 --- a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp +++ b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp @@ -95,21 +95,21 @@ class MyObject : QObject { myQObject.somethingChanged.disconnect(myOtherQObject.doSomething); //! [9] //! [10] - connect(thisObject, function) + myQObject.somethingChanged.connect(thisObject, function) //! [10] //! [11] - var obj = { x: 123 }; - var fun = function() { print(this.x); }; - myQObject.somethingChanged.connect(obj, fun); + var form = { x: 123 }; + var onClicked = function() { print(this.x); }; + myButton.clicked.connect(form, onClicked); //! [11] //! [12] - myQObject.somethingChanged.disconnect(obj, fun); + myQObject.somethingChanged.disconnect(thisObject, function); //! [12] //! [13] connect(function); //! [13] //! [14] - connect(thisObject, functionName) + myQObject.somethingChanged.connect(thisObject, "functionName") //! [14] //! [15] var obj = { x: 123, fun: function() { print(this.x); } }; @@ -119,7 +119,7 @@ class MyObject : QObject { connect(function); //! [16] //! [17] - myQObject.somethingChanged.disconnect(obj, "fun"); + myQObject.somethingChanged.disconnect(thisObject, "functionName"); //! [17] //! [18] try { @@ -145,8 +145,8 @@ class MyObject : QObject { Q_OBJECT public: - Q_INVOKABLE void thisMethodIsInvokableInQtScript(); - void thisMethodIsNotInvokableInQtScript(); + Q_INVOKABLE void thisMethodIsInvokableInJavaScript(); + void thisMethodIsNotInvokableInJavaScript(); ... }; diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.h b/WebKit/qt/examples/platformplugin/WebPlugin.h index 9a99d0b..4af19f9 100644 --- a/WebKit/qt/examples/platformplugin/WebPlugin.h +++ b/WebKit/qt/examples/platformplugin/WebPlugin.h @@ -92,6 +92,9 @@ public: virtual QWebNotificationPresenter* createNotificationPresenter() const { return new WebNotificationPresenter(); } + virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const { + return 0; + } }; #endif // WEBPLUGIN_H diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h index 32d22d4..3c56c98 100644 --- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h +++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -81,6 +81,20 @@ Q_SIGNALS: void notificationClosed(); }; +class QWebHapticFeedbackPlayer +{ +public: + enum HapticStrength { + None, Weak, Medium, Strong + }; + + enum HapticEvent { + Press, Release + }; + + virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; +}; + class QWebKitPlatformPlugin { public: @@ -88,15 +102,17 @@ public: enum Extension { MultipleSelections, - Notifications + Notifications, + Haptics }; virtual bool supportsExtension(Extension extension) const = 0; virtual QWebSelectMethod* createSelectInputMethod() const = 0; virtual QWebNotificationPresenter* createNotificationPresenter() const = 0; + virtual QWebHapticFeedbackPlayer* createHapticFeedbackPlayer() const = 0; }; -Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.2"); +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3"); #endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index b208447..83b8600 100644 --- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -33,6 +33,7 @@ #include <QRegExp> #include <QNetworkRequest> #include <QNetworkReply> +#include <QTextCodec> #ifndef QT_NO_OPENSSL #include <qsslerror.h> #endif @@ -625,6 +626,8 @@ private slots: void qObjectWrapperWithSameIdentity(); void introspectQtMethods_data(); void introspectQtMethods(); + void setContent_data(); + void setContent(); private: QString evalJS(const QString&s) { @@ -3101,5 +3104,34 @@ void tst_QWebFrame::introspectQtMethods() QVERIFY(evalJSV("var props=[]; for (var p in myObject.deleteLater) {props.push(p);}; props.sort()").toStringList().isEmpty()); } +void tst_QWebFrame::setContent_data() +{ + QTest::addColumn<QString>("mimeType"); + QTest::addColumn<QByteArray>("testContents"); + QTest::addColumn<QString>("expected"); + + QString str = QString::fromUtf8("ὕαλον ϕαγεῖν δύναμαι· τοῦτο οὔ με βλάπτει"); + QTest::newRow("UTF-8 plain text") << "text/plain; charset=utf-8" << str.toUtf8() << str; + + QTextCodec *utf16 = QTextCodec::codecForName("UTF-16"); + if (utf16) + QTest::newRow("UTF-16 plain text") << "text/plain; charset=utf-16" << utf16->fromUnicode(str) << str; + + str = QString::fromUtf8("Une chaîne de caractères à sa façon."); + QTest::newRow("latin-1 plain text") << "text/plain; charset=iso-8859-1" << str.toLatin1() << str; + + +} + +void tst_QWebFrame::setContent() +{ + QFETCH(QString, mimeType); + QFETCH(QByteArray, testContents); + QFETCH(QString, expected); + m_view->setContent(testContents, mimeType); + QWebFrame* mainFrame = m_view->page()->mainFrame(); + QCOMPARE(expected , mainFrame->toPlainText()); +} + QTEST_MAIN(tst_QWebFrame) #include "tst_qwebframe.moc" diff --git a/WebKit/qt/tests/qwebview/resources/input_types.html b/WebKit/qt/tests/qwebview/resources/input_types.html index 18ab314..2e893af 100644 --- a/WebKit/qt/tests/qwebview/resources/input_types.html +++ b/WebKit/qt/tests/qwebview/resources/input_types.html @@ -4,5 +4,6 @@ <input type='tel' style='position: absolute; left: 10px; top: 100px; height: 50px; width: 100px;'/><br> <input type='number' style='position: absolute; left: 10px; top: 150px; height: 50px; width: 100px;'/><br> <input type='email' style='position: absolute; left: 10px; top: 200px; height: 50px; width: 100px;'/><br> -<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br>" -</body></html>
\ No newline at end of file +<input type='url' style='position: absolute; left: 10px; top: 250px; height: 50px; width: 100px;'/><br> +<textarea style='position: absolute; left: 10px; top: 310px; height: 50px; width: 100px;' rows="2" cols="20">blah blah blah blah</textarea><br> +</body></html> diff --git a/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/WebKit/qt/tests/qwebview/tst_qwebview.cpp index 5dc5e41..57f726d 100644 --- a/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -264,30 +264,37 @@ void tst_QWebView::focusInputTypes() #else QVERIFY(webView->inputMethodHints() == Qt::ImhNone); #endif + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'password' field webView->fireMouseClick(QPoint(20, 60)); QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'tel' field webView->fireMouseClick(QPoint(20, 110)); QVERIFY(webView->inputMethodHints() == Qt::ImhDialableCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'number' field webView->fireMouseClick(QPoint(20, 160)); QVERIFY(webView->inputMethodHints() == Qt::ImhDigitsOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'email' field webView->fireMouseClick(QPoint(20, 210)); QVERIFY(webView->inputMethodHints() == Qt::ImhEmailCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'url' field webView->fireMouseClick(QPoint(20, 260)); QVERIFY(webView->inputMethodHints() == Qt::ImhUrlCharactersOnly); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'password' field webView->fireMouseClick(QPoint(20, 60)); QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); // 'text' type webView->fireMouseClick(QPoint(20, 10)); @@ -297,6 +304,17 @@ void tst_QWebView::focusInputTypes() #else QVERIFY(webView->inputMethodHints() == Qt::ImhNone); #endif + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + // 'password' field + webView->fireMouseClick(QPoint(20, 60)); + QVERIFY(webView->inputMethodHints() == Qt::ImhHiddenText); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); + + // 'text area' field + webView->fireMouseClick(QPoint(20, 320)); + QVERIFY(webView->inputMethodHints() == Qt::ImhNone); + QVERIFY(webView->testAttribute(Qt::WA_InputMethodEnabled)); delete webView; diff --git a/WebKit/win/AccessibleBase.h b/WebKit/win/AccessibleBase.h index ca1703f..df2d927 100644 --- a/WebKit/win/AccessibleBase.h +++ b/WebKit/win/AccessibleBase.h @@ -100,8 +100,8 @@ protected: AccessibleBase(WebCore::AccessibilityObject*); virtual ~AccessibleBase(); - virtual WebCore::String name() const; - virtual WebCore::String value() const; + virtual WTF::String name() const; + virtual WTF::String value() const; virtual long role() const; HRESULT getAccessibilityObjectForChild(VARIANT vChild, WebCore::AccessibilityObject*&) const; diff --git a/WebKit/win/AccessibleImage.h b/WebKit/win/AccessibleImage.h index 0c111e2..e987795 100644 --- a/WebKit/win/AccessibleImage.h +++ b/WebKit/win/AccessibleImage.h @@ -35,7 +35,7 @@ public: virtual ~AccessibleImage() { } private: - virtual WebCore::String name() const; + virtual WTF::String name() const; }; #endif // AccessibleImage_h diff --git a/WebKit/win/COMPropertyBag.h b/WebKit/win/COMPropertyBag.h index ae4a7b7..610c367 100644 --- a/WebKit/win/COMPropertyBag.h +++ b/WebKit/win/COMPropertyBag.h @@ -34,7 +34,7 @@ #include "COMVariantSetter.h"
-template<typename ValueType, typename KeyType = typename WebCore::String, typename HashType = typename WebCore::StringHash>
+template<typename ValueType, typename KeyType = typename WTF::String, typename HashType = typename WTF::StringHash>
class COMPropertyBag : public IPropertyBag, public IPropertyBag2, Noncopyable {
public:
typedef HashMap<KeyType, ValueType, HashType> HashMapType;
diff --git a/WebKit/win/COMVariantSetter.h b/WebKit/win/COMVariantSetter.h index 22c20e4..feb233c 100644 --- a/WebKit/win/COMVariantSetter.h +++ b/WebKit/win/COMVariantSetter.h @@ -29,10 +29,7 @@ #include <WebCore/BString.h>
#include <WebCore/COMPtr.h>
#include <wtf/Assertions.h>
-
-namespace WebCore {
- class String;
-}
+#include <wtf/Forward.h>
template<typename T> struct COMVariantSetter {};
@@ -44,11 +41,11 @@ template<typename T> struct COMVariantSetterBase }
};
-template<> struct COMVariantSetter<WebCore::String> : COMVariantSetterBase<WebCore::String>
+template<> struct COMVariantSetter<WTF::String> : COMVariantSetterBase<WTF::String>
{
static const VARENUM VariantType = VT_BSTR;
- static void setVariant(VARIANT* variant, const WebCore::String& value)
+ static void setVariant(VARIANT* variant, const WTF::String& value)
{
ASSERT(V_VT(variant) == VT_EMPTY);
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index d4a850e..acfeab7 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,184 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-05 Jessie Berlin <jberlin@apple.com> + + Reviewed by Jon Honeycutt. + + Bug 43593 - WebView::backingStore should check if m_backingStoreBitmap is NULL. + https://bugs.webkit.org/show_bug.cgi?id=43593 + + * WebView.cpp: + (WebView::backingStore): + If m_backingStoreBitmap is NULL, return E_FAIL. + +2010-08-05 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * COMVariantSetter.h: + * MarshallingHelpers.h: + * WebCoreSupport/WebContextMenuClient.h: + * WebCoreSupport/WebPluginHalterClient.h: + * WebHistory.h: + +2010-08-03 Adam Roben <aroben@apple.com> + + Turn on PLATFORM_STRATEGIES on Windows + + Fixes <http://webkit.org/b/43431>. + + Reviewed by Anders Carlsson. + + * WebCoreLocalizedStrings.cpp: Removed. + * WebCoreSupport/WebPlatformStrategies.cpp: Added. Based on the Mac + equivalent. + (WebPlatformStrategies::initialize): Creates the singleton instance. + (WebPlatformStrategies::WebPlatformStrategies): Registers the + singleton instance as the PlatformStrategies instance for WebCore. + + (WebPlatformStrategies::createPluginStrategy): + (WebPlatformStrategies::createLocalizationStrategy): + (WebPlatformStrategies::createVisitedLinkStrategy): + Return ourselves as the strategy. + + (WebPlatformStrategies::refreshPlugins): + (WebPlatformStrategies::getPluginInfo): + Moved code here from WebCore's PluginDataWin.cpp file. + + (WebPlatformStrategies::searchableIndexIntroduction): + (WebPlatformStrategies::submitButtonDefaultLabel): + (WebPlatformStrategies::inputElementAltText): + (WebPlatformStrategies::resetButtonDefaultLabel): + (WebPlatformStrategies::fileButtonChooseFileLabel): + (WebPlatformStrategies::fileButtonNoFileSelectedLabel): + (WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow): + (WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk): + (WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard): + (WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow): + (WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk): + (WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard): + (WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow): + (WebPlatformStrategies::contextMenuItemTagCopy): + (WebPlatformStrategies::contextMenuItemTagGoBack): + (WebPlatformStrategies::contextMenuItemTagGoForward): + (WebPlatformStrategies::contextMenuItemTagStop): + (WebPlatformStrategies::contextMenuItemTagReload): + (WebPlatformStrategies::contextMenuItemTagCut): + (WebPlatformStrategies::contextMenuItemTagPaste): + (WebPlatformStrategies::contextMenuItemTagNoGuessesFound): + (WebPlatformStrategies::contextMenuItemTagIgnoreSpelling): + (WebPlatformStrategies::contextMenuItemTagLearnSpelling): + (WebPlatformStrategies::contextMenuItemTagSearchWeb): + (WebPlatformStrategies::contextMenuItemTagLookUpInDictionary): + (WebPlatformStrategies::contextMenuItemTagOpenLink): + (WebPlatformStrategies::contextMenuItemTagIgnoreGrammar): + (WebPlatformStrategies::contextMenuItemTagSpellingMenu): + (WebPlatformStrategies::contextMenuItemTagCheckSpelling): + (WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping): + (WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling): + (WebPlatformStrategies::contextMenuItemTagFontMenu): + (WebPlatformStrategies::contextMenuItemTagBold): + (WebPlatformStrategies::contextMenuItemTagItalic): + (WebPlatformStrategies::contextMenuItemTagUnderline): + (WebPlatformStrategies::contextMenuItemTagOutline): + (WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu): + (WebPlatformStrategies::contextMenuItemTagTextDirectionMenu): + (WebPlatformStrategies::contextMenuItemTagDefaultDirection): + (WebPlatformStrategies::contextMenuItemTagLeftToRight): + (WebPlatformStrategies::contextMenuItemTagRightToLeft): + (WebPlatformStrategies::contextMenuItemTagShowSpellingPanel): + (WebPlatformStrategies::contextMenuItemTagInspectElement): + (WebPlatformStrategies::searchMenuNoRecentSearchesText): + (WebPlatformStrategies::searchMenuRecentSearchesText): + (WebPlatformStrategies::searchMenuClearRecentSearchesText): + (WebPlatformStrategies::AXWebAreaText): + (WebPlatformStrategies::AXLinkText): + (WebPlatformStrategies::AXListMarkerText): + (WebPlatformStrategies::AXImageMapText): + (WebPlatformStrategies::AXHeadingText): + (WebPlatformStrategies::AXDefinitionListTermText): + (WebPlatformStrategies::AXDefinitionListDefinitionText): + (WebPlatformStrategies::AXButtonActionVerb): + (WebPlatformStrategies::AXRadioButtonActionVerb): + (WebPlatformStrategies::AXTextFieldActionVerb): + (WebPlatformStrategies::AXCheckedCheckBoxActionVerb): + (WebPlatformStrategies::AXUncheckedCheckBoxActionVerb): + (WebPlatformStrategies::AXLinkActionVerb): + (WebPlatformStrategies::AXMenuListActionVerb): + (WebPlatformStrategies::AXMenuListPopupActionVerb): + (WebPlatformStrategies::unknownFileSizeText): + (WebPlatformStrategies::uploadFileText): + (WebPlatformStrategies::allFilesText): + (WebPlatformStrategies::missingPluginText): + (WebPlatformStrategies::crashedPluginText): + (WebPlatformStrategies::imageTitle): + (WebPlatformStrategies::multipleFileUploadText): + (WebPlatformStrategies::mediaElementLoadingStateText): + (WebPlatformStrategies::mediaElementLiveBroadcastStateText): + (WebPlatformStrategies::localizedMediaControlElementString): + (WebPlatformStrategies::localizedMediaControlElementHelpText): + (WebPlatformStrategies::localizedMediaTimeDescription): + (WebPlatformStrategies::validationMessageValueMissingText): + (WebPlatformStrategies::validationMessageTypeMismatchText): + (WebPlatformStrategies::validationMessagePatternMismatchText): + (WebPlatformStrategies::validationMessageTooLongText): + (WebPlatformStrategies::validationMessageRangeUnderflowText): + (WebPlatformStrategies::validationMessageRangeOverflowText): + (WebPlatformStrategies::validationMessageStepMismatchText): + Moved code here from WebCoreLocalizedStrings.cpp (and slightly cleaned + it up). + + (WebPlatformStrategies::isLinkVisited): + (WebPlatformStrategies::addVisitedLink): + Copied code from WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm. + + * WebCoreSupport/WebPlatformStrategies.h: Added. + + * WebKit.vcproj/WebKit.vcproj: Removed WebCoreLocalizedStrings, added + WebPlatformStrategies. + + * WebView.cpp: + (WebView::initWithFrame): Initialize WebPlatformStrategies. + +2010-08-03 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=42939 + WebEditorClient::didBeginEditing is never called in WebKit2 + + * WebView.cpp: (WebView::WebViewWndProc): Removed a call to setFocusedFrame. WebCore will + now set it to main frame, and besides, this call should have been before setFocused(), not + after it. My understanding is that we weren't getting all the same editing delegates on Windows, + so this change may make WebKit1 on Windows behave more like Mac - but I haven't tested it. + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/win/DOMCSSClasses.cpp b/WebKit/win/DOMCSSClasses.cpp index c6190ec..b89053b 100644 --- a/WebKit/win/DOMCSSClasses.cpp +++ b/WebKit/win/DOMCSSClasses.cpp @@ -91,7 +91,7 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::cssText( HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::setCssText( /* [in] */ BSTR cssText) { - WebCore::String cssTextString(cssText); + WTF::String cssTextString(cssText); // FIXME: <rdar://5148045> return DOM exception info WebCore::ExceptionCode ec; m_style->setCssText(cssTextString, ec); @@ -102,8 +102,8 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::getPropertyValue( /* [in] */ BSTR propertyName, /* [retval][out] */ BSTR* result) { - WebCore::String propertyNameString(propertyName); - WebCore::String value = m_style->getPropertyValue(propertyNameString); + WTF::String propertyNameString(propertyName); + WTF::String value = m_style->getPropertyValue(propertyNameString); *result = SysAllocStringLen(value.characters(), value.length()); if (value.length() && !*result) return E_OUTOFMEMORY; @@ -139,9 +139,9 @@ HRESULT STDMETHODCALLTYPE DOMCSSStyleDeclaration::setProperty( /* [in] */ BSTR value, /* [in] */ BSTR priority) { - WebCore::String propertyNameString(propertyName); - WebCore::String valueString(value); - WebCore::String priorityString(priority); + WTF::String propertyNameString(propertyName); + WTF::String valueString(value); + WTF::String priorityString(priority); // FIXME: <rdar://5148045> return DOM exception info WebCore::ExceptionCode code; m_style->setProperty(propertyNameString, valueString, priorityString, code); diff --git a/WebKit/win/DOMCoreClasses.cpp b/WebKit/win/DOMCoreClasses.cpp index 42e8e63..c6b8823 100644 --- a/WebKit/win/DOMCoreClasses.cpp +++ b/WebKit/win/DOMCoreClasses.cpp @@ -60,14 +60,14 @@ DEFINE_GUID(IID_DOMElement, 0x3b0c0eff, 0x478b, 0x4b0b, 0x82, 0x90, 0xd2, 0x32, // "DOMObject" exists both in the WebCore namespace and unnamespaced in this // file, which leads to ambiguities if we say "using namespace WebCore". using namespace WebCore::HTMLNames; -using WebCore::AtomicString; +using WTF::AtomicString; using WebCore::BString; using WebCore::Element; using WebCore::ExceptionCode; using WebCore::FontDescription; using WebCore::Frame; using WebCore::IntRect; -using WebCore::String; +using WTF::String; // DOMObject - IUnknown ------------------------------------------------------- @@ -119,7 +119,7 @@ HRESULT STDMETHODCALLTYPE DOMNode::nodeValue( { if (!m_node) return E_FAIL; - WebCore::String nodeValueStr = m_node->nodeValue(); + WTF::String nodeValueStr = m_node->nodeValue(); *result = SysAllocStringLen(nodeValueStr.characters(), nodeValueStr.length()); if (nodeValueStr.length() && !*result) return E_OUTOFMEMORY; @@ -894,8 +894,8 @@ HRESULT STDMETHODCALLTYPE DOMElement::getAttribute( { if (!m_element) return E_FAIL; - WebCore::String nameString(name, SysStringLen(name)); - WebCore::String& attrValueString = (WebCore::String&) m_element->getAttribute(nameString); + WTF::String nameString(name, SysStringLen(name)); + WTF::String& attrValueString = (WTF::String&) m_element->getAttribute(nameString); *result = SysAllocStringLen(attrValueString.characters(), attrValueString.length()); if (attrValueString.length() && !*result) return E_OUTOFMEMORY; @@ -909,8 +909,8 @@ HRESULT STDMETHODCALLTYPE DOMElement::setAttribute( if (!m_element) return E_FAIL; - WebCore::String nameString(name, SysStringLen(name)); - WebCore::String valueString(value, SysStringLen(value)); + WTF::String nameString(name, SysStringLen(name)); + WTF::String valueString(value, SysStringLen(value)); WebCore::ExceptionCode ec = 0; m_element->setAttribute(nameString, valueString, ec); return ec ? E_FAIL : S_OK; diff --git a/WebKit/win/DOMHTMLClasses.cpp b/WebKit/win/DOMHTMLClasses.cpp index f9634ff..2dd6deb 100644 --- a/WebKit/win/DOMHTMLClasses.cpp +++ b/WebKit/win/DOMHTMLClasses.cpp @@ -483,7 +483,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLElement::innerText( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->isHTMLElement()); - WebCore::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText(); + WTF::String innerTextString = static_cast<HTMLElement*>(m_element)->innerText(); *result = BString(innerTextString.characters(), innerTextString.length()).release(); return S_OK; } @@ -493,7 +493,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLElement::setInnerText( { ASSERT(m_element && m_element->isHTMLElement()); HTMLElement* htmlEle = static_cast<HTMLElement*>(m_element); - WebCore::String textString(text, SysStringLen(text)); + WTF::String textString(text, SysStringLen(text)); WebCore::ExceptionCode ec = 0; htmlEle->setInnerText(textString, ec); return S_OK; @@ -561,7 +561,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::action( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->hasTagName(formTag)); - WebCore::String actionString = static_cast<HTMLFormElement*>(m_element)->action(); + WTF::String actionString = static_cast<HTMLFormElement*>(m_element)->action(); *result = BString(actionString.characters(), actionString.length()).release(); return S_OK; } @@ -591,7 +591,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLFormElement::method( /* [retval][out] */ BSTR* result) { ASSERT(m_element && m_element->hasTagName(formTag)); - WebCore::String methodString = static_cast<HTMLFormElement*>(m_element)->method(); + WTF::String methodString = static_cast<HTMLFormElement*>(m_element)->method(); *result = BString(methodString.characters(), methodString.length()).release(); return S_OK; } @@ -1188,7 +1188,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::setType( { ASSERT(m_element && m_element->hasTagName(inputTag)); HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); - WebCore::String typeString(type, SysStringLen(type)); + WTF::String typeString(type, SysStringLen(type)); inputElement->setType(typeString); return S_OK; } @@ -1212,7 +1212,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::value( { ASSERT(m_element && m_element->hasTagName(inputTag)); HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element); - WebCore::String valueString = inputElement->value(); + WTF::String valueString = inputElement->value(); *result = BString(valueString.characters(), valueString.length()).release(); if (valueString.length() && !*result) return E_OUTOFMEMORY; @@ -1550,7 +1550,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::value( { ASSERT(m_element && m_element->hasTagName(textareaTag)); HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element); - WebCore::String valueString = textareaElement->value(); + WTF::String valueString = textareaElement->value(); *result = BString(valueString.characters(), valueString.length()).release(); if (valueString.length() && !*result) return E_OUTOFMEMORY; diff --git a/WebKit/win/MarshallingHelpers.h b/WebKit/win/MarshallingHelpers.h index bbde61f..b213fb9 100644 --- a/WebKit/win/MarshallingHelpers.h +++ b/WebKit/win/MarshallingHelpers.h @@ -26,12 +26,12 @@ #ifndef MarshallingHelpers_H #define MarshallingHelpers_H +#include <wtf/Forward.h> #include <CoreFoundation/CoreFoundation.h> namespace WebCore { class IntRect; class KURL; - class String; } class MarshallingHelpers @@ -39,8 +39,8 @@ class MarshallingHelpers public: static WebCore::KURL BSTRToKURL(BSTR); static BSTR KURLToBSTR(const WebCore::KURL&); - static CFURLRef PathStringToFileCFURLRef(const WebCore::String&); - static WebCore::String FileCFURLRefToPathString(CFURLRef fileURL); + static CFURLRef PathStringToFileCFURLRef(const WTF::String&); + static WTF::String FileCFURLRefToPathString(CFURLRef fileURL); static CFURLRef BSTRToCFURLRef(BSTR); static CFStringRef BSTRToCFStringRef(BSTR); static CFStringRef LPCOLESTRToCFStringRef(LPCOLESTR); diff --git a/WebKit/win/WebCoreLocalizedStrings.cpp b/WebKit/win/WebCoreLocalizedStrings.cpp deleted file mode 100644 index 2d2f17f..0000000 --- a/WebKit/win/WebCoreLocalizedStrings.cpp +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (C) 2007 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 met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 COMPUTER, INC. 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 "WebLocalizableStrings.h" -#include <WebCore/IntSize.h> -#include <WebCore/LocalizedStrings.h> -#include <WebCore/PlatformString.h> -#include <wtf/MathExtras.h> -#include <wtf/RetainPtr.h> - -using namespace WebCore; - -String WebCore::searchableIndexIntroduction() { return String(LPCTSTR_UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'")); } -String WebCore::submitButtonDefaultLabel() { return String(LPCTSTR_UI_STRING("Submit", "default label for Submit buttons in forms on web pages")); } -String WebCore::inputElementAltText() { return String(LPCTSTR_UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value")); } -String WebCore::resetButtonDefaultLabel() { return String(LPCTSTR_UI_STRING("Reset", "default label for Reset buttons in forms on web pages")); } -String WebCore::fileButtonChooseFileLabel() { return String(LPCTSTR_UI_STRING("Choose File", "title for file button used in HTML forms")); } -String WebCore::fileButtonNoFileSelectedLabel() { return String(LPCTSTR_UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected")); } -String WebCore::contextMenuItemTagOpenLinkInNewWindow() { return String(LPCTSTR_UI_STRING("Open Link in New Window", "Open in New Window context menu item")); } -String WebCore::contextMenuItemTagDownloadLinkToDisk() { return String(LPCTSTR_UI_STRING("Download Linked File", "Download Linked File context menu item")); } -String WebCore::contextMenuItemTagCopyLinkToClipboard() { return String(LPCTSTR_UI_STRING("Copy Link", "Copy Link context menu item")); } -String WebCore::contextMenuItemTagOpenImageInNewWindow() { return String(LPCTSTR_UI_STRING("Open Image in New Window", "Open Image in New Window context menu item")); } -String WebCore::contextMenuItemTagDownloadImageToDisk() { return String(LPCTSTR_UI_STRING("Download Image", "Download Image context menu item")); } -String WebCore::contextMenuItemTagCopyImageToClipboard() { return String(LPCTSTR_UI_STRING("Copy Image", "Copy Image context menu item")); } -String WebCore::contextMenuItemTagOpenFrameInNewWindow() { return String(LPCTSTR_UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item")); } -String WebCore::contextMenuItemTagCopy() { return String(LPCTSTR_UI_STRING("Copy", "Copy context menu item")); } -String WebCore::contextMenuItemTagGoBack() { return String(LPCTSTR_UI_STRING("Back", "Back context menu item")); } -String WebCore::contextMenuItemTagGoForward() { return String(LPCTSTR_UI_STRING("Forward", "Forward context menu item")); } -String WebCore::contextMenuItemTagStop() { return String(LPCTSTR_UI_STRING("Stop", "Stop context menu item")); } -String WebCore::contextMenuItemTagReload() { return String(LPCTSTR_UI_STRING("Reload", "Reload context menu item")); } -String WebCore::contextMenuItemTagCut() { return String(LPCTSTR_UI_STRING("Cut", "Cut context menu item")); } -String WebCore::contextMenuItemTagPaste() { return String(LPCTSTR_UI_STRING("Paste", "Paste context menu item")); } -String WebCore::contextMenuItemTagNoGuessesFound() { return String(LPCTSTR_UI_STRING("No Guesses Found", "No Guesses Found context menu item")); } -String WebCore::contextMenuItemTagIgnoreSpelling() { return String(LPCTSTR_UI_STRING("Ignore Spelling", "Ignore Spelling context menu item")); } -String WebCore::contextMenuItemTagLearnSpelling() { return String(LPCTSTR_UI_STRING("Learn Spelling", "Learn Spelling context menu item")); } -String WebCore::contextMenuItemTagSearchWeb() { return String(LPCTSTR_UI_STRING("Search with Google", "Search in Google context menu item")); } -String WebCore::contextMenuItemTagLookUpInDictionary() { return String(LPCTSTR_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item")); } -String WebCore::contextMenuItemTagOpenLink() { return String(LPCTSTR_UI_STRING("Open Link", "Open Link context menu item")); } -String WebCore::contextMenuItemTagIgnoreGrammar() { return String(LPCTSTR_UI_STRING("Ignore Grammar", "Ignore Grammar context menu item")); } -String WebCore::contextMenuItemTagSpellingMenu() { return String(LPCTSTR_UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item")); } -String WebCore::contextMenuItemTagCheckSpelling() { return String(LPCTSTR_UI_STRING("Check Document Now", "Check spelling context menu item")); } -String WebCore::contextMenuItemTagCheckSpellingWhileTyping() { return String(LPCTSTR_UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item")); } -String WebCore::contextMenuItemTagCheckGrammarWithSpelling() { return String(LPCTSTR_UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item")); } -String WebCore::contextMenuItemTagFontMenu() { return String(LPCTSTR_UI_STRING("Font", "Font context sub-menu item")); } -String WebCore::contextMenuItemTagBold() { return String(LPCTSTR_UI_STRING("Bold", "Bold context menu item")); } -String WebCore::contextMenuItemTagItalic() { return String(LPCTSTR_UI_STRING("Italic", "Italic context menu item")); } -String WebCore::contextMenuItemTagUnderline() { return String(LPCTSTR_UI_STRING("Underline", "Underline context menu item")); } -String WebCore::contextMenuItemTagOutline() { return String(LPCTSTR_UI_STRING("Outline", "Outline context menu item")); } -String WebCore::contextMenuItemTagWritingDirectionMenu() { return String(LPCTSTR_UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item")); } -String WebCore::contextMenuItemTagTextDirectionMenu() { return String(LPCTSTR_UI_STRING("Selection Direction", "Selection direction context sub-menu item")); } -String WebCore::contextMenuItemTagDefaultDirection() { return String(LPCTSTR_UI_STRING("Default", "Default writing direction context menu item")); } -String WebCore::contextMenuItemTagLeftToRight() { return String(LPCTSTR_UI_STRING("Left to Right", "Left to Right context menu item")); } -String WebCore::contextMenuItemTagRightToLeft() { return String(LPCTSTR_UI_STRING("Right to Left", "Right to Left context menu item")); } -String WebCore::contextMenuItemTagShowSpellingPanel(bool show) { return String(show ? LPCTSTR_UI_STRING("Show Spelling and Grammar", "menu item title") : LPCTSTR_UI_STRING("Hide Spelling and Grammar", "menu item title")); } -String WebCore::contextMenuItemTagInspectElement() { return String(LPCTSTR_UI_STRING("Inspect Element", "Inspect Element context menu item")); } -String WebCore::searchMenuNoRecentSearchesText() { return String(LPCTSTR_UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed")); } -String WebCore::searchMenuRecentSearchesText() { return String(LPCTSTR_UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title")); } -String WebCore::searchMenuClearRecentSearchesText() { return String(LPCTSTR_UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents")); } -String WebCore::AXWebAreaText() { return String(LPCTSTR_UI_STRING("web area", "accessibility role description for web area")); } -String WebCore::AXLinkText() { return String(LPCTSTR_UI_STRING("link", "accessibility role description for link")); } -String WebCore::AXListMarkerText() { return String(LPCTSTR_UI_STRING("list marker", "accessibility role description for list marker")); } -String WebCore::AXImageMapText() { return String(LPCTSTR_UI_STRING("image map", "accessibility role description for image map")); } -String WebCore::AXHeadingText() { return String(LPCTSTR_UI_STRING("heading", "accessibility role description for headings")); } -String WebCore::AXDefinitionListTermText() { return String(LPCTSTR_UI_STRING("term", "term word of a definition")); } -String WebCore::AXDefinitionListDefinitionText() { return String(LPCTSTR_UI_STRING("definition", "definition phrase")); } -String WebCore::AXButtonActionVerb() { return String(LPCTSTR_UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility")); } -String WebCore::AXRadioButtonActionVerb() { return String(LPCTSTR_UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility")); } -String WebCore::AXTextFieldActionVerb() { return String(LPCTSTR_UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility")); } -String WebCore::AXCheckedCheckBoxActionVerb() { return String(LPCTSTR_UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility")); } -String WebCore::AXUncheckedCheckBoxActionVerb() { return String(LPCTSTR_UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility")); } -String WebCore::AXLinkActionVerb() { return String(LPCTSTR_UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility")); } -String WebCore::AXMenuListActionVerb() { return String(LPCTSTR_UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility")); } -String WebCore::AXMenuListPopupActionVerb() { return String(LPCTSTR_UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility")); } -String WebCore::unknownFileSizeText() { return String(LPCTSTR_UI_STRING("Unknown", "Unknown filesize FTP directory listing item")); } -String WebCore::uploadFileText() { return String(LPCTSTR_UI_STRING("Upload file", "(Windows) Form submit file upload dialog title")); } -String WebCore::allFilesText() { return String(LPCTSTR_UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up")); } -String WebCore::missingPluginText() { return String(LPCTSTR_UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing")); } -String WebCore::crashedPluginText() { return String(LPCTSTR_UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed")); } -String WebCore::imageTitle(const String& filename, const IntSize& size) -{ - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)")); - - RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString()); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), filenameCF.get(), size.width(), size.height())); - - return result.get(); -} - -String multipleFileUploadText(unsigned numberOfFiles) -{ - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files")); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), numberOfFiles)); - - return result.get(); -} - -#if ENABLE(VIDEO) -String WebCore::mediaElementLoadingStateText() { return String(LPCTSTR_UI_STRING("Loading...", "Media controller status message when the media is loading")); } -String WebCore::mediaElementLiveBroadcastStateText() { return String(LPCTSTR_UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast")); } - -String WebCore::localizedMediaControlElementString(const String& name) -{ - if (name == "AudioElement") - return String(LPCTSTR_UI_STRING("audio element controller", "accessibility role description for audio element controller")); - if (name == "VideoElement") - return String(LPCTSTR_UI_STRING("video element controller", "accessibility role description for video element controller")); - if (name == "MuteButton") - return String(LPCTSTR_UI_STRING("mute", "accessibility role description for mute button")); - if (name == "UnMuteButton") - return String(LPCTSTR_UI_STRING("unmute", "accessibility role description for turn mute off button")); - if (name == "PlayButton") - return String(LPCTSTR_UI_STRING("play", "accessibility role description for play button")); - if (name == "PauseButton") - return String(LPCTSTR_UI_STRING("pause", "accessibility role description for pause button")); - if (name == "Slider") - return String(LPCTSTR_UI_STRING("movie time", "accessibility role description for timeline slider")); - if (name == "SliderThumb") - return String(LPCTSTR_UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb")); - if (name == "RewindButton") - return String(LPCTSTR_UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button")); - if (name == "ReturnToRealtimeButton") - return String(LPCTSTR_UI_STRING("return to realtime", "accessibility role description for return to real time button")); - if (name == "CurrentTimeDisplay") - return String(LPCTSTR_UI_STRING("elapsed time", "accessibility role description for elapsed time display")); - if (name == "TimeRemainingDisplay") - return String(LPCTSTR_UI_STRING("remaining time", "accessibility role description for time remaining display")); - if (name == "StatusDisplay") - return String(LPCTSTR_UI_STRING("status", "accessibility role description for movie status")); - if (name == "FullscreenButton") - return String(LPCTSTR_UI_STRING("fullscreen", "accessibility role description for enter fullscreen button")); - if (name == "SeekForwardButton") - return String(LPCTSTR_UI_STRING("fast forward", "accessibility role description for fast forward button")); - if (name == "SeekBackButton") - return String(LPCTSTR_UI_STRING("fast reverse", "accessibility role description for fast reverse button")); - if (name == "ShowClosedCaptionsButton") - return String(LPCTSTR_UI_STRING("show closed captions", "accessibility role description for show closed captions button")); - if (name == "HideClosedCaptionsButton") - return String(LPCTSTR_UI_STRING("hide closed captions", "accessibility role description for hide closed captions button")); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebCore::localizedMediaControlElementHelpText(const String& name) -{ - if (name == "AudioElement") - return String(LPCTSTR_UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller")); - if (name == "VideoElement") - return String(LPCTSTR_UI_STRING("video element playback controls and status display", "accessibility role description for video element controller")); - if (name == "MuteButton") - return String(LPCTSTR_UI_STRING("mute audio tracks", "accessibility help text for mute button")); - if (name == "UnMuteButton") - return String(LPCTSTR_UI_STRING("unmute audio tracks", "accessibility help text for un mute button")); - if (name == "PlayButton") - return String(LPCTSTR_UI_STRING("begin playback", "accessibility help text for play button")); - if (name == "PauseButton") - return String(LPCTSTR_UI_STRING("pause playback", "accessibility help text for pause button")); - if (name == "Slider") - return String(LPCTSTR_UI_STRING("movie time scrubber", "accessibility help text for timeline slider")); - if (name == "SliderThumb") - return String(LPCTSTR_UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb")); - if (name == "RewindButton") - return String(LPCTSTR_UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button")); - if (name == "ReturnToRealtimeButton") - return String(LPCTSTR_UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button")); - if (name == "CurrentTimeDisplay") - return String(LPCTSTR_UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display")); - if (name == "TimeRemainingDisplay") - return String(LPCTSTR_UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display")); - if (name == "StatusDisplay") - return String(LPCTSTR_UI_STRING("current movie status", "accessibility help text for movie status display")); - if (name == "SeekBackButton") - return String(LPCTSTR_UI_STRING("seek quickly back", "accessibility help text for fast rewind button")); - if (name == "SeekForwardButton") - return String(LPCTSTR_UI_STRING("seek quickly forward", "accessibility help text for fast forward button")); - if (name == "FullscreenButton") - return String(LPCTSTR_UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button")); - if (name == "ShowClosedCaptionsButton") - return String(LPCTSTR_UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button")); - if (name == "HideClosedCaptionsButton") - return String(LPCTSTR_UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button")); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebCore::localizedMediaTimeDescription(float time) -{ - if (!isfinite(time)) - return String(LPCTSTR_UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value")); - - int seconds = (int)fabsf(time); - int days = seconds / (60 * 60 * 24); - int hours = seconds / (60 * 60); - int minutes = (seconds / 60) % 60; - seconds %= 60; - - if (days) { - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day")); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), days, hours, minutes, seconds)); - return result.get(); - } - - if (hours) { - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes")); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), hours, minutes, seconds)); - return result.get(); - } - - if (minutes) { - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds")); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), minutes, seconds)); - return result.get(); - } - - static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds")); - RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), seconds)); - return result.get(); -} - -#endif // ENABLE(VIDEO) - -String WebCore::validationMessageValueMissingText() { return String(LPCTSTR_UI_STRING("value missing", "Validation message for required form control elements that have no value")); } -String WebCore::validationMessageTypeMismatchText() { return String(LPCTSTR_UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type")); } -String WebCore::validationMessagePatternMismatchText() { return String(LPCTSTR_UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern")); } -String WebCore::validationMessageTooLongText() { return String(LPCTSTR_UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length")); } -String WebCore::validationMessageRangeUnderflowText() { return String(LPCTSTR_UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum")); } -String WebCore::validationMessageRangeOverflowText() { return String(LPCTSTR_UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum")); } -String WebCore::validationMessageStepMismatchText() { return String(LPCTSTR_UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute")); } diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 08d4ee9..d5aea25 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -786,7 +786,7 @@ void WebChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChoose // FIXME: Show some sort of error if too many files are selected and the buffer is too small. For now, this will fail silently. } -void WebChromeClient::chooseIconForFiles(const Vector<WebCore::String>& filenames, WebCore::FileChooser* chooser) +void WebChromeClient::chooseIconForFiles(const Vector<WTF::String>& filenames, WebCore::FileChooser* chooser) { chooser->iconLoaded(Icon::createIconForFiles(filenames)); } diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index cea11c7..5a796eb 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -78,17 +78,17 @@ public: virtual void setResizable(bool); - virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WebCore::String& message, unsigned line, const WebCore::String& url); + virtual void addMessageToConsole(WebCore::MessageSource source, WebCore::MessageType type, WebCore::MessageLevel level, const WTF::String& message, unsigned line, const WTF::String& url); virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const WebCore::String& message, WebCore::Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const WTF::String& message, WebCore::Frame* frame); virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptConfirm(WebCore::Frame*, const WebCore::String&); - virtual bool runJavaScriptPrompt(WebCore::Frame*, const WebCore::String& message, const WebCore::String& defaultValue, WebCore::String& result); - virtual void setStatusbarText(const WebCore::String&); + virtual void runJavaScriptAlert(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptConfirm(WebCore::Frame*, const WTF::String&); + virtual bool runJavaScriptPrompt(WebCore::Frame*, const WTF::String& message, const WTF::String& defaultValue, WTF::String& result); + virtual void setStatusbarText(const WTF::String&); virtual bool shouldInterruptJavaScript(); virtual bool tabsToLinks() const; @@ -109,12 +109,12 @@ public: virtual bool shouldMissingPluginMessageBeButton() const; virtual void missingPluginButtonClicked(WebCore::Element*) const; - virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); + virtual void setToolTip(const WTF::String&, WebCore::TextDirection); virtual void print(WebCore::Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); + virtual void exceededDatabaseQuota(WebCore::Frame*, const WTF::String&); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) @@ -130,7 +130,7 @@ public: virtual bool paintCustomScrollCorner(WebCore::GraphicsContext*, const WebCore::FloatRect&); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); - virtual void chooseIconForFiles(const Vector<WebCore::String>&, WebCore::FileChooser*); + virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); virtual void setCursor(const WebCore::Cursor&); virtual void setLastSetCursorToCurrentCursor(); diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.h b/WebKit/win/WebCoreSupport/WebContextMenuClient.h index 153e30e..6bcb072 100644 --- a/WebKit/win/WebCoreSupport/WebContextMenuClient.h +++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.h @@ -26,9 +26,6 @@ #include <WebCore/ContextMenuClient.h> #include <wtf/Forward.h> -namespace WebCore { - class String; -} class WebView; class WebContextMenuClient : public WebCore::ContextMenuClient { @@ -43,7 +40,7 @@ public: virtual void downloadURL(const WebCore::KURL&); virtual void searchWithGoogle(const WebCore::Frame*); virtual void lookUpInDictionary(WebCore::Frame*); - virtual void speak(const WebCore::String&); + virtual void speak(const WTF::String&); virtual void stopSpeaking(); virtual bool isSpeaking(); diff --git a/WebKit/win/WebCoreSupport/WebDragClient.h b/WebKit/win/WebCoreSupport/WebDragClient.h index f7ca139..da2d208 100644 --- a/WebKit/win/WebCoreSupport/WebDragClient.h +++ b/WebKit/win/WebCoreSupport/WebDragClient.h @@ -39,7 +39,7 @@ public: virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&); virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*); virtual void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&, const WebCore::IntPoint&, WebCore::Clipboard*, WebCore::Frame*, bool); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String&, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String&, WebCore::Frame*); private: WebView* m_webView; }; diff --git a/WebKit/win/WebCoreSupport/WebEditorClient.h b/WebKit/win/WebCoreSupport/WebEditorClient.h index ac2e25e..8be6de9 100644 --- a/WebKit/win/WebCoreSupport/WebEditorClient.h +++ b/WebKit/win/WebCoreSupport/WebEditorClient.h @@ -53,7 +53,7 @@ public: virtual bool shouldBeginEditing(WebCore::Range*); virtual bool shouldEndEditing(WebCore::Range*); - virtual bool shouldInsertText(const WebCore::String&, WebCore::Range*, WebCore::EditorInsertAction); + virtual bool shouldInsertText(const WTF::String&, WebCore::Range*, WebCore::EditorInsertAction); virtual void didBeginEditing(); virtual void didEndEditing(); @@ -98,16 +98,16 @@ public: void handleKeyboardEvent(WebCore::KeyboardEvent*); void handleInputMethodKeydown(WebCore::KeyboardEvent*); - virtual void ignoreWordInSpellDocument(const WebCore::String&); - virtual void learnWord(const WebCore::String&); + virtual void ignoreWordInSpellDocument(const WTF::String&); + virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); - virtual WebCore::String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual void updateSpellingUIWithGrammarString(const WebCore::String&, const WebCore::GrammarDetail& detail); - virtual void updateSpellingUIWithMisspelledWord(const WebCore::String&); + virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail& detail); + virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const WebCore::String&, Vector<WebCore::String>& guesses); + virtual void getGuessesForWord(const WTF::String&, Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool); diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h index 97d9a34..648b5bf 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h @@ -70,7 +70,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WebCore::String&); + virtual void dispatchDidReceiveTitle(const WTF::String&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); @@ -102,7 +102,7 @@ public: virtual void didRunInsecureContent(WebCore::SecurityOrigin*); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WebCore::String& title, const WebCore::KURL&); + virtual void setTitle(const WTF::String& title, const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); @@ -110,13 +110,13 @@ public: virtual bool canCachePage() const; - virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, - const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); + virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, + const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(); - virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually); + virtual PassRefPtr<WebCore::Widget> createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, const WTF::String&, bool loadManually); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); - virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const; + virtual bool shouldUsePluginDocument(const WTF::String& mimeType) const; virtual void dispatchDidFailToStartPlugin(const WebCore::PluginView*) const; @@ -125,8 +125,8 @@ protected: ~WebFrameLoaderClient(); private: - PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WebCore::String& name, WebCore::HTMLFrameOwnerElement*, const WebCore::String& referrer); - void receivedData(const char*, int, const WebCore::String&); + PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL&, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer); + void receivedData(const char*, int, const WTF::String&); WebHistory* webHistory() const; WebFrame* m_webFrame; diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h index 17a8d99..4da3984 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h @@ -58,10 +58,10 @@ public: virtual void highlight(WebCore::Node*); virtual void hideHighlight(); - virtual void populateSetting(const WebCore::String& key, WebCore::String* value); - virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void populateSetting(const WTF::String& key, WTF::String* value); + virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual bool sendMessageToFrontend(const WebCore::String&); + virtual bool sendMessageToFrontend(const WTF::String&); void updateHighlight(); void frontendClosing() @@ -88,8 +88,8 @@ public: virtual void frontendLoaded(); - virtual WebCore::String localizedStringsURL(); - virtual WebCore::String hiddenPanels(); + virtual WTF::String localizedStringsURL(); + virtual WTF::String hiddenPanels(); virtual void bringToFront(); virtual void closeWindow(); @@ -98,7 +98,7 @@ public: virtual void detachWindow(); virtual void setAttachedWindowHeight(unsigned height); - virtual void inspectedURLChanged(const WebCore::String& newURL); + virtual void inspectedURLChanged(const WTF::String& newURL); private: ~WebInspectorFrontendClient(); @@ -128,7 +128,7 @@ private: bool m_attached; - WebCore::String m_inspectedURL; + WTF::String m_inspectedURL; bool m_destroyingInspectorView; static friend LRESULT CALLBACK WebInspectorWndProc(HWND, UINT, WPARAM, LPARAM); diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp new file mode 100644 index 0000000..00a2eab --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp @@ -0,0 +1,611 @@ +/* + * Copyright (C) 2010 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 met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebPlatformStrategies.h" + +#include "WebLocalizableStrings.h" +#include <WebCore/IntSize.h> +#include <WebCore/Page.h> +#include <WebCore/PageGroup.h> +#include <WebCore/PluginDatabase.h> +#include <wtf/MathExtras.h> +#include <wtf/RetainPtr.h> + +using namespace WebCore; + +void WebPlatformStrategies::initialize() +{ + DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ()); +} + +WebPlatformStrategies::WebPlatformStrategies() +{ + setPlatformStrategies(this); +} + +// PluginStrategy + +PluginStrategy* WebPlatformStrategies::createPluginStrategy() +{ + return this; +} + +LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() +{ + return this; +} + +VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() +{ + return this; +} + +void WebPlatformStrategies::refreshPlugins() +{ + PluginDatabase::installedPlugins()->refresh(); +} + +void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& outPlugins) +{ + const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins(); + + outPlugins.resize(plugins.size()); + + for (size_t i = 0; i < plugins.size(); ++i) { + PluginPackage* package = plugins[i]; + + PluginInfo info; + info.name = package->name(); + info.file = package->fileName(); + info.desc = package->description(); + + const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions(); + + info.mimes.reserveCapacity(mimeToDescriptions.size()); + + MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end(); + for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { + MimeClassInfo mime; + + mime.type = it->first; + mime.desc = it->second; + mime.extensions = package->mimeToExtensions().get(mime.type); + + info.mimes.append(mime); + } + + outPlugins[i] = info; + } +} + +// LocalizationStrategy + +String WebPlatformStrategies::searchableIndexIntroduction() +{ + return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); +} + +String WebPlatformStrategies::submitButtonDefaultLabel() +{ + return UI_STRING("Submit", "default label for Submit buttons in forms on web pages"); +} + +String WebPlatformStrategies::inputElementAltText() +{ + return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); +} + +String WebPlatformStrategies::resetButtonDefaultLabel() +{ + return UI_STRING("Reset", "default label for Reset buttons in forms on web pages"); +} + +String WebPlatformStrategies::fileButtonChooseFileLabel() +{ + return UI_STRING("Choose File", "title for file button used in HTML forms"); +} + +String WebPlatformStrategies::fileButtonNoFileSelectedLabel() +{ + return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow() +{ + return UI_STRING("Open Link in New Window", "Open in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk() +{ + return UI_STRING("Download Linked File", "Download Linked File context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard() +{ + return UI_STRING("Copy Link", "Copy Link context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow() +{ + return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk() +{ + return UI_STRING("Download Image", "Download Image context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard() +{ + return UI_STRING("Copy Image", "Copy Image context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow() +{ + return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCopy() +{ + return UI_STRING("Copy", "Copy context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagGoBack() +{ + return UI_STRING("Back", "Back context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagGoForward() +{ + return UI_STRING("Forward", "Forward context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagStop() +{ + return UI_STRING("Stop", "Stop context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagReload() +{ + return UI_STRING("Reload", "Reload context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCut() +{ + return UI_STRING("Cut", "Cut context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagPaste() +{ + return UI_STRING("Paste", "Paste context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagNoGuessesFound() +{ + return UI_STRING("No Guesses Found", "No Guesses Found context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling() +{ + return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLearnSpelling() +{ + return UI_STRING("Learn Spelling", "Learn Spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagSearchWeb() +{ + return UI_STRING("Search with Google", "Search in Google context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary() +{ + return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOpenLink() +{ + return UI_STRING("Open Link", "Open Link context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar() +{ + return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagSpellingMenu() +{ + return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckSpelling() +{ + return UI_STRING("Check Document Now", "Check spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping() +{ + return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling() +{ + return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagFontMenu() +{ + return UI_STRING("Font", "Font context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagBold() +{ + return UI_STRING("Bold", "Bold context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagItalic() +{ + return UI_STRING("Italic", "Italic context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagUnderline() +{ + return UI_STRING("Underline", "Underline context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagOutline() +{ + return UI_STRING("Outline", "Outline context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu() +{ + return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu() +{ + return UI_STRING("Selection Direction", "Selection direction context sub-menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagDefaultDirection() +{ + return UI_STRING("Default", "Default writing direction context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagLeftToRight() +{ + return UI_STRING("Left to Right", "Left to Right context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagRightToLeft() +{ + return UI_STRING("Right to Left", "Right to Left context menu item"); +} + +String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show) +{ + if (show) + return UI_STRING("Show Spelling and Grammar", "menu item title"); + return UI_STRING("Hide Spelling and Grammar", "menu item title"); +} + +String WebPlatformStrategies::contextMenuItemTagInspectElement() +{ + return UI_STRING("Inspect Element", "Inspect Element context menu item"); +} + +String WebPlatformStrategies::searchMenuNoRecentSearchesText() +{ + return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); +} + +String WebPlatformStrategies::searchMenuRecentSearchesText() +{ + return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); +} + +String WebPlatformStrategies::searchMenuClearRecentSearchesText() +{ + return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents"); +} + +String WebPlatformStrategies::AXWebAreaText() +{ + return UI_STRING("web area", "accessibility role description for web area"); +} + +String WebPlatformStrategies::AXLinkText() +{ + return UI_STRING("link", "accessibility role description for link"); +} + +String WebPlatformStrategies::AXListMarkerText() +{ + return UI_STRING("list marker", "accessibility role description for list marker"); +} + +String WebPlatformStrategies::AXImageMapText() +{ + return UI_STRING("image map", "accessibility role description for image map"); +} + +String WebPlatformStrategies::AXHeadingText() +{ + return UI_STRING("heading", "accessibility role description for headings"); +} + +String WebPlatformStrategies::AXDefinitionListTermText() +{ + return UI_STRING("term", "term word of a definition"); +} + +String WebPlatformStrategies::AXDefinitionListDefinitionText() +{ + return UI_STRING("definition", "definition phrase"); +} + +String WebPlatformStrategies::AXButtonActionVerb() +{ + return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility"); +} + +String WebPlatformStrategies::AXRadioButtonActionVerb() +{ + return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::AXTextFieldActionVerb() +{ + return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility"); +} + +String WebPlatformStrategies::AXCheckedCheckBoxActionVerb() +{ + return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb() +{ + return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::AXLinkActionVerb() +{ + return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::AXMenuListActionVerb() +{ + return UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::AXMenuListPopupActionVerb() +{ + return UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility"); +} + +String WebPlatformStrategies::unknownFileSizeText() +{ + return UI_STRING("Unknown", "Unknown filesize FTP directory listing item"); +} + +String WebPlatformStrategies::uploadFileText() +{ + return UI_STRING("Upload file", "(Windows) Form submit file upload dialog title"); +} + +String WebPlatformStrategies::allFilesText() +{ + return UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up"); +} + +String WebPlatformStrategies::missingPluginText() +{ + return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing"); +} + +String WebPlatformStrategies::crashedPluginText() +{ + return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed"); +} + +String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) +{ + RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString()); + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCF.get(), size.width(), size.height())).get(); +} + +String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles) +{ + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles)).get(); +} + +String WebPlatformStrategies::mediaElementLoadingStateText() +{ + return UI_STRING("Loading...", "Media controller status message when the media is loading"); +} + +String WebPlatformStrategies::mediaElementLiveBroadcastStateText() +{ + return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast"); +} + +String WebPlatformStrategies::localizedMediaControlElementString(const String& name) +{ + if (name == "AudioElement") + return UI_STRING("audio element controller", "accessibility role description for audio element controller"); + if (name == "VideoElement") + return UI_STRING("video element controller", "accessibility role description for video element controller"); + if (name == "MuteButton") + return UI_STRING("mute", "accessibility role description for mute button"); + if (name == "UnMuteButton") + return UI_STRING("unmute", "accessibility role description for turn mute off button"); + if (name == "PlayButton") + return UI_STRING("play", "accessibility role description for play button"); + if (name == "PauseButton") + return UI_STRING("pause", "accessibility role description for pause button"); + if (name == "Slider") + return UI_STRING("movie time", "accessibility role description for timeline slider"); + if (name == "SliderThumb") + return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"); + if (name == "RewindButton") + return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"); + if (name == "ReturnToRealtimeButton") + return UI_STRING("return to realtime", "accessibility role description for return to real time button"); + if (name == "CurrentTimeDisplay") + return UI_STRING("elapsed time", "accessibility role description for elapsed time display"); + if (name == "TimeRemainingDisplay") + return UI_STRING("remaining time", "accessibility role description for time remaining display"); + if (name == "StatusDisplay") + return UI_STRING("status", "accessibility role description for movie status"); + if (name == "FullscreenButton") + return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"); + if (name == "SeekForwardButton") + return UI_STRING("fast forward", "accessibility role description for fast forward button"); + if (name == "SeekBackButton") + return UI_STRING("fast reverse", "accessibility role description for fast reverse button"); + if (name == "ShowClosedCaptionsButton") + return UI_STRING("show closed captions", "accessibility role description for show closed captions button"); + if (name == "HideClosedCaptionsButton") + return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button"); + + ASSERT_NOT_REACHED(); + return String(); +} + +String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) +{ + if (name == "AudioElement") + return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"); + if (name == "VideoElement") + return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"); + if (name == "MuteButton") + return UI_STRING("mute audio tracks", "accessibility help text for mute button"); + if (name == "UnMuteButton") + return UI_STRING("unmute audio tracks", "accessibility help text for un mute button"); + if (name == "PlayButton") + return UI_STRING("begin playback", "accessibility help text for play button"); + if (name == "PauseButton") + return UI_STRING("pause playback", "accessibility help text for pause button"); + if (name == "Slider") + return UI_STRING("movie time scrubber", "accessibility help text for timeline slider"); + if (name == "SliderThumb") + return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); + if (name == "RewindButton") + return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); + if (name == "ReturnToRealtimeButton") + return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); + if (name == "CurrentTimeDisplay") + return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"); + if (name == "TimeRemainingDisplay") + return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"); + if (name == "StatusDisplay") + return UI_STRING("current movie status", "accessibility help text for movie status display"); + if (name == "SeekBackButton") + return UI_STRING("seek quickly back", "accessibility help text for fast rewind button"); + if (name == "SeekForwardButton") + return UI_STRING("seek quickly forward", "accessibility help text for fast forward button"); + if (name == "FullscreenButton") + return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); + if (name == "ShowClosedCaptionsButton") + return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button"); + if (name == "HideClosedCaptionsButton") + return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"); + + ASSERT_NOT_REACHED(); + return String(); +} + +String WebPlatformStrategies::localizedMediaTimeDescription(float time) +{ + if (!isfinite(time)) + return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value"); + + int seconds = (int)fabsf(time); + int days = seconds / (60 * 60 * 24); + int hours = seconds / (60 * 60); + int minutes = (seconds / 60) % 60; + seconds %= 60; + + if (days) + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds)).get(); + + if (hours) + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds)).get(); + + if (minutes) + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds)).get(); + + return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds)).get(); +} + +String WebPlatformStrategies::validationMessageValueMissingText() +{ + return UI_STRING("value missing", "Validation message for required form control elements that have no value"); +} + +String WebPlatformStrategies::validationMessageTypeMismatchText() +{ + return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type"); +} + +String WebPlatformStrategies::validationMessagePatternMismatchText() +{ + return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern"); +} + +String WebPlatformStrategies::validationMessageTooLongText() +{ + return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length"); +} + +String WebPlatformStrategies::validationMessageRangeUnderflowText() +{ + return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum"); +} + +String WebPlatformStrategies::validationMessageRangeOverflowText() +{ + return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum"); +} + +String WebPlatformStrategies::validationMessageStepMismatchText() +{ + return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute"); +} + +bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) +{ + return page->group().isLinkVisited(hash); +} + +void WebPlatformStrategies::addVisitedLink(Page* page, LinkHash hash) +{ + page->group().addVisitedLinkHash(hash); +} diff --git a/WebKit/win/WebCoreSupport/WebPlatformStrategies.h b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h new file mode 100644 index 0000000..c3cfbb4 --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebPlatformStrategies.h @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2010 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 met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebPlatformStrategies_h +#define WebPlatformStrategies_h + +#include <WebCore/LocalizationStrategy.h> +#include <WebCore/PlatformStrategies.h> +#include <WebCore/PluginStrategy.h> +#include <WebCore/VisitedLinkStrategy.h> + +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { +public: + static void initialize(); + +private: + WebPlatformStrategies(); + + // WebCore::PlatformStrategies + virtual WebCore::PluginStrategy* createPluginStrategy(); + virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); + virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); + + // WebCore::PluginStrategy + virtual void refreshPlugins(); + virtual void getPluginInfo(Vector<WebCore::PluginInfo>&); + + // WebCore::LocalizationStrategy + virtual WTF::String inputElementAltText(); + virtual WTF::String resetButtonDefaultLabel(); + virtual WTF::String searchableIndexIntroduction(); + virtual WTF::String submitButtonDefaultLabel(); + virtual WTF::String fileButtonChooseFileLabel(); + virtual WTF::String fileButtonNoFileSelectedLabel(); +#if ENABLE(CONTEXT_MENUS) + virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); + virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); + virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); + virtual WTF::String contextMenuItemTagDownloadImageToDisk(); + virtual WTF::String contextMenuItemTagCopyImageToClipboard(); + virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); + virtual WTF::String contextMenuItemTagCopy(); + virtual WTF::String contextMenuItemTagGoBack(); + virtual WTF::String contextMenuItemTagGoForward(); + virtual WTF::String contextMenuItemTagStop(); + virtual WTF::String contextMenuItemTagReload(); + virtual WTF::String contextMenuItemTagCut(); + virtual WTF::String contextMenuItemTagPaste(); + virtual WTF::String contextMenuItemTagNoGuessesFound(); + virtual WTF::String contextMenuItemTagIgnoreSpelling(); + virtual WTF::String contextMenuItemTagLearnSpelling(); + virtual WTF::String contextMenuItemTagSearchWeb(); + virtual WTF::String contextMenuItemTagLookUpInDictionary(); + virtual WTF::String contextMenuItemTagOpenLink(); + virtual WTF::String contextMenuItemTagIgnoreGrammar(); + virtual WTF::String contextMenuItemTagSpellingMenu(); + virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); + virtual WTF::String contextMenuItemTagCheckSpelling(); + virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); + virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); + virtual WTF::String contextMenuItemTagFontMenu(); + virtual WTF::String contextMenuItemTagBold(); + virtual WTF::String contextMenuItemTagItalic(); + virtual WTF::String contextMenuItemTagUnderline(); + virtual WTF::String contextMenuItemTagOutline(); + virtual WTF::String contextMenuItemTagWritingDirectionMenu(); + virtual WTF::String contextMenuItemTagTextDirectionMenu(); + virtual WTF::String contextMenuItemTagDefaultDirection(); + virtual WTF::String contextMenuItemTagLeftToRight(); + virtual WTF::String contextMenuItemTagRightToLeft(); + virtual WTF::String contextMenuItemTagInspectElement(); +#endif // ENABLE(CONTEXT_MENUS) + virtual WTF::String searchMenuNoRecentSearchesText(); + virtual WTF::String searchMenuRecentSearchesText(); + virtual WTF::String searchMenuClearRecentSearchesText(); + virtual WTF::String AXWebAreaText(); + virtual WTF::String AXLinkText(); + virtual WTF::String AXListMarkerText(); + virtual WTF::String AXImageMapText(); + virtual WTF::String AXHeadingText(); + virtual WTF::String AXDefinitionListTermText(); + virtual WTF::String AXDefinitionListDefinitionText(); + virtual WTF::String AXButtonActionVerb(); + virtual WTF::String AXRadioButtonActionVerb(); + virtual WTF::String AXTextFieldActionVerb(); + virtual WTF::String AXCheckedCheckBoxActionVerb(); + virtual WTF::String AXUncheckedCheckBoxActionVerb(); + virtual WTF::String AXMenuListActionVerb(); + virtual WTF::String AXMenuListPopupActionVerb(); + virtual WTF::String AXLinkActionVerb(); + virtual WTF::String missingPluginText(); + virtual WTF::String crashedPluginText(); + virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); + virtual WTF::String unknownFileSizeText(); + virtual WTF::String uploadFileText(); + virtual WTF::String allFilesText(); + virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&); + virtual WTF::String mediaElementLoadingStateText(); + virtual WTF::String mediaElementLiveBroadcastStateText(); + virtual WTF::String localizedMediaControlElementString(const WTF::String&); + virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); + virtual WTF::String localizedMediaTimeDescription(float); + virtual WTF::String validationMessageValueMissingText(); + virtual WTF::String validationMessageTypeMismatchText(); + virtual WTF::String validationMessagePatternMismatchText(); + virtual WTF::String validationMessageTooLongText(); + virtual WTF::String validationMessageRangeUnderflowText(); + virtual WTF::String validationMessageRangeOverflowText(); + virtual WTF::String validationMessageStepMismatchText(); + + // WebCore::VisitedLinkStrategy + virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); + virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); +}; + +#endif // WebPlatformStrategies_h diff --git a/WebKit/win/WebCoreSupport/WebPluginHalterClient.h b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h index da3d28a..9a4ca01 100644 --- a/WebKit/win/WebCoreSupport/WebPluginHalterClient.h +++ b/WebKit/win/WebCoreSupport/WebPluginHalterClient.h @@ -27,10 +27,10 @@ #define WebPluginHalterClient_h #include <WebCore/PluginHalterClient.h> +#include <wtf/Forward.h> namespace WebCore { class Node; - class String; } class WebView; @@ -39,7 +39,7 @@ class WebPluginHalterClient : public WebCore::PluginHalterClient { public: WebPluginHalterClient(WebView* webView); - virtual bool shouldHaltPlugin(WebCore::Node* n, bool isWindowed, const WebCore::String& pluginName) const; + virtual bool shouldHaltPlugin(WebCore::Node* n, bool isWindowed, const WTF::String& pluginName) const; virtual bool enabled() const; private: diff --git a/WebKit/win/WebDatabaseManager.cpp b/WebKit/win/WebDatabaseManager.cpp index 238aa61..4c23d6c 100644 --- a/WebKit/win/WebDatabaseManager.cpp +++ b/WebKit/win/WebDatabaseManager.cpp @@ -376,7 +376,7 @@ void WebKitInitializeWebDatabasesIfNecessary() if (initialized) return; - WebCore::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); + WTF::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); WebCore::DatabaseTracker::initializeTracker(databasesDirectory); initialized = true; diff --git a/WebKit/win/WebDatabaseManager.h b/WebKit/win/WebDatabaseManager.h index 405c916..a8ca523 100644 --- a/WebKit/win/WebDatabaseManager.h +++ b/WebKit/win/WebDatabaseManager.h @@ -79,7 +79,7 @@ public: // DatabaseTrackerClient virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*); - virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseName); + virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WTF::String& databaseName); private: WebDatabaseManager(); diff --git a/WebKit/win/WebDownload.h b/WebKit/win/WebDownload.h index 71aebfe..bbb645e 100644 --- a/WebKit/win/WebDownload.h +++ b/WebKit/win/WebDownload.h @@ -122,15 +122,15 @@ public: #endif protected: - static CFDataRef extractResumeDataFromBundle(const WebCore::String&); - static HRESULT appendResumeDataToBundle(CFDataRef, const WebCore::String&); - static const WebCore::String& bundleExtension(); + static CFDataRef extractResumeDataFromBundle(const WTF::String&); + static HRESULT appendResumeDataToBundle(CFDataRef, const WTF::String&); + static const WTF::String& bundleExtension(); static UInt32 bundleMagicNumber(); ULONG m_refCount; - WebCore::String m_destination; - WebCore::String m_bundlePath; + WTF::String m_destination; + WTF::String m_bundlePath; #if USE(CFNETWORK) RetainPtr<CFURLDownloadRef> m_download; #endif diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h index c14ddc9..6f8b56a 100644 --- a/WebKit/win/WebFrame.h +++ b/WebKit/win/WebFrame.h @@ -299,9 +299,9 @@ public: virtual void didChangeTitle(WebCore::DocumentLoader*); virtual void didChangeIcons(WebCore::DocumentLoader*); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; - virtual bool canShowMIMEType(const WebCore::String& MIMEType) const; - virtual bool representationExistsForURLScheme(const WebCore::String& URLScheme) const; - virtual WebCore::String generatedMIMETypeForURLScheme(const WebCore::String& URLScheme) const; + virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; + virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); virtual void restoreViewState(); virtual void provisionalLoadStarted(); @@ -309,7 +309,7 @@ public: virtual void addHistoryItemForFragmentScroll(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); - virtual WebCore::String userAgent(const WebCore::KURL&); + virtual WTF::String userAgent(const WebCore::KURL&); virtual void saveViewStateToItem(WebCore::HistoryItem *); virtual WebCore::ResourceError cancelledError(const WebCore::ResourceRequest&); virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&); @@ -319,8 +319,8 @@ public: virtual WebCore::ResourceError fileDoesNotExistError(const WebCore::ResourceResponse&); virtual WebCore::ResourceError pluginWillHandleLoadError(const WebCore::ResourceResponse&); virtual bool shouldFallBack(const WebCore::ResourceError&); - virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WebCore::String& MIMEType, const WebCore::ResourceRequest&); - virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WebCore::String& frameName); + virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction, const WTF::String& MIMEType, const WebCore::ResourceRequest&); + virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>, const WTF::String& frameName); virtual void dispatchDecidePolicyForNavigationAction(WebCore::FramePolicyFunction, const WebCore::NavigationAction&, const WebCore::ResourceRequest&, PassRefPtr<WebCore::FormState>); virtual void dispatchUnableToImplementPolicy(const WebCore::ResourceError&); virtual void download(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); @@ -330,10 +330,10 @@ public: virtual void dispatchDidFailLoad(const WebCore::ResourceError&); virtual void startDownload(const WebCore::ResourceRequest&); - virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WebCore::String>& paramNames, const Vector<WebCore::String>& paramValues); + virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(const WebCore::IntSize&, WebCore::HTMLAppletElement*, const WebCore::KURL& baseURL, const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); - virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WebCore::String& mimeType); - virtual WebCore::String overrideMediaType() const; + virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, const WTF::String& mimeType); + virtual WTF::String overrideMediaType() const; virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*); virtual void documentElementAvailable(); diff --git a/WebKit/win/WebHistory.h b/WebKit/win/WebHistory.h index 9d8acb3..17cd3a7 100644 --- a/WebKit/win/WebHistory.h +++ b/WebKit/win/WebHistory.h @@ -30,13 +30,13 @@ #include "COMPtr.h" #include <CoreFoundation/CoreFoundation.h> +#include <wtf/Forward.h> #include <wtf/OwnArrayPtr.h> #include <wtf/RetainPtr.h> namespace WebCore { class KURL; class PageGroup; - class String; } //----------------------------------------------------------------------------- @@ -121,10 +121,10 @@ public: // WebHistory static WebHistory* sharedHistory(); - void visitedURL(const WebCore::KURL&, const WebCore::String& title, const WebCore::String& httpMethod, bool wasFailure, bool increaseVisitCount); + void visitedURL(const WebCore::KURL&, const WTF::String& title, const WTF::String& httpMethod, bool wasFailure, bool increaseVisitCount); void addVisitedLinksToPageGroup(WebCore::PageGroup&); - COMPtr<IWebHistoryItem> itemForURLString(const WebCore::String&) const; + COMPtr<IWebHistoryItem> itemForURLString(const WTF::String&) const; typedef int64_t DateKey; typedef HashMap<DateKey, RetainPtr<CFMutableArrayRef> > DateToEntriesMap; diff --git a/WebKit/win/WebHistoryItem.h b/WebKit/win/WebHistoryItem.h index 40ec16d..7e42039 100644 --- a/WebKit/win/WebHistoryItem.h +++ b/WebKit/win/WebHistoryItem.h @@ -113,7 +113,7 @@ protected: ULONG m_refCount; RefPtr<WebCore::HistoryItem> m_historyItem; - WebCore::String m_alternateTitle; + WTF::String m_alternateTitle; }; #endif diff --git a/WebKit/win/WebIconDatabase.h b/WebKit/win/WebIconDatabase.h index ac42d4a..c6351a7 100644 --- a/WebKit/win/WebIconDatabase.h +++ b/WebKit/win/WebIconDatabase.h @@ -104,7 +104,7 @@ public: // IconDatabaseClient virtual void dispatchDidRemoveAllIcons(); - virtual void dispatchDidAddIconForPageURL(const WebCore::String&); + virtual void dispatchDidAddIconForPageURL(const WTF::String&); static BSTR iconDatabaseDidAddIconNotification(); static BSTR iconDatabaseDidRemoveAllIconsNotification(); diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj index 50f5921..85e8ee1 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.vcproj +++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj @@ -418,10 +418,6 @@ >
</File>
<File
- RelativePath="..\WebCoreLocalizedStrings.cpp"
- >
- </File>
- <File
RelativePath="..\WebKitClassFactory.cpp"
>
</File>
@@ -1328,6 +1324,14 @@ >
</File>
<File
+ RelativePath="..\WebCoreSupport\WebPlatformStrategies.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebCoreSupport\WebPlatformStrategies.h"
+ >
+ </File>
+ <File
RelativePath="..\WebCoreSupport\WebPluginHalterClient.cpp"
>
</File>
diff --git a/WebKit/win/WebKitDLL.h b/WebKit/win/WebKitDLL.h index d944b07..c31bc2d 100644 --- a/WebKit/win/WebKitDLL.h +++ b/WebKit/win/WebKitDLL.h @@ -48,7 +48,7 @@ extern "C" { extern ULONG gLockCount; extern ULONG gClassCount; -extern HashCountedSet<WebCore::String> gClassNameCount; +extern HashCountedSet<WTF::String> gClassNameCount; extern HINSTANCE gInstance; extern CLSID gRegCLSIDs[]; diff --git a/WebKit/win/WebKitSystemBits.cpp b/WebKit/win/WebKitSystemBits.cpp index e8ee0e9..eec6361 100644 --- a/WebKit/win/WebKitSystemBits.cpp +++ b/WebKit/win/WebKitSystemBits.cpp @@ -46,7 +46,7 @@ unsigned long long WebMemorySize() unsigned long long WebVolumeFreeSize(CFStringRef cfstringPath) { - WebCore::String path(cfstringPath); + WTF::String path(cfstringPath); ULARGE_INTEGER freeBytesToCaller; BOOL result = GetDiskFreeSpaceExW((LPCWSTR)path.charactersWithNullTermination(), &freeBytesToCaller, 0, 0); if (!result) diff --git a/WebKit/win/WebNavigationData.h b/WebKit/win/WebNavigationData.h index d00912c..f4793dc 100644 --- a/WebKit/win/WebNavigationData.h +++ b/WebKit/win/WebNavigationData.h @@ -33,9 +33,9 @@ class WebNavigationData : public IWebNavigationData { public: - static WebNavigationData* createInstance(const WebCore::String& url, const WebCore::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WebCore::String& clientRedirectSource); + static WebNavigationData* createInstance(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource); private: - WebNavigationData(const WebCore::String& url, const WebCore::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WebCore::String& clientRedirectSource); + WebNavigationData(const WTF::String& url, const WTF::String& title, IWebURLRequest*, IWebURLResponse*, bool hasSubstituteData, const WTF::String& clientRedirectSource); ~WebNavigationData(); public: diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index a1055cb..25cfbda 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -102,7 +102,7 @@ static bool booleanValueForPreferencesValue(CFPropertyListRef value) static CFDictionaryRef defaultSettings; -static HashMap<WebCore::String, COMPtr<WebPreferences> > webPreferencesInstances; +static HashMap<WTF::String, COMPtr<WebPreferences> > webPreferencesInstances; WebPreferences* WebPreferences::sharedStandardPreferences() { @@ -154,7 +154,7 @@ WebPreferences* WebPreferences::getInstanceForIdentifier(BSTR identifier) if (!identifier) return sharedStandardPreferences(); - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); return webPreferencesInstances.get(identifierString).get(); } @@ -162,7 +162,7 @@ void WebPreferences::setInstance(WebPreferences* instance, BSTR identifier) { if (!identifier || !instance) return; - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); webPreferencesInstances.add(identifierString, instance); } @@ -171,7 +171,7 @@ void WebPreferences::removeReferenceForIdentifier(BSTR identifier) if (!identifier || webPreferencesInstances.isEmpty()) return; - WebCore::String identifierString(identifier, SysStringLen(identifier)); + WTF::String identifierString(identifier, SysStringLen(identifier)); WebPreferences* webPreference = webPreferencesInstances.get(identifierString).get(); if (webPreference && webPreference->m_refCount == 1) webPreferencesInstances.remove(identifierString); @@ -194,7 +194,7 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitMinimumLogicalFontSizePreferenceKey), CFSTR("9")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFontSizePreferenceKey), CFSTR("16")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFixedFontSizePreferenceKey), CFSTR("13")); - WebCore::String defaultDefaultEncoding(LPCTSTR_UI_STRING("ISO-8859-1", "The default, default character encoding")); + WTF::String defaultDefaultEncoding(LPCTSTR_UI_STRING("ISO-8859-1", "The default, default character encoding")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultTextEncodingNamePreferenceKey), defaultDefaultEncoding.createCFString()); CFDictionaryAddValue(defaults, CFSTR(WebKitUserStyleSheetEnabledPreferenceKey), kCFBooleanFalse); diff --git a/WebKit/win/WebResource.cpp b/WebKit/win/WebResource.cpp index d02bcc5..506e55d 100644 --- a/WebKit/win/WebResource.cpp +++ b/WebKit/win/WebResource.cpp @@ -38,7 +38,7 @@ using namespace WebCore; // WebResource --------------------------------------------------------------------- -WebResource::WebResource(IStream* data, const WebCore::KURL& url, const WebCore::String& mimeType, const WebCore::String& textEncodingName, const WebCore::String& frameName) +WebResource::WebResource(IStream* data, const WebCore::KURL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName) : m_refCount(0) , m_data(data) , m_url(url) diff --git a/WebKit/win/WebResource.h b/WebKit/win/WebResource.h index d67cb56..7c6759a 100644 --- a/WebKit/win/WebResource.h +++ b/WebKit/win/WebResource.h @@ -41,7 +41,7 @@ class WebResource : public IWebResource { public: static WebResource* createInstance(PassRefPtr<WebCore::SharedBuffer> data, const WebCore::ResourceResponse& response); protected: - WebResource(IStream* data, const WebCore::KURL& url, const WebCore::String& mimeType, const WebCore::String& textEncodingName, const WebCore::String& frameName); + WebResource(IStream* data, const WebCore::KURL& url, const WTF::String& mimeType, const WTF::String& textEncodingName, const WTF::String& frameName); ~WebResource(); public: @@ -77,9 +77,9 @@ private: ULONG m_refCount; COMPtr<IStream> m_data; WebCore::KURL m_url; - WebCore::String m_mimeType; - WebCore::String m_textEncodingName; - WebCore::String m_frameName; + WTF::String m_mimeType; + WTF::String m_textEncodingName; + WTF::String m_frameName; }; #endif diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 8dfb7e7..c307c02 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -54,6 +54,7 @@ #include "WebKitSystemBits.h" #include "WebMutableURLRequest.h" #include "WebNotificationCenter.h" +#include "WebPlatformStrategies.h" #include "WebPluginHalterClient.h" #include "WebPreferences.h" #include "WebScriptWorld.h" @@ -2111,10 +2112,8 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, // child of ours (for example a plugin). if (!IsChild(hWnd, reinterpret_cast<HWND>(wParam))) focusController->setFocused(true); - } else { + } else focusController->setFocused(true); - focusController->setFocusedFrame(webView->page()->mainFrame()); - } break; } case WM_KILLFOCUS: { @@ -2557,6 +2556,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( WebKitInitializeWebDatabasesIfNecessary(); #endif WebKitSetApplicationCachePathIfNecessary(); + WebPlatformStrategies::initialize(); #if USE(SAFARI_THEME) BOOL shouldPaintNativeControls; @@ -3089,7 +3089,7 @@ HRESULT STDMETHODCALLTYPE WebView::stringByEvaluatingJavaScriptFromString( if (!coreFrame) return E_FAIL; - JSC::JSValue scriptExecutionResult = coreFrame->script()->executeScript(WebCore::String(script), true).jsValue(); + JSC::JSValue scriptExecutionResult = coreFrame->script()->executeScript(WTF::String(script), true).jsValue(); if (!scriptExecutionResult) return E_FAIL; else if (scriptExecutionResult.isString()) { @@ -5725,6 +5725,8 @@ HRESULT STDMETHODCALLTYPE WebView::backingStore( { if (!hBitmap) return E_POINTER; + if (!m_backingStoreBitmap) + return E_FAIL; *hBitmap = reinterpret_cast<OLE_HANDLE>(m_backingStoreBitmap->handle()); return S_OK; } @@ -5856,7 +5858,7 @@ HRESULT STDMETHODCALLTYPE WebView::registerEmbeddedViewMIMEType(BSTR mimeType) return S_OK; } -bool WebView::shouldUseEmbeddedView(const WebCore::String& mimeType) const +bool WebView::shouldUseEmbeddedView(const WTF::String& mimeType) const { if (!m_embeddedViewMIMETypes) return false; diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index c7e7605..eec24fd 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -806,7 +806,7 @@ public: virtual HRESULT STDMETHODCALLTYPE nextDisplayIsSynchronous(); // WebView - bool shouldUseEmbeddedView(const WebCore::String& mimeType) const; + bool shouldUseEmbeddedView(const WTF::String& mimeType) const; WebCore::Page* page(); bool handleMouseEvent(UINT, WPARAM, LPARAM); @@ -859,11 +859,11 @@ public: // Convenient to be able to violate the rules of COM here for easy movement to the frame. WebFrame* topLevelFrame() const { return m_mainFrame; } - const WebCore::String& userAgentForKURL(const WebCore::KURL& url); + const WTF::String& userAgentForKURL(const WebCore::KURL& url); static bool canHandleRequest(const WebCore::ResourceRequest&); - static WebCore::String standardUserAgentWithApplicationName(const WebCore::String&); + static WTF::String standardUserAgentWithApplicationName(const WTF::String&); void setIsBeingDestroyed() { m_isBeingDestroyed = true; } bool isBeingDestroyed() const { return m_isBeingDestroyed; } @@ -873,7 +873,7 @@ public: bool isPainting() const { return m_paintCount > 0; } - void setToolTip(const WebCore::String&); + void setToolTip(const WTF::String&); void registerForIconNotification(bool listen); void dispatchDidReceiveIconFromWebFrame(WebFrame*); @@ -992,11 +992,11 @@ protected: bool m_userAgentOverridden; bool m_useBackForwardList; - WebCore::String m_userAgentCustom; - WebCore::String m_userAgentStandard; + WTF::String m_userAgentCustom; + WTF::String m_userAgentStandard; float m_zoomMultiplier; - WebCore::String m_overrideEncoding; - WebCore::String m_applicationName; + WTF::String m_overrideEncoding; + WTF::String m_applicationName; bool m_mouseActivated; // WebCore dragging logic needs to be able to inspect the drag data // this is updated in DragEnter/Leave/Drop @@ -1012,7 +1012,7 @@ protected: bool m_hasCustomDropTarget; unsigned m_inIMEComposition; HWND m_toolTipHwnd; - WebCore::String m_toolTip; + WTF::String m_toolTip; bool m_deleteBackingStoreTimerActive; bool m_transparent; @@ -1024,7 +1024,7 @@ protected: HWND m_topLevelParent; - OwnPtr<HashSet<WebCore::String> > m_embeddedViewMIMETypes; + OwnPtr<HashSet<WTF::String> > m_embeddedViewMIMETypes; //Variables needed to store gesture information RefPtr<WebCore::Node> m_gestureTargetNode; diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index 362f6e5..b66bf69 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,41 @@ +2010-08-06 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43594 - Add string forwards to Forward.h + This allows us to remove forward declarations for these classes from + WebCore/WebKit (a step in moving these class from WebCore:: to WTF::). + + * WebKitSupport/FrameLoaderClientWx.h: + * WebKitSupport/InspectorClientWx.h: + +2010-08-06 Jessie Berlin <jberlin@apple.com> + + Roll out http://trac.webkit.org/changeset/64801, which broke the Safari Windows Build. + Unreviewed. + + * WebKitSupport/FrameLoaderClientWx.h: + * WebKitSupport/InspectorClientWx.h: + +2010-08-04 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fix for gcc not importing all symbols from convenience libraries. + Works on 10.6 only for Mac until the build system is reworked. + + * bindings/python/webview.i: + +2010-08-03 Malcolm MacLeod <mmacleod@webmail.co.za> + + Reviewed by Kevin Ollivier. + + Fix crash during HitTest call. + https://bugs.webkit.org/show_bug.cgi?id=43372 + + * WebFrame.cpp: + (wxWebFrame::HitTest): + * WebView.cpp: + (wxWebViewDOMElementInfo::wxWebViewDOMElementInfo): + 2010-07-27 Luiz Agostini <luiz.agostini@openbossa.org> Reviewed by Darin Fisher. diff --git a/WebKit/wx/WebEdit.cpp b/WebKit/wx/WebEdit.cpp index ed2d0d4..22ad193 100644 --- a/WebKit/wx/WebEdit.cpp +++ b/WebKit/wx/WebEdit.cpp @@ -55,7 +55,7 @@ wxWebEditCommand::~wxWebEditCommand() void wxWebEditCommand::SetNodeAttribute(WebDOMElement* element, const wxString& name, const wxString& value) { if (m_impl) - m_impl->setElementAttribute(element->impl(), WebCore::QualifiedName(WebCore::nullAtom, WebCore::String(name), WebCore::nullAtom), WebCore::String(value)); + m_impl->setElementAttribute(element->impl(), WebCore::QualifiedName(WebCore::nullAtom, WTF::String(name), WebCore::nullAtom), WTF::String(value)); } void wxWebEditCommand::Apply() diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp index b8d2ac2..182004b 100644 --- a/WebKit/wx/WebFrame.cpp +++ b/WebKit/wx/WebFrame.cpp @@ -164,7 +164,7 @@ void wxWebFrame::SetPageSource(const wxString& source, const wxString& baseUrl) const char* contents = charBuffer; WTF::PassRefPtr<WebCore::SharedBuffer> sharedBuffer = WebCore::SharedBuffer::create(contents, strlen(contents)); - WebCore::SubstituteData substituteData(sharedBuffer, WebCore::String("text/html"), WebCore::String("UTF-8"), WebCore::blankURL(), url); + WebCore::SubstituteData substituteData(sharedBuffer, WTF::String("text/html"), WTF::String("UTF-8"), WebCore::blankURL(), url); m_impl->frame->loader()->stop(); m_impl->frame->loader()->load(WebCore::ResourceRequest(url), substituteData, false); @@ -458,7 +458,6 @@ wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const if (m_impl->frame->view()) { WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false); if (result.innerNode()) { - domInfo.SetInnerNode(new WebDOMNode(result.innerNode())); domInfo.SetLink(result.absoluteLinkURL().string()); domInfo.SetText(result.textContent()); domInfo.SetImageSrc(result.absoluteImageURL().string()); diff --git a/WebKit/wx/WebFramePrivate.h b/WebKit/wx/WebFramePrivate.h index 58bc40a..bee461d 100644 --- a/WebKit/wx/WebFramePrivate.h +++ b/WebKit/wx/WebFramePrivate.h @@ -48,10 +48,10 @@ class WebViewFrameData { public: WebCore::KURL url; - WebCore::String name; + WTF::String name; WebCore::HTMLFrameOwnerElement* ownerElement; - WebCore::String referrer; + WTF::String referrer; bool allowsScrolling; int marginWidth; int marginHeight; diff --git a/WebKit/wx/WebKitSupport/DragClientWx.h b/WebKit/wx/WebKitSupport/DragClientWx.h index 0e93e66..afb54fb 100644 --- a/WebKit/wx/WebKitSupport/DragClientWx.h +++ b/WebKit/wx/WebKitSupport/DragClientWx.h @@ -39,7 +39,7 @@ public: virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&); virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false); - virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WebCore::String& label, WebCore::Frame*); + virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL&, const WTF::String& label, WebCore::Frame*); }; } diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.cpp b/WebKit/wx/WebKitSupport/EditorClientWx.cpp index 64bfd06..99afec8 100644 --- a/WebKit/wx/WebKitSupport/EditorClientWx.cpp +++ b/WebKit/wx/WebKitSupport/EditorClientWx.cpp @@ -532,7 +532,7 @@ void EditorClientWx::getGuessesForWord(const String&, Vector<String>& guesses) notImplemented(); } -String EditorClientWx::getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&) +String EditorClientWx::getAutoCorrectSuggestionForMisspelledWord(const WTF::String&) { notImplemented(); return String(); diff --git a/WebKit/wx/WebKitSupport/EditorClientWx.h b/WebKit/wx/WebKitSupport/EditorClientWx.h index 8d69e36..be5c98a 100644 --- a/WebKit/wx/WebKitSupport/EditorClientWx.h +++ b/WebKit/wx/WebKitSupport/EditorClientWx.h @@ -108,7 +108,7 @@ public: virtual void showSpellingUI(bool show); virtual bool spellingUIIsShowing(); virtual void getGuessesForWord(const String&, Vector<String>& guesses); - virtual String getAutoCorrectSuggestionForMisspelledWord(const WebCore::String&); + virtual String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); diff --git a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h index 95ef2e6..0dee4bf 100644 --- a/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h +++ b/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h @@ -34,6 +34,7 @@ #include "PluginView.h" #include "ResourceResponse.h" #include "HTMLPlugInElement.h" +#include <wtf/Forward.h> class wxWebFrame; class wxWebView; @@ -45,7 +46,6 @@ namespace WebCore { class Element; class FormState; class NavigationAction; - class String; class ResourceLoader; struct LoadErrorResetToken; diff --git a/WebKit/wx/WebKitSupport/InspectorClientWx.h b/WebKit/wx/WebKitSupport/InspectorClientWx.h index 698a0f5..799e954 100644 --- a/WebKit/wx/WebKitSupport/InspectorClientWx.h +++ b/WebKit/wx/WebKitSupport/InspectorClientWx.h @@ -27,12 +27,12 @@ #define InspectorClientWx_h #include "InspectorClient.h" +#include <wtf/Forward.h> namespace WebCore { class Node; class Page; -class String; class InspectorClientWx : public InspectorClient { public: diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp index 88d0ad9..3b0bcb0 100644 --- a/WebKit/wx/WebView.cpp +++ b/WebKit/wx/WebView.cpp @@ -235,7 +235,9 @@ wxWebViewDOMElementInfo::wxWebViewDOMElementInfo() : m_isSelected(false), m_text(wxEmptyString), m_imageSrc(wxEmptyString), - m_link(wxEmptyString) + m_link(wxEmptyString), + m_urlElement(NULL), + m_innerNode(NULL) { } diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i index 15b1d93..58961c0 100644 --- a/WebKit/wx/bindings/python/webview.i +++ b/WebKit/wx/bindings/python/webview.i @@ -26,6 +26,8 @@ %module webview %{ +#include "config.h" + #include "wx/wxPython/wxPython.h" #include "wx/wxPython/pyclasses.h" #include "WebBrowserShell.h" |