diff options
author | Steve Block <steveblock@google.com> | 2010-08-24 07:50:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-08-24 07:50:47 -0700 |
commit | c570a147a94b126d4172c30914f53dea17b4c8f5 (patch) | |
tree | 99c11741887d21f65d67c5bbdab58b7ba2a5d4d5 /WebKit | |
parent | c952714bc6809a5ad081baaf9fcc04107b92ea3f (diff) | |
parent | 6c65f16005b91786c2b7c0791b9ea1dd684d57f4 (diff) | |
download | external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.zip external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.gz external_webkit-c570a147a94b126d4172c30914f53dea17b4c8f5.tar.bz2 |
Merge changes I2e7e2317,Ie6ccde3a,I3e89f231,Id06ff339,I268dfe7d,Icaf70d9f,Ie234f1a0,Iff5c7aaa,I69b75bf0,Ifbf384f4
* changes:
Merge WebKit at r65615 : Update WebKit revision number
Merge WebKit at r65615 : Ignore http/tests/appcache/origin-quota.html
Merge WebKit at r65615 : Android-specific results for Geolocation tests.
Merge WebKit at r65615 : Fix GraphicsContext and ImageBuffer.
Merge WebKit at r65615 : processingUserGesture() is now static.
Merge WebKit at r65615 : UTF8String() becomes utf8().
Merge WebKit at r65615 : Fix include paths for string headers.
Merge WebKit at r65615 : Fix Makefiles.
Merge WebKit at r65615 : Fix conflicts.
Merge WebKit at r65615 : Initial merge by git.
Diffstat (limited to 'WebKit')
197 files changed, 4504 insertions, 1457 deletions
diff --git a/WebKit/CMakeLists.txt b/WebKit/CMakeLists.txt index 3fee2c6..379c8e4 100644 --- a/WebKit/CMakeLists.txt +++ b/WebKit/CMakeLists.txt @@ -66,8 +66,12 @@ ADD_DEFINITIONS(-DBUILDING_WebKit) INCLUDE_DIRECTORIES(${WebKit_INCLUDE_DIRECTORIES}) ADD_LIBRARY(${WebKit_LIBRARY_NAME} ${WebKit_LIBRARY_TYPE} ${WebKit_SOURCES}) TARGET_LINK_LIBRARIES(${WebKit_LIBRARY_NAME} ${WebKit_LIBRARIES}) -ADD_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} LINK_FLAGS "${WebKit_LINK_FLAGS}") -SET_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) -INSTALL(TARGETS ${WebKit_LIBRARY_NAME} DESTINATION lib) +IF (WebKit_LINK_FLAGS) + ADD_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} LINK_FLAGS "${WebKit_LINK_FLAGS}") +ENDIF () +IF (SHARED_CORE) + SET_TARGET_PROPERTIES(${WebKit_LIBRARY_NAME} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + INSTALL(TARGETS ${WebKit_LIBRARY_NAME} DESTINATION lib) +ENDIF () diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 92976db..c7858fb 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,54 @@ +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebKit.xcodeproj/project.pbxproj: Added new files. + +2010-08-17 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Remove developmentRegion from the project file as it shouldn't have been checked in. + + * WebKit.xcodeproj/project.pbxproj: + +2010-08-16 Leandro Pereira <leandro@profusion.mobi> + + [EFL] Build fix after r65366. + + * CMakeLists.txt: Use if (VAR) instead of if (${VAR}) to check if + they're empty. + +2010-08-14 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Pavel Feldman. + + Web Inspector: -[WebInspector attach] and detach should work + https://bugs.webkit.org/show_bug.cgi?id=43924 + + * WebKit.xcodeproj/project.pbxproj: Added WebInspectorFrontend.{h,mm}. + +2010-08-14 Patrick Gansterer <paroga@paroga.com> + + Reviewed by Kenneth Rohde Christiansen. + + [CMake] Set target properties only if available + https://bugs.webkit.org/show_bug.cgi?id=43978 + + * CMakeLists.txt: + +2010-08-13 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + Switch String::/UString::ascii() to return a CString. + + * WebKit.xcodeproj/project.pbxproj: + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj index bad03b6..b76bd24 100644 --- a/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/WebKit/WebKit.xcodeproj/project.pbxproj @@ -139,6 +139,8 @@ 934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */; }; 936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */; }; 936A2DEA0FD2D08400D312DB /* WebTextCompletionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */; }; + 9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */; }; + 9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */; }; 939810110824BF01008DF038 /* WebBackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607D020F50ED0ECA1767 /* WebBackForwardList.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810120824BF01008DF038 /* WebHistory.h in Headers */ = {isa = PBXBuildFile; fileRef = F520FB190221DEFD01C1A525 /* WebHistory.h */; settings = {ATTRIBUTES = (Public, ); }; }; 939810130824BF01008DF038 /* WebHistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3944607F020F50ED0ECA1767 /* WebHistoryItem.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -329,6 +331,8 @@ ABDDF20D08EB0DDC001E1241 /* WebDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */; }; B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */; }; B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */ = {isa = PBXBuildFile; fileRef = B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; + B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = B804176D1217A83100466BAE /* WebInspectorFrontend.h */; }; + B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */ = {isa = PBXBuildFile; fileRef = B804176E1217A83100466BAE /* WebInspectorFrontend.mm */; }; BC26C69E10B743F400B687ED /* WebSerializedJSValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC26C69D10B743F400B687ED /* WebSerializedJSValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC26C6A410B7447A00B687ED /* WebSerializedJSValue.mm */; }; BC2E464D0FD8A96800A9D9DE /* WebViewData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E464B0FD8A96800A9D9DE /* WebViewData.h */; }; @@ -596,6 +600,8 @@ 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceInternal.h; sourceTree = "<group>"; }; 936A2DE70FD2D08000D312DB /* WebTextCompletionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebTextCompletionController.mm; sourceTree = "<group>"; }; 936A2DE90FD2D08400D312DB /* WebTextCompletionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTextCompletionController.h; sourceTree = "<group>"; }; + 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; }; + 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; }; 939811320824BF01008DF038 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = SOURCE_ROOT; tabWidth = 8; usesTabs = 1; }; 939811330824BF01008DF038 /* WebKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 93AEB17D032C1735008635CE /* WebKitLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKitLogging.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -625,6 +631,8 @@ ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebDownloadInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebApplicationCache.h; sourceTree = "<group>"; }; B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebApplicationCache.mm; sourceTree = "<group>"; }; + B804176D1217A83100466BAE /* WebInspectorFrontend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebInspectorFrontend.h; sourceTree = "<group>"; }; + B804176E1217A83100466BAE /* WebInspectorFrontend.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorFrontend.mm; sourceTree = "<group>"; }; BC26C69D10B743F400B687ED /* WebSerializedJSValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedJSValue.h; sourceTree = "<group>"; }; BC26C6A410B7447A00B687ED /* WebSerializedJSValue.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSerializedJSValue.mm; sourceTree = "<group>"; }; BC2E464B0FD8A96800A9D9DE /* WebViewData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebViewData.h; sourceTree = "<group>"; }; @@ -871,6 +879,8 @@ 5D7BF8120C2A1D90008CE06D /* WebInspector.h */, 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */, 7A8FF0D01075024A00A80A08 /* WebInspectorPrivate.h */, + B804176D1217A83100466BAE /* WebInspectorFrontend.h */, + B804176E1217A83100466BAE /* WebInspectorFrontend.mm */, 1C68F663095B5FC100C2984E /* WebNodeHighlight.h */, 1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */, 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */, @@ -1254,6 +1264,8 @@ 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */, 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */, 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */, + 9391F273121B38BD00EBF7E8 /* WebFrameNetworkingContext.h */, + 9391F274121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm */, BC7F884910C8775A00D6133D /* WebGeolocationControllerClient.h */, BC7F884A10C8775A00D6133D /* WebGeolocationControllerClient.mm */, 51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */, @@ -1575,6 +1587,8 @@ A5DEFC0F11D5343E00885273 /* WebDatabaseQuotaManager.h in Headers */, A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */, A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */, + B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */, + 9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1616,7 +1630,6 @@ isa = PBXProject; buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, @@ -1937,6 +1950,8 @@ A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */, A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.mm in Sources */, A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */, + B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */, + 9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index ec1390e..d5cadad 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -163,7 +163,7 @@ Page* ChromeClientAndroid::createWindow(Frame* frame, const FrameLoadRequest&, if (features.fullscreen) dialog = false; WebCore::Frame* newFrame = m_webFrame->createWindow(dialog, - frame->script()->processingUserGesture(mainThreadNormalWorld())); + ScriptController::processingUserGesture()); if (newFrame) { WebCore::Page* page = newFrame->page(); page->setGroupName(frame->page()->groupName()); diff --git a/WebKit/android/WebCoreSupport/GeolocationPermissions.h b/WebKit/android/WebCoreSupport/GeolocationPermissions.h index 9a1966a..f40619b 100644 --- a/WebKit/android/WebCoreSupport/GeolocationPermissions.h +++ b/WebKit/android/WebCoreSupport/GeolocationPermissions.h @@ -27,14 +27,13 @@ #define GeolocationPermissions_h #include "PlatformString.h" -// We must include this before before HashMap.h, as it provides specalizations -// for String hash types instantiated there. -#include "StringHash.h" #include "Timer.h" + #include <wtf/HashMap.h> #include <wtf/HashSet.h> #include <wtf/RefCounted.h> #include <wtf/Vector.h> +#include <wtf/text/StringHash.h> namespace WebCore { class Frame; diff --git a/WebKit/android/WebCoreSupport/V8Counters.cpp b/WebKit/android/WebCoreSupport/V8Counters.cpp index 7472447..4e7351d 100644 --- a/WebKit/android/WebCoreSupport/V8Counters.cpp +++ b/WebKit/android/WebCoreSupport/V8Counters.cpp @@ -33,9 +33,9 @@ #include "V8Counters.h" #include "NotImplemented.h" -#include <StringHash.h> #include <utils/Log.h> #include <wtf/text/CString.h> +#include <wtf/text/StringHash.h> namespace WebCore { diff --git a/WebKit/android/benchmark/Intercept.cpp b/WebKit/android/benchmark/Intercept.cpp index e5a98f1..1ae6d6f 100644 --- a/WebKit/android/benchmark/Intercept.cpp +++ b/WebKit/android/benchmark/Intercept.cpp @@ -33,11 +33,12 @@ #include "ResourceHandleClient.h" #include "ResourceRequest.h" #include "ResourceResponse.h" -#include "StringHash.h" #include "TextEncoding.h" + #include <utils/Log.h> #include <wtf/HashMap.h> #include <wtf/text/CString.h> +#include <wtf/text/StringHash.h> PassRefPtr<WebCore::ResourceLoaderAndroid> MyResourceLoader::create( ResourceHandle* handle, String url) diff --git a/WebKit/android/jni/JavaBridge.cpp b/WebKit/android/jni/JavaBridge.cpp index 8e85896..5715ae5 100644 --- a/WebKit/android/jni/JavaBridge.cpp +++ b/WebKit/android/jni/JavaBridge.cpp @@ -27,7 +27,6 @@ #include "config.h" -#include "AtomicString.h" #include "Cache.h" #include "Connection.h" #include "CookieClient.h" @@ -54,6 +53,7 @@ #include <utils/misc.h> #include <wtf/Platform.h> #include <wtf/StdLibExtras.h> +#include <wtf/text/AtomicString.h> namespace android { diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index a868260..52f1551 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -29,7 +29,6 @@ #include "WebCoreFrameBridge.h" #include "Arena.h" -#include "AtomicString.h" #include "BackForwardList.h" #include "Cache.h" #include "Chrome.h" @@ -97,6 +96,7 @@ #include <utils/AssetManager.h> #include <wtf/CurrentTime.h> #include <wtf/Platform.h> +#include <wtf/text/AtomicString.h> #include <wtf/text/CString.h> #if USE(JSC) diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 72b4eac..3b4872f 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -28,7 +28,6 @@ #include "config.h" #include "WebViewCore.h" -#include "AtomicString.h" #include "BaseLayerAndroid.h" #include "CachedNode.h" #include "CachedRoot.h" @@ -101,7 +100,6 @@ #include "SkCanvas.h" #include "SkPicture.h" #include "SkUtils.h" -#include "StringImpl.h" #include "Text.h" #include "TypingCommand.h" #include "WebCoreFrameBridge.h" @@ -113,6 +111,8 @@ #include <JNIUtility.h> #include <ui/KeycodeLabels.h> #include <wtf/CurrentTime.h> +#include <wtf/text/AtomicString.h> +#include <wtf/text/StringImpl.h> #if USE(V8) #include "ScriptController.h" diff --git a/WebKit/android/nav/CachedNode.h b/WebKit/android/nav/CachedNode.h index 0014e07..db48a66 100644 --- a/WebKit/android/nav/CachedNode.h +++ b/WebKit/android/nav/CachedNode.h @@ -26,12 +26,13 @@ #ifndef CachedNode_H #define CachedNode_H -#include "AtomicString.h" #include "CachedDebug.h" #include "CachedNodeType.h" #include "IntRect.h" #include "PlatformString.h" -#include "wtf/Vector.h" + +#include <wtf/Vector.h> +#include <wtf/text/AtomicString.h> class SkPicture; diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 2132957..a15ef39 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -29,7 +29,6 @@ #include "AndroidAnimation.h" #include "AndroidLog.h" -#include "AtomicString.h" #include "BaseLayerAndroid.h" #include "CachedFrame.h" #include "CachedNode.h" @@ -68,6 +67,7 @@ #include <JNIHelp.h> #include <jni.h> #include <ui/KeycodeLabels.h> +#include <wtf/text/AtomicString.h> #include <wtf/text/CString.h> namespace android { diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 1486694..0a07733 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,651 @@ +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js with generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebKit.gyp: + +2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65238. + http://trac.webkit.org/changeset/65238 + https://bugs.webkit.org/show_bug.cgi?id=44168 + + Check if clobbering chromium bot fixes the layout test + failures (Requested by hamaji on #webkit). + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::frameDetached): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::detachedFromParent3): + +2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65595. + http://trac.webkit.org/changeset/65595 + https://bugs.webkit.org/show_bug.cgi?id=44161 + + qt build failed (Requested by loislo on #webkit). + + * WebKit.gyp: + +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebKit.gyp: + +2010-08-17 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium DevTools: Support runtime property name/value pairs + instead of feature names as navigation state. + https://bugs.webkit.org/show_bug.cgi?id=44054 + + * public/WebDevToolsAgent.h: + * public/WebDevToolsAgentClient.h: + (WebKit::WebDevToolsAgentClient::runtimePropertyChanged): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setRuntimeProperty): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + * src/WebDevToolsAgentImpl.h: + +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebKit.gyp: Added new files. + * src/FrameNetworkingContextImpl.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + +2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65516. + http://trac.webkit.org/changeset/65516 + https://bugs.webkit.org/show_bug.cgi?id=44126 + + broke chromium unit tests on mac and linux (Requested by + johnny_g on #webkit). + + * WebKit.gyp: + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Removed. + +2010-08-17 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Made WebFrame not report the text from hidden frames. + (some pages contain hidden frames with garbage text that + should not be indexed or used to detect the page's language). + https://bugs.webkit.org/show_bug.cgi?id=39456 + + * WebKit.gyp: + * public/WebCString.h: + (WebKit::operator<): + * public/WebURL.h: + (WebKit::operator<): + * src/WebCString.cpp: + (WebKit::WebCString::compare): + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Added. + +2010-08-17 Kelly Norton <knorton@google.com> + + Reviewed by Pavel Feldman. + + Web Inspector: Fixes a crash in addTimelineRecord when InspectorTimelineAgent + is enabled through WebDevToolsAgentImpl::setApuEnabled. + https://bugs.webkit.org/show_bug.cgi?id=44105 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + +2010-08-17 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: upstream Chromium debugger step tests + https://bugs.webkit.org/show_bug.cgi?id=44106 + + * src/js/Tests.js: + +2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65500. + http://trac.webkit.org/changeset/65500 + https://bugs.webkit.org/show_bug.cgi?id=44108 + + Qt bots failed to compile. (Requested by loislo on #webkit). + + * WebKit.gyp: + +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebKit.gyp: + +2010-08-17 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: upstream Chromium console tests and remove a couple + of tests that have already been covered with layout tests. + https://bugs.webkit.org/show_bug.cgi?id=44057 + + * src/js/Tests.js: + (.TestSuite.prototype.testConsoleEval): + (.TestSuite.prototype.testConsoleLog): + (.TestSuite.prototype.testEvalGlobal): + +2010-08-16 Kinuko Yasuda <kinuko@chromium.org> + + Unreviewed; attempt to fix Chromium Windows build. + + * public/WebFileUtilities.h: + +2010-08-16 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Jian Li. + + [chromium] Prepare to rename WebFileSystem interface to WebFileUtilities + https://bugs.webkit.org/show_bug.cgi?id=44077 + + We are going to have an implementation for HTML5 FileSystem API and + it would probably be less confusing to use the name "WebFileSystem" + for an WebKit API for the HTML5 API. + + This patch adds WebFileUtilities interface that is meant to replace + the existing WebFileSystem. + + * WebKit.gyp: + * public/WebFileSystem.h: + * public/WebFileUtilities.h: Added. + * public/WebKitClient.h: + (WebKit::WebKitClient::fileUtilities): Added. + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::fileExists): + (WebCore::ChromiumBridge::deleteFile): + (WebCore::ChromiumBridge::deleteEmptyDirectory): + (WebCore::ChromiumBridge::getFileSize): + (WebCore::ChromiumBridge::getFileModificationTime): + (WebCore::ChromiumBridge::directoryName): + (WebCore::ChromiumBridge::pathByAppendingComponent): + (WebCore::ChromiumBridge::makeAllDirectories): + (WebCore::ChromiumBridge::getAbsolutePath): + (WebCore::ChromiumBridge::isDirectory): + (WebCore::ChromiumBridge::filePathToURL): + (WebCore::ChromiumBridge::openFile): + (WebCore::ChromiumBridge::closeFile): + (WebCore::ChromiumBridge::seekFile): + (WebCore::ChromiumBridge::truncateFile): + (WebCore::ChromiumBridge::readFromFile): + (WebCore::ChromiumBridge::writeToFile): + +2010-08-16 Nate Chapin <japhet@chromium.org> + + Unreviewed, build fix. + + Don't include TilingDataTest.cpp, since it doesn't + compile on mac. + + * WebKit.gyp: + +2010-08-16 James Robinson <jamesr@chromium.org> + + Compile fix. Fix up paintsIntoCanvasBuffer impl. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer): + +2010-08-16 Vincent Scheib <scheib@chromium.org> + + Reviewed by Dimitri Glazkov. + + Canvas2D does not support images larger than system's GPU max texture size + https://bugs.webkit.org/show_bug.cgi?id=43864 + + Unit tests for TilingData class. + + * WebKit.gyp: + * tests/TilingDataTest.cpp: Added. + (WebCore::TEST): + +2010-08-16 Alex Milowski <alex@milowski.com> + + Reviewed by David Levin. + + Added the ENABLE_MATHML=1 to the feature_defines. + + * features.gypi: + +2010-08-16 Marcus Bulach <bulach@chromium.org> + + Reviewed by Jeremy Orlow. + + Implements IDBKeyPath extractor. + https://bugs.webkit.org/show_bug.cgi?id=43276 + + Unit-test IDBKeyPathExtractorTest.cpp. + LayoutTests will arrive as IndexedDB infrastructure is fleshed out. + + + * WebKit.gyp: + * public/WebIDBKey.h: + * public/WebIDBKeyPath.h: Added. + (WebKit::WebIDBKeyPath::WebIDBKeyPath): + (WebKit::WebIDBKeyPath::~WebIDBKeyPath): + * public/WebPrivateOwnPtr.h: Added. + (WebKit::WebPrivateOwnPtr::WebPrivateOwnPtr): + (WebKit::WebPrivateOwnPtr::~WebPrivateOwnPtr): + (WebKit::WebPrivateOwnPtr::reset): + (WebKit::WebPrivateOwnPtr::get): + (WebKit::WebPrivateOwnPtr::operator->): + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + * src/WebIDBKeyPath.cpp: Added. + (WebKit::WebIDBKeyPath::create): + (WebKit::WebIDBKeyPath::WebIDBKeyPath): + (WebKit::WebIDBKeyPath::parseError): + (WebKit::WebIDBKeyPath::assign): + (WebKit::WebIDBKeyPath::reset): + (WebKit::WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&): + * tests/IDBBindingUtilitiesTest.cpp: Added. + (WebCore::LocalContext::LocalContext): + (WebCore::LocalContext::~LocalContext): + (WebCore::checkKeyFromValueAndKeyPathInternal): + (WebCore::checkKeyPathNullValue): + (WebCore::checkKeyPathStringValue): + (WebCore::checkKeyPathNumberValue): + (WebCore::TEST): + +2010-07-28 Marcus Bulach <bulach@chromium.org> + + Reviewed by Adam Barth. + + Implement IDBKeyPath parser. + https://bugs.webkit.org/show_bug.cgi?id=42976 + + IDBKeyPath is an internal class, exposed only for unit tests for now. + It'll allow indexed database implementation to traverse a given key path and obtain the corresponding properties + from a SerializedScriptValue. + + * WebKit.gyp: + * tests/IDBKeyPathTest.cpp: Added. + (WebCore::ExpectedToken::ExpectedToken): + (WebCore::checkKeyPath): + (WebCore::TEST): + +2010-08-16 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Joseph Pecoraro. + + Web Inspector: upstream frontend-side WebSocket transport. + https://bugs.webkit.org/show_bug.cgi?id=43970 + + Chromium already has an alternate WebSocket-based communication channel with + the backend. Upstreaming it in this change. We will agree on the URI + of the remote service as the protocol matures. + + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend): + * src/js/DevTools.js: + (WebInspector.loaded): + (devtools.domContentLoaded): + +2010-08-16 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: remove utility context related code from debugger agent + https://bugs.webkit.org/show_bug.cgi?id=44049 + + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::onV8DebugMessage): + (WebKit::DebuggerAgentManager::pauseScript): + * src/DebuggerAgentManager.h: + +2010-08-16 Yuta Kitamura <yutak@chromium.org> + + Reviewed by Shinichiro Hamaji. + + Attempt to fix Chromium's test_shell_tests. + + Port Chromium's WebEntities to HTMLEntityTable + https://bugs.webkit.org/show_bug.cgi?id=44036 + + * src/WebEntities.cpp: + (WebKit::): + +2010-08-15 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Port Chromium's WebEntities to HTMLEntityTable + https://bugs.webkit.org/show_bug.cgi?id=44036 + + This code is wrong and needs to be removed. However, at least after + this patch, it will compile. + + * src/WebEntities.cpp: + (WebKit::): + (WebKit::WebEntities::WebEntities): + * src/WebEntities.h: + +2010-08-13 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Support for multiple speech enabled elements in same page. + https://bugs.webkit.org/show_bug.cgi?id=43922 + + * public/WebSpeechInputController.h: Bubbles up the requestId given by webcore to the embedder. + (WebKit::WebSpeechInputController::startRecognition): + (WebKit::WebSpeechInputController::cancelRecognition): + (WebKit::WebSpeechInputController::stopRecording): + * public/WebSpeechInputListener.h: Passes down the requestId given by embedder to webcore. + (WebKit::WebSpeechInputListener::didCompleteRecording): + (WebKit::WebSpeechInputListener::setRecognitionResult): + (WebKit::WebSpeechInputListener::didCompleteRecognition): + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::setListener): + (WebKit::SpeechInputClientImpl::startRecognition): + (WebKit::SpeechInputClientImpl::stopRecording): + (WebKit::SpeechInputClientImpl::cancelRecognition): + (WebKit::SpeechInputClientImpl::didCompleteRecording): + (WebKit::SpeechInputClientImpl::didCompleteRecognition): + (WebKit::SpeechInputClientImpl::setRecognitionResult): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl): + (WebKit::WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl): + (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecording): + (WebKit::WebSpeechInputControllerMockImpl::didCompleteRecognition): + (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + (WebKit::WebSpeechInputControllerMockImpl::cancelRecognition): + (WebKit::WebSpeechInputControllerMockImpl::stopRecording): + * src/WebSpeechInputControllerMockImpl.h: + +2010-08-12 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: allow interrupting long running JS to execute inspector command + https://bugs.webkit.org/show_bug.cgi?id=43900 + + * public/WebDevToolsAgent.h: + (WebKit::WebDevToolsAgent::MessageDescriptor::~MessageDescriptor): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgent::interruptAndDispatch): + (WebKit::WebDevToolsAgent::shouldInterruptForMessage): + (WebKit::WebDevToolsAgent::processPendingMessages): + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl): + * src/WebDevToolsFrontendImpl.h: + * src/js/DevTools.js: + +2010-08-12 Aaron Boodman <aa@chromium.org> + + Reviewed by David Hyatt. + + Make the cascade level of "user" styles configurable + https://bugs.webkit.org/show_bug.cgi?id=43457 + + * src/WebViewImpl.cpp: + (WebKit::WebView::addUserStyleSheet): + +2010-08-12 John Gregg <johnnyg@google.com> + + Reviewed by Kent Tamura. + + [chromium] Add Notification::detachPresenter to the WebKit API. + https://bugs.webkit.org/show_bug.cgi?id=43659 + + * public/WebNotification.h: + * src/WebNotification.cpp: + (WebKit::WebNotification::detachPresenter): + +2010-08-11 Stephen White <senorblanco@chromium.org> + + Reviewed by David Levin. + + Add support for BGRA pixel format to GraphicsContext3D. + https://bugs.webkit.org/show_bug.cgi?id=43858 + + Although this has been standard in desktop GL since 1.2, it's an + extension in GL ES 2.0, so a query function is provided to check + for support. The DefaultImpl returns false, since it does not yet + implement the TexImage2D internalFormat quirks. + + * public/WebGraphicsContext3D.h: + (WebKit::WebGraphicsContext3D::supportsBGRA): + * src/GraphicsContext3D.cpp: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65181. + http://trac.webkit.org/changeset/65181 + https://bugs.webkit.org/show_bug.cgi?id=43909 + + It broke 35 layout tests fail on chromium-win (Requested by + hamaji on #webkit). + + * public/WebFrameClient.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::detachedFromParent3): + +2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65221. + http://trac.webkit.org/changeset/65221 + https://bugs.webkit.org/show_bug.cgi?id=43896 + + Broke snow leopard build. (Requested by dave_levin on + #webkit). + + * public/WebGraphicsContext3D.h: + * src/GraphicsContext3D.cpp: + * src/WebGraphicsContext3DDefaultImpl.cpp: + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-08-11 Stephen White <senorblanco@chromium.org> + + Reviewed by David Levin. + + Add support for BGRA pixel format to GraphicsContext3D. + https://bugs.webkit.org/show_bug.cgi?id=43858 + + Although this has been standard in desktop GL since 1.2, it's an + extension in GL ES 2.0, so a query function is provided to check + for support. The DefaultImpl returns false, since it does not yet + implement the TexImage2D internalFormat quirks. + + * public/WebGraphicsContext3D.h: + (WebKit::WebGraphicsContext3D::supportsBGRA): + * src/GraphicsContext3D.cpp: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-08-11 James Hawkins <jhawkins@chromium.org> + + Reviewed by Dmitry Titov. + + [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-11 Dimitri Glazkov <dglazkov@chromium.org> + + Build fix, turn off yet-unbaked DEVICE_ORIENTATION stuff. + + * features.gypi: Turned it off. + +2010-08-11 Evan Stade <estade@chromium.org> + + Reviewed by David Levin. + + [chromium] linux chromium sends double clicks too often + https://bugs.webkit.org/show_bug.cgi?id=43096 + + * WebKit.gyp: add the test + * src/gtk/WebInputEventFactory.cpp: + (WebKit::WebInputEventFactory::mouseEvent): check the x/y coordinates of the + potential double click event + * tests/WebInputEventFactoryTestGtk.cpp: Added. + +2010-08-11 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Inform a plugin about the zoom level when it's created + https://bugs.webkit.org/show_bug.cgi?id=42268 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::createPlugin): + +2010-08-11 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix Chromium compilation. + + * DEPS: + +2010-08-11 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Chromium build fix. + + * DEPS: bump up Chromium revision. + +2010-08-11 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: remove InjectDispatch.js + https://bugs.webkit.org/show_bug.cgi?id=43835 + + * WebKit.grd: + * src/js/InjectDispatch.js: Removed. + +2010-08-10 Kent Tamura <tkent@chromium.org> + + Unreviewed, build fix. + + Chromium build fix for r65107. + + * src/WebAnimationControllerImpl.cpp: + (WebKit::WebAnimationControllerImpl::suspendAnimations): + (WebKit::WebAnimationControllerImpl::resumeAnimations): + +2010-08-10 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Roll forward Chromium DEPS to r55584 + https://bugs.webkit.org/show_bug.cgi?id=43811 + + * DEPS: + +2010-08-10 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Joseph Pecoraro. + + Web Inspector: Support appcache status change for Chrome + https://bugs.webkit.org/show_bug.cgi?id=43531 + + * src/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::notifyDOMApplicationCache): + +2010-08-10 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Use Chromium OpenGL bindings rather than GLEW in WebGraphicsContextDefaultImpl + https://bugs.webkit.org/show_bug.cgi?id=43754 + + Deleted per-platform OpenGL context management code, now + abstracted via GLContext. Built and tested in Chromium with + --in-process-webgl flag. + + * WebKit.gyp: + * src/GraphicsContext3D.cpp: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): + (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl): + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::validateAttributes): + (WebKit::WebGraphicsContext3DDefaultImpl::makeContextCurrent): + (WebKit::WebGraphicsContext3DDefaultImpl::reshape): + (WebKit::WebGraphicsContext3DDefaultImpl::readBackFramebuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::copyTexImage2D): + (WebKit::WebGraphicsContext3DDefaultImpl::copyTexSubImage2D): + (WebKit::WebGraphicsContext3DDefaultImpl::readPixels): + (WebKit::WebGraphicsContext3DDefaultImpl::createBuffer): + (WebKit::WebGraphicsContext3DDefaultImpl::deleteBuffer): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-08-10 Jian Li <jianli@chromium.org> + + Another chromium build fix. + + * src/AssertMatchingEnums.cpp: + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + + Bug 43786 - Move AtomicStringHash from WebCore to WTF + Also remove deprecated string headers from WebCore/platform/text. + + * src/WebKit.cpp: + * src/WebPageSerializerImpl.h: + * src/WebString.cpp: + +2010-08-10 James Robinson <jamesr@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Feature defines are out of sync between features.gypi and downstream feature_overrides.gypi + https://bugs.webkit.org/show_bug.cgi?id=43756 + + This synchronizes the feature defines to what's currently downstream (at r55468). + The difference between the build.webkit.org bots and the chromium bots has + caused strange compilation failures lately. + + * features.gypi: + 2010-08-10 Yury Semikhatsky <yurys@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index d7afc77..b517e28 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': '54723', + 'chromium_rev': '55695', } deps = { diff --git a/WebKit/chromium/WebKit.grd b/WebKit/chromium/WebKit.grd index 1f80034..92ee008 100644 --- a/WebKit/chromium/WebKit.grd +++ b/WebKit/chromium/WebKit.grd @@ -10,7 +10,6 @@ <release seq="1"> <includes> <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="src\js\DebuggerScript.js" type="BINDATA"/> - <include name="IDR_DEVTOOLS_INJECT_DISPATCH_JS" file="src\js\InjectDispatch.js" type="BINDATA"/> <include name="IDR_DEVTOOLS_INJECT_WEBKIT_JS" file="..\..\WebCore\inspector\front-end\InjectedScript.js" type="BINDATA"/> </includes> </release> diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index eb5abbe..d12bee7 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -87,6 +87,7 @@ 'msvs_guid': '5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65', 'dependencies': [ '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', + '<(chromium_src_dir)/app/app.gyp:app_base', # For GLContext '<(chromium_src_dir)/skia/skia.gyp:skia', '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', ], @@ -157,6 +158,7 @@ 'public/WebFileChooserParams.h', 'public/WebFileInfo.h', 'public/WebFileSystem.h', + 'public/WebFileUtilities.h', 'public/WebFindOptions.h', 'public/WebFloatPoint.h', 'public/WebFloatRect.h', @@ -185,6 +187,7 @@ 'public/WebIDBKeyRange.h', 'public/WebIDBIndex.h', 'public/WebIDBKey.h', + 'public/WebIDBKeyPath.h', 'public/WebIDBObjectStore.h', 'public/WebInputElement.h', 'public/WebInputEvent.h', @@ -224,6 +227,7 @@ 'public/WebPopupMenuInfo.h', 'public/WebPopupType.h', 'public/WebPrivatePtr.h', + 'public/WebPrivateOwnPtr.h', 'public/WebRange.h', 'public/WebRect.h', 'public/WebRegularExpression.h', @@ -314,9 +318,11 @@ 'src/EventListenerWrapper.h', 'src/FrameLoaderClientImpl.cpp', 'src/FrameLoaderClientImpl.h', + 'src/FrameNetworkingContextImpl.h', 'src/GLES2Context.cpp', 'src/GLES2ContextInternal.cpp', 'src/GLES2ContextInternal.h', + 'src/GraphicsContext3D.cpp', 'src/gtk/WebFontInfo.cpp', 'src/gtk/WebFontInfo.h', 'src/gtk/WebInputEventFactory.cpp', @@ -428,6 +434,7 @@ 'src/WebIDBIndexImpl.cpp', 'src/WebIDBIndexImpl.h', 'src/WebIDBKey.cpp', + 'src/WebIDBKeyPath.cpp', 'src/WebIDBKeyRange.cpp', 'src/WebIDBObjectStoreImpl.cpp', 'src/WebIDBObjectStoreImpl.h', @@ -592,18 +599,6 @@ 'sources/': [['exclude', '/win/']], }], ['"ENABLE_3D_CANVAS=1" in feature_defines', { - # Conditionally compile in GLEW and our GraphicsContext3D implementation. - 'sources+': [ - 'src/GraphicsContext3D.cpp', - '<(chromium_src_dir)/third_party/glew/src/glew.c' - ], - 'include_dirs+': [ - '<(chromium_src_dir)/third_party/glew/include' - ], - 'defines+': [ - 'GLEW_STATIC=1', - 'GLEW_NO_GLU=1', - ], 'conditions': [ ['OS=="mac"', { 'link_settings': { @@ -620,7 +615,10 @@ { 'target_name': 'inspector_resources', 'type': 'none', - 'dependencies': ['devtools_html'], + 'dependencies': [ + 'devtools_html', + '../../WebCore/WebCore.gyp/WebCore.gyp:inspector_protocol_sources', + ], 'conditions': [ ['debug_devtools==0', { 'dependencies': ['concatenated_devtools_js'], @@ -632,6 +630,7 @@ 'files': [ '<@(devtools_files)', '<@(webinspector_files)', + '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js', ], 'conditions': [ ['debug_devtools==0', { @@ -678,10 +677,12 @@ '<@(_input_page)', '<@(webinspector_files)', '<@(devtools_files)', + '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js', ], 'search_path': [ '../../WebCore/inspector/front-end', 'src/js', + '<(SHARED_INTERMEDIATE_DIR)/webcore', '<(chromium_src_dir)/v8/tools', ], 'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], @@ -713,9 +714,13 @@ ], 'sources': [ 'tests/DragImageTest.cpp', + 'tests/IDBBindingUtilitiesTest.cpp', + 'tests/IDBKeyPathTest.cpp', 'tests/KeyboardTest.cpp', 'tests/KURLTest.cpp', 'tests/RunAllTests.cpp', + # FIXME: This test is compile failing on mac. + # 'tests/TilingDataTest.cpp', ], 'conditions': [ ['OS=="win"', { @@ -732,6 +737,14 @@ 'tests/DragImageTest.cpp', ], }], + ['OS=="linux"', { + 'sources': [ + 'tests/WebInputEventFactoryTestGtk.cpp', + ], + 'include_dirs': [ + 'public/gtk', + ], + }], ], }], ], diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 9b758f9..e3092b3 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -38,27 +38,28 @@ # WARNING: build/features_override.gypi which is included in a full # chromium build, overrides this list with its own values. See # features_override.gypi inline documentation for more details. - 'feature_defines%': [ + 'feature_defines': [ 'ENABLE_3D_CANVAS=1', 'ENABLE_BLOB=1', + 'ENABLE_BLOB_SLICE=1', 'ENABLE_CHANNEL_MESSAGING=1', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', - 'ENABLE_DEVICE_ORIENTATION=1', + 'ENABLE_DEVICE_ORIENTATION=0', 'ENABLE_DIRECTORY_UPLOAD=1', 'ENABLE_DOM_STORAGE=1', 'ENABLE_EVENTSOURCE=1', - 'ENABLE_FILE_WRITER=1', - 'ENABLE_FILE_SYSTEM=1', + 'ENABLE_FILE_READER=1', 'ENABLE_FILTERS=1', 'ENABLE_GEOLOCATION=1', 'ENABLE_ICONDATABASE=0', - 'ENABLE_IMAGE_RESIZER=0', 'ENABLE_INDEXED_DATABASE=1', 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_LINK_PREFETCH=1', + 'ENABLE_MATHML=0', 'ENABLE_METER_TAG=1', 'ENABLE_NOTIFICATIONS=1', 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', @@ -75,16 +76,24 @@ 'ENABLE_SVG_FOREIGN_OBJECT=1', 'ENABLE_SVG_USE=1', 'ENABLE_TOUCH_EVENTS=1', + 'ENABLE_V8_SCRIPT_DEBUG_SERVER=1', 'ENABLE_VIDEO=1', 'ENABLE_WEB_SOCKETS=1', 'ENABLE_WEB_TIMING=1', 'ENABLE_WORKERS=1', - 'ENABLE_XHTMLMP=0', 'ENABLE_XPATH=1', 'ENABLE_XSLT=1', - 'WTF_USE_ACCELERATED_COMPOSITING=0', ], - + + 'conditions': [ + ['OS=="win" or OS=="linux"', { + 'feature_defines': [ + 'WTF_USE_ACCELERATED_COMPOSITING=1', + 'ENABLE_3D_RENDERING=1', + ], + }], + ], + 'use_accelerated_compositing%': 0, 'enable_svg%': 1, }, diff --git a/WebKit/chromium/public/WebAnimationController.h b/WebKit/chromium/public/WebAnimationController.h index d727d70..0d3fcf5 100644 --- a/WebKit/chromium/public/WebAnimationController.h +++ b/WebKit/chromium/public/WebAnimationController.h @@ -51,6 +51,8 @@ public: double time) = 0; WEBKIT_API virtual unsigned numberOfActiveAnimations() const = 0; + WEBKIT_API virtual void suspendAnimations() const = 0; + WEBKIT_API virtual void resumeAnimations() const = 0; protected: ~WebAnimationController() { } }; diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index 4fd1cbd..a355a0f 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -60,6 +60,7 @@ public: virtual void inspectElementAt(const WebPoint&) = 0; virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled) = 0; + virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0; // Exposed for LayoutTestController. virtual void evaluateInWebInspector(long callId, const WebString& script) = 0; @@ -73,6 +74,17 @@ public: // Asynchronously request debugger to pause immediately. WEBKIT_API static void debuggerPauseScript(); + class MessageDescriptor { + public: + virtual ~MessageDescriptor() { } + virtual WebDevToolsAgent* agent() = 0; + virtual WebString message() = 0; + }; + // Asynchronously request debugger to pause immediately and run the command. + WEBKIT_API static void interruptAndDispatch(MessageDescriptor*); + WEBKIT_API static bool shouldInterruptForMessage(const WebString&); + WEBKIT_API static void processPendingMessages(); + 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 ec013ac..386bd08 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -51,7 +51,7 @@ public: virtual int hostIdentifier() { return -1; } // Notifies host upon runtime feature being enabled/disabled. - virtual void runtimeFeatureStateChanged(const WebString& feature, bool enabled) { } + virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { } virtual WebCString injectedScriptSource() { return WebCString(); } virtual WebCString debuggerScriptSource() { return WebCString(); } diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h index fc6e6dd..a91106e 100644 --- a/WebKit/chromium/public/WebFileSystem.h +++ b/WebKit/chromium/public/WebFileSystem.h @@ -31,41 +31,12 @@ #ifndef WebFileSystem_h #define WebFileSystem_h -#include "WebCommon.h" -#include "WebString.h" -#include "WebURL.h" +#include "WebFileUtilities.h" namespace WebKit { -class WebFileSystem { -public: -#ifdef WIN32 - typedef HANDLE FileHandle; -#else - typedef int FileHandle; -#endif - - virtual bool fileExists(const WebString& path) { return false; } - virtual bool deleteFile(const WebString& path) { return false; } - virtual bool deleteEmptyDirectory(const WebString& path) { return false; } - virtual bool getFileSize(const WebString& path, long long& result) { return false; } - virtual bool getFileModificationTime(const WebString& path, double& result) { return false; } - virtual WebString directoryName(const WebString& path) { return WebString(); } - virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } - virtual bool makeAllDirectories(const WebString& path) { return false; } - virtual WebString getAbsolutePath(const WebString& path) { return WebString(); } - virtual bool isDirectory(const WebString& path) { return false; } - virtual WebURL filePathToURL(const WebString& path) { return WebURL(); } - virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); } - // Should set the FileHandle to a invalid value if the file is closed successfully. - virtual void closeFile(FileHandle&) { } - virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; } - virtual bool truncateFile(FileHandle, long long offset) { return false; } - virtual int readFromFile(FileHandle, char* data, int length) { return 0; } - virtual int writeToFile(FileHandle, const char* data, int length) { return 0; } - -protected: - ~WebFileSystem() {} +// FIXME: Clean up this class once the renaming to WebFileUtilities is done. +class WebFileSystem : public WebFileUtilities { }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFileUtilities.h b/WebKit/chromium/public/WebFileUtilities.h new file mode 100644 index 0000000..456ba69 --- /dev/null +++ b/WebKit/chromium/public/WebFileUtilities.h @@ -0,0 +1,77 @@ +/* + * 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 WebFileUtilities_h +#define WebFileUtilities_h + +#include "WebCommon.h" +#include "WebString.h" +#include "WebURL.h" + +#ifdef WIN32 +typedef void *HANDLE; +#endif + +namespace WebKit { + +class WebFileUtilities { +public: +#ifdef WIN32 + typedef HANDLE FileHandle; +#else + typedef int FileHandle; +#endif + + virtual bool fileExists(const WebString& path) { return false; } + virtual bool deleteFile(const WebString& path) { return false; } + virtual bool deleteEmptyDirectory(const WebString& path) { return false; } + virtual bool getFileSize(const WebString& path, long long& result) { return false; } + virtual bool getFileModificationTime(const WebString& path, double& result) { return false; } + virtual WebString directoryName(const WebString& path) { return WebString(); } + virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } + virtual bool makeAllDirectories(const WebString& path) { return false; } + virtual WebString getAbsolutePath(const WebString& path) { return WebString(); } + virtual bool isDirectory(const WebString& path) { return false; } + virtual WebURL filePathToURL(const WebString& path) { return WebURL(); } + virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); } + // Should set the FileHandle to a invalid value if the file is closed successfully. + virtual void closeFile(FileHandle&) { } + virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; } + virtual bool truncateFile(FileHandle, long long offset) { return false; } + virtual int readFromFile(FileHandle, char* data, int length) { return 0; } + virtual int writeToFile(FileHandle, const char* data, int length) { return 0; } + +protected: + ~WebFileUtilities() {} +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index 2b7ee0d..91f0e38 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -90,6 +90,12 @@ public: // General notifications ----------------------------------------------- + // This frame has been detached from the view. + // + // FIXME: Do not use this in new code. Currently this is used by code in + // Chromium that errantly caches WebKit objects. + virtual void frameDetached(WebFrame*) { } + // This frame is about to be closed. virtual void willClose(WebFrame*) { } diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 4378afb..4c18076 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -129,6 +129,8 @@ public: // getError in the order they were added. virtual void synthesizeGLError(unsigned long error) = 0; + virtual bool supportsBGRA() = 0; + // The entry points below map directly to the OpenGL ES 2.0 API. // See: http://www.khronos.org/registry/gles/ // and: http://www.khronos.org/opengles/sdk/docs/man/ diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 1cf336d..32caa10 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -34,12 +34,16 @@ namespace WebCore { class IDBKey; } namespace WebKit { +class WebIDBKeyPath; +class WebSerializedScriptValue; + class WebIDBKey { public: ~WebIDBKey() { reset(); } WEBKIT_API static WebIDBKey createNull(); WEBKIT_API static WebIDBKey createInvalid(); + WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScriptValue&, const WebIDBKeyPath&); WebIDBKey(const WebString& string) { assign(string); } WebIDBKey(int32_t number) { assign(number); } diff --git a/WebKit/chromium/public/WebIDBKeyPath.h b/WebKit/chromium/public/WebIDBKeyPath.h new file mode 100644 index 0000000..d08ec63 --- /dev/null +++ b/WebKit/chromium/public/WebIDBKeyPath.h @@ -0,0 +1,68 @@ +/* + * 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 WebIDBKeyPath_h +#define WebIDBKeyPath_h + +#include "WebCommon.h" +#include "WebPrivateOwnPtr.h" +#include "WebVector.h" + +namespace WebCore { struct IDBKeyPathElement; } + +namespace WTF { template<typename T, size_t inlineCapacity> class Vector; } + +namespace WebKit { + +class WebString; + +class WebIDBKeyPath { +public: + static WebIDBKeyPath create(const WebString&); + WebIDBKeyPath(const WebIDBKeyPath& keyPath) { assign(keyPath); } + ~WebIDBKeyPath() { reset(); } + + WEBKIT_API int parseError() const; + WEBKIT_API void assign(const WebIDBKeyPath&); + WEBKIT_API void reset(); + +#if WEBKIT_IMPLEMENTATION + operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>& () const; +#endif + +private: + WebIDBKeyPath(); + +#if WEBKIT_IMPLEMENTATION + WebIDBKeyPath(const WTF::Vector<WebCore::IDBKeyPathElement, 0>&, int parseError); +#endif + + WebPrivateOwnPtr<WTF::Vector<WebCore::IDBKeyPathElement, 0> > m_private; + int m_parseError; +}; + +} // namespace WebKit + +#endif // WebIDBKeyPath_h diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index 5959a1c..4104175 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -33,6 +33,7 @@ #include "WebCommon.h" #include "WebData.h" +#include "WebFileSystem.h" #include "WebLocalizedString.h" #include "WebString.h" #include "WebURL.h" @@ -49,7 +50,7 @@ class WebApplicationCacheHost; class WebApplicationCacheHostClient; class WebClipboard; class WebCookieJar; -class WebFileSystem; +class WebFileUtilities; class WebGLES2Context; class WebGraphicsContext3D; class WebIDBFactory; @@ -72,8 +73,13 @@ public: virtual WebMimeRegistry* mimeRegistry() { return 0; } // Must return non-null. + // FIXME: Clean up this one once the renaming to WebFileUtilities is done. virtual WebFileSystem* fileSystem() { return 0; } + // Must return non-null. + // FIXME: Clean up this one once the renaming from WebFileSystem is done. + virtual WebFileUtilities* fileUtilities() { return fileSystem(); } + // May return null if sandbox support is not necessary virtual WebSandboxSupport* sandboxSupport() { return 0; } diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index f872111..89dff7a 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -83,6 +83,9 @@ public: WEBKIT_API WebString replaceId() const; + // Called if the presenter goes out of scope before the notification does. + WEBKIT_API void detachPresenter(); + // Called to indicate the notification has been displayed. WEBKIT_API void dispatchDisplayEvent(); diff --git a/WebKit/chromium/public/WebPrivateOwnPtr.h b/WebKit/chromium/public/WebPrivateOwnPtr.h new file mode 100644 index 0000000..4bcabcf --- /dev/null +++ b/WebKit/chromium/public/WebPrivateOwnPtr.h @@ -0,0 +1,75 @@ +/* + * 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 WebPrivateOwnPtr_h +#define WebPrivateOwnPtr_h + +#include "WebCommon.h" + +namespace WebKit { + +// This class is an implementation detail of the WebKit API. It exists +// to help simplify the implementation of WebKit interfaces that merely +// wrap a pointer to a WebCore class. It's similar to WebPrivatePtr, but it +// wraps a naked pointer rather than a reference counted. +// Note: you must call reset(0) on the implementation side in order to delete +// the WebCore pointer. +template <typename T> +class WebPrivateOwnPtr { +public: + WebPrivateOwnPtr() : m_ptr(0) {} + ~WebPrivateOwnPtr() { WEBKIT_ASSERT(!m_ptr); } + +#if WEBKIT_IMPLEMENTATION + explicit WebPrivateOwnPtr(T* ptr) + : m_ptr(ptr) + { + } + + void reset(T* ptr) + { + delete m_ptr; + m_ptr = ptr; + } + + T* get() const { return m_ptr; } + + T* operator->() const + { + WEBKIT_ASSERT(m_ptr); + return m_ptr; + } +#endif // WEBKIT_IMPLEMENTATION + +private: + T* m_ptr; + + WebPrivateOwnPtr(const WebPrivateOwnPtr&); + void operator=(const WebPrivateOwnPtr&); +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h index 3dba5fb..b85fde6 100644 --- a/WebKit/chromium/public/WebSpeechInputController.h +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -41,14 +41,21 @@ public: // Starts speech recognition. Speech will get recorded until the endpointer detects silence, // runs to the limit or stopRecording is called. Progress indications and the recognized // text are returned via the listener interface. + virtual bool startRecognition(int) + { + return startRecognition(); + } + // FIXME: Remove this once chromium has picked up this change. virtual bool startRecognition() { - WEBKIT_ASSERT_NOT_REACHED(); - return false; + WEBKIT_ASSERT_NOT_REACHED(); + return false; } // Cancels an ongoing recognition and discards any audio recorded so far. No partial // recognition results are returned to the listener. + virtual void cancelRecognition(int) { cancelRecognition(); } + // FIXME: Remove this once chromium has picked up this change. virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); } // Stops audio recording and performs recognition with the audio recorded until now @@ -56,6 +63,8 @@ public: // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech // recording 'endpointer' should detect silence in the input and stop recording automatically. // Call startRecognition() to record audio and recognize speech again. + virtual void stopRecording(int) { stopRecording(); } + // FIXME: Remove this once chromium has picked up this change. virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); } protected: diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h index f1756af..e779c3a 100644 --- a/WebKit/chromium/public/WebSpeechInputListener.h +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -47,19 +47,34 @@ public: // WebSpeechInputController::stopRecording() was called. // Typically after this call the listener would update the UI to reflect that recognition is // in progress. - virtual void didCompleteRecording() = 0; + virtual void didCompleteRecording(int) = 0; + // FIXME: Remove this once chromium has picked up this change. + virtual void didCompleteRecording() + { + didCompleteRecording(1); + } // Gives results from speech recognition, either partial or the final results. // This method can potentially get called multiple times if there are partial results // available as the user keeps speaking. If the speech could not be recognized properly // or if there was any other errors in the process, this method may never be called. - virtual void setRecognitionResult(const WebString&) = 0; + virtual void setRecognitionResult(int, const WebString&) = 0; + // FIXME: Remove this once chromium has picked up this change. + virtual void setRecognitionResult(const WebString& result) + { + setRecognitionResult(1, result); + } // Informs that speech recognition has completed. This gets invoked irrespective of whether // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The // handler typically frees up any temporary resources allocated and waits for the next speech // recognition request. - virtual void didCompleteRecognition() = 0; + virtual void didCompleteRecognition(int) = 0; + // FIXME: Remove this once chromium has picked up this change. + virtual void didCompleteRecognition() + { + didCompleteRecognition(1); + } protected: ~WebSpeechInputListener() { } diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp index dfd4754..3bfcfe2 100644 --- a/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -202,6 +202,15 @@ void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplic void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int done) { +#if ENABLE(INSPECTOR) + // If host's frame is main frame and inspector frontend is connected, update appcache status. + if (id != PROGRESS_EVENT && m_documentLoader->frame()) { + Page* page = m_documentLoader->frame()->page(); + if (page && page->inspectorController()->applicationCacheAgent() && page->mainFrame() == m_documentLoader->frame()) + page->inspectorController()->applicationCacheAgent()->updateApplicationCacheStatus(status()); + } +#endif + if (m_defersEvents) { // Event dispatching is deferred until document.onload has fired. m_deferredEvents.append(DeferredEvent(id, total, done)); diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index bcd7931..b93d4bb 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -45,7 +45,6 @@ #include "PasteboardPrivate.h" #include "PlatformCursor.h" #include "Settings.h" -#include "StringImpl.h" #include "TextAffinity.h" #include "UserContentTypes.h" #include "UserScriptTypes.h" @@ -65,6 +64,7 @@ #include "WebTextCaseSensitivity.h" #include "WebView.h" #include <wtf/Assertions.h> +#include <wtf/text/StringImpl.h> #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), mismatching_enums) diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index a43109c..5b18e82 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -41,7 +41,7 @@ #include "WebCursorInfo.h" #include "WebData.h" #include "WebDragData.h" -#include "WebFileSystem.h" +#include "WebFileUtilities.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" #include "WebImage.h" @@ -320,28 +320,28 @@ void ChromiumBridge::prefetchDNS(const String& hostname) bool ChromiumBridge::fileExists(const String& path) { - return webKitClient()->fileSystem()->fileExists(path); + return webKitClient()->fileUtilities()->fileExists(path); } bool ChromiumBridge::deleteFile(const String& path) { - return webKitClient()->fileSystem()->deleteFile(path); + return webKitClient()->fileUtilities()->deleteFile(path); } bool ChromiumBridge::deleteEmptyDirectory(const String& path) { - return webKitClient()->fileSystem()->deleteEmptyDirectory(path); + return webKitClient()->fileUtilities()->deleteEmptyDirectory(path); } bool ChromiumBridge::getFileSize(const String& path, long long& result) { - return webKitClient()->fileSystem()->getFileSize(path, result); + return webKitClient()->fileUtilities()->getFileSize(path, result); } bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) { double modificationTime; - if (!webKitClient()->fileSystem()->getFileModificationTime(path, modificationTime)) + if (!webKitClient()->fileUtilities()->getFileModificationTime(path, modificationTime)) return false; result = static_cast<time_t>(modificationTime); return true; @@ -349,62 +349,62 @@ bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) String ChromiumBridge::directoryName(const String& path) { - return webKitClient()->fileSystem()->directoryName(path); + return webKitClient()->fileUtilities()->directoryName(path); } String ChromiumBridge::pathByAppendingComponent(const String& path, const String& component) { - return webKitClient()->fileSystem()->pathByAppendingComponent(path, component); + return webKitClient()->fileUtilities()->pathByAppendingComponent(path, component); } bool ChromiumBridge::makeAllDirectories(const String& path) { - return webKitClient()->fileSystem()->makeAllDirectories(path); + return webKitClient()->fileUtilities()->makeAllDirectories(path); } String ChromiumBridge::getAbsolutePath(const String& path) { - return webKitClient()->fileSystem()->getAbsolutePath(path); + return webKitClient()->fileUtilities()->getAbsolutePath(path); } bool ChromiumBridge::isDirectory(const String& path) { - return webKitClient()->fileSystem()->isDirectory(path); + return webKitClient()->fileUtilities()->isDirectory(path); } KURL ChromiumBridge::filePathToURL(const String& path) { - return webKitClient()->fileSystem()->filePathToURL(path); + return webKitClient()->fileUtilities()->filePathToURL(path); } PlatformFileHandle ChromiumBridge::openFile(const String& path, FileOpenMode mode) { - return webKitClient()->fileSystem()->openFile(path, mode); + return webKitClient()->fileUtilities()->openFile(path, mode); } void ChromiumBridge::closeFile(PlatformFileHandle& handle) { - webKitClient()->fileSystem()->closeFile(handle); + webKitClient()->fileUtilities()->closeFile(handle); } long long ChromiumBridge::seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin) { - return webKitClient()->fileSystem()->seekFile(handle, offset, origin); + return webKitClient()->fileUtilities()->seekFile(handle, offset, origin); } bool ChromiumBridge::truncateFile(PlatformFileHandle handle, long long offset) { - return webKitClient()->fileSystem()->truncateFile(handle, offset); + return webKitClient()->fileUtilities()->truncateFile(handle, offset); } int ChromiumBridge::readFromFile(PlatformFileHandle handle, char* data, int length) { - return webKitClient()->fileSystem()->readFromFile(handle, data, length); + return webKitClient()->fileUtilities()->readFromFile(handle, data, length); } int ChromiumBridge::writeToFile(PlatformFileHandle handle, const char* data, int length) { - return webKitClient()->fileSystem()->writeToFile(handle, data, length); + return webKitClient()->fileUtilities()->writeToFile(handle, data, length); } // Font ----------------------------------------------------------------------- diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp index 1df7172..dfc186c 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -50,10 +50,6 @@ bool DebuggerAgentManager::s_inHostDispatchHandler = false; DebuggerAgentManager::DeferrersMap DebuggerAgentManager::s_pageDeferrers; -bool DebuggerAgentManager::s_inUtilityContext = false; - -bool DebuggerAgentManager::s_debugBreakDelayed = false; - bool DebuggerAgentManager::s_exposeV8DebuggerProtocol = false; namespace { @@ -208,28 +204,20 @@ void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message) return; } - if (s_inUtilityContext && message.GetEvent() == v8::Break) { - // This may happen when two tabs are being debugged in the same process. - // Suppose that first debugger is pauesed on an exception. It will run - // nested MessageLoop which may process Break request from the second - // debugger. - s_debugBreakDelayed = true; - } else { - // If the context is from one of the inpected tabs or injected extension - // scripts it must have hostId in the data field. - int hostId = WebCore::V8Proxy::contextDebugId(context); - if (hostId != -1) { - DebuggerAgentImpl* agent = debuggerAgentForHostId(hostId); - if (agent) { - if (agent->autoContinueOnException() - && message.GetEvent() == v8::Exception) { - sendContinueCommandToV8(); - return; - } - - agent->debuggerOutput(out); + // If the context is from one of the inpected tabs or injected extension + // scripts it must have hostId in the data field. + int hostId = WebCore::V8Proxy::contextDebugId(context); + if (hostId != -1) { + DebuggerAgentImpl* agent = debuggerAgentForHostId(hostId); + if (agent) { + if (agent->autoContinueOnException() + && message.GetEvent() == v8::Exception) { + sendContinueCommandToV8(); return; } + + agent->debuggerOutput(out); + return; } } @@ -242,10 +230,7 @@ void DebuggerAgentManager::onV8DebugMessage(const v8::Debug::Message& message) void DebuggerAgentManager::pauseScript() { - if (s_inUtilityContext) - s_debugBreakDelayed = true; - else - v8::Debug::DebugBreak(); + v8::Debug::DebugBreak(); } void DebuggerAgentManager::executeDebuggerCommand(const WTF::String& command, int callerId) diff --git a/WebKit/chromium/src/DebuggerAgentManager.h b/WebKit/chromium/src/DebuggerAgentManager.h index 300cada..66bd714 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.h +++ b/WebKit/chromium/src/DebuggerAgentManager.h @@ -80,23 +80,6 @@ public: static void onNavigate(); - class UtilityContextScope : public Noncopyable { - public: - UtilityContextScope() - { - ASSERT(!s_inUtilityContext); - s_inUtilityContext = true; - } - ~UtilityContextScope() - { - if (s_debugBreakDelayed) { - v8::Debug::DebugBreak(); - s_debugBreakDelayed = false; - } - s_inUtilityContext = false; - } - }; - private: DebuggerAgentManager(); ~DebuggerAgentManager(); @@ -118,8 +101,6 @@ private: typedef HashMap<WebViewImpl*, WebCore::PageGroupLoadDeferrer*> DeferrersMap; static DeferrersMap s_pageDeferrers; - static bool s_inUtilityContext; - static bool s_debugBreakDelayed; static bool s_exposeV8DebuggerProtocol; }; diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index b416e35..74186bf 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -37,6 +37,7 @@ #include "FormState.h" #include "FrameLoader.h" #include "FrameLoadRequest.h" +#include "FrameView.h" #include "HTTPParsers.h" #include "HistoryItem.h" #include "HitTestResult.h" @@ -49,6 +50,7 @@ #include "PlatformString.h" #include "PluginData.h" #include "PluginDataChromium.h" +#include "Settings.h" #include "StringExtras.h" #include "WebDataSourceImpl.h" #include "WebDevToolsAgentPrivate.h" @@ -246,7 +248,12 @@ void FrameLoaderClientImpl::detachedFromParent3() // go to a page and then navigate to a new page without getting any asserts // or crashes. m_webFrame->frame()->script()->proxy()->clearForClose(); - + + // Alert the client that the frame is being detached. This is the last + // chance we have to communicate with the client. + if (m_webFrame->client()) + m_webFrame->client()->frameDetached(m_webFrame); + // Stop communicating with the WebFrameClient at this point since we are no // longer associated with the Page. m_webFrame->setClient(0); @@ -1390,6 +1397,14 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( if (!webPlugin->initialize(container.get())) return 0; + if (m_webFrame->frame()->view()->zoomFactor() != 1) { + // There's a saved zoom level, so tell the plugin about it since + // WebViewImpl::setZoomLevel was called before the plugin was created. + webPlugin->setZoomFactor( + m_webFrame->frame()->view()->zoomFactor(), + m_webFrame->frame()->page()->settings()->zoomMode() == ZoomTextOnly); + } + // The element might have been removed during plugin initialization! if (!element->renderer()) return 0; diff --git a/WebKit/chromium/src/FrameNetworkingContextImpl.h b/WebKit/chromium/src/FrameNetworkingContextImpl.h new file mode 100644 index 0000000..8670506 --- /dev/null +++ b/WebKit/chromium/src/FrameNetworkingContextImpl.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 FrameNetworkingContextImpl_h +#define FrameNetworkingContextImpl_h + +#include "FrameNetworkingContext.h" + +namespace WebKit { + +class FrameNetworkingContextImpl : public WebCore::FrameNetworkingContext { +public: + static PassRefPtr<FrameNetworkingContextImpl> create(WebCore::Frame* frame) + { + return adoptRef(new FrameNetworkingContextImpl(frame)); + } + +private: + FrameNetworkingContextImpl(WebCore::Frame* frame) + : WebCore::FrameNetworkingContext(frame) + { + } +}; + +} + +#endif diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index 5b5afef..0f672a3 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -85,9 +85,6 @@ namespace WebCore { //---------------------------------------------------------------------- // GraphicsContext3DInternal -// Uncomment this to render to a separate window for debugging -// #define RENDER_TO_DEBUGGING_WINDOW - class GraphicsContext3DInternal { public: GraphicsContext3DInternal(); @@ -105,8 +102,7 @@ public: void reshape(int width, int height); void paintRenderingResultsToCanvas(CanvasRenderingContext* context); - void beginPaint(CanvasRenderingContext* context); - void endPaint(); + bool paintsIntoCanvasBuffer() const; void prepareTexture(); @@ -300,6 +296,7 @@ public: void deleteTexture(unsigned); void synthesizeGLError(unsigned long error); + bool supportsBGRA(); private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; @@ -452,17 +449,10 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon #endif } -void GraphicsContext3DInternal::beginPaint(CanvasRenderingContext* context) +bool GraphicsContext3DInternal::paintsIntoCanvasBuffer() const { // If the gpu compositor is on then skip the readback and software rendering path. - if (m_webViewImpl->isAcceleratedCompositingActive()) - return; - - paintRenderingResultsToCanvas(context); -} - -void GraphicsContext3DInternal::endPaint() -{ + return !m_webViewImpl->isAcceleratedCompositingActive(); } void GraphicsContext3DInternal::reshape(int width, int height) @@ -910,6 +900,7 @@ DELEGATE_TO_IMPL_1(deleteShader, unsigned) DELEGATE_TO_IMPL_1(deleteTexture, unsigned) DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long) +DELEGATE_TO_IMPL_R(supportsBGRA, bool) //---------------------------------------------------------------------- // GraphicsContext3D @@ -1226,8 +1217,11 @@ 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, CanvasRenderingContext*) -DELEGATE_TO_INTERNAL_1(beginPaint, CanvasRenderingContext*) -DELEGATE_TO_INTERNAL(endPaint) + +bool GraphicsContext3D::paintsIntoCanvasBuffer() const +{ + return m_internal->paintsIntoCanvasBuffer(); +} DELEGATE_TO_INTERNAL_R(createBuffer, unsigned) DELEGATE_TO_INTERNAL_R(createFramebuffer, unsigned) @@ -1244,6 +1238,7 @@ DELEGATE_TO_INTERNAL_1(deleteShader, unsigned) DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned) DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long) +DELEGATE_TO_INTERNAL_R(supportsBGRA, bool) bool GraphicsContext3D::isGLES2Compliant() const { diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp index 66525e3..9c59bae 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.cpp +++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp @@ -51,41 +51,45 @@ SpeechInputClientImpl::~SpeechInputClientImpl() { } -bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputListener* listener) +void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener) { m_listener = listener; - return m_controller->startRecognition(); } -void SpeechInputClientImpl::stopRecording() +bool SpeechInputClientImpl::startRecognition(int requestId) { ASSERT(m_listener); - m_controller->stopRecording(); + return m_controller->startRecognition(requestId); } -void SpeechInputClientImpl::cancelRecognition() +void SpeechInputClientImpl::stopRecording(int requestId) { ASSERT(m_listener); - m_controller->cancelRecognition(); + m_controller->stopRecording(requestId); } -void SpeechInputClientImpl::didCompleteRecording() +void SpeechInputClientImpl::cancelRecognition(int requestId) { ASSERT(m_listener); - m_listener->didCompleteRecording(); + m_controller->cancelRecognition(requestId); } -void SpeechInputClientImpl::didCompleteRecognition() +void SpeechInputClientImpl::didCompleteRecording(int requestId) { ASSERT(m_listener); - m_listener->didCompleteRecognition(); - m_listener = 0; + m_listener->didCompleteRecording(requestId); } -void SpeechInputClientImpl::setRecognitionResult(const WebString& result) +void SpeechInputClientImpl::didCompleteRecognition(int requestId) { ASSERT(m_listener); - m_listener->setRecognitionResult(result); + m_listener->didCompleteRecognition(requestId); +} + +void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result) +{ + ASSERT(m_listener); + m_listener->setRecognitionResult(requestId, result); } } // namespace WebKit diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h index 5762da8..0ab54c1 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.h +++ b/WebKit/chromium/src/SpeechInputClientImpl.h @@ -53,18 +53,19 @@ public: virtual ~SpeechInputClientImpl(); // SpeechInputClient methods. - bool startRecognition(WebCore::SpeechInputListener*); - void stopRecording(); - void cancelRecognition(); + void setListener(WebCore::SpeechInputListener*); + bool startRecognition(int); + void stopRecording(int); + void cancelRecognition(int); // WebSpeechInputListener methods. - void didCompleteRecording(); - void setRecognitionResult(const WebString&); - void didCompleteRecognition(); + void didCompleteRecording(int); + void setRecognitionResult(int, const WebString&); + void didCompleteRecognition(int); private: WebSpeechInputController* m_controller; // To call into the embedder. - WebCore::SpeechInputListener* m_listener; // Valid when recognition is in progress. + WebCore::SpeechInputListener* m_listener; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.cpp b/WebKit/chromium/src/WebAnimationControllerImpl.cpp index 32a7a61..15df140 100644 --- a/WebKit/chromium/src/WebAnimationControllerImpl.cpp +++ b/WebKit/chromium/src/WebAnimationControllerImpl.cpp @@ -87,4 +87,24 @@ unsigned WebAnimationControllerImpl::numberOfActiveAnimations() const return controller->numberOfActiveAnimations(); } +void WebAnimationControllerImpl::suspendAnimations() const +{ + AnimationController* controller = animationController(); + if (!controller) + return; + if (!m_frameImpl->frame()) + return; + controller->suspendAnimations(m_frameImpl->frame()->document()); +} + +void WebAnimationControllerImpl::resumeAnimations() const +{ + AnimationController* controller = animationController(); + if (!controller) + return; + if (!m_frameImpl->frame()) + return; + controller->resumeAnimations(m_frameImpl->frame()->document()); +} + } // namespace WebKit diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.h b/WebKit/chromium/src/WebAnimationControllerImpl.h index 66dfe98..62b89f0 100644 --- a/WebKit/chromium/src/WebAnimationControllerImpl.h +++ b/WebKit/chromium/src/WebAnimationControllerImpl.h @@ -52,6 +52,8 @@ public: const WebString& propertyName, double time); virtual unsigned numberOfActiveAnimations() const; + virtual void suspendAnimations() const; + virtual void resumeAnimations() const; private: WebFrameImpl* m_frameImpl; WebCore::AnimationController* animationController() const; diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 4de5624..f4b1a86 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -36,6 +36,7 @@ #include "InjectedScriptHost.h" #include "InspectorBackendDispatcher.h" #include "InspectorController.h" +#include "InspectorValues.h" #include "Page.h" #include "PageGroup.h" #include "PlatformString.h" @@ -63,7 +64,11 @@ using WebCore::DocumentLoader; using WebCore::FrameLoader; using WebCore::InjectedScriptHost; +using WebCore::InspectorArray; +using WebCore::InspectorBackendDispatcher; using WebCore::InspectorController; +using WebCore::InspectorObject; +using WebCore::InspectorValue; using WebCore::Node; using WebCore::Page; using WebCore::ResourceError; @@ -232,7 +237,7 @@ void WebDevToolsAgentImpl::detach() void WebDevToolsAgentImpl::frontendLoaded() { inspectorController()->connectFrontend(); - m_client->runtimeFeatureStateChanged(kFrontendConnectedFeatureName, true); + m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, "true"); } void WebDevToolsAgentImpl::didNavigate() @@ -263,17 +268,22 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) void WebDevToolsAgentImpl::setRuntimeFeatureEnabled(const WebString& feature, bool enabled) { - if (feature == kApuAgentFeatureName) - setApuAgentEnabled(enabled); - else if (feature == kTimelineFeatureName) - setTimelineProfilingEnabled(enabled); - else if (feature == kResourceTrackingFeatureName) { + setRuntimeProperty(feature, enabled ? String("true") : String("false")); +} + +void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value) +{ + if (name == kApuAgentFeatureName) + setApuAgentEnabled(value == "true"); + else if (name == kTimelineFeatureName) + setTimelineProfilingEnabled(value == "true"); + else if (name == kResourceTrackingFeatureName) { InspectorController* ic = inspectorController(); - if (enabled) + if (value == "true") ic->enableResourceTracking(false /* not sticky */, false /* no reload */); else ic->disableResourceTracking(false /* not sticky */); - } else if (feature == kFrontendConnectedFeatureName && enabled && !inspectorController()->hasFrontend()) + } else if (name == kFrontendConnectedFeatureName && value == "true" && !inspectorController()->hasFrontend()) frontendLoaded(); } @@ -282,6 +292,8 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) m_apuAgentEnabled = enabled; InspectorController* ic = inspectorController(); if (enabled) { + if (!ic->hasFrontend()) + frontendLoaded(); m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); ic->startTimelineProfiler(); if (!m_resourceTrackingWasEnabled) { @@ -296,9 +308,9 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) ic->disableResourceTracking(false); m_resourceTrackingWasEnabled = false; } - m_client->runtimeFeatureStateChanged( + m_client->runtimePropertyChanged( kApuAgentFeatureName, - enabled); + enabled ? String("true") : String("false")); } WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController() @@ -412,22 +424,22 @@ bool WebDevToolsAgentImpl::sendMessageToFrontend(const WTF::String& message) void WebDevToolsAgentImpl::resourceTrackingWasEnabled() { - m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, true); + m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "true"); } void WebDevToolsAgentImpl::resourceTrackingWasDisabled() { - m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, false); + m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "false"); } void WebDevToolsAgentImpl::timelineProfilerWasStarted() { - m_client->runtimeFeatureStateChanged(kTimelineFeatureName, true); + m_client->runtimePropertyChanged(kTimelineFeatureName, "true"); } void WebDevToolsAgentImpl::timelineProfilerWasStopped() { - m_client->runtimeFeatureStateChanged(kTimelineFeatureName, false); + m_client->runtimePropertyChanged(kTimelineFeatureName, "false"); } void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script) @@ -455,6 +467,43 @@ void WebDevToolsAgent::debuggerPauseScript() DebuggerAgentManager::pauseScript(); } +void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d) +{ + class DebuggerTask : public WebCore::ScriptDebugServer::Task { + public: + DebuggerTask(WebDevToolsAgent::MessageDescriptor* descriptor) : m_descriptor(descriptor) { } + virtual ~DebuggerTask() { } + virtual void run() + { + if (WebDevToolsAgent* webagent = m_descriptor->agent()) + webagent->dispatchOnInspectorBackend(m_descriptor->message()); + } + private: + OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor; + }; + WebCore::ScriptDebugServer::interruptAndRun(new DebuggerTask(d)); +} + +bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) +{ + String commandName; + if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) + return false; + return commandName == InspectorBackendDispatcher::pauseCmd + || commandName == InspectorBackendDispatcher::setBreakpointCmd + || commandName == InspectorBackendDispatcher::removeBreakpointCmd + || commandName == InspectorBackendDispatcher::activateBreakpointsCmd + || commandName == InspectorBackendDispatcher::deactivateBreakpointsCmd + || commandName == InspectorBackendDispatcher::startProfilingCmd + || commandName == InspectorBackendDispatcher::stopProfilingCmd + || commandName == InspectorBackendDispatcher::getProfileCmd; +} + +void WebDevToolsAgent::processPendingMessages() +{ + WebCore::ScriptDebugServer::shared().runPendingTasks(); +} + void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler handler) { DebuggerAgentManager::setMessageLoopDispatchHandler(handler); diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index a0d2647..73b8a1e 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -77,6 +77,7 @@ public: virtual void inspectElementAt(const WebPoint& point); virtual void evaluateInWebInspector(long callId, const WebString& script); virtual void setRuntimeFeatureEnabled(const WebString& feature, bool enabled); + virtual void setRuntimeProperty(const WebString& name, const WebString& value); virtual void setTimelineProfilingEnabled(bool enable); virtual void identifierForInitialRequest(unsigned long, WebFrame*, const WebURLRequest&); diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index c1b09c4..905bc6d 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -100,17 +100,6 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( // Put each DevTools frontend Page into its own (single page) group so that it's not // deferred along with the inspected page. m_webViewImpl->page()->setGroupName(String()); - - WebFrameImpl* frame = m_webViewImpl->mainFrameImpl(); - v8::HandleScope scope; - v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame()); - - // Debugger commands should be sent using special method. - BoundObject debuggerCommandExecutorObj(frameContext, this, "RemoteDebuggerCommandExecutor"); - debuggerCommandExecutorObj.addProtoFunction( - "DebuggerPauseScript", - WebDevToolsFrontendImpl::jsDebuggerPauseScript); - debuggerCommandExecutorObj.build(); } WebDevToolsFrontendImpl::~WebDevToolsFrontendImpl() @@ -123,7 +112,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa v8::HandleScope scope; v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame()); v8::Context::Scope contextScope(frameContext); - v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("devtools$$dispatch")); + v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("WebInspector_syncDispatch")); ASSERT(dispatchFunction->IsFunction()); v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction); Vector< v8::Handle<v8::Value> > args; @@ -138,11 +127,4 @@ void WebDevToolsFrontendImpl::frontendLoaded() m_client->sendFrontendLoaded(); } -v8::Handle<v8::Value> WebDevToolsFrontendImpl::jsDebuggerPauseScript(const v8::Arguments& args) -{ - WebDevToolsFrontendImpl* frontend = static_cast<WebDevToolsFrontendImpl*>(v8::External::Cast(*args.Data())->Value()); - frontend->m_client->sendDebuggerPauseScript(); - return v8::Undefined(); -} - } // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.h b/WebKit/chromium/src/WebDevToolsFrontendImpl.h index e4f22fe..bde906f 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.h +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.h @@ -70,8 +70,6 @@ public: void frontendLoaded(); private: - static v8::Handle<v8::Value> jsDebuggerPauseScript(const v8::Arguments& args); - WebKit::WebViewImpl* m_webViewImpl; WebKit::WebDevToolsFrontendClient* m_client; String m_applicationLocale; diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp index 30b619b..2e05d52 100644 --- a/WebKit/chromium/src/WebEntities.cpp +++ b/WebKit/chromium/src/WebEntities.cpp @@ -33,6 +33,7 @@ #include <string.h> +#include "HTMLEntityTable.h" #include "PlatformString.h" #include "StringBuilder.h" #include <wtf/HashMap.h> @@ -41,59 +42,51 @@ using namespace WebCore; +namespace WebKit { + namespace { -// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting -// two copies of the data in memory. We can fix this by changing the script -// that generated the array to create a static const that is its length, but -// this is low priority since the data is less than 4K. We use anonymous -// namespace to prevent name collisions. -#include "HTMLEntityNames.cpp" // NOLINT -} -namespace WebKit { +void populateMapFromXMLEntities(WTF::HashMap<int, WTF::String>& map) +{ + ASSERT(map.isEmpty()); + map.set(0x003c, "lt"); + map.set(0x003e, "gt"); + map.set(0x0026, "amp"); + map.set(0x0027, "apos"); + map.set(0x0022, "quot"); +} -void populateMap(WTF::HashMap<int, WTF::String>& map, - const Entity* entities, - size_t entitiesCount, - bool standardHTML) +void populateMapFromHTMLEntityTable(WTF::HashMap<int, WTF::String>& map) { ASSERT(map.isEmpty()); - const Entity* entity = &entities[0]; - for (size_t i = 0; i < entitiesCount; i++, entity++) { - int code = entity->code; - String name = entity->name; - // For consistency, use the lowe case for entities that have both. - if (map.contains(code) && map.get(code) == name.lower()) + const HTMLEntityTableEntry* entry = HTMLEntityTable::firstEntry(); + const HTMLEntityTableEntry* end = HTMLEntityTable::lastEntry() + 1; + for (; entry != end; ++entry) { + String entity = entry->entity; + int value = entry->value; + ASSERT(value && !entity.isEmpty()); + if (entity[entity.length() - 1] != ';') + continue; // We want the canonical version that ends in ; + // For consistency, use the lower case for entities that have both. + if (map.contains(value) && map.get(value) == entity.lower()) continue; - // Don't register %, ⊅ and &supl;. - if (standardHTML && (code == '%' || code == 0x2285 || code == 0x00b9)) + // Don't register %, ⊅ and &supl; for some unknown reason. + if (value == '%' || value == 0x2285 || value == 0x00b9) continue; - map.set(code, name); + map.set(value, entity); } - if (standardHTML) - map.set(static_cast<int>(0x0027), String("#39")); + // We add #39 for some unknown reason. + map.set(0x0027, String("#39")); } -static const Entity xmlBuiltInEntityCodes[] = { - { "lt", 0x003c }, - { "gt", 0x003e }, - { "amp", 0x0026 }, - { "apos", 0x0027 }, - { "quot", 0x0022 } -}; +} WebEntities::WebEntities(bool xmlEntities) { if (xmlEntities) - populateMap(m_entitiesMap, - xmlBuiltInEntityCodes, - sizeof(xmlBuiltInEntityCodes) / sizeof(Entity), - false); + populateMapFromXMLEntities(m_entitiesMap); else - populateMap(m_entitiesMap, - wordlist, - sizeof(wordlist) / sizeof(Entity), - true); + populateMapFromHTMLEntityTable(m_entitiesMap); } String WebEntities::entityNameByCode(int code) const diff --git a/WebKit/chromium/src/WebEntities.h b/WebKit/chromium/src/WebEntities.h index a01cc5d..f210566 100644 --- a/WebKit/chromium/src/WebEntities.h +++ b/WebKit/chromium/src/WebEntities.h @@ -36,6 +36,7 @@ namespace WebKit { +// FIXME: This class is wrong and needs to be removed. class WebEntities { public: // ', %, ⊅, &supl; are not defined by the HTML standards. diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 410ac3b..a863862 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -34,81 +34,16 @@ #include "WebGraphicsContext3DDefaultImpl.h" +#include "app/gfx/gl/gl_bindings.h" +#include "app/gfx/gl/gl_context.h" #include "NotImplemented.h" +#include <wtf/PassOwnPtr.h> #include <stdio.h> #include <string.h> -#if OS(LINUX) -#include <dlfcn.h> -#endif - namespace WebKit { -// Uncomment this to render to a separate window for debugging -// #define RENDER_TO_DEBUGGING_WINDOW - -#if OS(DARWIN) -#define USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER -#endif - -bool WebGraphicsContext3DDefaultImpl::s_initializedGLEW = false; - -#if OS(LINUX) -WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::s_gl = 0; - -WebGraphicsContext3DDefaultImpl::GLConnection* WebGraphicsContext3DDefaultImpl::GLConnection::create() -{ - Display* dpy = XOpenDisplay(0); - if (!dpy) { - printf("GraphicsContext3D: error opening X display\n"); - return 0; - } - - // We use RTLD_GLOBAL semantics so that GLEW initialization works; - // GLEW expects to be able to open the current process's handle - // and do dlsym's of GL entry points from there. - void* libGL = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); - if (!libGL) { - XCloseDisplay(dpy); - printf("GraphicsContext3D: error opening libGL.so.1: %s\n", dlerror()); - return 0; - } - - PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC) dlsym(libGL, "glXChooseFBConfig"); - PFNGLXCREATENEWCONTEXTPROC createNewContext = (PFNGLXCREATENEWCONTEXTPROC) dlsym(libGL, "glXCreateNewContext"); - PFNGLXCREATEPBUFFERPROC createPbuffer = (PFNGLXCREATEPBUFFERPROC) dlsym(libGL, "glXCreatePbuffer"); - PFNGLXDESTROYPBUFFERPROC destroyPbuffer = (PFNGLXDESTROYPBUFFERPROC) dlsym(libGL, "glXDestroyPbuffer"); - PFNGLXMAKECURRENTPROC makeCurrent = (PFNGLXMAKECURRENTPROC) dlsym(libGL, "glXMakeCurrent"); - PFNGLXDESTROYCONTEXTPROC destroyContext = (PFNGLXDESTROYCONTEXTPROC) dlsym(libGL, "glXDestroyContext"); - PFNGLXGETCURRENTCONTEXTPROC getCurrentContext = (PFNGLXGETCURRENTCONTEXTPROC) dlsym(libGL, "glXGetCurrentContext"); - if (!chooseFBConfig || !createNewContext || !createPbuffer - || !destroyPbuffer || !makeCurrent || !destroyContext - || !getCurrentContext) { - XCloseDisplay(dpy); - dlclose(libGL); - printf("GraphicsContext3D: error looking up bootstrapping entry points\n"); - return 0; - } - return new GLConnection(dpy, - libGL, - chooseFBConfig, - createNewContext, - createPbuffer, - destroyPbuffer, - makeCurrent, - destroyContext, - getCurrentContext); -} - -WebGraphicsContext3DDefaultImpl::GLConnection::~GLConnection() -{ - XCloseDisplay(m_display); - dlclose(m_libGL); -} - -#endif // OS(LINUX) - WebGraphicsContext3DDefaultImpl::VertexAttribPointerState::VertexAttribPointerState() : enabled(false) , buffer(0) @@ -134,20 +69,6 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl() , m_scanline(0) #endif , m_boundArrayBuffer(0) -#if OS(WINDOWS) - , m_canvasWindow(0) - , m_canvasDC(0) - , m_contextObj(0) -#elif PLATFORM(CG) - , m_pbuffer(0) - , m_contextObj(0) - , m_renderOutput(0) -#elif OS(LINUX) - , m_contextObj(0) - , m_pbuffer(0) -#else -#error Must port to your platform -#endif { } @@ -155,7 +76,7 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() { if (m_initialized) { makeContextCurrent(); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias) { glDeleteRenderbuffersEXT(1, &m_multisampleColorBuffer); if (m_attributes.depth || m_attributes.stencil) @@ -171,220 +92,19 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() delete[] m_scanline; #endif glDeleteFramebuffersEXT(1, &m_fbo); -#endif // !RENDER_TO_DEBUGGING_WINDOW -#if OS(WINDOWS) - wglewMakeCurrent(0, 0); - wglewDeleteContext(m_contextObj); - ReleaseDC(m_canvasWindow, m_canvasDC); - DestroyWindow(m_canvasWindow); -#elif PLATFORM(CG) - CGLSetCurrentContext(0); - CGLDestroyContext(m_contextObj); - CGLDestroyPBuffer(m_pbuffer); - if (m_renderOutput) - delete[] m_renderOutput; -#elif OS(LINUX) - s_gl->makeCurrent(0, 0); - s_gl->destroyContext(m_contextObj); - s_gl->destroyPbuffer(m_pbuffer); -#else -#error Must port to your platform -#endif - m_contextObj = 0; + + m_glContext->Destroy(); } } bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView) { -#if OS(WINDOWS) - if (!s_initializedGLEW) { - // Do this only the first time through. - if (!wglewInit()) { - printf("WebGraphicsContext3DDefaultImpl: wglewInit failed\n"); - return false; - } - } - - WNDCLASS wc; - if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) { - ZeroMemory(&wc, sizeof(WNDCLASS)); - wc.style = CS_OWNDC; - wc.hInstance = GetModuleHandle(0); - wc.lpfnWndProc = DefWindowProc; - wc.lpszClassName = L"CANVASGL"; - - if (!RegisterClass(&wc)) { - printf("WebGraphicsContext3DDefaultImpl: RegisterClass failed\n"); - return false; - } - } - - m_canvasWindow = CreateWindow(L"CANVASGL", L"CANVASGL", - WS_CAPTION, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, 0, 0, GetModuleHandle(0), 0); - if (!m_canvasWindow) { - printf("WebGraphicsContext3DDefaultImpl: CreateWindow failed\n"); - return false; - } - - // get the device context - m_canvasDC = GetDC(m_canvasWindow); - if (!m_canvasDC) { - printf("WebGraphicsContext3DDefaultImpl: GetDC failed\n"); - return false; - } - - // find default pixel format - PIXELFORMATDESCRIPTOR pfd; - ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR)); - pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); - pfd.nVersion = 1; -#ifdef RENDER_TO_DEBUGGING_WINDOW - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; -#else - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; -#endif - int pixelformat = ChoosePixelFormat(m_canvasDC, &pfd); - - // set the pixel format for the dc - if (!SetPixelFormat(m_canvasDC, pixelformat, &pfd)) { - printf("WebGraphicsContext3DDefaultImpl: SetPixelFormat failed\n"); - return false; - } - - // create rendering context - m_contextObj = wglewCreateContext(m_canvasDC); - if (!m_contextObj) { - printf("WebGraphicsContext3DDefaultImpl: wglCreateContext failed\n"); - return false; - } - - if (!wglewMakeCurrent(m_canvasDC, m_contextObj)) { - printf("WebGraphicsContext3DDefaultImpl: wglMakeCurrent failed\n"); - return false; - } - -#ifdef RENDER_TO_DEBUGGING_WINDOW - typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); - PFNWGLSWAPINTERVALEXTPROC setSwapInterval = 0; - setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglewGetProcAddress("wglSwapIntervalEXT"); - if (setSwapInterval) - setSwapInterval(1); -#endif // RENDER_TO_DEBUGGING_WINDOW - -#elif PLATFORM(CG) - // Create a 1x1 pbuffer and associated context to bootstrap things - CGLPixelFormatAttribute attribs[] = { - (CGLPixelFormatAttribute) kCGLPFAPBuffer, - (CGLPixelFormatAttribute) 0 - }; - CGLPixelFormatObj pixelFormat; - GLint numPixelFormats; - if (CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats) != kCGLNoError) { - printf("WebGraphicsContext3DDefaultImpl: error choosing pixel format\n"); - return false; - } - if (!pixelFormat) { - printf("WebGraphicsContext3DDefaultImpl: no pixel format selected\n"); - return false; - } - CGLContextObj context; - CGLError res = CGLCreateContext(pixelFormat, 0, &context); - CGLDestroyPixelFormat(pixelFormat); - if (res != kCGLNoError) { - printf("WebGraphicsContext3DDefaultImpl: error creating context\n"); + if (!gfx::GLContext::InitializeOneOff()) return false; - } - CGLPBufferObj pbuffer; - if (CGLCreatePBuffer(1, 1, GL_TEXTURE_2D, GL_RGBA, 0, &pbuffer) != kCGLNoError) { - CGLDestroyContext(context); - printf("WebGraphicsContext3DDefaultImpl: error creating pbuffer\n"); - return false; - } - if (CGLSetPBuffer(context, pbuffer, 0, 0, 0) != kCGLNoError) { - CGLDestroyContext(context); - CGLDestroyPBuffer(pbuffer); - printf("WebGraphicsContext3DDefaultImpl: error attaching pbuffer to context\n"); - return false; - } - if (CGLSetCurrentContext(context) != kCGLNoError) { - CGLDestroyContext(context); - CGLDestroyPBuffer(pbuffer); - printf("WebGraphicsContext3DDefaultImpl: error making context current\n"); - return false; - } - m_pbuffer = pbuffer; - m_contextObj = context; -#elif OS(LINUX) - if (!s_gl) { - s_gl = GLConnection::create(); - if (!s_gl) - return false; - } - - int configAttrs[] = { - GLX_DRAWABLE_TYPE, - GLX_PBUFFER_BIT, - GLX_RENDER_TYPE, - GLX_RGBA_BIT, - GLX_DOUBLEBUFFER, - 0, - 0 - }; - int nelements = 0; - GLXFBConfig* config = s_gl->chooseFBConfig(0, configAttrs, &nelements); - if (!config) { - printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig failed\n"); - return false; - } - if (!nelements) { - printf("WebGraphicsContext3DDefaultImpl: glXChooseFBConfig returned 0 elements\n"); - XFree(config); - return false; - } - GLXContext context = s_gl->createNewContext(config[0], GLX_RGBA_TYPE, 0, True); - if (!context) { - printf("WebGraphicsContext3DDefaultImpl: glXCreateNewContext failed\n"); - XFree(config); - return false; - } - int pbufferAttrs[] = { - GLX_PBUFFER_WIDTH, - 1, - GLX_PBUFFER_HEIGHT, - 1, - 0 - }; - GLXPbuffer pbuffer = s_gl->createPbuffer(config[0], pbufferAttrs); - XFree(config); - if (!pbuffer) { - printf("WebGraphicsContext3DDefaultImpl: glxCreatePbuffer failed\n"); + + m_glContext = WTF::adoptPtr(gfx::GLContext::CreateOffscreenGLContext(0)); + if (!m_glContext) return false; - } - if (!s_gl->makeCurrent(pbuffer, context)) { - printf("WebGraphicsContext3DDefaultImpl: glXMakeCurrent failed\n"); - return false; - } - m_contextObj = context; - m_pbuffer = pbuffer; -#else -#error Must port to your platform -#endif - - if (!s_initializedGLEW) { - // Initialize GLEW and check for GL 2.0 support by the drivers. - GLenum glewInitResult = glewInit(); - if (glewInitResult != GLEW_OK) { - printf("WebGraphicsContext3DDefaultImpl: GLEW initialization failed\n"); - return false; - } - if (!glewIsSupported("GL_VERSION_2_0")) { - printf("WebGraphicsContext3DDefaultImpl: OpenGL 2.0 not supported\n"); - return false; - } - s_initializedGLEW = true; - } m_attributes = attributes; validateAttributes(); @@ -423,22 +143,7 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes() bool WebGraphicsContext3DDefaultImpl::makeContextCurrent() { -#if OS(WINDOWS) - if (wglewGetCurrentContext() != m_contextObj) - if (wglewMakeCurrent(m_canvasDC, m_contextObj)) - return true; -#elif PLATFORM(CG) - if (CGLGetCurrentContext() != m_contextObj) - if (CGLSetCurrentContext(m_contextObj) == kCGLNoError) - return true; -#elif OS(LINUX) - if (s_gl->getCurrentContext() != m_contextObj) - if (s_gl->makeCurrent(m_pbuffer, m_contextObj)) - return true; -#else -#error Must port to your platform -#endif - return false; + return m_glContext->MakeCurrent(); } int WebGraphicsContext3DDefaultImpl::width() @@ -500,23 +205,12 @@ static int createTextureObject(GLenum target) void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) { -#ifdef RENDER_TO_DEBUGGING_WINDOW - SetWindowPos(m_canvasWindow, HWND_TOP, 0, 0, width, height, - SWP_NOMOVE); - ShowWindow(m_canvasWindow, SW_SHOW); -#endif - m_cachedWidth = width; m_cachedHeight = height; makeContextCurrent(); -#ifndef RENDER_TO_DEBUGGING_WINDOW -#ifdef USE_TEXTURE_RECTANGLE_FOR_FRAMEBUFFER - // GL_TEXTURE_RECTANGLE_ARB is the best supported render target on Mac OS X - GLenum target = GL_TEXTURE_RECTANGLE_ARB; -#else GLenum target = GL_TEXTURE_2D; -#endif + if (!m_texture) { // Generate the texture object m_texture = createTextureObject(target); @@ -658,7 +352,6 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) if (mustRestoreFBO) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); -#endif // RENDER_TO_DEBUGGING_WINDOW #ifdef FLIP_FRAMEBUFFER_VERTICALLY if (m_scanline) { @@ -700,9 +393,6 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels, makeContextCurrent(); -#ifdef RENDER_TO_DEBUGGING_WINDOW - SwapBuffers(m_canvasDC); -#else // Earlier versions of this code used the GPU to flip the // framebuffer vertically before reading it back for compositing // via software. This code was quite complicated, used a lot of @@ -732,13 +422,9 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels, mustRestorePackAlignment = true; } -#if PLATFORM(SKIA) + // FIXME: OpenGL ES 2 does not support GL_BGRA so this fails when + // using that backend. glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_BYTE, pixels); -#elif PLATFORM(CG) - glReadPixels(0, 0, m_cachedWidth, m_cachedHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels); -#else -#error Must port to your platform -#endif if (mustRestorePackAlignment) glPixelStorei(GL_PACK_ALIGNMENT, packAlignment); @@ -751,7 +437,6 @@ bool WebGraphicsContext3DDefaultImpl::readBackFramebuffer(unsigned char* pixels, flipVertically(pixels, m_cachedWidth, m_cachedHeight); #endif -#endif // RENDER_TO_DEBUGGING_WINDOW return true; } @@ -760,6 +445,14 @@ void WebGraphicsContext3DDefaultImpl::synthesizeGLError(unsigned long error) m_syntheticErrors.add(error); } +bool WebGraphicsContext3DDefaultImpl::supportsBGRA() +{ + // Supported since OpenGL 1.2. However, glTexImage2D() must be modified + // to translate the internalFormat from GL_BGRA to GL_RGBA, since the + // former is not accepted by desktop GL. Return false until this is done. + return false; +} + // Helper macros to reduce the amount of code. #define DELEGATE_TO_GL(name, glname) \ @@ -916,38 +609,36 @@ void WebGraphicsContext3DDefaultImpl::copyTexImage2D(unsigned long target, long long x, long y, unsigned long width, unsigned long height, long border) { makeContextCurrent(); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) { glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); } -#endif + glCopyTexImage2D(target, level, internalformat, x, y, width, height, border); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); -#endif } void WebGraphicsContext3DDefaultImpl::copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height) { makeContextCurrent(); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) { glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); } -#endif + glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); -#endif } DELEGATE_TO_GL_1(cullFace, CullFace, unsigned long) @@ -1242,11 +933,11 @@ DELEGATE_TO_GL_1R(isBuffer, IsBuffer, WebGLId, bool) DELEGATE_TO_GL_1R(isEnabled, IsEnabled, unsigned long, bool) -DELEGATE_TO_GL_1R(isFramebuffer, IsFramebuffer, WebGLId, bool) +DELEGATE_TO_GL_1R(isFramebuffer, IsFramebufferEXT, WebGLId, bool) DELEGATE_TO_GL_1R(isProgram, IsProgram, WebGLId, bool) -DELEGATE_TO_GL_1R(isRenderbuffer, IsRenderbuffer, WebGLId, bool) +DELEGATE_TO_GL_1R(isRenderbuffer, IsRenderbufferEXT, WebGLId, bool) DELEGATE_TO_GL_1R(isShader, IsShader, WebGLId, bool) @@ -1266,7 +957,6 @@ void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long w // FIXME: remove the two glFlush calls when the driver bug is fixed, i.e., // all previous rendering calls should be done before reading pixels. glFlush(); -#ifndef RENDER_TO_DEBUGGING_WINDOW if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) { glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); @@ -1274,12 +964,11 @@ void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long w glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo); glFlush(); } -#endif + glReadPixels(x, y, width, height, format, type, pixels); -#ifndef RENDER_TO_DEBUGGING_WINDOW + if (m_attributes.antialias && m_boundFBO == m_multisampleFBO) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); -#endif } void WebGraphicsContext3DDefaultImpl::releaseShaderCompiler() @@ -1431,7 +1120,7 @@ unsigned WebGraphicsContext3DDefaultImpl::createBuffer() { makeContextCurrent(); GLuint o; - glGenBuffers(1, &o); + glGenBuffersARB(1, &o); return o; } @@ -1470,7 +1159,7 @@ unsigned WebGraphicsContext3DDefaultImpl::createTexture() void WebGraphicsContext3DDefaultImpl::deleteBuffer(unsigned buffer) { makeContextCurrent(); - glDeleteBuffers(1, &buffer); + glDeleteBuffersARB(1, &buffer); } void WebGraphicsContext3DDefaultImpl::deleteFramebuffer(unsigned framebuffer) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index 8223a1c..cf5f5b4 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -36,25 +36,14 @@ #include "WebGraphicsContext3D.h" #include <wtf/ListHashSet.h> +#include <wtf/OwnPtr.h> -#if OS(WINDOWS) -#include <windows.h> -#endif - -#include "GL/glew.h" -#if OS(WINDOWS) -#include "GL/wglew.h" -#endif - -#if PLATFORM(CG) -#include <OpenGL/OpenGL.h> -#else +#if !PLATFORM(CG) #define FLIP_FRAMEBUFFER_VERTICALLY #endif - -#if OS(LINUX) -#include "GL/glxew.h" -#endif +namespace gfx { +class GLContext; +} namespace WebKit { @@ -88,6 +77,7 @@ public: virtual void prepareTexture(); virtual void synthesizeGLError(unsigned long error); + virtual bool supportsBGRA(); virtual void activeTexture(unsigned long texture); virtual void attachShader(WebGLId program, WebGLId shader); @@ -323,103 +313,7 @@ private: // Errors raised by synthesizeGLError(). ListHashSet<unsigned long> m_syntheticErrors; - static bool s_initializedGLEW; -#if OS(WINDOWS) - HWND m_canvasWindow; - HDC m_canvasDC; - HGLRC m_contextObj; -#elif PLATFORM(CG) - CGLPBufferObj m_pbuffer; - CGLContextObj m_contextObj; - unsigned char* m_renderOutput; -#elif OS(LINUX) - GLXContext m_contextObj; - GLXPbuffer m_pbuffer; - - // In order to avoid problems caused by linking against libGL, we - // dynamically look up all the symbols we need. - // http://code.google.com/p/chromium/issues/detail?id=16800 - class GLConnection { - public: - ~GLConnection(); - - static GLConnection* create(); - - GLXFBConfig* chooseFBConfig(int screen, const int *attrib_list, int *nelements) - { - return m_glXChooseFBConfig(m_display, screen, attrib_list, nelements); - } - - GLXContext createNewContext(GLXFBConfig config, int renderType, GLXContext shareList, Bool direct) - { - return m_glXCreateNewContext(m_display, config, renderType, shareList, direct); - } - - GLXPbuffer createPbuffer(GLXFBConfig config, const int *attribList) - { - return m_glXCreatePbuffer(m_display, config, attribList); - } - - void destroyPbuffer(GLXPbuffer pbuf) - { - m_glXDestroyPbuffer(m_display, pbuf); - } - - Bool makeCurrent(GLXDrawable drawable, GLXContext ctx) - { - return m_glXMakeCurrent(m_display, drawable, ctx); - } - - void destroyContext(GLXContext ctx) - { - m_glXDestroyContext(m_display, ctx); - } - - GLXContext getCurrentContext() - { - return m_glXGetCurrentContext(); - } - - private: - Display* m_display; - void* m_libGL; - PFNGLXCHOOSEFBCONFIGPROC m_glXChooseFBConfig; - PFNGLXCREATENEWCONTEXTPROC m_glXCreateNewContext; - PFNGLXCREATEPBUFFERPROC m_glXCreatePbuffer; - PFNGLXDESTROYPBUFFERPROC m_glXDestroyPbuffer; - typedef Bool (* PFNGLXMAKECURRENTPROC)(Display* dpy, GLXDrawable drawable, GLXContext ctx); - PFNGLXMAKECURRENTPROC m_glXMakeCurrent; - typedef void (* PFNGLXDESTROYCONTEXTPROC)(Display* dpy, GLXContext ctx); - PFNGLXDESTROYCONTEXTPROC m_glXDestroyContext; - typedef GLXContext (* PFNGLXGETCURRENTCONTEXTPROC)(void); - PFNGLXGETCURRENTCONTEXTPROC m_glXGetCurrentContext; - - GLConnection(Display* display, - void* libGL, - PFNGLXCHOOSEFBCONFIGPROC chooseFBConfig, - PFNGLXCREATENEWCONTEXTPROC createNewContext, - PFNGLXCREATEPBUFFERPROC createPbuffer, - PFNGLXDESTROYPBUFFERPROC destroyPbuffer, - PFNGLXMAKECURRENTPROC makeCurrent, - PFNGLXDESTROYCONTEXTPROC destroyContext, - PFNGLXGETCURRENTCONTEXTPROC getCurrentContext) - : m_libGL(libGL) - , m_display(display) - , m_glXChooseFBConfig(chooseFBConfig) - , m_glXCreateNewContext(createNewContext) - , m_glXCreatePbuffer(createPbuffer) - , m_glXDestroyPbuffer(destroyPbuffer) - , m_glXMakeCurrent(makeCurrent) - , m_glXDestroyContext(destroyContext) - , m_glXGetCurrentContext(getCurrentContext) - { - } - }; - - static GLConnection* s_gl; -#else - #error Must port WebGraphicsContext3DDefaultImpl to your platform -#endif + OwnPtr<gfx::GLContext> m_glContext; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebIDBKey.cpp b/WebKit/chromium/src/WebIDBKey.cpp index 1c4c685..413a9e6 100644 --- a/WebKit/chromium/src/WebIDBKey.cpp +++ b/WebKit/chromium/src/WebIDBKey.cpp @@ -30,7 +30,12 @@ #if ENABLE(INDEXED_DATABASE) +#include "IDBBindingUtilities.h" #include "IDBKey.h" +#include "IDBKeyPath.h" +#include "SerializedScriptValue.h" +#include "WebIDBKeyPath.h" +#include "WebSerializedScriptValue.h" using namespace WebCore; @@ -50,6 +55,13 @@ WebIDBKey WebIDBKey::createInvalid() return key; } +WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& serializedScriptValue, const WebIDBKeyPath& idbKeyPath) +{ + if (serializedScriptValue.isNull()) + return WebIDBKey::createInvalid(); + return WebCore::createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); +} + void WebIDBKey::assign(const WebIDBKey& value) { m_private = value.m_private; diff --git a/WebKit/chromium/src/WebIDBKeyPath.cpp b/WebKit/chromium/src/WebIDBKeyPath.cpp new file mode 100644 index 0000000..9eb33d6 --- /dev/null +++ b/WebKit/chromium/src/WebIDBKeyPath.cpp @@ -0,0 +1,77 @@ +/* + * 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 "WebIDBKeyPath.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBKeyPath.h" +#include "WebString.h" +#include "WebVector.h" +#include <wtf/Vector.h> + +using namespace WebCore; + +namespace WebKit { + +WebIDBKeyPath WebIDBKeyPath::create(const WebString& keyPath) +{ + WTF::Vector<IDBKeyPathElement> idbElements; + IDBKeyPathParseError idbError; + IDBParseKeyPath(keyPath, idbElements, idbError); + return WebIDBKeyPath(idbElements, static_cast<int>(idbError)); +} + +WebIDBKeyPath::WebIDBKeyPath(const WTF::Vector<IDBKeyPathElement>& elements, int parseError) + : m_private(new WTF::Vector<IDBKeyPathElement>(elements)) + , m_parseError(parseError) +{ +} + +int WebIDBKeyPath::parseError() const +{ + return m_parseError; +} + +void WebIDBKeyPath::assign(const WebIDBKeyPath& keyPath) +{ + m_parseError = keyPath.m_parseError; + m_private.reset(new WTF::Vector<IDBKeyPathElement>(keyPath)); +} + +void WebIDBKeyPath::reset() +{ + m_private.reset(0); +} + +WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&() const +{ + return *m_private.get(); +} + +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp index 1d717ea..786d573 100644 --- a/WebKit/chromium/src/WebKit.cpp +++ b/WebKit/chromium/src/WebKit.cpp @@ -31,7 +31,6 @@ #include "config.h" #include "WebKit.h" -#include "AtomicString.h" #include "DOMTimer.h" #include "Logging.h" #include "Page.h" @@ -43,6 +42,7 @@ #include <wtf/Assertions.h> #include <wtf/Threading.h> +#include <wtf/text/AtomicString.h> namespace WebKit { diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp index 38d91df..6aa8439 100644 --- a/WebKit/chromium/src/WebNotification.cpp +++ b/WebKit/chromium/src/WebNotification.cpp @@ -113,6 +113,11 @@ WebString WebNotification::replaceId() const return m_private->replaceId(); } +void WebNotification::detachPresenter() +{ + m_private->detachPresenter(); +} + void WebNotification::dispatchDisplayEvent() { RefPtr<Event> event = Event::create("display", false, true); diff --git a/WebKit/chromium/src/WebPageSerializerImpl.h b/WebKit/chromium/src/WebPageSerializerImpl.h index 03f0a3b..a7f2fb4 100644 --- a/WebKit/chromium/src/WebPageSerializerImpl.h +++ b/WebKit/chromium/src/WebPageSerializerImpl.h @@ -32,10 +32,10 @@ #define WebPageSerializerImpl_h #include "PlatformString.h" -#include "StringHash.h" #include <wtf/Forward.h> #include <wtf/HashMap.h> #include <wtf/Vector.h> +#include <wtf/text/StringHash.h> #include "StringBuilder.h" #include "WebEntities.h" diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 6b04320..57e3635 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -46,6 +46,12 @@ WebSpeechInputControllerMockImpl::WebSpeechInputControllerMockImpl( : m_webcoreMock(new WebCore::SpeechInputClientMock()) , m_listener(listener) { + m_webcoreMock->setListener(this); +} + +WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl() +{ + m_webcoreMock->setListener(0); } void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result) @@ -53,34 +59,34 @@ void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& m_webcoreMock->setRecognitionResult(result); } -void WebSpeechInputControllerMockImpl::didCompleteRecording() +void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId) { - m_listener->didCompleteRecording(); + m_listener->didCompleteRecording(requestId); } -void WebSpeechInputControllerMockImpl::didCompleteRecognition() +void WebSpeechInputControllerMockImpl::didCompleteRecognition(int requestId) { - m_listener->didCompleteRecognition(); + m_listener->didCompleteRecognition(requestId); } -void WebSpeechInputControllerMockImpl::setRecognitionResult(const WTF::String& result) +void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WTF::String& result) { - m_listener->setRecognitionResult(result); + m_listener->setRecognitionResult(requestId, result); } -bool WebSpeechInputControllerMockImpl::startRecognition() +bool WebSpeechInputControllerMockImpl::startRecognition(int requestId) { - return m_webcoreMock->startRecognition(this); + return m_webcoreMock->startRecognition(requestId); } -void WebSpeechInputControllerMockImpl::cancelRecognition() +void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId) { - m_webcoreMock->cancelRecognition(); + m_webcoreMock->cancelRecognition(requestId); } -void WebSpeechInputControllerMockImpl::stopRecording() +void WebSpeechInputControllerMockImpl::stopRecording(int requestId) { - m_webcoreMock->stopRecording(); + m_webcoreMock->stopRecording(requestId); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index 046abf3..38a15df 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -47,16 +47,17 @@ class WebSpeechInputControllerMockImpl : public WebCore::SpeechInputListener , public WebSpeechInputControllerMock { public: WebSpeechInputControllerMockImpl(WebSpeechInputListener*); + virtual ~WebSpeechInputControllerMockImpl(); // WebCore::SpeechInputListener methods. - void didCompleteRecording(); - void didCompleteRecognition(); - void setRecognitionResult(const WTF::String& result); + void didCompleteRecording(int requestId); + void didCompleteRecognition(int requestId); + void setRecognitionResult(int requestId, const WTF::String& result); // WebSpeechInputController methods. - bool startRecognition(); - void cancelRecognition(); - void stopRecording(); + bool startRecognition(int requestId); + void cancelRecognition(int requestId); + void stopRecording(int requestId); // WebSpeechInputControllerMock methods. void setMockRecognitionResult(const WebString& result); diff --git a/WebKit/chromium/src/WebString.cpp b/WebKit/chromium/src/WebString.cpp index bbbe9ce..a091ef4 100644 --- a/WebKit/chromium/src/WebString.cpp +++ b/WebKit/chromium/src/WebString.cpp @@ -31,9 +31,9 @@ #include "config.h" #include "WebString.h" -#include "AtomicString.h" #include "PlatformString.h" #include <wtf/text/CString.h> +#include <wtf/text/AtomicString.h> #include "WebCString.h" diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 8733a2a..62b20d5 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -1949,8 +1949,14 @@ void WebView::addUserStyleSheet(const WebString& sourceCode, PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create()); + + // FIXME: Current callers always want the level to be "author". It probably makes sense to let + // callers specify this though, since in other cases the caller will probably want "user" level. + // + // FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL. pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0, - static_cast<UserContentInjectedFrames>(injectIn)); + static_cast<UserContentInjectedFrames>(injectIn), + UserStyleSheet::AuthorLevel); } void WebView::removeAllUserContent() diff --git a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp index dc46b07..f8a1386 100644 --- a/WebKit/chromium/src/gtk/WebInputEventFactory.cpp +++ b/WebKit/chromium/src/gtk/WebInputEventFactory.cpp @@ -45,12 +45,15 @@ namespace { -gint getDoubleClickTime() +bool countsAsDoubleClick(gint timeDiff, gint xDiff, gint yDiff) { static GtkSettings* settings = gtk_settings_get_default(); gint doubleClickTime = 250; - g_object_get(G_OBJECT(settings), "gtk-double-click-time", &doubleClickTime, NULL); - return doubleClickTime; + gint doubleClickDistance = 5; + g_object_get(G_OBJECT(settings), + "gtk-double-click-time", &doubleClickTime, + "gtk-double-click-distance", &doubleClickDistance, 0); + return timeDiff <= doubleClickTime && abs(xDiff) <= doubleClickDistance && abs(yDiff) <= doubleClickDistance; } } // namespace @@ -404,9 +407,13 @@ WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event) static int numClicks = 0; static GdkWindow* eventWindow = 0; static gint lastLeftClickTime = 0; + static gint lastLeftClickX = 0; + static gint lastLeftClickY = 0; - gint time_diff = event->time - lastLeftClickTime; - if (eventWindow == event->window && time_diff < getDoubleClickTime()) + gint timeDiff = event->time - lastLeftClickTime; + gint xDiff = event->x - lastLeftClickX; + gint yDiff = event->y - lastLeftClickY; + if (eventWindow == event->window && countsAsDoubleClick(timeDiff, xDiff, yDiff)) numClicks++; else numClicks = 1; @@ -414,6 +421,8 @@ WebMouseEvent WebInputEventFactory::mouseEvent(const GdkEventButton* event) result.clickCount = numClicks; eventWindow = event->window; lastLeftClickTime = event->time; + lastLeftClickX = event->x; + lastLeftClickY = event->y; } result.button = WebMouseEvent::ButtonNone; diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 895c68b..0fd66c9 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -34,22 +34,6 @@ * DevTools frontend together. It is also responsible for overriding existing * WebInspector functionality while it is getting upstreamed into WebCore. */ - -/** - * Dispatches raw message from the host. - * @param {string} remoteName - * @prama {string} methodName - * @param {string} param1, param2, param3 Arguments to dispatch. - */ -devtools$$dispatch = 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); -}; - - devtools.ToolsAgent = function() { this.profilerAgent_ = new devtools.ProfilerAgent(); @@ -75,30 +59,6 @@ devtools.tools = null; var context = {}; // Used by WebCore's inspector routines. -(function() { - WebInspector._paramsObject = {}; - - var queryParams = window.location.search; - if (queryParams) { - var params = queryParams.substring(1).split("&"); - for (var i = 0; i < params.length; ++i) { - var pair = params[i].split("="); - WebInspector._paramsObject[pair[0]] = pair[1]; - } - } - if ("page" in WebInspector._paramsObject) { - WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page); - 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"); - } -})(); /////////////////////////////////////////////////////////////////////////////// // Here and below are overrides to existing WebInspector methods only. // TODO(pfeldman): Patch WebCore and upstream changes. @@ -114,24 +74,15 @@ WebInspector.loaded = function() Preferences.profilerAlwaysEnabled = true; Preferences.canEditScriptSource = true; Preferences.onlineDetectionEnabled = false; - if ("page" in WebInspector._paramsObject) { - WebInspector.loadedDone = true; - if (WebInspector.socketOpened) - WebInspector.doLoadedDone(); - return; - } - WebInspector.doLoadedDone(); -} -WebInspector.doLoadedDone = function() { - oldLoaded.call(this); + oldLoaded.call(WebInspector); } devtools.domContentLoaded = function() { - WebInspector.setAttachedWindow(WebInspector._paramsObject.docked === "true"); - if (WebInspector._paramsObject.toolbar_color && WebInspector._paramsObject.text_color) - WebInspector.setToolbarColors(WebInspector._paramsObject.toolbar_color, WebInspector._paramsObject.text_color); + WebInspector.setAttachedWindow(WebInspector.queryParamsObject.docked === "true"); + if (WebInspector.queryParamsObject.toolbar_color && WebInspector.queryParamsObject.text_color) + WebInspector.setToolbarColors(WebInspector.queryParamsObject.toolbar_color, WebInspector.queryParamsObject.text_color); } document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false); @@ -243,10 +194,3 @@ WebInspector.resetToolbarColors = function() if (window.RemoteDebuggerAgent) { RemoteDebuggerAgent.setContextId = function() {}; } - - -// Support for pause while renderer is busy (is dispatched on IO thread). -InspectorBackend.pause = function() -{ - RemoteDebuggerCommandExecutor.DebuggerPauseScript(); -}; diff --git a/WebKit/chromium/src/js/InjectDispatch.js b/WebKit/chromium/src/js/InjectDispatch.js deleted file mode 100644 index cda84e5..0000000 --- a/WebKit/chromium/src/js/InjectDispatch.js +++ /dev/null @@ -1,67 +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. - */ - -/** - * @fileoverview Injects "injected" object into the inspectable page. - */ - - -var InspectorControllerDispatcher = {}; - -/** - * Main dispatch method, all calls from the host to InspectorController go - * through this one. - * @param {string} functionName Function to call - * @param {string} json_args JSON-serialized call parameters. - * @return {string} JSON-serialized result of the dispatched call. - */ -InspectorControllerDispatcher.dispatch = function(functionName, json_args) -{ - var params = JSON.parse(json_args); - InspectorBackend[functionName].apply(InspectorBackend, params); -}; - -/** - * This is called by the InspectorFrontend for serialization. - * We serialize the call and send it to the client over the IPC - * using dispatchOut bound method. - */ -function dispatch(method, var_args) { - var args = Array.prototype.slice.call(arguments); - var call = JSON.stringify(args); - DevToolsAgentHost.dispatch(call, method); -}; - -function close() { - // This method is called when InspectorFrontend closes in layout tests. -} - -function inspectedPageDestroyed() { -} diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index 764f624..41574b4 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -1069,25 +1069,6 @@ TestSuite.prototype._checkSourceFrameWhenLoaded = function(expectations, callbac /** - * Performs sequence of steps. - * @param {Array.<Object|Function>} Array [expectations1,action1,expectations2, - * action2,...,actionN]. - */ -TestSuite.prototype._performSteps = function(actions) -{ - var test = this; - var i = 0; - function doNextAction() { - if (i > 0) - actions[i++](); - if (i < actions.length - 1) - test._waitForScriptPause(actions[i++], doNextAction); - } - doNextAction(); -}; - - -/** * Waits until all the scripts are parsed and asynchronously executes the code * in the inspected page. */ @@ -1128,131 +1109,6 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb /** - * Waits until all debugger scripts are parsed and executes "a()" in the - * inspected page. - */ -TestSuite.prototype._executeFunctionForStepTest = function() -{ - this._executeCodeWhenScriptsAreParsed("a()", ["debugger_step.html", "debugger_step.js"]); -}; - - -/** - * Tests step over in the debugger. - */ -TestSuite.prototype.testStepOver = function() -{ - this.showPanel("scripts"); - var test = this; - - this._executeFunctionForStepTest(); - - this._performSteps([ - { - functionsOnStack: ["d","a",""], - lineNumber: 3, - lineText: " debugger;" - }, - function() { - document.getElementById("scripts-step-over").click(); - }, - { - functionsOnStack: ["d","a",""], - lineNumber: 5, - lineText: " var y = fact(10);" - }, - function() { - document.getElementById("scripts-step-over").click(); - }, - { - functionsOnStack: ["d","a",""], - lineNumber: 6, - lineText: " return y;" - }, - function() { - test.releaseControl(); - } - ]); - - test.takeControl(); -}; - - -/** - * Tests step out in the debugger. - */ -TestSuite.prototype.testStepOut = function() -{ - this.showPanel("scripts"); - var test = this; - - this._executeFunctionForStepTest(); - - this._performSteps([ - { - functionsOnStack: ["d","a",""], - lineNumber: 3, - lineText: " debugger;" - }, - function() { - document.getElementById("scripts-step-out").click(); - }, - { - functionsOnStack: ["a",""], - lineNumber: 8, - lineText: " printResult(result);" - }, - function() { - test.releaseControl(); - } - ]); - - test.takeControl(); -}; - - -/** - * Tests step in in the debugger. - */ -TestSuite.prototype.testStepIn = function() -{ - this.showPanel("scripts"); - var test = this; - - this._executeFunctionForStepTest(); - - this._performSteps([ - { - functionsOnStack: ["d","a",""], - lineNumber: 3, - lineText: " debugger;" - }, - function() { - document.getElementById("scripts-step-over").click(); - }, - { - functionsOnStack: ["d","a",""], - lineNumber: 5, - lineText: " var y = fact(10);" - }, - function() { - document.getElementById("scripts-step-into").click(); - }, - { - functionsOnStack: ["fact","d","a",""], - lineNumber: 10, - lineText: " var r = 1;" - }, - function() { - test.releaseControl(); - } - ]); - - test.takeControl(); -}; - - -/** * Gets a XPathResult matching given xpath. * @param {string} xpath * @param {number} resultType @@ -1503,116 +1359,6 @@ TestSuite.prototype._hookGetPropertiesCallback = function(hook, code) /** - * Tests that all elements in prototype chain of an object have expected - * intrinic proprties(__proto__, constructor, prototype). - */ -TestSuite.prototype.testDebugIntrinsicProperties = function() -{ - this.showPanel("scripts"); - var test = this; - - this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_intrinsic_properties.html"]); - - this._waitForScriptPause( - { - functionsOnStack: ["callDebugger", "handleClick", ""], - lineNumber: 29, - lineText: " debugger;" - }, - expandLocalScope); - - var localScopeSection = null; - function expandLocalScope() { - test._expandScopeSections(function(sections, i) { - if (i === 0) { - test.assertTrue(sections[i].object.isLocal, "Scope #0 is not Local."); - localScopeSection = sections[i]; - return true; - } - return false; - }, - examineLocalScope); - } - - function examineLocalScope() { - var scopeExpectations = [ - "a", "Child", [ - "__proto__", "Child", [ - "__proto__", "Parent", [ - "__proto__", "Object", null, - "constructor", "function Parent(n) {", [ - "name", '"Parent"', null, - "prototype", 'Parent', [ - "parentProtoField", "11", null, - ] - ], - "parentProtoField", "11", null, - ], - "constructor", "function Child(n) {", null, - "childProtoField", "21", null, - ], - - "parentField", "10", null, - "childField", "20", null, - ] - ]; - checkProperty(localScopeSection.propertiesTreeOutline, "<Local Scope>", scopeExpectations); - } - - var propQueue = []; - var index = 0; - var expectedFinalIndex = 5; - - function expandAndCheckNextProperty() { - if (index === propQueue.length) { - test.assertEquals(expectedFinalIndex, index, "Unexpected number of expanded objects."); - test.releaseControl(); - return; - } - - // Read next property data from the queue. - var treeElement = propQueue[index].treeElement; - var path = propQueue[index].path; - var expectations = propQueue[index].expectations; - index++; - - // Expand the property. - test._hookGetPropertiesCallback(function() { - checkProperty(treeElement, path, expectations); - }, - function() { - treeElement.expand(); - }); - } - - function checkProperty(treeElement, path, expectations) { - for (var i = 0; i < expectations.length; i += 3) { - var name = expectations[i]; - var description = expectations[i+1]; - var value = expectations[i+2]; - - var propertyPath = path + "." + name; - var propertyTreeElement = test._findChildProperty(treeElement, name, path); - test.assertTrue(propertyTreeElement, 'Property "' + propertyPath + '" not found.'); - test.assertEquals(description, propertyTreeElement.property.value.description, 'Unexpected "' + propertyPath + '" description.'); - if (value) { - // Schedule property content check. - propQueue.push({ - treeElement: propertyTreeElement, - path: propertyPath, - expectations: value, - }); - } - } - // Check next property in the queue. - expandAndCheckNextProperty(); - } - - test.takeControl(); -}; - - -/** * Tests "Pause" button will pause debugger when a snippet is evaluated. */ TestSuite.prototype.testPauseInEval = function() @@ -1647,101 +1393,6 @@ TestSuite.createKeyEvent = function(keyIdentifier) /** - * Tests console eval. - */ -TestSuite.prototype.testConsoleEval = function() -{ - var test = this; - this.evaluateInConsole_("123", - function(resultText) { - test.assertEquals("123", resultText); - test.releaseControl(); - }); - - this.takeControl(); -}; - - -/** - * Tests console log. - */ -TestSuite.prototype.testConsoleLog = function() -{ - WebInspector.showConsole(); - var messages = WebInspector.console.messages; - var index = 0; - - var test = this; - var assertNext = function(line, message, opt_class, opt_count, opt_substr) { - var elem = messages[index++].toMessageElement(); - var clazz = elem.getAttribute("class"); - var expectation = (opt_count || '') + 'console_test_page.html:' + line + message; - if (opt_substr) - test.assertContains(elem.textContent, expectation); - else - test.assertEquals(expectation, elem.textContent); - if (opt_class) - test.assertContains(clazz, "console-" + opt_class); - }; - - assertNext("5", "log", "log-level"); - assertNext("7", "debug", "log-level"); - assertNext("9", "info", "log-level"); - assertNext("11", "warn", "warning-level"); - assertNext("13", "error", "error-level"); - assertNext("15", "Message format number 1, 2 and 3.5"); - assertNext("17", "Message format for string"); - assertNext("19", "Object Object"); - assertNext("22", "repeated", "log-level", 5); - assertNext("26", "count: 1"); - assertNext("26", "count: 2"); - assertNext("29", "group", "group-title"); - index++; - assertNext("33", "timer:", "log-level", "", true); - assertNext("35", "1 2 3", "log-level"); - assertNext("37", "HTMLDocument", "log-level"); - assertNext("39", "<html>", "log-level", "", true); -}; - - -/** - * Tests eval of global objects. - */ -TestSuite.prototype.testEvalGlobal = function() -{ - WebInspector.showConsole(); - - var inputs = ["foo", "foobar"]; - var expectations = ["foo", "fooValue", "foobar", "ReferenceError: foobar is not defined"]; - - // Do not change code below - simply add inputs and expectations above. - var initEval = function(input) { - WebInspector.console.prompt.text = input; - WebInspector.console.promptElement.dispatchEvent( TestSuite.createKeyEvent("Enter")); - }; - var test = this; - var messagesCount = 0; - var inputIndex = 0; - this.addSniffer(WebInspector.ConsoleView.prototype, "addMessage", - function(commandResult) { - messagesCount++; - if (messagesCount === expectations.length) { - var messages = WebInspector.console.messages; - for (var i = 0; i < expectations; ++i) { - var elem = messages[i++].toMessageElement(); - test.assertEquals(elem.textContent, expectations[i]); - } - test.releaseControl(); - } else if (messagesCount % 2 === 0) - initEval(inputs[inputIndex++]); - }, true); - - initEval(inputs[inputIndex++]); - this.takeControl(); -}; - - -/** * Tests the message loop re-entrancy. */ TestSuite.prototype.testMessageLoopReentrant = function() diff --git a/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp new file mode 100644 index 0000000..1b7f156 --- /dev/null +++ b/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -0,0 +1,165 @@ +/* + * 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 "IDBBindingUtilities.h" +#include "IDBKey.h" +#include "IDBKeyPath.h" +#include "SerializedScriptValue.h" + +#include <gtest/gtest.h> +#include <wtf/Vector.h> + +#if ENABLE(INDEXED_DATABASE) + +using namespace WebCore; + +namespace { + +class LocalContext { +public: + LocalContext() + : m_context(v8::Context::New()) + { + m_context->Enter(); + } + + virtual ~LocalContext() + { + m_context->Exit(); + m_context.Dispose(); + } + +private: + v8::Locker m_locker; + v8::HandleScope m_scope; + v8::Persistent<v8::Context> m_context; +}; + +PassRefPtr<IDBKey> checkKeyFromValueAndKeyPathInternal(SerializedScriptValue* value, const String& keyPath) +{ + Vector<IDBKeyPathElement> idbKeyPath; + IDBKeyPathParseError parseError; + IDBParseKeyPath(keyPath, idbKeyPath, parseError); + EXPECT_EQ(IDBKeyPathParseErrorNone, parseError); + return createIDBKeyFromSerializedValueAndKeyPath(value, idbKeyPath); +} + +void checkKeyPathNullValue(SerializedScriptValue* value, const String& keyPath) +{ + RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath); + ASSERT_FALSE(idbKey.get()); +} + +void checkKeyPathStringValue(SerializedScriptValue* value, const String& keyPath, const String& expected) +{ + RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath); + ASSERT_TRUE(idbKey.get()); + ASSERT_EQ(IDBKey::StringType, idbKey->type()); + ASSERT_TRUE(expected == idbKey->string()); +} + +void checkKeyPathNumberValue(SerializedScriptValue* value, const String& keyPath, int expected) +{ + RefPtr<IDBKey> idbKey = checkKeyFromValueAndKeyPathInternal(value, keyPath); + ASSERT_TRUE(idbKey.get()); + ASSERT_EQ(IDBKey::NumberType, idbKey->type()); + ASSERT_TRUE(expected == idbKey->number()); +} + +TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue) +{ + LocalContext v8context; + v8::Local<v8::Object> object = v8::Object::New(); + object->Set(v8::String::New("foo"), v8::String::New("zoo")); + + RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object); + + checkKeyPathStringValue(serializedScriptValue.get(), "foo", "zoo"); + checkKeyPathNullValue(serializedScriptValue.get(), "bar"); + checkKeyPathNullValue(serializedScriptValue.get(), "[3]"); +} + +TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue) +{ + LocalContext v8context; + v8::Local<v8::Object> object = v8::Object::New(); + object->Set(v8::String::New("foo"), v8::Number::New(456)); + + RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object); + + checkKeyPathNumberValue(serializedScriptValue.get(), "foo", 456); + checkKeyPathNullValue(serializedScriptValue.get(), "bar"); + checkKeyPathNullValue(serializedScriptValue.get(), "[3]"); +} + +TEST(IDBKeyFromValueAndKeyPathTest, TopLevelArrayElement) +{ + LocalContext v8context; + v8::Local<v8::Array> array = v8::Array::New(); + array->Set(3, v8::String::New("zoo")); + + RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(array); + + checkKeyPathStringValue(serializedScriptValue.get(), "[3]", "zoo"); + checkKeyPathNullValue(serializedScriptValue.get(), "foo"); + checkKeyPathNullValue(serializedScriptValue.get(), "bar"); +} + +TEST(IDBKeyFromValueAndKeyPathTest, SubProperty) +{ + LocalContext v8context; + v8::Local<v8::Object> object = v8::Object::New(); + v8::Local<v8::Object> subProperty = v8::Object::New(); + subProperty->Set(v8::String::New("bar"), v8::String::New("zee")); + object->Set(v8::String::New("foo"), subProperty); + + RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object); + + checkKeyPathStringValue(serializedScriptValue.get(), "foo.bar", "zee"); + checkKeyPathNullValue(serializedScriptValue.get(), "bar"); + checkKeyPathNullValue(serializedScriptValue.get(), "[3]"); +} + +TEST(IDBKeyFromValueAndKeyPathTest, Array2D) +{ + LocalContext v8context; + v8::Local<v8::Object> object = v8::Object::New(); + v8::Local<v8::Array> array = v8::Array::New(); + v8::Local<v8::Array> subArray = v8::Array::New(); + subArray->Set(7, v8::String::New("zee")); + array->Set(3, subArray); + object->Set(v8::String::New("foo"), array); + + RefPtr<SerializedScriptValue> serializedScriptValue = SerializedScriptValue::create(object); + + checkKeyPathStringValue(serializedScriptValue.get(), "foo[3][7]", "zee"); + checkKeyPathNullValue(serializedScriptValue.get(), "bar"); + checkKeyPathNullValue(serializedScriptValue.get(), "[4]"); +} + +} // namespace + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/tests/IDBKeyPathTest.cpp b/WebKit/chromium/tests/IDBKeyPathTest.cpp new file mode 100644 index 0000000..ac10f4f --- /dev/null +++ b/WebKit/chromium/tests/IDBKeyPathTest.cpp @@ -0,0 +1,205 @@ +/* + * 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 "IDBKeyPath.h" + +#include <gtest/gtest.h> +#include <wtf/Vector.h> + +#if ENABLE(INDEXED_DATABASE) + +using namespace WebCore; + +namespace { + +IDBKeyPathElement ExpectedToken(const String& identifier, bool isIndexed, int index) +{ + IDBKeyPathElement expected; + if (isIndexed) { + expected.type = IDBKeyPathElement::IsIndexed; + expected.index = index; + } else { + expected.type = IDBKeyPathElement::IsNamed; + expected.identifier = identifier; + } + return expected; +} + +void checkKeyPath(const String& keyPath, const Vector<IDBKeyPathElement>& expected, int parserError) +{ + + IDBKeyPathParseError error; + Vector<IDBKeyPathElement> idbKeyPathElements; + IDBParseKeyPath(keyPath, idbKeyPathElements, error); + ASSERT_EQ(parserError, error); + if (error != IDBKeyPathParseErrorNone) + return; + ASSERT_EQ(expected.size(), idbKeyPathElements.size()); + for (int i = 0; i < expected.size(); ++i) { + ASSERT_TRUE(expected[i].type == idbKeyPathElements[i].type) << i; + if (expected[i].type == IDBKeyPathElement::IsIndexed) + ASSERT_EQ(expected[i].index, idbKeyPathElements[i].index) << i; + else if (expected[i].type == IDBKeyPathElement::IsNamed) + ASSERT_TRUE(expected[i].identifier == idbKeyPathElements[i].identifier) << i; + else + ASSERT_TRUE(false) << "Invalid IDBKeyPathElement type"; + } +} + +TEST(IDBKeyPathTest, ValidKeyPath0) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("foo.bar.zoo"); + expected.append(ExpectedToken("foo", false, 0)); + expected.append(ExpectedToken("bar", false, 0)); + expected.append(ExpectedToken("zoo", false, 0)); + checkKeyPath(keyPath, expected, 0); +} + +TEST(IDBKeyPathTest, ValidKeyPath1) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[34][20].foo[2].bar"); + expected.append(ExpectedToken("a", false, 0)); + expected.append(ExpectedToken(String(), true, 34)); + expected.append(ExpectedToken(String(), true, 20)); + expected.append(ExpectedToken("foo", false, 0)); + expected.append(ExpectedToken(String(), true, 2)); + expected.append(ExpectedToken("bar", false, 0)); + checkKeyPath(keyPath, expected, 0); +} + +TEST(IDBKeyPathTest, ValidKeyPath2) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("foo[ 34 ].Zoo_[00023]\t._c"); + expected.append(ExpectedToken("foo", false, 0)); + expected.append(ExpectedToken(String(), true, 34)); + expected.append(ExpectedToken("Zoo_", false, 0)); + expected.append(ExpectedToken(String(), true, 23)); + expected.append(ExpectedToken("_c", false, 0)); + checkKeyPath(keyPath, expected, 0); +} + +TEST(IDBKeyPathTest, ValidKeyPath3) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("foo[ 34 ]"); + expected.append(ExpectedToken("foo", false, 0)); + expected.append(ExpectedToken(String(), true, 34)); + checkKeyPath(keyPath, expected, 0); +} + +TEST(IDBKeyPathTest, ValidKeyPath4) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("[ 34 ]"); + expected.append(ExpectedToken(String(), true, 34)); + checkKeyPath(keyPath, expected, 0); +} + +TEST(IDBKeyPathTest, InvalidKeyPath2) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[[34]].b[2].c"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 3); +} + +TEST(IDBKeyPathTest, InvalidKeyPath3) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[[34].b[2].c"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 3); +} + +TEST(IDBKeyPathTest, InvalidKeyPath5) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[[34.b[2].c"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 3); +} + +TEST(IDBKeyPathTest, InvalidKeyPath6) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("+a[34].b[2].c"); + checkKeyPath(keyPath, expected, 1); +} + +TEST(IDBKeyPathTest, InvalidKeyPath7) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("%a[34].b[2].c"); + checkKeyPath(keyPath, expected, 1); +} + +TEST(IDBKeyPathTest, InvalidKeyPath8) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a{[34]}.b[2].c"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 2); +} + +TEST(IDBKeyPathTest, InvalidKeyPath9) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a..b[2].c"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 5); +} + +TEST(IDBKeyPathTest, InvalidKeyPath10) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[34]b.foo[2].bar"); + expected.append(ExpectedToken("a", false, 0)); + expected.append(ExpectedToken(String(), true, 34)); + checkKeyPath(keyPath, expected, 4); +} + +TEST(IDBKeyPathTest, InvalidKeyPath11) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[-1]"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 3); +} + +TEST(IDBKeyPathTest, InvalidKeyPath12) +{ + Vector<IDBKeyPathElement> expected; + String keyPath("a[9999999999999999999999999999999999]"); + expected.append(ExpectedToken("a", false, 0)); + checkKeyPath(keyPath, expected, 3); +} + +} // namespace + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/tests/TilingDataTest.cpp b/WebKit/chromium/tests/TilingDataTest.cpp new file mode 100755 index 0000000..463542b --- /dev/null +++ b/WebKit/chromium/tests/TilingDataTest.cpp @@ -0,0 +1,223 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "GLES2Texture.h" +#include <gtest/gtest.h> + +using namespace WebCore; + +namespace { + +TEST(TilingDataTest, numTiles_NoTiling) +{ + EXPECT_EQ(1, TilingData(16, 16, 16, false).numTiles()); + EXPECT_EQ(1, TilingData(16, 15, 15, true).numTiles()); + EXPECT_EQ(1, TilingData(16, 16, 16, true).numTiles()); + EXPECT_EQ(1, TilingData(16, 1, 16, false).numTiles()); + EXPECT_EQ(1, TilingData(15, 15, 15, true).numTiles()); +} + +TEST(TilingDataTest, numTiles_TilingNoBorders) +{ + EXPECT_EQ(1, TilingData(4, 1, 4, false).numTiles()); + EXPECT_EQ(1, TilingData(4, 2, 4, false).numTiles()); + EXPECT_EQ(1, TilingData(4, 3, 4, false).numTiles()); + EXPECT_EQ(1, TilingData(4, 4, 4, false).numTiles()); + EXPECT_EQ(2, TilingData(4, 5, 4, false).numTiles()); + EXPECT_EQ(2, TilingData(4, 6, 4, false).numTiles()); + EXPECT_EQ(2, TilingData(4, 7, 4, false).numTiles()); + EXPECT_EQ(2, TilingData(4, 8, 4, false).numTiles()); + EXPECT_EQ(3, TilingData(4, 9, 4, false).numTiles()); + EXPECT_EQ(3, TilingData(4, 10, 4, false).numTiles()); + EXPECT_EQ(3, TilingData(4, 11, 4, false).numTiles()); + + EXPECT_EQ(1, TilingData(5, 1, 5, false).numTiles()); + EXPECT_EQ(1, TilingData(5, 2, 5, false).numTiles()); + EXPECT_EQ(1, TilingData(5, 3, 5, false).numTiles()); + EXPECT_EQ(1, TilingData(5, 4, 5, false).numTiles()); + EXPECT_EQ(1, TilingData(5, 5, 5, false).numTiles()); + EXPECT_EQ(2, TilingData(5, 6, 5, false).numTiles()); + EXPECT_EQ(2, TilingData(5, 7, 5, false).numTiles()); + EXPECT_EQ(2, TilingData(5, 8, 5, false).numTiles()); + EXPECT_EQ(2, TilingData(5, 9, 5, false).numTiles()); + EXPECT_EQ(2, TilingData(5, 10, 5, false).numTiles()); + EXPECT_EQ(3, TilingData(5, 11, 5, false).numTiles()); + + EXPECT_EQ(1, TilingData(16, 16, 16, false).numTiles()); + EXPECT_EQ(1, TilingData(17, 16, 16, false).numTiles()); + EXPECT_EQ(4, TilingData(15, 16, 16, false).numTiles()); + EXPECT_EQ(4, TilingData(8, 16, 16, false).numTiles()); + EXPECT_EQ(6, TilingData(8, 17, 16, false).numTiles()); +} + +TEST(TilingDataTest, numTiles_TilingWithBorders) +{ + EXPECT_EQ(1, TilingData(3, 1, 3, true).numTiles()); + EXPECT_EQ(1, TilingData(3, 2, 3, true).numTiles()); + EXPECT_EQ(1, TilingData(3, 3, 3, true).numTiles()); + EXPECT_EQ(2, TilingData(3, 4, 3, true).numTiles()); + EXPECT_EQ(3, TilingData(3, 5, 3, true).numTiles()); + EXPECT_EQ(4, TilingData(3, 6, 3, true).numTiles()); + EXPECT_EQ(5, TilingData(3, 7, 3, true).numTiles()); + + EXPECT_EQ(1, TilingData(4, 1, 4, true).numTiles()); + EXPECT_EQ(1, TilingData(4, 2, 4, true).numTiles()); + EXPECT_EQ(1, TilingData(4, 3, 4, true).numTiles()); + EXPECT_EQ(1, TilingData(4, 4, 4, true).numTiles()); + EXPECT_EQ(2, TilingData(4, 5, 4, true).numTiles()); + EXPECT_EQ(2, TilingData(4, 6, 4, true).numTiles()); + EXPECT_EQ(3, TilingData(4, 7, 4, true).numTiles()); + EXPECT_EQ(3, TilingData(4, 8, 4, true).numTiles()); + EXPECT_EQ(4, TilingData(4, 9, 4, true).numTiles()); + EXPECT_EQ(4, TilingData(4, 10, 4, true).numTiles()); + EXPECT_EQ(5, TilingData(4, 11, 4, true).numTiles()); + + EXPECT_EQ(1, TilingData(5, 1, 5, true).numTiles()); + EXPECT_EQ(1, TilingData(5, 2, 5, true).numTiles()); + EXPECT_EQ(1, TilingData(5, 3, 5, true).numTiles()); + EXPECT_EQ(1, TilingData(5, 4, 5, true).numTiles()); + EXPECT_EQ(1, TilingData(5, 5, 5, true).numTiles()); + EXPECT_EQ(2, TilingData(5, 6, 5, true).numTiles()); + EXPECT_EQ(2, TilingData(5, 7, 5, true).numTiles()); + EXPECT_EQ(2, TilingData(5, 8, 5, true).numTiles()); + EXPECT_EQ(3, TilingData(5, 9, 5, true).numTiles()); + EXPECT_EQ(3, TilingData(5, 10, 5, true).numTiles()); + EXPECT_EQ(3, TilingData(5, 11, 5, true).numTiles()); +} + +TEST(TilingDataTest, tileXIndexFromSrcCoord) +{ + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(0)); + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(1)); + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(2)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(3)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(4)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(5)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(6)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(7)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(8)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(9)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(10)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileXIndexFromSrcCoord(11)); + + EXPECT_EQ(0, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(0)); + EXPECT_EQ(0, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(1)); + EXPECT_EQ(1, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(2)); + EXPECT_EQ(2, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(3)); + EXPECT_EQ(3, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(4)); + EXPECT_EQ(4, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(5)); + EXPECT_EQ(5, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(6)); + EXPECT_EQ(6, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(7)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(8)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(9)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(10)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileXIndexFromSrcCoord(11)); +} +TEST(TilingDataTest, tileYIndexFromSrcCoord) +{ + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(0)); + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(1)); + EXPECT_EQ(0, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(2)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(3)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(4)); + EXPECT_EQ(1, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(5)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(6)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(7)); + EXPECT_EQ(2, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(8)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(9)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(10)); + EXPECT_EQ(3, TilingData(3, 10, 10, false).tileYIndexFromSrcCoord(11)); + + EXPECT_EQ(0, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(0)); + EXPECT_EQ(0, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(1)); + EXPECT_EQ(1, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(2)); + EXPECT_EQ(2, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(3)); + EXPECT_EQ(3, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(4)); + EXPECT_EQ(4, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(5)); + EXPECT_EQ(5, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(6)); + EXPECT_EQ(6, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(7)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(8)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(9)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(10)); + EXPECT_EQ(7, TilingData(3, 10, 10, true).tileYIndexFromSrcCoord(11)); +} + +TEST(TilingDataTest, tileSizeX) +{ + EXPECT_EQ(5, TilingData(5, 5, 5, false).tileSizeX(0)); + EXPECT_EQ(5, TilingData(5, 5, 5, true).tileSizeX(0)); + + EXPECT_EQ(5, TilingData(5, 6, 6, false).tileSizeX(0)); + EXPECT_EQ(1, TilingData(5, 6, 6, false).tileSizeX(1)); + EXPECT_EQ(4, TilingData(5, 6, 6, true).tileSizeX(0)); + EXPECT_EQ(2, TilingData(5, 6, 6, true).tileSizeX(1)); + + EXPECT_EQ(5, TilingData(5, 8, 8, false).tileSizeX(0)); + EXPECT_EQ(3, TilingData(5, 8, 8, false).tileSizeX(1)); + EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeX(0)); + EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeX(1)); + + EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeX(0)); + EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeX(1)); + EXPECT_EQ(4, TilingData(5, 10, 10, true).tileSizeX(0)); + EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeX(1)); + EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeX(2)); + + EXPECT_EQ(4, TilingData(5, 11, 11, true).tileSizeX(2)); + EXPECT_EQ(3, TilingData(5, 12, 12, true).tileSizeX(2)); +} +TEST(TilingDataTest, tileSizeY) +{ + EXPECT_EQ(5, TilingData(5, 5, 5, false).tileSizeY(0)); + EXPECT_EQ(5, TilingData(5, 5, 5, true).tileSizeY(0)); + + EXPECT_EQ(5, TilingData(5, 6, 6, false).tileSizeY(0)); + EXPECT_EQ(1, TilingData(5, 6, 6, false).tileSizeY(1)); + EXPECT_EQ(4, TilingData(5, 6, 6, true).tileSizeY(0)); + EXPECT_EQ(2, TilingData(5, 6, 6, true).tileSizeY(1)); + + EXPECT_EQ(5, TilingData(5, 8, 8, false).tileSizeY(0)); + EXPECT_EQ(3, TilingData(5, 8, 8, false).tileSizeY(1)); + EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeY(0)); + EXPECT_EQ(4, TilingData(5, 8, 8, true).tileSizeY(1)); + + EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeY(0)); + EXPECT_EQ(5, TilingData(5, 10, 10, false).tileSizeY(1)); + EXPECT_EQ(4, TilingData(5, 10, 10, true).tileSizeY(0)); + EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeY(1)); + EXPECT_EQ(3, TilingData(5, 10, 10, true).tileSizeY(2)); + + EXPECT_EQ(4, TilingData(5, 11, 11, true).tileSizeY(2)); + EXPECT_EQ(3, TilingData(5, 12, 12, true).tileSizeY(2)); +} + +} // namespace diff --git a/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp b/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp new file mode 100644 index 0000000..7cd4837 --- /dev/null +++ b/WebKit/chromium/tests/WebInputEventFactoryTestGtk.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include <gdk/gdk.h> +#include <gtest/gtest.h> + +#include "WebInputEvent.h" +#include "WebInputEventFactory.h" + +using WebKit::WebMouseEvent; +using WebKit::WebInputEventFactory; + +namespace { + +TEST(WebInputEventFactoryTest, DoubleClick) +{ + GdkEventButton firstClick; + firstClick.type = GDK_BUTTON_PRESS; + firstClick.window = static_cast<GdkWindow*>(GINT_TO_POINTER(1)); + firstClick.x = firstClick.y = firstClick.x_root = firstClick.y_root = 100; + firstClick.state = 0; + firstClick.time = 0; + firstClick.button = 1; + + // Single click works. + WebMouseEvent firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick); + EXPECT_EQ(1, firstClickEvent.clickCount); + + // Make sure double click works. + GdkEventButton secondClick = firstClick; + secondClick.time = firstClick.time + 100; + WebMouseEvent secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick); + EXPECT_EQ(2, secondClickEvent.clickCount); + + // Reset the click count. + firstClick.time += 10000; + firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick); + EXPECT_EQ(1, firstClickEvent.clickCount); + + // Two clicks with a long gap in between aren't counted as a double click. + secondClick = firstClick; + secondClick.time = firstClick.time + 1000; + secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick); + EXPECT_EQ(1, secondClickEvent.clickCount); + + // Reset the click count. + firstClick.time += 10000; + firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick); + EXPECT_EQ(1, firstClickEvent.clickCount); + + // Two clicks far apart (horizontally) aren't counted as a double click. + secondClick = firstClick; + secondClick.time = firstClick.time + 1; + secondClick.x = firstClick.x + 100; + secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick); + EXPECT_EQ(1, secondClickEvent.clickCount); + + // Reset the click count. + firstClick.time += 10000; + firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick); + EXPECT_EQ(1, firstClickEvent.clickCount); + + // Two clicks far apart (vertically) aren't counted as a double click. + secondClick = firstClick; + secondClick.time = firstClick.time + 1; + secondClick.x = firstClick.y + 100; + secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick); + EXPECT_EQ(1, secondClickEvent.clickCount); + + // Reset the click count. + firstClick.time += 10000; + firstClickEvent = WebInputEventFactory::mouseEvent(&firstClick); + EXPECT_EQ(1, firstClickEvent.clickCount); + + // Two clicks on different windows aren't a double click. + secondClick = firstClick; + secondClick.time = firstClick.time + 1; + secondClick.window = static_cast<GdkWindow*>(GINT_TO_POINTER(2)); + secondClickEvent = WebInputEventFactory::mouseEvent(&secondClick); + EXPECT_EQ(1, secondClickEvent.clickCount); +} + +} // anonymous namespace diff --git a/WebKit/efl/CMakeListsEfl.txt b/WebKit/efl/CMakeListsEfl.txt index f6b96fd..e5fb9ef 100644 --- a/WebKit/efl/CMakeListsEfl.txt +++ b/WebKit/efl/CMakeListsEfl.txt @@ -73,10 +73,74 @@ IF (WTF_USE_CURL) ENDIF () FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme) -GENERATE_EDJ( +SET(WebKit_THEME ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj) +ADD_CUSTOM_COMMAND( + OUTPUT ${WebKit_THEME} + COMMAND ${EDJE_CC_EXECUTABLE} -v -id ${WEBKIT_DIR}/efl/DefaultTheme ${WEBKIT_DIR}/efl/DefaultTheme/default.edc ${WebKit_THEME} + DEPENDS ${WEBKIT_DIR}/efl/DefaultTheme/default.edc - ${CMAKE_BINARY_DIR}/WebKit/efl/DefaultTheme/default.edj - "-id;${WEBKIT_DIR}/efl/DefaultTheme" + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_press_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_press_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_knob_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_fill_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_fill_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/slider/slider_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_focus_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_press.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/icon.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_normal.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_normal_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_hover_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/combo/combo_press_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/decoration/search_decoration.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_hovered.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/search_field.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_normal.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/field/field_focused.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/search/cancel/search_cancel.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/check.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_off.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/check/img_check_on.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/radio.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_off.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/radio/img_radio_on_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_normal.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_press.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/img_button_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/button/button.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/entry.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_normal.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_focused.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/entry/img_hovered.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/scrollbar/scrollbar.edc + ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_normal.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_press.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_hover.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file_focus.png + ${WEBKIT_DIR}/efl/DefaultTheme/widget/file/file.edc + VERBATIM ) SET(EWebLauncher_SOURCES diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog index 0a627e7..de65885 100644 --- a/WebKit/efl/ChangeLog +++ b/WebKit/efl/ChangeLog @@ -1,3 +1,140 @@ +2010-08-15 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Antonio Gomes. + + [EFL] Enable localStorage of HTML5 for WebKit EFL + https://bugs.webkit.org/show_bug.cgi?id=44020 + + * ewk/ewk_view.cpp: + (_ewk_view_priv_new): + +2010-08-11 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Adding new theme for widgets. + https://bugs.webkit.org/show_bug.cgi?id=43860 + + Original theme was there for a long time. This is a new + fresh one. + + * DefaultTheme/default.edc: + * DefaultTheme/widget/button/button.edc: + * DefaultTheme/widget/button/img_button_focus.png: + * DefaultTheme/widget/button/img_button_hover.png: + * DefaultTheme/widget/button/img_button_normal.png: + * DefaultTheme/widget/button/img_button_press.png: + * DefaultTheme/widget/check/check.edc: + * DefaultTheme/widget/check/img_check_off.png: + * DefaultTheme/widget/check/img_check_off_focus.png: + * DefaultTheme/widget/check/img_check_off_hover.png: + * DefaultTheme/widget/check/img_check_on.png: + * DefaultTheme/widget/check/img_check_on_focus.png: + * DefaultTheme/widget/check/img_check_on_hover.png: + * DefaultTheme/widget/combo/combo.edc: + * DefaultTheme/widget/combo/combo_focus.png: + * DefaultTheme/widget/combo/combo_focus_button.png: + * DefaultTheme/widget/combo/combo_hover.png: + * DefaultTheme/widget/combo/combo_hover_button.png: + * DefaultTheme/widget/combo/combo_normal.png: + * DefaultTheme/widget/combo/combo_normal_button.png: + * DefaultTheme/widget/combo/combo_press.png: + * DefaultTheme/widget/combo/combo_press_button.png: + * DefaultTheme/widget/combo/icon.png: + * DefaultTheme/widget/entry/img_focused.png: + * DefaultTheme/widget/entry/img_hovered.png: + * DefaultTheme/widget/entry/img_normal.png: + * DefaultTheme/widget/file/file_focus.png: + * DefaultTheme/widget/file/file_hover.png: + * DefaultTheme/widget/file/file_normal.png: + * DefaultTheme/widget/file/file_press.png: + * DefaultTheme/widget/radio/img_radio_off.png: + * DefaultTheme/widget/radio/img_radio_off_focus.png: + * DefaultTheme/widget/radio/img_radio_off_hover.png: + * DefaultTheme/widget/radio/img_radio_on.png: + * DefaultTheme/widget/radio/img_radio_on_focus.png: + * DefaultTheme/widget/radio/img_radio_on_hover.png: + * DefaultTheme/widget/radio/radio.edc: + * DefaultTheme/widget/scrollbar/scrollbar.edc: + * DefaultTheme/widget/scrollbar/scrollbar_h.png: + * DefaultTheme/widget/scrollbar/scrollbar_hilight.png: Removed. + * DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: + * DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: + * DefaultTheme/widget/scrollbar/scrollbar_v.png: + * DefaultTheme/widget/search/cancel/cancel_normal_button2.png: + * DefaultTheme/widget/search/decoration/decoration_normal_button.png: + * DefaultTheme/widget/search/field/field_focused.png: + * DefaultTheme/widget/search/field/field_hovered.png: + * DefaultTheme/widget/search/field/field_normal.png: + * DefaultTheme/widget/slider/slider.edc: + * DefaultTheme/widget/slider/slider_fill_h.png: Added. + * DefaultTheme/widget/slider/slider_fill_v.png: Added. + * DefaultTheme/widget/slider/slider_h.png: + * DefaultTheme/widget/slider/slider_hilight.png: Removed. + * DefaultTheme/widget/slider/slider_knob_h.png: + * DefaultTheme/widget/slider/slider_knob_press_h.png: Added. + * DefaultTheme/widget/slider/slider_knob_press_v.png: Added. + * DefaultTheme/widget/slider/slider_knob_v.png: + * DefaultTheme/widget/slider/slider_v.png: + +2010-08-12 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Making CMake keep track of theme dependencies. + https://bugs.webkit.org/show_bug.cgi?id=43862 + + Adding theme source files and images as dependencies of the theme. + + * CMakeListsEfl.txt: + +2010-08-11 Rafael Antognolli <antognolli@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Add setting for enabling spatial navigation. + https://bugs.webkit.org/show_bug.cgi?id=43569 + + Adding api for enabling/disabling spatial navigation. + + * ewk/ewk_view.cpp: Both functions below added. + (ewk_view_setting_spatial_navigation_get): + (ewk_view_setting_spatial_navigation_set): + * ewk/ewk_view.h: same as ewk_view.cpp. + +2010-08-11 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Antonio Gomes. + + Implementation dispatchDecidePolicyForNavigationAction + https://bugs.webkit.org/show_bug.cgi?id=43544 + + Add ewk_view_navigation_policy_decision to decide whether url which + user clicked will be loaded or not. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction): + * ewk/ewk_private.h: + * ewk/ewk_view.cpp: + (ewk_view_navigation_policy_decision): + * ewk/ewk_view.h: + +2010-08-10 Ryuan Choi <ryuan.choi@samsung.com> + + Unreviewed build fix. + + [EFL]REGRESSION(65021) need to fix build break + https://bugs.webkit.org/show_bug.cgi?id=43767 + + Remove AtomicStringWTF and change namespace TextCaseInsensitive. + + * ewk/ewk_frame.cpp: + (ewk_frame_plugin_create): + * ewk/ewk_view.cpp: + (ewk_view_text_search): + (ewk_view_text_matches_mark): + (ewk_view_setting_font_cursive_set): + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/efl/DefaultTheme/default.edc b/WebKit/efl/DefaultTheme/default.edc index 82b6882..e9f55f0 100644 --- a/WebKit/efl/DefaultTheme/default.edc +++ b/WebKit/efl/DefaultTheme/default.edc @@ -23,16 +23,16 @@ color_classes { color_class { name: "webkit/selection/active"; color: 255 255 255 255; /* foreground */ - color2: 32 0 200 255; /* background */ + color2: 86 86 209 255; /* background */ } color_class { name: "webkit/selection/inactive"; color: 255 255 255 255; /* foreground */ - color2: 128 0 255 128; /* background */ + color2: 0 0 128 128; /* background */ } color_class { name: "webkit/focus_ring"; - color: 26 182 240 255; /* foreground */ + color: 26 26 226 255; /* foreground */ /* no background, consider transparent */ } color_class { diff --git a/WebKit/efl/DefaultTheme/widget/button/button.edc b/WebKit/efl/DefaultTheme/widget/button/button.edc index 603daa0..78cc72a 100644 --- a/WebKit/efl/DefaultTheme/widget/button/button.edc +++ b/WebKit/efl/DefaultTheme/widget/button/button.edc @@ -64,10 +64,10 @@ type: IMAGE; description { state: "default" 0.0; - min: 25 10; + min: 25 25; image { normal: "widget/button/img_button_normal.png"; - border: 6 6 6 6; + border: 6 10 8 10; } } description { @@ -75,7 +75,7 @@ inherit: "default" 0.0; image { normal: "widget/button/img_button_press.png"; - border: 8 8 8 8; + border: 6 10 8 10; } } description { @@ -88,7 +88,7 @@ inherit: "default" 0.0; image { normal: "widget/button/img_button_hover.png"; - border: 6 6 6 6; + border: 6 10 8 10; } } description { @@ -96,7 +96,7 @@ inherit: "default" 0.0; image { normal: "widget/button/img_button_focus.png"; - border: 6 6 6 6; + border: 6 10 8 10; } } } @@ -109,11 +109,11 @@ color: 0 0 0 0; rel1 { relative: 0.0 0.0; - offset: 10 5; + offset: 15 8; } rel2 { relative: 1.0 1.0; - offset: -11 -6; + offset: -16 -11; } } } diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png Binary files differindex b9395d3..9e91fe8 100644 --- a/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png +++ b/WebKit/efl/DefaultTheme/widget/button/img_button_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png Binary files differindex 224f966..9e91fe8 100644 --- a/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png +++ b/WebKit/efl/DefaultTheme/widget/button/img_button_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png Binary files differindex b546075..bd9dee9 100644 --- a/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png +++ b/WebKit/efl/DefaultTheme/widget/button/img_button_normal.png diff --git a/WebKit/efl/DefaultTheme/widget/button/img_button_press.png b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png Binary files differindex 7434179..b8b5163 100644 --- a/WebKit/efl/DefaultTheme/widget/button/img_button_press.png +++ b/WebKit/efl/DefaultTheme/widget/button/img_button_press.png diff --git a/WebKit/efl/DefaultTheme/widget/check/check.edc b/WebKit/efl/DefaultTheme/widget/check/check.edc index 86490f6..0e09303 100644 --- a/WebKit/efl/DefaultTheme/widget/check/check.edc +++ b/WebKit/efl/DefaultTheme/widget/check/check.edc @@ -22,7 +22,7 @@ group { name: "webkit/widget/checkbox"; - min: 14 14; + min: 12 12; images { image: "widget/check/img_check_on.png" COMP; @@ -71,8 +71,8 @@ type: IMAGE; description { state: "default" 0.0; - min: 14 14; - max: 14 14; + min: 12 12; + max: 12 12; image { normal: "widget/check/img_check_off.png"; } diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png Binary files differindex 4353276..167fa4e 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_off.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off.png diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png Binary files differindex 3d30818..18bee2a 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png Binary files differindex 6f397db..18bee2a 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_off_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png Binary files differindex 65750a7..87d13ed 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_on.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on.png diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png Binary files differindex 0abf6ee..1f40566 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png Binary files differindex 522c238..1f40566 100644 --- a/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png +++ b/WebKit/efl/DefaultTheme/widget/check/img_check_on_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo.edc b/WebKit/efl/DefaultTheme/widget/combo/combo.edc index 9c436cc..d101d60 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo.edc +++ b/WebKit/efl/DefaultTheme/widget/combo/combo.edc @@ -104,7 +104,7 @@ group { min: 36 20; image { normal: "widget/combo/combo_normal.png"; - border: 7 7 7 7; + border: 15 0 8 11; } } description { @@ -117,7 +117,7 @@ group { inherit: "default" 0.0; image { normal: "widget/combo/combo_hover.png"; - border: 7 7 7 7; + border: 15 0 8 11; } } description { @@ -125,7 +125,7 @@ group { inherit: "default" 0.0; image { normal: "widget/combo/combo_focus.png"; - border: 7 7 7 7; + border: 15 0 8 11; } } description { @@ -133,7 +133,7 @@ group { inherit: "default" 0.0; image { normal: "widget/combo/combo_press.png"; - border: 7 7 7 7; + border: 15 0 8 11; } } } @@ -165,7 +165,7 @@ group { rel1.to: "bt_combo_clipper"; image { normal: "widget/combo/combo_normal_button.png"; - border: 3 5 5 5; + border: 1 15 8 10; } } description { @@ -180,7 +180,7 @@ group { rel1.to: "bt_combo_clipper"; image { normal: "widget/combo/combo_hover_button.png"; - border: 3 5 5 5; + border: 1 15 8 10; } } description { @@ -189,7 +189,7 @@ group { rel1.to: "bt_combo_clipper"; image { normal: "widget/combo/combo_focus_button.png"; - border: 6 7 7 7; + border: 1 15 8 10; } } description { @@ -198,7 +198,7 @@ group { rel1.to: "bt_combo_clipper"; image { normal: "widget/combo/combo_press_button.png"; - border: 6 8 8 8; + border: 1 15 8 10; } } } @@ -210,8 +210,8 @@ group { clip_to: "bt_combo_clipper"; description { state: "default" 0.0; - min: 17 13; - max: 17 13; + min: 12 10; + max: 12 10; color: 255 255 255 150; rel1 { to: "bt_combo_clipper"; @@ -247,11 +247,11 @@ group { color: 0 0 0 0; rel1 { to: "combo_clipper"; - offset: 10 5; + offset: 15 10; } rel2 { to: "combo_clipper"; - offset: -6 -6; + offset: -11 -11; } } } diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png Binary files differindex cfdc309..3b1574b 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png Binary files differindex 9fc2d10..eaf137b 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_focus_button.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png Binary files differindex 9aaa4ee..3b1574b 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png Binary files differindex 1f5c6b8..eaf137b 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_hover_button.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png Binary files differindex 9afe713..fc461a7 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png Binary files differindex d920d90..1cbcb11 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_normal_button.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png Binary files differindex 4b39c70..97c88c5 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_press.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png Binary files differindex da54328..17233af 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png +++ b/WebKit/efl/DefaultTheme/widget/combo/combo_press_button.png diff --git a/WebKit/efl/DefaultTheme/widget/combo/icon.png b/WebKit/efl/DefaultTheme/widget/combo/icon.png Binary files differindex 5d9fb96..1534c2c 100644 --- a/WebKit/efl/DefaultTheme/widget/combo/icon.png +++ b/WebKit/efl/DefaultTheme/widget/combo/icon.png diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_focused.png b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png Binary files differindex 0069d1e..f4b17a9 100644 --- a/WebKit/efl/DefaultTheme/widget/entry/img_focused.png +++ b/WebKit/efl/DefaultTheme/widget/entry/img_focused.png diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png Binary files differindex fbd07af..f4b17a9 100644 --- a/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png +++ b/WebKit/efl/DefaultTheme/widget/entry/img_hovered.png diff --git a/WebKit/efl/DefaultTheme/widget/entry/img_normal.png b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png Binary files differindex 7c5f1cf..88d53f4 100644 --- a/WebKit/efl/DefaultTheme/widget/entry/img_normal.png +++ b/WebKit/efl/DefaultTheme/widget/entry/img_normal.png diff --git a/WebKit/efl/DefaultTheme/widget/file/file_focus.png b/WebKit/efl/DefaultTheme/widget/file/file_focus.png Binary files differindex 55f5bb8..cc93b27 100644 --- a/WebKit/efl/DefaultTheme/widget/file/file_focus.png +++ b/WebKit/efl/DefaultTheme/widget/file/file_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/file/file_hover.png b/WebKit/efl/DefaultTheme/widget/file/file_hover.png Binary files differindex be32454..41285a1 100644 --- a/WebKit/efl/DefaultTheme/widget/file/file_hover.png +++ b/WebKit/efl/DefaultTheme/widget/file/file_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/file/file_normal.png b/WebKit/efl/DefaultTheme/widget/file/file_normal.png Binary files differindex 794eba6..a6d0653 100644 --- a/WebKit/efl/DefaultTheme/widget/file/file_normal.png +++ b/WebKit/efl/DefaultTheme/widget/file/file_normal.png diff --git a/WebKit/efl/DefaultTheme/widget/file/file_press.png b/WebKit/efl/DefaultTheme/widget/file/file_press.png Binary files differindex 4471dc5..f18f8fd 100644 --- a/WebKit/efl/DefaultTheme/widget/file/file_press.png +++ b/WebKit/efl/DefaultTheme/widget/file/file_press.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png Binary files differindex e249d8f..cd64cd8 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png Binary files differindex b25751c..87d31e2 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png Binary files differindex 9096ef8..87d31e2 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_off_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png Binary files differindex b1f4085..b8d8ecb 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png Binary files differindex a28d3dd..bf8a970 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_focus.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png Binary files differindex 3a3a35e..bf8a970 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png +++ b/WebKit/efl/DefaultTheme/widget/radio/img_radio_on_hover.png diff --git a/WebKit/efl/DefaultTheme/widget/radio/radio.edc b/WebKit/efl/DefaultTheme/widget/radio/radio.edc index 38a6da9..f07b9b2 100644 --- a/WebKit/efl/DefaultTheme/widget/radio/radio.edc +++ b/WebKit/efl/DefaultTheme/widget/radio/radio.edc @@ -21,7 +21,7 @@ group { name: "webkit/widget/radio"; - min: 16 16; + min: 12 12; images { image: "widget/radio/img_radio_on.png" COMP; @@ -70,8 +70,8 @@ type: IMAGE; description { state: "default" 0.0; - min: 16 16; - max: 16 16; + min: 12 12; + max: 12 12; image { normal: "widget/radio/img_radio_off.png"; } diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc index 4f59784..b4eead0 100644 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc +++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar.edc @@ -1,7 +1,5 @@ /* 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 @@ -22,7 +20,7 @@ group { name: "scrollbar.vertical"; - min: 10 0; /* if > 0, this is the minimum size that will be allocated. + min: 0 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 */ @@ -85,20 +83,26 @@ group { description { min: 10 0; max: 10 999999; + align: 1.0 0.5; 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; + rel1.to: "rect.base"; + rel2.to: "rect.base"; } description { state: "hidden" 0.0; - color: 255 255 255 128; + color: 255 255 255 64; + rel1.to: "rect.base"; + rel2.to: "rect.base"; } } @@ -109,11 +113,31 @@ group { clip_to: "rect.clipper"; description { state: "default" 0.0; + min: 1 30; + max: 1 999999; + align: 0.5 0.5; image { normal: "widget/scrollbar/scrollbar_v.png"; - border: 0 0 6 6; + border: 0 0 15 15; + middle: SOLID; } - } + rel1.to: "rect.base"; + rel2.to: "rect.base"; + } + } + + part { + name: "rect.knobarea"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 0; + min: 5 5; + max: 5 999999; + align: 0.5 0.5; + rel1.to: "rect.base"; + rel2.to: "rect.base"; + } } part { @@ -124,15 +148,17 @@ group { dragable { x: 0 0 0; y: 1 1 0; - confine: "rect.base"; + confine: "rect.knobarea"; } description { state: "default" 0.0; - min: 10 10; - max: 10 999999; + min: 5 5; + max: 5 999999; + align: 0.5 0.5; image { normal: "widget/scrollbar/scrollbar_knob_v.png"; - border: 0 0 6 6; + border: 3 3 3 3; + middle: SOLID; } } } @@ -171,7 +197,7 @@ group { group { name: "scrollbar.horizontal"; - min: 0 10; /* if > 0, this is the minimum size that will be allocated. + min: 0 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 */ @@ -235,19 +261,25 @@ group { state: "default" 0.0; min: 0 10; max: 999999 10; + align: 0.5 1.0; color: 255 255 255 0; } } + part { name: "rect.clipper"; type: RECT; description { state: "default" 0.0; color: 255 255 255 255; + rel1.to: "rect.base"; + rel2.to: "rect.base"; } description { state: "hidden" 0.0; - color: 255 255 255 128; + color: 255 255 255 64; + rel1.to: "rect.base"; + rel2.to: "rect.base"; } } @@ -258,13 +290,34 @@ group { clip_to: "rect.clipper"; description { state: "default" 0.0; + min: 30 1; + max: 999999 1; + align: 0.5 0.5; image { normal: "widget/scrollbar/scrollbar_h.png"; - border: 6 6 0 0; + border: 15 15 0 0; + middle: SOLID; } + rel1.to: "rect.base"; + rel2.to: "rect.base"; } } + + part { + name: "rect.knobarea"; + type: RECT; + description { + state: "default" 0.0; + color: 255 255 255 0; + min: 5 5; + max: 999999 5; + align: 0.5 0.5; + rel1.to: "rect.base"; + rel2.to: "rect.base"; + } + } + part { name: "img.knob"; type: IMAGE; @@ -273,14 +326,16 @@ group { dragable { x: 1 1 0; y: 0 0 0; - confine: "rect.base"; + confine: "rect.knobarea"; } description { state: "default" 0.0; - min: 10 10; + min: 5 5; + max: 999999 5; image { normal: "widget/scrollbar/scrollbar_knob_h.png"; - border: 6 6 0 0; + border: 3 3 3 3; + middle: SOLID; } } } diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png Binary files differindex 6e55557..6703ea8 100644 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png +++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png Binary files differdeleted file mode 100644 index 1116f4e..0000000 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_hilight.png +++ /dev/null diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png Binary files differindex bc65102..b64d5ce 100644 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png +++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png Binary files differindex db3c685..9aa37ec 100644 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png +++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png diff --git a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png Binary files differindex 9ebdac2..364be0a 100644 --- a/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png +++ b/WebKit/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png diff --git a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png Binary files differindex 5ab4f5b..3120cfb 100644 --- a/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png +++ b/WebKit/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png diff --git a/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png Binary files differindex 3ed2219..6e7f418 100644 --- a/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png +++ b/WebKit/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png Binary files differindex 0069d1e..f4b17a9 100644 --- a/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png +++ b/WebKit/efl/DefaultTheme/widget/search/field/field_focused.png diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png Binary files differindex fbd07af..f4b17a9 100644 --- a/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png +++ b/WebKit/efl/DefaultTheme/widget/search/field/field_hovered.png diff --git a/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png Binary files differindex 7c5f1cf..88d53f4 100644 --- a/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png +++ b/WebKit/efl/DefaultTheme/widget/search/field/field_normal.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider.edc b/WebKit/efl/DefaultTheme/widget/slider/slider.edc index 6c1f6a5..9e339e5 100644 --- a/WebKit/efl/DefaultTheme/widget/slider/slider.edc +++ b/WebKit/efl/DefaultTheme/widget/slider/slider.edc @@ -22,35 +22,65 @@ group { name: "webkit/widget/slider/vertical"; - min: 10 0; /* if > 0, this is the minimum size that will be allocated. + min: 11 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 */ + max: 11 999999; images { image: "widget/slider/slider_v.png" COMP; image: "widget/slider/slider_knob_v.png" COMP; + image: "widget/slider/slider_knob_press_v.png" COMP; + image: "widget/slider/slider_fill_v.png" COMP; } script { - public message(Msg_Type:type, id, ...) { - if ((id == 0) && (type == MSG_FLOAT_SET)) { - new Float:vy, Float:sy; + public isEnabled; + public isPressed; + public isChecked; + public isFocused; + public isHovered; - vy = getfarg(2); - sy = getfarg(3); + public show() { - if (vy >= 0.0) { - set_drag_size(PART:"img.knob", 1.0, sy); - set_drag(PART:"img.knob", 0.0, vy); - } - } - } + if (get_int(isEnabled) == 1) { + set_state(PART:"img.knob", "default", 0.0); + if (get_int(isFocused) == 1) { + set_state(PART:"img.knob", "pressed", 0.0); + if (get_int(isPressed) == 1) + set_state(PART:"img.knob", "pressed", 0.0); + } + else if (get_int(isHovered) == 1) { + set_state(PART:"img.knob", "pressed", 0.0); + if (get_int(isPressed) == 1) + set_state(PART:"img.knob", "pressed", 0.0); + } + } + else + set_state(PART:"img.knob", "default", 0.0); + } - public update_drag_pos() { - new Float:x, Float:y; - get_drag(PART:"img.knob", x, y); - send_message(MSG_FLOAT, 1, y); - } + 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); + run_program(PROGRAM:"show"); + } else + run_program(PROGRAM:"hide"); + } + } + + public update_drag_pos() { + new Float:x, Float:y; + get_drag(PART:"img.knob", x, y); + send_message(MSG_FLOAT, 1, y); + } } parts { @@ -58,8 +88,8 @@ group { name: "rect.base"; type: RECT; description { - min: 10 0; - max: 10 999999; + min: 11 29; + max: 11 999999; state: "default" 0.0; color: 255 255 255 0; } @@ -71,6 +101,10 @@ group { state: "default" 0.0; color: 255 255 255 255; } + description { + state: "hidden" 0.0; + color: 255 255 255 128; + } } part { @@ -80,9 +114,32 @@ group { clip_to: "rect.clipper"; description { state: "default" 0.0; + min: 5 29; + max: 5 999999; + rel1.to: "rect.base"; + rel2.to: "rect.base"; image { normal: "widget/slider/slider_v.png"; - border: 0 0 6 6; + border: 0 0 5 5; + } + } + } + + part { + name: "img.slider_fill"; + type: IMAGE; + mouse_events: 0; + clip_to: "rect.clipper"; + description { + state: "default" 0.0; + min: 5 29; + max: 5 999999; + rel1.to: "img.knob"; + rel2.to: "rect.base"; + align: 0.5 0.5; + image { + normal: "widget/slider/slider_fill_v.png"; + border: 0 0 5 5; } } } @@ -94,22 +151,46 @@ group { clip_to: "rect.clipper"; dragable { x: 0 0 0; - y: 1 1 0; + y: 1 1 1; confine: "rect.base"; } description { state: "default" 0.0; - min: 10 10; - max: 10 999999; + min: 11 29; + align: 0.5 0.5; image { normal: "widget/slider/slider_knob_v.png"; border: 0 0 6 6; } } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + image.normal: "widget/slider/slider_knob_press_v.png"; + } } } programs { program { + name: "load"; + signal: "load"; + action: STATE_SET "hidden" 0.0; + target: "rect.clipper"; + } + program { + name: "hide"; + action: STATE_SET "hidden" 0.0; + transition: ACCELERATE 0.5; + target: "rect.clipper"; + } + + program { + name: "show"; + action: STATE_SET "default" 0.0; + target: "rect.clipper"; + } + + program { name: "dragged"; signal: "drag"; source: "img.knob"; @@ -117,41 +198,124 @@ group { update_drag_pos(); } } + + program { + name: "enabled"; + signal: "enabled"; + script { + set_int(isEnabled, 1); + show(); + } + } + program { + name: "pressed"; + signal: "pressed"; + script { + set_int(isPressed, 1); + show(); + } + } + program { + name: "checked"; + signal: "checked"; + script { + set_int(isChecked, 1); + show(); + } + } + program { + name: "focused"; + signal: "focused"; + script { + set_int(isFocused, 1); + show(); + } + } + program { + name: "hovered"; + signal: "hovered"; + script { + set_int(isHovered, 1); + show(); + } + } + program { + name: "reset"; + signal: "reset"; + script { + set_int(isEnabled, 0); + set_int(isPressed, 0); + set_int(isChecked, 0); + set_int(isFocused, 0); + set_int(isHovered, 0); + show(); + } + } } } group { name: "webkit/widget/slider/horizontal"; - min: 0 10; /* if > 0, this is the minimum size that will be allocated. + min: 0 11; /* if > 0, this is the minimum size that will be allocated. * If wants to draw on top, just overflow usign edje's rel1/rel2 */ + max: 999999 11; images { image: "widget/slider/slider_h.png" COMP; image: "widget/slider/slider_knob_h.png" COMP; + image: "widget/slider/slider_knob_press_h.png" COMP; + image: "widget/slider/slider_fill_h.png" COMP; } script { - public message(Msg_Type:type, id, ...) { - if ((id == 0) && (type == MSG_FLOAT_SET)) { - new Float:vx, Float:sx; + public isEnabled; + public isPressed; + public isChecked; + public isFocused; + public isHovered; - vx = getfarg(2); - sx = getfarg(3); + public show() { - if (vx >= 0.0) { - set_drag_size(PART:"img.knob", sx, 1.0); - set_drag(PART:"img.knob", vx, 0.0); - } - } - } + if (get_int(isEnabled) == 1) { + set_state(PART:"img.knob", "default", 0.0); + if (get_int(isFocused) == 1) { + set_state(PART:"img.knob", "pressed", 0.0); + if (get_int(isPressed) == 1) + set_state(PART:"img.knob", "pressed", 0.0); + } + else if (get_int(isHovered) == 1) { + set_state(PART:"img.knob", "pressed", 0.0); + if (get_int(isPressed) == 1) + set_state(PART:"img.knob", "pressed", 0.0); + } + } + else + set_state(PART:"img.knob", "default", 0.0); + } - public update_drag_pos() { - new Float:x, Float:y; - get_drag(PART:"img.knob", x, y); - send_message(MSG_FLOAT, 1, x); - } + 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); + run_program(PROGRAM:"show"); + } else + run_program(PROGRAM:"hide"); + } + } + + public update_drag_pos() { + new Float:x, Float:y; + get_drag(PART:"img.knob", x, y); + send_message(MSG_FLOAT, 1, x); + } } parts { @@ -160,8 +324,8 @@ group { type: RECT; description { state: "default" 0.0; - min: 0 10; - max: 999999 10; + min: 29 11; + max: 999999 11; color: 255 255 255 0; } } @@ -172,6 +336,10 @@ group { state: "default" 0.0; color: 255 255 255 255; } + description { + state: "hidden" 0.0; + color: 255 255 255 128; + } } part { @@ -181,9 +349,33 @@ group { clip_to: "rect.clipper"; description { state: "default" 0.0; + min: 29 5; + max: 999999 5; + rel1.to: "rect.base"; + rel2.to: "rect.base"; + align: 0.5 0.5; image { normal: "widget/slider/slider_h.png"; - border: 6 6 0 0; + border: 5 5 0 0; + } + } + } + + part { + name: "img.slider_fill"; + type: IMAGE; + mouse_events: 0; + clip_to: "rect.clipper"; + description { + state: "default" 0.0; + min: 29 5; + max: 999999 5; + rel1.to: "rect.base"; + rel2.to: "img.knob"; + align: 0.5 0.5; + image { + normal: "widget/slider/slider_fill_h.png"; + border: 5 5 0 0; } } } @@ -200,16 +392,41 @@ group { } description { state: "default" 0.0; - min: 10 10; + min: 29 11; + align: 0.5 0.5; image { normal: "widget/slider/slider_knob_h.png"; border: 6 6 0 0; } } + description { + state: "pressed" 0.0; + inherit: "default" 0.0; + image.normal: "widget/slider/slider_knob_press_h.png"; + } } } programs { program { + name: "load"; + signal: "load"; + action: STATE_SET "hidden" 0.0; + target: "rect.clipper"; + } + program { + name: "hide"; + action: STATE_SET "hidden" 0.0; + transition: ACCELERATE 0.5; + target: "rect.clipper"; + } + + program { + name: "show"; + action: STATE_SET "default" 0.0; + target: "rect.clipper"; + } + + program { name: "dragged"; signal: "drag"; source: "img.knob"; @@ -217,5 +434,58 @@ group { update_drag_pos(); } } + + program { + name: "enabled"; + signal: "enabled"; + script { + set_int(isEnabled, 1); + show(); + } + } + program { + name: "pressed"; + signal: "pressed"; + script { + set_int(isPressed, 1); + show(); + } + } + program { + name: "checked"; + signal: "checked"; + script { + set_int(isChecked, 1); + show(); + } + } + program { + name: "focused"; + signal: "focused"; + script { + set_int(isFocused, 1); + show(); + } + } + program { + name: "hovered"; + signal: "hovered"; + script { + set_int(isHovered, 1); + show(); + } + } + program { + name: "reset"; + signal: "reset"; + script { + set_int(isEnabled, 0); + set_int(isPressed, 0); + set_int(isChecked, 0); + set_int(isFocused, 0); + set_int(isHovered, 0); + show(); + } + } } } diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png Binary files differnew file mode 100644 index 0000000..abe9d2c --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_h.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png Binary files differnew file mode 100644 index 0000000..5184cad --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_fill_v.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_h.png Binary files differindex 6e55557..befd4a0 100644 --- a/WebKit/efl/DefaultTheme/widget/slider/slider_h.png +++ 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 differdeleted file mode 100644 index 1116f4e..0000000 --- a/WebKit/efl/DefaultTheme/widget/slider/slider_hilight.png +++ /dev/null diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png Binary files differindex bc65102..22454af 100644 --- a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_h.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png Binary files differnew file mode 100644 index 0000000..1421cd8 --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_h.png diff --git a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.png b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.png Binary files differnew file mode 100644 index 0000000..293813c --- /dev/null +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_knob_press_v.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 differindex db3c685..051f3c3 100644 --- a/WebKit/efl/DefaultTheme/widget/slider/slider_knob_v.png +++ 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 differindex 9ebdac2..7243929 100644 --- a/WebKit/efl/DefaultTheme/widget/slider/slider_v.png +++ b/WebKit/efl/DefaultTheme/widget/slider/slider_v.png diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index 5648ec7..499d6c2 100644 --- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -354,9 +354,22 @@ void FrameLoaderClientEfl::dispatchDecidePolicyForNavigationAction(FramePolicyFu ASSERT(m_frame); // if not acceptNavigationRequest - look at Qt -> PolicyIgnore; // FIXME: do proper check and only reset forms when on PolicyIgnore - Frame* f = ewk_frame_core_get(m_frame); - f->loader()->resetMultipleFormSubmissionProtection(); - callPolicyFunction(function, PolicyUse); + char* url = strdup(resourceRequest.url().prettyURL().utf8().data()); + Ewk_Frame_Resource_Request request = { url, 0 }; + Eina_Bool ret = ewk_view_navigation_policy_decision(m_view, &request); + free(url); + + PolicyAction policy; + if (!ret) + policy = PolicyIgnore; + else { + if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) { + Frame* f = ewk_frame_core_get(m_frame); + f->loader()->resetMultipleFormSubmissionProtection(); + } + policy = PolicyUse; + } + callPolicyFunction(function, policy); } PassRefPtr<Widget> FrameLoaderClientEfl::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index fcf5ed3..296c261 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -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<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::StringWTF::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) { return 0; } diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index f69f46c..eaad13c 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -148,6 +148,8 @@ 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<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually); +Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request); + #ifdef __cplusplus } diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index c030c1c..7a98bac 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -106,6 +106,7 @@ struct _Ewk_View_Private_Data { Eina_Bool resizable_textareas:1; Eina_Bool private_browsing:1; Eina_Bool caret_browsing:1; + Eina_Bool spatial_navigation:1; struct { float w; float h; @@ -557,6 +558,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) priv->page_settings->setStandardFontFamily("sans"); priv->page_settings->setJavaScriptEnabled(true); priv->page_settings->setPluginsEnabled(true); + priv->page_settings->setLocalStorageEnabled(true); url = priv->page_settings->userStyleSheetLocation(); priv->settings.user_stylesheet = eina_stringshare_add(url.prettyURL().utf8().data()); @@ -1318,13 +1320,13 @@ Eina_Bool ewk_view_text_search(const Evas_Object* o, const char* string, Eina_Bo EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(string, EINA_FALSE); - WebCore::TextCaseSensitivity sensitive; + WTF::TextCaseSensitivity sensitive; WebCore::FindDirection direction; if (case_sensitive) - sensitive = WebCore::TextCaseSensitive; + sensitive = WTF::TextCaseSensitive; else - sensitive = WebCore::TextCaseInsensitive; + sensitive = WTF::TextCaseInsensitive; if (forward) direction = WebCore::FindDirectionForward; @@ -1350,12 +1352,12 @@ unsigned int ewk_view_text_matches_mark(Evas_Object* o, const char* string, Eina EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, 0); EINA_SAFETY_ON_NULL_RETURN_VAL(string, 0); - WebCore::TextCaseSensitivity sensitive; + WTF::TextCaseSensitivity sensitive; if (case_sensitive) - sensitive = WebCore::TextCaseSensitive; + sensitive = WTF::TextCaseSensitive; else - sensitive = WebCore::TextCaseInsensitive; + sensitive = WTF::TextCaseInsensitive; return priv->page->markAllMatchesForText(WTF::String::fromUTF8(string), sensitive, highlight, limit); } @@ -2528,7 +2530,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)) { - WTF::AtomicStringWTF::AtomicString s = WTF::String::fromUTF8(family); + WTF::AtomicString s = WTF::String::fromUTF8(family); priv->page_settings->setCursiveFontFamily(s); } return EINA_TRUE; @@ -2606,6 +2608,25 @@ Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object* o, const char* famil return EINA_TRUE; } +Eina_Bool ewk_view_setting_spatial_navigation_get(Evas_Object* o) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + return priv->settings.spatial_navigation; +} + +Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enable) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + enable = !!enable; + if (priv->settings.spatial_navigation != enable) { + priv->page_settings->setSpatialNavigationEnabled(enable); + priv->settings.spatial_navigation = enable; + } + return EINA_TRUE; +} + /** * Similar to evas_object_smart_data_get(), but does type checking. * @@ -3980,3 +4001,23 @@ Eina_Bool ewk_view_user_scalable_get(Evas_Object* o) return priv->settings.zoom_range.user_scalable; } + +/** + * @internal + * Reports a requeset will be loaded. It's client responsibility to decide if + * request would be used. If @return is true, loader will try to load. Else, + * Loader ignore action of request. + * + * @param o View to load + * @param request Request which contain url to navigate + */ +Eina_Bool ewk_view_navigation_policy_decision(Evas_Object* o, Ewk_Frame_Resource_Request* request) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_TRUE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, EINA_TRUE); + + if (!sd->api->navigation_policy_decision) + return EINA_TRUE; + + return sd->api->navigation_policy_decision(sd, request); +} diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h index 19a3588..8dd6178 100644 --- a/WebKit/efl/ewk/ewk_view.h +++ b/WebKit/efl/ewk/ewk_view.h @@ -21,6 +21,7 @@ #ifndef ewk_view_h #define ewk_view_h +#include "ewk_frame.h" #include "ewk_history.h" #include "ewk_window_features.h" @@ -133,6 +134,8 @@ struct _Ewk_View_Smart_Class { uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size); Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames); + + Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request); }; #define EWK_VIEW_SMART_CLASS_VERSION 1UL /** the version you have to put into the version field in the Ewk_View_Smart_Class structure */ @@ -433,6 +436,9 @@ EAPI Eina_Bool ewk_view_setting_font_serif_set(Evas_Object *o, const char *fa EAPI const char *ewk_view_setting_font_sans_serif_get(const Evas_Object *o); EAPI Eina_Bool ewk_view_setting_font_sans_serif_set(Evas_Object *o, const char *family); +EAPI Eina_Bool ewk_view_setting_spatial_navigation_get(Evas_Object* o); +EAPI Eina_Bool ewk_view_setting_spatial_navigation_set(Evas_Object* o, Eina_Bool enable); + /* to be used by subclass implementations */ EAPI Ewk_View_Smart_Data *ewk_view_smart_data_get(const Evas_Object *o); diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index dbba4a9..79e4a0b 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,230 @@ +2010-08-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] WebBackForwardList's new_with_web_view should not be public + https://bugs.webkit.org/show_bug.cgi?id=43802 + + Deprecate the constructor. The introspection annotation has been + fixed in a previous commit. + + * webkit/webkitwebbackforwardlist.cpp: + +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js with generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-18 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65595. + http://trac.webkit.org/changeset/65595 + https://bugs.webkit.org/show_bug.cgi?id=44161 + + qt build failed (Requested by loislo on #webkit). + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + Fix the builds when HAVE_GSETTINGS is defined. + + * webkit/webkitprivate.cpp: + (isSchemaAvailable): + (inspectorGSettings): + +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/FrameNetworkingContextGtk.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + +2010-08-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + WebBackForwardList.get_{back|forward}_list_with_limit not introspectable + https://bugs.webkit.org/show_bug.cgi?id=43054 + + Annotate WebKitWebBackForwardList and the function that is used to fetch it from + the WebKitWebView. More will follow. + + * webkit/webkitwebbackforwardlist.cpp: Annotations, and small + improvements to the docs. + * webkit/webkitwebbackforwardlist.h: Couple empty lines missing. + * webkit/webkitwebview.cpp: + +2010-08-17 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Clean up WebCore/platform/graphics/gtk/ImageGtk.cpp + https://bugs.webkit.org/show_bug.cgi?id=44069 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): Switched to using the new WEBKITGTK_API_VERSION_STRING define. + * webkit/webkitprivate.cpp: + (inspectorGSettings): Ditto. + +2010-08-17 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65500. + http://trac.webkit.org/changeset/65500 + https://bugs.webkit.org/show_bug.cgi?id=44108 + + Qt bots failed to compile. (Requested by loislo on #webkit). + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: replace hand written InspectorBackendStub.js by generated one. + https://bugs.webkit.org/show_bug.cgi?id=43791 + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorClient::openInspectorFrontend): + +2010-08-17 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] GSettings support adds annoying warnings on systems with older glib versions + https://bugs.webkit.org/show_bug.cgi?id=44056 + + Use #ifdef instead of #if for HAVE_GSETTINGS to avoid warnings + when it is not defined. + + * WebCoreSupport/InspectorClientGtk.cpp: + * webkit/webkitprivate.cpp: + (webkit_init): + * webkit/webkitprivate.h: + +2010-08-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Really add a missing file. I wish I would remember running git add + on them after applying a patch =(. + + * org.webkitgtk.gschema.xml.in: Added. + +2010-08-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] Use GSettings to save/restore Web Inspector settings + https://bugs.webkit.org/show_bug.cgi?id=43512 + + Use GSettings to save/restore settings used by the Web Inspector. + A few helper functions were added to have settings that use + boolean values be actual booleans, and also to conform with the + GSettings naming requirements for keys. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::toGSettingName): + (WebKit::truthStringFromVariant): + (WebKit::variantFromTruthString): + (WebKit::InspectorClient::populateSetting): + (WebKit::InspectorClient::storeSetting): + * org.webkit.gtk.gschema.xml: Added. + * webkit/webkitprivate.cpp: + (inspectorGSettings): + (webkit_init): + * webkit/webkitprivate.h: + +2010-08-11 Joone Hur <joone@kldp.org> + + Reviewed by Martin Robinson. + + [GTK] Last Hangul letter is typed again when a composition is finished with mouse press + https://bugs.webkit.org/show_bug.cgi?id=40518 + + When a mouse press fires during a IME composition, the current composition character + can be entered twice at the previous editing position and a new editing position. + Because the IME commit signal is emitted after the mouse press event. + This patch allows to prevent the commit signal during a composition when a mouse press fires. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::imContextCommitted): + (WebKit::EditorClient::handleInputMethodKeydown): Allow to accept the next composition commit. + (WebKit::EditorClient::handleInputMethodMousePress): Added for handling IME when a mouse press fires. + (WebKit::EditorClient::EditorClient): Initialize m_preventNextCompositionCommit + * WebCoreSupport/EditorClientGtk.h: + (WebKit::EditorClient::preventNextCompositionCommit): Added for checking whether skipping a commit. + * webkit/webkitwebview.cpp: + (webkit_web_view_button_press_event): Call handleInputMethodMousePress() + +2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + Small improvement to the documentation of the geolocation-policy-decision-requested + signal, stating more clearly what is expected from the handler. + + * webkit/webkitwebview.cpp: + (webkit_web_view_class_init): + +2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] Geolocation policy decision object leaking + https://bugs.webkit.org/show_bug.cgi?id=43884 + + Use GRefPtr on the policy decision object to fix the leak. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::requestGeolocationPermissionForFrame): + +2010-08-10 Chris Marrin <cmarrin@apple.com> + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Gtk specific API. + + * webkit/webkitprivate.h: + * webkit/webkitwebframe.cpp: + (webkit_web_frame_suspend_animations): + (webkit_web_frame_resume_animations): + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + + Bug 43786 - Move AtomicStringHash from WebCore to WTF + Also remove deprecated string headers from WebCore/platform/text. + + * gdom/ConvertToGCharPrivate.h: + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index a06d637..185ac16 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -611,12 +611,12 @@ void ChromeClient::requestGeolocationPermissionForFrame(Frame* frame, Geolocatio WebKitWebFrame* webFrame = kit(frame); WebKitWebView* webView = getViewFromFrame(webFrame); - WebKitGeolocationPolicyDecision* policyDecision = webkit_geolocation_policy_decision_new(webFrame, geolocation); + GRefPtr<WebKitGeolocationPolicyDecision> policyDecision(adoptGRef(webkit_geolocation_policy_decision_new(webFrame, geolocation))); gboolean isHandled = FALSE; - g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision, &isHandled); + g_signal_emit_by_name(webView, "geolocation-policy-decision-requested", webFrame, policyDecision.get(), &isHandled); if (!isHandled) - webkit_geolocation_policy_deny(policyDecision); + webkit_geolocation_policy_deny(policyDecision.get()); } void ChromeClient::cancelGeolocationPermissionRequestForFrame(WebCore::Frame* frame, WebCore::Geolocation*) diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp index cd04782..8a019b4 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp @@ -67,6 +67,11 @@ static void imContextCommitted(GtkIMContext* context, const gchar* compositionSt return; } + // If this signal fires during a mousepress event when we are in the middle + // of a composition, skip this 'commit' because the composition is already confirmed. + if (client->preventNextCompositionCommit()) + return; + frame->editor()->confirmComposition(String::fromUTF8(compositionString)); client->clearPendingComposition(); } @@ -670,6 +675,7 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event) WebKitWebViewPrivate* priv = m_webView->priv; + m_preventNextCompositionCommit = false; // Some IM contexts (e.g. 'simple') will act as if they filter every // keystroke and just issue a 'commit' signal during handling. In situations @@ -711,9 +717,32 @@ void EditorClient::handleInputMethodKeydown(KeyboardEvent* event) m_treatContextCommitAsKeyEvent = false; } +void EditorClient::handleInputMethodMousePress() +{ + Frame* targetFrame = core(m_webView)->focusController()->focusedOrMainFrame(); + + if (!targetFrame || !targetFrame->editor()->canEdit()) + return; + + WebKitWebViewPrivate* priv = m_webView->priv; + + // When a mouse press fires, the commit signal happens during a composition. + // In this case, if the focused node is changed, the commit signal happens in a diffrent node. + // Therefore, we need to confirm the current compositon and ignore the next commit signal. + GOwnPtr<gchar> newPreedit(0); + gtk_im_context_get_preedit_string(priv->imContext, &newPreedit.outPtr(), 0, 0); + + if (g_utf8_strlen(newPreedit.get(), -1)) { + targetFrame->editor()->confirmComposition(); + m_preventNextCompositionCommit = true; + gtk_im_context_reset(priv->imContext); + } +} + EditorClient::EditorClient(WebKitWebView* webView) : m_isInRedo(false) , m_webView(webView) + , m_preventNextCompositionCommit(false) , m_treatContextCommitAsKeyEvent(false) , m_nativeWidget(gtk_text_view_new()) { diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h index 2688629..3e881fa 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.h @@ -61,6 +61,7 @@ namespace WebKit { ~EditorClient(); WebKitWebView* webView() { return m_webView; } bool treatContextCommitAsKeyEvent() { return m_treatContextCommitAsKeyEvent; } + bool preventNextCompositionCommit() { return m_preventNextCompositionCommit; } void clearPendingComposition() { m_pendingComposition.set(0); } bool hasPendingComposition() { return m_pendingComposition; } void addPendingEditorCommand(const char* command) { m_pendingEditorCommands.append(command); } @@ -112,6 +113,7 @@ namespace WebKit { virtual void handleKeyboardEvent(WebCore::KeyboardEvent*); virtual void handleInputMethodKeydown(WebCore::KeyboardEvent*); + virtual void handleInputMethodMousePress(); virtual void textFieldDidBeginEditing(WebCore::Element*); virtual void textFieldDidEndEditing(WebCore::Element*); @@ -135,6 +137,7 @@ namespace WebKit { private: WebKitWebView* m_webView; + bool m_preventNextCompositionCommit; bool m_treatContextCommitAsKeyEvent; GOwnPtr<gchar> m_pendingComposition; Vector<const char*> m_pendingEditorCommands; diff --git a/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h new file mode 100644 index 0000000..8e4c214 --- /dev/null +++ b/WebKit/gtk/WebCoreSupport/FrameNetworkingContextGtk.h @@ -0,0 +1,45 @@ +/* + 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 FrameNetworkingContextGtk_h +#define FrameNetworkingContextGtk_h + +#include "FrameNetworkingContext.h" + +namespace WebKit { + +class FrameNetworkingContextGtk : public WebCore::FrameNetworkingContext { +public: + static PassRefPtr<FrameNetworkingContextGtk> create(WebCore::Frame* frame) + { + return adoptRef(new FrameNetworkingContextGtk(frame)); + } + + WebCore::Frame* coreFrame() const { return frame(); } + +private: + FrameNetworkingContextGtk(WebCore::Frame* frame) + : WebCore::FrameNetworkingContext(frame) + { + } +}; + +} + +#endif diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index 1256000..b0dd40e 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2008 Gustavo Noronha Silva + * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -81,13 +82,13 @@ void InspectorClient::openInspectorFrontend(InspectorController* controller) GOwnPtr<gchar> inspectorURI; // Make the Web Inspector work when running tests - if (g_file_test("WebCore/inspector/front-end/inspector.html", G_FILE_TEST_EXISTS)) { + // FixMe: it is not working. It should be not the subdirectory of the current directory, but a subdirectory of $(WEBKITOUTPUTDIR). + if (g_file_test("resources/inspector/inspector.html", G_FILE_TEST_EXISTS)) { GOwnPtr<gchar> currentDirectory(g_get_current_dir()); - GOwnPtr<gchar> fullPath(g_strdup_printf("%s/WebCore/inspector/front-end/inspector.html", currentDirectory.get())); + GOwnPtr<gchar> fullPath(g_strdup_printf("%s/resources/inspector/inspector.html", currentDirectory.get())); inspectorURI.set(g_filename_to_uri(fullPath.get(), 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)); + inspectorURI.set(g_filename_to_uri(DATA_DIR"/webkitgtk-"WEBKITGTK_API_VERSION_STRING"/webinspector/inspector.html", NULL, NULL)); } webkit_web_view_load_uri(inspectorWebView, inspectorURI.get()); @@ -118,15 +119,116 @@ void InspectorClient::hideHighlight() gtk_widget_queue_draw(GTK_WIDGET(m_inspectedWebView)); } +#ifdef HAVE_GSETTINGS +static String toGSettingName(String inspectorSettingName) +{ + if (inspectorSettingName == "resourceTrackingEnabled") + return String("resource-tracking-enabled"); + + if (inspectorSettingName == "xhrMonitor") + return String("xhr-monitor-enabled"); + + if (inspectorSettingName == "frontendSettings") + return String("frontend-settings"); + + if (inspectorSettingName == "debuggerEnabled") + return String("debugger-enabled"); + + if (inspectorSettingName == "profilerEnabled") + return String("profiler-enabled"); + + return inspectorSettingName; +} + +static String truthStringFromVariant(GVariant* variant) +{ + if (g_variant_get_boolean(variant)) + return String("true"); + + return String("false"); +} + +static GVariant* variantFromTruthString(const String& truth) +{ + if (truth == "true") + return g_variant_new_boolean(TRUE); + + return g_variant_new_boolean(FALSE); +} + +static bool shouldIgnoreSetting(const String& key) +{ + // Ignore this setting for now, it doesn't seem to be used for + // anything right now. + if (key == "lastActivePanel") + return true; + + // GSettings considers trying to fetch or set a setting that is + // not backed by a schema as programmer error, and aborts the + // program's execution. We check here to avoid having an unhandled + // setting as a fatal error. + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "frontendSettings" || key == "debuggerEnabled" + || key == "profilerEnabled") + return false; + + LOG_VERBOSE(NotYetImplemented, "Unknown key ignored: %s", key.ascii().data()); + return true; +} + void InspectorClient::populateSetting(const String& key, String* value) { - notImplemented(); + if (shouldIgnoreSetting(key)) + return; + + GSettings* settings = inspectorGSettings(); + if (!settings) + return; + + GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, toGSettingName(key).utf8().data())); + + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "debuggerEnabled" || key == "profilerEnabled") + *value = truthStringFromVariant(variant.get()); + else if (key == "frontendSettings") + *value = String(g_variant_get_string(variant.get(), 0)); } void InspectorClient::storeSetting(const String& key, const String& value) { + if (shouldIgnoreSetting(key)) + return; + + GSettings* settings = inspectorGSettings(); + if (!settings) + return; + + GRefPtr<GVariant> variant(0); + + // Set the key with the appropriate type, and also avoid setting + // unknown keys to avoid aborting the execution. + if (key == "resourceTrackingEnabled" || key == "xhrMonitor" + || key == "debuggerEnabled" || key == "profilerEnabled") + variant = adoptGRef(variantFromTruthString(value)); + else if (key == "frontendSettings") + variant = adoptGRef(g_variant_new_string(value.utf8().data())); + + if (!variant) + return; + + g_settings_set_value(settings, toGSettingName(key).utf8().data(), variant.get()); +} +#else +void InspectorClient::populateSetting(const String&, String*) +{ + notImplemented(); +} + +void InspectorClient::storeSetting(const String&, const String&) +{ notImplemented(); } +#endif // HAVE_GSETTINGS bool InspectorClient::sendMessageToFrontend(const String& message) { diff --git a/WebKit/gtk/gdom/ConvertToGCharPrivate.h b/WebKit/gtk/gdom/ConvertToGCharPrivate.h index ef42b08..afbed49 100644 --- a/WebKit/gtk/gdom/ConvertToGCharPrivate.h +++ b/WebKit/gtk/gdom/ConvertToGCharPrivate.h @@ -20,10 +20,10 @@ #ifndef ConvertToGCharPrivate_h #define ConvertToGCharPrivate_h -#include "AtomicString.h" #include "KURL.h" #include "PlatformString.h" #include <wtf/text/CString.h> +#include <wtf/text/AtomicString.h> inline gchar* copyAsGchar(WTF::String const& s) { diff --git a/WebKit/gtk/org.webkitgtk.gschema.xml.in b/WebKit/gtk/org.webkitgtk.gschema.xml.in new file mode 100644 index 0000000..17063f4 --- /dev/null +++ b/WebKit/gtk/org.webkitgtk.gschema.xml.in @@ -0,0 +1,32 @@ +<schemalist> + <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@" path="/system/webkitgtk/"> + <child schema="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" name="inspector"/> + </schema> + <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" path="/system/webkitgtk/inspector/"> + <key name="resource-tracking-enabled" type="b"> + <default>false</default> + <summary>Resource Tracking Enabled</summary> + <description>Whether the Resource Tracking panel is always enabled.</description> + </key> + <key name="xhr-monitor-enabled" type="b"> + <default>false</default> + <summary>XHR Monitor Enabled</summary> + <description>Whether the XHR monitor is always enabled.</description> + </key> + <key name="debugger-enabled" type="b"> + <default>false</default> + <summary>Debugger Enabled</summary> + <description>Whether the debugger is always enabled.</description> + </key> + <key name="profiler-enabled" type="b"> + <default>false</default> + <summary>Profiler Enabled</summary> + <description>Whether the profiler is always enabled.</description> + </key> + <key name="frontend-settings" type="s"> + <default>''</default> + <summary>Misc Inspector Frontend Settings</summary> + <description>Miscelaneous Settings managed by the Inspector Frontend</description> + </key> + </schema> +</schemalist> diff --git a/WebKit/gtk/webkit/webkitprivate.cpp b/WebKit/gtk/webkit/webkitprivate.cpp index 41de76e..91b2904 100644 --- a/WebKit/gtk/webkit/webkitprivate.cpp +++ b/WebKit/gtk/webkit/webkitprivate.cpp @@ -44,6 +44,7 @@ #include "WebKitDOMBinding.h" #include "webkitnetworkresponse.h" #include "webkitsoupauthdialog.h" +#include "webkitversion.h" #include <libintl.h> #include <runtime/InitializeThreading.h> #include <stdlib.h> @@ -214,6 +215,45 @@ static void closeIconDatabaseOnExit() iconDatabase()->close(); } +#ifdef HAVE_GSETTINGS +static bool isSchemaAvailable(const char* schemaID) +{ + const char* const* availableSchemas = g_settings_list_schemas(); + char* const* iter = const_cast<char* const*>(availableSchemas); + + while (*iter) { + if (g_str_equal(schemaID, *iter)) + return true; + iter++; + } + + return false; +} + +GSettings* inspectorGSettings() +{ + static GSettings* settings = 0; + + if (settings) + return settings; + + const gchar* schemaID = "org.webkitgtk-"WEBKITGTK_API_VERSION_STRING".inspector"; + + // Unfortunately GSettings will abort the process execution if the + // schema is not installed, which is the case for when running + // tests, or even the introspection dump at build time, so check + // if we have the schema before trying to initialize it. + if (!isSchemaAvailable(schemaID)) { + g_warning("GSettings schema not found - settings will not be used or saved."); + return 0; + } + + settings = g_settings_new(schemaID); + + return settings; +} +#endif + void webkit_init() { static bool isInitialized = false; @@ -238,6 +278,12 @@ void webkit_init() // FIXME: Expose this with an API and/or calculate based on available resources webkit_set_cache_model(WEBKIT_CACHE_MODEL_WEB_BROWSER); +#ifdef HAVE_GSETTINGS + // Initialize settings variables here to make sure this happens in + // the main thread. + inspectorGSettings(); +#endif + #if ENABLE(DATABASE) gchar* databaseDirectory = g_build_filename(g_get_user_data_dir(), "webkit", "databases", NULL); webkit_set_web_database_directory_path(databaseDirectory); diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index aa19bec..a5508a4 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -120,6 +120,10 @@ namespace WebKit { extern "C" { void webkit_init(); +#ifdef HAVE_GSETTINGS + GSettings* inspectorGSettings(); +#endif + #define WEBKIT_PARAM_READABLE ((GParamFlags)(G_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) #define WEBKIT_PARAM_READWRITE ((GParamFlags)(G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB)) @@ -347,6 +351,12 @@ extern "C" { webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame); WEBKIT_API void + webkit_web_frame_suspend_animations(WebKitWebFrame* frame); + + WEBKIT_API void + webkit_web_frame_resume_animations(WebKitWebFrame* frame); + + WEBKIT_API void webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame); WEBKIT_API AtkObject* diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp index 70fdea5..4789de9 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp @@ -96,12 +96,15 @@ static void webkit_web_back_forward_list_init(WebKitWebBackForwardList* webBackF } /** - * webkit_web_back_forward_list_new_with_web_view: + * webkit_web_back_forward_list_new_with_web_view: (skip) * @web_view: the back forward list's #WebKitWebView * * Creates an instance of the back forward list with a controlling #WebKitWebView * * Return value: a #WebKitWebBackForwardList + * + * Deprecated: 1.3.4: Instances of #WebKitWebBackForwardList are + * created and owned by #WebKitWebView instances only. */ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitWebView* webView) { @@ -151,11 +154,11 @@ void webkit_web_back_forward_list_go_back(WebKitWebBackForwardList* webBackForwa /** * webkit_web_back_forward_list_contains_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to check + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to check * * Checks if @web_history_item is in the back forward list * - * Return: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't + * Return value: %TRUE if @web_history_item is in the back forward list, %FALSE if it doesn't */ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* webBackForwardList, WebKitWebHistoryItem* webHistoryItem) { @@ -174,7 +177,7 @@ gboolean webkit_web_back_forward_list_contains_item(WebKitWebBackForwardList* we /** * webkit_web_back_forward_list_go_to_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to go to + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to go to * * Go to the specified @web_history_item in the back forward list */ @@ -197,7 +200,7 @@ void webkit_web_back_forward_list_go_to_item(WebKitWebBackForwardList* webBackFo * * Returns a list of items that succeed the current item, limited by @limit * - * Return value: a #GList of items succeeding the current item, limited by @limit + * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items succeeding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { @@ -227,7 +230,7 @@ GList* webkit_web_back_forward_list_get_forward_list_with_limit(WebKitWebBackFor * * Returns a list of items that precede the current item, limited by @limit * - * Return value: a #GList of items preceding the current item, limited by @limit + * Return value: (element-type WebKit.WebHistoryItem) (transfer container): a #GList of items preceding the current item, limited by @limit */ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwardList* webBackForwardList, gint limit) { @@ -256,7 +259,7 @@ GList* webkit_web_back_forward_list_get_back_list_with_limit(WebKitWebBackForwar * * Returns the item that precedes the current item * - * Return value: the #WebKitWebHistoryItem preceding the current item + * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem preceding the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackForwardList* webBackForwardList) { @@ -279,7 +282,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_back_item(WebKitWebBackFo * * Returns a NULL value if the back forward list is empty * - * Return value: a #WebKitWebHistoryItem + * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBackForwardList* webBackForwardList) { @@ -302,7 +305,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_current_item(WebKitWebBac * * Returns a NULL value if there nothing that succeeds the current item * - * Return value: a #WebKitWebHistoryItem + * Return value: (type WebKit.WebHistoryItem) (transfer none): a #WebKitWebHistoryItem */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBackForwardList* webBackForwardList) { @@ -324,7 +327,7 @@ WebKitWebHistoryItem* webkit_web_back_forward_list_get_forward_item(WebKitWebBac * * Returns the item at a given index relative to the current item. * - * Return value: the #WebKitWebHistoryItem located at the specified index relative to the current item + * Return value: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem located at the specified index relative to the current item */ WebKitWebHistoryItem* webkit_web_back_forward_list_get_nth_item(WebKitWebBackForwardList* webBackForwardList, gint index) { @@ -417,7 +420,7 @@ void webkit_web_back_forward_list_set_limit(WebKitWebBackForwardList* webBackFor /** * webkit_web_back_forward_list_add_item: * @web_back_forward_list: a #WebKitWebBackForwardList - * @history_item: the #WebKitWebHistoryItem to add + * @history_item: (type WebKit.WebHistoryItem) (transfer none): the #WebKitWebHistoryItem to add * * Adds the item to the #WebKitWebBackForwardList. * @@ -440,7 +443,7 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw /** * webkit_web_back_forward_list_clear: - * @webBackForwardList: a #WebKitWebBackForwardList + * @web_back_forward_list: the #WebKitWebBackForwardList to be cleared * * Clears the @webBackForwardList by removing all its elements. Note that not even * the current page is kept in list when cleared so you would have to add it later. diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.h b/WebKit/gtk/webkit/webkitwebbackforwardlist.h index 2cffc68..15ddc94 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.h +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.h @@ -107,9 +107,11 @@ webkit_web_back_forward_list_get_limit (WebKitWebBackForwardLi WEBKIT_API void webkit_web_back_forward_list_set_limit (WebKitWebBackForwardList *web_back_forward_list, gint limit); + WEBKIT_API void webkit_web_back_forward_list_add_item (WebKitWebBackForwardList *web_back_forward_list, WebKitWebHistoryItem *history_item); + WEBKIT_API void webkit_web_back_forward_list_clear (WebKitWebBackForwardList *web_back_forward_list); diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index 5e82d57..88f0bb7 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -1053,6 +1053,32 @@ unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame) return controller->numberOfActiveAnimations(); } +void webkit_web_frame_suspend_animations(WebKitWebFrame* frame) +{ + Frame* coreFrame = core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->suspendAnimations(coreFrame->document()); +} + +void webkit_web_frame_resume_animations(WebKitWebFrame* frame) +{ + Frame* coreFrame = core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->resumeAnimations(coreFrame->document()); +} + gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame) { Frame* coreFrame = core(frame); diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 58d91ea..64b7dcc 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -665,8 +665,9 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu if (!frame->view()) return FALSE; - gboolean result = frame->eventHandler()->handleMousePressEvent(platformEvent); + // Handle the IM context when a mouse press fires + static_cast<WebKit::EditorClient*>(core(webView)->editorClient())->handleInputMethodMousePress(); #if PLATFORM(X11) /* Copy selection to the X11 selection clipboard */ @@ -2395,10 +2396,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) * @frame: the frame that requests permission * @policy_decision: a WebKitGeolocationPolicyDecision * - * When a @frame wants to get its geolocation permission. - * The receiver must reply with a boolean wether it handled or not the - * request. If the request is not handled, default behaviour is to deny - * geolocation. + * This signal is emitted when a @frame wants to obtain the user's + * location. The decision can be made asynchronously, but you must + * call g_object_ref() the @policy_decision, and return %TRUE if + * you are going to handle the request. To actually make the + * decision you need to call webkit_geolocation_policy_allow() or + * webkit_geolocation_policy_deny() on @policy_decision. * * Since: 1.1.23 */ @@ -3299,9 +3302,10 @@ void webkit_web_view_set_maintains_back_forward_list(WebKitWebView* webView, gbo * webkit_web_view_get_back_forward_list: * @web_view: a #WebKitWebView * - * Returns a #WebKitWebBackForwardList + * Obtains the #WebKitBackForwardList associated with the given #WebKitWebView. The + * #WebKitWebBackForwardList is owned by the #WebKitWebView. * - * Return value: the #WebKitWebBackForwardList + * Return value: (transfer none): the #WebKitWebBackForwardList */ WebKitWebBackForwardList* webkit_web_view_get_back_forward_list(WebKitWebView* webView) { diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 269110f..1381fee 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,191 @@ +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/WebFrameNetworkingContext.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + * WebCoreSupport/WebFrameNetworkingContext.mm: Added. + Empty placeholder for now. + +2010-08-17 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Navigating back/forward during a modal dialog causes a crash when the modal dialog is dismissed. + <rdar://problem/8313579> and https://bugs.webkit.org/show_bug.cgi?id=44131 + + * WebView/WebView.mm: + (-[WebView canGoBack]): Return false if loads are deferred. + (-[WebView canGoForward]): Ditto. + +2010-08-14 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Pavel Feldman. + + Web Inspector: -[WebInspector attach] and detach should work + https://bugs.webkit.org/show_bug.cgi?id=43924 + + For actions that relate only to the Web Inspector's Frontend + window (actions on the InspectorFrontendClient) the new Obj-C + wrapper class WebInspectorFrontend can be used. For now, this + is just attach and detach. + + * WebCoreSupport/WebInspectorClient.mm: + (WebInspectorClient::openInspectorFrontend): setup and attach the WebInspectorFrontend to the WebInspector. + * WebInspector/WebInspector.h: + * WebInspector/WebInspector.mm: + (-[WebInspector dealloc]): + (-[WebInspector attach:]): delegate to the frontend. + (-[WebInspector detach:]): delegate to the frontend. + (-[WebInspector setFrontend:]): + * WebInspector/WebInspectorFrontend.h: Added. + * WebInspector/WebInspectorFrontend.mm: Added. + (-[WebInspectorFrontend initWithFrontendClient:]): + (-[WebInspectorFrontend attach]): + (-[WebInspectorFrontend detach]): + * WebInspector/WebInspectorPrivate.h: + +2010-08-13 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + Switch String::/UString::ascii() to return a CString. + + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyInstance::methodsNamed): + (WebKit::ProxyInstance::fieldNamed): + +2010-08-13 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Sam Weinig + + Unify UString::UTF8String() & String::utf8() methods, + remove UString::cost() & make atArrayIndex a free function. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::enumerate): + +2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65295. + http://trac.webkit.org/changeset/65295 + https://bugs.webkit.org/show_bug.cgi?id=43950 + + It broke 4 sputnik tests (Requested by Ossy on #webkit). + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::enumerate): + +2010-08-12 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Sam Weinig + + Unify UString::UTF8String() & String::utf8() methods, + remove UString::cost() & make atArrayIndex a free function. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::enumerate): + +2010-08-12 Jeremy Orlow <jorlow@chromium.org> + + Revert for now + https://bugs.webkit.org/show_bug.cgi?id=43794 + + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + (-[WebView _preferencesChangedNotification:]): + +2010-08-10 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Adam Barth. + + Some settings are linked to the PageGroup not the Page. Create a new class for those. + https://bugs.webkit.org/show_bug.cgi?id=43794 + + Change WebView to use the new GroupSettings class rather than Settings for the + settings that moved. This is sub-optimal since the settings aren't really + per-view, but we can't really change the API at this point. + + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + (-[WebView _preferencesChangedNotification:]): + +2010-08-11 Gavin Barraclough <barraclough@apple.com> + + Rubber stamps by Darin Adler & Sam Weinig. + + Bug 43867 - Some UString cleanup + + Change JSC::UString data(), size(), and from(), to characters(), length(), and number() to match WTF::String. + Move string concatenation methods to a new header to simplify down UString.h. Remove is8Bit(). + + * WebView/WebScriptDebugger.mm: + (toNSString): + +2010-08-10 David Hyatt <hyatt@apple.com> + + Reviewed by Dan Bernstein. + + https://bugs.webkit.org/show_bug.cgi?id=43806, add ability to paginate screen content. + + Add SPI for entering and exiting screen pagination mode. This is similar to printing mode but it can be done for on-screen + content. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _web_setPrintingModeRecursive]): + (-[WebHTMLView _web_clearPrintingModeRecursive]): + (-[WebHTMLView _web_setPrintingModeRecursiveAndAdjustViewSize]): + (-[WebHTMLView _beginPrintModeWithPageWidth:height:shrinkToFit:]): + (-[WebHTMLView _endPrintMode]): + (-[WebHTMLView _isInScreenPaginationMode]): + (-[WebHTMLView _beginScreenPaginationModeWithPageSize:shrinkToFit:]): + (-[WebHTMLView _endScreenPaginationMode]): + (-[WebHTMLView reapplyStyles]): + (-[WebHTMLView _setPrinting:minimumPageWidth:height:maximumPageWidth:adjustViewSize:paginateScreenContent:]): + (-[WebHTMLView adjustPageHeightNew:top:bottom:limit:]): + (-[WebHTMLView setPageWidthForPrinting:]): + * WebView/WebHTMLViewPrivate.h: + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Build fix (update more includes) + + * Plugins/Hosted/NetscapePluginHostManager.h: + +2010-08-10 Chris Marrin <cmarrin@apple.com> + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Mac specific API. Plumbs suspendAnimations/resumeAnimations down to WebCore. + + * WebView/WebFrame.mm: + (-[WebFrame _suspendAnimations]): + (-[WebFrame _resumeAnimations]): + * WebView/WebFramePrivate.h: + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig + + Bug 43817 - Remove UString::Rep + UString::Rep has for a long time been replaced by UStringImpl (Rep + remaining as a typedef). UStringImpl has since been removed too + (unified with StringImpl). Remove Rep, rename rep() to impl() and + m_rep to m_impl. Also add impl() method to Identifier, and rename + its UString member from _ustring to m_string. + + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyInstance::methodsNamed): + (WebKit::ProxyInstance::fieldNamed): + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h index b88f1a4..2645c55 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h @@ -29,9 +29,9 @@ #define NetscapePluginHostManager_h #import <WebCore/PlatformString.h> -#import <WebCore/StringHash.h> #import <wtf/HashMap.h> #import <wtf/PassRefPtr.h> +#import <wtf/text/StringHash.h> @class WebHostedNetscapePluginView; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index 8354c06..cb1d958 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -1238,7 +1238,7 @@ bool NetscapePluginInstanceProxy::enumerate(uint32_t objectID, data_t& resultDat RetainPtr<NSMutableArray*> array(AdoptNS, [[NSMutableArray alloc] init]); for (unsigned i = 0; i < propertyNames.size(); i++) { - uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().UTF8String().data())); + uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(propertyNames[i].ustring().utf8().data())); [array.get() addObject:[NSNumber numberWithLongLong:methodName]]; } diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm index b3799ca..306d2e5 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm +++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm @@ -329,7 +329,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier) return MethodList(); // If we already have an entry in the map, use it. - MethodMap::iterator existingMapEntry = m_methods.find(identifier.ustring().rep()); + MethodMap::iterator existingMapEntry = m_methods.find(identifier.impl()); if (existingMapEntry != m_methods.end()) { MethodList methodList; if (existingMapEntry->second) @@ -337,7 +337,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier) return methodList; } - uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii())); + uint64_t methodName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data())); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasMethod(m_instanceProxy->hostProxy()->port(), @@ -353,7 +353,7 @@ MethodList ProxyInstance::methodsNamed(const Identifier& identifier) return MethodList(); // Add a new entry to the map unless an entry was added while we were in waitForReply. - pair<MethodMap::iterator, bool> mapAddResult = m_methods.add(identifier.ustring().rep(), 0); + pair<MethodMap::iterator, bool> mapAddResult = m_methods.add(identifier.impl(), 0); if (mapAddResult.second && reply->m_result) mapAddResult.first->second = new ProxyMethod(methodName); @@ -369,11 +369,11 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier) return 0; // If we already have an entry in the map, use it. - FieldMap::iterator existingMapEntry = m_fields.find(identifier.ustring().rep()); + FieldMap::iterator existingMapEntry = m_fields.find(identifier.impl()); if (existingMapEntry != m_fields.end()) return existingMapEntry->second; - uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii())); + uint64_t propertyName = reinterpret_cast<uint64_t>(_NPN_GetStringIdentifier(identifier.ascii().data())); uint32_t requestID = m_instanceProxy->nextRequestID(); if (_WKPHNPObjectHasProperty(m_instanceProxy->hostProxy()->port(), @@ -389,7 +389,7 @@ Field* ProxyInstance::fieldNamed(const Identifier& identifier) return 0; // Add a new entry to the map unless an entry was added while we were in waitForReply. - pair<FieldMap::iterator, bool> mapAddResult = m_fields.add(identifier.ustring().rep(), 0); + pair<FieldMap::iterator, bool> mapAddResult = m_fields.add(identifier.impl(), 0); if (mapAddResult.second && reply->m_result) mapAddResult.first->second = new ProxyField(propertyName); return mapAddResult.first->second; diff --git a/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h new file mode 100644 index 0000000..de89024 --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.h @@ -0,0 +1,39 @@ +/* + 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. +*/ + +#import <WebCore/FrameNetworkingContext.h> + +class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext { +public: + static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame* frame) + { + return adoptRef(new WebFrameNetworkingContext(frame)); + } + +private: + WebFrameNetworkingContext(WebCore::Frame* frame) + : WebCore::FrameNetworkingContext(frame) + { + } + + virtual bool needsSiteSpecificQuirks() const; + virtual bool localFileContentSniffingEnabled() const; + virtual WebCore::SchedulePairHashSet* scheduledRunLoopPairs() const; + virtual WebCore::ResourceError blockedError(const WebCore::ResourceRequest&) const; +}; diff --git a/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm new file mode 100644 index 0000000..941cfaa --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebFrameNetworkingContext.mm @@ -0,0 +1,21 @@ +/* + 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. +*/ + +// Checking this file in empty to get the build system work out of the way. +// Will put the code in here later. diff --git a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm index d59109e..7cae8fc 100644 --- a/WebKit/mac/WebCoreSupport/WebInspectorClient.mm +++ b/WebKit/mac/WebCoreSupport/WebInspectorClient.mm @@ -33,6 +33,8 @@ #import "WebFrameInternal.h" #import "WebFrameView.h" #import "WebInspector.h" +#import "WebInspectorPrivate.h" +#import "WebInspectorFrontend.h" #import "WebLocalizableStrings.h" #import "WebNodeHighlight.h" #import "WebUIDelegate.h" @@ -98,8 +100,12 @@ void WebInspectorClient::openInspectorFrontend(InspectorController* inspectorCon { RetainPtr<WebInspectorWindowController> windowController(AdoptNS, [[WebInspectorWindowController alloc] initWithInspectedWebView:m_webView]); [windowController.get() setInspectorClient:this]; + m_frontendPage = core([windowController.get() webView]); - m_frontendPage->inspectorController()->setInspectorFrontendClient(new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage)); + WebInspectorFrontendClient* frontendClient = new WebInspectorFrontendClient(m_webView, windowController.get(), inspectorController, m_frontendPage); + m_frontendPage->inspectorController()->setInspectorFrontendClient(frontendClient); + + [[m_webView inspector] setFrontend:[[WebInspectorFrontend alloc] initWithFrontendClient:frontendClient]]; } void WebInspectorClient::highlight(Node* node) diff --git a/WebKit/mac/WebInspector/WebInspector.h b/WebKit/mac/WebInspector/WebInspector.h index fa13c8d..ed78ed7 100644 --- a/WebKit/mac/WebInspector/WebInspector.h +++ b/WebKit/mac/WebInspector/WebInspector.h @@ -29,10 +29,12 @@ #import <Foundation/NSObject.h> @class WebView; +@class WebInspectorFrontend; @interface WebInspector : NSObject { WebView *_webView; + WebInspectorFrontend *_frontend; } - (id)initWithWebView:(WebView *)webView; - (void)webViewClosed; diff --git a/WebKit/mac/WebInspector/WebInspector.mm b/WebKit/mac/WebInspector/WebInspector.mm index 9b17459..f109e15 100644 --- a/WebKit/mac/WebInspector/WebInspector.mm +++ b/WebKit/mac/WebInspector/WebInspector.mm @@ -30,6 +30,7 @@ #import "WebFrameInternal.h" #import "WebInspectorPrivate.h" +#import "WebInspectorFrontend.h" #include <WebCore/Document.h> #include <WebCore/Frame.h> @@ -47,6 +48,12 @@ using namespace WebCore; return self; } +- (void)dealloc +{ + [_frontend release]; + [super dealloc]; +} + - (void)webViewClosed { _webView = nil; @@ -175,10 +182,12 @@ using namespace WebCore; - (void)attach:(id)sender { + [_frontend attach]; } - (void)detach:(id)sender { + [_frontend detach]; } - (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script @@ -186,6 +195,12 @@ using namespace WebCore; if (Page* page = core(_webView)) page->inspectorController()->evaluateForTestInFrontend(callId, script); } + +- (void)setFrontend:(WebInspectorFrontend *)frontend +{ + [_frontend release]; + _frontend = [frontend retain]; +} @end @implementation WebInspector (Obsolete) diff --git a/WebKit/mac/WebInspector/WebInspectorFrontend.h b/WebKit/mac/WebInspector/WebInspectorFrontend.h new file mode 100644 index 0000000..93bed84 --- /dev/null +++ b/WebKit/mac/WebInspector/WebInspectorFrontend.h @@ -0,0 +1,35 @@ +/* + * 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 WebInspectorFrontendClient; + +@interface WebInspectorFrontend : NSObject { +@private + WebInspectorFrontendClient *m_frontendClient; +} +- (id)initWithFrontendClient:(WebInspectorFrontendClient *)frontendClient; +- (void)attach; +- (void)detach; +@end diff --git a/WebKit/mac/WebInspector/WebInspectorFrontend.mm b/WebKit/mac/WebInspector/WebInspectorFrontend.mm new file mode 100644 index 0000000..91caa64 --- /dev/null +++ b/WebKit/mac/WebInspector/WebInspectorFrontend.mm @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#import "WebInspectorFrontend.h" + +#import "WebInspectorClient.h" + +@implementation WebInspectorFrontend + +- (id)initWithFrontendClient:(WebInspectorFrontendClient *)frontendClient; +{ + if (!(self = [super init])) + return nil; + + m_frontendClient = frontendClient; + return self; +} + +- (void)attach +{ + m_frontendClient->attachWindow(); +} + +- (void)detach +{ + m_frontendClient->detachWindow(); +} + +@end diff --git a/WebKit/mac/WebInspector/WebInspectorPrivate.h b/WebKit/mac/WebInspector/WebInspectorPrivate.h index d18f804..df1e286 100644 --- a/WebKit/mac/WebInspector/WebInspectorPrivate.h +++ b/WebKit/mac/WebInspector/WebInspectorPrivate.h @@ -30,6 +30,9 @@ #import <WebKit/WebInspector.h> +@class WebInspectorFrontend; + @interface WebInspector (WebPrivate) - (void)evaluateInFrontend:(id)sender callId:(long)callId script:(NSString *)script; +- (void)setFrontend:(WebInspectorFrontend *)frontend; @end diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm index b71d501..82df7bc 100644 --- a/WebKit/mac/WebView/WebFrame.mm +++ b/WebKit/mac/WebView/WebFrame.mm @@ -1193,6 +1193,32 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) return controller->numberOfActiveAnimations(); } +- (void) _suspendAnimations +{ + Frame* frame = core(self); + if (!frame) + return; + + AnimationController* controller = frame->animation(); + if (!controller) + return; + + controller->suspendAnimations(frame->document()); +} + +- (void) _resumeAnimations +{ + Frame* frame = core(self); + if (!frame) + return; + + AnimationController* controller = frame->animation(); + if (!controller) + return; + + controller->resumeAnimations(frame->document()); +} + - (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle { if (_private->coreFrame->selection()->isNone() || !fragment) diff --git a/WebKit/mac/WebView/WebFramePrivate.h b/WebKit/mac/WebView/WebFramePrivate.h index 0bda966..3556ad8 100644 --- a/WebKit/mac/WebView/WebFramePrivate.h +++ b/WebKit/mac/WebView/WebFramePrivate.h @@ -113,6 +113,10 @@ typedef enum { // Returns the total number of currently running animations (includes both CSS transitions and CSS animations). - (unsigned) _numberOfActiveAnimations; +// Suspend and resume animations (includes both CSS transitions and CSS animations). +- (void) _suspendAnimations; +- (void) _resumeAnimations; + - (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle; - (void)_replaceSelectionWithText:(NSString *)text selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace; - (void)_replaceSelectionWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace; diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 0e559b4..77df9d1 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -399,7 +399,7 @@ static CachedResourceClient* promisedDataClient() #endif @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize; +- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; @end @class NSTextInputContext; @@ -445,6 +445,7 @@ struct WebHTMLViewInterpretKeyEventsParameters { BOOL ignoringMouseDraggedEvents; BOOL printing; BOOL avoidingPrintOrphan; + BOOL paginateScreenContent; BOOL observingMouseMovedNotifications; BOOL observingSuperviewNotifications; BOOL observingWindowNotifications; @@ -1041,7 +1042,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursive { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1053,7 +1054,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1064,7 +1065,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_clearPrintingModeRecursive { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1076,7 +1077,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -1087,7 +1088,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) - (void)_web_setPrintingModeRecursiveAndAdjustViewSize { - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; #ifndef NDEBUG _private->enumeratingSubviews = YES; @@ -1099,7 +1100,7 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) unsigned count = [descendantWebHTMLViews count]; for (unsigned i = 0; i < count; ++i) - [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; + [[descendantWebHTMLViews objectAtIndex:i] _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; [descendantWebHTMLViews release]; @@ -2248,14 +2249,46 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) minLayoutHeight = shrinkToFit ? pageHeight * _WebHTMLViewPrintingMinimumShrinkFactor : pageHeight; maxLayoutWidth = shrinkToFit ? pageWidth * _WebHTMLViewPrintingMaximumShrinkFactor : pageWidth; } - [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES]; + [self _setPrinting:YES minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; return YES; } - (void)_endPrintMode { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; +} + +- (BOOL)_isInScreenPaginationMode +{ + return _private->paginateScreenContent; +} + +- (BOOL)_beginScreenPaginationModeWithPageSize:(CGSize)pageSize shrinkToFit:(BOOL)shrinkToFit +{ + Frame* frame = core([self _frame]); + if (!frame) + return NO; + + CGFloat minLayoutWidth = 0; + CGFloat minLayoutHeight = 0; + CGFloat maxLayoutWidth = 0; + + // If we are a frameset just print with the layout we have on the screen. Otherwise do a relayout + // according to the page width. + if (!frame->document() || !frame->document()->isFrameSet()) { + minLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.width; + minLayoutHeight = shrinkToFit ? pageSize.height * _WebHTMLViewPrintingMinimumShrinkFactor : pageSize.height; + maxLayoutWidth = shrinkToFit ? pageSize.width * _WebHTMLViewPrintingMaximumShrinkFactor : pageSize.width; + } + [self _setPrinting:[self _isInPrintMode] minimumPageWidth:minLayoutWidth height:minLayoutHeight maximumPageWidth:maxLayoutWidth adjustViewSize:YES paginateScreenContent:YES]; + + return YES; +} + +- (void)_endScreenPaginationMode +{ + [self _setPrinting:[self _isInPrintMode] minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:YES paginateScreenContent:NO]; } - (CGFloat)_adjustedBottomOfPageWithTop:(CGFloat)top bottom:(CGFloat)bottom limit:(CGFloat)bottomLimit @@ -3092,8 +3125,10 @@ WEBCORE_COMMAND(yankAndSelect) if (Frame* coreFrame = core([self _frame])) { if (FrameView* coreView = coreFrame->view()) coreView->setMediaType(_private->printing ? "print" : "screen"); - if (Document* document = coreFrame->document()) + if (Document* document = coreFrame->document()) { + document->setPaginatedForScreen(_private->paginateScreenContent); document->setPrinting(_private->printing); + } coreFrame->reapplyStyles(); } @@ -3823,8 +3858,11 @@ static BOOL isInPasswordField(Frame* coreFrame) // Does setNeedsDisplay:NO as a side effect when printing is ending. // pageWidth != 0 implies we will relayout to a new width -- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize +- (void)_setPrinting:(BOOL)printing minimumPageWidth:(float)minPageWidth height:(float)minPageHeight maximumPageWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent { + if (printing == _private->printing && paginateScreenContent == _private->paginateScreenContent) + return; + WebFrame *frame = [self _frame]; NSArray *subframes = [frame childFrames]; unsigned n = [subframes count]; @@ -3833,23 +3871,22 @@ static BOOL isInPasswordField(Frame* coreFrame) WebFrame *subframe = [subframes objectAtIndex:i]; WebFrameView *frameView = [subframe frameView]; if ([[subframe _dataSource] _isDocumentHTML]) { - [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize]; + [(WebHTMLView *)[frameView documentView] _setPrinting:printing minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:adjustViewSize paginateScreenContent:paginateScreenContent]; } } - if (printing || _private->printing) { - [_private->pageRects release]; - _private->pageRects = nil; - _private->printing = printing; - if (!printing) - _private->avoidingPrintOrphan = NO; - [self setNeedsToApplyStyles:YES]; - [self setNeedsLayout:YES]; - [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; - if (!printing) { - // Can't do this when starting printing or nested printing won't work, see 3491427. - [self setNeedsDisplay:NO]; - } + [_private->pageRects release]; + _private->pageRects = nil; + _private->printing = printing; + _private->paginateScreenContent = paginateScreenContent; + if (!printing && !paginateScreenContent) + _private->avoidingPrintOrphan = NO; + [self setNeedsToApplyStyles:YES]; + [self setNeedsLayout:YES]; + [self layoutToMinimumPageWidth:minPageWidth height:minPageHeight maximumPageWidth:maxPageWidth adjustingViewSize:adjustViewSize]; + if (!printing) { + // Can't do this when starting printing or nested printing won't work, see 3491427. + [self setNeedsDisplay:NO]; } } @@ -3866,7 +3903,7 @@ static BOOL isInPasswordField(Frame* coreFrame) // If the WebHTMLView itself is what we're printing, then we will never have to do this. BOOL wasInPrintingMode = _private->printing; if (!wasInPrintingMode) - [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [self _setPrinting:YES minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; *newBottom = [self _adjustedBottomOfPageWithTop:oldTop bottom:oldBottom limit:bottomLimit]; @@ -3877,7 +3914,7 @@ static BOOL isInPasswordField(Frame* coreFrame) [self performSelector:@selector(_delayedEndPrintMode:) withObject:currenPrintOperation afterDelay:0]; else // not sure if this is actually ever invoked, it probably shouldn't be - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; } } @@ -3907,8 +3944,8 @@ static BOOL isInPasswordField(Frame* coreFrame) // This is used for Carbon printing. At some point we might want to make this public API. - (void)setPageWidthForPrinting:(float)pageWidth { - [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO]; - [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES]; + [self _setPrinting:NO minimumPageWidth:0 height:0 maximumPageWidth:0 adjustViewSize:NO paginateScreenContent:[self _isInScreenPaginationMode]]; + [self _setPrinting:YES minimumPageWidth:pageWidth height:0 maximumPageWidth:pageWidth adjustViewSize:YES paginateScreenContent:[self _isInScreenPaginationMode]]; } - (void)_endPrintModeAndRestoreWindowAutodisplay diff --git a/WebKit/mac/WebView/WebHTMLViewPrivate.h b/WebKit/mac/WebView/WebHTMLViewPrivate.h index c2ca3fe..e1d15dc 100644 --- a/WebKit/mac/WebView/WebHTMLViewPrivate.h +++ b/WebKit/mac/WebView/WebHTMLViewPrivate.h @@ -138,6 +138,10 @@ extern const float _WebHTMLViewPrintingMaximumShrinkFactor; - (BOOL)_beginPrintModeWithPageWidth:(float)pageWidth height:(float)pageHeight shrinkToFit:(BOOL)shrinkToFit; - (void)_endPrintMode; +- (BOOL)_isInScreenPaginationMode; +- (BOOL)_beginScreenPaginationModeWithPageSize:(CGSize)pageSize shrinkToFit:(BOOL)shrinkToFit; +- (void)_endScreenPaginationMode; + - (BOOL)_canSmartReplaceWithPasteboard:(NSPasteboard *)pasteboard; @end diff --git a/WebKit/mac/WebView/WebScriptDebugger.mm b/WebKit/mac/WebView/WebScriptDebugger.mm index c5e0ac8..f67b46f 100644 --- a/WebKit/mac/WebView/WebScriptDebugger.mm +++ b/WebKit/mac/WebView/WebScriptDebugger.mm @@ -54,7 +54,7 @@ NSString *toNSString(const UString& s) { if (s.isEmpty()) return nil; - return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.data()) length:s.size()]; + return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(s.characters()) length:s.length()]; } static NSString *toNSString(const SourceCode& s) diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index aefd56b..d6faeca 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -3908,7 +3908,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag) - (BOOL)canGoBack { - if (!_private->page) + if (!_private->page || _private->page->defersLoading()) return NO; return !!_private->page->backForwardList()->backItem(); @@ -3916,7 +3916,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag) - (BOOL)canGoForward { - if (!_private->page) + if (!_private->page || _private->page->defersLoading()) return NO; return !!_private->page->backForwardList()->forwardItem(); diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 47ab82a..7f66d98 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -67,7 +67,9 @@ public: void _q_contentsSizeChanged(const QSize&); void _q_scaleChanged(); +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) void _q_updateMicroFocus(); +#endif void _q_pageDestroyed(); QGraphicsWebView* q; @@ -100,9 +102,9 @@ void QGraphicsWebViewPrivate::_q_doLoadFinished(bool success) emit q->loadFinished(success); } +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) void QGraphicsWebViewPrivate::_q_updateMicroFocus() { -#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) // Ideally, this should be handled by a common call to an updateMicroFocus function // in QGraphicsItem. See http://bugreports.qt.nokia.com/browse/QTBUG-7578. QList<QGraphicsView*> views = q->scene()->views(); @@ -111,8 +113,8 @@ void QGraphicsWebViewPrivate::_q_updateMicroFocus() if (ic) ic->update(); } -#endif } +#endif void QGraphicsWebViewPrivate::_q_pageDestroyed() { @@ -488,10 +490,12 @@ void QGraphicsWebView::setPage(QWebPage* page) this, SIGNAL(statusBarMessage(QString))); connect(d->page, SIGNAL(linkClicked(QUrl)), this, SIGNAL(linkClicked(QUrl))); - connect(d->page, SIGNAL(microFocusChanged()), - this, SLOT(_q_updateMicroFocus())); connect(d->page, SIGNAL(destroyed()), this, SLOT(_q_pageDestroyed())); +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + connect(d->page, SIGNAL(microFocusChanged()), + this, SLOT(_q_updateMicroFocus())); +#endif } /*! diff --git a/WebKit/qt/Api/qgraphicswebview.h b/WebKit/qt/Api/qgraphicswebview.h index 8650984..77f0359 100644 --- a/WebKit/qt/Api/qgraphicswebview.h +++ b/WebKit/qt/Api/qgraphicswebview.h @@ -146,7 +146,9 @@ protected: private: Q_PRIVATE_SLOT(d, void _q_doLoadFinished(bool success)) +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) Q_PRIVATE_SLOT(d, void _q_updateMicroFocus()) +#endif Q_PRIVATE_SLOT(d, void _q_pageDestroyed()) // we don't want to change the moc based on USE() macro, so this function is here // but will be empty if ACCLERATED_COMPOSITING is disabled diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp index d2cdf79..ce2f283 100644 --- a/WebKit/qt/Api/qwebelement.cpp +++ b/WebKit/qt/Api/qwebelement.cpp @@ -970,7 +970,7 @@ void QWebElement::appendInside(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); ExceptionCode exception = 0; m_element->appendChild(fragment, exception); @@ -1016,7 +1016,7 @@ void QWebElement::prependInside(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); ExceptionCode exception = 0; @@ -1068,7 +1068,7 @@ void QWebElement::prependOutside(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); ExceptionCode exception = 0; m_element->parent()->insertBefore(fragment, m_element, exception); @@ -1118,7 +1118,7 @@ void QWebElement::appendOutside(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); ExceptionCode exception = 0; if (!m_element->nextSibling()) @@ -1263,7 +1263,7 @@ void QWebElement::encloseContentsWith(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); if (!fragment || !fragment->firstChild()) return; @@ -1338,7 +1338,7 @@ void QWebElement::encloseWith(const QString &markup) return; HTMLElement* htmlElement = static_cast<HTMLElement*>(m_element); - RefPtr<DocumentFragment> fragment = htmlElement->createContextualFragment(markup); + RefPtr<DocumentFragment> fragment = htmlElement->deprecatedCreateContextualFragment(markup); if (!fragment || !fragment->firstChild()) return; diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index 4f2845f..25e8fb3 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,133 @@ +2010-08-17 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Reviewed by Ariya Hidayat. + + [Qt] [Symbian] Consistently use Q_OS_SYMBIAN to guard all Symbian platform dependencies + https://bugs.webkit.org/show_bug.cgi?id=44124 + + Q_WS_S60 is not defined for Symbian^4 devices as Q_WS_S60 used to guard + Avkon UI framework dependencies. Use Q_OS_SYMBIAN everywhere to mark + Symbian dependencies. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::populate): + +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/FrameNetworkingContextQt.cpp: Added. + Empty placeholder for now. + * WebCoreSupport/FrameNetworkingContextQt.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + +2010-08-17 Hui Huang <hui.2.huang@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Fix ARM5 compiling error in FrameLoaderClientQt.cpp + https://bugs.webkit.org/show_bug.cgi?id=43927 + + In the Symbian build chain QT_USE_FAST_OPERATOR_PLUS is defined, + which means that the '+' will automatically be performed as the + QStringBuilder '%'. Create a QString explicitly to make sure that + toLocal8bit() member is available that the qPrintable Macro uses. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + +2010-08-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> + + Reviewed by Kenneth Christiansen. + + [Qt] Implement ChromeClient's windowToScreen() and screenToWindow() + + * WebCoreSupport/ChromeClientQt.cpp: + +2010-08-14 Adam Barth <abarth@webkit.org> + + Propagate name change to Qt. + + * Api/qwebelement.cpp: + (QWebElement::appendInside): + (QWebElement::prependInside): + (QWebElement::prependOutside): + (QWebElement::appendOutside): + (QWebElement::encloseContentsWith): + (QWebElement::encloseWith): + +2010-08-12 Jeremy Orlow <jorlow@chromium.org> + + Revert for now + https://bugs.webkit.org/show_bug.cgi?id=43794 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-08-11 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Adam Barth. + + Some settings are linked to the PageGroup not the Page. Create a new class for those. + https://bugs.webkit.org/show_bug.cgi?id=43794 + + Change WebSettings to use the new GroupSettings class rather than Settings for the + settings that moved. This is sub-optimal since the settings aren't really + per-view, but I don't see how we can change the API at this point. + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-08-11 Simon Hausmann <simon.hausmann@nokia.com> + + [Qt] Update the Symbian def files + + Re-freeze with various QGraphicsWebView and DRT updates. + The uppper part of the diff is just whitespace, so + diff -w will show the real diff. + + * symbian/eabi/QtWebKitu.def: + +2010-08-10 Anders Bakken <agbakken@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Don't connect to microFocusChanged() if _q_updateMicroFocus is a noop. + https://bugs.webkit.org/show_bug.cgi?id=40580 + + _q_updateMicroFocus() is a noop unless this ifdef evaluates to true: + #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + + In such cases there's no need to carry the overhead of the extra + signal/slot connection. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_updateMicroFocus): + (QGraphicsWebView::setPage): + +2010-08-10 Chris Marrin <cmarrin@apple.com> + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Qt specific API. Missing symbian symbol defines in: + + WebKit/qt/symbian/bwins/QtWebKitu.def + WebKit/qt/symbian/eabi/QtWebKitu.def + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendAnimations): + (DumpRenderTreeSupportQt::resumeAnimations): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index 0b77ea6..87ed19d 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -410,14 +410,31 @@ void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const { - notImplemented(); - return rect; + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return rect; + + QWidget* ownerWidget = pageClient->ownerWidget(); + if (!ownerWidget) + return rect; + + QRect screenRect(rect); + screenRect.translate(ownerWidget->mapToGlobal(QPoint(0, 0))); + + return screenRect; } IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const { - notImplemented(); - return point; + QWebPageClient* pageClient = platformPageClient(); + if (!pageClient) + return point; + + QWidget* ownerWidget = pageClient->ownerWidget(); + if (!ownerWidget) + return point; + + return ownerWidget->mapFromGlobal(point); } PlatformPageClient ChromeClientQt::platformPageClient() const diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index ddc9d7a..b6c3d51 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -262,6 +262,32 @@ int DumpRenderTreeSupportQt::numberOfActiveAnimations(QWebFrame *frame) return controller->numberOfActiveAnimations(); } +void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->suspendAnimations(coreFrame->document()); +} + +void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) +{ + Frame* coreFrame = QWebFramePrivate::core(frame); + if (!coreFrame) + return; + + AnimationController* controller = coreFrame->animation(); + if (!controller) + return; + + controller->resumeAnimations(coreFrame->document()); +} + void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame) { Frame* coreFrame = QWebFramePrivate::core(frame); diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h index 3a92158..2069114 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -79,6 +79,8 @@ public: static void clearFrameName(QWebFrame* frame); static void overwritePluginDirectories(); static int numberOfActiveAnimations(QWebFrame*); + static void suspendAnimations(QWebFrame*); + static void resumeAnimations(QWebFrame*); static int numberOfPages(QWebFrame* frame, float width, float height); static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height); static bool hasDocumentElement(QWebFrame* frame); diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index cf76dae..1dd9f21 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -1121,7 +1121,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun printf("Policy delegate: attempt to load %s with navigation type '%s'%s\n", qPrintable(drtDescriptionSuitableForTestResult(request.url())), navigationTypeToString(action.type()), - (node) ? qPrintable(" originating from " + drtDescriptionSuitableForTestResult(node, 0)) : ""); + (node) ? qPrintable(QString(" originating from " + drtDescriptionSuitableForTestResult(node, 0))) : ""); if (policyDelegatePermissive) result = PolicyUse; diff --git a/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp new file mode 100644 index 0000000..941cfaa --- /dev/null +++ b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp @@ -0,0 +1,21 @@ +/* + 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. +*/ + +// Checking this file in empty to get the build system work out of the way. +// Will put the code in here later. diff --git a/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h new file mode 100644 index 0000000..461023e --- /dev/null +++ b/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.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 FrameNetworkingContextQt_h +#define FrameNetworkingContextQt_h + +#include "FrameNetworkingContext.h" + +namespace WebCore { + +class FrameNetworkingContextQt : public FrameNetworkingContext { +public: + static PassRefPtr<FrameNetworkingContextQt> create(Frame*, QObject* originatingObject, QNetworkAccessManager*); + +private: + FrameNetworkingContextQt(Frame*, QObject* originatingObject, QNetworkAccessManager*); + + virtual QObject* originatingObject() const; + virtual QNetworkAccessManager* networkAccessManager() const; + + QObject* m_originatingObject; + QNetworkAccessManager* m_networkAccessManager; +}; + +} + +#endif // FrameNetworkingContextQt_h diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp index 21678c7..3b53476 100644 --- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp +++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp @@ -215,7 +215,7 @@ void QtFallbackWebPopup::populate(const QWebSelectData& data) QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model()); Q_ASSERT(model); -#if !defined(Q_WS_S60) +#if !defined(Q_OS_SYMBIAN) m_combo->setFont(font()); #endif diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def index 548add1..9c3e152 100644 --- a/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -742,39 +742,39 @@ EXPORTS _ZN23DumpRenderTreeSupportQt22javaScriptObjectsCountEv @ 741 NONAME _ZN23DumpRenderTreeSupportQt23setCaretBrowsingEnabledEP8QWebPageb @ 742 NONAME _ZN23DumpRenderTreeSupportQt24executeCoreCommandByNameEP8QWebPageRK7QStringS4_ @ 743 NONAME - _ZN23DumpRenderTreeSupportQt21dumpSetAcceptsEditingEb @744 NONAME - _ZN23DumpRenderTreeSupportQt22resumeActiveDOMObjectsEP9QWebFrame @745 NONAME - _ZN23DumpRenderTreeSupportQt23suspendActiveDOMObjectsEP9QWebFrame @746 NONAME - _ZN23DumpRenderTreeSupportQt24numberOfActiveAnimationsEP9QWebFrame @747 NONAME - _ZN23DumpRenderTreeSupportQt24pageNumberForElementByIdEP9QWebFrameRK7QStringff @748 NONAME - _ZN23DumpRenderTreeSupportQt25dumpResourceLoadCallbacksEb @749 NONAME - _ZN23DumpRenderTreeSupportQt25pauseTransitionOfPropertyEP9QWebFrameRK7QStringdS4_ @750 NONAME - _ZN23DumpRenderTreeSupportQt25setFrameFlatteningEnabledEP8QWebPageb @751 NONAME - _ZN23DumpRenderTreeSupportQt25webInspectorExecuteScriptEP8QWebPagelRK7QString @752 NONAME - _ZN23DumpRenderTreeSupportQt25whiteListAccessFromOriginERK7QStringS2_S2_b @753 NONAME - _ZN23DumpRenderTreeSupportQt26counterValueForElementByIdEP9QWebFrameRK7QString @754 NONAME - _ZN23DumpRenderTreeSupportQt26firstRectForCharacterRangeEP8QWebPageii @755 NONAME - _ZN23DumpRenderTreeSupportQt26overwritePluginDirectoriesEv @756 NONAME - _ZN23DumpRenderTreeSupportQt27resetOriginAccessWhiteListsEv @757 NONAME - _ZN23DumpRenderTreeSupportQt27setSmartInsertDeleteEnabledEP8QWebPageb @758 NONAME - _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @759 NONAME - _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @760 NONAME - _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @761 NONAME - _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME - _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @763 NONAME - _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @764 NONAME - _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @765 NONAME - _ZN23DumpRenderTreeSupportQt33computedStyleIncludingVisitedInfoERK11QWebElement @766 NONAME - _ZN23DumpRenderTreeSupportQt34setSelectTrailingWhitespaceEnabledEP8QWebPageb @767 NONAME - _ZN23DumpRenderTreeSupportQt39elementDoesAutoCompleteForElementWithIdEP9QWebFrameRK7QString @768 NONAME - _ZN23DumpRenderTreeSupportQt39setWillSendRequestReturnsNullOnRedirectEb @769 NONAME - _ZN23DumpRenderTreeSupportQt40garbageCollectorCollectOnAlternateThreadEb @770 NONAME - _ZN23DumpRenderTreeSupportQt40setDomainRelaxationForbiddenForURLSchemeEbRK7QString @771 NONAME + _ZN23DumpRenderTreeSupportQt21dumpSetAcceptsEditingEb @ 744 NONAME + _ZN23DumpRenderTreeSupportQt22resumeActiveDOMObjectsEP9QWebFrame @ 745 NONAME + _ZN23DumpRenderTreeSupportQt23suspendActiveDOMObjectsEP9QWebFrame @ 746 NONAME + _ZN23DumpRenderTreeSupportQt24numberOfActiveAnimationsEP9QWebFrame @ 747 NONAME + _ZN23DumpRenderTreeSupportQt24pageNumberForElementByIdEP9QWebFrameRK7QStringff @ 748 NONAME + _ZN23DumpRenderTreeSupportQt25dumpResourceLoadCallbacksEb @ 749 NONAME + _ZN23DumpRenderTreeSupportQt25pauseTransitionOfPropertyEP9QWebFrameRK7QStringdS4_ @ 750 NONAME + _ZN23DumpRenderTreeSupportQt25setFrameFlatteningEnabledEP8QWebPageb @ 751 NONAME + _ZN23DumpRenderTreeSupportQt25webInspectorExecuteScriptEP8QWebPagelRK7QString @ 752 NONAME + _ZN23DumpRenderTreeSupportQt25whiteListAccessFromOriginERK7QStringS2_S2_b @ 753 NONAME + _ZN23DumpRenderTreeSupportQt26counterValueForElementByIdEP9QWebFrameRK7QString @ 754 NONAME + _ZN23DumpRenderTreeSupportQt26firstRectForCharacterRangeEP8QWebPageii @ 755 NONAME + _ZN23DumpRenderTreeSupportQt26overwritePluginDirectoriesEv @ 756 NONAME + _ZN23DumpRenderTreeSupportQt27resetOriginAccessWhiteListsEv @ 757 NONAME + _ZN23DumpRenderTreeSupportQt27setSmartInsertDeleteEnabledEP8QWebPageb @ 758 NONAME + _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @ 759 NONAME + _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @ 760 NONAME + _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @ 761 NONAME + _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @ 762 NONAME + _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @ 763 NONAME + _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @ 764 NONAME + _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @ 765 NONAME + _ZN23DumpRenderTreeSupportQt33computedStyleIncludingVisitedInfoERK11QWebElement @ 766 NONAME + _ZN23DumpRenderTreeSupportQt34setSelectTrailingWhitespaceEnabledEP8QWebPageb @ 767 NONAME + _ZN23DumpRenderTreeSupportQt39elementDoesAutoCompleteForElementWithIdEP9QWebFrameRK7QString @ 768 NONAME + _ZN23DumpRenderTreeSupportQt39setWillSendRequestReturnsNullOnRedirectEb @ 769 NONAME + _ZN23DumpRenderTreeSupportQt40garbageCollectorCollectOnAlternateThreadEb @ 770 NONAME + _ZN23DumpRenderTreeSupportQt40setDomainRelaxationForbiddenForURLSchemeEbRK7QString @ 771 NONAME _ZN23DumpRenderTreeSupportQt18setEditingBehaviorEP8QWebPageRK7QString @ 772 NONAME - _ZN23DumpRenderTreeSupportQt24setNotificationsReceiverEP7QObject @ 773 NONAME - _ZN23DumpRenderTreeSupportQt26allowNotificationForOriginERK7QString @ 774 NONAME - _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME - _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME + _ZN23DumpRenderTreeSupportQt24setNotificationsReceiverEP7QObject @ 773 NONAME ABSENT + _ZN23DumpRenderTreeSupportQt26allowNotificationForOriginERK7QString @ 774 NONAME ABSENT + _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME ABSENT + _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME ABSENT _ZN23DumpRenderTreeSupportQt31removeWhiteListAccessFromOriginERK7QStringS2_S2_b @ 777 NONAME _ZN23DumpRenderTreeSupportQt11shouldCloseEP9QWebFrame @ 778 NONAME _ZN23DumpRenderTreeSupportQt12isTargetItemERK15QWebHistoryItem @ 779 NONAME @@ -799,3 +799,17 @@ EXPORTS _ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME _ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME _ZNK15QWebScriptWorld5worldEv @ 800 NONAME + _ZN16QGraphicsWebView13setDeviceSizeERK5QSize @ 801 NONAME + _ZN23DumpRenderTreeSupportQt12pagePropertyEP9QWebFrameRK7QStringi @ 802 NONAME + _ZN23DumpRenderTreeSupportQt16isPageBoxVisibleEP9QWebFramei @ 803 NONAME + _ZN23DumpRenderTreeSupportQt16resumeAnimationsEP9QWebFrame @ 804 NONAME + _ZN23DumpRenderTreeSupportQt17addUserStyleSheetEP8QWebPageRK7QString @ 805 NONAME + _ZN23DumpRenderTreeSupportQt17suspendAnimationsEP9QWebFrame @ 806 NONAME + _ZN23DumpRenderTreeSupportQt26pageSizeAndMarginsInPixelsEP9QWebFrameiiiiiii @ 807 NONAME + _ZN23DumpRenderTreeSupportQt28setDeferMainResourceDataLoadEb @ 808 NONAME + _ZN8QWebPage17setUserPermissionEP9QWebFrameNS_16PermissionDomainENS_16PermissionPolicyE @ 809 NONAME + _ZN8QWebPage23checkPermissionFromUserEP9QWebFrameNS_16PermissionDomainERNS_16PermissionPolicyE @ 810 NONAME + _ZN8QWebPage25requestPermissionFromUserEP9QWebFrameNS_16PermissionDomainE @ 811 NONAME + _ZN8QWebPage27cancelRequestsForPermissionEP9QWebFrameNS_16PermissionDomainE @ 812 NONAME + _ZNK16QGraphicsWebView10deviceSizeEv @ 813 NONAME + diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index acfeab7..cd0f234 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,76 @@ +2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + Preparation: Just add the files to the build system. + + * WebCoreSupport/WebFrameNetworkingContext.cpp: Added. + Empty placeholder for now. + * WebCoreSupport/WebFrameNetworkingContext.h: Added. + Placeholder with tentative code that might be changed when landing + the rest of it. + * WebKit.vcproj/WebKit.vcproj: Added new files. + +2010-08-17 Brady Eidson <beidson@apple.com> + + Reviewed by Sam Weinig. + + Navigating back/forward during a modal dialog causes a crash when the modal dialog is dismissed. + <rdar://problem/8313579> and https://bugs.webkit.org/show_bug.cgi?id=44131 + + * WebView.cpp: + (WebView::canGoBack): Return false if loads are deferred. + (WebView::canGoForward): Ditto. + +2010-08-16 Kinuko Yasuda <kinuko@chromium.org> + + Unreviewed; build fix attempt for Windows. + + * DefaultDownloadDelegate.cpp: + +2010-08-12 Jeremy Orlow <jorlow@chromium.org> + + Revert for now + https://bugs.webkit.org/show_bug.cgi?id=43794 + + * WebView.cpp: + (WebView::initWithFrame): + +2010-08-12 Jeremy Orlow <jorlow@chromium.org> + + Build fix. Matches solutions in qt and mac ports for + https://bugs.webkit.org/show_bug.cgi?id=43794 + + * WebView.cpp: + (WebView::initWithFrame): + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Build fix (update more includes) + + * WebKitDLL.h: + * WebLocalizableStrings.cpp: + * WebNotificationCenter.cpp: + * WebPreferences.cpp: + +2010-08-10 Chris Marrin <cmarrin@apple.com> + + Reviewed by Oliver Hunt. + + Add suspendAnimations/resumeAnimation API to DRT + https://bugs.webkit.org/show_bug.cgi?id=43733 + + Win specific API + + * Interfaces/IWebFramePrivate.idl: + * WebFrame.cpp: + (WebFrame::suspendAnimations): + (WebFrame::resumeAnimations): + * WebFrame.h: + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/win/DefaultDownloadDelegate.cpp b/WebKit/win/DefaultDownloadDelegate.cpp index cf443b5..29da6a4 100644 --- a/WebKit/win/DefaultDownloadDelegate.cpp +++ b/WebKit/win/DefaultDownloadDelegate.cpp @@ -30,6 +30,7 @@ #include "WebKit.h" #include "WebKitLogging.h" #include "WebMutableURLRequest.h" +#include <wtf/text/CString.h> #include <shlobj.h> #include <tchar.h> diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl index b04edfe..cf25204 100755 --- a/WebKit/win/Interfaces/IWebFramePrivate.idl +++ b/WebKit/win/Interfaces/IWebFramePrivate.idl @@ -90,6 +90,8 @@ interface IWebFramePrivate : IUnknown HRESULT pauseAnimation([in] BSTR animationName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* animationWasRunning); HRESULT pauseTransition([in] BSTR propertyName, [in] IDOMNode* node, [in] double secondsFromNow, [out, retval] BOOL* transitionWasRunning); HRESULT numberOfActiveAnimations([out, retval] UINT* number); + HRESULT suspendAnimations(); + HRESULT resumeAnimations(); HRESULT isDisplayingStandaloneImage([out, retval] BOOL* result); diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl index 8938501..d25cdfe 100644 --- a/WebKit/win/Interfaces/WebKit.idl +++ b/WebKit/win/Interfaces/WebKit.idl @@ -20,7 +20,7 @@ * 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. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ cpp_quote("/*") diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp new file mode 100644 index 0000000..941cfaa --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp @@ -0,0 +1,21 @@ +/* + 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. +*/ + +// Checking this file in empty to get the build system work out of the way. +// Will put the code in here later. diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h new file mode 100644 index 0000000..7fd55d5 --- /dev/null +++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.h @@ -0,0 +1,42 @@ +/* + 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 WebFrameNetworkingContext_h +#define WebFrameNetworkingContext_h + +#include <WebCore/FrameNetworkingContext.h> + +class WebFrameNetworkingContext : public WebCore::FrameNetworkingContext { +public: + static PassRefPtr<WebFrameNetworkingContext> create(WebCore::Frame*, const WTF::String& userAgent); + +private: + WebFrameNetworkingContext(WebCore::Frame* frame, const WTF::String& userAgent) + : WebCore::FrameNetworkingContext(frame) + , m_userAgent(userAgent) + { + } + + virtual WTF::String userAgent() const; + virtual WTF::String referrer() const; + + WTF::String m_userAgent; +}; + +#endif // WebFrameNetworkingContext_h diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index f07821f..500a643 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -1297,6 +1297,34 @@ HRESULT WebFrame::numberOfActiveAnimations(UINT* number) return S_OK; } +HRESULT WebFrame::suspendAnimations() +{ + Frame* frame = core(this); + if (!frame) + return E_FAIL; + + AnimationController* controller = frame->animation(); + if (!controller) + return E_FAIL; + + controller->suspendAnimations(frame->document()); + return S_OK; +} + +HRESULT WebFrame::resumeAnimations() +{ + Frame* frame = core(this); + if (!frame) + return E_FAIL; + + AnimationController* controller = frame->animation(); + if (!controller) + return E_FAIL; + + controller->resumeAnimations(frame->document()); + return S_OK; +} + HRESULT WebFrame::isDisplayingStandaloneImage(BOOL* result) { if (!result) diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h index 6f8b56a..24a7e2b 100644 --- a/WebKit/win/WebFrame.h +++ b/WebKit/win/WebFrame.h @@ -258,6 +258,8 @@ public: virtual HRESULT STDMETHODCALLTYPE pauseTransition(BSTR propertyName, IDOMNode*, double secondsFromNow, BOOL* transitionWasRunning); virtual HRESULT STDMETHODCALLTYPE pauseSVGAnimation(BSTR elementId, IDOMNode*, double secondsFromNow, BOOL* animationWasRunning); virtual HRESULT STDMETHODCALLTYPE numberOfActiveAnimations(UINT*); + virtual HRESULT STDMETHODCALLTYPE suspendAnimations(); + virtual HRESULT STDMETHODCALLTYPE resumeAnimations(); virtual HRESULT STDMETHODCALLTYPE isDisplayingStandaloneImage(BOOL*); diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj index 85e8ee1..822e13c 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.vcproj +++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj @@ -1296,6 +1296,14 @@ >
</File>
<File
+ RelativePath="..\WebCoreSupport\WebFrameNetworkingContext.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebCoreSupport\WebFrameNetworkingContext.h"
+ >
+ </File>
+ <File
RelativePath="..\WebCoreSupport\WebGeolocationControllerClient.cpp"
>
</File>
diff --git a/WebKit/win/WebKitDLL.h b/WebKit/win/WebKitDLL.h index c31bc2d..8ba5b8e 100644 --- a/WebKit/win/WebKitDLL.h +++ b/WebKit/win/WebKitDLL.h @@ -33,8 +33,8 @@ #include <winsock2.h> #include <windows.h> #include <wtf/HashCountedSet.h> +#include <wtf/text/StringHash.h> #include <WebCore/PlatformString.h> -#include <WebCore/StringHash.h> #ifdef WEBKIT_EXPORTS #define WEBKIT_API __declspec(dllexport) diff --git a/WebKit/win/WebLocalizableStrings.cpp b/WebKit/win/WebLocalizableStrings.cpp index ab2db5d..da6b221 100644 --- a/WebKit/win/WebLocalizableStrings.cpp +++ b/WebKit/win/WebLocalizableStrings.cpp @@ -30,8 +30,8 @@ #pragma warning(push, 0) #include <WebCore/PlatformString.h> -#include <WebCore/StringHash.h> #include <wtf/text/CString.h> +#include <wtf/text/StringHash.h> #pragma warning(pop) #include <wtf/Assertions.h> diff --git a/WebKit/win/WebNotificationCenter.cpp b/WebKit/win/WebNotificationCenter.cpp index 919f499..6c22224 100644 --- a/WebKit/win/WebNotificationCenter.cpp +++ b/WebKit/win/WebNotificationCenter.cpp @@ -31,10 +31,10 @@ #pragma warning(push, 0) #include <WebCore/COMPtr.h> #include <WebCore/PlatformString.h> -#include <WebCore/StringHash.h> #include <wtf/HashMap.h> #include <wtf/HashTraits.h> #include <wtf/Vector.h> +#include <wtf/text/StringHash.h> #pragma warning(pop) #include <tchar.h> #include <utility> diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index 25cfbda..255b68e 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -32,10 +32,10 @@ #include "WebNotificationCenter.h" #include "WebPreferenceKeysPrivate.h" +#include <wtf/text/StringHash.h> #include <WebCore/FileSystem.h> #include <WebCore/Font.h> #include <WebCore/PlatformString.h> -#include <WebCore/StringHash.h> #include <WebCore/WKCACFLayerRenderer.h> #include "WebLocalizableStrings.h" diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index c307c02..6d610a1 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -3694,7 +3694,7 @@ HRESULT STDMETHODCALLTYPE WebView::canGoBack( /* [in] */ IUnknown* /*sender*/, /* [retval][out] */ BOOL* result) { - *result = !!m_page->backForwardList()->backItem(); + *result = !!(m_page->backForwardList()->backItem() && !m_page->defersLoading()); return S_OK; } @@ -3709,7 +3709,7 @@ HRESULT STDMETHODCALLTYPE WebView::canGoForward( /* [in] */ IUnknown* /*sender*/, /* [retval][out] */ BOOL* result) { - *result = !!m_page->backForwardList()->forwardItem(); + *result = !!(m_page->backForwardList()->forwardItem() && !m_page->defersLoading()); return S_OK; } diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index b66bf69..342edea 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,66 @@ +2010-08-16 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fix, do not build WebCore as a convenience library as this leads to + errors in the Win build w/export symbols and causes problems with DOM bindings + debugging in gdb. + + * WebKitDefines.h: + * bindings/python/wscript: + +2010-08-16 Kevin Ollivier <kevino@theolliviers.com> + + wxMSW build fix. Don't build the Python DOM bindings until we get the export issues + sorted out. + + * bindings/python/webview.i: + +2010-08-13 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Sam Weinig + + Unify UString::UTF8String() & String::utf8() methods, + remove UString::cost() & make atArrayIndex a free function. + + * WebFrame.cpp: + (wxWebFrame::RunScript): + +2010-08-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r65295. + http://trac.webkit.org/changeset/65295 + https://bugs.webkit.org/show_bug.cgi?id=43950 + + It broke 4 sputnik tests (Requested by Ossy on #webkit). + + * WebFrame.cpp: + (wxWebFrame::RunScript): + +2010-08-12 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Sam Weinig + + Unify UString::UTF8String() & String::utf8() methods, + remove UString::cost() & make atArrayIndex a free function. + + * WebFrame.cpp: + (wxWebFrame::RunScript): + +2010-08-11 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fix. WebCore::String -> WTF::String fixes. + + * WebEdit.cpp: + (wxWebEditCommand::SetNodeAttribute): + +2010-08-10 Gavin Barraclough <barraclough@apple.com> + + Rubber stamped by Sam Weinig. + + Bug 43786 - Move AtomicStringHash from WebCore to WTF + Also remove deprecated string headers from WebCore/platform/text. + + * WebEdit.cpp: + 2010-08-06 Gavin Barraclough <barraclough@apple.com> Rubber stamped by Sam Weinig diff --git a/WebKit/wx/WebEdit.cpp b/WebKit/wx/WebEdit.cpp index 22ad193..503e2ed 100644 --- a/WebKit/wx/WebEdit.cpp +++ b/WebKit/wx/WebEdit.cpp @@ -3,7 +3,6 @@ #include "config.h" #include "WebEdit.h" -#include "AtomicString.h" #include "CompositeEditCommand.h" #include "Document.h" #include "Frame.h" @@ -13,6 +12,7 @@ #include "WebFrame.h" #include "WebDOMElement.h" +#include <wtf/text/AtomicString.h> namespace WebCore { @@ -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, WTF::String(name), WebCore::nullAtom), WTF::String(value)); + m_impl->setElementAttribute(element->impl(), WebCore::QualifiedName(WTF::nullAtom, WTF::String(name), WTF::nullAtom), WTF::String(value)); } void wxWebEditCommand::Apply() diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp index 182004b..f9be56f 100644 --- a/WebKit/wx/WebFrame.cpp +++ b/WebKit/wx/WebFrame.cpp @@ -233,7 +233,7 @@ wxString wxWebFrame::RunScript(const wxString& javascript) if (jsEnabled) { JSC::JSValue result = controller->executeScript(javascript, true).jsValue(); if (result) - returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).UTF8String().data(), wxConvUTF8); + returnValue = wxString(result.toString(m_impl->frame->script()->globalObject(WebCore::mainThreadNormalWorld())->globalExec()).utf8().data(), wxConvUTF8); } } } diff --git a/WebKit/wx/WebKitDefines.h b/WebKit/wx/WebKitDefines.h index 67ad868..66e4216 100644 --- a/WebKit/wx/WebKitDefines.h +++ b/WebKit/wx/WebKitDefines.h @@ -34,7 +34,7 @@ #define WXDLLIMPEXP_WEBKIT __attribute__ ((visibility("default"))) #elif defined(WXMAKINGDLL_WEBKIT) #define WXDLLIMPEXP_WEBKIT WXEXPORT -#elif defined(WXUSINGDLL_WEBKIT) +#else #define WXDLLIMPEXP_WEBKIT WXIMPORT #endif diff --git a/WebKit/wx/bindings/python/webview.i b/WebKit/wx/bindings/python/webview.i index 58961c0..8e3c808 100644 --- a/WebKit/wx/bindings/python/webview.i +++ b/WebKit/wx/bindings/python/webview.i @@ -50,6 +50,7 @@ #include "WebDOMObject.h" #include "WebDOMRange.h" +#ifndef __WXMSW__ PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn) { //static wxPyTypeInfoHashMap* typeInfoCache = NULL; @@ -86,6 +87,7 @@ PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn) return Py_None; } +#endif %} //--------------------------------------------------------------------------- @@ -93,8 +95,12 @@ PyObject* createDOMNodeSubtype(WebDOMNode* ptr, bool setThisOwn) %import core.i %import windows.i +#ifndef __WXMSW__ %typemap(out) WebDOMNode* { $result = createDOMNodeSubtype($1, (bool)$owner); } %typemap(out) WebDOMElement* { $result = createDOMNodeSubtype($1, (bool)$owner); } +%typemap(out) WebDOMNode { $result = createDOMNodeSubtype(&$1, (bool)$owner); } +%typemap(out) WebDOMElement { $result = createDOMNodeSubtype(&$1, (bool)$owner); } +#endif MAKE_CONST_WXSTRING(WebViewNameStr); @@ -104,6 +110,7 @@ MustHaveApp(wxWebView); %include WebKitDefines.h +#ifndef __WXMSW__ %include WebDOMObject.h %include WebDOMNode.h @@ -112,6 +119,7 @@ MustHaveApp(wxWebView); %include WebDOMElement.h %include WebDOMNodeList.h %include WebDOMRange.h +#endif %include WebBrowserShell.h %include WebDOMSelection.h diff --git a/WebKit/wx/bindings/python/wscript b/WebKit/wx/bindings/python/wscript index 617a839..cd07836 100644 --- a/WebKit/wx/bindings/python/wscript +++ b/WebKit/wx/bindings/python/wscript @@ -53,15 +53,6 @@ def wxpy_swig_include(): return fullpath return '' - -def set_options(opt): - common_set_options(opt) - -def configure(conf): - if Options.options.wxpython: - common_configure(conf) - conf.check_tool('swig', tooldir='.') - conf.check_swig_version('1.3.29') def build(bld): if Options.options.wxpython: @@ -94,9 +85,9 @@ def build(bld): swig_flags = ' '.join(wx_swig_args), defines = defines, target = '_webview', - uselib = 'WX CURL ICU XSLT XML SQLITE3 WXWEBKIT ' + get_config(), + uselib = 'WX CURL ICU XSLT XML SQLITE3 ' + get_config(), libpath = [output_dir], - uselib_local = '', + uselib_local = 'wxwebkit', install_path = output_dir ) |