diff options
Diffstat (limited to 'WebKit')
202 files changed, 8404 insertions, 1607 deletions
diff --git a/WebKit/CMakeListsEfl.txt b/WebKit/CMakeListsEfl.txt index cbc0d92..7eeddeb 100644 --- a/WebKit/CMakeListsEfl.txt +++ b/WebKit/CMakeListsEfl.txt @@ -39,6 +39,7 @@ LIST(APPEND WebKit_SOURCES efl/ewk/ewk_util.cpp efl/ewk/ewk_view.cpp efl/ewk/ewk_view_single.c + efl/ewk/ewk_window_features.cpp ) LIST(APPEND WebKit_LIBRARIES @@ -95,6 +96,12 @@ ADD_EXECUTABLE(../Programs/EWebLauncher ${EWebLauncher_SOURCES}) TARGET_LINK_LIBRARIES(../Programs/EWebLauncher ${EWebLauncher_LIBRARIES}) ADD_TARGET_PROPERTIES(../Programs/EWebLauncher LINK_FLAGS ${EWebLauncher_LINK_FLAGS}) +IF (SHARED_CORE) + SET(LIBS_PRIVATE "-l${WTF_LIBRARY_NAME} -l${JavaScriptCore_LIBRARY_NAME} -l${WebCore_LIBRARY_NAME}") +ELSE () + SET(LIBS_PRIVATE "") +ENDIF () + CONFIGURE_FILE( efl/ewebkit.pc.in ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc @@ -102,6 +109,8 @@ CONFIGURE_FILE( INSTALL(FILES ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc DESTINATION lib/pkgconfig) +UNSET(LIBS_PRIVATE) + FILE(GLOB EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/*.h") LIST(REMOVE_ITEM EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_private.h") diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 77dc9cf..fc1195b 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,184 @@ +2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Stop frame loaders when deleting view. + Frame loaders were still alive after view is deleted, causing + segmentation fault when libsoup had something to deliver yet. + https://bugs.webkit.org/show_bug.cgi?id=41007 + + * efl/ewk/ewk_view.cpp: + (_ewk_view_smart_del): stop loaders. + +2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Fix warnings about printf format + When printing uint64_t the macro PRIu64 is needed in order to be + portable across 32 and 64 bits. It was previously showing warning + messages on 32-bits systems. + https://bugs.webkit.org/show_bug.cgi?id=40965 + + * efl/ewk/ewk_view.cpp: + (ewk_view_exceeded_database_quota): + +2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Do not load error message for download and cancellation. + When a download is made or a request is cancelled an error page should + not be shown. + https://bugs.webkit.org/show_bug.cgi?id=40956 + + * efl/WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading): return if it + should not fallback. + (WebCore::FrameLoaderClientEfl::dispatchDidFailLoad): return if it + should not fallback. + (WebCore::FrameLoaderClientEfl::interruptForPolicyChangeError): fix + typo in related error message. + (WebCore::FrameLoaderClientEfl::shouldFallBack): if user cancelled the + request or the policy changed (for example, because the request is a + download) then it should not fallback. + +2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Implement runOpenPanel method. The interface with browser was + already implemented. Now we are actually calling it. + https://bugs.webkit.org/show_bug.cgi?id=40923 + + * efl/WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::runOpenPanel): implement method. + * efl/ewk/ewk_private.h: export to WebCoreSupport the needed method + +2010-06-24 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + Full-screened content doesn't keep the display on: Safari not grabbing a power assertion? + https://bugs.webkit.org/show_bug.cgi?id=40939 + rdar://problem/7996172 + + Add IOKit.framework to the list of linked frameworks. + + * WebKit.xcodeproj/project.pbxproj: + +2010-06-23 Leandro Pereira <leandro@profusion.mobi> + + Reviewed by Gustavo Noronha Silva. + + [EFL] Add Libs.private to ewebkit.pc when building with SHARED_CORE. + https://bugs.webkit.org/show_bug.cgi?id=40862 + + * CMakeListsEfl.txt: + * efl/ewebkit.pc.in: + +2010-06-23 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Gustavo Noronha Silva. + + Add implementaion of new windows for EFL port. Both cases of a link + with target="_blank" and a javascript that does window.open() are + treated, delegating to browser the role of actually creating the + window (or blocking it). + https://bugs.webkit.org/show_bug.cgi?id=40930 + + * CMakeListsEfl.txt: add new file that wraps the WindowFeatures struct + * efl/WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::createWindow): implement method for + creating new window by delegating to browser its creation. Browser + might decide to continue on the same window by returning the same + view object. + * efl/WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchCreatePage): implement method + for creating new window when its creation is done by a javascript + script. + * efl/ewk/EWebKit.h: new header for WindowFeatures. + * efl/ewk/ewk_private.h: + * efl/ewk/ewk_view.cpp: + (ewk_view_window_create): call the method implemented by browser. + * efl/ewk/ewk_view.h: + * efl/ewk/ewk_window_features.cpp: Added. + (ewk_window_features_unref): + (ewk_window_features_ref): + (ewk_window_features_bool_property_get): + (ewk_window_features_int_property_get): + (ewk_window_features_new_from_core): create and wrapped struct + containing the core struct. + * efl/ewk/ewk_window_features.h: Added. + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Rename WebPluginPackage.m to make it an Objective-C++ file. + + * WebKit.xcodeproj/project.pbxproj: + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make WebCoreSystemInterface.h a C++ only header + https://bugs.webkit.org/show_bug.cgi?id=40867 + + * WebKit.xcodeproj/project.pbxproj: + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add stubbed out WebPlatformStrategies class to WebKit. + https://bugs.webkit.org/show_bug.cgi?id=40851 + + * WebKit.xcodeproj/project.pbxproj: + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [qt] Better check for the declarative plugin inclusion. + + * WebKit.pro: + +2010-06-17 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Eric Seidel. + + Clean EFL header files in order to diminish the compilation time with + EFL from subversion. We remove the EFL includes from header files and use + forward declarations, including the headers in correspondent source + files when needed. This causes only the needed source files to be + recompiled in case a new version of EFL is installed instead of + triggering a recompilation of almost all WebCore/WebKit. + https://bugs.webkit.org/show_bug.cgi?id=40575 + + * efl/WebCoreSupport/ChromeClientEfl.cpp: include needed header. + * efl/WebCoreSupport/ChromeClientEfl.h: forward declaration. + * efl/WebCoreSupport/EditorClientEfl.h: forward declaration. + +2010-06-15 Gustavo Noronha Silva <gns@gnome.org> + + Unreviewed EFL build fix. Simple typo. + + * efl/WebCoreSupport/InspectorClientEfl.cpp: + (WebCore::InspectorClientEfl::sendMessageToFrontend): + +2010-06-14 Tony Chang <tony@chromium.org> + + Reviewed by Darin Fisher. + + Chromium shouldn't build inside the source directory + https://bugs.webkit.org/show_bug.cgi?id=40489 + + Ignore directories fetched by chromium and chromium mac output dir. + + * chromium: Added property svn:ignore. + 2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj index 2972a3d..66d2cd3 100644 --- a/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/WebKit/WebKit.xcodeproj/project.pbxproj @@ -42,6 +42,8 @@ 1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */; }; 1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */; }; 1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */; }; + 1AA879B611CBE9BF003C664F /* WebPlatformStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */; }; + 1AA879B711CBE9BF003C664F /* WebPlatformStrategies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */; }; 1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */; settings = {ATTRIBUTES = (Private, ); }; }; 1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -262,7 +264,7 @@ 939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */; }; 939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; }; 939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717210288493C018635CA /* WebPluginDatabase.mm */; }; - 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.m */; }; + 939810DC0824BF01008DF038 /* WebPluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.mm */; }; 939810DD0824BF01008DF038 /* npapi.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717230288493C018635CA /* npapi.mm */; }; 939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */; }; 939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */; }; @@ -309,7 +311,7 @@ 9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */; }; 9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D623DD051E791F002F47DD /* libicucore.dylib */; }; 9398112F0824BF01008DF038 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830E81E005853AC000AD0891 /* Security.framework */; }; - 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.m */; }; + 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */; }; 93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; }; 93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; }; A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A70936AD0B5608DC00CDB48E /* WebDragClient.h */; }; @@ -340,6 +342,7 @@ C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; }; C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */; }; + CD8EAC7311CAC9A300774075 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD8EAC7211CAC9A300774075 /* IOKit.framework */; }; DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; }; DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; }; DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; }; @@ -392,6 +395,8 @@ 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginRequest.m; sourceTree = "<group>"; }; 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostedNetscapePluginStream.h; sourceTree = "<group>"; }; 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HostedNetscapePluginStream.mm; sourceTree = "<group>"; }; + 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPlatformStrategies.h; sourceTree = "<group>"; }; + 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPlatformStrategies.mm; sourceTree = "<group>"; }; 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgent.defs; sourceTree = "<group>"; }; 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgentReply.defs; sourceTree = "<group>"; }; 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginClient.defs; sourceTree = "<group>"; }; @@ -546,7 +551,7 @@ 83E4AF46036652150000E506 /* WebBasePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBasePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF47036652150000E506 /* WebBasePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBasePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E4AF4B036659440000E506 /* WebPluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; - 83E4AF4C036659440000E506 /* WebPluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; + 83E4AF4C036659440000E506 /* WebPluginPackage.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84311A1205EAAAF00088EDA4 /* WebResource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 84311A1305EAAAF00088EDA4 /* WebResource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebResource.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -592,7 +597,7 @@ 93C6F14507920B93002449CD /* WebFrameViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSObjectExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 93D623DD051E791F002F47DD /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; }; - 93EB178C09F88D460091F8FF /* WebSystemInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSystemInterface.m; sourceTree = "<group>"; }; + 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemInterface.mm; sourceTree = "<group>"; }; 93EB178E09F88D510091F8FF /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; }; 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryInternal.h; sourceTree = "<group>"; }; 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -638,6 +643,7 @@ C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegatePrivate.h; sourceTree = "<group>"; }; C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentURLPattern.h; sourceTree = "<group>"; }; C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebUserContentURLPattern.mm; sourceTree = "<group>"; }; + CD8EAC7211CAC9A300774075 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; }; DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; }; DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -726,6 +732,7 @@ 1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */, 9398112F0824BF01008DF038 /* Security.framework in Frameworks */, 9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */, + CD8EAC7311CAC9A300774075 /* IOKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -771,6 +778,7 @@ 0867D69AFE84028FC02AAC07 /* Frameworks and Libraries */ = { isa = PBXGroup; children = ( + CD8EAC7211CAC9A300774075 /* IOKit.framework */, F5C2869402846DCD018635CA /* Carbon.framework */, F5C2869502846DCD018635CA /* Cocoa.framework */, F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */, @@ -1081,7 +1089,7 @@ 8467275C0367158500CA2ACA /* WebPluginController.h */, 8467275D0367158500CA2ACA /* WebPluginController.mm */, 83E4AF4B036659440000E506 /* WebPluginPackage.h */, - 83E4AF4C036659440000E506 /* WebPluginPackage.m */, + 83E4AF4C036659440000E506 /* WebPluginPackage.mm */, 225F881409F97E8A00423A40 /* WebPluginPrivate.h */, 848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */, 83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */, @@ -1242,10 +1250,12 @@ 84723BE4056D719E0044BFEA /* WebKeyGenerator.m */, A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */, A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */, + 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */, + 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */, 0A2D87FB107AF52B00CDDEE3 /* WebPluginHalterClient.h */, 0A2D87FC107AF52B00CDDEE3 /* WebPluginHalterClient.mm */, 93EB178E09F88D510091F8FF /* WebSystemInterface.h */, - 93EB178C09F88D460091F8FF /* WebSystemInterface.m */, + 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */, F5F7174C02885C5B018635CA /* WebViewFactory.h */, F5F7174D02885C5B018635CA /* WebViewFactory.mm */, ); @@ -1539,6 +1549,7 @@ 0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */, 41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */, C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */, + 1AA879B611CBE9BF003C664F /* WebPlatformStrategies.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1869,7 +1880,7 @@ 939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */, 939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */, 0A2D87FE107AF52B00CDDEE3 /* WebPluginHalterClient.mm in Sources */, - 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */, + 939810DC0824BF01008DF038 /* WebPluginPackage.mm in Sources */, 1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */, 224100F90918190100D2D266 /* WebPluginsPrivate.m in Sources */, 939811080824BF01008DF038 /* WebPolicyDelegate.mm in Sources */, @@ -1882,7 +1893,7 @@ 51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */, BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */, 939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */, - 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */, + 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */, 936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */, 1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */, F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */, @@ -1896,6 +1907,7 @@ 0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */, 41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */, C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */, + 1AA879B711CBE9BF003C664F /* WebPlatformStrategies.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 452c79d..2a56d9d 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,826 @@ +2010-06-25 Lei Zheng <lzheng@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Add a flag to the ResourceResponse for tracking if a request was fetched + when Alternate-Protocol is available. + + https://bugs.webkit.org/show_bug.cgi?id=41001 + + * public/WebURLResponse.h: + * src/WebURLResponse.cpp: + (WebKit::WebURLResponse::wasAlternateProtocolAvailable): + (WebKit::WebURLResponse::setWasAlternateProtocolAvailable): + +2010-06-25 Michael Nordman <michaeln@google.com> + + Reviewed by Dumitru Daniliuc. + + Additional API to pass additional info needed for AppCache progress events. + https://bugs.webkit.org/show_bug.cgi?id=37602 + + Also, delete an obsolete method from the worker API. + + * public/WebApplicationCacheHostClient.h: define a new method + * public/WebSharedWorker.h: remove an obsolte method + * src/ApplicationCacheHostInternal.h: implement the new method + (WebCore::ApplicationCacheHostInternal::notifyProgressEventListener): + +2010-06-25 John Gregg <johnnyg@google.com> + + Reviewed by Darin Fisher. + + Notification should expose ltr/rtl as TextDirection, not String + https://bugs.webkit.org/show_bug.cgi?id=40871 + + * public/WebNotification.h: + * src/WebNotification.cpp: + (WebKit::WebNotification::direction): + +2010-06-24 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Clean up and document DocumentWriter::replaceDocument code path + https://bugs.webkit.org/show_bug.cgi?id=41182 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::loadJavaScriptURL): + - Make Chromium use DocumentWriter like it should. + +2010-06-24 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] A WebView can now own a GLES2Context which gets created on + demand. This context will typically be created for the gpu compositor + and used as a parent context for any elements on the page that use the + gpu for rendering (e.g. WebGL) and need to pass their backbuffer directly + to the compositor. + https://bugs.webkit.org/show_bug.cgi?id=41010 + + * public/WebGLES2Context.h: + * src/GLES2Context.cpp: + (WebCore::GLES2ContextInternal::getWebGLES2Context): + (WebCore::GLES2ContextInternal::initialize): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::gles2Context): + * src/WebViewImpl.h: + +2010-06-24 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Inspector cleanup + better DevTools alignment with Inspector. + + https://bugs.webkit.org/show_bug.cgi?id=41094 + + - Merged InspectorClient implementation into WebDevToolsAgent + - Changed the way WebDevToolsAgent is initialized (will break chromium bot, needs coordinated landing) + - Removed a lot of legacy code from WebDevToolsAgentImpl + - Removed a lot of overrides from DevTools.js + - Simplified devtools stubs + - Got rid of all logic from within InjectDispatch.js + + * public/WebView.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad): + * src/InspectorClientImpl.cpp: + (WebKit::InspectorClientImpl::inspectorDestroyed): + (WebKit::InspectorClientImpl::openInspectorFrontend): + (WebKit::InspectorClientImpl::highlight): + (WebKit::InspectorClientImpl::hideHighlight): + (WebKit::InspectorClientImpl::populateSetting): + (WebKit::InspectorClientImpl::storeSetting): + (WebKit::InspectorClientImpl::sendMessageToFrontend): + (WebKit::InspectorClientImpl::resourceTrackingWasEnabled): + (WebKit::InspectorClientImpl::resourceTrackingWasDisabled): + (WebKit::InspectorClientImpl::timelineProfilerWasStarted): + (WebKit::InspectorClientImpl::timelineProfilerWasStopped): + (WebKit::InspectorClientImpl::devToolsAgent): + * src/InspectorClientImpl.h: + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::inspectedURLChanged): + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient): + (WebKit::WebDevToolsAgentImpl::inspectorDestroyed): + (WebKit::WebDevToolsAgentImpl::openInspectorFrontend): + (WebKit::WebDevToolsAgentImpl::highlight): + (WebKit::WebDevToolsAgentImpl::hideHighlight): + (WebKit::WebDevToolsAgentImpl::populateSetting): + (WebKit::WebDevToolsAgentImpl::storeSetting): + (WebKit::WebDevToolsAgentImpl::sendMessageToFrontend): + (WebKit::WebDevToolsAgentImpl::resourceTrackingWasEnabled): + (WebKit::WebDevToolsAgentImpl::resourceTrackingWasDisabled): + (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStarted): + (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStopped): + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsAgentPrivate.h: + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + * src/js/DevTools.js: + (devtools.ToolsAgent): + (): + (devtools): + * src/js/DevToolsHostStub.js: + (.window.setDebuggerScriptSource): + (.window.dispatchOnInjectedScript): + * src/js/InjectDispatch.js: + (dispatch): + * src/js/InspectorControllerImpl.js: + +2010-06-24 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: revert 61766. + + * WebKit.gyp: + * public/WebView.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad): + * src/InspectorClientImpl.cpp: Added. + (WebKit::InspectorClientImpl::InspectorClientImpl): + (WebKit::InspectorClientImpl::~InspectorClientImpl): + (WebKit::InspectorClientImpl::inspectorDestroyed): + (WebKit::InspectorClientImpl::openInspectorFrontend): + (WebKit::invalidateNodeBoundingRect): + (WebKit::InspectorClientImpl::highlight): + (WebKit::InspectorClientImpl::hideHighlight): + (WebKit::InspectorClientImpl::populateSetting): + (WebKit::InspectorClientImpl::storeSetting): + (WebKit::InspectorClientImpl::sendMessageToFrontend): + * src/InspectorClientImpl.h: Added. + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::inspectedURLChanged): + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::didCommitProvisionalLoad): + (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient): + (WebKit::WebDevToolsAgentImpl::jsDispatchToApu): + (WebKit::WebDevToolsAgentImpl::jsEvaluateOnSelf): + (WebKit::WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged): + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsAgentPrivate.h: + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setDevToolsAgent): + * src/WebViewImpl.h: + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::initializeLoader): + * src/js/DevTools.js: + (devtools.ToolsAgent): + (devtools.ToolsAgent.prototype.frameNavigate_): + (): + * src/js/DevToolsHostStub.js: + (.RemoteDebuggerAgentStub): + (.RemoteDebuggerAgentStub.prototype.getContextId): + (.RemoteDebuggerAgentStub.prototype.processDebugCommands): + (.RemoteProfilerAgentStub): + (.RemoteProfilerAgentStub.prototype.getActiveProfilerModules): + (.RemoteProfilerAgentStub.prototype.getLogLines): + (.RemoteToolsAgentStub): + (.RemoteToolsAgentStub.prototype.dispatchOnInjectedScript): + (.RemoteToolsAgentStub.prototype.dispatchOnInspectorController): + (.ProfilerStubHelper): + (.ProfilerStubHelper.GetInstance): + (.ProfilerStubHelper.prototype.StopProfiling): + (.ProfilerStubHelper.prototype.StartProfiling): + (.ProfilerStubHelper.prototype.getActiveProfilerModules): + (.ProfilerStubHelper.prototype.getLogLines): + (.RemoteDebuggerCommandExecutorStub): + (.RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand): + (.RemoteDebuggerCommandExecutorStub.prototype.DebuggerPauseScript): + (.RemoteDebuggerCommandExecutorStub.prototype.sendResponse_): + (.DevToolsHostStub): + (.DevToolsHostStub.prototype.reset): + (.DevToolsHostStub.prototype.setting): + (.DevToolsHostStub.prototype.setSetting): + * src/js/InjectDispatch.js: + (ApuAgentDispatcher.dispatchToApu): + (dispatch): + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl.prototype.debuggerEnabled): + (devtools.InspectorBackendImpl.prototype.profilerEnabled): + +2010-06-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Inspector cleanup + better DevTools alignment with Inspector. + + https://bugs.webkit.org/show_bug.cgi?id=41094 + + - Merged InspectorClient implementation into WebDevToolsAgent + - Changed the way WebDevToolsAgent is initialized (will break chromium bot, needs coordinated landing) + - Removed a lot of legacy code from WebDevToolsAgentImpl + - Removed a lot of overrides from DevTools.js + - Simplified devtools stubs + - Got rid of all logic from within InjectDispatch.js + + * WebKit.gyp: + * public/WebDevToolsAgent.h: + * public/WebView.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad): + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::inspectedURLChanged): + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient): + (WebKit::WebDevToolsAgentImpl::inspectorDestroyed): + (WebKit::WebDevToolsAgentImpl::openInspectorFrontend): + (WebKit::WebDevToolsAgentImpl::highlight): + (WebKit::WebDevToolsAgentImpl::hideHighlight): + (WebKit::WebDevToolsAgentImpl::populateSetting): + (WebKit::WebDevToolsAgentImpl::storeSetting): + (WebKit::WebDevToolsAgentImpl::sendMessageToFrontend): + (WebKit::WebDevToolsAgentImpl::resourceTrackingWasEnabled): + (WebKit::WebDevToolsAgentImpl::resourceTrackingWasDisabled): + (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStarted): + (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStopped): + * src/WebDevToolsAgentImpl.h: + * src/WebDevToolsAgentPrivate.h: + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::initializeLoader): + * src/js/DevTools.js: + (devtools.ToolsAgent): + (): + (devtools): + * src/js/DevToolsHostStub.js: + (.window.setDebuggerScriptSource): + (.window.dispatchOnInjectedScript): + * src/js/InjectDispatch.js: + (dispatch): + * src/js/InspectorControllerImpl.js: + +2010-06-24 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: implement layout tests for debugger + https://bugs.webkit.org/show_bug.cgi?id=40774 + + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl): + +2010-06-23 Tony Chang <tony@chromium.org> + + Reviewed by Darin Fisher. + + layout test for a crash in chromium multipart request handling + https://bugs.webkit.org/show_bug.cgi?id=41050 + + Also roll DEPS to pick up the crash fix. + + * DEPS: + +2010-06-23 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Make page format data methods accessible from Chromium + https://bugs.webkit.org/show_bug.cgi?id=41056 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::isPageBoxVisible): + (WebKit::WebFrameImpl::pageAreaRectInPixels): + (WebKit::WebFrameImpl::preferredPageSizeInPixels): + * src/WebFrameImpl.h: + +2010-06-22 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename HTMLDocumentParser to LegacyHTMLDocumentParser + https://bugs.webkit.org/show_bug.cgi?id=41043 + + * src/WebEntities.cpp: + +2010-06-22 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: follow up to r61655 to make Chromium tests happy. + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-06-22 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Clean up after removal of static WebDevToolsAgentClient::sendMessageToFrontendOnIOThread. + + https://bugs.webkit.org/show_bug.cgi?id=40914 + + * public/WebDevToolsAgentClient.h: + +2010-06-22 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Add a sanity test for heap profiler. + + https://bugs.webkit.org/show_bug.cgi?id=40917 + + * src/js/Tests.js: + (.TestSuite.prototype.testHeapProfiler.findDisplayedNode): + (.TestSuite.prototype.testHeapProfiler.findVisibleView): + (.TestSuite.prototype.testHeapProfiler): + +2010-06-21 MORITA Hajime <morrita@google.com> + + Reviewed by Darin Fisher. + + [Chromium] Dragging outside the frame immediately causes page to scroll + http://webkit.org/b/40461 + + This is regression that was introduced at http://webkit.org/b/39725. + + There are 2 problems: + 1. It starts auto-scrolling immediately. We should have some delay. + 2. The scroll continues even after a mouse cursor goes outside a frame. + The scroll should be stopped when the curosr has left. + + This change introduced DragScrollTimer to handle 1. + At the same time, it fixed DragScrollTimer::scrollDistanceFor() to + handle 2, We now stop scrolling when the cursor gone. + + * WebKit.gyp: + * src/DragScrollTimer.cpp: Added. + (WebKit::distanceToRect): + (WebKit::DragScrollTimer::DragScrollTimer): + (WebKit::DragScrollTimer::~DragScrollTimer): + (WebKit::DragScrollTimer::stop): + (WebKit::DragScrollTimer::scroll): + (WebKit::DragScrollTimer::update): + (WebKit::DragScrollTimer::triggerScroll): + (WebKit::DragScrollTimer::scrollDistanceFor): + * src/DragScrollTimer.h: Added. + (WebKit::DragScrollTimer::fired): + (WebKit::DragScrollTimer::shouldScroll): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::dragSourceEndedAt): + (WebKit::WebViewImpl::dragSourceMovedTo): + (WebKit::WebViewImpl::dragTargetDrop): + (WebKit::WebViewImpl::dragTargetDragEnterOrOver): + * src/WebViewImpl.h: + +2010-06-21 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Enable EVENTSOURCE, FILE_WRITER, and IMAGE_RESIZER + https://bugs.webkit.org/show_bug.cgi?id=40905 + + EVENTSOURCE: It is already enabled in Chromium browser. This fixes + some tests with Chromium DRT. + + FILE_WRITER and IMAGE_RESIZER: Enable experimental features in + order to test them before enabling them in Chromium browser. + + * features.gypi: + +2010-06-21 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Speech Input Patch 0: Added compilation argument to conditionally compile pending patches. + https://bugs.webkit.org/show_bug.cgi?id=40878 + + * features.gypi: + +2010-06-21 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Yury Semikhatsky. + + [Chromium] Remove usage of static WebDevToolsAgentClient::sendMessageToFrontendOnIOThread. + + Also, move WebDevToolsMessageTransport to its own header file. + + https://bugs.webkit.org/show_bug.cgi?id=40913 + + * DEPS: + * WebKit.gyp: + * public/WebDevToolsAgent.h: + * public/WebDevToolsAgentClient.h: + * public/WebDevToolsMessageTransport.h: Added. + (WebKit::WebDevToolsMessageTransport::~WebDevToolsMessageTransport): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + +2010-06-20 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [v8] Web Inspector: don't add ScriptDebugServer as v8 listener if browser exposes + v8 debugging protocol. + + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol): + +2010-06-19 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Adding a < operator to WebURLs so they can be used in std::maps. + https://bugs.webkit.org/show_bug.cgi?id=40632 + + * public/WebCString.h: + (WebKit::operator<): + * public/WebURL.h: + (WebKit::operator<): + * src/WebCString.cpp: + (WebKit::WebCString::compare): + +2010-06-19 Kent Tamura <tkent@chromium.org> + + Unreviewed. Build fix for r61488. + + * features.gypi: Define use_accelerated_compositing. + +2010-06-19 Thomas Van Lenten <thomasvl@chromium.org> + + Reviewed by David Levin. + + Warnings from -Wextra in a Chromium Mac build + 1. checks of unsigned >= 0 + 2. enumeral and non-enumeral type in conditional expression + 3. copy ctors that don't call the super copy ctor or ctor + + https://bugs.webkit.org/show_bug.cgi?id=40791 + + * src/AutoFillPopupMenuClient.cpp: + (WebKit::AutoFillPopupMenuClient::getSuggestion): + (WebKit::AutoFillPopupMenuClient::removeSuggestionAtIndex): + (WebKit::AutoFillPopupMenuClient::valueChanged): + (WebKit::AutoFillPopupMenuClient::selectionChanged): + * src/AutocompletePopupMenuClient.cpp: + (WebKit::AutocompletePopupMenuClient::getSuggestion): + (WebKit::AutocompletePopupMenuClient::removeSuggestionAtIndex): + +2010-06-19 Zhe Su <suzhe@chromium.org> + + Reviewed by Darin Fisher. + + [chromium]Refactor input method related APIs. + https://bugs.webkit.org/show_bug.cgi?id=40608 + + * WebKit.gyp: + * public/WebCompositionCommand.h: + * public/WebCompositionUnderline.h: Added. + (WebKit::WebCompositionUnderline::WebCompositionUnderline): + * public/WebTextInputType.h: Added. + (WebKit::): + * public/WebViewClient.h: + * public/WebWidget.h: + * public/WebWidgetClient.h: + (WebKit::WebWidgetClient::resetInputMethod): + * src/CompositionUnderlineBuilder.h: Added. + (WebKit::CompositionUnderlineBuilder::CompositionUnderlineBuilder): + * src/CompositionUnderlineVectorBuilder.cpp: Added. + (WebKit::CompositionUnderlineVectorBuilder::CompositionUnderlineVectorBuilder): + * src/CompositionUnderlineVectorBuilder.h: Added. + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::setInputMethodState): + * src/WebPopupMenuImpl.cpp: + (WebKit::WebPopupMenuImpl::setComposition): + (WebKit::WebPopupMenuImpl::confirmComposition): + (WebKit::WebPopupMenuImpl::textInputType): + (WebKit::WebPopupMenuImpl::caretOrSelectionBounds): + * src/WebPopupMenuImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleCompositionEvent): + (WebKit::WebViewImpl::setComposition): + (WebKit::WebViewImpl::confirmComposition): + (WebKit::WebViewImpl::textInputType): + (WebKit::WebViewImpl::caretOrSelectionBounds): + * src/WebViewImpl.h: + +2010-06-19 Victoria Kirst <vrk@google.com> + + Reviewed by David Levin. + + Modifying the WebMediaPlayer interface to be compatible with + a change in chrome. + This is a part 2 of 3 one-sided changes to chrome and WebKit. Chrome + has been updated, so this commit should NOT break chromium anymore, + nor should it cause any test failures. + https://bugs.webkit.org/show_bug.cgi?id=39445 + + * public/WebMediaPlayer.h: Changed buffered() to be non-const. + +2010-06-19 Zhenyao Mo <zmo@google.com> + + Reviewed by Dimitri Glazkov. + + fast/canvas/webgl/get-active-test.html failed in Chrome Mac + https://bugs.webkit.org/show_bug.cgi?id=40496 + + * src/WebGraphicsContext3DDefaultImpl.cpp: Call makeContextCurrent(). + (WebKit::WebGraphicsContext3DDefaultImpl::getActiveAttrib): + (WebKit::WebGraphicsContext3DDefaultImpl::getActiveUniform): + (WebKit::WebGraphicsContext3DDefaultImpl::readPixels): + +2010-06-18 Aaron Boodman <aa@chromium.org> + + Remove WebKit::WebDocument::isXHTMLDocument. + https://bugs.webkit.org/show_bug.cgi?id=40815 + + * public/WebDocument.h: Remove isXHTMLDocument(). + * src/WebDocument.cpp: Ditto. + +2010-06-19 Aaron Boodman <aa@chromium.org> + + Unreviewed, rolling out r61466. + http://trac.webkit.org/changeset/61466 + https://bugs.webkit.org/show_bug.cgi?id=40816 + + Landed wrong change + + * src/WebKit.cpp: + (WebKit::shutdown): + +2010-06-18 Aaron Boodman <aa@chromium.org> + + WebKit API: Undo static hooks into V8 when WebKit is shut downm + https://bugs.webkit.org/show_bug.cgi?id=40816 + + * src/WebKit.cpp: + (WebKit::shutdown): Call new WebCore::V8DOMWindowShell::uninitializeV8IfNeeded(). + +2010-06-18 Drew Wilson <atwilson@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Plumbing for top-level frame names + https://bugs.webkit.org/show_bug.cgi?id=40430 + + * public/WebFrame.h: + Removed obsolete clearName() API and added better documentation for + setName(). + * src/WebFrameImpl.cpp: + Removed clearName() API. + * src/WebFrameImpl.h: + Removed clearName() API. + +2010-06-18 Drew Wilson <atwilson@chromium.org> + + Reviewed by Dumitru Daniliuc. + + Roll chromium DEPS 50089:50171 + https://bugs.webkit.org/show_bug.cgi?id=40842 + + * DEPS: + Update chromium_rev to r50171 to remove downstream reference to WebFrame::clearName(). + +2010-06-18 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Yury Semikhatsky. + + Implement 'takeHeapSnapshot' in InspectorController. + + https://bugs.webkit.org/show_bug.cgi?id=40834 + + * src/js/HeapProfilerPanel.js: + (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked): + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + * src/js/ProfilerAgent.js: + (devtools.ProfilerAgent.prototype.startProfiling): + +2010-06-18 Anton Muhin <antonm@chromium.org> + + Reviewed by Dimitri Glazkov. + + [v8] Finish migration to new named property query API + https://bugs.webkit.org/show_bug.cgi?id=40771 + Remove definition which allowed gradual transition to new API. + See https://bugs.webkit.org/show_bug.cgi?id=40303 for first phase. + Requires V8 roll. + + * DEPS: + +2010-06-17 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: bring XHR console records back. + - adds "Enable XHR Monitor" / "Disable XHR Monitor" actions to the console's context menu + - make the chosen option persist in the settings. + + https://bugs.webkit.org/show_bug.cgi?id=40799 + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableDatabase): + (WebKit::WebRuntimeFeatures::isDatabaseEnabled): + +2010-06-17 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] cleanup redundant DEPS value and remove buildbot cleanup code + https://bugs.webkit.org/show_bug.cgi?id=40615 + + * DEPS: tools/data_pack was listed twice for linux (harmless, but unnecessary) + +2010-06-17 Jeremy Moskovich <jeremy@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium API] Implement WebSandboxSupport on OS X and add stubs to allow + OOP loading of fonts. + + https://bugs.webkit.org/show_bug.cgi?id=40544 + + * WebKit.gyp: Add mac WebSandboxSupport.h + * public/mac/WebSandboxSupport.h: Added. + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::loadFont): + +2010-06-17 Pavel Feldman <pfeldman@chromium.org> + + Unreviewed: chromium tests fix. Added InspectorBackend delegates for new inspector methods. + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-06-17 Mikhail Naganov <mnaganov@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Prepare to making WebDevToolsAgentClient::sendMessageToFrontendOnIOThread virtual + + https://bugs.webkit.org/show_bug.cgi?id=39302 + + * public/WebDevToolsAgent.h: + * public/WebDevToolsAgentClient.h: + (WebKit::WebDevToolsMessageTransport::~WebDevToolsMessageTransport): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread): + +2010-06-17 John Gregg <johnnyg@google.com> + + Reviewed by David Levin. + + Undo the build fix with the correct patch: Chromium NotificationPresenter + is now informed of the destruction before it actually happens, so this + use of the Notification object is correct. + https://bugs.webkit.org/show_bug.cgi?id=40097 + + * src/NotificationPresenterImpl.cpp: + (WebKit::NotificationPresenterImpl::notificationObjectDestroyed): + +2010-06-16 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Set current working directory for each of tests + https://bugs.webkit.org/show_bug.cgi?id=40668 + + * DEPS: Update Chromium to r49915 to have + webkit_support::SetCurrentDirectoryForFileURL(). + +2010-06-16 Drew Wilson <atwilson@chromium.org> + + Reviewed by Kent Tamura. + + Added plumbing to Chromium WebKit API to allow setting/getting the name + of top level frames. + + https://bugs.webkit.org/show_bug.cgi?id=40430 + * public/WebFrame.h: + Added setName() API. + * public/WebViewClient.h: + (WebKit::WebViewClient::createView): + Now takes a "name" parameter. + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::createWindow): + Passes a name parameter. + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::setName): + Allows setting the frame name by calling through to the WebCore API. + * src/WebFrameImpl.h: + +2010-06-15 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions out of Frame class that were marked "move to Chrome" + https://bugs.webkit.org/show_bug.cgi?id=39636 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::dispatchBeforeUnloadEvent): Call shouldClose + on FrameLoader instead of going through Frame. + +2010-06-11 Darin Fisher <darin@chromium.org> + + Reviewed by Brady Eidson. + + Expose WebHistoryItem::itemSequenceNumber. + + https://bugs.webkit.org/show_bug.cgi?id=40451 + + * public/WebHistoryItem.h: + * src/WebHistoryItem.cpp: + (WebKit::WebHistoryItem::itemSequenceNumber): + (WebKit::WebHistoryItem::setItemSequenceNumber): + +2010-06-15 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [v8] Web Inspector: make ui tests pass when ScriptDebugServer is used + https://bugs.webkit.org/show_bug.cgi?id=40623 + + * src/js/DebuggerAgent.js: + (devtools.DebuggerAgent.prototype.formatCallFrame_): return empty function name for anonymous functions. + * src/js/DebuggerScript.js: + * src/js/Tests.js: + (.TestSuite.prototype.testProfilerTab.findVisibleView): + (.TestSuite.prototype.testProfilerTab): + (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.waitUntilScriptIsParsed): + (.TestSuite.prototype.testSetBreakpoint.this): + (.TestSuite.prototype.testSetBreakpoint): + (.TestSuite.prototype.testEvalOnCallFrame.waitForBreakpointHit): + (.TestSuite.prototype._executeCodeWhenScriptsAreParsed.executeFunctionInInspectedPage): + (.TestSuite.prototype.testExpandScope.examineScopes): + (.TestSuite.prototype.testExpandScope): + (.TestSuite.prototype.testDebugIntrinsicProperties): + +2010-06-14 Anders Carlsson <andersca@apple.com> + + Fix Chromium build. + + * src/WebPluginListBuilderImpl.cpp: + (WebKit::WebPluginListBuilderImpl::addFileExtensionToLastMediaType): + +2010-06-14 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Get DatabaseTracker ready for sync DBs. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * public/WebDatabase.h: + * src/DatabaseObserver.cpp: + (WebCore::DatabaseObserver::databaseOpened): + (WebCore::DatabaseObserver::databaseModified): + (WebCore::DatabaseObserver::databaseClosed): + * src/WebDatabase.cpp: + (WebKit::WebDatabase::closeDatabaseImmediately): + (WebKit::WebDatabase::WebDatabase): + (WebKit::WebDatabase::operator=): + (WebKit::WebDatabase::operator WTF::PassRefPtr<AbstractDatabase>): + +2010-06-14 Chris Fleizach <cfleizach@apple.com> + + Reviewed by Darin Adler. + + AX: need ListItemRole and PresentationalRole + https://bugs.webkit.org/show_bug.cgi?id=40133 + + * public/WebAccessibilityRole.h: + * src/AssertMatchingEnums.cpp: + +2010-06-14 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Remove pluginIndex from MimeClassInfo + https://bugs.webkit.org/show_bug.cgi?id=40588 + + * src/WebPluginListBuilderImpl.cpp: + (WebKit::WebPluginListBuilderImpl::addMediaTypeToLastPlugin): + 2010-06-14 Jeremy Orlow <jorlow@chromium.org> Build fix. @@ -23,6 +846,15 @@ 2010-06-13 Tony Chang <tony@chromium.org> + Reviewed by Darin Fisher. + + [chromium] checkout chromium third_party directly + https://bugs.webkit.org/show_bug.cgi?id=40556 + + * DEPS: + +2010-06-13 Tony Chang <tony@chromium.org> + Build fix, not reviewed. fix chromium compile after r61094 (id attribute refactor) diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 973e78d..b6b35a5 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': '49521', + 'chromium_rev': '50676', } deps = { @@ -91,70 +91,26 @@ deps = { Var('chromium_svn')+'/media@'+Var('chromium_rev'), 'third_party/angle': # needed by the gpu process From('chromium_deps', 'src/third_party/angle'), - 'third_party/glew': # webgl related - Var('chromium_svn')+'/third_party/glew@'+Var('chromium_rev'), 'third_party/ffmpeg': # needed by webkit/media From('chromium_deps', 'src/third_party/ffmpeg'), 'third_party/libvpx/include': From('chromium_deps', 'src/third_party/libvpx/include'), 'third_party/libvpx/lib': From('chromium_deps', 'src/third_party/libvpx/lib'), - 'third_party/mesa': - Var('chromium_svn')+'/third_party/mesa@'+Var('chromium_rev'), - 'third_party/yasm': # needed by ffmpeg - Var('chromium_svn')+'/third_party/yasm@'+Var('chromium_rev'), - 'third_party/openmax': # needed by webkit/media - Var('chromium_svn')+'/third_party/openmax@'+Var('chromium_rev'), 'tools/grit': Var('chromium_svn')+'/tools/grit@'+Var('chromium_rev'), 'tools/generate_stubs': Var('chromium_svn')+'/tools/generate_stubs@'+Var('chromium_rev'), # other third party + 'third_party': + Var('chromium_svn')+'/third_party@'+Var('chromium_rev'), 'third_party/icu': From('chromium_deps', 'src/third_party/icu'), - - 'third_party/bzip2': - Var('chromium_svn')+'/third_party/bzip2@'+Var('chromium_rev'), - - 'third_party/libevent': - Var('chromium_svn')+'/third_party/libevent@'+Var('chromium_rev'), - - 'third_party/libjpeg': - Var('chromium_svn')+'/third_party/libjpeg@'+Var('chromium_rev'), - - 'third_party/libpng': - Var('chromium_svn')+'/third_party/libpng@'+Var('chromium_rev'), - - 'third_party/libxml': - Var('chromium_svn')+'/third_party/libxml@'+Var('chromium_rev'), - - 'third_party/libxslt': - Var('chromium_svn')+'/third_party/libxslt@'+Var('chromium_rev'), - - 'third_party/modp_b64': - Var('chromium_svn')+'/third_party/modp_b64@'+Var('chromium_rev'), - - 'third_party/npapi': - Var('chromium_svn')+'/third_party/npapi@'+Var('chromium_rev'), - 'third_party/ppapi': From('chromium_deps', 'src/third_party/ppapi'), - 'third_party/ots': From('chromium_deps', 'src/third_party/ots'), - - 'third_party/sqlite': - Var('chromium_svn')+'/third_party/sqlite@'+Var('chromium_rev'), - - 'third_party/tcmalloc': - Var('chromium_svn')+'/third_party/tcmalloc@'+Var('chromium_rev'), - - 'third_party/zlib': - Var('chromium_svn')+'/third_party/zlib@'+Var('chromium_rev'), - - 'third_party/mozilla': - Var('chromium_svn')+'/third_party/mozilla@'+Var('chromium_rev'), } deps_os = { @@ -169,8 +125,6 @@ deps_os = { From('chromium_deps', 'src/third_party/lighttpd'), 'third_party/nss': From('chromium_deps', 'src/third_party/nss'), - 'third_party/wtl': - Var('chromium_svn')+'/third_party/wtl@'+Var('chromium_rev'), }, 'mac': { # needed by ffmpeg @@ -181,12 +135,8 @@ deps_os = { }, 'unix': { # Linux, actually. - 'third_party/harfbuzz': - Var('chromium_svn')+'/third_party/harfbuzz@'+Var('chromium_rev'), 'tools/xdisplaycheck': Var('chromium_svn')+'/tools/xdisplaycheck@'+Var('chromium_rev'), - 'tools/data_pack': - Var('chromium_svn')+'/tools/data_pack@'+Var('chromium_rev'), 'third_party/yasm/source/patched-yasm': From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'), }, diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 83ae631..a53dd28 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -77,6 +77,7 @@ 'public/linux/WebRenderTheme.h', 'public/x11/WebScreenInfoFactory.h', 'public/mac/WebInputEventFactory.h', + 'public/mac/WebSandboxSupport.h', 'public/mac/WebScreenInfoFactory.h', 'public/WebAccessibilityCache.h', 'public/WebAccessibilityObject.h', @@ -93,6 +94,7 @@ 'public/WebCommon.h', 'public/WebCommonWorkerClient.h', 'public/WebCompositionCommand.h', + 'public/WebCompositionUnderline.h', 'public/WebConsoleMessage.h', 'public/WebContextMenuData.h', 'public/WebCookie.h', @@ -110,6 +112,7 @@ 'public/WebDevToolsFrontend.h', 'public/WebDevToolsFrontendClient.h', 'public/WebDevToolsMessageData.h', + 'public/WebDevToolsMessageTransport.h', 'public/WebDocument.h', 'public/WebDragData.h', 'public/WebEditingAction.h', @@ -205,6 +208,7 @@ 'public/WebTextAffinity.h', 'public/WebTextCaseSensitivity.h', 'public/WebTextDirection.h', + 'public/WebTextInputType.h', 'public/WebThemeEngine.h', 'public/WebURL.h', 'public/WebURLError.h', @@ -240,6 +244,9 @@ 'src/ChromiumBridge.cpp', 'src/ChromiumCurrentTime.cpp', 'src/ChromiumThreading.cpp', + 'src/CompositionUnderlineBuilder.h', + 'src/CompositionUnderlineVectorBuilder.cpp', + 'src/CompositionUnderlineVectorBuilder.h', 'src/ContextMenuClientImpl.cpp', 'src/ContextMenuClientImpl.h', 'src/DatabaseObserver.cpp', @@ -254,6 +261,8 @@ 'src/DOMUtilitiesPrivate.h', 'src/DragClientImpl.cpp', 'src/DragClientImpl.h', + 'src/DragScrollTimer.cpp', + 'src/DragScrollTimer.h', 'src/EditorClientImpl.cpp', 'src/EditorClientImpl.h', 'src/EventListenerWrapper.cpp', diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 9a23949..256192b 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -46,13 +46,15 @@ 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', 'ENABLE_DOM_STORAGE=1', + 'ENABLE_EVENTSOURCE=1', 'ENABLE_FILE_READER=1', - 'ENABLE_FILE_WRITER=0', + 'ENABLE_FILE_WRITER=1', 'ENABLE_FILTERS=1', 'ENABLE_GEOLOCATION=1', 'ENABLE_ICONDATABASE=0', - 'ENABLE_IMAGE_RESIZER=0', + 'ENABLE_IMAGE_RESIZER=1', 'ENABLE_INDEXED_DATABASE=1', + 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', 'ENABLE_JSC_MULTIPLE_THREADS=0', 'ENABLE_METER_TAG=1', @@ -80,10 +82,12 @@ 'WTF_USE_ACCELERATED_COMPOSITING=0', ], + 'use_accelerated_compositing%': 0, 'enable_svg%': 1, }, 'feature_defines%': '<(feature_defines)', + 'use_accelerated_compositing%': '<(use_accelerated_compositing)', 'enable_svg%': '<(enable_svg)', }, } diff --git a/WebKit/chromium/public/WebAccessibilityRole.h b/WebKit/chromium/public/WebAccessibilityRole.h index ec041e0..b0748a7 100644 --- a/WebKit/chromium/public/WebAccessibilityRole.h +++ b/WebKit/chromium/public/WebAccessibilityRole.h @@ -102,6 +102,7 @@ enum WebAccessibilityRole { WebAccessibilityRoleAnnotation, WebAccessibilityRoleSliderThumb, WebAccessibilityRoleIgnored, + WebAccessibilityRolePresentational, WebAccessibilityRoleTab, WebAccessibilityRoleTabList, WebAccessibilityRoleTabPanel, diff --git a/WebKit/chromium/public/WebApplicationCacheHostClient.h b/WebKit/chromium/public/WebApplicationCacheHostClient.h index 4e830e3..39b7fa2 100644 --- a/WebKit/chromium/public/WebApplicationCacheHostClient.h +++ b/WebKit/chromium/public/WebApplicationCacheHostClient.h @@ -39,8 +39,9 @@ namespace WebKit { // This interface is used by the embedder to call into webkit. class WebApplicationCacheHostClient { public: - // Called to fire the event in the scriptable interface. + // Called to fire events in the scriptable interface. virtual void notifyEventListener(WebApplicationCacheHost::EventID) = 0; + virtual void notifyProgressEventListener(const WebURL&, int num_total, int num_complete) = 0; protected: // Should not be deleted by the embedder. diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h index d24916b..2c1e137 100644 --- a/WebKit/chromium/public/WebCString.h +++ b/WebKit/chromium/public/WebCString.h @@ -68,6 +68,11 @@ public: return *this; } + // Returns 0 if both strings are equals, a value greater than zero if the + // first character that does not match has a greater value in this string + // than in |other|, or a value less than zero to indicate the opposite. + WEBKIT_API int compare(const WebCString& other) const; + WEBKIT_API void reset(); WEBKIT_API void assign(const WebCString&); WEBKIT_API void assign(const char* data, size_t len); @@ -117,6 +122,11 @@ private: WebCStringPrivate* m_private; }; +inline bool operator<(const WebCString& a, const WebCString& b) +{ + return a.compare(b) < 0; +} + } // namespace WebKit #endif diff --git a/WebKit/chromium/public/WebCompositionCommand.h b/WebKit/chromium/public/WebCompositionCommand.h index fa89529..bda1eb1 100644 --- a/WebKit/chromium/public/WebCompositionCommand.h +++ b/WebKit/chromium/public/WebCompositionCommand.h @@ -33,6 +33,7 @@ namespace WebKit { +// DEPRECATED. enum WebCompositionCommand { WebCompositionCommandDiscard, WebCompositionCommandSet, diff --git a/WebKit/chromium/public/WebCompositionUnderline.h b/WebKit/chromium/public/WebCompositionUnderline.h new file mode 100644 index 0000000..d8b0d63 --- /dev/null +++ b/WebKit/chromium/public/WebCompositionUnderline.h @@ -0,0 +1,61 @@ +/* + * 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 WebCompositionUnderline_h +#define WebCompositionUnderline_h + +#include "WebColor.h" + +namespace WebKit { + +// Class WebCompositionUnderline is intended to be used with WebWidget's +// setComposition() method. +struct WebCompositionUnderline { + WebCompositionUnderline() + : startOffset(0) + , endOffset(0) + , color(0) + , thick(false) { } + + WebCompositionUnderline(unsigned s, unsigned e, WebColor c, bool t) + : startOffset(s) + , endOffset(e) + , color(c) + , thick(t) { } + + unsigned startOffset; + unsigned endOffset; + WebColor color; + bool thick; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebDatabase.h b/WebKit/chromium/public/WebDatabase.h index 108201d..4679f68 100644 --- a/WebKit/chromium/public/WebDatabase.h +++ b/WebKit/chromium/public/WebDatabase.h @@ -35,7 +35,7 @@ #include "WebSecurityOrigin.h" #if WEBKIT_IMPLEMENTATION -namespace WebCore { class Database; } +namespace WebCore { class AbstractDatabase; } namespace WTF { template <typename T> class PassRefPtr; } #endif @@ -76,9 +76,9 @@ public: const WebString& originIdentifier, const WebString& databaseName); #if WEBKIT_IMPLEMENTATION - WebDatabase(const WTF::PassRefPtr<WebCore::Database>&); - WebDatabase& operator=(const WTF::PassRefPtr<WebCore::Database>&); - operator WTF::PassRefPtr<WebCore::Database>() const; + WebDatabase(const WTF::PassRefPtr<WebCore::AbstractDatabase>&); + WebDatabase& operator=(const WTF::PassRefPtr<WebCore::AbstractDatabase>&); + operator WTF::PassRefPtr<WebCore::AbstractDatabase>() const; #endif private: diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index e3b5186..d1ad23c 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -35,6 +35,7 @@ namespace WebKit { class WebDevToolsAgentClient; +class WebDevToolsMessageTransport; class WebFrame; class WebString; class WebURLRequest; @@ -73,7 +74,7 @@ public: // Asynchronously request debugger to pause immediately. WEBKIT_API static void debuggerPauseScript(); - WEBKIT_API static bool dispatchMessageFromFrontendOnIOThread(const WebDevToolsMessageData&); + WEBKIT_API static bool dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport*, const WebDevToolsMessageData&); typedef void (*MessageLoopDispatchHandler)(); diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h index 622f788..91fd3e8 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -51,8 +51,6 @@ public: // Notifies host upon runtime feature being enabled/disabled. virtual void runtimeFeatureStateChanged(const WebString& feature, bool enabled) { } - WEBKIT_API static void sendMessageToFrontendOnIOThread(const WebDevToolsMessageData&); - virtual WebCString injectedScriptSource() { return WebCString(); } virtual WebCString injectedScriptDispatcherSource() { return WebCString(); } virtual WebCString debuggerScriptSource() { return WebCString(); } diff --git a/WebKit/chromium/public/WebDevToolsMessageTransport.h b/WebKit/chromium/public/WebDevToolsMessageTransport.h new file mode 100644 index 0000000..54c07f1 --- /dev/null +++ b/WebKit/chromium/public/WebDevToolsMessageTransport.h @@ -0,0 +1,48 @@ +/* + * 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 WebDevToolsMessageTransport_h +#define WebDevToolsMessageTransport_h + +#include "WebCString.h" +#include "WebCommon.h" + +namespace WebKit { +struct WebDevToolsMessageData; + +class WebDevToolsMessageTransport { +public: + virtual ~WebDevToolsMessageTransport() { } + virtual void sendMessageToFrontendOnIOThread(const WebDevToolsMessageData&) = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index 772db75..319ce38 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -102,7 +102,11 @@ public: // The name of this frame. virtual WebString name() const = 0; - virtual void clearName() = 0; + + // Sets the name of this frame. For child frames (frames that are not a + // top-most frame) the actual name may have a suffix appended to make the + // frame name unique within the hierarchy. + virtual void setName(const WebString&) = 0; // The url of the document loaded in this frame. This is equivalent to // dataSource()->request().url(). @@ -399,6 +403,17 @@ public: // Reformats the WebFrame for screen display. virtual void printEnd() = 0; + // CSS3 Paged Media ---------------------------------------------------- + + // Returns true if page box (margin boxes and page borders) is visible. + virtual bool isPageBoxVisible(int pageIndex) = 0; + + // Returns the page area rectangle in pixels, assuming 96 pixels per inch. + virtual WebRect pageAreaRectInPixels(int pageIndex) = 0; + + // Returns the preferred page size in pixels, assuming 96 pixels per inch. + virtual WebSize preferredPageSizeInPixels(int pageIndex) = 0; + // Find-in-page -------------------------------------------------------- diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h index bd63060..a7e9560 100644 --- a/WebKit/chromium/public/WebGLES2Context.h +++ b/WebKit/chromium/public/WebGLES2Context.h @@ -45,7 +45,7 @@ class WebGLES2Context : public WebNonCopyable { public: virtual ~WebGLES2Context() {} - virtual bool initialize(WebView*) = 0; + virtual bool initialize(WebView*, WebGLES2Context* parent) = 0; virtual bool makeCurrent() = 0; virtual bool destroy() = 0; virtual bool swapBuffers() = 0; diff --git a/WebKit/chromium/public/WebHistoryItem.h b/WebKit/chromium/public/WebHistoryItem.h index 015f5d7..1b4863e 100644 --- a/WebKit/chromium/public/WebHistoryItem.h +++ b/WebKit/chromium/public/WebHistoryItem.h @@ -34,6 +34,9 @@ #include "WebCommon.h" #include "WebPrivatePtr.h" +// FIXME: Remove this once Chromium starts using itemSequenceNumber. +#define WEBKIT_BUG_40451_IS_FIXED + namespace WebCore { class HistoryItem; } namespace WebKit { @@ -102,6 +105,9 @@ public: WEBKIT_API WebVector<WebString> documentState() const; WEBKIT_API void setDocumentState(const WebVector<WebString>&); + WEBKIT_API long long itemSequenceNumber() const; + WEBKIT_API void setItemSequenceNumber(long long); + WEBKIT_API long long documentSequenceNumber() const; WEBKIT_API void setDocumentSequenceNumber(long long); diff --git a/WebKit/chromium/public/WebMediaPlayer.h b/WebKit/chromium/public/WebMediaPlayer.h index 0b658f9..6f51345 100644 --- a/WebKit/chromium/public/WebMediaPlayer.h +++ b/WebKit/chromium/public/WebMediaPlayer.h @@ -95,7 +95,7 @@ public: virtual void setVisible(bool) = 0; virtual bool setAutoBuffer(bool) = 0; virtual bool totalBytesKnown() = 0; - virtual const WebTimeRanges& buffered() const = 0; + virtual const WebTimeRanges& buffered() = 0; virtual float maxTimeSeekable() const = 0; virtual void setSize(const WebSize&) = 0; diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index ab747e3..787d4f3 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -32,6 +32,7 @@ #define WebNotification_h #include "WebCommon.h" +#include "WebTextDirection.h" #if WEBKIT_IMPLEMENTATION namespace WebCore { class Notification; } @@ -75,7 +76,11 @@ public: WEBKIT_API WebString title() const; WEBKIT_API WebString body() const; + // FIXME: Remove dir() when no longer referenced. + // dir() is deprecated; use direction(). WEBKIT_API WebString dir() const; + WEBKIT_API WebTextDirection direction() const; + WEBKIT_API WebString replaceId() const; // Called to indicate the notification has been displayed. diff --git a/WebKit/chromium/public/WebSharedWorker.h b/WebKit/chromium/public/WebSharedWorker.h index 01c8391..9492a4f 100644 --- a/WebKit/chromium/public/WebSharedWorker.h +++ b/WebKit/chromium/public/WebSharedWorker.h @@ -63,15 +63,6 @@ public: const WebString& sourceCode, long long scriptResourceAppCacheID) = 0; - // FIXME(michaeln): Remove this after the roll and adjusting to it. - virtual void startWorkerContext(const WebURL& scriptURL, - const WebString& name, - const WebString& userAgent, - const WebString& sourceCode) - { - startWorkerContext(scriptURL, name, userAgent, sourceCode, 0); - } - class ConnectListener { public: // Invoked once the connect event has been sent so the caller can free this object. diff --git a/WebKit/chromium/public/WebTextInputType.h b/WebKit/chromium/public/WebTextInputType.h new file mode 100644 index 0000000..2592f6f --- /dev/null +++ b/WebKit/chromium/public/WebTextInputType.h @@ -0,0 +1,53 @@ +/* + * 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 WebTextInputType_h +#define WebTextInputType_h + +namespace WebKit { + +enum WebTextInputType { + // Input caret is not in an editable node, no input method shall be used. + WebTextInputTypeNone, + + // Input caret is in a normal editable node, any input method can be used. + WebTextInputTypeText, + + // Input caret is in a password box, an input method may be used only if + // it's suitable for password input. + WebTextInputTypePassword, + + // FIXME: Add more text input types when necessary, eg. Number, + // Date, Email, URL, etc. +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebURL.h b/WebKit/chromium/public/WebURL.h index 78a16a8..bb90e32 100644 --- a/WebKit/chromium/public/WebURL.h +++ b/WebKit/chromium/public/WebURL.h @@ -138,6 +138,11 @@ private: bool m_isValid; }; +inline bool operator<(const WebURL& a, const WebURL& b) +{ + return a.spec() < b.spec(); +} + } // namespace WebKit #endif diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h index 4462394..293d955 100644 --- a/WebKit/chromium/public/WebURLResponse.h +++ b/WebKit/chromium/public/WebURLResponse.h @@ -131,6 +131,11 @@ public: WEBKIT_API bool wasNpnNegotiated() const; WEBKIT_API void setWasNpnNegotiated(bool); + // Flag whether this request was made when "Alternate-Protocol: xxx" + // is present in server's response. + WEBKIT_API bool wasAlternateProtocolAvailable() const; + WEBKIT_API void setWasAlternateProtocolAvailable(bool); + // Flag whether this request was loaded via an explicit proxy (HTTP, SOCKS, etc). WEBKIT_API bool wasFetchedViaProxy() const; WEBKIT_API void setWasFetchedViaProxy(bool); diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index 9054d8c..eadfc26 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -38,6 +38,7 @@ namespace WebKit { class WebAccessibilityObject; class WebDevToolsAgent; +class WebDevToolsAgentClient; class WebDragData; class WebFrame; class WebFrameClient; @@ -55,8 +56,8 @@ public: // Creates a WebView that is NOT yet initialized. You will need to // call initializeMainFrame to finish the initialization. It is valid - // to pass a null WebViewClient pointer. - WEBKIT_API static WebView* create(WebViewClient*); + // to pass null WebViewClient and WebDevToolsAgentClient pointers. + WEBKIT_API static WebView* create(WebViewClient*, WebDevToolsAgentClient* = 0); // After creating a WebView, you should immediately call this method. // You can optionally modify the settings before calling this method. diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 31ef028..0712815 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -73,7 +73,8 @@ public: // so any subsequent calls to createSessionStorageNamespace conform to the // WebStorage specification. virtual WebView* createView(WebFrame* creator, - const WebWindowFeatures& features) { return 0; } + const WebWindowFeatures& features, + const WebString& name) { return 0; } // Create a new WebPopupMenu. In the second form, the client is // responsible for rendering the contents of the popup menu. @@ -124,6 +125,8 @@ public: virtual bool isSmartInsertDeleteEnabled() { return true; } virtual bool isSelectTrailingWhitespaceEnabled() { return true; } + + // DEPRECATED: replaced by WebWidgetClient::resetInputMethod(). virtual void setInputMethodEnabled(bool enabled) { } virtual void didBeginEditing() { } diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h index b1feee9..3da245b 100644 --- a/WebKit/chromium/public/WebWidget.h +++ b/WebKit/chromium/public/WebWidget.h @@ -34,6 +34,8 @@ #include "WebCanvas.h" #include "WebCommon.h" #include "WebCompositionCommand.h" +#include "WebCompositionUnderline.h" +#include "WebTextInputType.h" #include "WebTextDirection.h" namespace WebKit { @@ -42,6 +44,7 @@ class WebInputEvent; class WebString; struct WebRect; struct WebSize; +template <typename T> class WebVector; class WebWidget { public: @@ -76,17 +79,39 @@ public: // Called to inform the WebWidget that it has gained or lost keyboard focus. virtual void setFocus(bool) = 0; - // Called to inform the WebWidget of a composition event. + // DEPRECATED. It's replaced by setComposition() and confirmComposition(). virtual bool handleCompositionEvent(WebCompositionCommand command, int cursorPosition, int targetStart, int targetEnd, const WebString& text) = 0; - // Retrieve the status of this WebWidget required by IME APIs. Upon - // success enabled and caretBounds are set. + // Called to inform the WebWidget of a new composition text. + // If selectionStart and selectionEnd has the same value, then it indicates + // the input caret position. If the text is empty, then the existing + // composition text will be cancelled. + // Returns true if the composition text was set successfully. + virtual bool setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, + int selectionEnd) = 0; + + // Called to inform the WebWidget to confirm an ongoing composition. + // Returns true if there is an ongoing composition. + virtual bool confirmComposition() = 0; + + // DEPRECATED. It's replaced by textInputType() and + // caretOrSelectionBounds(). virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) = 0; + // Returns the current text input type of this WebWidget. + virtual WebTextInputType textInputType() = 0; + + // Returns the current caret bounds of this WebWidget. The selection bounds + // will be returned if a selection range is available. + virtual WebRect caretOrSelectionBounds() = 0; + // Changes the text direction of the selected input node. virtual void setTextDirection(WebTextDirection) = 0; diff --git a/WebKit/chromium/public/WebWidgetClient.h b/WebKit/chromium/public/WebWidgetClient.h index 06d9eba..bd7bd6a 100644 --- a/WebKit/chromium/public/WebWidgetClient.h +++ b/WebKit/chromium/public/WebWidgetClient.h @@ -83,6 +83,10 @@ public: // displayed. virtual WebScreenInfo screenInfo() { return WebScreenInfo(); } + // When this method gets called, WebWidgetClient implementation should + // reset the input method by cancelling any ongoing composition. + virtual void resetInputMethod() { } + protected: ~WebWidgetClient() { } }; diff --git a/WebKit/chromium/public/mac/WebSandboxSupport.h b/WebKit/chromium/public/mac/WebSandboxSupport.h new file mode 100644 index 0000000..57d48aa --- /dev/null +++ b/WebKit/chromium/public/mac/WebSandboxSupport.h @@ -0,0 +1,63 @@ +/* + * 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 WebSandboxSupport_h +#define WebSandboxSupport_h + +typedef uintptr_t ATSFontContainerRef; + +#ifdef __OBJC__ +@class NSFont; +#else +class NSFont; +#endif + +namespace WebKit { + +// Put methods here that are required due to sandbox restrictions. +class WebSandboxSupport { +public: + // Given an input font - |srcFont| [which can't be loaded due to sandbox + // restrictions]. Return a font container belonging to an equivalent + // font file that can be used to access the font. + // + // Note that a font container may contain multiple fonts, the caller is + // responsible for retreiving the appropriate font from the container. + // + // If this function succeeds, the caller assumes ownership of the |out| + // parameter and must call ATSFontDeactivate() to unload it when done. + // + // Returns: true on success, false on error. + virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out) = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/ApplicationCacheHostInternal.h b/WebKit/chromium/src/ApplicationCacheHostInternal.h index bf6c4ae..edaaca9 100644 --- a/WebKit/chromium/src/ApplicationCacheHostInternal.h +++ b/WebKit/chromium/src/ApplicationCacheHostInternal.h @@ -39,6 +39,7 @@ #include "WebFrameImpl.h" #include "WebKit.h" #include "WebKitClient.h" +#include "WebURL.h" namespace WebCore { @@ -57,6 +58,17 @@ public: m_innerHost->notifyDOMApplicationCache(static_cast<ApplicationCacheHost::EventID>(eventID)); } + virtual void notifyProgressEventListener(const WebKit::WebURL&, int num_total, int num_complete) + { + // FIXME: Modify webcore's progress event handling to carry the extra info and alter the + // layout tests to not fail when the more recently specified 'final' event is raised. + // For now, we're eating the extra info and that last event. + // See https://bugs.webkit.org/show_bug.cgi?id=37602 + if (num_complete == num_total) + return; + notifyEventListener(WebKit::WebApplicationCacheHost::ProgressEvent); + } + static WebKit::WebApplicationCacheHost* toWebApplicationCacheHost(ApplicationCacheHost* innerHost) { if (innerHost && innerHost->m_internal.get()) diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index fa7d73a..819339d 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -127,6 +127,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDefinitionListDefinition, Defin COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleAnnotation, AnnotationRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleSliderThumb, SliderThumbRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleIgnored, IgnoredRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRolePresentational, PresentationalRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTab, TabRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTabList, TabListRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTabPanel, TabPanelRole); diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp index 8084aad..04c02f2 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp @@ -56,7 +56,7 @@ WebString AutoFillPopupMenuClient::getSuggestion(unsigned listIndex) const --listIndex; // FIXME: Modify the PopupMenu to add the label in gray right-justified. - ASSERT(listIndex >= 0 && listIndex < m_names.size()); + ASSERT(listIndex < m_names.size()); WebString suggestion = m_names[listIndex]; if (m_labels[listIndex].isEmpty()) @@ -68,7 +68,7 @@ WebString AutoFillPopupMenuClient::getSuggestion(unsigned listIndex) const void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) { // FIXME: Do we want to remove AutoFill suggestions? - ASSERT(listIndex >= 0 && listIndex < m_names.size()); + ASSERT(listIndex < m_names.size()); m_names.remove(listIndex); m_labels.remove(listIndex); } @@ -82,7 +82,7 @@ void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents) if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex)) --listIndex; - ASSERT(listIndex >= 0 && listIndex < m_names.size()); + ASSERT(listIndex < m_names.size()); webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()), m_names[listIndex], @@ -99,7 +99,7 @@ void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEven if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex)) --listIndex; - ASSERT(listIndex >= 0 && listIndex < m_names.size()); + ASSERT(listIndex < m_names.size()); webView->client()->didSelectAutoFillSuggestion(WebNode(getTextField()), m_names[listIndex], diff --git a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp b/WebKit/chromium/src/AutocompletePopupMenuClient.cpp index 9620ffc..ed4f670 100644 --- a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp +++ b/WebKit/chromium/src/AutocompletePopupMenuClient.cpp @@ -46,13 +46,13 @@ unsigned AutocompletePopupMenuClient::getSuggestionsCount() const WebString AutocompletePopupMenuClient::getSuggestion(unsigned listIndex) const { - ASSERT(listIndex >= 0 && listIndex < m_suggestions.size()); + ASSERT(listIndex < m_suggestions.size()); return m_suggestions[listIndex]; } void AutocompletePopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) { - ASSERT(listIndex >= 0 && listIndex < m_suggestions.size()); + ASSERT(listIndex < m_suggestions.size()); m_suggestions.remove(listIndex); } diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 559a62b..54c81aa 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -231,7 +231,7 @@ Page* ChromeClientImpl::createWindow( return 0; WebViewImpl* newView = static_cast<WebViewImpl*>( - m_webView->client()->createView(WebFrameImpl::fromFrame(frame), features)); + m_webView->client()->createView(WebFrameImpl::fromFrame(frame), features, r.frameName())); if (!newView) return 0; diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 3b8e5fa..4963f78 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -49,6 +49,7 @@ #include "WebMimeRegistry.h" #include "WebPluginContainerImpl.h" #include "WebPluginListBuilderImpl.h" +#include "WebSandboxSupport.h" #include "WebScreenInfo.h" #include "WebString.h" #include "WebURL.h" @@ -59,12 +60,10 @@ #if OS(WINDOWS) #include "WebRect.h" -#include "WebSandboxSupport.h" #include "WebThemeEngine.h" #endif #if OS(LINUX) -#include "WebSandboxSupport.h" #include "WebFontInfo.h" #include "WebFontRenderStyle.h" #endif @@ -404,6 +403,22 @@ void ChromiumBridge::getRenderStyleForStrike(const char* font, int sizeAndStyle, } #endif +#if OS(DARWIN) +bool ChromiumBridge::loadFont(NSFont* srcFont, ATSFontContainerRef* out) +{ + WebSandboxSupport* ss = webKitClient()->sandboxSupport(); + if (ss) + return ss->loadFont(srcFont, out); + + // This function should only be called in response to an error loading a + // font due to being blocked by the sandbox. + // This by definition shouldn't happen if there is no sandbox support. + ASSERT_NOT_REACHED(); + *out = 0; + return false; +} +#endif + // Geolocation ---------------------------------------------------------------- GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(GeolocationServiceChromium* geolocationServiceChromium) diff --git a/WebKit/chromium/src/CompositionUnderlineBuilder.h b/WebKit/chromium/src/CompositionUnderlineBuilder.h new file mode 100644 index 0000000..ce62474 --- /dev/null +++ b/WebKit/chromium/src/CompositionUnderlineBuilder.h @@ -0,0 +1,53 @@ +/* + * 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 CompositionUnderlineBuilder_h +#define CompositionUnderlineBuilder_h + +#include "Editor.h" +#include "Vector.h" +#include "WebCompositionUnderline.h" +#include "WebVector.h" + +namespace WebKit { + +// This class is used for converting from WebCompositionUnderline to +// WebCore::CompositionUnderline. + +class CompositionUnderlineBuilder : public WebCore::CompositionUnderline { +public: + CompositionUnderlineBuilder(const WebCompositionUnderline& u) + : WebCore::CompositionUnderline(u.startOffset, u.endOffset, + WebCore::Color(u.color), u.thick) { } +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp new file mode 100644 index 0000000..55dca85 --- /dev/null +++ b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp @@ -0,0 +1,49 @@ +/* + * 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 "CompositionUnderlineVectorBuilder.h" + +#include "CompositionUnderlineBuilder.h" + +using namespace WebCore; + +namespace WebKit { + +CompositionUnderlineVectorBuilder::CompositionUnderlineVectorBuilder( + const WebVector<WebCompositionUnderline>& underlines) +{ + size_t size = underlines.size(); + reserveCapacity(size); + for (size_t i = 0; i < size; ++i) + append(CompositionUnderlineBuilder(underlines[i])); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h new file mode 100644 index 0000000..8050f02 --- /dev/null +++ b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h @@ -0,0 +1,53 @@ +/* + * 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 CompositionUnderlineVectorBuilder_h +#define CompositionUnderlineVectorBuilder_h + +#include "Editor.h" +#include "Vector.h" +#include "WebCompositionUnderline.h" +#include "WebVector.h" + +namespace WebKit { + +// This classes are used for converting from std::vector<WebCompositionUnderline> +// to Vector<WebCore::CompositionUnderline>. + +class CompositionUnderlineVectorBuilder : + public Vector<WebCore::CompositionUnderline> { +public: + CompositionUnderlineVectorBuilder( + const WebVector<WebCompositionUnderline>&); +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp index be658fe..e1b7cbe 100644 --- a/WebKit/chromium/src/DatabaseObserver.cpp +++ b/WebKit/chromium/src/DatabaseObserver.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "DatabaseObserver.h" -#include "Database.h" +#include "AbstractDatabase.h" #include "Document.h" #include "ScriptExecutionContext.h" #include "WebDatabase.h" @@ -65,19 +65,19 @@ bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecut return true; } -void DatabaseObserver::databaseOpened(Database* database) +void DatabaseObserver::databaseOpened(AbstractDatabase* database) { ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseOpened(WebDatabase(database)); } -void DatabaseObserver::databaseModified(Database* database) +void DatabaseObserver::databaseModified(AbstractDatabase* database) { ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseModified(WebDatabase(database)); } -void DatabaseObserver::databaseClosed(Database* database) +void DatabaseObserver::databaseClosed(AbstractDatabase* database) { ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseClosed(WebDatabase(database)); diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp index a30675d..939f4ed 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -265,9 +265,9 @@ void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::Messa void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value) { s_exposeV8DebuggerProtocol = value; + WebCore::ScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol); } - void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId) { ASSERT(hostId > 0); diff --git a/WebKit/chromium/src/DragScrollTimer.cpp b/WebKit/chromium/src/DragScrollTimer.cpp new file mode 100644 index 0000000..83b81b7 --- /dev/null +++ b/WebKit/chromium/src/DragScrollTimer.cpp @@ -0,0 +1,126 @@ +/* + * 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 "DragScrollTimer.h" + +#include "FrameView.h" + +using namespace WebCore; + +namespace WebKit { + +// Computes the distance from a point outside a rect to the nearest edge of the rect. +static IntSize distanceToRect(const IntPoint& point, const IntRect& rect) +{ + int dx = 0, dy = 0; + if (point.x() < rect.x()) + dx = point.x() - rect.x(); + else if (rect.right() < point.x()) + dx = point.x() - rect.right(); + if (point.y() < rect.y()) + dy = point.y() - rect.y(); + else if (rect.bottom() < point.y()) + dy = point.y() - rect.bottom(); + return IntSize(dx, dy); +} + +DragScrollTimer::DragScrollTimer() + : m_timer(this, &DragScrollTimer::fired) + , m_view(0) + , m_scrolling(false) +{ +} + +DragScrollTimer::~DragScrollTimer() +{ + // We do this for detecting dead object earlier + stop(); +} + +void DragScrollTimer::stop() +{ + m_timer.stop(); + m_view = 0; + m_scrolling = false; +} + +void DragScrollTimer::scroll() +{ + m_view->scrollBy(m_lastDistance); + m_scrolling = true; +} + +void DragScrollTimer::update() +{ + if (shouldScroll()) + scroll(); + else + stop(); +} + +void DragScrollTimer::triggerScroll(FrameView* view, const WebPoint& location) +{ + if (!view) + return; + + // Approximates Safari + static const double scrollStartDelay = 0.2; + + m_view = view; + m_lastDistance = scrollDistanceFor(view, location); + + if (m_scrolling) + update(); + else if (shouldScroll() && !m_timer.isActive()) + m_timer.startOneShot(scrollStartDelay); +} + +IntSize DragScrollTimer::scrollDistanceFor(FrameView* view, const WebPoint& location) const +{ + static const int scrollMargin = 30; + + IntRect bounds(0, 0, view->visibleWidth(), view->visibleHeight()); + if (!bounds.contains(location)) + return IntSize(0, 0); // The location is outside the border belt. + + bounds.setY(bounds.y() + scrollMargin); + bounds.setHeight(bounds.height() - scrollMargin * 2); + bounds.setX(bounds.x() + scrollMargin); + bounds.setWidth(bounds.width() - scrollMargin * 2); + + if (bounds.contains(location)) + return IntSize(0, 0); // The location is inside the border belt. + + // The location is over the border belt. + return distanceToRect(location, bounds); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/DragScrollTimer.h b/WebKit/chromium/src/DragScrollTimer.h new file mode 100644 index 0000000..a4090e0 --- /dev/null +++ b/WebKit/chromium/src/DragScrollTimer.h @@ -0,0 +1,69 @@ +/* + * 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 DragScrollTimer_h +#define DragScrollTimer_h + +#include "IntSize.h" +#include "Timer.h" +#include "WebPoint.h" + +namespace WebCore { class FrameView; } + +namespace WebKit { + +// +// Encapsulating a timer and associated state management for +// scroll-on-drag behaviour. +// +class DragScrollTimer { +public: + DragScrollTimer(); + ~DragScrollTimer(); + + void fired(WebCore::Timer<DragScrollTimer>*) { update(); } + void triggerScroll(WebCore::FrameView*, const WebPoint&); + void stop(); + +private: + void scroll(); + void update(); + WebCore::IntSize scrollDistanceFor(WebCore::FrameView*, const WebPoint&) const; + bool shouldScroll() const { return !m_lastDistance.isZero(); } + + WebCore::Timer<DragScrollTimer> m_timer; + WebCore::FrameView* m_view; + WebCore::IntSize m_lastDistance; + bool m_scrolling; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index 4eda1f6..2a40d78 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -921,8 +921,13 @@ void EditorClientImpl::getGuessesForWord(const String&, void EditorClientImpl::setInputMethodState(bool enabled) { - if (m_webView->client()) + if (m_webView->client()) { + m_webView->client()->resetInputMethod(); + + // Remove this line when WebViewClient::setInputMethodEnabled() gets + // removed. m_webView->client()->setInputMethodEnabled(enabled); + } } } // namesace WebKit diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 694d7c2..dae9348 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -735,9 +735,6 @@ void FrameLoaderClientImpl::dispatchDidCommitLoad() if (m_webFrame->client()) m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, isNewNavigation); - - if (webview->devToolsAgentPrivate()) - webview->devToolsAgentPrivate()->didCommitProvisionalLoad(m_webFrame, isNewNavigation); } void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( diff --git a/WebKit/chromium/src/GLES2Context.cpp b/WebKit/chromium/src/GLES2Context.cpp index 9dd4eff..b6d619c 100644 --- a/WebKit/chromium/src/GLES2Context.cpp +++ b/WebKit/chromium/src/GLES2Context.cpp @@ -47,6 +47,8 @@ // WebGLES2Context. This is done so we have a place to inject an // implementation which creates the GL ES context. +using namespace WebKit; + namespace WebCore { class GLES2ContextInternal { @@ -56,23 +58,20 @@ public: bool initialize(Page*); - WebKit::WebGLES2Context* getWebGLES2Context() { return m_impl.get(); } + WebGLES2Context* getWebGLES2Context() { return m_impl; } private: - OwnPtr<WebKit::WebGLES2Context> m_impl; + WebGLES2Context* m_impl; }; bool GLES2ContextInternal::initialize(Page* page) { - m_impl = WebKit::webKitClient()->createGLES2Context(); + ASSERT(page); + WebViewImpl* webView = WebViewImpl::fromPage(page); + m_impl = webView->gles2Context(); if (!m_impl) return false; - WebKit::WebViewImpl* webView = WebKit::WebViewImpl::fromPage(page); - if (!m_impl->initialize(webView)) { - m_impl.clear(); - return false; - } return true; } @@ -94,7 +93,7 @@ GLES2Context::~GLES2Context() bool GLES2Context::makeCurrent() { - WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context(); + WebGLES2Context* webContext = m_internal->getWebGLES2Context(); if (!webContext) return false; return webContext->makeCurrent(); @@ -102,7 +101,7 @@ bool GLES2Context::makeCurrent() bool GLES2Context::destroy() { - WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context(); + WebGLES2Context* webContext = m_internal->getWebGLES2Context(); if (!webContext) return false; return webContext->destroy(); @@ -110,7 +109,7 @@ bool GLES2Context::destroy() bool GLES2Context::swapBuffers() { - WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context(); + WebGLES2Context* webContext = m_internal->getWebGLES2Context(); if (!webContext) return false; return webContext->swapBuffers(); diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp index 91d10d5..cf491f7 100644 --- a/WebKit/chromium/src/InspectorClientImpl.cpp +++ b/WebKit/chromium/src/InspectorClientImpl.cpp @@ -60,64 +60,74 @@ InspectorClientImpl::~InspectorClientImpl() void InspectorClientImpl::inspectorDestroyed() { - // Our lifetime is bound to the WebViewImpl. + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->inspectorDestroyed(); } -void InspectorClientImpl::openInspectorFrontend(InspectorController*) +void InspectorClientImpl::openInspectorFrontend(InspectorController* controller) { -} - -static void invalidateNodeBoundingRect(WebViewImpl* webView) -{ - // FIXME: Is it important to just invalidate the rect of the node region - // given that this is not on a critical codepath? In order to do so, we'd - // have to take scrolling into account. - const WebSize& size = webView->size(); - WebRect damagedRect(0, 0, size.width, size.height); - if (webView->client()) - webView->client()->didInvalidateRect(damagedRect); + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->openInspectorFrontend(controller); } void InspectorClientImpl::highlight(Node* node) { - // InspectorController does the actually tracking of the highlighted node - // and the drawing of the highlight. Here we just make sure to invalidate - // the rects of the old and new nodes. - hideHighlight(); + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->highlight(node); } void InspectorClientImpl::hideHighlight() { - // FIXME: able to invalidate a smaller rect. - invalidateNodeBoundingRect(m_inspectedWebView); + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->hideHighlight(); } void InspectorClientImpl::populateSetting(const String& key, String* value) { - WebString string; - m_inspectedWebView->inspectorSetting(key, &string); - *value = string; + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->populateSetting(key, value); } void InspectorClientImpl::storeSetting(const String& key, const String& value) { - m_inspectedWebView->setInspectorSetting(key, value); + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->storeSetting(key, value); } bool InspectorClientImpl::sendMessageToFrontend(const WebCore::String& message) { - WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent()); - if (!devToolsAgent) - return false; - - WebVector<WebString> arguments(size_t(1)); - arguments[0] = message; - WebDevToolsMessageData data; - data.className = "ToolsAgentDelegate"; - data.methodName = "dispatchOnClient"; - data.arguments.swap(arguments); - devToolsAgent->sendRpcMessage(data); - return true; + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + return agent->sendMessageToFrontend(message); + return false; +} + +void InspectorClientImpl::resourceTrackingWasEnabled() +{ + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->resourceTrackingWasEnabled(); +} + +void InspectorClientImpl::resourceTrackingWasDisabled() +{ + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->resourceTrackingWasDisabled(); +} + +void InspectorClientImpl::timelineProfilerWasStarted() +{ + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->timelineProfilerWasStarted(); +} + +void InspectorClientImpl::timelineProfilerWasStopped() +{ + if (WebDevToolsAgentImpl* agent = devToolsAgent()) + agent->timelineProfilerWasStopped(); +} + +WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent() +{ + return static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent()); } } // namespace WebKit diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h index f4994e3..0605ccd 100644 --- a/WebKit/chromium/src/InspectorClientImpl.h +++ b/WebKit/chromium/src/InspectorClientImpl.h @@ -38,6 +38,7 @@ namespace WebKit { class WebDevToolsAgentClient; +class WebDevToolsAgentImpl; class WebViewImpl; class InspectorClientImpl : public WebCore::InspectorClient { @@ -56,7 +57,13 @@ public: virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); virtual bool sendMessageToFrontend(const WebCore::String&); + + virtual void resourceTrackingWasEnabled(); + virtual void resourceTrackingWasDisabled(); + virtual void timelineProfilerWasStarted(); + virtual void timelineProfilerWasStopped(); private: + WebDevToolsAgentImpl* devToolsAgent(); // The WebViewImpl of the page being inspected; gets passed to the constructor WebViewImpl* m_inspectedWebView; diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp index 6f7ed95..83b925a 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp @@ -31,6 +31,8 @@ #include "config.h" #include "InspectorFrontendClientImpl.h" +#include "Document.h" +#include "Frame.h" #include "InspectorFrontendHost.h" #include "Page.h" #include "PlatformString.h" @@ -120,9 +122,9 @@ void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned) // Do nothing; } -void InspectorFrontendClientImpl::inspectedURLChanged(const String&) +void InspectorFrontendClientImpl::inspectedURLChanged(const String& url) { - // Do nothing; + m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url); } } // namespace WebKit diff --git a/WebKit/chromium/src/NotificationPresenterImpl.cpp b/WebKit/chromium/src/NotificationPresenterImpl.cpp index c928c91..dca1856 100644 --- a/WebKit/chromium/src/NotificationPresenterImpl.cpp +++ b/WebKit/chromium/src/NotificationPresenterImpl.cpp @@ -88,10 +88,7 @@ void NotificationPresenterImpl::cancel(Notification* notification) void NotificationPresenterImpl::notificationObjectDestroyed(Notification* notification) { - // TODO(pkasting): We cannot ref an object that's being destroyed. Either - // this function needs to be called earlier than in ~Notification(), or it - // needs to not ref this object. - //m_presenter->objectDestroyed(PassRefPtr<Notification>(notification)); + m_presenter->objectDestroyed(PassRefPtr<Notification>(notification)); } NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& sourceURL) diff --git a/WebKit/chromium/src/ToolsAgent.h b/WebKit/chromium/src/ToolsAgent.h index ab48153..c748c8a 100644 --- a/WebKit/chromium/src/ToolsAgent.h +++ b/WebKit/chromium/src/ToolsAgent.h @@ -50,9 +50,6 @@ namespace WebKit { DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT) #define TOOLS_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ - /* Updates focused node on the client. */ \ - METHOD1(frameNavigate, String /* url */) \ - \ /* Response to the DispatchOn*. */ \ METHOD3(didDispatchOn, int /* call_id */, String /* result */, String /* exception */) \ \ diff --git a/WebKit/chromium/src/WebCString.cpp b/WebKit/chromium/src/WebCString.cpp index b484b19..f81d7f4 100644 --- a/WebKit/chromium/src/WebCString.cpp +++ b/WebKit/chromium/src/WebCString.cpp @@ -41,6 +41,18 @@ namespace WebKit { class WebCStringPrivate : public WTF::CStringBuffer { }; +int WebCString::compare(const WebCString& other) const +{ + // A null string is always less than a non null one. + if (isNull() != other.isNull()) + return isNull() ? -1 : 1; + + if (isNull()) + return 0; // Both WebStrings are null. + + return strcmp(m_private->data(), other.m_private->data()); +} + void WebCString::reset() { if (m_private) { diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp index 1479eb0..376509d 100644 --- a/WebKit/chromium/src/WebDatabase.cpp +++ b/WebKit/chromium/src/WebDatabase.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebDatabase.h" -#include "Database.h" +#include "AbstractDatabase.h" #include "DatabaseTask.h" #include "DatabaseThread.h" #include "DatabaseTracker.h" @@ -50,7 +50,7 @@ namespace WebKit { static WebDatabaseObserver* databaseObserver = 0; -class WebDatabasePrivate : public Database { +class WebDatabasePrivate : public AbstractDatabase { }; void WebDatabase::reset() @@ -110,34 +110,27 @@ void WebDatabase::updateDatabaseSize( void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName) { - HashSet<RefPtr<Database> > databaseHandles; - PassRefPtr<SecurityOrigin> originPrp(WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier)); - RefPtr<SecurityOrigin> origin = originPrp; + HashSet<RefPtr<AbstractDatabase> > databaseHandles; + RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(originIdentifier); DatabaseTracker::tracker().getOpenDatabases(origin.get(), databaseName, &databaseHandles); - for (HashSet<RefPtr<Database> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it) { - Database* database = it->get(); - DatabaseThread* databaseThread = database->scriptExecutionContext()->databaseThread(); - if (databaseThread && !databaseThread->terminationRequested()) { - database->stop(); - databaseThread->scheduleTask(DatabaseCloseTask::create(database, Database::RemoveDatabaseFromContext, 0)); - } - } + for (HashSet<RefPtr<AbstractDatabase> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it) + it->get()->closeImmediately(); } -WebDatabase::WebDatabase(const WTF::PassRefPtr<Database>& database) +WebDatabase::WebDatabase(const WTF::PassRefPtr<AbstractDatabase>& database) : m_private(static_cast<WebDatabasePrivate*>(database.releaseRef())) { } -WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<Database>& database) +WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<AbstractDatabase>& database) { assign(static_cast<WebDatabasePrivate*>(database.releaseRef())); return *this; } -WebDatabase::operator WTF::PassRefPtr<Database>() const +WebDatabase::operator WTF::PassRefPtr<AbstractDatabase>() const { - return PassRefPtr<Database>(const_cast<WebDatabasePrivate*>(m_private)); + return PassRefPtr<AbstractDatabase>(const_cast<WebDatabasePrivate*>(m_private)); } void WebDatabase::assign(WebDatabasePrivate* d) diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index c4bbbfa..c0e9b44 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -60,12 +60,15 @@ #include "WebDataSource.h" #include "WebDevToolsAgentClient.h" #include "WebDevToolsMessageData.h" +#include "WebDevToolsMessageTransport.h" #include "WebFrameImpl.h" +#include "WebRect.h" #include "WebString.h" #include "WebURL.h" #include "WebURLError.h" #include "WebURLRequest.h" #include "WebURLResponse.h" +#include "WebViewClient.h" #include "WebViewImpl.h" #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> @@ -103,32 +106,23 @@ void InspectorBackendWeakReferenceCallback(v8::Persistent<v8::Value> object, voi object.Dispose(); } -void SetApuAgentEnabledInUtilityContext(v8::Handle<v8::Context> context, bool enabled) -{ - v8::HandleScope handleScope; - v8::Context::Scope contextScope(context); - v8::Handle<v8::Object> dispatcher = v8::Local<v8::Object>::Cast( - context->Global()->Get(v8::String::New("ApuAgentDispatcher"))); - if (dispatcher.IsEmpty()) - return; - dispatcher->Set(v8::String::New("enabled"), v8::Boolean::New(enabled)); -} - -// TODO(pfeldman): Make this public in WebDevToolsAgent API. -static const char kApuAgentFeatureName[] = "apu-agent"; - -// Keep these in sync with the ones in inject_dispatch.js. -static const char kTimelineFeatureName[] = "timeline-profiler"; static const char kResourceTrackingFeatureName[] = "resource-tracking"; +static const char kTimelineFeatureName[] = "timeline-profiler"; +static const char kApuAgentFeatureName[] = "apu-agent"; class IORPCDelegate : public DevToolsRPC::Delegate, public Noncopyable { public: - IORPCDelegate() { } + IORPCDelegate() : m_transport(0) { } + explicit IORPCDelegate(WebDevToolsMessageTransport* transport) : m_transport(transport) { } virtual ~IORPCDelegate() { } virtual void sendRpcMessage(const WebDevToolsMessageData& data) { - WebDevToolsAgentClient::sendMessageToFrontendOnIOThread(data); + if (m_transport) + m_transport->sendMessageToFrontendOnIOThread(data); } + +private: + WebDevToolsMessageTransport* m_transport; }; class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop { @@ -306,21 +300,6 @@ void WebDevToolsAgentImpl::didNavigate() DebuggerAgentManager::onNavigate(); } -void WebDevToolsAgentImpl::didCommitProvisionalLoad(WebFrameImpl* webframe, bool isNewNavigation) -{ - if (!m_attached) - return; - WebDataSource* ds = webframe->dataSource(); - const WebURLRequest& request = ds->request(); - WebURL url = ds->hasUnreachableURL() ? - ds->unreachableURL() : - request.url(); - if (!webframe->parent()) { - m_toolsAgentDelegateStub->frameNavigate(WebCore::KURL(url).string()); - SetApuAgentEnabledInUtilityContext(m_utilityContext, m_apuAgentEnabled); - } -} - void WebDevToolsAgentImpl::didClearWindowObject(WebFrameImpl* webframe) { DebuggerAgentManager::setHostId(webframe, m_hostId); @@ -412,15 +391,6 @@ void WebDevToolsAgentImpl::initDevToolsAgentHost() devtoolsAgentHost.addProtoFunction( "dispatch", WebDevToolsAgentImpl::jsDispatchOnClient); - devtoolsAgentHost.addProtoFunction( - "dispatchToApu", - WebDevToolsAgentImpl::jsDispatchToApu); - devtoolsAgentHost.addProtoFunction( - "evaluateOnSelf", - WebDevToolsAgentImpl::jsEvaluateOnSelf); - devtoolsAgentHost.addProtoFunction( - "runtimeFeatureStateChanged", - WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged); devtoolsAgentHost.build(); v8::HandleScope scope; @@ -481,7 +451,6 @@ void WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController() void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) { m_apuAgentEnabled = enabled; - SetApuAgentEnabledInUtilityContext(m_utilityContext, enabled); InspectorController* ic = m_webViewImpl->page()->inspectorController(); if (enabled) { m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); @@ -510,55 +479,25 @@ v8::Handle<v8::Value> WebDevToolsAgentImpl::jsDispatchOnClient(const v8::Argumen String message = WebCore::toWebCoreStringWithNullCheck(args[0]); if (message.isEmpty() || exceptionCatcher.HasCaught()) return v8::Undefined(); + WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value()); - agent->m_toolsAgentDelegateStub->dispatchOnClient(message); - return v8::Undefined(); -} -// static -v8::Handle<v8::Value> WebDevToolsAgentImpl::jsDispatchToApu(const v8::Arguments& args) -{ - v8::TryCatch exceptionCatcher; - String message = WebCore::toWebCoreStringWithNullCheck(args[0]); - if (message.isEmpty() || exceptionCatcher.HasCaught()) + if (!agent->m_apuAgentEnabled) { + agent->m_toolsAgentDelegateStub->dispatchOnClient(message); return v8::Undefined(); - WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>( - v8::External::Cast(*args.Data())->Value()); - agent->m_apuAgentDelegateStub->dispatchToApu(message); - return v8::Undefined(); -} - -// static -v8::Handle<v8::Value> WebDevToolsAgentImpl::jsEvaluateOnSelf(const v8::Arguments& args) -{ - String code; - { - v8::TryCatch exceptionCatcher; - code = WebCore::toWebCoreStringWithNullCheck(args[0]); - if (code.isEmpty() || exceptionCatcher.HasCaught()) - return v8::Undefined(); } - WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value()); - v8::Context::Scope(agent->m_utilityContext); - V8Proxy* proxy = V8Proxy::retrieve(agent->m_webViewImpl->page()->mainFrame()); - v8::Local<v8::Value> result = proxy->runScript(v8::Script::Compile(v8::String::New(code.utf8().data())), true); - return result; -} -// static -v8::Handle<v8::Value> WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged(const v8::Arguments& args) -{ - v8::TryCatch exceptionCatcher; - String feature = WebCore::toWebCoreStringWithNullCheck(args[0]); - bool enabled = args[1]->ToBoolean()->Value(); - if (feature.isEmpty() || exceptionCatcher.HasCaught()) + String method = WebCore::toWebCoreStringWithNullCheck(args[1]); + if (method.isEmpty() || exceptionCatcher.HasCaught()) return v8::Undefined(); - WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value()); - agent->m_client->runtimeFeatureStateChanged(feature, enabled); + + if (method != "addRecordToTimeline" && method != "updateResource" && method != "addResource") + return v8::Undefined(); + + agent->m_apuAgentDelegateStub->dispatchToApu(message); return v8::Undefined(); } - WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController() { if (Page* page = m_webViewImpl->page()) @@ -612,6 +551,83 @@ void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURL ic->didFailLoading(resourceId, resourceError); } +void WebDevToolsAgentImpl::inspectorDestroyed() +{ + // Our lifetime is bound to the WebViewImpl. +} + +void WebDevToolsAgentImpl::openInspectorFrontend(InspectorController*) +{ +} + +void WebDevToolsAgentImpl::highlight(Node* node) +{ + // InspectorController does the actuall tracking of the highlighted node + // and the drawing of the highlight. Here we just make sure to invalidate + // the rects of the old and new nodes. + hideHighlight(); +} + +void WebDevToolsAgentImpl::hideHighlight() +{ + // FIXME: able to invalidate a smaller rect. + // FIXME: Is it important to just invalidate the rect of the node region + // given that this is not on a critical codepath? In order to do so, we'd + // have to take scrolling into account. + const WebSize& size = m_webViewImpl->size(); + WebRect damagedRect(0, 0, size.width, size.height); + if (m_webViewImpl->client()) + m_webViewImpl->client()->didInvalidateRect(damagedRect); +} + +void WebDevToolsAgentImpl::populateSetting(const String& key, String* value) +{ + WebString string; + m_webViewImpl->inspectorSetting(key, &string); + *value = string; +} + +void WebDevToolsAgentImpl::storeSetting(const String& key, const String& value) +{ + m_webViewImpl->setInspectorSetting(key, value); +} + +bool WebDevToolsAgentImpl::sendMessageToFrontend(const WebCore::String& message) +{ + WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_webViewImpl->devToolsAgent()); + if (!devToolsAgent) + return false; + + WebVector<WebString> arguments(size_t(1)); + arguments[0] = message; + WebDevToolsMessageData data; + data.className = "ToolsAgentDelegate"; + data.methodName = "dispatchOnClient"; + data.arguments.swap(arguments); + devToolsAgent->sendRpcMessage(data); + return true; +} + +void WebDevToolsAgentImpl::resourceTrackingWasEnabled() +{ + m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, true); +} + +void WebDevToolsAgentImpl::resourceTrackingWasDisabled() +{ + m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, false); +} + +void WebDevToolsAgentImpl::timelineProfilerWasStarted() +{ + m_client->runtimeFeatureStateChanged(kTimelineFeatureName, true); +} + +void WebDevToolsAgentImpl::timelineProfilerWasStopped() +{ + m_client->runtimeFeatureStateChanged(kTimelineFeatureName, false); +} + void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script) { InspectorController* ic = inspectorController(); @@ -647,10 +663,10 @@ void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler DebuggerAgentManager::setMessageLoopDispatchHandler(handler); } -bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(const WebDevToolsMessageData& data) +bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport* transport, const WebDevToolsMessageData& data) { - IORPCDelegate transport; - ProfilerAgentDelegateStub stub(&transport); + IORPCDelegate delegate(transport); + ProfilerAgentDelegateStub stub(&delegate); ProfilerAgentImpl agent(&stub); return ProfilerAgentDispatch::dispatch(&agent, data); } diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index 455dcef..c97b21f 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -31,6 +31,8 @@ #ifndef WebDevToolsAgentImpl_h #define WebDevToolsAgentImpl_h +#include "InspectorClient.h" + #include "APUAgentDelegate.h" #include "DevToolsRPC.h" #include "ToolsAgent.h" @@ -41,6 +43,7 @@ namespace WebCore { class Document; +class InspectorClient; class InspectorController; class Node; class String; @@ -62,7 +65,8 @@ struct WebDevToolsMessageData; class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate, public ToolsAgent, - public DevToolsRPC::Delegate { + public DevToolsRPC::Delegate, + public WebCore::InspectorClient { public: WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client); virtual ~WebDevToolsAgentImpl(); @@ -73,7 +77,6 @@ public: // WebDevToolsAgentPrivate implementation. virtual void didClearWindowObject(WebFrameImpl* frame); - virtual void didCommitProvisionalLoad(WebFrameImpl* frame, bool isNewNavigation); // WebDevToolsAgent implementation. virtual void attach(); @@ -92,6 +95,19 @@ public: virtual void didFinishLoading(unsigned long); virtual void didFailLoading(unsigned long, const WebURLError&); + // InspectorClient implementation. + virtual void inspectorDestroyed(); + virtual void openInspectorFrontend(WebCore::InspectorController*); + virtual void highlight(WebCore::Node*); + virtual void hideHighlight(); + virtual void populateSetting(const WebCore::String& key, WebCore::String* value); + virtual void storeSetting(const WebCore::String& key, const WebCore::String& value); + virtual void resourceTrackingWasEnabled(); + virtual void resourceTrackingWasDisabled(); + virtual void timelineProfilerWasStarted(); + virtual void timelineProfilerWasStopped(); + virtual bool sendMessageToFrontend(const WebCore::String&); + // DevToolsRPC::Delegate implementation. virtual void sendRpcMessage(const WebDevToolsMessageData& data); @@ -101,9 +117,6 @@ public: private: static v8::Handle<v8::Value> jsDispatchOnClient(const v8::Arguments& args); - static v8::Handle<v8::Value> jsDispatchToApu(const v8::Arguments& args); - static v8::Handle<v8::Value> jsEvaluateOnSelf(const v8::Arguments& args); - static v8::Handle<v8::Value> jsOnRuntimeFeatureStateChanged(const v8::Arguments& args); void disposeUtilityContext(); diff --git a/WebKit/chromium/src/WebDevToolsAgentPrivate.h b/WebKit/chromium/src/WebDevToolsAgentPrivate.h index 446f647..7038a5e 100644 --- a/WebKit/chromium/src/WebDevToolsAgentPrivate.h +++ b/WebKit/chromium/src/WebDevToolsAgentPrivate.h @@ -43,11 +43,6 @@ public: // The window object for the frame has been cleared of any extra properties // that may have been set by script from the previously loaded document. virtual void didClearWindowObject(WebFrameImpl*) = 0; - - // The provisional datasource is now committed. The first part of the - // response body has been received, and the encoding of the response body - // is known. - virtual void didCommitProvisionalLoad(WebFrameImpl*, bool isNewNavigation) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index 0a6c8de..eda2f77 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -105,6 +105,10 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( InspectorController* ic = m_webViewImpl->page()->inspectorController(); ic->setInspectorFrontendClient(new InspectorFrontendClientImpl(m_webViewImpl->page(), m_client, this)); + // Put DevTools frontend Page into its own group so that it's not + // deferred along with inspected page. + m_webViewImpl->page()->setGroupName("DevToolsFrontend"); + WebFrameImpl* frame = m_webViewImpl->mainFrameImpl(); v8::HandleScope scope; v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame()); diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp index 2b8ae3c..665d8d9 100644 --- a/WebKit/chromium/src/WebEntities.cpp +++ b/WebKit/chromium/src/WebEntities.cpp @@ -42,7 +42,7 @@ using namespace WebCore; namespace { -// Note that this file is also included by HTMLDocumentParser.cpp so we are getting +// 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 diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index bb1f6ce..c5fa1fe 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -472,9 +472,9 @@ WebString WebFrameImpl::name() const return m_frame->tree()->name(); } -void WebFrameImpl::clearName() +void WebFrameImpl::setName(const WebString& name) { - m_frame->tree()->clearName(); + m_frame->tree()->setName(name); } WebURL WebFrameImpl::url() const @@ -1279,6 +1279,21 @@ void WebFrameImpl::printEnd() m_printContext.clear(); } +bool WebFrameImpl::isPageBoxVisible(int pageIndex) +{ + return frame()->document()->isPageBoxVisible(pageIndex); +} + +WebRect WebFrameImpl::pageAreaRectInPixels(int pageIndex) +{ + return frame()->document()->pageAreaRectInPixels(pageIndex); +} + +WebSize WebFrameImpl::preferredPageSizeInPixels(int pageIndex) +{ + return frame()->document()->preferredPageSizeInPixels(pageIndex); +} + bool WebFrameImpl::find(int identifier, const WebString& searchText, const WebFindOptions& options, @@ -2135,14 +2150,8 @@ void WebFrameImpl::loadJavaScriptURL(const KURL& url) if (!result.getString(scriptResult)) return; - SecurityOrigin* securityOrigin = m_frame->document()->securityOrigin(); - - if (!m_frame->redirectScheduler()->locationChangePending()) { - m_frame->loader()->stopAllLoaders(); - m_frame->loader()->writer()->begin(m_frame->loader()->url(), true, securityOrigin); - m_frame->loader()->writer()->addData(scriptResult); - m_frame->loader()->writer()->end(); - } + if (!m_frame->redirectScheduler()->locationChangePending()) + m_frame->loader()->writer()->replaceDocument(scriptResult); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index a8b272f..c14ad9b 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -64,7 +64,7 @@ class WebFrameImpl : public WebFrame, public RefCounted<WebFrameImpl> { public: // WebFrame methods: virtual WebString name() const; - virtual void clearName(); + virtual void setName(const WebString&); virtual WebURL url() const; virtual WebURL favIconURL() const; virtual WebURL openSearchDescriptionURL() const; @@ -149,6 +149,9 @@ public: virtual float printPage(int pageToPrint, WebCanvas*); virtual float getPrintPageShrink(int page); virtual void printEnd(); + virtual bool isPageBoxVisible(int pageIndex); + virtual WebRect pageAreaRectInPixels(int pageIndex); + virtual WebSize preferredPageSizeInPixels(int pageIndex); virtual bool find( int identifier, const WebString& searchText, const WebFindOptions&, bool wrapWithinFrame, WebRect* selectionRect); diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 4d24ea9..b23dc35 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -1001,6 +1001,7 @@ void WebGraphicsContext3DDefaultImpl::generateMipmap(unsigned long target) bool WebGraphicsContext3DDefaultImpl::getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo& info) { + makeContextCurrent(); if (!program) { synthesizeGLError(GL_INVALID_VALUE); return false; @@ -1032,6 +1033,7 @@ bool WebGraphicsContext3DDefaultImpl::getActiveAttrib(WebGLId program, unsigned bool WebGraphicsContext3DDefaultImpl::getActiveUniform(WebGLId program, unsigned long index, ActiveInfo& info) { + makeContextCurrent(); GLint maxNameLength = -1; glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength); if (maxNameLength < 0) @@ -1223,6 +1225,7 @@ DELEGATE_TO_GL_2(polygonOffset, PolygonOffset, double, double) void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels) { + makeContextCurrent(); // 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(); diff --git a/WebKit/chromium/src/WebHistoryItem.cpp b/WebKit/chromium/src/WebHistoryItem.cpp index 45e4472..99ebce8 100644 --- a/WebKit/chromium/src/WebHistoryItem.cpp +++ b/WebKit/chromium/src/WebHistoryItem.cpp @@ -201,6 +201,17 @@ void WebHistoryItem::setDocumentState(const WebVector<WebString>& state) m_private->setDocumentState(ds); } +long long WebHistoryItem::itemSequenceNumber() const +{ + return m_private->itemSequenceNumber(); +} + +void WebHistoryItem::setItemSequenceNumber(long long itemSequenceNumber) +{ + ensureMutable(); + m_private->setItemSequenceNumber(itemSequenceNumber); +} + long long WebHistoryItem::documentSequenceNumber() const { return m_private->documentSequenceNumber(); diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp index 5ae1557..38d91df 100644 --- a/WebKit/chromium/src/WebNotification.cpp +++ b/WebKit/chromium/src/WebNotification.cpp @@ -36,6 +36,7 @@ #include "Notification.h" #include "WebString.h" +#include "WebTextDirection.h" #include "WebURL.h" #include <wtf/PassRefPtr.h> @@ -94,11 +95,19 @@ WebString WebNotification::body() const return m_private->contents().body(); } +// FIXME: remove dir() when unreferenced. Being replaced by direction(). WebString WebNotification::dir() const { return m_private->dir(); } +WebTextDirection WebNotification::direction() const +{ + return (m_private->direction() == RTL) ? + WebTextDirectionRightToLeft : + WebTextDirectionLeftToRight; +} + WebString WebNotification::replaceId() const { return m_private->replaceId(); diff --git a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp index 8f5a1f7..d0f7324 100644 --- a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp +++ b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp @@ -53,16 +53,13 @@ void WebPluginListBuilderImpl::addMediaTypeToLastPlugin(const WebString& name, c MimeClassInfo info; info.type = name; info.desc = description; - info.pluginIndex = m_results->size() - 1; m_results->last().mimes.append(info); } void WebPluginListBuilderImpl::addFileExtensionToLastMediaType(const WebString& extension) { MimeClassInfo& info = m_results->last().mimes.last(); - if (!info.suffixes.isEmpty()) - info.suffixes.append(','); - info.suffixes.append(extension); + info.extensions.append(extension); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp index f9da394..9ac4d34 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.cpp +++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp @@ -230,6 +230,7 @@ void WebPopupMenuImpl::setFocus(bool enable) { } +// DEPRECATED, will be removed later. bool WebPopupMenuImpl::handleCompositionEvent( WebCompositionCommand command, int cursorPosition, int targetStart, int targetEnd, const WebString& imeString) @@ -237,11 +238,34 @@ bool WebPopupMenuImpl::handleCompositionEvent( return false; } +bool WebPopupMenuImpl::setComposition( + const WebString& text, const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, int selectionEnd) +{ + return false; +} + +bool WebPopupMenuImpl::confirmComposition() +{ + return false; +} + +// DEPRECATED, will be removed later. bool WebPopupMenuImpl::queryCompositionStatus(bool* enabled, WebRect* caretRect) { return false; } +WebTextInputType WebPopupMenuImpl::textInputType() +{ + return WebTextInputTypeNone; +} + +WebRect WebPopupMenuImpl::caretOrSelectionBounds() +{ + return WebRect(); +} + void WebPopupMenuImpl::setTextDirection(WebTextDirection direction) { } diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h index a2602b0..95f776e 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/WebKit/chromium/src/WebPopupMenuImpl.h @@ -66,10 +66,21 @@ public: virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); + + // DEPRECATED, will be removed later. virtual bool handleCompositionEvent( WebCompositionCommand command, int cursorPosition, int targetStart, int targetEnd, const WebString& text); + virtual bool setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, int selectionEnd); + virtual bool confirmComposition(); + + // DEPRECATED, will be removed later. virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect); + virtual WebTextInputType textInputType(); + virtual WebRect caretOrSelectionBounds(); virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const { return false; } diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp index 8e73d6f..595a47f 100644 --- a/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebRuntimeFeatures.h" -#include "Database.h" +#include "AbstractDatabase.h" #include "RuntimeEnabledFeatures.h" #include "WebMediaPlayerClientImpl.h" #include "WebSocket.h" @@ -43,14 +43,14 @@ namespace WebKit { void WebRuntimeFeatures::enableDatabase(bool enable) { #if ENABLE(DATABASE) - Database::setIsAvailable(enable); + AbstractDatabase::setIsAvailable(enable); #endif } bool WebRuntimeFeatures::isDatabaseEnabled() { #if ENABLE(DATABASE) - return Database::isAvailable(); + return AbstractDatabase::isAvailable(); #else return false; #endif diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp index d5ba707..3f3ddba 100644 --- a/WebKit/chromium/src/WebURLResponse.cpp +++ b/WebKit/chromium/src/WebURLResponse.cpp @@ -287,6 +287,16 @@ void WebURLResponse::setWasNpnNegotiated(bool value) m_private->m_resourceResponse->setWasNpnNegotiated(value); } +bool WebURLResponse::wasAlternateProtocolAvailable() const +{ + return m_private->m_resourceResponse->wasAlternateProtocolAvailable(); +} + +void WebURLResponse::setWasAlternateProtocolAvailable(bool value) +{ + m_private->m_resourceResponse->setWasAlternateProtocolAvailable(value); +} + bool WebURLResponse::wasFetchedViaProxy() const { return m_private->m_resourceResponse->wasFetchedViaProxy(); diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 5adc35c..257d646 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -35,6 +35,7 @@ #include "AutocompletePopupMenuClient.h" #include "AXObjectCache.h" #include "Chrome.h" +#include "CompositionUnderlineVectorBuilder.h" #include "ContextMenu.h" #include "ContextMenuController.h" #include "ContextMenuItem.h" @@ -45,6 +46,7 @@ #include "DocumentLoader.h" #include "DOMUtilitiesPrivate.h" #include "DragController.h" +#include "DragScrollTimer.h" #include "DragData.h" #include "Editor.h" #include "EventHandler.h" @@ -81,14 +83,18 @@ #include "SecurityOrigin.h" #include "SelectionController.h" #include "Settings.h" +#include "Timer.h" #include "TypingCommand.h" #include "WebAccessibilityObject.h" #include "WebDevToolsAgentPrivate.h" +#include "WebDevToolsAgentImpl.h" #include "WebDragData.h" #include "WebFrameImpl.h" #include "WebImage.h" #include "WebInputEvent.h" #include "WebInputEventConversion.h" +#include "WebKit.h" +#include "WebKitClient.h" #include "WebMediaPlayerAction.h" #include "WebNode.h" #include "WebPoint.h" @@ -160,9 +166,9 @@ static const PopupContainerSettings suggestionsPopupSettings = { // WebView ---------------------------------------------------------------- -WebView* WebView::create(WebViewClient* client) +WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient) { - return new WebViewImpl(client); + return new WebViewImpl(client, devToolsClient); } void WebView::updateVisitedLinkState(unsigned long long linkHash) @@ -209,7 +215,7 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient) SecurityOrigin::setLocalLoadPolicy(SecurityOrigin::AllowLocalLoadsForLocalOnly); } -WebViewImpl::WebViewImpl(WebViewClient* client) +WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient) : m_client(client) , m_backForwardListClientImpl(this) , m_chromeClientImpl(this) @@ -238,10 +244,12 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_suggestionsPopup(0) , m_isTransparent(false) , m_tabsToLinks(false) + , m_dragScrollTimer(new DragScrollTimer()) #if USE(ACCELERATED_COMPOSITING) , m_layerRenderer(0) , m_isAcceleratedCompositingActive(false) #endif + , m_gles2Context(0) { // WebKit/win/WebView.cpp does the same thing, except they call the // KJS specific wrapper around this method. We need to have threading @@ -252,9 +260,13 @@ WebViewImpl::WebViewImpl(WebViewClient* client) // set to impossible point so we always get the first mouse pos m_lastMousePosition = WebPoint(-1, -1); - // the page will take ownership of the various clients + if (devToolsClient) + m_devToolsAgent = static_cast<WebDevToolsAgentImpl*>(WebDevToolsAgent::create(this, devToolsClient)); + m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0)); + // the page will take ownership of the various clients + m_page->backForwardList()->setClient(&m_backForwardListClientImpl); m_page->setGroupName(pageGroupName); @@ -827,45 +839,6 @@ bool WebViewImpl::mapKeyCodeForScroll(int keyCode, return true; } -// Computes the distance from a point outside a rect to the nearest edge of the rect. -static IntSize distanceToRect(const IntPoint& point, const IntRect& rect) -{ - int dx = 0, dy = 0; - if (point.x() < rect.x()) - dx = point.x() - rect.x(); - else if (rect.right() < point.x()) - dx = point.x() - rect.right(); - if (point.y() < rect.y()) - dy = point.y() - rect.y(); - else if (rect.bottom() < point.y()) - dy = point.y() - rect.bottom(); - return IntSize(dx, dy); -} - -void WebViewImpl::scrollForDragging(const WebPoint& clientPoint) -{ - // This margin approximates Safari behavior, derived from an observation. - static const int scrollMargin = 30; - - FrameView* view = mainFrameImpl()->frameView(); - if (!view) - return; - - IntRect bounds(0, 0, view->visibleWidth(), view->visibleHeight()); - bounds.setY(bounds.y() + scrollMargin); - bounds.setHeight(bounds.height() - scrollMargin * 2); - bounds.setX(bounds.x() + scrollMargin); - bounds.setWidth(bounds.width() - scrollMargin * 2); - - IntPoint point = clientPoint; - if (bounds.contains(point)) - return; - - IntSize toScroll = distanceToRect(point, bounds); - if (!toScroll.isZero()) - view->scrollBy(toScroll); -} - void WebViewImpl::hideSelectPopup() { if (m_selectPopup.get()) @@ -1191,25 +1164,66 @@ void WebViewImpl::setFocus(bool enable) } } +// DEPRECATED, will be removed later. bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command, int cursorPosition, int targetStart, int targetEnd, const WebString& imeString) { + if (command == WebKit::WebCompositionCommandSet) { + if (targetStart < 0) + targetStart = 0; + if (targetEnd < 0) + targetEnd = static_cast<int>(imeString.length()); + + // Create custom underlines. + // To emphasize the selection, the selected region uses a solid black + // for its underline while other regions uses a pale gray for theirs. + WebVector<WebCompositionUnderline> underlines(static_cast<size_t>(3)); + underlines[0].startOffset = 0; + underlines[0].endOffset = targetStart; + underlines[0].thick = true; + underlines[0].color = 0xffd3d3d3; + underlines[1].startOffset = targetStart; + underlines[1].endOffset = targetEnd; + underlines[1].thick = true; + underlines[1].color = 0xff000000; + underlines[2].startOffset = targetEnd; + underlines[2].endOffset = static_cast<unsigned>(imeString.length()); + underlines[2].thick = true; + underlines[2].color = 0xffd3d3d3; + return setComposition(imeString, underlines, cursorPosition, cursorPosition); + } + + if (command == WebKit::WebCompositionCommandDiscard) + setComposition(WebString(), WebVector<WebCompositionUnderline>(), 0, 0); + else if (command == WebKit::WebCompositionCommandConfirm) { + setComposition(imeString, WebVector<WebCompositionUnderline>(), 0, 0); + confirmComposition(); + } + + return true; +} + +bool WebViewImpl::setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, + int selectionEnd) +{ Frame* focused = focusedWebCoreFrame(); if (!focused || !m_imeAcceptEvents) return false; Editor* editor = focused->editor(); if (!editor) return false; - if (!editor->canEdit()) { - // The input focus has been moved to another WebWidget object. - // We should use this |editor| object only to complete the ongoing - // composition. - if (!editor->hasComposition()) - return false; - } + + // The input focus has been moved to another WebWidget object. + // We should use this |editor| object only to complete the ongoing + // composition. + if (!editor->canEdit() && !editor->hasComposition()) + return false; // We should verify the parent node of this IME composition node are // editable because JavaScript may delete a parent node of the composition @@ -1224,9 +1238,7 @@ bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command, // If we're not going to fire a keypress event, then the keydown event was // canceled. In that case, cancel any existing composition. - // FIXME: Ideally, we would only cancel a single keypress, rather than the - // whole composition. - if ((command == WebCompositionCommandDiscard) || m_suppressNextKeypressEvent) { + if (text.isEmpty() || m_suppressNextKeypressEvent) { // A browser process sent an IPC message which does not contain a valid // string, which means an ongoing composition has been canceled. // If the ongoing composition has been canceled, replace the ongoing @@ -1234,49 +1246,45 @@ bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command, String emptyString; Vector<CompositionUnderline> emptyUnderlines; editor->setComposition(emptyString, emptyUnderlines, 0, 0); - } else { - // A browser process sent an IPC message which contains a string to be - // displayed in this Editor object. - // To display the given string, set the given string to the - // m_compositionNode member of this Editor object and display it. - if (targetStart < 0) - targetStart = 0; - if (targetEnd < 0) - targetEnd = static_cast<int>(imeString.length()); - String compositionString(imeString); - // Create custom underlines. - // To emphasize the selection, the selected region uses a solid black - // for its underline while other regions uses a pale gray for theirs. - Vector<CompositionUnderline> underlines(3); - underlines[0].startOffset = 0; - underlines[0].endOffset = targetStart; - underlines[0].thick = true; - underlines[0].color.setRGB(0xd3, 0xd3, 0xd3); - underlines[1].startOffset = targetStart; - underlines[1].endOffset = targetEnd; - underlines[1].thick = true; - underlines[1].color.setRGB(0x00, 0x00, 0x00); - underlines[2].startOffset = targetEnd; - underlines[2].endOffset = static_cast<int>(imeString.length()); - underlines[2].thick = true; - underlines[2].color.setRGB(0xd3, 0xd3, 0xd3); - // When we use custom underlines, WebKit ("InlineTextBox.cpp" Line 282) - // prevents from writing a text in between 'selectionStart' and - // 'selectionEnd' somehow. - // Therefore, we use the 'cursorPosition' for these arguments so that - // there are not any characters in the above region. - editor->setComposition(compositionString, underlines, - cursorPosition, cursorPosition); - // The given string is a result string, which means the ongoing - // composition has been completed. I have to call the - // Editor::confirmCompletion() and complete this composition. - if (command == WebCompositionCommandConfirm) - editor->confirmComposition(); + return text.isEmpty(); } + // When the range of composition underlines overlap with the range between + // selectionStart and selectionEnd, WebKit somehow won't paint the selection + // at all (see InlineTextBox::paint() function in InlineTextBox.cpp). + // But the selection range actually takes effect. + editor->setComposition(String(text), + CompositionUnderlineVectorBuilder(underlines), + selectionStart, selectionEnd); + return editor->hasComposition(); } +bool WebViewImpl::confirmComposition() +{ + Frame* focused = focusedWebCoreFrame(); + if (!focused || !m_imeAcceptEvents) + return false; + Editor* editor = focused->editor(); + if (!editor || !editor->hasComposition()) + return false; + + // We should verify the parent node of this IME composition node are + // editable because JavaScript may delete a parent node of the composition + // node. In this case, WebKit crashes while deleting texts from the parent + // node, which doesn't exist any longer. + PassRefPtr<Range> range = editor->compositionRange(); + if (range) { + const Node* node = range->startPosition().node(); + if (!node || !node->isContentEditable()) + return false; + } + + editor->confirmComposition(); + return true; +} + +// DEPRECATED, will be removed later. bool WebViewImpl::queryCompositionStatus(bool* enableIME, WebRect* caretRect) { // Store whether the selected node needs IME and the caret rectangle. @@ -1311,6 +1319,59 @@ bool WebViewImpl::queryCompositionStatus(bool* enableIME, WebRect* caretRect) return true; } +WebTextInputType WebViewImpl::textInputType() +{ + WebTextInputType type = WebTextInputTypeNone; + const Frame* focused = focusedWebCoreFrame(); + if (!focused) + return type; + + const Editor* editor = focused->editor(); + if (!editor || !editor->canEdit()) + return type; + + SelectionController* controller = focused->selection(); + if (!controller) + return type; + + const Node* node = controller->start().node(); + if (!node) + return type; + + // FIXME: Support more text input types when necessary, eg. Number, + // Date, Email, URL, etc. + if (controller->isInPasswordField()) + type = WebTextInputTypePassword; + else if (node->shouldUseInputMethod()) + type = WebTextInputTypeText; + + return type; +} + +WebRect WebViewImpl::caretOrSelectionBounds() +{ + WebRect rect; + const Frame* focused = focusedWebCoreFrame(); + if (!focused) + return rect; + + SelectionController* controller = focused->selection(); + if (!controller) + return rect; + + const FrameView* view = focused->view(); + if (!view) + return rect; + + if (controller->isCaret()) + rect = view->contentsToWindow(controller->absoluteCaretBounds()); + else if (controller->isRange()) { + RefPtr<Range> range = controller->toNormalizedRange(); + rect = view->contentsToWindow(focused->firstRectForRange(range.get())); + } + return rect; +} + void WebViewImpl::setTextDirection(WebTextDirection direction) { // The Editor::setBaseWritingDirection() function checks if we can change @@ -1393,7 +1454,7 @@ bool WebViewImpl::dispatchBeforeUnloadEvent() if (!frame) return true; - return frame->shouldClose(); + return frame->loader()->shouldClose(); } void WebViewImpl::dispatchUnloadEvent() @@ -1576,6 +1637,7 @@ void WebViewImpl::dragSourceEndedAt( false, 0); m_page->mainFrame()->eventHandler()->dragSourceEndedAt(pme, static_cast<DragOperation>(operation)); + m_dragScrollTimer->stop(); } void WebViewImpl::dragSourceMovedTo( @@ -1583,7 +1645,7 @@ void WebViewImpl::dragSourceMovedTo( const WebPoint& screenPoint, WebDragOperation operation) { - scrollForDragging(clientPoint); + m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); } void WebViewImpl::dragSourceSystemDragEnded() @@ -1672,6 +1734,7 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, m_dropEffect = DropEffectDefault; m_dragOperation = WebDragOperationNone; m_dragIdentity = 0; + m_dragScrollTimer->stop(); } int WebViewImpl::dragIdentity() @@ -1707,7 +1770,10 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo m_dragOperation = static_cast<WebDragOperation>(effect); if (dragAction == DragOver) - scrollForDragging(clientPoint); + m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); + else + m_dragScrollTimer->stop(); + return m_dragOperation; } @@ -2221,7 +2287,23 @@ void WebViewImpl::setRootLayerNeedsDisplay() if (m_layerRenderer) m_layerRenderer->setNeedsDisplay(); } +#endif // USE(ACCELERATED_COMPOSITING) -#endif +// Returns the GLES2 context associated with this View. If one doesn't exist +// it will get created first. +WebGLES2Context* WebViewImpl::gles2Context() +{ + if (!m_gles2Context) { + m_gles2Context = webKitClient()->createGLES2Context(); + if (!m_gles2Context) + return 0; + + if (!m_gles2Context->initialize(this, 0)) { + m_gles2Context.clear(); + return 0; + } + } + return m_gles2Context.get(); +} } // namespace WebKit diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index 8b15f8a..a6fa131 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -31,6 +31,7 @@ #ifndef WebViewImpl_h #define WebViewImpl_h +#include "WebGLES2Context.h" #include "WebNavigationPolicy.h" #include "WebPoint.h" #include "WebSize.h" @@ -68,8 +69,10 @@ namespace WebKit { class AutocompletePopupMenuClient; class AutoFillPopupMenuClient; class ContextMenuClientImpl; +class DragScrollTimer; class SuggestionsPopupMenuClient; class WebAccessibilityObject; +class WebDevToolsAgentClient; class WebDevToolsAgentPrivate; class WebFrameImpl; class WebImage; @@ -90,13 +93,24 @@ public: virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); + + // DEPRECATED, will be removed later. virtual bool handleCompositionEvent(WebCompositionCommand command, int cursorPosition, int targetStart, int targetEnd, const WebString& text); - virtual bool queryCompositionStatus(bool* enabled, - WebRect* caretRect); + virtual bool setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, + int selectionEnd); + virtual bool confirmComposition(); + + // DEPRECATED, will be removed later. + virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect); + virtual WebTextInputType textInputType(); + virtual WebRect caretOrSelectionBounds(); virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const; @@ -322,6 +336,10 @@ public: WebCore::ScrollDirection* scrollDirection, WebCore::ScrollGranularity* scrollGranularity); + // Returns the GLES2Context associated with this WebView. One will be created + // if it doesn't already exist. + WebGLES2Context* gles2Context(); + private: friend class WebView; // So WebView::Create can call our constructor friend class WTF::RefCounted<WebViewImpl>; @@ -331,7 +349,7 @@ private: DragOver }; - WebViewImpl(WebViewClient* client); + WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient); ~WebViewImpl(); // Returns true if the event was actually processed. @@ -351,8 +369,6 @@ private: // Returns true if the view was scrolled. bool scrollViewWithKeyboard(int keyCode, int modifiers); - void scrollForDragging(const WebPoint&); - void hideSelectPopup(); // Converts |pos| from window coordinates to contents coordinates and gets @@ -496,6 +512,7 @@ private: typedef HashMap<WebCore::String, WebCore::String> SettingsMap; OwnPtr<SettingsMap> m_inspectorSettingsMap; + OwnPtr<DragScrollTimer> m_dragScrollTimer; #if ENABLE(NOTIFICATIONS) // The provider of desktop notifications; @@ -510,6 +527,8 @@ private: bool m_isAcceleratedCompositingActive; #endif static const WebInputEvent* m_currentInputEvent; + + OwnPtr<WebGLES2Context> m_gles2Context; }; } // namespace WebKit diff --git a/WebKit/chromium/src/js/DebuggerAgent.js b/WebKit/chromium/src/js/DebuggerAgent.js index 8d2457f..01d7627 100644 --- a/WebKit/chromium/src/js/DebuggerAgent.js +++ b/WebKit/chromium/src/js/DebuggerAgent.js @@ -1075,7 +1075,7 @@ devtools.DebuggerAgent.prototype.formatCallFrame_ = function(stackFrame) WebInspector.parsedScriptSource(sourceId, null, null, 0, WebInspector.Script.WorldType.MAIN_WORLD); } - var funcName = func.name || func.inferredName || "(anonymous function)"; + var funcName = func.name || func.inferredName; var line = devtools.DebuggerAgent.v8ToWwebkitLineNumber_(stackFrame.line); // Add basic scope chain info with scope variables. diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js index 3ff3eb7..baddb7d 100644 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ b/WebKit/chromium/src/js/DebuggerScript.js @@ -219,8 +219,6 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) var functionName; if (func) functionName = func.name() || func.inferredName(); - if (!functionName) - functionName = "[anonymous]"; // Get script ID. var script = func.script(); diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 398d358..851c934 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -61,7 +61,6 @@ devtools$$dispatch = function(remoteName, methodName, param1, param2, param3) devtools.ToolsAgent = function() { RemoteToolsAgent.didDispatchOn = WebInspector.Callback.processCallback; - RemoteToolsAgent.frameNavigate = this.frameNavigate_.bind(this); RemoteToolsAgent.dispatchOnClient = this.dispatchOnClient_.bind(this); this.debuggerAgent_ = new devtools.DebuggerAgent(); this.profilerAgent_ = new devtools.ProfilerAgent(); @@ -107,24 +106,14 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function() }; -/** - * @param {string} url Url frame navigated to. - * @see tools_agent.h - * @private - */ -devtools.ToolsAgent.prototype.frameNavigate_ = function(url) +(function () { +var orig = WebInspector.reset; +WebInspector.reset = function() { - this.reset(); - // Do not reset Profiles panel. - var profiles = null; - if ("profiles" in WebInspector.panels) { - profiles = WebInspector.panels["profiles"]; - delete WebInspector.panels["profiles"]; - } - WebInspector.reset(); - if (profiles !== null) - WebInspector.panels["profiles"] = profiles; + devtools.tools.reset(); + orig.call(this); }; +})(); /** @@ -302,31 +291,6 @@ WebInspector.UIString = function(string) return String.vsprintf(string, Array.prototype.slice.call(arguments, 1)); }; -// Activate window upon node search complete. This will go away once InspectorFrontendClient is landed. -(function() { - var original = WebInspector.searchingForNodeWasDisabled; - WebInspector.searchingForNodeWasDisabled = function() - { - if (this.panels.elements._nodeSearchButton.toggled) - InspectorFrontendHost.bringToFront(); - original.apply(this, arguments); - } -})(); - - -// There is no clear way of setting frame title yet. So sniffing main resource -// load. -(function OverrideUpdateResource() { - var originalUpdateResource = WebInspector.updateResource; - WebInspector.updateResource = function(identifier, payload) - { - originalUpdateResource.call(this, identifier, payload); - var resource = this.resources[identifier]; - if (resource && resource.mainResource && resource.finished) - document.title = WebInspector.UIString("Developer Tools - %s", resource.url); - }; -})(); - /** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */ (function() @@ -356,9 +320,10 @@ WebInspector.UIString = function(string) })(); -// We need to have a place for postponed tasks -// which should be executed when all the messages between agent and frontend -// are processed. + +/////////////////////////////////////////// +// Chromium layout test harness support. // +/////////////////////////////////////////// WebInspector.runAfterPendingDispatchesQueue = []; @@ -375,19 +340,11 @@ WebInspector.queuesAreEmpty = function() copy[i].call(this); }; -(function() -{ -var originalAddToFrame = InspectorFrontendHost.addResourceSourceToFrame; -InspectorFrontendHost.addResourceSourceToFrame = function(identifier, element) -{ - var resource = WebInspector.resources[identifier]; - if (!resource) - return; - originalAddToFrame.call(this, identifier, resource.mimeType, element); -}; -})(); -// Chromium theme support. +///////////////////////////// +// Chromium theme support. // +///////////////////////////// + WebInspector.setToolbarColors = function(backgroundColor, color) { if (!WebInspector._themeStyleElement) { diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js index da5929a..806bf6a 100644 --- a/WebKit/chromium/src/js/DevToolsHostStub.js +++ b/WebKit/chromium/src/js/DevToolsHostStub.js @@ -34,277 +34,8 @@ */ if (!window["RemoteDebuggerAgent"]) { - -/** - * FIXME: change field naming style to use trailing underscore. - * @constructor - */ -RemoteDebuggerAgentStub = function() -{ -}; - - -RemoteDebuggerAgentStub.prototype.getContextId = function() -{ - RemoteDebuggerAgent.setContextId(3); -}; - - -RemoteDebuggerAgentStub.prototype.processDebugCommands = function() -{ -}; - - - -/** - * @constructor - */ -RemoteProfilerAgentStub = function() -{ -}; - - -RemoteProfilerAgentStub.prototype.getActiveProfilerModules = function() -{ - ProfilerStubHelper.GetInstance().getActiveProfilerModules(); -}; - - -RemoteProfilerAgentStub.prototype.getLogLines = function(pos) -{ - ProfilerStubHelper.GetInstance().getLogLines(pos); -}; - - -/** - * @constructor - */ -RemoteToolsAgentStub = function() -{ -}; - - -RemoteToolsAgentStub.prototype.dispatchOnInjectedScript = function() -{ -}; - - -RemoteToolsAgentStub.prototype.dispatchOnInspectorController = function() -{ -}; - - -/** - * @constructor - */ -ProfilerStubHelper = function() -{ - this.activeProfilerModules_ = devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE; - this.heapProfSample_ = 0; - this.log_ = ''; -}; - - -ProfilerStubHelper.GetInstance = function() -{ - if (!ProfilerStubHelper.instance_) - ProfilerStubHelper.instance_ = new ProfilerStubHelper(); - return ProfilerStubHelper.instance_; -}; - - -ProfilerStubHelper.prototype.StopProfiling = function(modules) -{ - this.activeProfilerModules_ &= ~modules; -}; - - -ProfilerStubHelper.prototype.StartProfiling = function(modules) -{ - var profModules = devtools.ProfilerAgent.ProfilerModules; - if (modules & profModules.PROFILER_MODULE_HEAP_SNAPSHOT) { - if (modules & profModules.PROFILER_MODULE_HEAP_STATS) { - this.log_ += - 'heap-sample-begin,"Heap","allocated",' + - (new Date()).getTime() + '\n' + - 'heap-sample-stats,"Heap","allocated",10000,1000\n'; - this.log_ += - 'heap-sample-item,STRING_TYPE,100,1000\n' + - 'heap-sample-item,CODE_TYPE,10,200\n' + - 'heap-sample-item,MAP_TYPE,20,350\n'; - this.log_ += ProfilerStubHelper.HeapSamples[this.heapProfSample_++]; - this.heapProfSample_ %= ProfilerStubHelper.HeapSamples.length; - this.log_ += 'heap-sample-end,"Heap","allocated"\n'; - } - } else { - if (modules & profModules.PROFILER_MODULE_CPU) - this.log_ += ProfilerStubHelper.ProfilerLogBuffer; - this.activeProfilerModules_ |= modules; - } -}; - - -ProfilerStubHelper.prototype.getActiveProfilerModules = function() -{ - var self = this; - setTimeout(function() { - RemoteProfilerAgent.didGetActiveProfilerModules(self.activeProfilerModules_); - }, 100); -}; - - -ProfilerStubHelper.prototype.getLogLines = function(pos) -{ - var profModules = devtools.ProfilerAgent.ProfilerModules; - var logLines = this.log_.substr(pos); - setTimeout(function() { - RemoteProfilerAgent.didGetLogLines(pos + logLines.length, logLines); - }, 100); -}; - - -ProfilerStubHelper.ProfilerLogBuffer = - 'profiler,begin,1\n' + - 'profiler,resume\n' + - 'code-creation,LazyCompile,0x1000,256,"test1 http://aaa.js:1"\n' + - 'code-creation,LazyCompile,0x2000,256,"test2 http://bbb.js:2"\n' + - 'code-creation,LazyCompile,0x3000,256,"test3 http://ccc.js:3"\n' + - 'tick,0x1010,0x0,3\n' + - 'tick,0x2020,0x0,3,0x1010\n' + - 'tick,0x2020,0x0,3,0x1010\n' + - 'tick,0x3010,0x0,3,0x2020, 0x1010\n' + - 'tick,0x2020,0x0,3,0x1010\n' + - 'tick,0x2030,0x0,3,0x2020, 0x1010\n' + - 'tick,0x2020,0x0,3,0x1010\n' + - 'tick,0x1010,0x0,3\n' + - 'profiler,pause\n'; - - -ProfilerStubHelper.HeapSamples = [ - 'heap-js-cons-item,foo,1,100\n' + - 'heap-js-cons-item,bar,20,2000\n' + - 'heap-js-cons-item,Object,5,100\n' + - 'heap-js-ret-item,foo,bar;3\n' + - 'heap-js-ret-item,bar,foo;5\n' + - 'heap-js-ret-item,Object:0x1234,(roots);1\n', - - 'heap-js-cons-item,foo,2000,200000\n' + - 'heap-js-cons-item,bar,10,1000\n' + - 'heap-js-cons-item,Object,6,120\n' + - 'heap-js-ret-item,foo,bar;7,Object:0x1234;10\n' + - 'heap-js-ret-item,bar,foo;10,Object:0x1234;10\n' + - 'heap-js-ret-item,Object:0x1234,(roots);1\n', - - 'heap-js-cons-item,foo,15,1500\n' + - 'heap-js-cons-item,bar,15,1500\n' + - 'heap-js-cons-item,Object,5,100\n' + - 'heap-js-cons-item,Array,3,1000\n' + - 'heap-js-ret-item,foo,bar;3,Array:0x5678;1\n' + - 'heap-js-ret-item,bar,foo;5,Object:0x1234;8,Object:0x5678;2\n' + - 'heap-js-ret-item,Object:0x1234,(roots);1,Object:0x5678;2\n' + - 'heap-js-ret-item,Object:0x5678,(global property);3,Object:0x1234;5\n' + - 'heap-js-ret-item,Array:0x5678,(global property);3,Array:0x5678;2\n', - - 'heap-js-cons-item,bar,20,2000\n' + - 'heap-js-cons-item,Object,6,120\n' + - 'heap-js-ret-item,bar,foo;5,Object:0x1234;1,Object:0x1235;3\n' + - 'heap-js-ret-item,Object:0x1234,(global property);3\n' + - 'heap-js-ret-item,Object:0x1235,(global property);5\n', - - 'heap-js-cons-item,foo,15,1500\n' + - 'heap-js-cons-item,bar,15,1500\n' + - 'heap-js-cons-item,Array,10,1000\n' + - 'heap-js-ret-item,foo,bar;1,Array:0x5678;1\n' + - 'heap-js-ret-item,bar,foo;5\n' + - 'heap-js-ret-item,Array:0x5678,(roots);3\n', - - 'heap-js-cons-item,bar,20,2000\n' + - 'heap-js-cons-item,baz,15,1500\n' + - 'heap-js-ret-item,bar,baz;3\n' + - 'heap-js-ret-item,baz,bar;3\n' -]; - - -/** - * @constructor - */ -RemoteDebuggerCommandExecutorStub = function() -{ -}; - - -RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand = function(cmd) -{ - if ('{"seq":2,"type":"request","command":"scripts","arguments":{"includeSource":false}}' === cmd) { - var response1 = - '{"seq":5,"request_seq":2,"type":"response","command":"scripts","' + - 'success":true,"body":[{"handle":61,"type":"script","name":"' + - 'http://www/~test/t.js","id":59,"lineOffset":0,"columnOffset":0,' + - '"lineCount":1,"sourceStart":"function fib(n) {","sourceLength":300,' + - '"scriptType":2,"compilationType":0,"context":{"ref":60}}],"refs":[{' + - '"handle":60,"type":"context","data":"page,3"}],"running":false}'; - this.sendResponse_(response1); - } else if ('{"seq":3,"type":"request","command":"scripts","arguments":{"ids":[59],"includeSource":true}}' === cmd) { - this.sendResponse_( - '{"seq":8,"request_seq":3,"type":"response","command":"scripts",' + - '"success":true,"body":[{"handle":1,"type":"script","name":' + - '"http://www/~test/t.js","id":59,"lineOffset":0,"columnOffset":0,' + - '"lineCount":1,"source":"function fib(n) {return n+1;}",' + - '"sourceLength":244,"scriptType":2,"compilationType":0,"context":{' + - '"ref":0}}],"refs":[{"handle":0,"type":"context","data":"page,3}],"' + - '"running":false}'); - } else if (cmd.indexOf('"command":"profile"') !== -1) { - var cmdObj = JSON.parse(cmd); - if (cmdObj.arguments.command === "resume") - ProfilerStubHelper.GetInstance().StartProfiling(parseInt(cmdObj.arguments.modules)); - else if (cmdObj.arguments.command === "pause") - ProfilerStubHelper.GetInstance().StopProfiling(parseInt(cmdObj.arguments.modules)); - else - debugPrint("Unexpected profile command: " + cmdObj.arguments.command); - } else - debugPrint("Unexpected command: " + cmd); -}; - - -RemoteDebuggerCommandExecutorStub.prototype.DebuggerPauseScript = function() -{ -}; - - -RemoteDebuggerCommandExecutorStub.prototype.sendResponse_ = function(response) -{ - setTimeout(function() { - RemoteDebuggerAgent.debuggerOutput(response); - }, 0); -}; - - -DevToolsHostStub = function() -{ - this.isStub = true; -}; -DevToolsHostStub.prototype.__proto__ = WebInspector.InspectorFrontendHostStub.prototype; - - -DevToolsHostStub.prototype.reset = function() -{ -}; - - -DevToolsHostStub.prototype.setting = function() -{ -}; - - -DevToolsHostStub.prototype.setSetting = function() -{ -}; - - -window["RemoteDebuggerAgent"] = new RemoteDebuggerAgentStub(); -window["RemoteDebuggerCommandExecutor"] = new RemoteDebuggerCommandExecutorStub(); -window["RemoteProfilerAgent"] = new RemoteProfilerAgentStub(); -window["RemoteToolsAgent"] = new RemoteToolsAgentStub(); -InspectorFrontendHost = new DevToolsHostStub(); - + window["RemoteDebuggerAgent"] = { setDebuggerScriptSource: function() {} }; + window["RemoteDebuggerCommandExecutor"] = {}; + window["RemoteProfilerAgent"] = {}; + window["RemoteToolsAgent"] = { dispatchOnInjectedScript: function() {} }; } diff --git a/WebKit/chromium/src/js/HeapProfilerPanel.js b/WebKit/chromium/src/js/HeapProfilerPanel.js index 0fc4418..bcb008f 100644 --- a/WebKit/chromium/src/js/HeapProfilerPanel.js +++ b/WebKit/chromium/src/js/HeapProfilerPanel.js @@ -932,7 +932,7 @@ WebInspector.HeapSnapshotProfileType.prototype = { buttonClicked: function() { - InspectorBackend.takeHeapSnapshot(); + devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT); }, get welcomeMessage() diff --git a/WebKit/chromium/src/js/InjectDispatch.js b/WebKit/chromium/src/js/InjectDispatch.js index 30caaf2..cda84e5 100644 --- a/WebKit/chromium/src/js/InjectDispatch.js +++ b/WebKit/chromium/src/js/InjectDispatch.js @@ -49,60 +49,14 @@ InspectorControllerDispatcher.dispatch = function(functionName, json_args) }; /** - * Special controller object for APU related messages. Outgoing messages - * are sent to this object if the ApuAgentDispatcher is enabled. - **/ -var ApuAgentDispatcher = { enabled : false }; - -/** - * Dispatches messages to APU. This filters and transforms - * outgoing messages that are used by APU. - * @param {string} method name of the dispatch method. - **/ -ApuAgentDispatcher.dispatchToApu = function(method, args) -{ - if (method !== "addRecordToTimeline" && method !== "updateResource" && method !== "addResource") - return; - // TODO(knorton): Transform args so they can be used - // by APU. - DevToolsAgentHost.dispatchToApu(JSON.stringify(args)); -}; - -/** * 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) { - // Handle all messages with non-primitieve arguments here. var args = Array.prototype.slice.call(arguments); - - if (method === "inspectedWindowCleared" || method === "reset" || method === "setAttachedWindow") { - // Filter out messages we don't need here. - // We do it on the sender side since they may have non-serializable - // parameters. - return; - } - - // Sniff some inspector controller state changes in order to support - // cross-navigation instrumentation. Keep names in sync with - // webdevtoolsagent_impl. - if (method === "timelineProfilerWasStarted") - DevToolsAgentHost.runtimeFeatureStateChanged("timeline-profiler", true); - else if (method === "timelineProfilerWasStopped") - DevToolsAgentHost.runtimeFeatureStateChanged("timeline-profiler", false); - else if (method === "resourceTrackingWasEnabled") - DevToolsAgentHost.runtimeFeatureStateChanged("resource-tracking", true); - else if (method === "resourceTrackingWasDisabled") - DevToolsAgentHost.runtimeFeatureStateChanged("resource-tracking", false); - - if (ApuAgentDispatcher.enabled) { - ApuAgentDispatcher.dispatchToApu(method, args); - return; - } - var call = JSON.stringify(args); - DevToolsAgentHost.dispatch(call); + DevToolsAgentHost.dispatch(call, method); }; function close() { diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js index 327ca8f..cbe607d 100644 --- a/WebKit/chromium/src/js/InspectorControllerImpl.js +++ b/WebKit/chromium/src/js/InspectorControllerImpl.js @@ -38,14 +38,18 @@ if (!this.devtools) devtools.InspectorBackendImpl = function() { WebInspector.InspectorBackendStub.call(this); + this.installInspectorControllerDelegate_("addInspectedNode"); this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad"); - this.installInspectorControllerDelegate_("clearMessages"); + this.installInspectorControllerDelegate_("changeTagName"); + this.installInspectorControllerDelegate_("clearConsoleMessages"); this.installInspectorControllerDelegate_("copyNode"); this.installInspectorControllerDelegate_("deleteCookie"); this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend"); + this.installInspectorControllerDelegate_("disableMonitoringXHR"); this.installInspectorControllerDelegate_("disableResourceTracking"); this.installInspectorControllerDelegate_("disableSearchingForNode"); this.installInspectorControllerDelegate_("disableTimeline"); + this.installInspectorControllerDelegate_("enableMonitoringXHR"); this.installInspectorControllerDelegate_("enableResourceTracking"); this.installInspectorControllerDelegate_("enableSearchingForNode"); this.installInspectorControllerDelegate_("enableTimeline"); @@ -54,6 +58,7 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("getDatabaseTableNames"); this.installInspectorControllerDelegate_("getDOMStorageEntries"); this.installInspectorControllerDelegate_("getEventListenersForNode"); + this.installInspectorControllerDelegate_("getOuterHTML"); this.installInspectorControllerDelegate_("getProfile"); this.installInspectorControllerDelegate_("getProfileHeaders"); this.installInspectorControllerDelegate_("removeProfile"); @@ -62,6 +67,7 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("highlightDOMNode"); this.installInspectorControllerDelegate_("hideDOMNodeHighlight"); this.installInspectorControllerDelegate_("performSearch"); + this.installInspectorControllerDelegate_("pushNodeByPathToFrontend"); this.installInspectorControllerDelegate_("releaseWrapperObjectGroup"); this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad"); this.installInspectorControllerDelegate_("reloadPage"); @@ -74,12 +80,14 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("setAttribute"); this.installInspectorControllerDelegate_("setDOMStorageItem"); this.installInspectorControllerDelegate_("setInjectedScriptSource"); + this.installInspectorControllerDelegate_("setOuterHTML"); this.installInspectorControllerDelegate_("setTextNodeValue"); this.installInspectorControllerDelegate_("startProfiling"); this.installInspectorControllerDelegate_("startTimelineProfiler"); this.installInspectorControllerDelegate_("stopProfiling"); this.installInspectorControllerDelegate_("stopTimelineProfiler"); this.installInspectorControllerDelegate_("storeLastActivePanel"); + this.installInspectorControllerDelegate_("takeHeapSnapshot"); this.installInspectorControllerDelegate_("getAllStyles"); this.installInspectorControllerDelegate_("getStyles"); @@ -113,24 +121,6 @@ devtools.InspectorBackendImpl = function() devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype; -/** - * @override - */ -devtools.InspectorBackendImpl.prototype.debuggerEnabled = function() -{ - return true; -}; - - -/** - * @override - */ -devtools.InspectorBackendImpl.prototype.profilerEnabled = function() -{ - return true; -}; - - if (!window.v8ScriptDebugServerEnabled) { devtools.InspectorBackendImpl.prototype.setBreakpoint = function(sourceID, line, enabled, condition) @@ -248,17 +238,6 @@ devtools.InspectorBackendImpl.prototype.pauseInDebugger = function() /** * @override */ -devtools.InspectorBackendImpl.prototype.takeHeapSnapshot = function() -{ - devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT - | devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_STATS - | devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_JS_CONSTRUCTORS); -}; - - -/** - * @override - */ devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = function(callId, injectedScriptId, methodName, argsString, async) { // Encode injectedScriptId into callId diff --git a/WebKit/chromium/src/js/ProfilerAgent.js b/WebKit/chromium/src/js/ProfilerAgent.js index 29de4a3..0b65ace 100644 --- a/WebKit/chromium/src/js/ProfilerAgent.js +++ b/WebKit/chromium/src/js/ProfilerAgent.js @@ -105,12 +105,8 @@ devtools.ProfilerAgent.prototype._getNextLogLines = function(immediately) */ devtools.ProfilerAgent.prototype.startProfiling = function(modules) { - var cmd = new devtools.DebugCommand("profile", { - "modules": modules, - "command": "resume"}); - devtools.DebuggerAgent.sendCommand_(cmd); - RemoteDebuggerAgent.processDebugCommands(); if (modules & devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT) { + InspectorBackend.takeHeapSnapshot(); // Active modules will not change, instead, a snapshot will be logged. this._getNextLogLines(); } @@ -118,19 +114,6 @@ devtools.ProfilerAgent.prototype.startProfiling = function(modules) /** - * Stops profiling. - */ -devtools.ProfilerAgent.prototype.stopProfiling = function(modules) -{ - var cmd = new devtools.DebugCommand("profile", { - "modules": modules, - "command": "pause"}); - devtools.DebuggerAgent.sendCommand_(cmd); - RemoteDebuggerAgent.processDebugCommands(); -}; - - -/** * Handles current profiler status. * @param {number} modules List of active (started) modules. */ diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index fa910ab..893bc56 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -453,7 +453,7 @@ TestSuite.prototype.testProfilerTab = function() setTimeout(findVisibleView, 0); return; } - setTimeout(findDisplayedNode, 0); + setTimeout(findDisplayedNode, 0); } findVisibleView(); @@ -462,6 +462,51 @@ TestSuite.prototype.testProfilerTab = function() /** + * Tests that heap profiler works. + */ +TestSuite.prototype.testHeapProfiler = function() +{ + this.showPanel("profiles"); + + var panel = WebInspector.panels.profiles; + var test = this; + + function findDisplayedNode() { + var node = panel.visibleView.dataGrid.children[0]; + if (!node) { + // Profile hadn't been queried yet, re-schedule. + window.setTimeout(findDisplayedNode, 100); + return; + } + + // Iterate over displayed functions and find node called "A" + // If found, this will mean that we actually have taken heap snapshot. + while (node) { + if (node.constructorName.indexOf("A") !== -1) { + test.releaseControl(); + return; + } + node = node.traverseNextNode(false, null, true); + } + + test.fail(); + } + + function findVisibleView() { + if (!panel.visibleView) { + setTimeout(findVisibleView, 0); + return; + } + setTimeout(findDisplayedNode, 0); + } + + WebInspector.HeapSnapshotProfileType.prototype.buttonClicked(); + findVisibleView(); + this.takeControl(); +}; + + +/** * Tests that scripts tab can be open and populated with inspected scripts. */ TestSuite.prototype.testShowScriptsTab = function() @@ -488,31 +533,19 @@ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function() var test = this; this.assertEquals(WebInspector.panels.elements, WebInspector.currentPanel, "Elements panel should be current one."); - this.addSniffer(devtools.DebuggerAgent.prototype, "reset", waitUntilScriptIsParsed); + this.addSniffer(WebInspector.panels.scripts, "reset", waitUntilScriptIsParsed); // Reload inspected page. It will reset the debugger agent. test.evaluateInConsole_( "window.location.reload(true);", - function(resultText) { - test.assertEquals("undefined", resultText, "Unexpected result of reload()."); - }); + function(resultText) {}); function waitUntilScriptIsParsed() { - var parsed = devtools.tools.getDebuggerAgent().parsedScripts_; - for (var id in parsed) { - var url = parsed[id].getUrl(); - if (url && url.search("debugger_test_page.html") !== -1) { - checkScriptsPanel(); - return; - } - } - test.addSniffer(devtools.DebuggerAgent.prototype, "addScriptInfo_", waitUntilScriptIsParsed); - } - - function checkScriptsPanel() { test.showPanel("scripts"); - test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Inspected script not found in the scripts list"); - test.releaseControl(); + test._waitUntilScriptsAreParsed(["debugger_test_page.html"], + function() { + test.releaseControl(); + }); } // Wait until all scripts are added to the debugger. @@ -603,7 +636,7 @@ TestSuite.prototype.testSetBreakpoint = function() var test = this; this.showPanel("scripts"); - var breakpointLine = 12; + var breakpointLine = 16 this._waitUntilScriptsAreParsed(["debugger_test_page.html"], function() { @@ -611,15 +644,25 @@ TestSuite.prototype.testSetBreakpoint = function() "debugger_test_page.html", function(view, url) { view._addBreakpoint(breakpointLine); - // Force v8 execution. - RemoteDebuggerAgent.processDebugCommands(); - test.waitForSetBreakpointResponse_(url, breakpointLine, - function() { - test.releaseControl(); + + test.evaluateInConsole_( + 'setTimeout("calculate()" , 0)', + function(resultText) { + test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); }); }); }); + this._waitForScriptPause( + { + functionsOnStack: ["calculate", ""], + lineNumber: breakpointLine, + lineText: " result = fib(lastVal++);" + }, + function() { + test.releaseControl(); + }); + this.takeControl(); }; @@ -632,21 +675,13 @@ TestSuite.prototype.testPauseOnException = function() this.showPanel("scripts"); var test = this; - // TODO(yurys): remove else branch once the states are supported. - if (WebInspector.ScriptsPanel.PauseOnExceptionsState) { - while (WebInspector.currentPanel._pauseOnExceptionButton.state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions) - WebInspector.currentPanel._pauseOnExceptionButton.element.click(); - } else { - // Make sure pause on exceptions is on. - if (!WebInspector.currentPanel._pauseOnExceptionButton.toggled) - WebInspector.currentPanel._pauseOnExceptionButton.element.click(); - } + InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions); this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html"]); this._waitForScriptPause( { - functionsOnStack: ["throwAnException", "handleClick", "(anonymous function)"], + functionsOnStack: ["throwAnException", "handleClick", ""], lineNumber: 6, lineText: " return unknown_var;" }, @@ -728,7 +763,7 @@ TestSuite.prototype.testPauseWhenScriptIsRunning = function() test._waitForScriptPause( { - functionsOnStack: ["handleClick", "(anonymous function)"], + functionsOnStack: ["handleClick", ""], lineNumber: 5, lineText: " while(true) {" }, @@ -861,36 +896,30 @@ TestSuite.prototype.testEvalOnCallFrame = function() var breakpointLine = 16; var test = this; - this.addSniffer(devtools.DebuggerAgent.prototype, "handleScriptsResponse_", - function(msg) { + this._waitUntilScriptsAreParsed(["debugger_test_page.html"], + function() { test.showMainPageScriptSource_( "debugger_test_page.html", function(view, url) { view._addBreakpoint(breakpointLine); - // Force v8 execution. - RemoteDebuggerAgent.processDebugCommands(); - test.waitForSetBreakpointResponse_(url, breakpointLine, setBreakpointCallback); + + // Since breakpoints are ignored in evals' calculate() function is + // execute after zero-timeout so that the breakpoint is hit. + test.evaluateInConsole_( + 'setTimeout("calculate(123)" , 0)', + function(resultText) { + test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); + waitForBreakpointHit(); + }); }); }); - function setBreakpointCallback() { - // Since breakpoints are ignored in evals' calculate() function is - // execute after zero-timeout so that the breakpoint is hit. - test.evaluateInConsole_( - 'setTimeout("calculate(123)" , 0)', - function(resultText) { - test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); - waitForBreakpointHit(); - }); - } - function waitForBreakpointHit() { - test.addSniffer( - devtools.DebuggerAgent.prototype, - "handleBacktraceResponse_", - function(msg) { - test.assertEquals(2, this.callFrames_.length, "Unexpected stack depth on the breakpoint. " + JSON.stringify(msg)); - test.assertEquals("calculate", this.callFrames_[0].functionName, "Unexpected top frame function."); + test.addSniffer(WebInspector, + "pausedScript", + function(callFrames) { + test.assertEquals(2, callFrames.length, "Unexpected stack depth on the breakpoint. " + JSON.stringify(callFrames, null, 4)); + test.assertEquals("calculate", callFrames[0].functionName, "Unexpected top frame function."); // Evaluate "e+1" where "e" is an argument of "calculate" function. test.evaluateInConsole_( "e+1", @@ -916,7 +945,7 @@ TestSuite.prototype.testCompletionOnPause = function() this._waitForScriptPause( { - functionsOnStack: ["innerFunction", "handleClick", "(anonymous function)"], + functionsOnStack: ["innerFunction", "handleClick", ""], lineNumber: 9, lineText: " debugger;" }, @@ -963,6 +992,9 @@ TestSuite.prototype.testCompletionOnPause = function() */ TestSuite.prototype.testAutoContinueOnSyntaxError = function() { + if (window.v8ScriptDebugServerEnabled) + return; + this.showPanel("scripts"); var test = this; @@ -978,6 +1010,7 @@ TestSuite.prototype.testAutoContinueOnSyntaxError = function() } } + this.addSniffer(devtools.DebuggerAgent.prototype, "handleScriptsResponse_", function(msg) { checkScriptsList(); @@ -1140,7 +1173,7 @@ TestSuite.prototype._executeCodeWhenScriptsAreParsed = function(code, expectedSc test.evaluateInConsole_( 'setTimeout("' + code + '" , 0)', function(resultText) { - test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText); + test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText + ". Code: " + code); }); } @@ -1188,7 +1221,7 @@ TestSuite.prototype.testStepOver = function() this._performSteps([ { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 3, lineText: " debugger;" }, @@ -1196,7 +1229,7 @@ TestSuite.prototype.testStepOver = function() document.getElementById("scripts-step-over").click(); }, { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 5, lineText: " var y = fact(10);" }, @@ -1204,7 +1237,7 @@ TestSuite.prototype.testStepOver = function() document.getElementById("scripts-step-over").click(); }, { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 6, lineText: " return y;" }, @@ -1229,7 +1262,7 @@ TestSuite.prototype.testStepOut = function() this._performSteps([ { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 3, lineText: " debugger;" }, @@ -1237,7 +1270,7 @@ TestSuite.prototype.testStepOut = function() document.getElementById("scripts-step-out").click(); }, { - functionsOnStack: ["a","(anonymous function)"], + functionsOnStack: ["a",""], lineNumber: 8, lineText: " printResult(result);" }, @@ -1262,7 +1295,7 @@ TestSuite.prototype.testStepIn = function() this._performSteps([ { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 3, lineText: " debugger;" }, @@ -1270,7 +1303,7 @@ TestSuite.prototype.testStepIn = function() document.getElementById("scripts-step-over").click(); }, { - functionsOnStack: ["d","a","(anonymous function)"], + functionsOnStack: ["d","a",""], lineNumber: 5, lineText: " var y = fact(10);" }, @@ -1278,7 +1311,7 @@ TestSuite.prototype.testStepIn = function() document.getElementById("scripts-step-into").click(); }, { - functionsOnStack: ["fact","d","a","(anonymous function)"], + functionsOnStack: ["fact","d","a",""], lineNumber: 10, lineText: " var r = 1;" }, @@ -1440,7 +1473,7 @@ TestSuite.prototype.testExpandScope = function() this._waitForScriptPause( { - functionsOnStack: ["innerFunction", "handleClick", "(anonymous function)"], + functionsOnStack: ["innerFunction", "handleClick", ""], lineNumber: 8, lineText: " debugger;" }, @@ -1463,14 +1496,14 @@ TestSuite.prototype.testExpandScope = function() properties: { x:"2009", innerFunctionLocalVar:"2011", - "this": "global", + "this": (window.v8ScriptDebugServerEnabled ? "DOMWindow" : "global"), } }, { title: "Closure", properties: { - n:"TextParam", - makeClosureLocalVar:"local.TextParam", + n: (window.v8ScriptDebugServerEnabled ? '"TextParam"' : "TextParam"), + makeClosureLocalVar: (window.v8ScriptDebugServerEnabled ? '"local.TextParam"' : "local.TextParam"), } }, { @@ -1554,7 +1587,7 @@ TestSuite.prototype.testDebugIntrinsicProperties = function() this._waitForScriptPause( { - functionsOnStack: ["callDebugger", "handleClick", "(anonymous function)"], + functionsOnStack: ["callDebugger", "handleClick", ""], lineNumber: 29, lineText: " debugger;" }, @@ -1574,6 +1607,15 @@ TestSuite.prototype.testDebugIntrinsicProperties = function() } function examineLocalScope() { + if (window.v8ScriptDebugServerEnabled) { + var scopeExpectations = [ + "a", "Child", [ + "constructor", "function Child(n) {", null, + "parentField", "10", null, + "childField", "20", null, + ] + ]; + } else { var scopeExpectations = [ "a", "Object", [ "constructor", "function Child()", [ @@ -1606,13 +1648,14 @@ TestSuite.prototype.testDebugIntrinsicProperties = function() "childField", 20, null, ] ]; + } checkProperty(localScopeSection.propertiesTreeOutline, "<Local Scope>", scopeExpectations); } var propQueue = []; var index = 0; - var expectedFinalIndex = 8; + var expectedFinalIndex = (window.v8ScriptDebugServerEnabled ? 1 : 8); function expandAndCheckNextProperty() { if (index === propQueue.length) { diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index c51befb..8ec65b9 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -38,6 +38,7 @@ #include "DatabaseTracker.h" #endif #include "EWebKit.h" +#include "FileChooser.h" #include "FloatRect.h" #include "FrameLoader.h" #include "FrameLoaderClientEfl.h" @@ -50,6 +51,8 @@ #include "ewk_private.h" #include <wtf/text/CString.h> +#include <Evas.h> + using namespace WebCore; static inline Evas_Object* kit(Frame* frame) @@ -115,10 +118,16 @@ void ChromeClientEfl::unfocus() evas_object_focus_set(m_view, EINA_FALSE); } -Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features) +Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features) { - notImplemented(); - return 0; + Evas_Object* newView = ewk_view_window_create(m_view, EINA_TRUE, &features); + if (!newView) + return 0; + + if (!frameLoadRequest.isEmpty()) + ewk_view_uri_set(newView, frameLoadRequest.resourceRequest().url().string().utf8().data()); + + return ewk_view_core_page_get(newView); } void ChromeClientEfl::show() @@ -376,7 +385,35 @@ void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& database void ChromeClientEfl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser) { - notImplemented(); + RefPtr<FileChooser> chooser = prpFileChooser; + bool confirm; + Eina_List* selectedFilenames = 0; + Eina_List* suggestedFilenames = 0; + void* filename; + Vector<String> filenames; + + for (unsigned i = 0; i < chooser->filenames().size(); i++) { + CString str = chooser->filenames()[i].utf8(); + filename = strdup(str.data()); + suggestedFilenames = eina_list_append(suggestedFilenames, filename); + } + + confirm = ewk_view_run_open_panel(m_view, kit(frame), chooser->allowsMultipleFiles(), suggestedFilenames, &selectedFilenames); + EINA_LIST_FREE(suggestedFilenames, filename) + free(filename); + + if (!confirm) + return; + + EINA_LIST_FREE(selectedFilenames, filename) { + filenames.append((char *)filename); + free(filename); + } + + if (chooser->allowsMultipleFiles()) + chooser->chooseFiles(filenames); + else + chooser->chooseFile(filenames[0]); } void ChromeClientEfl::formStateDidChange(const Node*) diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h index 399ef7f..fccf54f 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h @@ -26,7 +26,8 @@ #include "ChromeClient.h" #include "KURL.h" #include "PopupMenu.h" -#include <Evas.h> + +typedef struct _Evas_Object Evas_Object; namespace WebCore { diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.h b/WebKit/efl/WebCoreSupport/EditorClientEfl.h index ead1169..a53d624 100644 --- a/WebKit/efl/WebCoreSupport/EditorClientEfl.h +++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.h @@ -34,10 +34,11 @@ #define EditorClientEfl_h #include "EditorClient.h" -#include <Evas.h> #include <wtf/Forward.h> +typedef struct _Evas_Object Evas_Object; + namespace WebCore { class Page; diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index 2358fab..438d6a0 100644 --- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -707,8 +707,11 @@ void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned lo notImplemented(); } -void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError&) +void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err) { + if (!shouldFallBack(err)) + return; + if (m_firstData) { FrameLoader* fl = loader->frameLoader(); fl->writer()->setEncoding(m_response.textEncodingName(), false); @@ -735,6 +738,9 @@ void FrameLoaderClientEfl::dispatchDidFailProvisionalLoad(const ResourceError& e void FrameLoaderClientEfl::dispatchDidFailLoad(const ResourceError& err) { + if (!shouldFallBack(err)) + return; + m_loadError = err; ewk_frame_load_error(m_frame, m_loadError.domain().utf8().data(), @@ -782,7 +788,7 @@ ResourceError FrameLoaderClientEfl::cannotShowURLError(const ResourceRequest& re ResourceError FrameLoaderClientEfl::interruptForPolicyChangeError(const ResourceRequest& request) { return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange, - request.url().string(), "Frame load interruped by policy change"); + request.url().string(), "Frame load interrupted by policy change"); } ResourceError FrameLoaderClientEfl::cannotShowMIMETypeError(const ResourceResponse& response) @@ -803,10 +809,9 @@ ResourceError FrameLoaderClientEfl::pluginWillHandleLoadError(const ResourceResp return ResourceError("Error", 0, "", ""); } -bool FrameLoaderClientEfl::shouldFallBack(const ResourceError&) +bool FrameLoaderClientEfl::shouldFallBack(const ResourceError& error) { - notImplemented(); - return false; + return !(error.isCancellation() || (error.errorCode() == WebKitErrorFrameLoadInterruptedByPolicyChange)); } bool FrameLoaderClientEfl::canCachePage() const @@ -816,8 +821,17 @@ bool FrameLoaderClientEfl::canCachePage() const Frame* FrameLoaderClientEfl::dispatchCreatePage() { - notImplemented(); - return 0; + if (!m_view) + return 0; + + Evas_Object* newView = ewk_view_window_create(m_view, EINA_FALSE, 0); + Evas_Object* mainFrame; + if (!newView) + mainFrame = m_frame; + else + mainFrame = ewk_view_frame_main_get(newView); + + return ewk_frame_core_get(mainFrame); } void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&) diff --git a/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp index 2fa860a..6bfd6ad 100644 --- a/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp @@ -60,7 +60,7 @@ void InspectorClientEfl::storeSetting(const String&, const String&) bool InspectorClientEfl::sendMessageToFrontend(const String&) { - notImpelemented(); + notImplemented(); return false; } diff --git a/WebKit/efl/ewebkit.pc.in b/WebKit/efl/ewebkit.pc.in index f58e5bf..d618e30 100644 --- a/WebKit/efl/ewebkit.pc.in +++ b/WebKit/efl/ewebkit.pc.in @@ -8,4 +8,5 @@ Description: Web content engine for EFL applications Version: @PROJECT_VERSION@ Requires: cairo evas ecore Libs: -L${libdir} -lewebkit @EXTRA_EWEBKIT_LINK@ +Libs.private: @LIBS_PRIVATE@ Cflags: -I${includedir}/EWebKit diff --git a/WebKit/efl/ewk/EWebKit.h b/WebKit/efl/ewk/EWebKit.h index a61cc9d..e08c4a5 100644 --- a/WebKit/efl/ewk/EWebKit.h +++ b/WebKit/efl/ewk/EWebKit.h @@ -29,6 +29,7 @@ #include "ewk_main.h" #include "ewk_settings.h" #include "ewk_view.h" +#include "ewk_window_features.h" #include <Evas.h> diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index 5f66fd8..facd6aa 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -56,6 +56,7 @@ void ewk_view_frame_main_load_started(Evas_Object *o); void ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error); void ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error); void ewk_view_load_progress_changed(Evas_Object *o); +Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures); void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data); void ewk_view_mouse_link_hover_out(Evas_Object *o); @@ -83,6 +84,8 @@ Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *fra Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o); uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size); +Eina_Bool ewk_view_run_open_panel(Evas_Object *o, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames); + void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame); WebCore::Page *ewk_view_core_page_get(const Evas_Object *o); @@ -102,6 +105,8 @@ void ewk_context_menu_item_append(Ewk_Context_Menu *o, WebCore::Con Ewk_Context_Menu *ewk_context_menu_custom_get(Ewk_Context_Menu *o); void ewk_context_menu_show(Ewk_Context_Menu *o); +Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeatures* core); + Evas_Object *ewk_frame_add(Evas *e); Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame); Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer); diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index d5920e5..8d66734 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -18,6 +18,7 @@ Boston, MA 02110-1301, USA. */ +#define __STDC_FORMAT_MACROS #include "config.h" #include "ewk_view.h" @@ -43,6 +44,7 @@ #include <Eina.h> #include <Evas.h> #include <eina_safety_checks.h> +#include <inttypes.h> #include <sys/time.h> #define ZOOM_MIN (0.05) @@ -706,6 +708,7 @@ static void _ewk_view_smart_del(Evas_Object* o) EWK_VIEW_SD_GET(o, sd); Ewk_View_Private_Data* priv = sd ? sd->_priv : 0; + ewk_view_stop(o); _parent_sc.del(o); _ewk_view_priv_del(priv); } @@ -3150,21 +3153,36 @@ void ewk_view_restore_state(Evas_Object* o, Evas_Object* frame) /** * @internal * Delegates to browser the creation of a new window. If it is not implemented, - * current view is returned, so navigation might continue in same window. + * current view is returned, so navigation might continue in same window. If + * browser supports the creation of new windows, a new Ewk_Window_Features is + * created and passed to browser. If it intends to keep the request for opening + * the window later it must increments the Ewk_Winwdow_Features ref count by + * calling ewk_window_features_ref(window_features). Otherwise this struct will + * be freed after returning to this function. * * @param o Current view. + * @param javascript @c EINA_TRUE if the new window is originated from javascript, + * @c EINA_FALSE otherwise + * @param window_features Features of the new window being created. If it's @c + * NULL, it will be created a window with default features. * * @return New view, in case smart class implements the creation of new windows; * else, current view @param o. + * + * @see ewk_window_features_ref(). */ -Evas_Object* ewk_view_window_create(Evas_Object* o) +Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures) { EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); if (!sd->api->window_create) return o; - return sd->api->window_create(sd); + Ewk_Window_Features* window_features = ewk_window_features_new_from_core(coreFeatures); + Evas_Object* view = sd->api->window_create(sd, javascript, window_features); + ewk_window_features_unref(window_features); + + return view; } /** @@ -3449,7 +3467,7 @@ uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, co if (!sd->api->exceeded_database_quota) return 0; - ERR("##### %lu %lu", current_size, expected_size); + INF("current_size=%"PRIu64" expected_size="PRIu64, current_size, expected_size); return sd->api->exceeded_database_quota(sd, frame, databaseName, current_size, expected_size); } diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h index b029a68..a8fe3b8 100644 --- a/WebKit/efl/ewk/ewk_view.h +++ b/WebKit/efl/ewk/ewk_view.h @@ -21,9 +21,11 @@ #ifndef ewk_view_h #define ewk_view_h +#include "ewk_history.h" +#include "ewk_window_features.h" + #include <Evas.h> #include <cairo.h> -#include <ewk_history.h> #ifdef __cplusplus extern "C" { @@ -95,7 +97,7 @@ struct _Ewk_View_Smart_Class { Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */ unsigned long version; - Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */ + Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */ // hooks to allow different backing stores Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */ Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */ diff --git a/WebKit/efl/ewk/ewk_window_features.cpp b/WebKit/efl/ewk/ewk_window_features.cpp new file mode 100644 index 0000000..3855e89 --- /dev/null +++ b/WebKit/efl/ewk/ewk_window_features.cpp @@ -0,0 +1,156 @@ +/* + Copyright (C) 2010 ProFUSION embedded systems + Copyright (C) 2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_window_features.h" + +#include "WindowFeatures.h" +#include "ewk_private.h" + +#include <Eina.h> + +struct _Ewk_Window_Features { + unsigned int __ref; + WebCore::WindowFeatures* core; +}; + +/** + * Decrease the ref count of an Ewk_Window_Features, possibly freeing it. + * + * When its ref count reaches 0, @param window_features is freed. + * + * @param window_features The window's features. + */ +EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features) +{ + EINA_SAFETY_ON_NULL_RETURN(window_features); + EINA_SAFETY_ON_FALSE_RETURN(window_features->__ref > 0); + + if (--window_features->__ref) + return; + + delete window_features->core; + window_features->core = 0; + free(window_features); +} + +/** + * Increase the ref count of an Ewk_Window_Features + * + * @param window_features The window's features. + */ +EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features) +{ + EINA_SAFETY_ON_NULL_RETURN(window_features); + window_features->__ref++; +} + +/** + * Get boolean properties + * + * @param window_features A window_features. + * @param toolbar_visible pointer to store if toolbar is visible. + * @param statusbar_visible pointer to store if statusbar is visible. + * @param scrollbars_visible pointer to store if scrollbars is visible. + * @param menubar_visible pointer to store if menubar is visible. + * @param locationbar_visible pointer to store if locationbar is visible. + * @param fullscreen pointer to store if fullscreen is enabled. + */ +EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen) +{ + EINA_SAFETY_ON_NULL_RETURN(window_features); + EINA_SAFETY_ON_NULL_RETURN(window_features->core); + + if (toolbar_visible) + *toolbar_visible = window_features->core->toolBarVisible; + + if (statusbar_visible) + *statusbar_visible = window_features->core->statusBarVisible; + + if (scrollbars_visible) + *scrollbars_visible = window_features->core->scrollbarsVisible; + + if (menubar_visible) + *menubar_visible = window_features->core->menuBarVisible; + + if (locationbar_visible) + *locationbar_visible = window_features->core->locationBarVisible; + + if (fullscreen) + *fullscreen = window_features->core->fullscreen; +} + +/** + * Get int properties + * + * Properties are returned in the respective pointers. Passing NULL to any of + * these pointers will make that property to not be returned. Make sure to check + * if the value returned is less than 0 before using it, since in that case it + * means that property was not set in @param winwdow_features. + * + * @param window_features A window_features. + * @param x pointer to store x position or -1 if it's not set in window_features. + * @param y pointer to store y position or-1 if it's not set in window_features. + * @param w pointer to store width or-1 if it's not set in window_features. + * @param h pointer to store height or-1 if it's not set in window_features. + */ +EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h) +{ + EINA_SAFETY_ON_NULL_RETURN(window_features); + EINA_SAFETY_ON_NULL_RETURN(window_features->core); + + if (x) + *x = window_features->core->xSet ? static_cast<int>(window_features->core->x) : -1; + + if (y) + *y = window_features->core->ySet ? static_cast<int>(window_features->core->y) : -1; + + if (w) + *w = window_features->core->widthSet ? static_cast<int>(window_features->core->width) : -1; + + if (h) + *h = window_features->core->heightSet ? static_cast<int>(window_features->core->height) : -1; +} + +/* internal methods ****************************************************/ + +/** + * @internal + * Create a new Ewk_Window_Features from a WebCore::WindowFeatures if @param + * core is not NULL or a new one with default features. + * + * A new WebCore::WindowFeatures is allocated copying @param core features and + * it is embedded inside an Ewk_Window_Features whose ref count is initialized. + * + * @returns a new allocated Ewk_Window_Features + */ +Ewk_Window_Features* ewk_window_features_new_from_core(const WebCore::WindowFeatures* core) +{ + Ewk_Window_Features* window_features = static_cast<Ewk_Window_Features*>(malloc(sizeof(*window_features))); + + if (core) + window_features->core = new WebCore::WindowFeatures(*core); + else + window_features->core = new WebCore::WindowFeatures(); + + window_features->__ref = 1; + + return window_features; +} diff --git a/WebKit/efl/ewk/ewk_window_features.h b/WebKit/efl/ewk/ewk_window_features.h new file mode 100644 index 0000000..b579dc4 --- /dev/null +++ b/WebKit/efl/ewk/ewk_window_features.h @@ -0,0 +1,43 @@ +/* + Copyright (C) 2010 ProFUSION embedded systems + Copyright (C) 2010 Samsung Electronics + + 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 ewk_window_features_h +#define ewk_window_features_h + +#include "ewk_eapi.h" + +#include <Eina.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _Ewk_Window_Features Ewk_Window_Features; + +EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features); +EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features); + +EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen); +EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h); + +#ifdef __cplusplus +} +#endif +#endif // ewk_window_features_h diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index d1652dc..e13e9ce 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,85 @@ +2010-06-24 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Cannot change the selection via the keyboard + https://bugs.webkit.org/show_bug.cgi?id=41162 + + Fix issue where the selection could not be extended via the keyboard by + adjusting the logic guarding against inserting text in non-editable nodes. + + * WebCoreSupport/EditorClientGtk.cpp: + (WebKit::EditorClient::handleKeyboardEvent): + Allow editor commands that do not insert text in non-editable nodes. This + fixes keyboard selection extension in non-editable nodes. Move the existing + check to after the execution of any editor commands. + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * webkit/webkitwebview.cpp: + (webkit_web_view_update_settings): + (webkit_web_view_settings_notify): + (webkit_get_cache_model): + +2010-06-16 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Remove the abuse of GDK_CURRENT_TIME in the DRT + https://bugs.webkit.org/show_bug.cgi?id=40600 + + * WebCoreSupport/DragClientGtk.cpp: + (WebKit::DragClient::startDrag): Reset the click count after a drag starts. + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::postCommitFrameViewSetup): Reset the click count after a load is committed. + * webkit/webkitprivate.h: Move static click counting variables to be per-view. + * webkit/webkitwebview.cpp: + (getEventTime): Added. + (webkit_web_view_button_press_event): If the event time is zero, use the current time. + (webkit_web_view_finalize): Clean up click counting member. + (webkit_web_view_init): Initialize click counting member. + +2010-06-15 Xan Lopez <xlopez@igalia.com> + + Fix compilation with older GTK+. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::pageRect): + +2010-06-15 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Does not compile with -DGSEAL_ENABLE + https://bugs.webkit.org/show_bug.cgi?id=37851 + + Fix compilation with GSEAL_ENABLE. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::pageRect): + (WebKit::ChromeClient::contentsSizeChanged): + * tests/testdomnode.c: + (test_dom_node_insertion): + * webkit/webkitwebview.cpp: + (webkit_web_view_realize): + (webkit_web_view_script_dialog): + (webkit_web_view_drag_end): + (webkit_web_view_init): + +2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> + + Unreviewed build fix. + + This is a fix for flaky inspector tests at gtk-debug bots. + + * WebCoreSupport/InspectorClientGtk.cpp: + (WebKit::InspectorFrontendClient::destroyInspectorWindow): + 2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 5759601..fe5d9eb 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -104,7 +104,12 @@ void ChromeClient::setWindowRect(const FloatRect& rect) FloatRect ChromeClient::pageRect() { - GtkAllocation allocation = GTK_WIDGET(m_webView)->allocation; + GtkAllocation allocation; +#if GTK_CHECK_VERSION(2, 18, 0) + gtk_widget_get_allocation(GTK_WIDGET(m_webView), &allocation); +#else + allocation = GTK_WIDGET(m_webView)->allocation; +#endif return IntRect(allocation.x, allocation.y, allocation.width, allocation.height); } @@ -425,9 +430,15 @@ void ChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const // We need to queue a resize request only if the size changed, // otherwise we get into an infinite loop! GtkWidget* widget = GTK_WIDGET(m_webView); + GtkRequisition requisition; +#if GTK_CHECK_VERSION(2, 20, 0) + gtk_widget_get_requisition(widget, &requisition); +#else + requisition = widget->requisition; +#endif if (gtk_widget_get_realized(widget) - && (widget->requisition.height != size.height()) - || (widget->requisition.width != size.width())) + && (requisition.height != size.height()) + || (requisition.width != size.width())) gtk_widget_queue_resize_no_redraw(widget); } diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp index 6c395c7..4bcc4c2 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp @@ -79,6 +79,10 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin, GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get()); webView->priv->draggingDataObjects.set(context, dataObject); + // A drag starting should prevent a double-click from happening. This might + // happen if a drag is followed very quickly by another click (like in the DRT). + webView->priv->previousClickTime = 0; + if (image) gtk_drag_set_icon_pixbuf(context, image, eventPos.x() - dragImageOrigin.x(), eventPos.y() - dragImageOrigin.y()); else diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp index a5c36e8..77ed9b2 100644 --- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 Nuanti Ltd. * Copyright (C) 2009 Diego Escalante Urrelo <diegoe@gnome.org> * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2009, Igalia S.L. + * Copyright (C) 2009, 2010 Igalia S.L. * Copyright (C) 2010, Martin Robinson <mrobinson@webkit.org> * * This library is free software; you can redistribute it and/or @@ -604,11 +604,6 @@ void EditorClient::handleKeyboardEvent(KeyboardEvent* event) if (!platformEvent) return; - // Don't allow editor commands or text insertion for nodes that - // cannot edit, unless we are in caret mode. - if (!frame->editor()->canEdit() && !(frame->settings() && frame->settings()->caretBrowsingEnabled())) - return; - generateEditorCommands(event); if (m_pendingEditorCommands.size() > 0) { @@ -622,12 +617,17 @@ void EditorClient::handleKeyboardEvent(KeyboardEvent* event) return; } - if (executePendingEditorCommands(frame, true)) { + // Only allow text insertion commands if the current node is editable. + if (executePendingEditorCommands(frame, frame->editor()->canEdit())) { event->setDefaultHandled(); return; } } + // Don't allow text insertion for nodes that cannot edit. + if (!frame->editor()->canEdit()) + return; + // This is just a normal text insertion, so wait to execute the insertion // until a keypress event happens. This will ensure that the insertion will not // be reflected in the contents of the field until the keyup DOM event. diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 021374c..17a3cd5 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -1145,6 +1145,9 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo gtk_menu_popdown(menu); g_object_unref(menu); } + + // Do not allow click counting between main frame loads. + priv->previousClickTime = 0; } void FrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cachedFrame) diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index 5e69c31..4bc3c32 100644 --- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -175,12 +175,15 @@ void InspectorFrontendClient::destroyInspectorWindow() core(m_inspectedWebView)->inspectorController()->disconnectFrontend(); + if (m_inspectorClient) + m_inspectorClient->releaseFrontendPage(); + gboolean handled = FALSE; g_signal_emit_by_name(webInspector, "close-window", &handled); ASSERT(handled); - if (m_inspectorClient) - m_inspectorClient->releaseFrontendPage(); + // Please do not use member variables here because InspectorFrontendClient object pointed by 'this' + // has been implicitly deleted by "close-window" function. /* we should now dispose our own reference */ g_object_unref(webInspector); diff --git a/WebKit/gtk/po/ChangeLog b/WebKit/gtk/po/ChangeLog index b9f97fe..ec5330e 100644 --- a/WebKit/gtk/po/ChangeLog +++ b/WebKit/gtk/po/ChangeLog @@ -1,3 +1,12 @@ +2010-06-25 Fran Diéguez <fran.dieguez@mabishu.com> + + Reviewed by Darin Adler. + + Add Galician translation to webkitgtk + https://bugs.webkit.org/show_bug.cgi?id=39547 + + * gl.po: Added. + 2010-04-05 Lucas Lommer <llommer@svn.gnome.org> Reviewed by Gustavo Noronha. diff --git a/WebKit/gtk/po/gl.po b/WebKit/gtk/po/gl.po new file mode 100644 index 0000000..266f7f4 --- /dev/null +++ b/WebKit/gtk/po/gl.po @@ -0,0 +1,1117 @@ +# Galician translation for webkit. +# Copyright (C) 2009 webkit's COPYRIGHT HOLDER +# This file is distributed under the same license as the webkit package. +# Fran Diéguez <frandieguez@ubuntu.com>, 2009, 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: webkit HEAD\n" +"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n" +"POT-Creation-Date: 2010-02-25 15:53-0300\n" +"PO-Revision-Date: 2010-05-23 01:14+0200\n" +"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n" +"Language-Team: Galician <gnome@g11.net>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\\\n" + +#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535 +msgid "Upload File" +msgstr "Subir ficheiro" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61 +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143 +msgid "Input _Methods" +msgstr "_Métodos de entrada" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78 +msgid "LRM _Left-to-right mark" +msgstr "Marca de _esquerda-a-derita [LRM]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79 +msgid "RLM _Right-to-left mark" +msgstr "Marca de _dereita-a-esquerda [RLM]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80 +msgid "LRE Left-to-right _embedding" +msgstr "In_crustamento de esquerda-a-dereita [LRE]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81 +msgid "RLE Right-to-left e_mbedding" +msgstr "Inc_rustamento de dereita-a-esquerda [RLE]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82 +msgid "LRO Left-to-right _override" +msgstr "_Prevalencia de esquerda-a-dereita [LRO]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83 +msgid "RLO Right-to-left o_verride" +msgstr "Pre_valencia de dereita-a-esquerda [RLO]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84 +msgid "PDF _Pop directional formatting" +msgstr "Formatadeo d_ireccional emerxente de PDF" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85 +msgid "ZWS _Zero width space" +msgstr "Espazo de anchura _cero [ZWS]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86 +msgid "ZWJ Zero width _joiner" +msgstr "En_samblador de ancho cero [ZWJ]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87 +msgid "ZWNJ Zero width _non-joiner" +msgstr "_Non ensamblador de anchura cero [ZWNJ]" + +#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109 +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138 +msgid "_Insert Unicode Control Character" +msgstr "_Insertar un carácter de control Unicode" + +#: WebKit/gtk/webkit/webkitdownload.cpp:266 +msgid "Network Request" +msgstr "Solicitude de rede" + +#: WebKit/gtk/webkit/webkitdownload.cpp:267 +msgid "The network request for the URI that should be downloaded" +msgstr "A solicitude de rede para o URI que debe descargarse" + +#: WebKit/gtk/webkit/webkitdownload.cpp:281 +#| msgid "Network Request" +msgid "Network Response" +msgstr "Resposta de rede" + +#: WebKit/gtk/webkit/webkitdownload.cpp:282 +#| msgid "The network request for the URI that should be downloaded" +msgid "The network response for the URI that should be downloaded" +msgstr "A resposta de rede do URI que debería ser descargado" + +#: WebKit/gtk/webkit/webkitdownload.cpp:296 +msgid "Destination URI" +msgstr "URI de destino" + +#: WebKit/gtk/webkit/webkitdownload.cpp:297 +msgid "The destination URI where to save the file" +msgstr "A URI de destino onde gardar o ficheiro" + +#: WebKit/gtk/webkit/webkitdownload.cpp:311 +msgid "Suggested Filename" +msgstr "Nome do ficheiro suxerido" + +#: WebKit/gtk/webkit/webkitdownload.cpp:312 +msgid "The filename suggested as default when saving" +msgstr "O nome de ficheiro suxerido como predefinido ao gardar" + +#: WebKit/gtk/webkit/webkitdownload.cpp:329 +msgid "Progress" +msgstr "Progreso" + +#: WebKit/gtk/webkit/webkitdownload.cpp:330 +msgid "Determines the current progress of the download" +msgstr "Determina o progreso actual da descarga" + +#: WebKit/gtk/webkit/webkitdownload.cpp:343 +msgid "Status" +msgstr "Estado" + +#: WebKit/gtk/webkit/webkitdownload.cpp:344 +msgid "Determines the current status of the download" +msgstr "Determina o estado actual da descarga" + +#: WebKit/gtk/webkit/webkitdownload.cpp:359 +msgid "Current Size" +msgstr "Tamaño actual" + +#: WebKit/gtk/webkit/webkitdownload.cpp:360 +msgid "The length of the data already downloaded" +msgstr "A lonxitude dos datos xa descargados" + +#: WebKit/gtk/webkit/webkitdownload.cpp:374 +msgid "Total Size" +msgstr "Tamaño total" + +#: WebKit/gtk/webkit/webkitdownload.cpp:375 +msgid "The total size of the file" +msgstr "O tamaño total do ficheiro" + +#: WebKit/gtk/webkit/webkitdownload.cpp:526 +msgid "User cancelled the download" +msgstr "O usuario cancelou a descarga" + +#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248 +#, c-format +msgid "A username and password are being requested by the site %s" +msgstr "O sitio %s solicitou un nome de usuario e unha contrasinal" + +#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278 +msgid "Server message:" +msgstr "Mensaxe do servidor:" + +#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291 +msgid "Username:" +msgstr "Nome de usuario:" + +#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293 +msgid "Password:" +msgstr "Contrasinal:" + +#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302 +#| msgid "Remember password" +msgid "_Remember password" +msgstr "_Lembrar o contrasinal" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:298 +msgid "Name" +msgstr "Nome" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:299 +msgid "The name of the frame" +msgstr "O nome do marco" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:305 +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146 +#: WebKit/gtk/webkit/webkitwebview.cpp:2318 +msgid "Title" +msgstr "Título" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:306 +msgid "The document title of the frame" +msgstr "O título do documento do marco" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:312 +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178 +#: WebKit/gtk/webkit/webkitwebview.cpp:2332 +msgid "URI" +msgstr "URI" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:313 +msgid "The current URI of the contents displayed by the frame" +msgstr "O URI actual dos contidos mostrados no marco" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:344 +msgid "Horizontal Scrollbar Policy" +msgstr "Normativa da barra de desprazamento horizontal" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:345 +#| msgid "Determines the current progress of the download" +msgid "" +"Determines the current policy for the horizontal scrollbar of the frame." +msgstr "" +"Determina a normativa actual para a barra de desprazamento horizontal para o " +"marco." + +#: WebKit/gtk/webkit/webkitwebframe.cpp:362 +msgid "Vertical Scrollbar Policy" +msgstr "Normativa da barra de desprazamento vertical" + +#: WebKit/gtk/webkit/webkitwebframe.cpp:363 +#| msgid "Determines the current progress of the download" +msgid "Determines the current policy for the vertical scrollbar of the frame." +msgstr "" +"Determina a normativa actual para a barra de desprazamento vertical para o " +"marco." + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147 +msgid "The title of the history item" +msgstr "O título do elemento do historial" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162 +msgid "Alternate Title" +msgstr "Título alternativo" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163 +msgid "The alternate title of the history item" +msgstr "O título alternativo do elemento do historial" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179 +msgid "The URI of the history item" +msgstr "O URI do elemento do historial" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194 +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173 +msgid "Original URI" +msgstr "URI orixinal" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195 +msgid "The original URI of the history item" +msgstr "O URI orixinal do elemento do historial" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210 +msgid "Last visited Time" +msgstr "Tempo da última visita" + +#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211 +msgid "The time at which the history item was last visited" +msgstr "O tempo no cal o elemento do historial foi visitado a última vez" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:268 +msgid "Web View" +msgstr "Visualización web" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:269 +msgid "The Web View that renders the Web Inspector itself" +msgstr "A visualización web que renderiza o propio Inspector web" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:282 +msgid "Inspected URI" +msgstr "URI inspeccionada" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:283 +msgid "The URI that is currently being inspected" +msgstr "O URI que está sendo inspeccionada actualmente" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:299 +msgid "Enable JavaScript profiling" +msgstr "Activar o perfilado de JavaScript" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:300 +msgid "Profile the executed JavaScript." +msgstr "Perfilar o JavaScript executado." + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:315 +#| msgid "Enable JavaScript profiling" +msgid "Enable Timeline profiling" +msgstr "Activar o perfilado da Liña de tempo" + +#: WebKit/gtk/webkit/webkitwebinspector.cpp:316 +msgid "Profile the WebCore instrumentation." +msgstr "Perfilar a instrumentación de WebCore." + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158 +msgid "Reason" +msgstr "Razón" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159 +msgid "The reason why this navigation is occurring" +msgstr "A razón pola que esta navegación está ocorrendo" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174 +msgid "The URI that was requested as the target for the navigation" +msgstr "O URI que foi solicitado como destino para a navegación" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188 +msgid "Button" +msgstr "Botón" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189 +msgid "The button used to click" +msgstr "O botón empregado para premer" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204 +msgid "Modifier state" +msgstr "Estado dos modificadores" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205 +msgid "A bitmask representing the state of the modifier keys" +msgstr "A máscara de bits representa o estado das teclas modificadoras" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220 +#| msgid "The name of the frame" +msgid "Target frame" +msgstr "Marco de destino" + +#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221 +#| msgid "The URI that was requested as the target for the navigation" +msgid "The target frame for the navigation" +msgstr "O marco de destino para a navegación" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:237 +msgid "Default Encoding" +msgstr "Codificación predefinida" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:238 +msgid "The default encoding used to display text." +msgstr "A codificación predefinida empregada para mostrar o texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:246 +msgid "Cursive Font Family" +msgstr "Familia de tipo de fonte cursiva" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:247 +msgid "The default Cursive font family used to display text." +msgstr "A familia de tipo de fonte cursiva empregado para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:255 +msgid "Default Font Family" +msgstr "Familia de tipo de fonte predefinida" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:256 +msgid "The default font family used to display text." +msgstr "A familia de fonte predefinida para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:264 +msgid "Fantasy Font Family" +msgstr "Familia de tipo de fonte Fantasy" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:265 +msgid "The default Fantasy font family used to display text." +msgstr "A familia de tipo de fonte Fantasy empregado para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:273 +msgid "Monospace Font Family" +msgstr "Familia de tipo de fonte Monospace" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:274 +msgid "The default font family used to display monospace text." +msgstr "A familia de tipo de fonte predefinido empregado para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:282 +msgid "Sans Serif Font Family" +msgstr "Familia de tipo de fonte Sans Serif" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:283 +msgid "The default Sans Serif font family used to display text." +msgstr "A familia de tipo de fonte Sans Serif empregado para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:291 +msgid "Serif Font Family" +msgstr "Familia de tipo de fonte Serif" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:292 +msgid "The default Serif font family used to display text." +msgstr "A familia de tipo de fonte Serif empregado para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:300 +msgid "Default Font Size" +msgstr "Tamaño do tipo de fonte predefinido" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:301 +msgid "The default font size used to display text." +msgstr "O tamaño do tipo de fonte predefinido para mostrar o texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:309 +msgid "Default Monospace Font Size" +msgstr "Tamaño predefinido do tipo de fonte monoespaciado" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:310 +msgid "The default font size used to display monospace text." +msgstr "" +"O tamaño predefinido de tipo de fonte para mostrar o texto monoespaciado" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:318 +msgid "Minimum Font Size" +msgstr "Tamaño mínimo para o tipo de fonte" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:319 +msgid "The minimum font size used to display text." +msgstr "Tamaño mínimo do tipo de fonte empregado para mostrar o texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:327 +msgid "Minimum Logical Font Size" +msgstr "O tamaño lóxico de fonte mínimo" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:328 +msgid "The minimum logical font size used to display text." +msgstr "O tamaño lóxico de fonte mínimo a empregar para mostrar texto." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:347 +msgid "Enforce 96 DPI" +msgstr "Forzar 96 DPI." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:348 +msgid "Enforce a resolution of 96 DPI" +msgstr "Forzar unha resolución de 96 DPI" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:356 +msgid "Auto Load Images" +msgstr "Cargar imaxes automáticamente" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:357 +msgid "Load images automatically." +msgstr "Carga imaxes automaticamente." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:365 +msgid "Auto Shrink Images" +msgstr "Recortar imaxes automaticamente" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:366 +msgid "Automatically shrink standalone images to fit." +msgstr "Recorta de forma automática as imaxes para que se axusten." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:374 +msgid "Print Backgrounds" +msgstr "Imprimir fondos" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:375 +msgid "Whether background images should be printed." +msgstr "Indica se se deben imprimir as imaxes de fondo." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:383 +msgid "Enable Scripts" +msgstr "Activar scripts" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:384 +msgid "Enable embedded scripting languages." +msgstr "Activa as linguaxes de scripting incrustadas." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:392 +msgid "Enable Plugins" +msgstr "Activar complementos" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:393 +msgid "Enable embedded plugin objects." +msgstr "Activar os obxectos de complementos incrustados." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:401 +msgid "Resizable Text Areas" +msgstr "Áreas de texto retamañábeis" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:402 +msgid "Whether text areas are resizable." +msgstr "Indica se as áreas de texto son retamañábeis." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:409 +msgid "User Stylesheet URI" +msgstr "URI da folla de estilos do usuario" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:410 +msgid "The URI of a stylesheet that is applied to every page." +msgstr "O URI dunha folla de estilos que se aplica en cada páxina." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:425 +msgid "Zoom Stepping Value" +msgstr "Valor de salto do zoom" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:426 +msgid "The value by which the zoom level is changed when zooming in or out." +msgstr "" +"O valor polo cal o nivel de zoom se cambiará ao incrementar o zoom ou " +"reducilo." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:444 +msgid "Enable Developer Extras" +msgstr "Activar extras do desenvolvedor" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:445 +msgid "Enables special extensions that help developers" +msgstr "Activa as extensións especiais que axudan aos desenvolvedores" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:465 +msgid "Enable Private Browsing" +msgstr "Activar a navegación privada" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:466 +msgid "Enables private browsing mode" +msgstr "Activa o modo privado de navegación" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:481 +msgid "Enable Spell Checking" +msgstr "Activar a corrección ortográfica" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:482 +#| msgid "Check Spelling While _Typing" +msgid "Enables spell checking while typing" +msgstr "Comprobar ortografía ao escribir" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:505 +msgid "Languages to use for spell checking" +msgstr "Idiomas a usar na corrección ortográfica" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:506 +msgid "Comma separated list of languages to use for spell checking" +msgstr "" +"Lista de separada por comas das linguaxes a usar na comprobación ortográfica" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:520 +#| msgid "Enable Private Browsing" +msgid "Enable Caret Browsing" +msgstr "Activar a navegación cos cursores" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:521 +msgid "Whether to enable accesibility enhanced keyboard navigation" +msgstr "" +"Indica se activar a navegación mellorada por teclado para a accesibilidade" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:536 +msgid "Enable HTML5 Database" +msgstr "Activar a base de datos de HTML5" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:537 +msgid "Whether to enable HTML5 database support" +msgstr "Indica se activar a compatibilidade de HTML5" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:552 +msgid "Enable HTML5 Local Storage" +msgstr "Activar o almacenamento local de HTML5" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:553 +msgid "Whether to enable HTML5 Local Storage support" +msgstr "Indica se activar a compatibilidade de almacenamento local de HTML5" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:567 +#| msgid "Enable Scripts" +msgid "Enable XSS Auditor" +msgstr "Activar o auditor de XSS" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:568 +msgid "Whether to enable teh XSS auditor" +msgstr "Indica se activar o auditor de XSS" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:586 +msgid "User Agent" +msgstr "Axente de usuario" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:587 +msgid "The User-Agent string used by WebKitGtk" +msgstr "A cadea User-Agent usada polo WebKitGtk" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:602 +msgid "JavaScript can open windows automatically" +msgstr "JavaScript pode abrir xanelas automáticamente" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:603 +msgid "Whether JavaScript can open windows automatically" +msgstr "Indica se JavaScript pode abrir xanelas automaticamente" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:618 +msgid "Enable offline web application cache" +msgstr "Activar a caché de aplicativo web fóra de liña" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:619 +msgid "Whether to enable offline web application cache" +msgstr "Indica" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:646 +msgid "Editing behavior" +msgstr "Comportamento de edición" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:647 +msgid "The behavior mode to use in editing mode" +msgstr "O modo de comportamento no modo de edición" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:663 +msgid "Enable universal access from file URIs" +msgstr "Activar o acceso universal para os URIs de ficheiro" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:664 +msgid "Whether to allow universal access from file URIs" +msgstr "Indica se permitir o acceso universal desde os URI de ficheiro" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:679 +#| msgid "Enable Scripts" +msgid "Enable DOM paste" +msgstr "Activar o pegado de DOM" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:680 +msgid "Whether to enable DOM paste" +msgstr "Indica se activar o pegado de DOM" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:698 +msgid "Tab key cycles through elements" +msgstr "A tecla de tabulación móvese ciclicamente a través dos elementos" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:699 +msgid "Whether the tab key cycles through elements on the page." +msgstr "" +"Indica se a tecla de tabulación móvese ciclicamente a través dos elementos " +"nunha da páxina." + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:719 +msgid "Enable Default Context Menu" +msgstr "Activar o menú contextual predefinido" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:720 +msgid "" +"Enables the handling of right-clicks for the creation of the default context " +"menu" +msgstr "" +"Activa a xestión dos clic dereitos para a creación do menú contextual " +"predefinido" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:740 +msgid "Enable Site Specific Quirks" +msgstr "Activar as solucións específicas dun sitio" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:741 +msgid "Enables the site-specific compatibility workarounds" +msgstr "Activa os arranxos de compatibilidade específicos dun sitio" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:763 +msgid "Enable page cache" +msgstr "Activar a caché de páxina" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:764 +#| msgid "Whether background images should be printed." +msgid "Whether the page cache should be used" +msgstr "Indica se se debería usar a caché de páxina" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:784 +msgid "Auto Resize Window" +msgstr "Autoredimentsionar a xanela" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:785 +msgid "Automatically resize the toplevel window when a page requests it" +msgstr "" +"Redimensionar automaticamente a xanela de nivel superior cando a páxina o " +"solicite" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:817 +#| msgid "Enable JavaScript profiling" +msgid "Enable Java Applet" +msgstr "Activar os Applet de Java" + +#: WebKit/gtk/webkit/webkitwebsettings.cpp:818 +msgid "Whether Java Applet support through <applet> should be enabled" +msgstr "" +"Indica se se debería activar a compatibilidade dos Applet de Java a través " +"de <applet>" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2319 +msgid "Returns the @web_view's document title" +msgstr "Devolve o título do documento do @web_view" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2333 +msgid "Returns the current URI of the contents displayed by the @web_view" +msgstr "Devolve o URI actual dos contidos mostrados polo @web_view" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2346 +msgid "Copy target list" +msgstr "Copiar lista de destinos" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2347 +msgid "The list of targets this web view supports for clipboard copying" +msgstr "" +"A lista de destinos para os cales esta visualización web ten compatibilidade " +"para copiar no portarretallos" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2360 +msgid "Paste target list" +msgstr "Pegar lista de destinos" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2361 +msgid "The list of targets this web view supports for clipboard pasting" +msgstr "" +"A lista de destinos para os que esta visualización web ten compatibilidade " +"para pegar no portarretallos" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2367 +msgid "Settings" +msgstr "Configuracións" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2368 +msgid "An associated WebKitWebSettings instance" +msgstr "Unha instancia de WebKitWebSettings asociada" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2381 +msgid "Web Inspector" +msgstr "Inspector web" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2382 +msgid "The associated WebKitWebInspector instance" +msgstr "A instancia de WebKitWebInspector asociada" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2402 +msgid "Editable" +msgstr "Editábel" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2403 +msgid "Whether content can be modified by the user" +msgstr "Indica se o contido pode ser modificado polo usuario" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2409 +msgid "Transparent" +msgstr "Transparente" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2410 +msgid "Whether content has a transparent background" +msgstr "Indica se o contido pode ter un fondo transparente" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2423 +msgid "Zoom level" +msgstr "Nivel de zoom" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2424 +msgid "The level of zoom of the content" +msgstr "O nivel de zoom do contido" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2439 +msgid "Full content zoom" +msgstr "Zoom de contido completo" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2440 +msgid "Whether the full content is scaled when zooming" +msgstr "Indica se o contido completo é escalado ao facer zoom" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2453 +msgid "Encoding" +msgstr "Codificación" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2454 +msgid "The default encoding of the web view" +msgstr "A codificación predefinida para a visualización web" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2467 +msgid "Custom Encoding" +msgstr "Codificación personalizada" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2468 +msgid "The custom encoding of the web view" +msgstr "A codificación personalizada para a visualización web" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2520 +msgid "Icon URI" +msgstr "URI da icona" + +#: WebKit/gtk/webkit/webkitwebview.cpp:2521 +msgid "The URI for the favicon for the #WebKitWebView." +msgstr "O URI do favicon para o #WebKitWebView." + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55 +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60 +msgid "Submit" +msgstr "Enviar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65 +msgid "Reset" +msgstr "Restabelecer" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70 +msgid "This is a searchable index. Enter search keywords: " +msgstr "Este é un índice buscábel. Insira as palabras chave de búsqueda:" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75 +msgid "Choose File" +msgstr "Seleccionar ficheiro" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80 +msgid "(None)" +msgstr "(ningún)" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85 +msgid "Open Link in New _Window" +msgstr "Abrir a ligazón nunha nova _xanela" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90 +msgid "_Download Linked File" +msgstr "_Descargar o ficheiro ligado" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95 +msgid "Copy Link Loc_ation" +msgstr "Copiar a loc_alización da ligazón" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100 +msgid "Open _Image in New Window" +msgstr "Abrir _imaxe nunha nova xanela" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105 +msgid "Sa_ve Image As" +msgstr "Gar_dar imaxe como" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110 +msgid "Cop_y Image" +msgstr "Co_piar imaxe" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115 +msgid "Open _Frame in New Window" +msgstr "Abrir _marco nunha nova xanela" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166 +msgid "_Reload" +msgstr "_Recargar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183 +msgid "No Guesses Found" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188 +msgid "_Ignore Spelling" +msgstr "_Ignorar corrección ortográfica" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193 +msgid "_Learn Spelling" +msgstr "Apren_er corrección ortográfica" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198 +msgid "_Search the Web" +msgstr "_Buscar na web" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203 +msgid "_Look Up in Dictionary" +msgstr "_Buscar no dicionario" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208 +msgid "_Open Link" +msgstr "_Abrir ligazón" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213 +msgid "Ignore _Grammar" +msgstr "Ignorar _gramática" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218 +msgid "Spelling and _Grammar" +msgstr "Corrección ortográfica e _gramatical" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223 +msgid "_Show Spelling and Grammar" +msgstr "_Mostrar corrección ortográfica e gramatical" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223 +msgid "_Hide Spelling and Grammar" +msgstr "_Agochar corrección ortográfica e gramatical" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228 +msgid "_Check Document Now" +msgstr "_Comprobar o documento agora" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233 +msgid "Check Spelling While _Typing" +msgstr "Comprobar ortografía ao _escribir" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238 +msgid "Check _Grammar With Spelling" +msgstr "Comprobar _gramática ao escribir" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243 +msgid "_Font" +msgstr "_Tipo de fonte" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266 +msgid "_Outline" +msgstr "_Contorno" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271 +msgid "Inspect _Element" +msgstr "Inspeccionar _elemento" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276 +msgid "No recent searches" +msgstr "Non hai buscas recentes" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281 +msgid "Recent searches" +msgstr "Buscas recentes" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286 +msgid "_Clear recent searches" +msgstr "_Limpar as buscas recentes" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291 +msgid "term" +msgstr "termo" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296 +msgid "definition" +msgstr "definición" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301 +msgid "press" +msgstr "premer" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306 +msgid "select" +msgstr "seleccionar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311 +msgid "activate" +msgstr "activado" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316 +msgid "uncheck" +msgstr "desmarcar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321 +msgid "check" +msgstr "marcar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326 +msgid "jump" +msgstr "saltar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342 +msgid " files" +msgstr " ficheiros" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347 +msgid "Unknown" +msgstr "Descoñecido" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364 +msgid "Loading..." +msgstr "Cargando..." + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369 +msgid "Live Broadcast" +msgstr "Retransmisión en vivo" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375 +msgid "audio element controller" +msgstr "controlador do elemento de son" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377 +msgid "video element controller" +msgstr "controlador de elemento de vídeo" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379 +msgid "mute" +msgstr "enmudecer" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381 +msgid "unmute" +msgstr "desenmudecer" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383 +msgid "play" +msgstr "reproducir" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385 +msgid "pause" +msgstr "pausar" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387 +msgid "movie time" +msgstr "tempo do filme" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389 +msgid "timeline slider thumb" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391 +msgid "back 30 seconds" +msgstr "abrás 30 segundos" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393 +msgid "return to realtime" +msgstr "voltar ao tempo real" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395 +msgid "elapsed time" +msgstr "tempo transcorrido" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397 +msgid "remaining time" +msgstr "tempo restante" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399 +#| msgid "Status" +msgid "status" +msgstr "estado" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401 +msgid "fullscreen" +msgstr "pantalla completa" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403 +msgid "fast forward" +msgstr "avance rápido" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405 +msgid "fast reverse" +msgstr "retroceso rápido" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407 +msgid "show closed captions" +msgstr "mostrar os subtítulos pechados" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409 +msgid "hide closed captions" +msgstr "ocultar os subtítulos pechados" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418 +msgid "audio element playback controls and status display" +msgstr "controis e xanela de estado de reprodución dos elementos de son" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420 +msgid "video element playback controls and status display" +msgstr "controis e xanela de estado de reprodución dos elementos de vídeo" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422 +msgid "mute audio tracks" +msgstr "enmudecer as pistas de son" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424 +msgid "unmute audio tracks" +msgstr "desenmudecer as pistas de son" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426 +msgid "begin playback" +msgstr "comezar a reprodución" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428 +msgid "pause playback" +msgstr "pausar a reprodución" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430 +msgid "movie time scrubber" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432 +msgid "movie time scrubber thumb" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434 +msgid "seek movie back 30 seconds" +msgstr "buscar cara atrás no filme 30 segundos" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436 +msgid "return streaming movie to real time" +msgstr "devolver a reprodución en vivo do filme ao tempo real" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438 +msgid "current movie time in seconds" +msgstr "tempo actual do filme en segundos" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440 +msgid "number of seconds of movie remaining" +msgstr "números de segundos que faltan do filme" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442 +msgid "current movie status" +msgstr "estado do filme actual" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444 +msgid "seek quickly back" +msgstr "buscar cara atrás rápidamente" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446 +msgid "seek quickly forward" +msgstr "buscar cara adiante rápidamente" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448 +msgid "Play movie in fullscreen mode" +msgstr "Reproducir o filme en pantalla completa" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450 +msgid "start displaying closed captions" +msgstr "comezar a mostrar os subtítulos pechados" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452 +msgid "stop displaying closed captions" +msgstr "parar de mostrar os subtítulos pechados" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461 +#| msgid "definition" +msgid "indefinite time" +msgstr "tempo non definido" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491 +msgid "value missing" +msgstr "falta o valor" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497 +msgid "type mismatch" +msgstr "tipo non coincidente" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502 +msgid "pattern mismatch" +msgstr "patron non coincidente" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507 +msgid "too long" +msgstr "demasiado longo" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512 +msgid "range underflow" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517 +msgid "range overflow" +msgstr "" + +#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522 +msgid "step mismatch" +msgstr "paso non coincidente" + +#~ msgid "_Searchable Index" +#~ msgstr "Índice bu_scábel" diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 44ffc1e..556648d 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -56,6 +56,7 @@ #include "Page.h" #include "Frame.h" #include "InspectorClientGtk.h" +#include "IntPoint.h" #include "FrameLoaderClient.h" #include "ResourceHandle.h" #include "ResourceRequest.h" @@ -152,6 +153,11 @@ extern "C" { GHashTable* subResources; char* tooltipText; + int currentClickCount; + WebCore::IntPoint* previousClickPoint; + guint previousClickButton; + guint32 previousClickTime; + HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> > draggingDataObjects; }; diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index 6744732..ce2bbc6 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -41,6 +41,7 @@ #include "webkitwebhistoryitem.h" #include "AXObjectCache.h" +#include "AbstractDatabase.h" #include "BackForwardList.h" #include "Cache.h" #include "ChromeClientGtk.h" @@ -49,7 +50,6 @@ #include "ContextMenuController.h" #include "ContextMenu.h" #include "Cursor.h" -#include "Database.h" #include "Document.h" #include "DocumentLoader.h" #include "DragClientGtk.h" @@ -587,16 +587,25 @@ static gboolean webkit_web_view_key_release_event(GtkWidget* widget, GdkEventKey return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->key_release_event(widget, event); } -static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventButton* event) +static guint32 getEventTime(GdkEvent* event) { - // Eventually it may make sense for these to be per-view and per-device, - // but at this time the implementation matches the Windows port. - static int currentClickCount = 1; - static IntPoint previousPoint; - static guint previousButton; - static guint32 previousTime; + guint32 time = gdk_event_get_time(event); + if (time) + return time; + + // Real events always have a non-zero time, but events synthesized + // by the DRT do not and we must calculate a time manually. This time + // is not calculated in the DRT, because GTK+ does not work well with + // anything other than GDK_CURRENT_TIME on synthesized events. + GTimeVal timeValue; + g_get_current_time(&timeValue); + return (timeValue.tv_sec * 1000) + (timeValue.tv_usec / 1000); +} +static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventButton* event) +{ WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); + WebKitWebViewPrivate* priv = webView->priv; // FIXME: need to keep track of subframe focus for key events gtk_widget_grab_focus(widget); @@ -620,20 +629,21 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu // GTK+ only counts up to triple clicks, but WebCore wants to know about // quadruple clicks, quintuple clicks, ad infinitum. Here, we replicate the // GDK logic for counting clicks. + guint32 eventTime = getEventTime(reinterpret_cast<GdkEvent*>(event)); if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS) - || ((abs(event->x - previousPoint.x()) < doubleClickDistance) - && (abs(event->y - previousPoint.y()) < doubleClickDistance) - && (event->time - previousTime < static_cast<guint>(doubleClickTime)) - && (event->button == previousButton))) - currentClickCount++; + || ((abs(event->x - priv->previousClickPoint->x()) < doubleClickDistance) + && (abs(event->y - priv->previousClickPoint->y()) < doubleClickDistance) + && (eventTime - priv->previousClickTime < static_cast<guint>(doubleClickTime)) + && (event->button == priv->previousClickButton))) + priv->currentClickCount++; else - currentClickCount = 1; + priv->currentClickCount = 1; PlatformMouseEvent platformEvent(event); - platformEvent.setClickCount(currentClickCount); - previousPoint = platformEvent.pos(); - previousButton = event->button; - previousTime = event->time; + platformEvent.setClickCount(priv->currentClickCount); + *priv->previousClickPoint = platformEvent.pos(); + priv->previousClickButton = event->button; + priv->previousClickTime = eventTime; if (event->button == 3) return webkit_web_view_forward_context_menu_event(webView, PlatformMouseEvent(event)); @@ -799,17 +809,24 @@ static gboolean webkit_web_view_focus_out_event(GtkWidget* widget, GdkEventFocus static void webkit_web_view_realize(GtkWidget* widget) { - GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); + gtk_widget_set_realized(widget, TRUE); + + GtkAllocation allocation; +#if GTK_CHECK_VERSION(2, 18, 0) + gtk_widget_get_allocation(widget, &allocation); +#else + allocation = widget->allocation; +#endif GdkWindowAttr attributes; attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = widget->allocation.x; - attributes.y = widget->allocation.y; - attributes.width = widget->allocation.width; - attributes.height = widget->allocation.height; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; - attributes.visual = gtk_widget_get_visual (widget); - attributes.colormap = gtk_widget_get_colormap (widget); + attributes.visual = gtk_widget_get_visual(widget); + attributes.colormap = gtk_widget_get_colormap(widget); attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK @@ -823,15 +840,20 @@ static void webkit_web_view_realize(GtkWidget* widget) | GDK_BUTTON3_MOTION_MASK; gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP; - widget->window = gdk_window_new(gtk_widget_get_parent_window (widget), &attributes, attributes_mask); - gdk_window_set_user_data(widget->window, widget); + GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributes_mask); + gtk_widget_set_window(widget, window); + gdk_window_set_user_data(window, widget); - widget->style = gtk_style_attach(widget->style, widget->window); - gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL); +#if GTK_CHECK_VERSION(2, 20, 0) + gtk_widget_style_attach(widget); +#else + widget->style = gtk_style_attach(gtk_widget_get_style(widget), window); +#endif + gtk_style_set_background(gtk_widget_get_style(widget), window, GTK_STATE_NORMAL); WebKitWebView* webView = WEBKIT_WEB_VIEW(widget); WebKitWebViewPrivate* priv = webView->priv; - gtk_im_context_set_client_window(priv->imContext, widget->window); + gtk_im_context_set_client_window(priv->imContext, window); } static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* hadj, GtkAdjustment* vadj) @@ -970,7 +992,7 @@ static gboolean webkit_web_view_script_dialog(WebKitWebView* webView, WebKitWebF if (type == WEBKIT_SCRIPT_DIALOG_PROMPT) { entry = gtk_entry_new(); gtk_entry_set_text(GTK_ENTRY(entry), defaultValue); - gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), entry); + gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), entry); gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); gtk_widget_show(entry); } @@ -1184,6 +1206,8 @@ static void webkit_web_view_finalize(GObject* object) g_free(priv->customEncoding); g_free(priv->iconURI); + delete priv->previousClickPoint; + G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object); } @@ -1312,7 +1336,7 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context) event->button.state = modifiers; PlatformMouseEvent platformEvent(&event->button); - frame->eventHandler()->dragSourceEndedAt(platformEvent, gdkDragActionToDragOperation(context->action)); + frame->eventHandler()->dragSourceEndedAt(platformEvent, gdkDragActionToDragOperation(gdk_drag_context_get_selected_action(context))); gdk_event_free(event); } @@ -2730,7 +2754,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) settings->setPrivateBrowsingEnabled(enablePrivateBrowsing); settings->setCaretBrowsingEnabled(enableCaretBrowsing); #if ENABLE(DATABASE) - Database::setIsAvailable(enableHTML5Database); + AbstractDatabase::setIsAvailable(enableHTML5Database); #endif settings->setLocalStorageEnabled(enableHTML5LocalStorage); settings->setXSSAuditorEnabled(enableXSSAuditor); @@ -2823,7 +2847,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar settings->setCaretBrowsingEnabled(g_value_get_boolean(&value)); #if ENABLE(DATABASE) else if (name == g_intern_string("enable-html5-database")) { - Database::setIsAvailable(g_value_get_boolean(&value)); + AbstractDatabase::setIsAvailable(g_value_get_boolean(&value)); } #endif else if (name == g_intern_string("enable-html5-local-storage")) @@ -2882,7 +2906,7 @@ static void webkit_web_view_init(WebKitWebView* webView) g_object_ref_sink(priv->horizontalAdjustment); g_object_ref_sink(priv->verticalAdjustment); - GTK_WIDGET_SET_FLAGS(webView, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(GTK_WIDGET(webView), TRUE); priv->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView)); priv->lastPopupXPosition = priv->lastPopupYPosition = -1; priv->editable = false; @@ -2900,6 +2924,10 @@ static void webkit_web_view_init(WebKitWebView* webView) priv->subResources = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref); priv->tooltipText = 0; + priv->currentClickCount = 0; + priv->previousClickPoint = new IntPoint(0, 0); + priv->previousClickButton = 0; + priv->previousClickTime = 0; } GtkWidget* webkit_web_view_new(void) @@ -4450,4 +4478,3 @@ WebKitCacheModel webkit_get_cache_model() webkit_init(); return cacheModel; } - diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index c6151ad..ea2393a 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,779 @@ +2010-06-24 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + Full-screened content doesn't keep the display on: Safari not grabbing a power assertion? + https://bugs.webkit.org/show_bug.cgi?id=40939 + rdar://problem/7996172 + + Take a IOKit power assertion when playing video in fullscreen mode. Release the + assertion when paused in fullscreen mode, and when exiting fullscreen mode. + + * WebView/WebVideoFullscreenController.h: + * WebView/WebVideoFullscreenController.mm: + (-[WebVideoFullscreenController windowDidExitFullscreen]): Call updatePowerAssertions. + (-[WebVideoFullscreenController windowDidEnterFullscreen]): Call updatePowerAssertions. + (-[WebVideoFullscreenController _disableIdleDisplaySleep]): + (-[WebVideoFullscreenController _enableIdleDisplaySleep]): + (-[WebVideoFullscreenController _disableIdleSystemSleep]): + (-[WebVideoFullscreenController _enableIdleSystemSleep]): + (-[WebVideoFullscreenController updatePowerAssertions]): Call _(enable|disable)Idle(System|Display)sleep depending on current playback rate and fullscreen status. + (-[WebVideoFullscreenController rateChanged:]): Call updatePowerAssertions. + +2010-06-24 Jer Noble <jer.noble@apple.com> + + Reviewed by Darin Adler. + + Playing movie full screen on second monitor hides menu bar and title bar on main monitor + https://bugs.webkit.org/show_bug.cgi?id=40933 + rdar://problem/7858452 + + Remove all references to GetSystemUIMode and SetSystemUIMode. Replace these calls with + [NSApplication setPresentationOptions:]. Do not auto-hide the menu bar if the fullscreen + screen is does not contain the menu-bar. Do not auto-hide the dock if the fullscreen screen + is both not the menu-bar screen and not the dock screen. + + * WebView/WebVideoFullscreenController.mm: + (-[WebVideoFullscreenController windowDidLoad]): Register the applicationDidChangeScreenParameters: listener. + (-[WebVideoFullscreenController windowDidExitFullscreen]): Calls updateMenuAndDockForFullscreen. + (-[WebVideoFullscreenController windowDidEnterFullscreen]): Calls updateMenuAndDockForFullscreen. + (-[WebVideoFullscreenController applicationDidChangeScreenParameters:]): New notification handler; catches NSApplicationDidChangeScreenParameters. + (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Hide/show the menu-bar and dock according to the fullscreen window's screen. + +2010-06-24 Jer Noble <jer.noble@apple.com> + + Reviewed by Eric Carlson. + + Full screen video in Safari exits full-screen if you switch to another app + https://bugs.webkit.org/show_bug.cgi?id=40635 + rdar://problem/7885101 + + Implement the following rules for exiting full screen when switching apps: + 1. If the system has a single screen, switching apps will cause Safari to exit full-screen. + 2. Otherwise, if the full-screen screen is the "main screen" (the one with the title bar), + switching apps will cause Safari to exit full-screen. + 3. Overriding rules 1 & 2, if the full-screen screen is not on the "current space", + switching apps will NOT cause Safari to exit full-screen. + + * WebView/WebVideoFullscreenController.mm: + (-[WebVideoFullscreenController windowDidLoad]): + (-[WebVideoFullscreenController applicationDidResignActive:]): + +2010-06-24 Adele Peterson <adele@apple.com> + + Reviewed by Sam Weinig. + + Updated fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events + https://bugs.webkit.org/show_bug.cgi?id=41085 + + * WebView/WebHTMLView.mm: Use the WebCore command system for the pasteAsPlainText selector. + Also remove internal methods that no one is using. + +2010-06-24 Damian Kaleta <dkaleta@apple.com> + + Reviewed by Sam Weinig. + + Added an ObjC wrapper to Node::renderRect(bool&). + + * DOM/WebDOMOperations.mm: + (-[DOMNode _renderRect:]): + * DOM/WebDOMOperationsPrivate.h: + +2010-06-24 Adele Peterson <adele@apple.com> + + Reviewed by Eric Carlson. + + Fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events + https://bugs.webkit.org/show_bug.cgi?id=41085 + + * WebView/WebHTMLView.mm: (-[WebHTMLView pasteAsPlainText:]): Reuse code in WebCore + which does everything done here and also fires paste events. + +2010-06-23 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Implement page format data programming interface. + Add methods for testing. + https://bugs.webkit.org/show_bug.cgi?id=37538 + + * Misc/WebCoreStatistics.h: + * Misc/WebCoreStatistics.mm: + (-[WebFrame isPageBoxVisible:]): + (-[WebFrame pageAreaRectInPixels:]): + (-[WebFrame preferredPageSizeInPixels:]): + +2010-06-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Get rid of more USE_LIBDISPATCH code. + + * Plugins/Hosted/NetscapePluginHostProxy.h: + +2010-06-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Get rid of the USE_LIBDISPATCH code. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy): + (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy): + +2010-06-22 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Wean NetscapePluginHostManager of any knowledge about WebNetscapePluginPackage + https://bugs.webkit.org/show_bug.cgi?id=41006 + + * Plugins/Hosted/NetscapePluginHostManager.h: + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::hostForPlugin): + (WebKit::NetscapePluginHostManager::spawnPluginHost): + (WebKit::NetscapePluginHostManager::instantiatePlugin): + (WebKit::NetscapePluginHostManager::createPropertyListFile): + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView createPlugin]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage createPropertyListFile]): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Fix an off-by-one bug I introduced. + + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + +2010-06-21 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + FrameLoader cleanup: Split high level subframe and plugin + loading functions into a separate class. + https://bugs.webkit.org/show_bug.cgi?id=40453 + + * WebView/WebFrame.mm: + (-[WebFrame _cacheabilityDictionary]): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Another Tiger build fix. + + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage _tryLoad]): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + More WebBasePluginPackage cleanup + https://bugs.webkit.org/show_bug.cgi?id=40944 + + * Plugins/Hosted/HostedNetscapePluginStream.mm: + (WebKit::HostedNetscapePluginStream::pluginCancelledConnectionError): + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::spawnPluginHost): + * Plugins/WebBaseNetscapePluginStream.mm: + (WebNetscapePluginStream::pluginCancelledConnectionError): + * Plugins/WebBaseNetscapePluginView.mm: + (WebHaltablePlugin::pluginName): + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage _objectForInfoDictionaryKey:]): + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage load]): + (-[WebBasePluginPackage dealloc]): + (-[WebBasePluginPackage finalize]): + (-[WebBasePluginPackage pluginInfo]): + (-[WebBasePluginPackage supportsExtension:]): + (-[WebBasePluginPackage supportsMIMEType:WebCore::]): + (-[WebBasePluginPackage MIMETypeForExtension:]): + (-[WebBasePluginPackage isJavaPlugIn]): + (-[WebBasePluginPackage versionNumber]): + (-[WebBasePluginPackage WebCore::]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage openResourceFile]): + (-[WebNetscapePluginPackage closeResourceFile:]): + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + (-[WebNetscapePluginPackage _initWithPath:]): + (-[WebNetscapePluginPackage _applyDjVuWorkaround]): + (-[WebNetscapePluginPackage _tryLoad]): + (-[WebNetscapePluginPackage supportsSnapshotting]): + (-[WebNetscapePluginPackage _unloadWithShutdown:]): + * Plugins/WebPluginDatabase.mm: + (-[WebPluginDatabase refresh]): + (-[WebPluginDatabase _removePlugin:]): + * Plugins/WebPluginPackage.mm: + (-[WebPluginPackage initWithPath:]): + (-[WebPluginPackage load]): + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::createPlugin): + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::getPluginInfo): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Another PowerPC build fix. + + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage openResourceFile]): + (-[WebNetscapePluginPackage _tryLoad]): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Try to fix the PowerPC build. + + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage _tryLoad]): + +2010-06-21 Nate Chapin <japhet@chromium.org> + + Reviewed by Adam Barth. + + Update relevant calls into FrameLoader to make use of + FrameLoaderStateMachine. + https://bugs.webkit.org/show_bug.cgi?id=39695 + + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::transitionToCommittedForNewPage): + * WebView/WebFrame.mm: + (-[WebFrame _firstLayoutDone]): + +2010-06-21 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Dan Bernstein. + + Chromium/Mac build fix. + + * WebCoreSupport/WebSystemInterface.mm: Change the order of wtf/Platform.h include to let other + headers smell it. + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Make all of WebKit build with clang++ + + * DefaultDelegates/WebDefaultPolicyDelegate.m: + (-[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]): + * Plugins/Hosted/NetscapePluginHostManager.mm: + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView resolvedURLStringForURL:target:]): + * WebView/WebDynamicScrollBarsView.mm: + (-[WebDynamicScrollBarsView setSuppressLayout:]): + * WebView/WebHTMLRepresentation.mm: + * WebView/WebNavigationData.mm: + (-[WebNavigationData initWithURLString:title:originalRequest:response:hasSubstituteData:clientRedirectSource:]): + * WebView/WebPDFRepresentation.mm: + (-[WebPDFRepresentation setDataSource:]): + (-[WebPDFRepresentation receivedData:withDataSource:]): + (-[WebPDFRepresentation receivedError:withDataSource:]): + * WebView/WebResource.mm: + (-[WebResource description]): + * WebView/WebSerializedJSValue.mm: + (-[WebSerializedJSValue initWithValue:context:exception:]): + * WebView/WebVideoFullscreenController.mm: + (-[WebVideoFullscreenController WebCore::]): + (-[WebVideoFullscreenController setMediaElement:WebCore::]): + (-[WebVideoFullscreenController setDelegate:]): + (-[WebVideoFullscreenController enterFullscreen:]): + * WebView/WebView.mm: + (-[WebView _openFrameInNewWindowFromMenu:]): + (-[WebView _geolocationDidChangePosition:]): + +2010-06-21 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Remove unused dictionary ivars from WebBasePluginPackage + https://bugs.webkit.org/show_bug.cgi?id=40928 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage dealloc]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + +2010-06-21 Dan Bernstein <mitz@apple.com> + + Build fix + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + +2010-06-21 Dan Bernstein <mitz@apple.com> + + Reviewed by Darin Adler. + + WebKit part of implementing the 'hyphens' and 'hyphenate-character' properties + https://bugs.webkit.org/show_bug.cgi?id=10228 + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Initialize wkGetHyphenationLocationBeforeIndex. + +2010-06-21 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Speech Input Patch 0: Added compilation argument to conditionally compile pending patches. + https://bugs.webkit.org/show_bug.cgi?id=40878 + + * Configurations/FeatureDefines.xcconfig: + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Fix Tiger build. + + * Plugins/WebNetscapePluginPackage.mm: + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Get rid of the old MIMETypes getter method + https://bugs.webkit.org/show_bug.cgi?id=40898 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage supportsExtension:]): + (-[WebBasePluginPackage supportsMIMEType:WebCore::]): + (-[WebBasePluginPackage MIMETypeForExtension:]): + * Plugins/WebPluginDatabase.mm: + (-[WebPluginDatabase refresh]): + (-[WebPluginDatabase _removePlugin:]): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Remove bogus const qualifiers. + + * WebCoreSupport/WebPasteboardHelper.h: + * WebCoreSupport/WebPasteboardHelper.mm: + (WebPasteboardHelper::urlFromPasteboard): + (WebPasteboardHelper::plainTextFromPasteboard): + (WebPasteboardHelper::fragmentFromPasteboard): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Get rid of the extensionToMIME mapping in WebBasePluginPackage + https://bugs.webkit.org/show_bug.cgi?id=40897 + + Instead of using the extensionToMIME mutable dictionary, use the MIME types vector. + While this makes lookup of MIME types based on extensions linear instead of constant, + the number of extensions per plug-in is too small for it to matter. + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage dealloc]): + (-[WebBasePluginPackage supportsExtension:]): + (-[WebBasePluginPackage MIMETypeForExtension:]): + (-[WebBasePluginPackage setMIMEToExtensionsDictionary:]): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add a MimeClassInfo Vector to WebBasePluginPackage + https://bugs.webkit.org/show_bug.cgi?id=40896 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage WebCore::]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::getPluginInfo): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Move the NSBundle ivar to WebPluginPackage + https://bugs.webkit.org/show_bug.cgi?id=40894 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage _objectForInfoDictionaryKey:]): + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage load]): + (-[WebBasePluginPackage dealloc]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage _initWithPath:]): + * Plugins/WebPluginPackage.h: + * Plugins/WebPluginPackage.mm: + (-[WebPluginPackage initWithPath:]): + (-[WebPluginPackage dealloc]): + (-[WebPluginPackage viewFactory]): + (-[WebPluginPackage load]): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Remove -[WebBasePluginPackage bundle] + https://bugs.webkit.org/show_bug.cgi?id=40892 + + Add -[WebBasePluginPackage bundleIdentifier] and switch clients over to it. + + Move the supportsSnapshotting method over to the plug-in package. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::hostForPackage): + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]): + (-[WebBaseNetscapePluginView supportsSnapshotting]): + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage isQuickTimePlugIn]): + (-[WebBasePluginPackage isJavaPlugIn]): + (-[WebBasePluginPackage WebCore::]): + Call bundleIdentifier directly instead of asking the bundle + * Plugins/WebNetscapePluginPackage.h: + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage supportsSnapshotting]): + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView setAttributeKeys:andValues:]): + (-[WebNetscapePluginView _createPlugin]): + * Plugins/WebPluginDatabase.mm: + (checkCandidate): + +2010-06-20 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Change some WebPluginDabase ivars to use WebCore::String instead of NSString. + https://bugs.webkit.org/show_bug.cgi?id=40869 + + Re-land r61459, with extra null-checks in WebFrameLoaderClient. + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::spawnPluginHost): + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage dealloc]): + (-[WebBasePluginPackage name]): + (-[WebBasePluginPackage path]): + (-[WebBasePluginPackage filename]): + (-[WebBasePluginPackage pluginDescription]): + (-[WebBasePluginPackage description]): + (-[WebBasePluginPackage isJavaPlugIn]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + (-[WebNetscapePluginPackage _tryLoad]): + (-[WebNetscapePluginPackage _unloadWithShutdown:]): + * Plugins/WebPluginPackage.mm: + (-[WebPluginPackage load]): + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::createPlugin): + +2010-06-18 Adam Barth <abarth@webkit.org> + + Unreviewed, rolling out r61459. + http://trac.webkit.org/changeset/61459 + https://bugs.webkit.org/show_bug.cgi?id=40869 + + Seems to have broken two tests on the Tiger buildbot: + + dom/html/level2/html/AppletsCollection.html + plugins/qt-qwidget-plugin.html + + Anders wasn't on #webkit... + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::spawnPluginHost): + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage dealloc]): + (-[WebBasePluginPackage name]): + (-[WebBasePluginPackage path]): + (-[WebBasePluginPackage filename]): + (-[WebBasePluginPackage pluginDescription]): + (-[WebBasePluginPackage setName:]): + (-[WebBasePluginPackage setPath:]): + (-[WebBasePluginPackage setPluginDescription:]): + (-[WebBasePluginPackage description]): + (-[WebBasePluginPackage isJavaPlugIn]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + (-[WebNetscapePluginPackage _tryLoad]): + (-[WebNetscapePluginPackage _unloadWithShutdown:]): + * Plugins/WebPluginPackage.mm: + (-[WebPluginPackage load]): + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Fix Tiger build. + + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage isJavaPlugIn]): + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Change some WebPluginDabase ivars to use WebCore::String instead of NSString. + https://bugs.webkit.org/show_bug.cgi?id=40869 + + * Plugins/Hosted/NetscapePluginHostManager.mm: + (WebKit::NetscapePluginHostManager::spawnPluginHost): + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage initWithPath:]): + (-[WebBasePluginPackage getPluginInfoFromPLists]): + (-[WebBasePluginPackage dealloc]): + (-[WebBasePluginPackage name]): + (-[WebBasePluginPackage path]): + (-[WebBasePluginPackage filename]): + (-[WebBasePluginPackage pluginDescription]): + (-[WebBasePluginPackage description]): + (-[WebBasePluginPackage isJavaPlugIn]): + * Plugins/WebNetscapePluginPackage.mm: + (-[WebNetscapePluginPackage getPluginInfoFromResources]): + (-[WebNetscapePluginPackage _tryLoad]): + (-[WebNetscapePluginPackage _unloadWithShutdown:]): + * Plugins/WebPluginPackage.mm: + (-[WebPluginPackage load]): + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Rename WebPluginPackage.m to make it an Objective-C++ file. + + * Plugins/WebPluginPackage.m: Removed. + * Plugins/WebPluginPackage.mm: Copied from Plugins/WebPluginPackage.m. + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Get rid of the NSEnumerators from WebBasePluginPackage + https://bugs.webkit.org/show_bug.cgi?id=40868 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage MIMETypes]): + (-[WebBasePluginPackage supportsExtension:]): + (-[WebBasePluginPackage supportsMIMEType:]): + * Plugins/WebPluginDatabase.mm: + (-[WebPluginDatabase pluginForMIMEType:]): + (-[WebPluginDatabase pluginForExtension:]): + (-[WebPluginDatabase refresh]): + (-[WebPluginDatabase _removePlugin:]): + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::getPluginInfo): + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Make WebCoreSystemInterface.h a C++ only header + https://bugs.webkit.org/show_bug.cgi?id=40867 + + * WebCoreSupport/WebSystemInterface.h: + * WebCoreSupport/WebSystemInterface.m: Removed. + * WebCoreSupport/WebSystemInterface.mm: Copied from WebKit/mac/WebCoreSupport/WebSystemInterface.m. + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Clean up WebPluginDatabase.mm + https://bugs.webkit.org/show_bug.cgi?id=40866 + + * Plugins/WebBasePluginPackage.h: + * Plugins/WebBasePluginPackage.mm: + (pathByResolvingSymlinksAndAliases): + (-[WebBasePluginPackage initWithPath:]): + Change an instance method into a static function. + + * Plugins/WebPluginDatabase.mm: + (PluginPackageCandidates::PluginPackageCandidates): + (PluginPackageCandidates::update): + (PluginPackageCandidates::bestCandidate): + Add a new PluginPackageCandidates class. + + (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]): + Use PluginPackageCandidates here. + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Fix Tiger build. + + * WebCoreSupport/WebPlatformStrategies.mm: + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Get rid of PluginDataMac.mm and use the plug-in strategy instead + https://bugs.webkit.org/show_bug.cgi?id=40860 + + * Plugins/WebBasePluginPackage.h: + * WebCoreSupport/WebPlatformStrategies.h: + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::createPluginStrategy): + (WebPlatformStrategies::refreshPlugins): + (WebPlatformStrategies::getPluginInfo): + * WebCoreSupport/WebViewFactory.mm: + +2010-06-18 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Add stubbed out WebPlatformStrategies class to WebKit. + https://bugs.webkit.org/show_bug.cgi?id=40851 + + * WebCoreSupport/WebPlatformStrategies.h: Added. + * WebCoreSupport/WebPlatformStrategies.mm: Added. + (WebPlatformStrategies::initialize): + (WebPlatformStrategies::WebPlatformStrategies): + (WebPlatformStrategies::createPluginStrategy): + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): + +2010-06-17 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Use adoptRef and create functions in more code paths + https://bugs.webkit.org/show_bug.cgi?id=40760 + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: Made create no longer + be an inline function. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): + Moved the call to addPluginInstance out of here. + (WebKit::NetscapePluginInstanceProxy::create): Move it in here. + This makes sure we call adoptRef on the new proxy before any caller + calls ref on it. + +2010-06-16 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Enable HTML5 Parser in Safari on Mac + https://bugs.webkit.org/show_bug.cgi?id=40739 + + The HTML5 parser is probably off on all webkit ports. + We should either flip the meaning of the default so that + "false" means HTML5 on all ports, or we'll have to write + more code like this for all the other ports. + + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): + +2010-06-15 Mark Rowe <mrowe@apple.com> + + Reviewed by Sam Weinig. + + Don't leak WebGeolocationPositionInternal and GeolocationPosition instances for every WebGeolocationPosition created. + + * WebView/WebGeolocationPosition.mm: + (-[WebGeolocationPosition dealloc]): Implement -dealloc and release our WebGeolocationPositionInternal instance. + +2010-06-10 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Implement render style selection for pages to support CSS3 Paged Media. + https://bugs.webkit.org/show_bug.cgi?id=35961 + + * Misc/WebCoreStatistics.h: + * Misc/WebCoreStatistics.mm: + (-[WebFrame pageProperty:propertyName:]): + +2010-06-15 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions out of Frame class that were marked "move to Chrome" + https://bugs.webkit.org/show_bug.cgi?id=39636 + + * WebView/WebView.mm: + (-[WebView shouldClose]): Call shouldClose on FrameLoader instead of + going through Frame. + +2010-06-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Remove getPluginInfoFromBundleAndMIMEDictionary: + + * Plugins/WebBasePluginPackage.mm: + +2010-06-15 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Fold getPluginInfoFromBundleAndMIMEDictionary: into its sole caller. + + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage getPluginInfoFromPLists]): + +2010-06-11 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Darin Adler. + + <rdar://problem/8084721> Pages using accelerated compositing fail to update correctly in Carbon apps + + The run loop observer used to commit compositing layer changes does not do + updates if [window viewsNeedDisplay] is true, because this indicates that a delayed window + update is pending (added in r58623). + + However, Carbon apps don't use the NSWindow updating mechanism, so [window viewsNeedDisplay] always returns YES. + This caused us to never sync compositing layers. + + So detect if the current window is wrapping a carbon window, and in that case consult the root + HIView to detect if display is pending. + + * WebView/WebView.mm: + (layerSyncRunLoopObserverCallBack): + +2010-06-15 Dan Bernstein <mitz@apple.com> + + Reviewed by John Sullivan. + + <rdar://problem/8077032> REGRESSION (r50796): Black background on AppleScript generated email + + Test: platform/mac/editing/input/NSBackgroundColor-transparent.html + + r50796 changed the initial background color from invalid to transparent. As a result, + NSAttributedStrings returned from +_web_attributedStringFromRange started including the + NSBackgroundColor attribute, with a transparent color as the value. This caused problems for + components in the system that ignore the alpha component, turning the color into opaque black. + + * Misc/WebNSAttributedStringExtras.mm: + (+[NSAttributedString _web_attributedStringFromRange:]): Change to not include the background + and foreground color attributes if the color are transparent. + 2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 5b52793..08d9ef9 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -57,6 +57,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION; ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; ENABLE_IMAGE_RESIZER = ; ENABLE_INDEXED_DATABASE = ; +ENABLE_INPUT_SPEECH = ; ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; ENABLE_MATHML = ; ENABLE_METER_TAG = ENABLE_METER_TAG; @@ -81,4 +82,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index 6f999af..f775a54 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 1; +MINOR_VERSION = 2; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm index 2bda67a..194a000 100644 --- a/WebKit/mac/DOM/WebDOMOperations.mm +++ b/WebKit/mac/DOM/WebDOMOperations.mm @@ -53,11 +53,20 @@ using namespace WebCore; return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self))] autorelease]; } +@end + +@implementation DOMNode (WebDOMNodeOperationsPendingPublic) + - (NSString *)markupString { return createFullMarkup(core(self)); } +- (NSRect)_renderRect:(bool *)isReplaced +{ + return NSRect(core(self)->renderRect(isReplaced)); +} + @end /* This doesn't appear to be used by anyone. We should consider removing this. */ diff --git a/WebKit/mac/DOM/WebDOMOperationsPrivate.h b/WebKit/mac/DOM/WebDOMOperationsPrivate.h index 013a687..826aa7d 100644 --- a/WebKit/mac/DOM/WebDOMOperationsPrivate.h +++ b/WebKit/mac/DOM/WebDOMOperationsPrivate.h @@ -34,4 +34,5 @@ @interface DOMNode (WebDOMNodeOperationsPendingPublic) - (NSString *)markupString; +- (NSRect)_renderRect:(bool *)isReplaced; @end diff --git a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m index 6de2792..bad87d5 100644 --- a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m +++ b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m @@ -60,7 +60,7 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil; - (void)webView: (WebView *)wv decidePolicyForMIMEType:(NSString *)type request:(NSURLRequest *)request frame:(WebFrame *)frame - decisionListener:(id <WebPolicyDecisionListener>)listener; + decisionListener:(id <WebPolicyDecisionListener>)listener { if ([[request URL] isFileURL]) { BOOL isDirectory = NO; diff --git a/WebKit/mac/Misc/WebCoreStatistics.h b/WebKit/mac/Misc/WebCoreStatistics.h index a11c064..e357b72 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.h +++ b/WebKit/mac/Misc/WebCoreStatistics.h @@ -87,4 +87,8 @@ - (NSString *)counterValueForElement:(DOMElement*)element; - (int)pageNumberForElement:(DOMElement*)element:(float)pageWidthInPixels:(float)pageHeightInPixels; - (int)numberOfPages:(float)pageWidthInPixels:(float)pageHeightInPixels; +- (NSString *)pageProperty:(const char*)propertyName:(int)pageNumber; +- (bool)isPageBoxVisible:(int)pageNumber; +- (NSString *)pageAreaRectInPixels:(int)pageNumber; +- (NSString *)preferredPageSizeInPixels:(int)pageNumber; @end diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm index c3fc23e..9112d21 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/WebKit/mac/Misc/WebCoreStatistics.mm @@ -275,4 +275,23 @@ using namespace WebCore; return PrintContext::numberOfPages(_private->coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels)); } +- (NSString *)pageProperty:(const char *)propertyName:(int)pageNumber +{ + return PrintContext::pageProperty(_private->coreFrame, propertyName, pageNumber); +} + +- (bool)isPageBoxVisible:(int)pageNumber +{ + return PrintContext::isPageBoxVisible(_private->coreFrame, pageNumber); +} + +- (NSString *)pageAreaRectInPixels:(int)pageNumber +{ + return PrintContext::pageAreaRectInPixels(_private->coreFrame, pageNumber); +} + +- (NSString *)preferredPageSizeInPixels:(int)pageNumber; +{ + return PrintContext::preferredPageSizeInPixels(_private->coreFrame, pageNumber); +} @end diff --git a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm index 35b2524..2469da8 100644 --- a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm +++ b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm @@ -154,11 +154,11 @@ static NSFileWrapper *fileWrapperForElement(Element* e) RenderStyle* style = renderer->style(); NSFont *font = style->font().primaryFont()->getNSFont(); [attrs.get() setObject:font forKey:NSFontAttributeName]; - if (style->visitedDependentColor(CSSPropertyColor).isValid()) + if (style->visitedDependentColor(CSSPropertyColor).alpha()) [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSForegroundColorAttributeName]; - if (style->visitedDependentColor(CSSPropertyBackgroundColor).isValid()) + if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha()) [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName]; else [attrs.get() removeObjectForKey:NSBackgroundColorAttributeName]; diff --git a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm index 98b5a7e..25e5462 100644 --- a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm +++ b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm @@ -256,7 +256,7 @@ NSError *HostedNetscapePluginStream::pluginCancelledConnectionError() const return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get() pluginPageURL:nil - pluginName:[[m_instance->pluginView() pluginPackage] name] + pluginName:[[m_instance->pluginView() pluginPackage] pluginInfo].name MIMEType:m_mimeType.get()] autorelease]; } diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h index e62d87a..e1f02ac 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h @@ -28,11 +28,12 @@ #ifndef NetscapePluginHostManager_h #define NetscapePluginHostManager_h +#import <WebCore/PlatformString.h> +#import <WebCore/StringHash.h> #import <wtf/HashMap.h> #import <wtf/PassRefPtr.h> @class WebHostedNetscapePluginView; -@class WebNetscapePluginPackage; namespace WebKit { @@ -43,28 +44,28 @@ class NetscapePluginHostManager { public: static NetscapePluginHostManager& shared(); - PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); + PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled); void pluginHostDied(NetscapePluginHostProxy*); - static void createPropertyListFile(WebNetscapePluginPackage *); + static void createPropertyListFile(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture); void didCreateWindow(); private: - NetscapePluginHostProxy* hostForPackage(WebNetscapePluginPackage *, bool useProxiedOpenPanel); + NetscapePluginHostProxy* hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, bool useProxiedOpenPanel); NetscapePluginHostManager(); ~NetscapePluginHostManager(); - bool spawnPluginHost(WebNetscapePluginPackage *, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); + bool spawnPluginHost(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel); bool initializeVendorPort(); mach_port_t m_pluginVendorPort; // FIXME: This should really be a HashMap of RetainPtrs, but that doesn't work right now. - typedef HashMap<WebNetscapePluginPackage*, NetscapePluginHostProxy*> PluginHostMap; + typedef HashMap<WebCore::String, NetscapePluginHostProxy*> PluginHostMap; PluginHostMap m_pluginHosts; }; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm index e4177f5..baec6ba 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm @@ -48,6 +48,7 @@ extern "C" { } using namespace std; +using namespace WebCore; namespace WebKit { @@ -58,7 +59,7 @@ NetscapePluginHostManager& NetscapePluginHostManager::shared() return pluginHostManager; } -static const NSString *pluginHostAppName = @"WebKitPluginHost.app"; +static NSString * const pluginHostAppName = @"WebKitPluginHost.app"; NetscapePluginHostManager::NetscapePluginHostManager() : m_pluginVendorPort(MACH_PORT_NULL) @@ -69,9 +70,9 @@ NetscapePluginHostManager::~NetscapePluginHostManager() { } -NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePluginPackage *package, bool useProxiedOpenPanel) +NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel) { - pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(package, 0); + pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(pluginPath, 0); // The package was already in the map, just return it. if (!result.second) @@ -85,7 +86,7 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl mach_port_t pluginHostPort; ProcessSerialNumber pluginHostPSN; - if (!spawnPluginHost(package, clientPort, pluginHostPort, pluginHostPSN, useProxiedOpenPanel)) { + if (!spawnPluginHost(pluginPath, pluginArchitecture, clientPort, pluginHostPort, pluginHostPSN, useProxiedOpenPanel)) { mach_port_destroy(mach_task_self(), clientPort); m_pluginHosts.remove(result.first); return 0; @@ -93,17 +94,16 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl // Since Flash NPObjects add methods dynamically, we don't want to cache when a property/method doesn't exist // on an object because it could be added later. - bool shouldCacheMissingPropertiesAndMethods = ![[[package bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]; + bool shouldCacheMissingPropertiesAndMethods = bundleIdentifier != "com.macromedia.Flash Player.plugin"; NetscapePluginHostProxy* hostProxy = new NetscapePluginHostProxy(clientPort, pluginHostPort, pluginHostPSN, shouldCacheMissingPropertiesAndMethods); - CFRetain(package); result.first->second = hostProxy; return hostProxy; } -bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *package, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel) +bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel) { if (m_pluginVendorPort == MACH_PORT_NULL) { if (!initializeVendorPort()) @@ -121,7 +121,7 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag NSDictionary *launchProperties = [[NSDictionary alloc] initWithObjectsAndKeys: pluginHostAppExecutablePath, @"pluginHostPath", - [NSNumber numberWithInt:[package pluginHostArchitecture]], @"cpuType", + [NSNumber numberWithInt:pluginArchitecture], @"cpuType", localization.get(), @"localization", [NSNumber numberWithBool:useProxiedOpenPanel], @"useProxiedOpenPanel", nil]; @@ -152,11 +152,11 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag NSString *visibleName = [NSString stringWithFormat:UI_STRING("%@ (%@ Internet plug-in)", "visible name of the plug-in host process. The first argument is the plug-in name " "and the second argument is the application name."), - [[package filename] stringByDeletingPathExtension], [[NSProcessInfo processInfo] processName]]; + [[(NSString*)pluginPath lastPathComponent] stringByDeletingPathExtension], [[NSProcessInfo processInfo] processName]]; NSDictionary *hostProperties = [[NSDictionary alloc] initWithObjectsAndKeys: visibleName, @"visibleName", - [package path], @"bundlePath", + (NSString *)pluginPath, @"bundlePath", nil]; data = [NSPropertyListSerialization dataFromPropertyList:hostProperties format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil]; @@ -215,10 +215,10 @@ void NetscapePluginHostManager::pluginHostDied(NetscapePluginHostProxy* pluginHo } } -PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled) +PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled) { WebPreferences *preferences = [[pluginView webView] preferences]; - NetscapePluginHostProxy* hostProxy = hostForPackage(pluginPackage, [preferences usesProxiedOpenPanel]); + NetscapePluginHostProxy* hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]); if (!hostProxy) return 0; @@ -257,7 +257,7 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl pluginHostDied(hostProxy); // Try to spawn it again. - hostProxy = hostForPackage(pluginPackage, [preferences usesProxiedOpenPanel]); + hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]); // Create a new instance. instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame); @@ -277,11 +277,11 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl return instance.release(); } -void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage *package) +void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture) { NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName]; NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath]; - NSString *bundlePath = [package path]; + NSString *bundlePath = pluginPath; pid_t pid; posix_spawnattr_t attr; @@ -289,7 +289,7 @@ void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage // Set the architecture. size_t ocount = 0; - int cpuTypes[1] = { [package pluginHostArchitecture] }; + int cpuTypes[] = { pluginArchitecture }; posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &ocount); // Spawn the plug-in host and tell it to call the registration function. diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h index d35503f..20db5d2 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h @@ -84,11 +84,7 @@ private: mach_port_t m_clientPort; mach_port_t m_portSet; -#ifdef USE_LIBDISPATCH - dispatch_source_t m_clientPortSource; -#else RetainPtr<CFRunLoopSourceRef> m_clientPortSource; -#endif mach_port_t m_pluginHostPort; RetainPtr<CFMachPortRef> m_deadNameNotificationPort; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm index 1d4cdad..8e1c2df 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm @@ -116,15 +116,9 @@ NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_po CFRunLoopAddSource(CFRunLoopGetCurrent(), deathPortSource.get(), kCFRunLoopDefaultMode); -#ifdef USE_LIBDISPATCH - // FIXME: Unfortunately we can't use a dispatch source here until <rdar://problem/6393180> has been resolved. - m_clientPortSource = dispatch_source_mig_create(m_clientPort, WKWebKitPluginClient_subsystem.maxsize, 0, - dispatch_get_main_queue(), WebKitPluginClient_server); -#else m_clientPortSource.adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKWebKitPluginClient_subsystem, m_clientPort)); CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), kCFRunLoopDefaultMode); CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSEventTrackingRunLoopMode); -#endif } NetscapePluginHostProxy::~NetscapePluginHostProxy() @@ -139,12 +133,8 @@ NetscapePluginHostProxy::~NetscapePluginHostProxy() } ASSERT(m_clientPortSource); -#ifdef USE_LIBDISPATCH - dispatch_release(m_clientPortSource); -#else CFRunLoopSourceInvalidate(m_clientPortSource.get()); m_clientPortSource = 0; -#endif } void NetscapePluginHostProxy::pluginHostDied() diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 7391c1e..5900b02 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -61,10 +61,7 @@ class ProxyInstance; class NetscapePluginInstanceProxy : public RefCounted<NetscapePluginInstanceProxy> { public: - static PassRefPtr<NetscapePluginInstanceProxy> create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin) - { - return adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin)); - } + static PassRefPtr<NetscapePluginInstanceProxy> create(NetscapePluginHostProxy*, WebHostedNetscapePluginView *, bool fullFramePlugin); ~NetscapePluginInstanceProxy(); uint32_t pluginID() const diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index 9c90dae..ca012ee 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -237,14 +237,19 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy do { m_pluginID = ++pluginIDCounter; } while (pluginHostProxy->pluginInstance(m_pluginID) || !m_pluginID); - - pluginHostProxy->addPluginInstance(this); #ifndef NDEBUG netscapePluginInstanceProxyCounter.increment(); #endif } +PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginInstanceProxy::create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin) +{ + RefPtr<NetscapePluginInstanceProxy> proxy = adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin)); + pluginHostProxy->addPluginInstance(proxy.get()); + return proxy.release(); +} + NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy() { ASSERT(!m_pluginHostProxy); diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index 6917e5f..e743722 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -111,7 +111,7 @@ extern "C" { accleratedCompositingEnabled = [[[self webView] preferences] acceleratedCompositingEnabled]; #endif - _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), + _proxy = NetscapePluginHostManager::shared().instantiatePlugin([_pluginPackage.get() path], [_pluginPackage.get() pluginHostArchitecture], [_pluginPackage.get() bundleIdentifier], self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(), _mode == NP_FULL, _isPrivateBrowsingEnabled, accleratedCompositingEnabled); if (!_proxy) return NO; diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm index 7322d31..07d1d4f 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm @@ -104,7 +104,7 @@ NSError *WebNetscapePluginStream::pluginCancelledConnectionError() const return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get() pluginPageURL:nil - pluginName:[[m_pluginView.get() pluginPackage] name] + pluginName:[[m_pluginView.get() pluginPackage] pluginInfo].name MIMEType:m_mimeType.get()] autorelease]; } diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index a75251e..bcef2a1 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -108,7 +108,7 @@ bool WebHaltablePlugin::isWindowed() const String WebHaltablePlugin::pluginName() const { - return [[m_view pluginPackage] name]; + return [[m_view pluginPackage] pluginInfo].name; } @implementation WebBaseNetscapePluginView @@ -146,7 +146,7 @@ String WebHaltablePlugin::pluginName() const #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) // Enable "kiosk mode" when instantiating the QT plug-in inside of Dashboard. See <rdar://problem/6878105> if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.dashboard.client"] && - [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.apple.QuickTime Plugin.plugin"]) { + [_pluginPackage.get() bundleIdentifier] == "com.apple.QuickTime Plugin.plugin") { RetainPtr<NSMutableArray> mutableKeys(AdoptNS, [keys mutableCopy]); RetainPtr<NSMutableArray> mutableValues(AdoptNS, [values mutableCopy]); @@ -578,20 +578,7 @@ String WebHaltablePlugin::pluginName() const - (BOOL)supportsSnapshotting { - NSBundle *pluginBundle = [_pluginPackage.get() bundle]; - if (![[pluginBundle bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]) - return YES; - - // Flash has a bogus Info.plist entry for CFBundleVersionString, so use CFBundleShortVersionString. - NSString *versionString = [pluginBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"]; - - static const NSString *flash10dotOnePrefix = @"10.1"; - if (![versionString hasPrefix:flash10dotOnePrefix]) - return YES; - - // Some prerelease versions of Flash 10.1 crash when sent a drawRect event using the CA drawing model: <rdar://problem/7739922> - static const CFStringRef knownGoodFlash10dot1Release = CFSTR("10.1.53.60"); - return CFStringCompare((CFStringRef)versionString, knownGoodFlash10dot1Release, kCFCompareNumerically) != kCFCompareLessThan; + return [_pluginPackage.get() supportsSnapshotting]; } - (BOOL)hasBeenHalted @@ -930,7 +917,7 @@ String WebHaltablePlugin::pluginName() const } -- (CString)resolvedURLStringForURL:(const char*)url target:(const char*)target; +- (CString)resolvedURLStringForURL:(const char*)url target:(const char*)target { String relativeURLString = String::fromUTF8(url); if (relativeURLString.isNull()) diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.h b/WebKit/mac/Plugins/WebBasePluginPackage.h index 1082551..ca2ddcd 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.h +++ b/WebKit/mac/Plugins/WebBasePluginPackage.h @@ -26,7 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#import <WebCore/WebCoreViewFactory.h> +#import <WebCore/PluginData.h> +#import <wtf/RetainPtr.h> #if ENABLE(NETSCAPE_PLUGIN_API) #import <WebKit/npfunctions.h> @@ -52,21 +53,15 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); #define WebPluginTypeDescriptionKey @"WebPluginTypeDescription" #define WebPluginTypeEnabledKey @"WebPluginTypeEnabled" -@interface WebBasePluginPackage : NSObject <WebCorePluginInfo> +@interface WebBasePluginPackage : NSObject { NSMutableSet *pluginDatabases; - NSString *name; - NSString *path; - NSString *pluginDescription; + WebCore::String path; + WebCore::PluginInfo pluginInfo; - NSBundle *bundle; - CFBundleRef cfBundle; + RetainPtr<CFBundleRef> cfBundle; - NSDictionary *MIMEToDescription; - NSDictionary *MIMEToExtensions; - NSMutableDictionary *extensionToMIME; - BP_CreatePluginMIMETypesPreferencesFuncPtr BP_CreatePluginMIMETypesPreferences; } @@ -78,23 +73,16 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void); - (BOOL)load; - (void)unload; -- (NSString *)name; -- (NSString *)path; -- (NSString *)filename; -- (NSString *)pluginDescription; -- (NSBundle *)bundle; - -- (NSEnumerator *)extensionEnumerator; -- (NSEnumerator *)MIMETypeEnumerator; -- (NSString *)descriptionForMIMEType:(NSString *)MIMEType; -- (NSString *)MIMETypeForExtension:(NSString *)extension; -- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType; - -- (void)setName:(NSString *)theName; -- (void)setPath:(NSString *)thePath; -- (void)setPluginDescription:(NSString *)description; -- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary; -- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary; +- (const WebCore::String&)path; + +- (const WebCore::PluginInfo&)pluginInfo; + +- (WebCore::String)bundleIdentifier; + +- (BOOL)supportsExtension:(const WebCore::String&)extension; +- (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType; + +- (NSString *)MIMETypeForExtension:(const WebCore::String&)extension; - (BOOL)isQuickTimePlugIn; - (BOOL)isJavaPlugIn; diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm index f186b81..70e5889 100644 --- a/WebKit/mac/Plugins/WebBasePluginPackage.mm +++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -28,6 +28,7 @@ #import <WebKit/WebBasePluginPackage.h> +#import <algorithm> #import <WebCore/WebCoreObjCExtras.h> #import <WebKit/WebKitNSStringExtras.h> #import <WebKit/WebNSObjectExtras.h> @@ -47,18 +48,20 @@ #import <mach-o/fat.h> #import <mach-o/loader.h> +#define JavaCocoaPluginIdentifier "com.apple.JavaPluginCocoa" +#define JavaCarbonPluginIdentifier "com.apple.JavaAppletPlugin" +#define JavaCFMPluginFilename "Java Applet Plugin Enabler" -#define JavaCocoaPluginIdentifier @"com.apple.JavaPluginCocoa" -#define JavaCarbonPluginIdentifier @"com.apple.JavaAppletPlugin" -#define JavaCFMPluginFilename @"Java Applet Plugin Enabler" - -#define QuickTimeCarbonPluginIdentifier @"com.apple.QuickTime Plugin.plugin" -#define QuickTimeCocoaPluginIdentifier @"com.apple.quicktime.webplugin" +#define QuickTimeCarbonPluginIdentifier "com.apple.QuickTime Plugin.plugin" +#define QuickTimeCocoaPluginIdentifier "com.apple.quicktime.webplugin" @interface NSArray (WebPluginExtensions) - (NSArray *)_web_lowercaseStrings; @end; +using namespace std; +using namespace WebCore; + @implementation WebBasePluginPackage + (void)initialize @@ -91,7 +94,7 @@ return WebCFAutorelease(WKCopyCFLocalizationPreferredName(NULL)); } -- (NSString *)pathByResolvingSymlinksAndAliasesInPath:(NSString *)thePath +static NSString *pathByResolvingSymlinksAndAliases(NSString *thePath) { NSString *newPath = [thePath stringByResolvingSymlinksInPath]; @@ -122,80 +125,20 @@ if (!(self = [super init])) return nil; - path = [[self pathByResolvingSymlinksAndAliasesInPath:pluginPath] retain]; - bundle = [[NSBundle alloc] initWithPath:path]; + path = pathByResolvingSymlinksAndAliases(pluginPath); + cfBundle.adoptCF(CFBundleCreate(kCFAllocatorDefault, (CFURLRef)[NSURL fileURLWithPath:path])); + #ifndef __ppc__ // 32-bit PowerPC is the only platform where non-bundled CFM plugins are supported - if (!bundle) { + if (!cfBundle) { [self release]; return nil; } #endif - cfBundle = CFBundleCreate(NULL, (CFURLRef)[NSURL fileURLWithPath:path]); - extensionToMIME = [[NSMutableDictionary alloc] init]; return self; } -- (BOOL)getPluginInfoFromBundleAndMIMEDictionary:(NSDictionary *)MIMETypes -{ - if (!bundle) - return NO; - - if (!MIMETypes) { - MIMETypes = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesKey]; - if (!MIMETypes) - return NO; - } - - NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary]; - NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary]; - NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator]; - NSDictionary *MIMEDictionary; - NSString *MIME, *description; - NSArray *extensions; - - while ((MIME = [keyEnumerator nextObject]) != nil) { - MIMEDictionary = [MIMETypes objectForKey:MIME]; - - // FIXME: Consider storing disabled MIME types. - NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey]; - if (isEnabled && [isEnabled boolValue] == NO) - continue; - - extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings]; - if ([extensions count] == 0) - extensions = [NSArray arrayWithObject:@""]; - - MIME = [MIME lowercaseString]; - - [MIMEToExtensionsDictionary setObject:extensions forKey:MIME]; - - description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey]; - if (!description) - description = @""; - - [MIMEToDescriptionDictionary setObject:description forKey:MIME]; - } - - [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary]; - [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary]; - - NSString *filename = [self filename]; - - NSString *theName = [bundle objectForInfoDictionaryKey:WebPluginNameKey]; - if (!theName) - theName = filename; - [self setName:theName]; - - description = [bundle objectForInfoDictionaryKey:WebPluginDescriptionKey]; - if (!description) - description = filename; - [self setPluginDescription:description]; - - return YES; -} - - (void)unload { } @@ -225,13 +168,22 @@ return pList; } +- (id)_objectForInfoDictionaryKey:(NSString *)key +{ + CFDictionaryRef bundleInfoDictionary = CFBundleGetInfoDictionary(cfBundle.get()); + if (!bundleInfoDictionary) + return nil; + + return (id)CFDictionaryGetValue(bundleInfoDictionary, key); +} + - (BOOL)getPluginInfoFromPLists { - if (!bundle) + if (!cfBundle) return NO; NSDictionary *MIMETypes = nil; - NSString *pListFilename = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesFilenameKey]; + NSString *pListFilename = [self _objectForInfoDictionaryKey:WebPluginMIMETypesFilenameKey]; // Check if the MIME types are claimed in a plist in the user's preferences directory. if (pListFilename) { @@ -247,15 +199,65 @@ // Plist doesn't exist, ask the plug-in to create it. MIMETypes = [[self pListForPath:pListPath createFile:YES] objectForKey:WebPluginMIMETypesKey]; } - - // Pass the MIME dictionary to the superclass to parse it. - return [self getPluginInfoFromBundleAndMIMEDictionary:MIMETypes]; + + if (!MIMETypes) { + MIMETypes = [self _objectForInfoDictionaryKey:WebPluginMIMETypesKey]; + if (!MIMETypes) + return NO; + } + + NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator]; + NSDictionary *MIMEDictionary; + NSString *MIME, *description; + NSArray *extensions; + + while ((MIME = [keyEnumerator nextObject]) != nil) { + MIMEDictionary = [MIMETypes objectForKey:MIME]; + + // FIXME: Consider storing disabled MIME types. + NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey]; + if (isEnabled && [isEnabled boolValue] == NO) + continue; + + MimeClassInfo mimeClassInfo; + + extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings]; + for (NSUInteger i = 0; i < [extensions count]; ++i) + mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:i]); + + if ([extensions count] == 0) + extensions = [NSArray arrayWithObject:@""]; + + mimeClassInfo.type = String(MIME).lower(); + + description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey]; + mimeClassInfo.desc = description; + + pluginInfo.mimes.append(mimeClassInfo); + if (!description) + description = @""; + } + + NSString *filename = [(NSString *)path lastPathComponent]; + pluginInfo.file = filename; + + NSString *theName = [self _objectForInfoDictionaryKey:WebPluginNameKey]; + if (!theName) + theName = filename; + pluginInfo.name = theName; + + description = [self _objectForInfoDictionaryKey:WebPluginDescriptionKey]; + if (!description) + description = filename; + pluginInfo.desc = description; + + return YES; } - (BOOL)load { - if (bundle && !BP_CreatePluginMIMETypesPreferences) - BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("BP_CreatePluginMIMETypesPreferences")); + if (cfBundle && !BP_CreatePluginMIMETypesPreferences) + BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("BP_CreatePluginMIMETypesPreferences")); return YES; } @@ -265,18 +267,6 @@ ASSERT(!pluginDatabases || [pluginDatabases count] == 0); [pluginDatabases release]; - [name release]; - [path release]; - [pluginDescription release]; - - [MIMEToDescription release]; - [MIMEToExtensions release]; - [extensionToMIME release]; - - [bundle release]; - if (cfBundle) - CFRelease(cfBundle); - [super dealloc]; } @@ -286,128 +276,71 @@ ASSERT(!pluginDatabases || [pluginDatabases count] == 0); [pluginDatabases release]; - if (cfBundle) - CFRelease(cfBundle); - [super finalize]; } -- (NSString *)name -{ - return name; -} - -- (NSString *)path +- (const String&)path { return path; } -- (NSString *)filename -{ - return [path lastPathComponent]; -} - -- (NSString *)pluginDescription +- (const PluginInfo&)pluginInfo { - return pluginDescription; + return pluginInfo; } -- (NSEnumerator *)extensionEnumerator +- (BOOL)supportsExtension:(const String&)extension { - return [extensionToMIME keyEnumerator]; -} - -- (NSEnumerator *)MIMETypeEnumerator -{ - return [MIMEToExtensions keyEnumerator]; -} - -- (NSString *)descriptionForMIMEType:(NSString *)MIMEType -{ - return [MIMEToDescription objectForKey:MIMEType]; -} - -- (NSString *)MIMETypeForExtension:(NSString *)extension -{ - return [extensionToMIME objectForKey:extension]; -} - -- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType -{ - return [MIMEToExtensions objectForKey:MIMEType]; -} - -- (NSBundle *)bundle -{ - return bundle; -} - -- (void)setName:(NSString *)theName -{ - [name release]; - name = [theName retain]; -} + ASSERT(extension.lower() == extension); + + for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) { + const Vector<String>& extensions = pluginInfo.mimes[i].extensions; -- (void)setPath:(NSString *)thePath -{ - [path release]; - path = [thePath retain]; -} + if (find(extensions.begin(), extensions.end(), extension) != extensions.end()) + return YES; + } -- (void)setPluginDescription:(NSString *)description -{ - [pluginDescription release]; - pluginDescription = [description retain]; + return NO; } -- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary +- (BOOL)supportsMIMEType:(const WebCore::String&)mimeType { - [MIMEToDescription release]; - MIMEToDescription = [MIMEToDescriptionDictionary retain]; + ASSERT(mimeType.lower() == mimeType); + + for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) { + if (pluginInfo.mimes[i].type == mimeType) + return YES; + } + + return NO; } -- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary +- (NSString *)MIMETypeForExtension:(const String&)extension { - [MIMEToExtensions release]; - MIMEToExtensions = [MIMEToExtensionsDictionary retain]; - - // Reverse the mapping - [extensionToMIME removeAllObjects]; - - NSEnumerator *MIMEEnumerator = [MIMEToExtensions keyEnumerator], *extensionEnumerator; - NSString *MIME, *extension; - NSArray *extensions; + ASSERT(extension.lower() == extension); - while ((MIME = [MIMEEnumerator nextObject]) != nil) { - extensions = [MIMEToExtensions objectForKey:MIME]; - extensionEnumerator = [extensions objectEnumerator]; - - while ((extension = [extensionEnumerator nextObject]) != nil) { - if (![extension isEqualToString:@""]) - [extensionToMIME setObject:MIME forKey:extension]; - } + for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) { + const MimeClassInfo& mimeClassInfo = pluginInfo.mimes[i]; + const Vector<String>& extensions = mimeClassInfo.extensions; + + if (find(extensions.begin(), extensions.end(), extension) != extensions.end()) + return mimeClassInfo.type; } -} -- (NSString *)description -{ - return [NSString stringWithFormat:@"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@", - name, path, [MIMEToExtensions description], [MIMEToDescription description], pluginDescription]; + return nil; } - (BOOL)isQuickTimePlugIn { - NSString *bundleIdentifier = [[self bundle] bundleIdentifier]; - return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCarbonPluginIdentifier] || - [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCocoaPluginIdentifier]; + const String& bundleIdentifier = [self bundleIdentifier]; + return bundleIdentifier == QuickTimeCocoaPluginIdentifier || bundleIdentifier == QuickTimeCocoaPluginIdentifier; } - (BOOL)isJavaPlugIn { - NSString *bundleIdentifier = [[self bundle] bundleIdentifier]; - return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCocoaPluginIdentifier] || - [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCarbonPluginIdentifier] || - [[path lastPathComponent] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename]; + const String& bundleIdentifier = [self bundleIdentifier]; + return bundleIdentifier == JavaCocoaPluginIdentifier || bundleIdentifier == JavaCarbonPluginIdentifier || + equalIgnoringCase(pluginInfo.file, JavaCFMPluginFilename); } static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) @@ -492,7 +425,7 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) - (UInt32)versionNumber { // CFBundleGetVersionNumber doesn't work with all possible versioning schemes, but we think for now it's good enough for us. - return CFBundleGetVersionNumber(cfBundle); + return CFBundleGetVersionNumber(cfBundle.get()); } - (void)wasAddedToPluginDatabase:(WebPluginDatabase *)database @@ -512,6 +445,11 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length) [pluginDatabases removeObject:database]; } +- (WebCore::String)bundleIdentifier +{ + return CFBundleGetIdentifier(cfBundle.get()); +} + @end @implementation NSArray (WebPluginExtensions) diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.h b/WebKit/mac/Plugins/WebNetscapePluginPackage.h index 1d4c893..445c3bb 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.h +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.h @@ -77,6 +77,8 @@ typedef enum { - (WebExecutableType)executableType; - (NPPluginFuncs *)pluginFuncs; +- (BOOL)supportsSnapshotting; + #if USE(PLUGIN_HOST_PROCESS) - (cpu_type_t)pluginHostArchitecture; #endif diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm index 5651e7e..7ca1121 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm @@ -29,12 +29,14 @@ #if ENABLE(NETSCAPE_PLUGIN_API) #import "WebNetscapePluginPackage.h" +#import "WebTypesInternal.h" #import "WebKitLogging.h" #import "WebKitNSStringExtras.h" #import "WebNSFileManagerExtras.h" #import "WebNSObjectExtras.h" #import "WebNetscapeDeprecatedFunctions.h" #import <WebCore/npruntime_impl.h> +#import <wtf/RetainPtr.h> #if USE(PLUGIN_HOST_PROCESS) #import "NetscapePluginHostManager.h" @@ -42,6 +44,8 @@ using namespace WebKit; #endif +using namespace WebCore; + #ifdef SUPPORT_CFM typedef void (* FunctionPointer)(void); typedef void (* TransitionVector)(void); @@ -54,7 +58,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #define MIMEListStringStringNumber 128 #define RealPlayerAppIndentifier @"com.RealNetworks.RealOne Player" -#define RealPlayerPluginFilename @"RealPlayer Plugin" +#define RealPlayerPluginFilename "RealPlayer Plugin" @interface WebNetscapePluginPackage (Internal) - (void)_unloadWithShutdown:(BOOL)shutdown; @@ -95,7 +99,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #ifdef SUPPORT_CFM if (!isBundle) { FSRef fref; - OSErr err = FSPathMakeRef((const UInt8 *)[path fileSystemRepresentation], &fref, NULL); + OSErr err = FSPathMakeRef((const UInt8 *)[(NSString *)path fileSystemRepresentation], &fref, NULL); if (err != noErr) return -1; @@ -103,7 +107,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); } #endif - return CFBundleOpenBundleResourceMap(cfBundle); + return CFBundleOpenBundleResourceMap(cfBundle.get()); } - (void)closeResourceFile:(ResFileRefNum)resRef @@ -115,7 +119,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); } #endif - CFBundleCloseBundleResourceMap(cfBundle, resRef); + CFBundleCloseBundleResourceMap(cfBundle.get(), resRef); } - (NSString *)stringForStringListID:(SInt16)stringListID andIndex:(SInt16)index @@ -156,46 +160,42 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); NSArray *extensions; unsigned i; - NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary]; - NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary]; - for (i=1; 1; i+=2) { MIME = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i] lowercaseString]; if (!MIME) break; + MimeClassInfo mimeClassInfo; + mimeClassInfo.type = String(MIME).lower(); + extensionsList = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i+1] lowercaseString]; if (extensionsList) { extensions = [extensionsList componentsSeparatedByString:@","]; - [MIMEToExtensionsDictionary setObject:extensions forKey:MIME]; - } else - // DRM and WMP claim MIMEs without extensions. Use a @"" extension in this case. - [MIMEToExtensionsDictionary setObject:[NSArray arrayWithObject:@""] forKey:MIME]; + for (NSUInteger j = 0; j < [extensions count]; ++j) + mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:j]); + } description = [self stringForStringListID:MIMEDescriptionStringNumber - andIndex:[MIMEToExtensionsDictionary count]]; - if (description) - [MIMEToDescriptionDictionary setObject:description forKey:MIME]; - else - [MIMEToDescriptionDictionary setObject:@"" forKey:MIME]; - } + andIndex:pluginInfo.mimes.size() + 1]; + mimeClassInfo.desc = description; - [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary]; - [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary]; + pluginInfo.mimes.append(mimeClassInfo); + } - NSString *filename = [self filename]; + NSString *filename = [(NSString *)path lastPathComponent]; + pluginInfo.file = filename; description = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:1]; if (!description) description = filename; - [self setPluginDescription:description]; + pluginInfo.desc = description; NSString *theName = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:2]; if (!theName) theName = filename; - [self setName:theName]; + pluginInfo.name = theName; [self closeResourceFile:resRef]; @@ -208,9 +208,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); OSType type = 0; - if (bundle) { + if (cfBundle) { // Bundle - CFBundleGetPackageInfo(cfBundle, &type, NULL); + CFBundleGetPackageInfo(cfBundle.get(), &type, NULL); #ifdef SUPPORT_CFM isBundle = YES; #endif @@ -230,8 +230,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); return NO; // Check if the executable is Mach-O or CFM. - if (bundle) { - NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]]; + if (cfBundle) { + RetainPtr<CFURLRef> executableURL(AdoptCF, CFBundleCopyExecutableURL(cfBundle.get())); + if (!executableURL) + return NO; + NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[(NSURL *)executableURL.get() path]]; NSData *data = [executableFile readDataOfLength:512]; [executableFile closeFile]; // Check the length of the data before calling memcmp. We think this fixes 3782543. @@ -246,11 +249,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #endif #if USE(PLUGIN_HOST_PROCESS) - NSArray *archs = [bundle executableArchitectures]; + RetainPtr<CFArrayRef> archs(AdoptCF, CFBundleCopyExecutableArchitectures(cfBundle.get())); - if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) + if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]]) pluginHostArchitecture = CPU_TYPE_X86_64; - else if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) + else if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]]) pluginHostArchitecture = CPU_TYPE_X86; else return NO; @@ -299,7 +302,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); - (void)createPropertyListFile { - NetscapePluginHostManager::createPropertyListFile(self); + NetscapePluginHostManager::createPropertyListFile(path, pluginHostArchitecture); } #endif @@ -323,7 +326,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); if (!cfBundle) return; - if ([(NSString *)CFBundleGetIdentifier(cfBundle) isEqualToString:@"com.lizardtech.NPDjVu"]) { + if ([self bundleIdentifier] == "com.lizardtech.NPDjVu") { // The DjVu plug-in will crash copying the vtable if it's too big so we cap it to // what the plug-in expects here. // size + version + 40 function pointers. @@ -352,7 +355,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); CFAbsoluteTime currentTime; CFAbsoluteTime duration; #endif - LOG(Plugins, "%f Load timing started for: %@", start, [self name]); + LOG(Plugins, "%f Load timing started for: %@", start, (NSString *)[self pluginInfo].name); if (isLoaded) return YES; @@ -360,7 +363,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #ifdef SUPPORT_CFM if (isBundle) { #endif - if (!CFBundleLoadExecutable(cfBundle)) + if (!CFBundleLoadExecutable(cfBundle.get())) return NO; #if !LOG_DISABLED currentTime = CFAbsoluteTimeGetCurrent(); @@ -371,14 +374,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); #ifdef SUPPORT_CFM if (isCFM) { - pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("main") ); + pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("main") ); if (!pluginMainFunc) return NO; } else { #endif - NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Initialize")); - NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints")); - NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown")); + NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_Initialize")); + NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_GetEntryPoints")); + NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_Shutdown")); if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown) return NO; #ifdef SUPPORT_CFM @@ -389,7 +392,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); FSRef fref; OSErr err; - err = FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fref, NULL); + err = FSPathMakeRef((UInt8 *)[(NSString *)path fileSystemRepresentation], &fref, NULL); if (err != noErr) { LOG_ERROR("FSPathMakeRef failed. Error=%d", err); return NO; @@ -503,7 +506,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); // Workaround for 3270576. The RealPlayer plug-in fails to load if its preference file is out of date. // Launch the RealPlayer application to refresh the file. if (npErr != NPERR_NO_ERROR) { - if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && [[self filename] isEqualToString:RealPlayerPluginFilename]) + if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && equalIgnoringCase(pluginInfo.file, RealPlayerPluginFilename)) [self launchRealPlayer]; return NO; } @@ -534,9 +537,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); // LiveConnect support pluginFuncs.javaClass = (JRIGlobalRef)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass); if (pluginFuncs.javaClass) { - LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); + LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", (NSString *)[self pluginInfo].name, pluginFuncs.javaClass); } else { - LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); + LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", (NSString *)[self pluginInfo].name); } } else { @@ -625,9 +628,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); pluginVersion = pluginFuncs.version; if (pluginFuncs.javaClass) - LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass); + LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", (NSString *)[self pluginInfo].name, pluginFuncs.javaClass); else - LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]); + LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", (NSString *)[self pluginInfo].name); #ifdef SUPPORT_CFM } @@ -689,6 +692,22 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer); [self _unloadWithShutdown:YES]; } + +- (BOOL)supportsSnapshotting +{ + if ([self bundleIdentifier] != "com.macromedia.Flash Player.plugin") + return YES; + + // Flash has a bogus Info.plist entry for CFBundleVersionString, so use CFBundleShortVersionString. + NSString *versionString = (NSString *)CFDictionaryGetValue(CFBundleGetInfoDictionary(cfBundle.get()), CFSTR("CFBundleShortVersionString")); + + if (![versionString hasPrefix:@"10.1"]) + return YES; + + // Some prerelease versions of Flash 10.1 crash when sent a drawRect event using the CA drawing model: <rdar://problem/7739922> + return CFStringCompare((CFStringRef)versionString, CFSTR("10.1.53.60"), kCFCompareNumerically) != kCFCompareLessThan; +} + @end #ifdef SUPPORT_CFM @@ -736,7 +755,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer fp) if (!isLoaded) return; - LOG(Plugins, "Unloading %@...", name); + LOG(Plugins, "Unloading %@...", (NSString *)pluginInfo.name); // Cannot unload a plug-in package while an instance is still using it if (instanceCount > 0) { diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm index 8b4d998..f062f7c 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm @@ -1234,7 +1234,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) cValues = (char **)malloc([values count] * sizeof(char *)); } - BOOL isWMP = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.WMP.defaultplugin"]; + BOOL isWMP = [_pluginPackage.get() bundleIdentifier] == "com.microsoft.WMP.defaultplugin"; unsigned i; unsigned count = [keys count]; @@ -2370,9 +2370,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr) ASSERT(pluginFunctionCallDepth == 0); PluginMainThreadScheduler::scheduler().registerPlugin(plugin); - - _isFlash = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"]; - _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"]; + + _isFlash = [_pluginPackage.get() bundleIdentifier] == "com.macromedia.Flash Player.plugin"; + _isSilverlight = [_pluginPackage.get() bundleIdentifier] == "com.microsoft.SilverlightPlugin"; [[self class] setCurrentPluginView:self]; NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL); diff --git a/WebKit/mac/Plugins/WebPluginDatabase.mm b/WebKit/mac/Plugins/WebPluginDatabase.mm index 34f5e0f..e7fae1b 100644 --- a/WebKit/mac/Plugins/WebPluginDatabase.mm +++ b/WebKit/mac/Plugins/WebPluginDatabase.mm @@ -45,6 +45,8 @@ #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> +using namespace WebCore; + static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin); @interface WebPluginDatabase (Internal) @@ -82,78 +84,107 @@ static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPa return; } - if ([[[*currentPlugin bundle] bundleIdentifier] isEqualToString:[[*candidatePlugin bundle] bundleIdentifier]] && [*candidatePlugin versionNumber] > [*currentPlugin versionNumber]) + if ([*currentPlugin bundleIdentifier] == [*candidatePlugin bundleIdentifier] && [*candidatePlugin versionNumber] > [*currentPlugin versionNumber]) *currentPlugin = *candidatePlugin; } -- (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(SEL)enumeratorSelector -{ - WebBasePluginPackage *plugin = nil; - WebBasePluginPackage *webPlugin = nil; +struct PluginPackageCandidates { + PluginPackageCandidates() + : webPlugin(nil) + , machoPlugin(nil) #ifdef SUPPORT_CFM - WebBasePluginPackage *CFMPlugin = nil; + , CFMPlugin(nil) #endif - WebBasePluginPackage *machoPlugin = nil; - - NSEnumerator *pluginEnumerator = [plugins objectEnumerator]; - key = [key lowercaseString]; - - while ((plugin = [pluginEnumerator nextObject]) != nil) { - if ([[[plugin performSelector:enumeratorSelector] allObjects] containsObject:key]) { - if ([plugin isKindOfClass:[WebPluginPackage class]]) - checkCandidate(&webPlugin, &plugin); + { + } + + void update(WebBasePluginPackage *plugin) + { + if ([plugin isKindOfClass:[WebPluginPackage class]]) { + checkCandidate(&webPlugin, &plugin); + return; + } + #if ENABLE(NETSCAPE_PLUGIN_API) - else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) { - WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType]; + if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) { + WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType]; #ifdef SUPPORT_CFM - if (executableType == WebCFMExecutableType) { - checkCandidate(&CFMPlugin, &plugin); - } else + if (executableType == WebCFMExecutableType) { + checkCandidate(&CFMPlugin, &plugin); + return; + } #endif // SUPPORT_CFM - if (executableType == WebMachOExecutableType) { - checkCandidate(&machoPlugin, &plugin); - } else { - ASSERT_NOT_REACHED(); - } - } else { - ASSERT_NOT_REACHED(); + if (executableType == WebMachOExecutableType) { + checkCandidate(&machoPlugin, &plugin); + return; } -#endif } +#endif + ASSERT_NOT_REACHED(); } - - // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type - // that the QT plug-in can handle, they probably intended to override QT. - if (webPlugin && ![webPlugin isQuickTimePlugIn]) - return webPlugin; - else if (machoPlugin && ![machoPlugin isQuickTimePlugIn]) - return machoPlugin; + WebBasePluginPackage *bestCandidate() + { + // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type + // that the QT plug-in can handle, they probably intended to override QT. + if (webPlugin && ![webPlugin isQuickTimePlugIn]) + return webPlugin; + + if (machoPlugin && ![machoPlugin isQuickTimePlugIn]) + return machoPlugin; + #ifdef SUPPORT_CFM - else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn]) - return CFMPlugin; + if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn]) + return CFMPlugin; #endif // SUPPORT_CFM - else if (webPlugin) - return webPlugin; - else if (machoPlugin) - return machoPlugin; + + if (webPlugin) + return webPlugin; + if (machoPlugin) + return machoPlugin; #ifdef SUPPORT_CFM - else if (CFMPlugin) - return CFMPlugin; + if (CFMPlugin) + return CFMPlugin; #endif - return nil; -} + return nil; + } + + WebBasePluginPackage *webPlugin; + WebBasePluginPackage *machoPlugin; +#ifdef SUPPORT_CFM + WebBasePluginPackage *CFMPlugin; +#endif +}; - (WebBasePluginPackage *)pluginForMIMEType:(NSString *)MIMEType { - return [self pluginForKey:[MIMEType lowercaseString] - withEnumeratorSelector:@selector(MIMETypeEnumerator)]; + PluginPackageCandidates candidates; + + MIMEType = [MIMEType lowercaseString]; + NSEnumerator *pluginEnumerator = [plugins objectEnumerator]; + + while (WebBasePluginPackage *plugin = [pluginEnumerator nextObject]) { + if ([plugin supportsMIMEType:MIMEType]) + candidates.update(plugin); + } + + return candidates.bestCandidate(); } - (WebBasePluginPackage *)pluginForExtension:(NSString *)extension { - WebBasePluginPackage *plugin = [self pluginForKey:[extension lowercaseString] - withEnumeratorSelector:@selector(extensionEnumerator)]; + PluginPackageCandidates candidates; + + extension = [extension lowercaseString]; + NSEnumerator *pluginEnumerator = [plugins objectEnumerator]; + + while (WebBasePluginPackage *plugin = [pluginEnumerator nextObject]) { + if ([plugin supportsExtension:extension]) + candidates.update(plugin); + } + + WebBasePluginPackage *plugin = candidates.bestCandidate(); + if (!plugin) { // If no plug-in was found from the extension, attempt to map from the extension to a MIME type // and find the a plug-in from the MIME type. This is done in case the plug-in has not fully specified @@ -275,8 +306,11 @@ static NSArray *additionalWebPlugInPaths; // Build a list of MIME types. NSMutableSet *MIMETypes = [[NSMutableSet alloc] init]; pluginEnumerator = [plugins objectEnumerator]; - while ((plugin = [pluginEnumerator nextObject]) != nil) - [MIMETypes addObjectsFromArray:[[plugin MIMETypeEnumerator] allObjects]]; + while ((plugin = [pluginEnumerator nextObject])) { + const PluginInfo& pluginInfo = [plugin pluginInfo]; + for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) + [MIMETypes addObject:pluginInfo.mimes[i].type]; + } // Register plug-in views and representations. NSEnumerator *MIMEEnumerator = [MIMETypes objectEnumerator]; @@ -410,9 +444,10 @@ static NSArray *additionalWebPlugInPaths; ASSERT(plugin); // Unregister plug-in's MIME type registrations - NSEnumerator *MIMETypeEnumerator = [plugin MIMETypeEnumerator]; - NSString *MIMEType; - while ((MIMEType = [MIMETypeEnumerator nextObject])) { + const PluginInfo& pluginInfo = [plugin pluginInfo]; + for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) { + NSString *MIMEType = pluginInfo.mimes[i].type; + if ([registeredMIMETypes containsObject:MIMEType]) { if (self == sharedDatabase) [WebView _unregisterPluginMIMEType:MIMEType]; diff --git a/WebKit/mac/Plugins/WebPluginPackage.h b/WebKit/mac/Plugins/WebPluginPackage.h index 290bb1b..f8c8146 100644 --- a/WebKit/mac/Plugins/WebPluginPackage.h +++ b/WebKit/mac/Plugins/WebPluginPackage.h @@ -32,7 +32,9 @@ @protocol WebPluginViewFactory; -@interface WebPluginPackage : WebBasePluginPackage +@interface WebPluginPackage : WebBasePluginPackage { + NSBundle *nsBundle; +} - (Class)viewFactory; diff --git a/WebKit/mac/Plugins/WebPluginPackage.m b/WebKit/mac/Plugins/WebPluginPackage.mm index d7f144e..a608068 100644 --- a/WebKit/mac/Plugins/WebPluginPackage.m +++ b/WebKit/mac/Plugins/WebPluginPackage.mm @@ -40,26 +40,28 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey" @implementation WebPluginPackage -- initWithPath:(NSString *)pluginPath +- (id)initWithPath:(NSString *)pluginPath { if (!(self = [super initWithPath:pluginPath])) return nil; - if (bundle == nil) { + nsBundle = [[NSBundle alloc] initWithPath:path]; + + if (!nsBundle) { [self release]; return nil; } if (![[pluginPath pathExtension] _webkit_isCaseInsensitiveEqualToString:@"webplugin"]) { UInt32 type = 0; - CFBundleGetPackageInfo(cfBundle, &type, NULL); + CFBundleGetPackageInfo(cfBundle.get(), &type, NULL); if (type != FOUR_CHAR_CODE('WBPL')) { [self release]; return nil; } } - NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]]; + NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[nsBundle executablePath]]; NSData *data = [executableFile readDataOfLength:512]; [executableFile closeFile]; if (![self isNativeLibraryData:data]) { @@ -75,9 +77,16 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey" return self; } +- (void)dealloc +{ + [nsBundle release]; + + [super dealloc]; +} + - (Class)viewFactory { - return [bundle principalClass]; + return [nsBundle principalClass]; } - (BOOL)load @@ -87,14 +96,14 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey" #endif // Load the bundle - if (![bundle isLoaded]) { - if (![bundle load]) + if (![nsBundle isLoaded]) { + if (![nsBundle load]) return NO; } #if !LOG_DISABLED CFAbsoluteTime duration = CFAbsoluteTimeGetCurrent() - start; - LOG(Plugins, "principalClass took %f seconds for: %@", duration, [self name]); + LOG(Plugins, "principalClass took %f seconds for: %@", duration, (NSString *)[self pluginInfo].name); #endif return [super load]; } diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index cf4b03c..d72f4ed 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -84,6 +84,7 @@ #import <WebCore/FormState.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> +#import <WebCore/FrameLoaderStateMachine.h> #import <WebCore/FrameLoaderTypes.h> #import <WebCore/FrameTree.h> #import <WebCore/FrameView.h> @@ -1177,7 +1178,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage() if (usesDocumentViews) { // FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too. bool willProduceHTMLView = [m_webFrame->_private->webFrameView _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class]; - bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView; + bool canSkipCreation = core(m_webFrame.get())->loader()->stateMachine()->committingFirstRealLoad() && willProduceHTMLView; if (canSkipCreation) { [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource]; return; @@ -1631,8 +1632,10 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage"))); if (!pluginPageURL.protocolInHTTPFamily()) pluginPageURL = KURL(); + NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage pluginInfo].name : nil; + NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode - contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType]; + contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:pluginName MIMEType:MIMEType]; CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView], @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]); [error release]; @@ -1721,7 +1724,8 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& s if (!view) { WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(getWebView(m_webFrame.get())); if (implementations->plugInFailedWithErrorFunc) { - NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:[pluginPackage name] MIMEType:MIMEType]; + NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage pluginInfo].name : nil; + NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:pluginName MIMEType:MIMEType]; CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView], @selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]); [error release]; diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h index 94ff676..7092157 100644 --- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h +++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h @@ -34,9 +34,9 @@ class WebPasteboardHelper : public WebCore::PasteboardHelper { public: WebPasteboardHelper(WebHTMLView* view) : m_view(view) {} - virtual WebCore::String urlFromPasteboard(const NSPasteboard*, WebCore::String* title) const; - virtual WebCore::String plainTextFromPasteboard(const NSPasteboard*) const; - virtual DOMDocumentFragment* fragmentFromPasteboard(const NSPasteboard*) const; + virtual WebCore::String urlFromPasteboard(NSPasteboard*, WebCore::String* title) const; + virtual WebCore::String plainTextFromPasteboard(NSPasteboard*) const; + virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const; virtual NSArray* insertablePasteboardTypes() const; private: WebHTMLView* m_view; diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm index eb6a58d..fb93f8e 100644 --- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm +++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm @@ -37,7 +37,7 @@ using namespace WebCore; -String WebPasteboardHelper::urlFromPasteboard(const NSPasteboard* pasteboard, String* title) const +String WebPasteboardHelper::urlFromPasteboard(NSPasteboard* pasteboard, String* title) const { NSURL *URL = [pasteboard _web_bestURL]; if (title) { @@ -48,7 +48,7 @@ String WebPasteboardHelper::urlFromPasteboard(const NSPasteboard* pasteboard, St return [URL _web_originalDataAsString]; } -String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboard) const +String WebPasteboardHelper::plainTextFromPasteboard(NSPasteboard *pasteboard) const { NSArray *types = [pasteboard types]; @@ -85,7 +85,7 @@ String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboa return String(); } -DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(const NSPasteboard *pasteboard) const +DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(NSPasteboard *pasteboard) const { return [m_view _documentFragmentFromPasteboard:pasteboard]; } diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h new file mode 100644 index 0000000..ce8bf9d --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebPlatformStrategies_h +#define WebPlatformStrategies_h + +#include <WebCore/PlatformStrategies.h> +#include <WebCore/PluginStrategy.h> + +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy { +public: + static void initialize(); + +private: + WebPlatformStrategies(); + + // WebCore::PlatformStrategies + virtual WebCore::PluginStrategy* createPluginStrategy(); + + // WebCore::PluginStrategy + virtual void refreshPlugins(); + virtual void getPluginInfo(Vector<WebCore::PluginInfo>&); +}; + +#endif // WebPlatformStrategies_h diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm new file mode 100644 index 0000000..d4bb684 --- /dev/null +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "WebPlatformStrategies.h" + +#import "WebPluginDatabase.h" +#import "WebPluginPackage.h" +#import <WebCore/BlockExceptions.h> +#import <wtf/StdLibExtras.h> + +#ifdef BUILDING_ON_TIGER +typedef unsigned NSUInteger; +#endif + +using namespace WebCore; + +void WebPlatformStrategies::initialize() +{ + DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ()); + setPlatformStrategies(&platformStrategies); +} + +WebPlatformStrategies::WebPlatformStrategies() +{ +} + +// PluginStrategy + +PluginStrategy* WebPlatformStrategies::createPluginStrategy() +{ + return this; +} + +void WebPlatformStrategies::refreshPlugins() +{ + [[WebPluginDatabase sharedDatabase] refresh]; +} + +void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& plugins) +{ + BEGIN_BLOCK_OBJC_EXCEPTIONS; + + NSArray* pluginsArray = [[WebPluginDatabase sharedDatabase] plugins]; + for (unsigned int i = 0; i < [pluginsArray count]; ++i) { + WebPluginPackage *plugin = [pluginsArray objectAtIndex:i]; + + plugins.append([plugin pluginInfo]); + } + + END_BLOCK_OBJC_EXCEPTIONS; +} + + diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.h b/WebKit/mac/WebCoreSupport/WebSystemInterface.h index 6e20279..d460217 100644 --- a/WebKit/mac/WebCoreSupport/WebSystemInterface.h +++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.h @@ -26,12 +26,4 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef __cplusplus -extern "C" { -#endif - -void InitWebCoreSystemInterface(void); - -#ifdef __cplusplus -} -#endif +void InitWebCoreSystemInterface(); diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm index b792707..0b74dee 100644 --- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m +++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm @@ -1,5 +1,5 @@ /* - * Copyright 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. + * Copyright 2006, 2007, 2008, 2009, 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 @@ -28,12 +28,12 @@ #import "WebSystemInterface.h" -#import <WebCore/WebCoreSystemInterface.h> -#import <WebKitSystemInterface.h> - // Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753. #include <wtf/Platform.h> +#import <WebCore/WebCoreSystemInterface.h> +#import <WebKitSystemInterface.h> + #define INIT(function) wk##function = WK##function void InitWebCoreSystemInterface(void) @@ -115,5 +115,9 @@ void InitWebCoreSystemInterface(void) INIT(NoteOpenPanelFiles); #endif +#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) + INIT(GetHyphenationLocationBeforeIndex); +#endif + didInit = true; } diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm index fd6d5b0..a97d5a5 100644 --- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm +++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm @@ -35,7 +35,6 @@ #import <WebKit/WebNSUserDefaultsExtras.h> #import <WebKit/WebNSObjectExtras.h> #import <WebKit/WebNSViewExtras.h> -#import <WebKit/WebPluginDatabase.h> #import <WebKitSystemInterface.h> #import <wtf/Assertions.h> @@ -65,16 +64,6 @@ ASSERT([[self sharedFactory] isKindOfClass:self]); } -- (NSArray *)pluginsInfo -{ - return [[WebPluginDatabase sharedDatabase] plugins]; -} - -- (void)refreshPlugins -{ - [[WebPluginDatabase sharedDatabase] refresh]; -} - - (NSString *)inputElementAltText { return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm index 86090be..74439dd 100644 --- a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm +++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm @@ -174,7 +174,7 @@ struct WebDynamicScrollBarsViewPrivate { [[self contentView] setFrame:[self contentViewFrame]]; } -- (void)setSuppressLayout:(BOOL)flag; +- (void)setSuppressLayout:(BOOL)flag { _private->suppressLayout = flag; } diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm index 7c59615..b71d501 100644 --- a/WebKit/mac/WebView/WebFrame.mm +++ b/WebKit/mac/WebView/WebFrame.mm @@ -66,6 +66,7 @@ #import <WebCore/EventNames.h> #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> +#import <WebCore/FrameLoaderStateMachine.h> #import <WebCore/FrameTree.h> #import <WebCore/GraphicsContext.h> #import <WebCore/HTMLFrameOwnerElement.h> @@ -1051,7 +1052,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (BOOL)_firstLayoutDone { - return _private->coreFrame->loader()->firstLayoutDone(); + return _private->coreFrame->loader()->stateMachine()->firstLayoutDone(); } - (WebFrameLoadType)_loadType @@ -1222,7 +1223,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) if (documentLoader && !documentLoader->mainDocumentError().isNull()) [result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError]; - if (frameLoader->containsPlugins()) + if (frameLoader->subframeLoader()->containsPlugins()) [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins]; if (DOMWindow* domWindow = _private->coreFrame->domWindow()) { diff --git a/WebKit/mac/WebView/WebGeolocationPosition.mm b/WebKit/mac/WebView/WebGeolocationPosition.mm index 46f62c1..c92b7f1 100644 --- a/WebKit/mac/WebView/WebGeolocationPosition.mm +++ b/WebKit/mac/WebView/WebGeolocationPosition.mm @@ -83,4 +83,10 @@ GeolocationPosition* core(WebGeolocationPosition *position) return self; } +- (void)dealloc +{ + [_internal release]; + [super dealloc]; +} + @end diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm index 51fd5ba..c009f4a 100644 --- a/WebKit/mac/WebView/WebHTMLRepresentation.mm +++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm @@ -29,6 +29,7 @@ #import "WebHTMLRepresentation.h" #import "DOMElementInternal.h" +#import "DOMNodeInternal.h" #import "DOMRangeInternal.h" #import "WebArchive.h" #import "WebBasePluginPackage.h" diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index a60ae12..e40500c 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -353,7 +353,6 @@ static CachedResourceClient* promisedDataClient() - (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText; - (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard; - (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText; -- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard; - (void)_removeMouseMovedObserverUnconditionally; - (void)_removeSuperviewObservers; - (void)_removeWindowObservers; @@ -874,19 +873,6 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) [webView release]; } -- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard -{ - WebView *webView = [[self _webView] retain]; - [webView _setInsertionPasteboard:pasteboard]; - - NSString *text = [self _plainTextFromPasteboard:pasteboard]; - if ([self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionPasted]) - [[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]]; - - [webView _setInsertionPasteboard:nil]; - [webView release]; -} - - (void)_removeMouseMovedObserverUnconditionally { if (!_private || !_private->observingMouseMovedNotifications) @@ -2576,6 +2562,7 @@ WEBCORE_COMMAND(pageDown) WEBCORE_COMMAND(pageDownAndModifySelection) WEBCORE_COMMAND(pageUp) WEBCORE_COMMAND(pageUpAndModifySelection) +WEBCORE_COMMAND(pasteAsPlainText) WEBCORE_COMMAND(selectAll) WEBCORE_COMMAND(selectLine) WEBCORE_COMMAND(selectParagraph) @@ -2615,18 +2602,6 @@ WEBCORE_COMMAND(yankAndSelect) return YES; } -- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard -{ - Frame* coreFrame = core([self _frame]); - if (!coreFrame) - return NO; - if (coreFrame->selection()->isContentRichlyEditable()) - [self _pasteWithPasteboard:pasteboard allowPlainText:YES]; - else - [self _pasteAsPlainTextWithPasteboard:pasteboard]; - return YES; -} - - (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType { BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]); @@ -5162,15 +5137,6 @@ static BOOL writingDirectionKeyBindingsEnabled() coreFrame->editor()->pasteAsPlainText(); } -- (void)pasteAsPlainText:(id)sender -{ - COMMAND_PROLOGUE - - if (![self _canEdit]) - return; - [self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]]; -} - - (void)closeIfNotCurrentView { if ([[[self _frame] frameView] documentView] != self) diff --git a/WebKit/mac/WebView/WebNavigationData.mm b/WebKit/mac/WebView/WebNavigationData.mm index 290d8b1..753a441 100644 --- a/WebKit/mac/WebView/WebNavigationData.mm +++ b/WebKit/mac/WebView/WebNavigationData.mm @@ -55,7 +55,7 @@ @implementation WebNavigationData -- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource; +- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource { _private = [[WebNavigationDataPrivate alloc] init]; diff --git a/WebKit/mac/WebView/WebPDFRepresentation.mm b/WebKit/mac/WebView/WebPDFRepresentation.mm index 36449f3..44a1362 100644 --- a/WebKit/mac/WebView/WebPDFRepresentation.mm +++ b/WebKit/mac/WebView/WebPDFRepresentation.mm @@ -70,15 +70,15 @@ return PDFDocumentClass; } -- (void)setDataSource:(WebDataSource *)dataSource; +- (void)setDataSource:(WebDataSource *)dataSource { } -- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource; +- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource { } -- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource; +- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource { } diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 36aef1f..0a192f9 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -360,6 +360,7 @@ static WebCacheModel cacheModelForMainBundle(void) [NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey, [NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey, [NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey, + [NSNumber numberWithBool:YES], WebKitHTML5ParserEnabledPreferenceKey, nil]; // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm index 73c0118..fd02212 100644 --- a/WebKit/mac/WebView/WebResource.mm +++ b/WebKit/mac/WebView/WebResource.mm @@ -277,7 +277,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse" return frameName; } -- (id)description +- (NSString *)description { return [NSString stringWithFormat:@"<%@ %@>", [self className], [self URL]]; } diff --git a/WebKit/mac/WebView/WebSerializedJSValue.mm b/WebKit/mac/WebView/WebSerializedJSValue.mm index af96aa4..05a316b 100644 --- a/WebKit/mac/WebView/WebSerializedJSValue.mm +++ b/WebKit/mac/WebView/WebSerializedJSValue.mm @@ -40,7 +40,7 @@ using namespace WebCore; @implementation WebSerializedJSValue -- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception; +- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception { ASSERT_ARG(value, value); ASSERT_ARG(sourceContext, sourceContext); diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.h b/WebKit/mac/WebView/WebVideoFullscreenController.h index 2e0c4c3..3e7b6cf 100644 --- a/WebKit/mac/WebView/WebVideoFullscreenController.h +++ b/WebKit/mac/WebView/WebVideoFullscreenController.h @@ -48,6 +48,8 @@ namespace WebCore { BOOL _isEndingFullscreen; BOOL _isWindowLoaded; BOOL _forceDisableAnimation; + uint32_t _idleDisplaySleepAssertion; + uint32_t _idleSystemSleepAssertion; SystemUIMode _savedUIMode; SystemUIOptions _savedUIOptions; } diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm index 8cbe0a0..69ded78 100644 --- a/WebKit/mac/WebView/WebVideoFullscreenController.mm +++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm @@ -30,6 +30,7 @@ #import "WebTypesInternal.h" #import "WebVideoFullscreenHUDWindowController.h" #import "WebWindowAnimation.h" +#import <IOKit/pwr_mgt/IOPMLib.h> #import <QTKit/QTKit.h> #import <WebCore/HTMLMediaElement.h> #import <WebCore/SoftLinking.h> @@ -55,6 +56,13 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) @end @interface WebVideoFullscreenController(HUDWindowControllerDelegate) <WebVideoFullscreenHUDWindowControllerDelegate> +- (void)requestExitFullscreenWithAnimation:(BOOL)animation; +- (void)updateMenuAndDockForFullscreen; +- (void)updatePowerAssertions; +@end + +@interface NSWindow(IsOnActiveSpaceAdditionForTigerAndLeopard) +- (BOOL)isOnActiveSpace; @end @implementation WebVideoFullscreenController @@ -98,15 +106,18 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) [window setHasShadow:YES]; // This is nicer with a shadow. [window setLevel:NSPopUpMenuWindowLevel-1]; [layer release]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp]; #endif } -- (WebCore::HTMLMediaElement*)mediaElement; +- (WebCore::HTMLMediaElement*)mediaElement { return _mediaElement.get(); } -- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement; +- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement { #ifdef BUILDING_ON_TIGER // WebVideoFullscreenController is not supported on Tiger: @@ -133,7 +144,7 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) return _delegate; } -- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate; +- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate { _delegate = delegate; } @@ -153,7 +164,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) [self clearFadeAnimation]; [[self window] close]; [self setWindow:nil]; - SetSystemUIMode(_savedUIMode, _savedUIOptions); + [self updateMenuAndDockForFullscreen]; + [self updatePowerAssertions]; [_hudController setDelegate:nil]; [_hudController release]; _hudController = nil; @@ -173,8 +185,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) _hudController = [[WebVideoFullscreenHUDWindowController alloc] init]; [_hudController setDelegate:self]; - GetSystemUIMode(&_savedUIMode, &_savedUIOptions); - SetSystemUIMode(kUIModeAllSuppressed , 0); + [self updateMenuAndDockForFullscreen]; + [self updatePowerAssertions]; [NSCursor setHiddenUntilMouseMoves:YES]; // Give the HUD keyboard focus initially @@ -186,6 +198,22 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *) return _mediaElement->screenRect(); } +- (void)applicationDidResignActive:(NSNotification*)notification +{ + // Check to see if the fullscreenWindow is on the active space; this function is available + // on 10.6 and later, so default to YES if the function is not available: + NSWindow* fullscreenWindow = [self fullscreenWindow]; + BOOL isOnActiveSpace = ([fullscreenWindow respondsToSelector:@selector(isOnActiveSpace)] ? [fullscreenWindow isOnActiveSpace] : YES); + + // Replicate the QuickTime Player (X) behavior when losing active application status: + // Is the fullscreen screen the main screen? (Note: this covers the case where only a + // single screen is available.) Is the fullscreen screen on the current space? IFF so, + // then exit fullscreen mode. + if ([fullscreenWindow screen] == [[NSScreen screens] objectAtIndex:0] && isOnActiveSpace) + [self requestExitFullscreenWithAnimation:NO]; +} + + #pragma mark - #pragma mark Exposed Interface @@ -229,7 +257,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) _fadeAnimation = [[WebWindowFadeAnimation alloc] initWithDuration:0.2 window:_backgroundFullscreenWindow initialAlpha:initialAlpha finalAlpha:fadeIn ? 1 : 0]; } -- (void)enterFullscreen:(NSScreen *)screen; +- (void)enterFullscreen:(NSScreen *)screen { if (!screen) screen = [NSScreen mainScreen]; @@ -277,6 +305,98 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) [[self fullscreenWindow] animateFromRect:[[self window] frame] toRect:endFrame withSubAnimation:_fadeAnimation controllerAction:@selector(windowDidExitFullscreen)]; } +- (void)applicationDidChangeScreenParameters:(NSNotification*)notification +{ + // The user may have changed the main screen by moving the menu bar, or they may have changed + // the Dock's size or location, or they may have changed the fullscreen screen's dimensions. + // Update our presentation parameters, and ensure that the full screen window occupies the + // entire screen: + [self updateMenuAndDockForFullscreen]; + [[self window] setFrame:[[[self window] screen] frame] display:YES]; +} + +- (void)updateMenuAndDockForFullscreen +{ + // NSApplicationPresentationOptions is available on > 10.6 only: +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + NSApplicationPresentationOptions options = NSApplicationPresentationDefault; + NSScreen* fullscreenScreen = [[self window] screen]; + + if (!_isEndingFullscreen) { + // Auto-hide the menu bar if the fullscreenScreen contains the menu bar: + // NOTE: if the fullscreenScreen contains the menu bar but not the dock, we must still + // auto-hide the dock, or an exception will be thrown. + if ([[NSScreen screens] objectAtIndex:0] == fullscreenScreen) + options |= (NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock); + // Check if the current screen contains the dock by comparing the screen's frame to its + // visibleFrame; if a dock is present, the visibleFrame will differ. If the current screen + // contains the dock, hide it. + else if (!NSEqualRects([fullscreenScreen frame], [fullscreenScreen visibleFrame])) + options |= NSApplicationPresentationAutoHideDock; + } + + if ([NSApp respondsToSelector:@selector(setPresentationOptions:)]) + [NSApp setPresentationOptions:options]; + else +#endif + SetSystemUIMode(_isEndingFullscreen ? kUIModeNormal : kUIModeAllHidden, 0); +} + +#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5 +- (void)_disableIdleDisplaySleep +{ + if (_idleDisplaySleepAssertion == kIOPMNullAssertionID) +#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK + IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &_idleDisplaySleepAssertion); +#else // IOPMAssertionCreate is depreciated in > 10.5 + IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleDisplaySleepAssertion); +#endif +} + +- (void)_enableIdleDisplaySleep +{ + if (_idleDisplaySleepAssertion != kIOPMNullAssertionID) { + IOPMAssertionRelease(_idleDisplaySleepAssertion); + _idleDisplaySleepAssertion = kIOPMNullAssertionID; + } +} + +- (void)_disableIdleSystemSleep +{ + if (_idleSystemSleepAssertion == kIOPMNullAssertionID) +#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK + IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_idleSystemSleepAssertion); +#else // IOPMAssertionCreate is depreciated in > 10.5 + IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleSystemSleepAssertion); +#endif +} + +- (void)_enableIdleSystemSleep +{ + if (_idleSystemSleepAssertion != kIOPMNullAssertionID) { + IOPMAssertionRelease(_idleSystemSleepAssertion); + _idleSystemSleepAssertion = kIOPMNullAssertionID; + } +} +#endif + +- (void)updatePowerAssertions +{ +#if !defined(BUILDING_ON_TIGER) + float rate = 0; + if (_mediaElement && _mediaElement->platformMedia().type == WebCore::PlatformMedia::QTMovieType) + rate = [_mediaElement->platformMedia().media.qtMovie rate]; + + if (rate && !_isEndingFullscreen) { + [self _disableIdleSystemSleep]; + [self _disableIdleDisplaySleep]; + } else { + [self _enableIdleSystemSleep]; + [self _enableIdleDisplaySleep]; + } +#endif +} + #pragma mark - #pragma mark Window callback @@ -314,6 +434,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) { UNUSED_PARAM(unusedNotification); [_hudController updateRate]; + [self updatePowerAssertions]; } @end @@ -453,12 +574,6 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level) [[self windowController] fadeHUDIn]; } -- (void)resignKeyWindow -{ - [super resignKeyWindow]; - [[self windowController] requestExitFullscreenWithAnimation:NO]; -} - @end #endif /* ENABLE(VIDEO) */ diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 0023509..631dd63 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -86,6 +86,7 @@ #import "WebPDFView.h" #import "WebPanelAuthenticationHandler.h" #import "WebPasteboardHelper.h" +#import "WebPlatformStrategies.h" #import "WebPluginDatabase.h" #import "WebPluginHalterClient.h" #import "WebPolicyDelegate.h" @@ -103,13 +104,13 @@ #import <Foundation/NSURLConnection.h> #import <JavaScriptCore/APICast.h> #import <JavaScriptCore/JSValueRef.h> +#import <WebCore/AbstractDatabase.h> #import <WebCore/ApplicationCacheStorage.h> #import <WebCore/BackForwardList.h> #import <WebCore/Cache.h> #import <WebCore/ColorMac.h> #import <WebCore/CSSComputedStyleDeclaration.h> #import <WebCore/Cursor.h> -#import <WebCore/Database.h> #import <WebCore/Document.h> #import <WebCore/DocumentLoader.h> #import <WebCore/DragController.h> @@ -190,6 +191,7 @@ @interface NSWindow (WebNSWindowDetails) - (id)_oldFirstResponderBeforeBecoming; - (void)_enableScreenUpdatesIfNeeded; +- (BOOL)_wrapsCarbonWindow; @end using namespace WebCore; @@ -654,6 +656,10 @@ static bool shouldEnableLoadDeferring() #endif WebKitInitializeApplicationCachePathIfNecessary(); patchMailRemoveAttributesMethod(); + + // Initialize our platform strategies. + WebPlatformStrategies::initialize(); + didOneTimeInitialization = true; } @@ -1356,7 +1362,7 @@ static bool fastDocumentTeardownEnabled() settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]); settings->setPluginsEnabled([preferences arePlugInsEnabled]); #if ENABLE(DATABASE) - Database::setIsAvailable([preferences databasesEnabled]); + AbstractDatabase::setIsAvailable([preferences databasesEnabled]); #endif settings->setLocalStorageEnabled([preferences localStorageEnabled]); settings->setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]); @@ -4209,7 +4215,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag) Frame* coreFrame = [self _mainCoreFrame]; if (!coreFrame) return YES; - return coreFrame->shouldClose(); + return coreFrame->loader()->shouldClose(); } static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValue) @@ -5389,7 +5395,7 @@ static WebFrameView *containingFrameView(NSView *view) NSDictionary *element = [sender representedObject]; ASSERT([element isKindOfClass:[NSDictionary class]]); - WebDataSource *dataSource = [[element objectForKey:WebElementFrameKey] dataSource]; + WebDataSource *dataSource = [(WebFrame *)[element objectForKey:WebElementFrameKey] dataSource]; NSURLRequest *request = [[dataSource request] copy]; ASSERT(request); @@ -5669,7 +5675,15 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi // An NSWindow may not display in the next runloop cycle after dirtying due to delayed window display logic, // in which case this observer can fire first. So if the window is due for a display, don't commit // layer changes, otherwise they'll show on screen before the view drawing. - if ([window viewsNeedDisplay]) + bool viewsNeedDisplay; +#ifndef __LP64__ + if (window && [window _wrapsCarbonWindow]) + viewsNeedDisplay = HIViewGetNeedsDisplay(HIViewGetRoot(static_cast<WindowRef>([window windowRef]))); + else +#endif + viewsNeedDisplay = [window viewsNeedDisplay]; + + if (viewsNeedDisplay) return; if ([webView _syncCompositingChanges]) { @@ -5766,7 +5780,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi return nil; } -- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position; +- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position { #if ENABLE(CLIENT_BASED_GEOLOCATION) if (_private && _private->page) diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro index 22d4c8d..62546f6 100644 --- a/WebKit/qt/Api/DerivedSources.pro +++ b/WebKit/qt/Api/DerivedSources.pro @@ -12,7 +12,7 @@ DOUBLE_ESCAPED_QUOTE = "" ESCAPE = "" win32-msvc*|symbian { ESCAPE = "^" -} else:win32-g++:isEmpty(QMAKE_SH) { +} else:win32-g++*:isEmpty(QMAKE_SH) { # MinGW's make will run makefile commands using sh, even if make # was run from the Windows shell, if it finds sh in the path. ESCAPE = "^" diff --git a/WebKit/qt/Api/headers.pri b/WebKit/qt/Api/headers.pri index 29bb125..e9fe28d 100644 --- a/WebKit/qt/Api/headers.pri +++ b/WebKit/qt/Api/headers.pri @@ -12,4 +12,5 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ $$PWD/qwebpluginfactory.h \ $$PWD/qwebhistory.h \ $$PWD/qwebinspector.h \ - $$PWD/qwebkitversion.h + $$PWD/qwebkitversion.h \ + $$PWD/qwebscriptworld.h diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 178f5c2..8361970 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -122,7 +122,7 @@ void QGraphicsWebViewPrivate::_q_pageDestroyed() void QGraphicsWebViewPrivate::updateResizesToContentsForPage() { ASSERT(page); - + static_cast<PageClientQGraphicsWidget*>(page->d->client)->viewResizesToContents = resizesToContents; if (resizesToContents) { // resizes to contents mode requires preferred contents size to be set if (!page->preferredContentsSize().isValid()) @@ -821,10 +821,8 @@ void QGraphicsWebView::setResizesToContents(bool enabled) if (d->resizesToContents == enabled) return; d->resizesToContents = enabled; - if (d->page) { - static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->viewResizesToContents = enabled; + if (d->page) d->updateResizesToContentsForPage(); - } } bool QGraphicsWebView::resizesToContents() const diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 3eba058..c42cfa3 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -71,6 +71,8 @@ #include "qwebpage_p.h" #include "qwebsecurityorigin.h" #include "qwebsecurityorigin_p.h" +#include "qwebscriptworld.h" +#include "qwebscriptworld_p.h" #include "runtime_object.h" #include "runtime_root.h" #include "wtf/HashMap.h" @@ -1272,8 +1274,8 @@ void QWebFrame::print(QPrinter *printer) const if (!painter.begin(printer)) return; - const qreal zoomFactorX = printer->logicalDpiX() / qt_defaultDpi(); - const qreal zoomFactorY = printer->logicalDpiY() / qt_defaultDpi(); + const qreal zoomFactorX = (qreal)printer->logicalDpiX() / qt_defaultDpi(); + const qreal zoomFactorY = (qreal)printer->logicalDpiY() / qt_defaultDpi(); PrintContext printContext(d->frame); float pageHeight = 0; @@ -1376,6 +1378,22 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) return rc; } +QVariant QWebFrame::evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource) +{ + ScriptController *proxy = d->frame->script(); + QVariant rc; + + if (proxy) { + JSC::JSValue v = proxy->executeScriptInWorld(scriptWorld->world(), scriptSource, true).jsValue(); + if (!d->frame) // In case the script removed our frame from the page. + return QString(); + int distance = 0; + rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance); + } + return rc; +} + + /*! \since 4.5 diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h index ecd31de..5f3dbd4 100644 --- a/WebKit/qt/Api/qwebframe.h +++ b/WebKit/qt/Api/qwebframe.h @@ -49,6 +49,7 @@ class QWebHistoryItem; class QWebSecurityOrigin; class QWebElement; class QWebElementCollection; +class QWebScriptWorld; class DumpRenderTreeSupportQt; namespace WebCore { @@ -199,6 +200,7 @@ public: public Q_SLOTS: QVariant evaluateJavaScript(const QString& scriptSource); + QVariant evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource); #ifndef QT_NO_PRINTER void print(QPrinter *printer) const; #endif diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h index fcc37e7..62bd59e 100644 --- a/WebKit/qt/Api/qwebframe_p.h +++ b/WebKit/qt/Api/qwebframe_p.h @@ -71,6 +71,7 @@ public: , allowsScrolling(true) , marginWidth(-1) , marginHeight(-1) + , initialLayoutComplete(false) {} void init(QWebFrame* qframe, QWebFrameData* frameData); void setPage(QWebPage*); @@ -98,6 +99,7 @@ public: bool allowsScrolling; int marginWidth; int marginHeight; + bool initialLayoutComplete; }; class QWebHitTestResultPrivate { diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp index 0147f92..a6f3d0c 100644 --- a/WebKit/qt/Api/qwebhistory.cpp +++ b/WebKit/qt/Api/qwebhistory.cpp @@ -363,9 +363,8 @@ bool QWebHistory::canGoForward() const void QWebHistory::back() { if (canGoBack()) { - d->lst->goBack(); WebCore::Page* page = d->lst->page(); - page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); + page->goToItem(d->lst->backItem(), WebCore::FrameLoadTypeIndexedBackForward); } } @@ -378,9 +377,8 @@ void QWebHistory::back() void QWebHistory::forward() { if (canGoForward()) { - d->lst->goForward(); WebCore::Page* page = d->lst->page(); - page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); + page->goToItem(d->lst->forwardItem(), WebCore::FrameLoadTypeIndexedBackForward); } } @@ -391,9 +389,8 @@ void QWebHistory::forward() */ void QWebHistory::goToItem(const QWebHistoryItem &item) { - d->lst->goToItem(item.d->item); WebCore::Page* page = d->lst->page(); - page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward); + page->goToItem(item.d->item, WebCore::FrameLoadTypeIndexedBackForward); } /*! diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h index bac618c..32d22d4 100644 --- a/WebKit/qt/Api/qwebkitplatformplugin.h +++ b/WebKit/qt/Api/qwebkitplatformplugin.h @@ -31,7 +31,7 @@ class QWebSelectData { public: - inline ~QWebSelectData() {} + virtual ~QWebSelectData() {} enum ItemType { Option, Group, Separator }; @@ -48,7 +48,7 @@ class QWebSelectMethod : public QObject { Q_OBJECT public: - inline ~QWebSelectMethod() {} + virtual ~QWebSelectMethod() {} virtual void show(const QWebSelectData&) = 0; virtual void hide() = 0; @@ -61,6 +61,8 @@ Q_SIGNALS: class QWebNotificationData { public: + virtual ~QWebNotificationData() {} + virtual const QString title() const = 0; virtual const QString message() const = 0; virtual const QByteArray iconData() const = 0; diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index d49ac14..eab909c 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -593,7 +593,7 @@ void QWebPagePrivate::timerEvent(QTimerEvent *ev) if (timerId == tripleClickTimer.timerId()) tripleClickTimer.stop(); else - q->QObject::timerEvent(ev); + q->timerEvent(ev); } void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev) @@ -1207,6 +1207,14 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) } #ifndef QT_NO_PROPERTIES +typedef struct { + const char* name; + double deferredRepaintDelay; + double initialDeferredRepaintDelayDuringLoading; + double maxDeferredRepaintDelayDuringLoading; + double deferredRepaintDelayIncrementDuringLoading; +} QRepaintThrottlingPreset; + void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event) { if (event->propertyName() == "_q_viewMode") { @@ -1224,7 +1232,42 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") { double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble(); q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay); - } + } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelay") { + double p = q->property("_q_RepaintThrottlingDeferredRepaintDelay").toDouble(); + FrameView::setRepaintThrottlingDeferredRepaintDelay(p); + } else if (event->propertyName() == "_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading") { + double p = q->property("_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading").toDouble(); + FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading") { + double p = q->property("_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading").toDouble(); + FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading") { + double p = q->property("_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading").toDouble(); + FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(p); + } else if (event->propertyName() == "_q_RepaintThrottlingPreset") { + static const QRepaintThrottlingPreset presets[] = { + { "NoThrottling", 0, 0, 0, 0 }, + { "Legacy", 0.025, 0, 2.5, 0.5 }, + { "Minimal", 0.01, 0, 1, 0.2 }, + { "Medium", 0.025, 1, 5, 0.5 }, + { "Heavy", 0.1, 2, 10, 1 } + }; + + QString p = q->property("_q_RepaintThrottlingPreset").toString(); + for(int i = 0; i < sizeof(presets) / sizeof(presets[0]); i++) { + if(p == presets[i].name) { + FrameView::setRepaintThrottlingDeferredRepaintDelay( + presets[i].deferredRepaintDelay); + FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading( + presets[i].initialDeferredRepaintDelayDuringLoading); + FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading( + presets[i].maxDeferredRepaintDelayDuringLoading); + FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading( + presets[i].deferredRepaintDelayIncrementDuringLoading); + break; + } + } + } #if ENABLE(TILED_BACKING_STORE) else if (event->propertyName() == "_q_TiledBackingStoreTileSize") { WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); @@ -1655,6 +1698,109 @@ InspectorController* QWebPagePrivate::inspectorController() \value WebModalDialog The window acts as modal dialog. */ + +/*! + \class QWebPage::ViewportHints + \since 4.7 + \brief The QWebPage::ViewportHints class describes hints that can be applied to a viewport. + + QWebPage::ViewportHints provides a description of a viewport, such as viewport geometry, + initial scale factor with limits, plus information about whether a user should be able + to scale the contents in the viewport or not, ie. by zooming. + + ViewportHints can be set by a web author using the viewport meta tag extension, documented + at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}. + + All values might not be set, as such when dealing with the hints, the developer needs to + check whether the values are valid. Negative values denote an invalid qreal value. + + \inmodule QtWebKit +*/ + +/*! + Constructs an empty QWebPage::ViewportHints. +*/ +QWebPage::ViewportHints::ViewportHints() + : d(0) + , m_initialScaleFactor(-1.0) + , m_minimumScaleFactor(-1.0) + , m_maximumScaleFactor(-1.0) + , m_isUserScalable(true) + , m_isValid(false) +{ + +} + +/*! + Constructs a QWebPage::ViewportHints which is a copy from \a other . +*/ +QWebPage::ViewportHints::ViewportHints(const QWebPage::ViewportHints& other) + : d(other.d) + , m_initialScaleFactor(other.m_initialScaleFactor) + , m_minimumScaleFactor(other.m_minimumScaleFactor) + , m_maximumScaleFactor(other.m_maximumScaleFactor) + , m_isUserScalable(other.m_isUserScalable) + , m_isValid(other.m_isValid) + , m_size(other.m_size) +{ + +} + +/*! + Destroys the QWebPage::ViewportHints. +*/ +QWebPage::ViewportHints::~ViewportHints() +{ + +} + +/*! + Assigns the given QWebPage::ViewportHints to this viewport hints and returns a + reference to this. +*/ +QWebPage::ViewportHints& QWebPage::ViewportHints::operator=(const QWebPage::ViewportHints& other) +{ + if (this != &other) { + d = other.d; + m_initialScaleFactor = other.m_initialScaleFactor; + m_minimumScaleFactor = other.m_minimumScaleFactor; + m_maximumScaleFactor = other.m_maximumScaleFactor; + m_isUserScalable = other.m_isUserScalable; + m_isValid = other.m_isValid; + m_size = other.m_size; + } + + return *this; +} + +/*! \fn inline bool QWebPage::ViewportHints::isValid() const + Returns whether this is a valid ViewportHints or not. + + An invalid ViewportHints will have an empty QSize, negative values for scale factors and + true for the boolean isUserScalable. +*/ + +/*! \fn inline QSize QWebPage::ViewportHints::size() const + Returns the size of the viewport. +*/ + +/*! \fn inline qreal QWebPage::ViewportHints::initialScaleFactor() const + Returns the initial scale of the viewport as a multiplier. +*/ + +/*! \fn inline qreal QWebPage::ViewportHints::minimumScaleFactor() const + Returns the minimum scale value of the viewport as a multiplier. +*/ + +/*! \fn inline qreal QWebPage::ViewportHints::maximumScaleFactor() const + Returns the maximum scale value of the viewport as a multiplier. +*/ + +/*! \fn inline bool QWebPage::ViewportHints::isUserScalable() const + Determines whether or not the scale can be modified by the user. +*/ + + /*! \class QWebPage \since 4.4 @@ -1852,9 +1998,14 @@ QWidget *QWebPage::view() const */ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID) { - Q_UNUSED(message) - Q_UNUSED(lineNumber) Q_UNUSED(sourceID) + + // Catch plugin logDestroy message for LayoutTests/plugins/open-and-close-window-with-plugin.html + // At this point DRT's WebPage has already been destroyed + if (QWebPagePrivate::drtRun) { + if (message == "PLUGIN: NPP_Destroy") + fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData()); + } } /*! @@ -2184,30 +2335,42 @@ QSize QWebPage::preferredContentsSize() const /*! \property QWebPage::preferredContentsSize \since 4.6 - \brief the preferred size of the contents + \brief a custom size used for laying out the page contents. + + By default all pages are laid out using the viewport of the page as the base. + + As pages mostly are designed for desktop usage, they often do not layout properly + on small devices as the contents require a certain view width. For this reason + it is common to use a different layout size and then scale the contents to fit + within the actual view. - If this property is set to a valid size, it is used to lay out the page. - If it is not set (the default), the viewport size is used instead. + If this property is set to a valid size, this size is used for all layout needs + instead of the size of the viewport. + + Setting an invalid size, makes the page fall back to using the viewport size for layout. \sa viewportSize */ -void QWebPage::setPreferredContentsSize(const QSize &size) const +void QWebPage::setPreferredContentsSize(const QSize& size) const { + // FIXME: Rename this method to setCustomLayoutSize + d->fixedLayoutSize = size; - QWebFrame *frame = mainFrame(); - if (frame->d->frame && frame->d->frame->view()) { - WebCore::FrameView* view = frame->d->frame->view(); + QWebFrame* frame = mainFrame(); + if (!frame->d->frame || !frame->d->frame->view()) + return; - if (size.isValid()) { - view->setUseFixedLayout(true); - view->setFixedLayoutSize(size); - view->layout(); - } else if (view->useFixedLayout()) { - view->setUseFixedLayout(false); - view->layout(); - } - } + WebCore::FrameView* view = frame->d->frame->view(); + + if (size.isValid()) { + view->setUseFixedLayout(true); + view->setFixedLayoutSize(size); + } else if (view->useFixedLayout()) + view->setUseFixedLayout(false); + + if (frame->d->initialLayoutComplete) + view->layout(); } /*! @@ -3538,6 +3701,29 @@ quint64 QWebPage::bytesReceived() const } /*! + \since 4.7 + \fn void QWebPage::viewportChangeRequested(const QWebPage::ViewportHints& hints) + + This signal is emitted before any layout of the contents, giving you the viewport \a arguments + the web page would like you to use when laying out its contents, including elements fixed to the + viewport. This viewport might be larger that your actual viewport, meaning that a initialScaleFactor + should be applied. When no scale is given, it is assumed that the contents should be scaled + such that the width of the scaled contents fits within the actual viewport. + + The minimum and maximum allowed scale represents the min and max values that the page + allows for scaling, and thus, affects the ability to zoom in on the page. + + Invalid values are supplied for the values not explicitly set by the web author; thus an + invalid viewport size, and negative values for scale factor and limits. The boolean + ViewportHints::isUserScalable is set to true. + + Page authors can provide the supplied values by using the viewport meta tag. More information + about this can be found at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}. + + \sa QWebPage::ViewportHints, setPreferredContentsSize(), QGraphicsWebView::setScale() +*/ + +/*! \fn void QWebPage::loadStarted() This signal is emitted when a new load of the page is started. diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index 721f4a8..fcaa302 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -42,12 +42,13 @@ class QWebFrame; class QWebNetworkRequest; class QWebHistory; -class QWebPagePrivate; class QWebFrameData; +class QWebHistoryItem; +class QWebHitTestResult; class QWebNetworkInterface; +class QWebPagePrivate; class QWebPluginFactory; -class QWebHitTestResult; -class QWebHistoryItem; +class QtViewportHintsPrivate; namespace WebCore { class ChromeClientQt; @@ -194,6 +195,35 @@ public: WebModalDialog }; + class ViewportHints { + public: + ViewportHints(); + ViewportHints(const QWebPage::ViewportHints& other); + + ~ViewportHints(); + + QWebPage::ViewportHints& operator=(const QWebPage::ViewportHints& other); + + inline qreal initialScaleFactor() const { return m_initialScaleFactor; }; + inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; }; + inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; }; + inline bool isUserScalable() const { return m_isUserScalable; }; + inline bool isValid() const { return m_isValid; }; + inline QSize size() const { return m_size; }; + + private: + QSharedDataPointer<QtViewportHintsPrivate> d; + qreal m_initialScaleFactor; + qreal m_minimumScaleFactor; + qreal m_maximumScaleFactor; + bool m_isUserScalable; + bool m_isValid; + QSize m_size; + + friend class WebCore::ChromeClientQt; + }; + + explicit QWebPage(QObject *parent = 0); ~QWebPage(); @@ -339,6 +369,8 @@ Q_SIGNALS: void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item); void restoreFrameStateRequested(QWebFrame* frame); + void viewportChangeRequested(const QWebPage::ViewportHints& hints); + protected: virtual QWebPage *createWindow(WebWindowType type); virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues); diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h index 272f96b..54a1523 100644 --- a/WebKit/qt/Api/qwebpage_p.h +++ b/WebKit/qt/Api/qwebpage_p.h @@ -58,6 +58,15 @@ QT_END_NAMESPACE class QWebInspector; class QWebPageClient; +class QtViewportHintsPrivate : public QSharedData { +public: + QtViewportHintsPrivate(QWebPage::ViewportHints* qq) + : q(qq) + { } + + QWebPage::ViewportHints* q; +}; + class QWebPagePrivate { public: QWebPagePrivate(QWebPage*); diff --git a/WebKit/qt/Api/qwebscriptworld.cpp b/WebKit/qt/Api/qwebscriptworld.cpp new file mode 100644 index 0000000..5d912cc --- /dev/null +++ b/WebKit/qt/Api/qwebscriptworld.cpp @@ -0,0 +1,49 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.net> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "qwebscriptworld.h" +#include "qwebscriptworld_p.h" + +#include "KURL.h" +#include "ScriptController.h" +#include <QStringList> + +using namespace WebCore; + +/*! + Constructs a security origin from \a other. +*/ +QWebScriptWorld::QWebScriptWorld() +{ + d = new QWebScriptWorldPrivate(ScriptController::createWorld()); +} + +DOMWrapperWorld* QWebScriptWorld::world() const +{ + return d->world.get(); +} + +/*! + Destroys the security origin. +*/ +QWebScriptWorld::~QWebScriptWorld() +{ +} + diff --git a/WebKit/qt/Api/qwebscriptworld.h b/WebKit/qt/Api/qwebscriptworld.h new file mode 100644 index 0000000..6e728ab --- /dev/null +++ b/WebKit/qt/Api/qwebscriptworld.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.net> + + 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 QWebScriptWorld_h_ +#define QWebScriptWorld_h_ + +#include <QtCore/qurl.h> +#include <QtCore/qshareddata.h> + +#include "qwebkitglobal.h" + +namespace WebCore { + class DOMWrapperWorld; +} + +class QWebScriptWorldPrivate; +class QWebFrame; + +class QWEBKIT_EXPORT QWebScriptWorld { +public: + QWebScriptWorld(); + ~QWebScriptWorld(); + + WebCore::DOMWrapperWorld* world() const; + +private: + QExplicitlySharedDataPointer<QWebScriptWorldPrivate> d; + + friend class QWebFrame; +}; + +#endif diff --git a/WebKit/qt/Api/qwebscriptworld_p.h b/WebKit/qt/Api/qwebscriptworld_p.h new file mode 100644 index 0000000..7115eb2 --- /dev/null +++ b/WebKit/qt/Api/qwebscriptworld_p.h @@ -0,0 +1,44 @@ +/* + Copyright (C) 2010 Robert Hogan <robert@roberthogan.net> + + 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 _QWEBSCRIPTWORLD_P_H_ +#define _QWEBSCRIPTWORLD_P_H_ + +#include "RefPtr.h" + +namespace WebCore { + class DOMWrapperWorld; +} + +class QWebScriptWorldPrivate : public QSharedData { +public: + QWebScriptWorldPrivate(WTF::PassRefPtr<WebCore::DOMWrapperWorld> o) + { + Q_ASSERT(o); + world = o; + } + + ~QWebScriptWorldPrivate() + { + } + + WTF::RefPtr<WebCore::DOMWrapperWorld> world; +}; + +#endif diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp index 4881bac..b2766a7 100644 --- a/WebKit/qt/Api/qwebsettings.cpp +++ b/WebKit/qt/Api/qwebsettings.cpp @@ -24,9 +24,9 @@ #include "qwebpage_p.h" #include "qwebplugindatabase_p.h" +#include "AbstractDatabase.h" #include "Cache.h" #include "CrossOriginPreflightResultCache.h" -#include "Database.h" #include "FontCache.h" #include "Page.h" #include "PageCache.h" @@ -217,7 +217,7 @@ void QWebSettingsPrivate::apply() #if ENABLE(DATABASE) value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled, global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled)); - WebCore::Database::setIsAvailable(value); + WebCore::AbstractDatabase::setIsAvailable(value); #endif value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled, diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h index c063bcd..38a2b3f 100644 --- a/WebKit/qt/Api/qwebsettings.h +++ b/WebKit/qt/Api/qwebsettings.h @@ -74,8 +74,8 @@ public: LocalContentCanAccessFileUrls, TiledBackingStoreEnabled, FrameFlatteningEnabled, - WebGLEnabled, - SiteSpecificQuirksEnabled + SiteSpecificQuirksEnabled, + WebGLEnabled }; enum WebGraphic { MissingImageGraphic, diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index f83d64d..2e565ae 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,632 @@ +2010-06-24 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Symbian build fix. + + The QML WebKit integration needs to be part of QtWebKit.sis + + * declarative/declarative.pro: Removed non-working deployment. + +2010-06-23 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file after r61478. + + * symbian/eabi/QtWebKitu.def: + +2010-06-23 David Boddie <dboddie@trolltech.com> + + Reviewed by Simon Hausmann. + + [Qt] Doc: Fixed documentation errors. + + * docs/qtwebkit-bridge.qdoc: + +2010-06-23 Alessandro Portale <alessandro.portale@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Provide the Webkit Qml plugin with a UID3 on Symbian + + ...otherwise we cannot Symbian sign it. + + * declarative/declarative.pro: + +2010-06-23 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Qt package build fix. + + When building without build-webkit, set OUTPUT_DIR if necessary, like + in the other .pro files. + + * declarative/declarative.pro: + +2010-06-22 Tasuku Suzuki <tasuku.suzuki@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix compilation with QT_NO_COMBOBOX. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::createSelectPopup): + +2010-06-21 Robert Hogan <robert@webkit.org> + + [Qt] Build fix for Qt on Windows MSVC2008 + + Unreviewed, build fix. + + Fix by Jocelyn Turcotte. + + * Api/qwebframe.cpp: + +2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by nobody, build fix. + + [Qt] Fix MSVC build. + + The max macro was replacing the max function used in StringImpl.h + when compiling moc_NotificationPresenterClientQt.cpp. + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + +2010-06-21 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-21 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed build fix. + + [Qt] Fix package builds + + Don't use rpath unless we're building inside the trunk. + + * declarative/declarative.pro: + +2010-06-20 Jedrzej Nowacki <jedrzej.nowacki@nokia.com> + + Reviewed by Simon Hausmann. + + The QWebHistory regression fix. + + After change r51629 and r61207 QWebHistory's function back(), + forward(), goToItem() got broken. + + Use page->goToItem() instead of direct actions on the BackForwardList. + + [Qt] REGRESSION(r61207): qwebhistory unit test hangs + https://bugs.webkit.org/show_bug.cgi?id=40672 + + * Api/qwebhistory.cpp: + (QWebHistory::back): + (QWebHistory::forward): + (QWebHistory::goToItem): + * tests/qwebhistory/tst_qwebhistory.cpp: + (tst_QWebHistory::init): + (tst_QWebHistory::back): + (tst_QWebHistory::forward): + +2010-06-19 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Platform plugin's multi-select does not take OptGroup into account + https://bugs.webkit.org/show_bug.cgi?id=40718 + + Make sure that SelectData is valid throughout the lifetime of the dialog. + This is mostly important for the Orbt based plugin. + Added virtual desctructors where they were missing. + + * Api/qwebkitplatformplugin.h: + (QWebSelectData::~QWebSelectData): + (QWebSelectMethod::~QWebSelectMethod): + (QWebNotificationData::~QWebNotificationData): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper): + (WebCore::SelectInputMethodWrapper::~SelectInputMethodWrapper): + (WebCore::SelectInputMethodWrapper::show): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebSelectData::~QWebSelectData): + (QWebSelectMethod::~QWebSelectMethod): + (QWebNotificationData::~QWebNotificationData): + +2010-06-19 No'am Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Simon Hausmann. + + Bridge documentation: some snippets have the wrong indentation + https://bugs.webkit.org/show_bug.cgi?id=40717 + + Fixed code snippets + + * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp: + (wrapInFunction): + +2010-06-02 Robert Hogan <robert@webkit.org> + + Reviewed by Adam Barth. + + [Qt] Support evaluateScriptInIsolatedWorld() + + https://bugs.webkit.org/show_bug.cgi?id=40079 + + * Api/headers.pri: + * Api/qwebframe.cpp: + (QWebFrame::evaluateScriptInIsolatedWorld): + * Api/qwebframe.h: + * Api/qwebscriptworld.cpp: Added. + (QWebScriptWorld::QWebScriptWorld): + (QWebScriptWorld::world): + (QWebScriptWorld::~QWebScriptWorld): + * Api/qwebscriptworld.h: Added. + * Api/qwebscriptworld_p.h: Added. + (QWebScriptWorldPrivate::QWebScriptWorldPrivate): + (QWebScriptWorldPrivate::~QWebScriptWorldPrivate): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-06-19 Olivier Goffart <olivier.goffart@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Compilation in QWebPagePrivate::timerEvent with clang + https://bugs.webkit.org/show_bug.cgi?id=40714 + + QObject::timerEvent is protected and cannot be accessed by QWebPagePrivate + with clang + + QWebPagePrivate is a friend of QWebPage and then should have access to + all protected members of parents of QWebPage, including QObject. + But the clang team do not want to conform to this aspect of the specification + because "It is either a drafting error or a horrible mistake." + See http://llvm.org/bugs/show_bug.cgi?id=6840 + + This change is better because QWebPage does not reimplement the timerEvent + (QWebPagePrivate::timerEvent is called from QWebPage::event) + So customers that would reimplement their own timerEvent + for their own timer now get a chance to catch them. + + + * Api/qwebpage.cpp: + (QWebPagePrivate::timerEvent): + +2010-06-19 Mirko Damiani <mirko@develer.com> + + Reviewed by Simon Hausmann. + + [Qt] Avoid truncation of zoom factor in QWebFrame's print function. + https://bugs.webkit.org/show_bug.cgi?id=40662 + + The zoom factor is a qreal number but its value is truncated to an + integer. So a cast to qreal is needed to avoid this issue. + + * Api/qwebframe.cpp: + (QWebFrame::print): + +2010-06-18 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt + + Capture logDestroy messages from the test plugin. DRT's WebPage + is already destroyed by the time they are emitted. + + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Unskip: + plugins/open-and-close-window-with-plugin.html + plugins/geturlnotify-during-document-teardown.html + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix documentation for the declarative module import. + + * declarative/qdeclarativewebview.cpp: + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + Fix documentation issue on the onAlert handler. + Fix compilation issue with QT_NO_ACTION. + + * declarative/qdeclarativewebview.cpp: + * declarative/qdeclarativewebview_p.h: + +2010-06-18 Simon Hausmann <simon.hausmann@nokia.com> + + Reviewed by Antti Koivisto. + + REGRESSION(r60958) [Qt] qwebpage::inputMethods auto-test fails + https://bugs.webkit.org/show_bug.cgi?id=40830 + + When activating a regular input method field, always set or unset the ImhHiddenText + input method hint. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::setInputMethodState): + +2010-06-18 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Change the target path to QtWebKit. + + * declarative/declarative.pro: + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * Api/qwebsettings.cpp: + (QWebSettingsPrivate::apply): + +2010-06-17 Robert Hogan <robert@webkit.org> + + [Qt] Build fix + + Unreviewed. + + Remove includes in qdeclarativewebview*.* that rely on an installation + of QtWebKit. + + * declarative/qdeclarativewebview.cpp: + * declarative/qdeclarativewebview_p.h: + +2010-06-17 Robert Hogan <robert@webkit.org> + + Unreviewed, rolling out r61346. + http://trac.webkit.org/changeset/61346 + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Broke inspector tests on Qt + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-17 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt + + Capture logDestroy messages from the test plugin. DRT's WebPage + is already destroyed by the time they are emitted. + + https://bugs.webkit.org/show_bug.cgi?id=33333 + + Unskip: + plugins/open-and-close-window-with-plugin.html + plugins/geturlnotify-during-document-teardown.html + + * Api/qwebpage.cpp: + (QWebPage::javaScriptConsoleMessage): + +2010-06-17 Jesus Sanchez-Palencia <jesus@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit does not support viewport meta tag + https://bugs.webkit.org/show_bug.cgi?id=39902 + + Add viewport meta tag support to QtWebKit API layer. + + This implements didReceiveViewportArguments in our ChromeClientQt + which is hooked up with QWebPage::viewportChangeRequested(). + This signal does not affect the current default behavior. + The documentation of the signal explains how to make use of this new feature. + + * Api/qwebframe_p.h: + (QWebFramePrivate::QWebFramePrivate): + Store information about whether the page has been laid out or not. + * Api/qwebpage.cpp: + (QWebPage::viewportChangeRequested): + * Api/qwebpage_p.h: + Added class QtViewportHintsPrivate. + * Api/qwebpage.h: + (QWebPage::setPreferredContentsSize): + Improved documentation and now only layout if the page had already + passed layout phase. + Added class QWebPage::ViewportHints. + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::windowRect): + Modified to work as intended by the DOM, for both QWebView + and QGraphicsWebView. + (WebCore::ChromeClientQt::didReceiveViewportArguments): + Emits the signal QWebPage::viewportChangeRequested. + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout): + Update information about whether the page has been laid out or not. + If the page has been laid out we ignore any further viewport meta data. + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PageClientQWidget::windowRect): + (WebCore::PageClientQGraphicsWidget::windowRect): + (WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect): + * WebCoreSupport/PageClientQt.h: + The PageClient is now responsible for providing the right window rect. + +2010-06-17 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Upstream the WebKit QML integration plugin + https://bugs.webkit.org/show_bug.cgi?id=40050 + + Add to the Qt port the QML WebKit integration plugin. + QDeclarativeWebView is creating the item and expose + properties. The C++ API is not public, only the + properties are. + + * declarative/declarative.pro: Added. + * declarative/plugin.cpp: Added. + (WebKitQmlPlugin::registerTypes): + * declarative/qdeclarativewebview.cpp: Added. + (QDeclarativeWebViewPrivate::QDeclarativeWebViewPrivate): + (QDeclarativeWebViewPrivate::): + (QDeclarativeWebViewPrivate::windowObjectsAppend): + (GraphicsWebView::GraphicsWebView): + (GraphicsWebView::mousePressEvent): + (GraphicsWebView::mouseReleaseEvent): + (GraphicsWebView::mouseDoubleClickEvent): + (GraphicsWebView::timerEvent): + (GraphicsWebView::mouseMoveEvent): + (QDeclarativeWebView::QDeclarativeWebView): + (QDeclarativeWebView::~QDeclarativeWebView): + (QDeclarativeWebView::init): + (QDeclarativeWebView::componentComplete): + (QDeclarativeWebView::status): + (QDeclarativeWebView::progress): + (QDeclarativeWebView::doLoadStarted): + (QDeclarativeWebView::doLoadProgress): + (QDeclarativeWebView::pageUrlChanged): + (QDeclarativeWebView::doLoadFinished): + (QDeclarativeWebView::url): + (QDeclarativeWebView::setUrl): + (QDeclarativeWebView::preferredWidth): + (QDeclarativeWebView::setPreferredWidth): + (QDeclarativeWebView::preferredHeight): + (QDeclarativeWebView::setPreferredHeight): + (QDeclarativeWebView::evaluateJavaScript): + (QDeclarativeWebView::updateDeclarativeWebViewSize): + (QDeclarativeWebView::initialLayout): + (QDeclarativeWebView::updateContentsSize): + (QDeclarativeWebView::geometryChanged): + (QDeclarativeWebView::javaScriptWindowObjects): + (QDeclarativeWebView::qmlAttachedProperties): + (QDeclarativeWebViewPrivate::updateWindowObjects): + (QDeclarativeWebView::renderingEnabled): + (QDeclarativeWebView::setRenderingEnabled): + (QDeclarativeWebView::heuristicZoom): + (QDeclarativeWebView::pressGrabTime): + (QDeclarativeWebView::setPressGrabTime): + (QDeclarativeWebView::backAction): + (QDeclarativeWebView::forwardAction): + (QDeclarativeWebView::reloadAction): + (QDeclarativeWebView::stopAction): + (QDeclarativeWebView::title): + (QDeclarativeWebView::icon): + (QDeclarativeWebView::setStatusText): + (QDeclarativeWebView::windowObjectCleared): + (QDeclarativeWebView::statusText): + (QDeclarativeWebView::page): + (QDeclarativeWebView::settingsObject): + (QDeclarativeWebView::setPage): + (QDeclarativeWebView::load): + (QDeclarativeWebView::html): + (QDeclarativeWebView::setHtml): + (QDeclarativeWebView::setContent): + (QDeclarativeWebView::history): + (QDeclarativeWebView::settings): + (QDeclarativeWebView::createWindow): + (QDeclarativeWebView::newWindowComponent): + (QDeclarativeWebView::setNewWindowComponent): + (QDeclarativeWebView::newWindowParent): + (QDeclarativeWebView::setNewWindowParent): + (QDeclarativeWebView::contentsSize): + (QDeclarativeWebView::contentsScale): + (QDeclarativeWebView::setContentsScale): + (QDeclarativeWebView::elementAreaAt): + (QDeclarativeWebPage::QDeclarativeWebPage): + (QDeclarativeWebPage::~QDeclarativeWebPage): + (QDeclarativeWebPage::chooseFile): + (QDeclarativeWebPage::javaScriptAlert): + (QDeclarativeWebPage::javaScriptConfirm): + (QDeclarativeWebPage::javaScriptPrompt): + (QDeclarativeWebPage::viewItem): + (QDeclarativeWebPage::createWindow): + * declarative/qdeclarativewebview_p.h: Added. + (QDeclarativeWebView::): + (QDeclarativeWebView::isComponentCompletePublic): + (QDeclarativeWebViewAttached::QDeclarativeWebViewAttached): + (QDeclarativeWebViewAttached::windowObjectName): + (QDeclarativeWebViewAttached::setWindowObjectName): + (QDeclarativeWebSettings::QDeclarativeWebSettings): + (QDeclarativeWebSettings::standardFontFamily): + (QDeclarativeWebSettings::setStandardFontFamily): + (QDeclarativeWebSettings::fixedFontFamily): + (QDeclarativeWebSettings::setFixedFontFamily): + (QDeclarativeWebSettings::serifFontFamily): + (QDeclarativeWebSettings::setSerifFontFamily): + (QDeclarativeWebSettings::sansSerifFontFamily): + (QDeclarativeWebSettings::setSansSerifFontFamily): + (QDeclarativeWebSettings::cursiveFontFamily): + (QDeclarativeWebSettings::setCursiveFontFamily): + (QDeclarativeWebSettings::fantasyFontFamily): + (QDeclarativeWebSettings::setFantasyFontFamily): + (QDeclarativeWebSettings::minimumFontSize): + (QDeclarativeWebSettings::setMinimumFontSize): + (QDeclarativeWebSettings::minimumLogicalFontSize): + (QDeclarativeWebSettings::setMinimumLogicalFontSize): + (QDeclarativeWebSettings::defaultFontSize): + (QDeclarativeWebSettings::setDefaultFontSize): + (QDeclarativeWebSettings::defaultFixedFontSize): + (QDeclarativeWebSettings::setDefaultFixedFontSize): + (QDeclarativeWebSettings::autoLoadImages): + (QDeclarativeWebSettings::setAutoLoadImages): + (QDeclarativeWebSettings::javascriptEnabled): + (QDeclarativeWebSettings::setJavascriptEnabled): + (QDeclarativeWebSettings::javaEnabled): + (QDeclarativeWebSettings::setJavaEnabled): + (QDeclarativeWebSettings::pluginsEnabled): + (QDeclarativeWebSettings::setPluginsEnabled): + (QDeclarativeWebSettings::privateBrowsingEnabled): + (QDeclarativeWebSettings::setPrivateBrowsingEnabled): + (QDeclarativeWebSettings::javascriptCanOpenWindows): + (QDeclarativeWebSettings::setJavascriptCanOpenWindows): + (QDeclarativeWebSettings::javascriptCanAccessClipboard): + (QDeclarativeWebSettings::setJavascriptCanAccessClipboard): + (QDeclarativeWebSettings::developerExtrasEnabled): + (QDeclarativeWebSettings::setDeveloperExtrasEnabled): + (QDeclarativeWebSettings::linksIncludedInFocusChain): + (QDeclarativeWebSettings::setLinksIncludedInFocusChain): + (QDeclarativeWebSettings::zoomTextOnly): + (QDeclarativeWebSettings::setZoomTextOnly): + (QDeclarativeWebSettings::printElementBackgrounds): + (QDeclarativeWebSettings::setPrintElementBackgrounds): + (QDeclarativeWebSettings::offlineStorageDatabaseEnabled): + (QDeclarativeWebSettings::setOfflineStorageDatabaseEnabled): + (QDeclarativeWebSettings::offlineWebApplicationCacheEnabled): + (QDeclarativeWebSettings::setOfflineWebApplicationCacheEnabled): + (QDeclarativeWebSettings::localStorageDatabaseEnabled): + (QDeclarativeWebSettings::setLocalStorageDatabaseEnabled): + (QDeclarativeWebSettings::localContentCanAccessRemoteUrls): + (QDeclarativeWebSettings::setLocalContentCanAccessRemoteUrls): + * declarative/qmldir: Added. + * docs/qtwebkit.qdocconf: + +2010-06-17 Mark Brand <mabrand@mabrand.nl> + + Reviewed by Simon Hausmann. + + [Qt] use "win32-g++*" scope to match all MinGW makespecs + + The scope "win32-g++" comes from the name of the makespec. However, it + is frequently used to check for MinGW. This works fine as long as + win32-g++ is the only makespec for MinGW. Now we need the wildcard + to cover "win32-g++-cross" as well. + + * Api/DerivedSources.pro: + +2010-05-28 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com> + + Reviewed by Simon Hausmann, Antti Koivisto + + [Qt] Add internal Qt Api to configure repaint throttling parameters. + https://bugs.webkit.org/show_bug.cgi?id=38401 + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-06-16 Alexis Menard <alexis.menard@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Fix tiled backing store painting when calling QGraphicsWebView::setPage() after setResizesToContents(true) + + When calling setPage() after setResizesToContents, the value of the property wasn't propagated + to the page client. Therefore the visible rect for the tiled backing store was incorrect. + + Simply move the variable assignment into updateResizesToContentsForPage(), which is always called. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): + (QGraphicsWebView::setResizesToContents): + +2010-06-16 Simon Hausmann <simon.hausmann@nokia.com> + + Rubber-stamped by Tor Arne Vestbø. + + Swap WebGL and SiteSpecificQuirks attributes in the QWebSettings + enum, to allow for binary compatibility with qtwebkit-2.0, where + WebGL is not in the settings but SiteSpecificQuirks will be. + + * Api/qwebsettings.h: + +2010-06-15 Darin Adler <darin@apple.com> + + Fix build. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::shouldClose): Call loader()->shouldClose(). + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Rename NotificatioIconWrapper to NotificationWrapper + https://bugs.webkit.org/show_bug.cgi?id=40571 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationWrapper::NotificationWrapper): + (WebCore::NotificationWrapper::close): + (WebCore::NotificationWrapper::title): + (WebCore::NotificationWrapper::message): + (WebCore::NotificationWrapper::iconData): + (WebCore::NotificationWrapper::notificationClosed): + (WebCore::NotificationPresenterClientQt::displayNotification): + (WebCore::NotificationPresenterClientQt::cancel): + (WebCore::NotificationPresenterClientQt::notificationForWrapper): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationWrapper::~NotificationWrapper): + +2010-06-15 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Unreviewed. + + Fix typo in reviewer name in r61187 + +2010-06-15 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Simon Fraser. + + [Qt] Build fix for Qt minimal after r61121 + https://bugs.webkit.org/show_bug.cgi?id=40624 + + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (WebCore::NotificationIconWrapper::NotificationIconWrapper): + (WebCore::NotificationIconWrapper::close): + (WebCore::NotificationIconWrapper::title): + (WebCore::NotificationIconWrapper::message): + (WebCore::NotificationIconWrapper::iconData): + (WebCore::NotificationIconWrapper::notificationClosed): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationIconWrapper::~NotificationIconWrapper): + +2010-06-14 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed, Symbian build fix. + + [Qt] Update the def file with recent new exports. + + * symbian/eabi/QtWebKitu.def: + 2010-06-13 Yael Aharon <yael.aharon@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index 98ffd8a..faec705 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -37,36 +37,37 @@ #include "FrameLoaderClientQt.h" #include "FrameView.h" #include "Geolocation.h" +#if USE(ACCELERATED_COMPOSITING) +#include "GraphicsLayerQt.h" +#endif #include "HitTestResult.h" #include "Icon.h" #include "NotImplemented.h" #include "NotificationPresenterClientQt.h" -#include "ScrollbarTheme.h" -#include "WindowFeatures.h" +#include "PageClientQt.h" #if defined(Q_WS_MAEMO_5) #include "QtMaemoWebPopup.h" #else #include "QtFallbackWebPopup.h" #endif #include "QWebPageClient.h" +#include "ScrollbarTheme.h" #include "SecurityOrigin.h" +#include "ViewportArguments.h" +#include "WindowFeatures.h" +#include "qgraphicswebview.h" #include "qwebframe_p.h" #include "qwebpage.h" #include "qwebpage_p.h" #include "qwebsecurityorigin.h" #include "qwebsecurityorigin_p.h" #include "qwebview.h" - #include <qdebug.h> #include <qeventloop.h> #include <qtextdocument.h> #include <qtooltip.h> -#if USE(ACCELERATED_COMPOSITING) -#include "GraphicsLayerQt.h" -#endif - namespace WebCore { ChromeClientQt::ChromeClientQt(QWebPage* webPage) @@ -90,19 +91,18 @@ void ChromeClientQt::setWindowRect(const FloatRect& rect) qRound(rect.width()), qRound(rect.height()))); } - +/*! + windowRect represents the rect of the Window, including all interface elements + like toolbars/scrollbars etc. It is used by the viewport meta tag as well as + by the DOM Window object: outerHeight(), outerWidth(), screenX(), screenY(). +*/ FloatRect ChromeClientQt::windowRect() { - if (!m_webPage) - return FloatRect(); - - QWidget* view = m_webPage->view(); - if (!view) + if (!platformPageClient()) return FloatRect(); - return IntRect(view->window()->geometry()); + return platformPageClient()->windowRect(); } - FloatRect ChromeClientQt::pageRect() { if (!m_webPage) @@ -595,7 +595,7 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup() #elif !defined(QT_NO_COMBOBOX) return new QtFallbackWebPopup; #else - return result; + return 0; #endif } @@ -626,4 +626,23 @@ bool ChromeClientQt::isMinimized() } #endif +void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const +{ + if (m_webPage->mainFrame()->d->initialLayoutComplete) + return; + + QSize viewportSize(arguments.width, arguments.height); + bool isUserScalable = arguments.userScalable == 1; + + QWebPage::ViewportHints hints; + hints.m_isValid = true; + hints.m_size = viewportSize; + hints.m_initialScaleFactor = arguments.initialScale; + hints.m_minimumScaleFactor = arguments.minimumScale; + hints.m_maximumScaleFactor = arguments.maximumScale; + hints.m_isUserScalable = isUserScalable; + + emit m_webPage->viewportChangeRequested(hints); } + +} // namespace WebCore diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h index 0396aef..4b55eb2 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -48,6 +48,7 @@ namespace WebCore { class Page; struct FrameLoadRequest; class QtAbstractWebPopup; + struct ViewportArguments; class ChromeClientQt : public ChromeClient { @@ -177,6 +178,8 @@ namespace WebCore { QtAbstractWebPopup* createSelectPopup(); + virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const; + QWebPage* m_webPage; WebCore::KURL lastHoverURL; WebCore::String lastHoverTitle; diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index c92e43f..0ae55d7 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -331,13 +331,6 @@ void DumpRenderTreeSupportQt::resumeActiveDOMObjects(QWebFrame* frame) coreFrame->document()->resumeActiveDOMObjects(); } -void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script) -{ - Frame* coreFrame = QWebFramePrivate::core(frame); - if (coreFrame) - JSC::JSValue result = coreFrame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue(); -} - void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) { SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); @@ -621,7 +614,7 @@ QList<QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebH bool DumpRenderTreeSupportQt::shouldClose(QWebFrame* frame) { WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); - return coreFrame->shouldClose(); + return coreFrame->loader()->shouldClose(); } // Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h index e3408e3..0b94a03 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -70,7 +70,6 @@ public: static void setMediaType(QWebFrame* qframe, const QString& type); static void setDumpRenderTreeModeEnabled(bool b); - static void evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script); static void garbageCollectorCollect(); static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone); static void setJavaScriptProfilingEnabled(QWebFrame*, bool enabled); diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 93e5745..e140968 100644 --- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -611,6 +611,7 @@ void EditorClientQt::setInputMethodState(bool active) webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField()); webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField()); webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField()); + webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField()); } } diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index e86a84a..42b0c49 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -380,6 +380,8 @@ void FrameLoaderClientQt::dispatchDidCommitLoad() if (m_frame->tree()->parent() || !m_webFrame) return; + m_webFrame->d->initialLayoutComplete = false; + emit m_webFrame->urlChanged(m_webFrame->url()); m_webFrame->page()->d->updateNavigationActions(); @@ -387,6 +389,12 @@ void FrameLoaderClientQt::dispatchDidCommitLoad() // will be called very soon with the correct title. // This properly resets the title when we navigate to a URI without a title. emit titleChanged(String()); + + bool isMainFrame = (m_frame == m_frame->page()->mainFrame()); + if (!isMainFrame) + return; + + emit m_webFrame->page()->viewportChangeRequested(QWebPage::ViewportHints()); } @@ -424,7 +432,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad() void FrameLoaderClientQt::dispatchDidFirstLayout() { - notImplemented(); + m_webFrame->d->initialLayoutComplete = true; } void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout() diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp index 8bde5c4..c90b3b5 100644 --- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp @@ -42,10 +42,10 @@ #include "qwebkitglobal.h" #include <QtGui> -#if ENABLE(NOTIFICATIONS) - namespace WebCore { +#if ENABLE(NOTIFICATIONS) + const double notificationTimeout = 10.0; bool NotificationPresenterClientQt::dumpNotification = false; @@ -61,51 +61,69 @@ NotificationPresenterClientQt* NotificationPresenterClientQt::notificationPresen return s_notificationPresenter; } -NotificationIconWrapper::NotificationIconWrapper() - : m_closeTimer(this, &NotificationIconWrapper::close) +#endif + +NotificationWrapper::NotificationWrapper() + : m_closeTimer(this, &NotificationWrapper::close) { +#if ENABLE(NOTIFICATIONS) + #ifndef QT_NO_SYSTEMTRAYICON m_notificationIcon = 0; #endif m_presenter = 0; +#endif } -NotificationIconWrapper::~NotificationIconWrapper() -{ -} - -void NotificationIconWrapper::close(Timer<NotificationIconWrapper>*) +void NotificationWrapper::close(Timer<NotificationWrapper>*) { +#if ENABLE(NOTIFICATIONS) NotificationPresenterClientQt::notificationPresenter()->cancel(this); +#endif } -const QString NotificationIconWrapper::title() const +const QString NotificationWrapper::title() const { +#if ENABLE(NOTIFICATIONS) Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); if (notification) return notification->contents().title(); +#endif return QString(); } -const QString NotificationIconWrapper::message() const +const QString NotificationWrapper::message() const { +#if ENABLE(NOTIFICATIONS) Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); if (notification) return notification->contents().body(); +#endif return QString(); } -const QByteArray NotificationIconWrapper::iconData() const +const QByteArray NotificationWrapper::iconData() const { - Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); QByteArray iconData; +#if ENABLE(NOTIFICATIONS) + Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this); if (notification) { if (notification->iconData()) iconData = QByteArray::fromRawData(notification->iconData()->data(), notification->iconData()->size()); } +#endif return iconData; } +void NotificationWrapper::notificationClosed() +{ +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::notificationPresenter()->cancel(this); +#endif +} + +#if ENABLE(NOTIFICATIONS) + NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0) { } @@ -127,11 +145,6 @@ void NotificationPresenterClientQt::removeClient() } } -void NotificationIconWrapper::notificationClosed() -{ - NotificationPresenterClientQt::notificationPresenter()->cancel(this); -} - bool NotificationPresenterClientQt::show(Notification* notification) { // FIXME: workers based notifications are not supported yet. @@ -152,7 +165,7 @@ bool NotificationPresenterClientQt::show(Notification* notification) void NotificationPresenterClientQt::displayNotification(Notification* notification, const QByteArray& bytes) { - NotificationIconWrapper* wrapper = new NotificationIconWrapper(); + NotificationWrapper* wrapper = new NotificationWrapper(); m_notifications.insert(notification, wrapper); QString title; QString message; @@ -213,14 +226,14 @@ void NotificationPresenterClientQt::cancel(Notification* notification) } } -void NotificationPresenterClientQt::cancel(NotificationIconWrapper* wrapper) +void NotificationPresenterClientQt::cancel(NotificationWrapper* wrapper) { Notification* notification = notificationForWrapper(wrapper); if (notification) cancel(notification); } -Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationIconWrapper* wrapper) const +Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationWrapper* wrapper) const { NotificationsQueue::ConstIterator end = m_notifications.end(); NotificationsQueue::ConstIterator iter = m_notifications.begin(); @@ -341,5 +354,7 @@ void NotificationPresenterClientQt::dumpShowText(Notification* notification) } } -} #endif // ENABLE(NOTIFICATIONS) +} + +#include "moc_NotificationPresenterClientQt.cpp" diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h index 1630cd9..82c5f7c 100644 --- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h +++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h @@ -47,14 +47,14 @@ namespace WebCore { class Document; class KURL; -class NotificationIconWrapper : public QObject, public QWebNotificationData { +class NotificationWrapper : public QObject, public QWebNotificationData { Q_OBJECT public: - NotificationIconWrapper(); - ~NotificationIconWrapper(); + NotificationWrapper(); + ~NotificationWrapper() {} void close(); - void close(Timer<NotificationIconWrapper>*); + void close(Timer<NotificationWrapper>*); const QString title() const; const QString message() const; const QByteArray iconData() const; @@ -68,12 +68,12 @@ public: #endif OwnPtr<QWebNotificationPresenter> m_presenter; - Timer<NotificationIconWrapper> m_closeTimer; + Timer<NotificationWrapper> m_closeTimer; }; #if ENABLE(NOTIFICATIONS) -typedef QHash <Notification*, NotificationIconWrapper*> NotificationsQueue; +typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue; class NotificationPresenterClientQt : public NotificationPresenter { public: @@ -87,7 +87,7 @@ public: virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>); virtual NotificationPresenter::Permission checkPermission(const KURL&); - void cancel(NotificationIconWrapper*); + void cancel(NotificationWrapper*); void allowNotificationForOrigin(const QString& origin); @@ -99,7 +99,7 @@ public: void removeClient(); static NotificationPresenterClientQt* notificationPresenter(); - Notification* notificationForWrapper(const NotificationIconWrapper*) const; + Notification* notificationForWrapper(const NotificationWrapper*) const; private: void sendEvent(Notification*, const AtomicString& eventName); diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp index 4ccf34a..f52c382 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -103,6 +103,11 @@ QStyle* PageClientQWidget::style() const return view->style(); } +QRectF PageClientQWidget::windowRect() const +{ + return QRectF(view->window()->geometry()); +} + PageClientQGraphicsWidget::~PageClientQGraphicsWidget() { #if USE(ACCELERATED_COMPOSITING) @@ -292,14 +297,14 @@ QRect PageClientQGraphicsWidget::geometryRelativeToOwnerWidget() const #if ENABLE(TILED_BACKING_STORE) QRectF PageClientQGraphicsWidget::graphicsItemVisibleRect() const -{ +{ if (!view->scene()) return QRectF(); QList<QGraphicsView*> views = view->scene()->views(); if (views.isEmpty()) return QRectF(); - + QGraphicsView* graphicsView = views.at(0); int xOffset = graphicsView->horizontalScrollBar()->value(); int yOffset = graphicsView->verticalScrollBar()->value(); @@ -317,6 +322,13 @@ QStyle* PageClientQGraphicsWidget::style() const return view->style(); } +QRectF PageClientQGraphicsWidget::windowRect() const +{ + if (!view->scene()) + return QRectF(); - + // The sceneRect is a good approximation of the size of the application, independent of the view. + return view->scene()->sceneRect(); } + +} // namespace WebCore diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h index 818c67a..4d42ca1 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.h +++ b/WebKit/qt/WebCoreSupport/PageClientQt.h @@ -76,9 +76,11 @@ public: virtual QObject* pluginParent() const; virtual QStyle* style() const; - + virtual bool viewResizesToContentsEnabled() const { return false; } + virtual QRectF windowRect() const; + QWidget* view; }; @@ -182,6 +184,8 @@ public: virtual bool allowsAcceleratedCompositing() const { return true; } #endif + virtual QRectF windowRect() const; + QGraphicsWidget* view; QWebPage* page; bool viewResizesToContents; diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp index 5e7e6d1..cccb07c 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -56,16 +56,24 @@ QWebSelectData::ItemType SelectData::itemType(int index) const SelectInputMethodWrapper::SelectInputMethodWrapper(QWebSelectMethod* plugin) : m_plugin(plugin) + , m_selectData(0) { m_plugin->setParent(this); connect(m_plugin, SIGNAL(didHide()), this, SLOT(didHide())); connect(m_plugin, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool))); } +SelectInputMethodWrapper::~SelectInputMethodWrapper() +{ + delete m_selectData; +} + void SelectInputMethodWrapper::show() { - SelectData data(this); - m_plugin->show(data); + if (m_selectData) + delete m_selectData; + m_selectData = new SelectData(this); + m_plugin->show(*m_selectData); } void SelectInputMethodWrapper::hide() diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h index ff10d58..2de4859 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -28,6 +28,7 @@ class QWebSelectMethod; class QWebKitPlatformPlugin; class QWebNotificationPresenter; +class QWebSelectData; namespace WebCore { @@ -35,6 +36,7 @@ class SelectInputMethodWrapper : public QObject, public QtAbstractWebPopup { Q_OBJECT public: SelectInputMethodWrapper(QWebSelectMethod* plugin); + ~SelectInputMethodWrapper(); virtual void show(); virtual void hide(); @@ -45,6 +47,7 @@ private Q_SLOTS: private: QWebSelectMethod* m_plugin; + QWebSelectData* m_selectData; }; class QtPlatformPlugin { diff --git a/WebKit/qt/declarative/declarative.pro b/WebKit/qt/declarative/declarative.pro new file mode 100644 index 0000000..75268f3 --- /dev/null +++ b/WebKit/qt/declarative/declarative.pro @@ -0,0 +1,72 @@ +TARGET = qmlwebkitplugin +TARGETPATH = QtWebKit + +TEMPLATE = lib +CONFIG += qt plugin + +win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release + +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../.. + +QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir +copy2build.input = QMLDIRFILE +CONFIG(QTDIR_build) { + copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir +} else { + copy2build.output = $$OUTPUT_DIR/imports/$$TARGETPATH/qmldir +} +!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS +copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} +copy2build.name = COPY ${QMAKE_FILE_IN} +copy2build.CONFIG += no_link +QMAKE_EXTRA_COMPILERS += copy2build + +TARGET = $$qtLibraryTarget($$TARGET) +contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols + +wince*:LIBS += $$QMAKE_LIBS_GUI + +symbian: { + TARGET.EPOCALLOWDLLDATA=1 + TARGET.CAPABILITY = All -Tcb + load(armcc_warnings) +} + +include(../../../WebKit.pri) + +QT += declarative + +!CONFIG(standalone_package) { + linux-* { + # From Creator's src/rpath.pri: + # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR + # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var. + QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR + MY_RPATH = $$join(QMAKE_RPATHDIR, ":") + + QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\' + QMAKE_RPATHDIR = + } else { + QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR + } +} + +SOURCES += qdeclarativewebview.cpp plugin.cpp +HEADERS += qdeclarativewebview_p.h + +CONFIG(QTDIR_build) { + DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH +} else { + DESTDIR = $$OUTPUT_DIR/imports/$$TARGETPATH +} +target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + + +qmldir.files += $$PWD/qmldir +qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH + +symbian:{ + TARGET.UID3 = 0x20021321 +} + +INSTALLS += target qmldir diff --git a/WebKit/qt/declarative/plugin.cpp b/WebKit/qt/declarative/plugin.cpp new file mode 100644 index 0000000..f1f165e --- /dev/null +++ b/WebKit/qt/declarative/plugin.cpp @@ -0,0 +1,43 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "qdeclarativewebview_p.h" + +#include <QtDeclarative/qdeclarative.h> +#include <QtDeclarative/qdeclarativeextensionplugin.h> + +QT_BEGIN_NAMESPACE + +class WebKitQmlPlugin : public QDeclarativeExtensionPlugin { + Q_OBJECT +public: + virtual void registerTypes(const char* uri) + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit")); + qmlRegisterType<QDeclarativeWebSettings>(); + qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin)); + diff --git a/WebKit/qt/declarative/qdeclarativewebview.cpp b/WebKit/qt/declarative/qdeclarativewebview.cpp new file mode 100644 index 0000000..a349bec --- /dev/null +++ b/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -0,0 +1,1022 @@ +/* + Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "qdeclarativewebview_p.h" + +#include <QtCore/QDebug> +#include <QtCore/QEvent> +#include <QtCore/QFile> +#include <QtDeclarative/QDeclarativeContext> +#include <QtDeclarative/QDeclarativeEngine> +#include <QtDeclarative/qdeclarative.h> +#include <QtGui/QApplication> +#include <QtGui/QGraphicsSceneMouseEvent> +#include <QtGui/QKeyEvent> +#include <QtGui/QMouseEvent> +#include <QtGui/QPen> +#include "qwebelement.h" +#include "qwebframe.h" +#include "qwebpage.h" +#include "qwebsettings.h" + +QT_BEGIN_NAMESPACE + +class QDeclarativeWebViewPrivate { +public: + QDeclarativeWebViewPrivate(QDeclarativeWebView* qq) + : q(qq) + , preferredwidth(0) + , preferredheight(0) + , progress(1.0) + , status(QDeclarativeWebView::Null) + , pending(PendingNone) + , newWindowComponent(0) + , newWindowParent(0) + , rendering(true) + { + } + + QDeclarativeWebView* q; + + QUrl url; // page url might be different if it has not loaded yet + GraphicsWebView* view; + + int preferredwidth, preferredheight; + qreal progress; + QDeclarativeWebView::Status status; + QString statusText; + enum { PendingNone, PendingUrl, PendingHtml, PendingContent } pending; + QUrl pendingUrl; + QString pendingString; + QByteArray pendingData; + mutable QDeclarativeWebSettings settings; + QDeclarativeComponent* newWindowComponent; + QDeclarativeItem* newWindowParent; + + static void windowObjectsAppend(QDeclarativeListProperty<QObject>* prop, QObject* o) + { + static_cast<QDeclarativeWebViewPrivate*>(prop->data)->windowObjects.append(o); + static_cast<QDeclarativeWebViewPrivate*>(prop->data)->updateWindowObjects(); + } + + void updateWindowObjects(); + QObjectList windowObjects; + + bool rendering; +}; + +GraphicsWebView::GraphicsWebView(QDeclarativeWebView* parent) + : QGraphicsWebView(parent) + , parent(parent) + , pressTime(400) +{ +} + +void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event) +{ + setFocus(); + pressPoint = event->pos(); + if (pressTime) { + pressTimer.start(pressTime, this); + parent->setKeepMouseGrab(false); + } else { + grabMouse(); + parent->setKeepMouseGrab(true); + } + QGraphicsWebView::mousePressEvent(event); +} + +void GraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) +{ + QGraphicsWebView::mouseReleaseEvent(event); + pressTimer.stop(); + parent->setKeepMouseGrab(false); + ungrabMouse(); +} + +void GraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) +{ + QMouseEvent* me = new QMouseEvent(QEvent::MouseButtonDblClick, (event->pos() / parent->contentsScale()).toPoint(), event->button(), event->buttons(), 0); + emit doubleClick(event->pos().x(), event->pos().y()); + delete me; +} + +void GraphicsWebView::timerEvent(QTimerEvent* event) +{ + if (event->timerId() == pressTimer.timerId()) { + pressTimer.stop(); + grabMouse(); + parent->setKeepMouseGrab(true); + } +} + +void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event) +{ + if (pressTimer.isActive()) { + if ((event->pos() - pressPoint).manhattanLength() > QApplication::startDragDistance()) + pressTimer.stop(); + } + if (parent->keepMouseGrab()) + QGraphicsWebView::mouseMoveEvent(event); +} + +/*! + \qmlclass WebView QDeclarativeWebView + \since 4.7 + \brief The WebView item allows you to add web content to a canvas. + \inherits Item + + A WebView renders web content based on a URL. + + This type is made available by importing the \c QtWebKit module: + + \bold{import QtWebKit 1.0} + + If the width and height of the item is not set, they will + dynamically adjust to a size appropriate for the content. + This width may be large for typical online web pages. + + If the width or height is explictly set, the rendered website + will be clipped, not scaled, to fit into the set dimensions. + + If the preferredWidth is set, the width will be this amount or larger, + usually laying out the web content to fit the preferredWidth. + + \qml + import QtWebKit 1.0 + + WebView { + url: "http://www.nokia.com" + preferredWidth: 490 + preferredHeight: 400 + scale: 0.5 + smooth: false + smoothCache: true + } + \endqml + + \image webview.png + + The item includes no scrolling, scaling, + toolbars, etc., those must be implemented around WebView. See the WebBrowser example + for a demonstration of this. + + When this item has keyboard focus, all keyboard input will be sent directly to the + web page within. +*/ + +/*! + \internal + \class QDeclarativeWebView + \brief The QDeclarativeWebView class allows you to add web content to a QDeclarativeView. + + A WebView renders web content base on a URL. + + \image webview.png + + The item includes no scrolling, scaling, + toolbars, etc., those must be implemented around WebView. See the WebBrowser example + for a demonstration of this. + + A QDeclarativeWebView object can be instantiated in Qml using the tag \l WebView. +*/ + +QDeclarativeWebView::QDeclarativeWebView(QDeclarativeItem *parent) : QDeclarativeItem(parent) +{ + init(); +} + +QDeclarativeWebView::~QDeclarativeWebView() +{ + delete d; +} + +void QDeclarativeWebView::init() +{ + d = new QDeclarativeWebViewPrivate(this); + + QWebSettings::enablePersistentStorage(); + + setAcceptedMouseButtons(Qt::LeftButton); + setFlag(QGraphicsItem::ItemHasNoContents, true); + setClip(true); + + d->view = new GraphicsWebView(this); + d->view->setResizesToContents(true); + QWebPage* wp = new QDeclarativeWebPage(this); + setPage(wp); + connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize())); + connect(d->view, SIGNAL(doubleClick(int, int)), this, SIGNAL(doubleClick(int, int))); + connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged())); +} + +void QDeclarativeWebView::componentComplete() +{ + QDeclarativeItem::componentComplete(); + page()->setNetworkAccessManager(qmlEngine(this)->networkAccessManager()); + + switch (d->pending) { + case QDeclarativeWebViewPrivate::PendingUrl: + setUrl(d->pendingUrl); + break; + case QDeclarativeWebViewPrivate::PendingHtml: + setHtml(d->pendingString, d->pendingUrl); + break; + case QDeclarativeWebViewPrivate::PendingContent: + setContent(d->pendingData, d->pendingString, d->pendingUrl); + break; + default: + break; + } + d->pending = QDeclarativeWebViewPrivate::PendingNone; + d->updateWindowObjects(); +} + +QDeclarativeWebView::Status QDeclarativeWebView::status() const +{ + return d->status; +} + + +/*! + \qmlproperty real WebView::progress + This property holds the progress of loading the current URL, from 0 to 1. + + If you just want to know when progress gets to 1, use + WebView::onLoadFinished() or WebView::onLoadFailed() instead. +*/ +qreal QDeclarativeWebView::progress() const +{ + return d->progress; +} + +void QDeclarativeWebView::doLoadStarted() +{ + if (!d->url.isEmpty()) { + d->status = Loading; + emit statusChanged(d->status); + } + emit loadStarted(); +} + +void QDeclarativeWebView::doLoadProgress(int p) +{ + if (d->progress == p / 100.0) + return; + d->progress = p / 100.0; + emit progressChanged(); +} + +void QDeclarativeWebView::pageUrlChanged() +{ + updateContentsSize(); + + if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank"))) + || (d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty())) + { + d->url = page()->mainFrame()->url(); + if (d->url == QUrl(QLatin1String("about:blank"))) + d->url = QUrl(); + emit urlChanged(); + } +} + +void QDeclarativeWebView::doLoadFinished(bool ok) +{ + if (ok) { + d->status = d->url.isEmpty() ? Null : Ready; + emit loadFinished(); + } else { + d->status = Error; + emit loadFailed(); + } + emit statusChanged(d->status); +} + +/*! + \qmlproperty url WebView::url + This property holds the URL to the page displayed in this item. It can be set, + but also can change spontaneously (eg. because of network redirection). + + If the url is empty, the page is blank. + + The url is always absolute (QML will resolve relative URL strings in the context + of the containing QML document). +*/ +QUrl QDeclarativeWebView::url() const +{ + return d->url; +} + +void QDeclarativeWebView::setUrl(const QUrl& url) +{ + if (url == d->url) + return; + + if (isComponentComplete()) { + d->url = url; + updateContentsSize(); + QUrl seturl = url; + if (seturl.isEmpty()) + seturl = QUrl(QLatin1String("about:blank")); + + Q_ASSERT(!seturl.isRelative()); + + page()->mainFrame()->load(seturl); + + emit urlChanged(); + } else { + d->pending = d->PendingUrl; + d->pendingUrl = url; + } +} + +/*! + \qmlproperty int WebView::preferredWidth + This property holds the ideal width for displaying the current URL. +*/ +int QDeclarativeWebView::preferredWidth() const +{ + return d->preferredwidth; +} + +void QDeclarativeWebView::setPreferredWidth(int width) +{ + if (d->preferredwidth == width) + return; + d->preferredwidth = width; + updateContentsSize(); + emit preferredWidthChanged(); +} + +/*! + \qmlproperty int WebView::preferredHeight + This property holds the ideal height for displaying the current URL. + This only affects the area zoomed by heuristicZoom(). +*/ +int QDeclarativeWebView::preferredHeight() const +{ + return d->preferredheight; +} + +void QDeclarativeWebView::setPreferredHeight(int height) +{ + if (d->preferredheight == height) + return; + d->preferredheight = height; + updateContentsSize(); + emit preferredHeightChanged(); +} + +/*! + \qmlmethod bool WebView::evaluateJavaScript(string) + + Evaluates the \a scriptSource JavaScript inside the context of the + main web frame, and returns the result of the last executed statement. + + Note that this JavaScript does \e not have any access to QML objects + except as made available as windowObjects. +*/ +QVariant QDeclarativeWebView::evaluateJavaScript(const QString& scriptSource) +{ + return this->page()->mainFrame()->evaluateJavaScript(scriptSource); +} + +void QDeclarativeWebView::updateDeclarativeWebViewSize() +{ + QSizeF size = d->view->geometry().size() * contentsScale(); + setImplicitWidth(size.width()); + setImplicitHeight(size.height()); +} + +void QDeclarativeWebView::initialLayout() +{ + // nothing useful to do at this point +} + +void QDeclarativeWebView::updateContentsSize() +{ + if (page()) { + page()->setPreferredContentsSize(QSize( + d->preferredwidth>0 ? d->preferredwidth : width(), + d->preferredheight>0 ? d->preferredheight : height())); + } +} + +void QDeclarativeWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry) +{ + QWebPage* webPage = page(); + if (newGeometry.size() != oldGeometry.size() && webPage) { + QSize contentSize = webPage->preferredContentsSize(); + if (widthValid()) + contentSize.setWidth(width()); + if (heightValid()) + contentSize.setHeight(height()); + if (contentSize != webPage->preferredContentsSize()) + webPage->setPreferredContentsSize(contentSize); + } + QDeclarativeItem::geometryChanged(newGeometry, oldGeometry); +} + +/*! + \qmlproperty list<object> WebView::javaScriptWindowObjects + + A list of QML objects to expose to the web page. + + Each object will be added as a property of the web frame's window object. The + property name is controlled by the value of \c WebView.windowObjectName + attached property. + + Exposing QML objects to a web page allows JavaScript executing in the web + page itself to communicate with QML, by reading and writing properties and + by calling methods of the exposed QML objects. + + This example shows how to call into a QML method using a window object. + + \qml + WebView { + javaScriptWindowObjects: QtObject { + WebView.windowObjectName: "qml" + + function qmlCall() { + console.log("This call is in QML!"); + } + } + + html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>" + } + \endqml + + The output of the example will be: + \code + This is in WebKit! + This call is in QML! + \endcode + + If Javascript is not enabled for the page, then this property does nothing. +*/ +QDeclarativeListProperty<QObject> QDeclarativeWebView::javaScriptWindowObjects() +{ + return QDeclarativeListProperty<QObject>(this, d, &QDeclarativeWebViewPrivate::windowObjectsAppend); +} + +QDeclarativeWebViewAttached* QDeclarativeWebView::qmlAttachedProperties(QObject* o) +{ + return new QDeclarativeWebViewAttached(o); +} + +void QDeclarativeWebViewPrivate::updateWindowObjects() +{ + if (!q->isComponentCompletePublic() || !q->page()) + return; + + for (int i = 0; i < windowObjects.count(); ++i) { + QObject* object = windowObjects.at(i); + QDeclarativeWebViewAttached* attached = static_cast<QDeclarativeWebViewAttached *>(qmlAttachedPropertiesObject<QDeclarativeWebView>(object)); + if (attached && !attached->windowObjectName().isEmpty()) + q->page()->mainFrame()->addToJavaScriptWindowObject(attached->windowObjectName(), object); + } +} + +bool QDeclarativeWebView::renderingEnabled() const +{ + return d->rendering; +} + +void QDeclarativeWebView::setRenderingEnabled(bool enabled) +{ + if (d->rendering == enabled) + return; + d->rendering = enabled; + emit renderingEnabledChanged(); + d->view->setTiledBackingStoreFrozen(!enabled); +} + +/*! + \qmlsignal WebView::onDoubleClick(clickx, clicky) + + The WebView does not pass double-click events to the web engine, but rather + emits this signals. +*/ + +/*! + \qmlmethod bool WebView::heuristicZoom(clickX,clickY,maxzoom) + + Finds a zoom that: + \list + \i shows a whole item + \i includes (\a clickX, \a clickY) + \i fits into the preferredWidth and preferredHeight + \i zooms by no more than \a maxZoom + \i is more than 10% above the current zoom + \endlist + + If such a zoom exists, emits zoomTo(zoom,centerX,centerY) and returns true; otherwise, + no signal is emitted and returns false. +*/ +bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxZoom) +{ + if (contentsScale() >= maxZoom / scale()) + return false; + qreal ozf = contentsScale(); + QRect showArea = elementAreaAt(clickX, clickY, d->preferredwidth / maxZoom, d->preferredheight / maxZoom); + qreal z = qMin(qreal(d->preferredwidth) / showArea.width(), qreal(d->preferredheight) / showArea.height()); + if (z > maxZoom / scale()) + z = maxZoom / scale(); + if (z / ozf > 1.2) { + QRectF r(showArea.left() * z, showArea.top() * z, showArea.width() * z, showArea.height() * z); + emit zoomTo(z, r.x() + r.width() / 2, r.y() + r.height() / 2); + return true; + } + return false; +} + +/*! + \qmlproperty int WebView::pressGrabTime + + The number of milliseconds the user must press before the WebView + starts passing move events through to the web engine (rather than + letting other QML elements such as a Flickable take them). + + Defaults to 400ms. Set to 0 to always grab and pass move events to + the web engine. +*/ +int QDeclarativeWebView::pressGrabTime() const +{ + return d->view->pressTime; +} + +void QDeclarativeWebView::setPressGrabTime(int millis) +{ + if (d->view->pressTime == millis) + return; + d->view->pressTime = millis; + emit pressGrabTimeChanged(); +} + +#ifndef QT_NO_ACTION +/*! + \qmlproperty action WebView::back + This property holds the action for causing the previous URL in the history to be displayed. +*/ +QAction* QDeclarativeWebView::backAction() const +{ + return page()->action(QWebPage::Back); +} + +/*! + \qmlproperty action WebView::forward + This property holds the action for causing the next URL in the history to be displayed. +*/ +QAction* QDeclarativeWebView::forwardAction() const +{ + return page()->action(QWebPage::Forward); +} + +/*! + \qmlproperty action WebView::reload + This property holds the action for reloading with the current URL +*/ +QAction* QDeclarativeWebView::reloadAction() const +{ + return page()->action(QWebPage::Reload); +} + +/*! + \qmlproperty action WebView::stop + This property holds the action for stopping loading with the current URL +*/ +QAction* QDeclarativeWebView::stopAction() const +{ + return page()->action(QWebPage::Stop); +} +#endif // QT_NO_ACTION + +/*! + \qmlproperty real WebView::title + This property holds the title of the web page currently viewed + + By default, this property contains an empty string. +*/ +QString QDeclarativeWebView::title() const +{ + return page()->mainFrame()->title(); +} + +/*! + \qmlproperty pixmap WebView::icon + This property holds the icon associated with the web page currently viewed +*/ +QPixmap QDeclarativeWebView::icon() const +{ + return page()->mainFrame()->icon().pixmap(QSize(256, 256)); +} + +/*! + \qmlproperty string WebView::statusText + + This property is the current status suggested by the current web page. In a web browser, + such status is often shown in some kind of status bar. +*/ +void QDeclarativeWebView::setStatusText(const QString& text) +{ + d->statusText = text; + emit statusTextChanged(); +} + +void QDeclarativeWebView::windowObjectCleared() +{ + d->updateWindowObjects(); +} + +QString QDeclarativeWebView::statusText() const +{ + return d->statusText; +} + +QWebPage* QDeclarativeWebView::page() const +{ + return d->view->page(); +} + +// The QObject interface to settings(). +/*! + \qmlproperty string WebView::settings.standardFontFamily + \qmlproperty string WebView::settings.fixedFontFamily + \qmlproperty string WebView::settings.serifFontFamily + \qmlproperty string WebView::settings.sansSerifFontFamily + \qmlproperty string WebView::settings.cursiveFontFamily + \qmlproperty string WebView::settings.fantasyFontFamily + + \qmlproperty int WebView::settings.minimumFontSize + \qmlproperty int WebView::settings.minimumLogicalFontSize + \qmlproperty int WebView::settings.defaultFontSize + \qmlproperty int WebView::settings.defaultFixedFontSize + + \qmlproperty bool WebView::settings.autoLoadImages + \qmlproperty bool WebView::settings.javascriptEnabled + \qmlproperty bool WebView::settings.javaEnabled + \qmlproperty bool WebView::settings.pluginsEnabled + \qmlproperty bool WebView::settings.privateBrowsingEnabled + \qmlproperty bool WebView::settings.javascriptCanOpenWindows + \qmlproperty bool WebView::settings.javascriptCanAccessClipboard + \qmlproperty bool WebView::settings.developerExtrasEnabled + \qmlproperty bool WebView::settings.linksIncludedInFocusChain + \qmlproperty bool WebView::settings.zoomTextOnly + \qmlproperty bool WebView::settings.printElementBackgrounds + \qmlproperty bool WebView::settings.offlineStorageDatabaseEnabled + \qmlproperty bool WebView::settings.offlineWebApplicationCacheEnabled + \qmlproperty bool WebView::settings.localStorageDatabaseEnabled + \qmlproperty bool WebView::settings.localContentCanAccessRemoteUrls + + These properties give access to the settings controlling the web view. + + See QWebSettings for details of these properties. + + \qml + WebView { + settings.pluginsEnabled: true + settings.standardFontFamily: "Arial" + ... + } + \endqml +*/ +QDeclarativeWebSettings* QDeclarativeWebView::settingsObject() const +{ + d->settings.s = page()->settings(); + return &d->settings; +} + +void QDeclarativeWebView::setPage(QWebPage* page) +{ + if (d->view->page() == page) + return; + + d->view->setPage(page); + updateContentsSize(); + page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); + page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); + connect(page->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(pageUrlChanged())); + connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString))); + connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged())); + connect(page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged())); + connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout())); + connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize))); + + connect(page, SIGNAL(loadStarted()), this, SLOT(doLoadStarted())); + connect(page, SIGNAL(loadProgress(int)), this, SLOT(doLoadProgress(int))); + connect(page, SIGNAL(loadFinished(bool)), this, SLOT(doLoadFinished(bool))); + connect(page, SIGNAL(statusBarMessage(QString)), this, SLOT(setStatusText(QString))); + + connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(windowObjectCleared())); + + page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); + +} + +/*! + \qmlsignal WebView::onLoadStarted() + + This handler is called when the web engine begins loading + a page. Later, WebView::onLoadFinished() or WebView::onLoadFailed() + will be emitted. +*/ + +/*! + \qmlsignal WebView::onLoadFinished() + + This handler is called when the web engine \e successfully + finishes loading a page, including any component content + (WebView::onLoadFailed() will be emitted otherwise). + + \sa progress +*/ + +/*! + \qmlsignal WebView::onLoadFailed() + + This handler is called when the web engine fails loading + a page or any component content + (WebView::onLoadFinished() will be emitted on success). +*/ + +void QDeclarativeWebView::load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation, const QByteArray& body) +{ + page()->mainFrame()->load(request, operation, body); +} + +QString QDeclarativeWebView::html() const +{ + return page()->mainFrame()->toHtml(); +} + +/*! + \qmlproperty string WebView::html + This property holds HTML text set directly + + The html property can be set as a string. + + \qml + WebView { + html: "<p>This is <b>HTML</b>." + } + \endqml +*/ +void QDeclarativeWebView::setHtml(const QString& html, const QUrl& baseUrl) +{ + updateContentsSize(); + if (isComponentComplete()) + page()->mainFrame()->setHtml(html, baseUrl); + else { + d->pending = d->PendingHtml; + d->pendingUrl = baseUrl; + d->pendingString = html; + } + emit htmlChanged(); +} + +void QDeclarativeWebView::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl) +{ + updateContentsSize(); + + if (isComponentComplete()) + page()->mainFrame()->setContent(data, mimeType, qmlContext(this)->resolvedUrl(baseUrl)); + else { + d->pending = d->PendingContent; + d->pendingUrl = baseUrl; + d->pendingString = mimeType; + d->pendingData = data; + } +} + +QWebHistory* QDeclarativeWebView::history() const +{ + return page()->history(); +} + +QWebSettings* QDeclarativeWebView::settings() const +{ + return page()->settings(); +} + +QDeclarativeWebView* QDeclarativeWebView::createWindow(QWebPage::WebWindowType type) +{ + switch (type) { + case QWebPage::WebBrowserWindow: { + if (!d->newWindowComponent && d->newWindowParent) + qWarning("WebView::newWindowComponent not set - WebView::newWindowParent ignored"); + else if (d->newWindowComponent && !d->newWindowParent) + qWarning("WebView::newWindowParent not set - WebView::newWindowComponent ignored"); + else if (d->newWindowComponent && d->newWindowParent) { + QDeclarativeWebView* webview = 0; + QDeclarativeContext* windowContext = new QDeclarativeContext(qmlContext(this)); + + QObject* newObject = d->newWindowComponent->create(windowContext); + if (newObject) { + windowContext->setParent(newObject); + QDeclarativeItem* item = qobject_cast<QDeclarativeItem *>(newObject); + if (!item) + delete newObject; + else { + webview = item->findChild<QDeclarativeWebView*>(); + if (!webview) + delete item; + else { + newObject->setParent(d->newWindowParent); + static_cast<QGraphicsObject*>(item)->setParentItem(d->newWindowParent); + } + } + } else + delete windowContext; + + return webview; + } + } + break; + case QWebPage::WebModalDialog: { + // Not supported + } + } + return 0; +} + +/*! + \qmlproperty component WebView::newWindowComponent + + This property holds the component to use for new windows. + The component must have a WebView somewhere in its structure. + + When the web engine requests a new window, it will be an instance of + this component. + + The parent of the new window is set by newWindowParent. It must be set. +*/ +QDeclarativeComponent* QDeclarativeWebView::newWindowComponent() const +{ + return d->newWindowComponent; +} + +void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent* newWindow) +{ + if (newWindow == d->newWindowComponent) + return; + d->newWindowComponent = newWindow; + emit newWindowComponentChanged(); +} + + +/*! + \qmlproperty item WebView::newWindowParent + + The parent item for new windows. + + \sa newWindowComponent +*/ +QDeclarativeItem* QDeclarativeWebView::newWindowParent() const +{ + return d->newWindowParent; +} + +void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem* parent) +{ + if (parent == d->newWindowParent) + return; + if (d->newWindowParent && parent) { + QList<QGraphicsItem *> children = d->newWindowParent->childItems(); + for (int i = 0; i < children.count(); ++i) + children.at(i)->setParentItem(parent); + } + d->newWindowParent = parent; + emit newWindowParentChanged(); +} + +QSize QDeclarativeWebView::contentsSize() const +{ + return page()->mainFrame()->contentsSize() * contentsScale(); +} + +qreal QDeclarativeWebView::contentsScale() const +{ + return d->view->scale(); +} + +void QDeclarativeWebView::setContentsScale(qreal scale) +{ + if (scale == d->view->scale()) + return; + d->view->setScale(scale); + updateDeclarativeWebViewSize(); + emit contentsScaleChanged(); +} + +/*! + Returns the area of the largest element at position (\a x,\a y) that is no larger + than \a maxWidth by \a maxHeight pixels. + + May return an area larger in the case when no smaller element is at the position. +*/ +QRect QDeclarativeWebView::elementAreaAt(int x, int y, int maxWidth, int maxHeight) const +{ + QWebHitTestResult hit = page()->mainFrame()->hitTestContent(QPoint(x, y)); + QRect hitRect = hit.boundingRect(); + QWebElement element = hit.enclosingBlockElement(); + if (maxWidth <= 0) + maxWidth = INT_MAX; + if (maxHeight <= 0) + maxHeight = INT_MAX; + while (!element.parent().isNull() && element.geometry().width() <= maxWidth && element.geometry().height() <= maxHeight) { + hitRect = element.geometry(); + element = element.parent(); + } + return hitRect; +} + +/*! + \internal + \class QDeclarativeWebPage + \brief The QDeclarativeWebPage class is a QWebPage that can create QML plugins. + + \sa QDeclarativeWebView +*/ +QDeclarativeWebPage::QDeclarativeWebPage(QDeclarativeWebView* parent) : + QWebPage(parent) +{ +} + +QDeclarativeWebPage::~QDeclarativeWebPage() +{ +} + +QString QDeclarativeWebPage::chooseFile(QWebFrame* originatingFrame, const QString& oldFile) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(oldFile) + return oldFile; +} + +/*! + \qmlsignal WebView::onAlert(message) + + The handler is called when the web engine sends a JavaScript alert. The \a message is the text + to be displayed in the alert to the user. +*/ + + +void QDeclarativeWebPage::javaScriptAlert(QWebFrame* originatingFrame, const QString& msg) +{ + Q_UNUSED(originatingFrame) + emit viewItem()->alert(msg); +} + +bool QDeclarativeWebPage::javaScriptConfirm(QWebFrame* originatingFrame, const QString& msg) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(msg) + return false; +} + +bool QDeclarativeWebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString& msg, const QString& defaultValue, QString* result) +{ + // Not supported (it's modal) + Q_UNUSED(originatingFrame) + Q_UNUSED(msg) + Q_UNUSED(defaultValue) + Q_UNUSED(result) + return false; +} + + +QDeclarativeWebView* QDeclarativeWebPage::viewItem() +{ + return static_cast<QDeclarativeWebView*>(parent()); +} + +QWebPage* QDeclarativeWebPage::createWindow(WebWindowType type) +{ + QDeclarativeWebView* newView = viewItem()->createWindow(type); + if (newView) + return newView->page(); + return 0; +} + +QT_END_NAMESPACE + diff --git a/WebKit/qt/declarative/qdeclarativewebview_p.h b/WebKit/qt/declarative/qdeclarativewebview_p.h new file mode 100644 index 0000000..b2055bf --- /dev/null +++ b/WebKit/qt/declarative/qdeclarativewebview_p.h @@ -0,0 +1,371 @@ +/* + Copyright (C) 2009 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 qdeclarativewebview_p_h +#define qdeclarativewebview_p_h + +#include <QtCore/QBasicTimer> +#include <QtCore/QUrl> +#include <QtDeclarative/QDeclarativeItem> +#include <QtGui/QAction> +#include <QtNetwork/QNetworkAccessManager> +#include "qgraphicswebview.h" +#include "qwebpage.h" + + +QT_BEGIN_HEADER + +class QWebHistory; +class QWebSettings; + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) +class QDeclarativeWebSettings; +class QDeclarativeWebViewPrivate; +class QNetworkRequest; +class QDeclarativeWebView; +class QDeclarativeWebViewPrivate; + +class QDeclarativeWebPage : public QWebPage { + Q_OBJECT +public: + explicit QDeclarativeWebPage(QDeclarativeWebView *parent); + ~QDeclarativeWebPage(); +protected: + QWebPage *createWindow(WebWindowType type); + QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile); + void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg); + bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg); + bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result); + +private: + QDeclarativeWebView *viewItem(); +}; + +class GraphicsWebView : public QGraphicsWebView { + Q_OBJECT +public: + GraphicsWebView(QDeclarativeWebView* parent = 0); +protected: + void mousePressEvent(QGraphicsSceneMouseEvent* event); + void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); + void mouseMoveEvent(QGraphicsSceneMouseEvent* event); + void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); + void timerEvent(QTimerEvent* event); +Q_SIGNALS: + void doubleClick(int clickX, int clickY); +private: + QDeclarativeWebView *parent; + QPointF pressPoint; + QBasicTimer pressTimer; + int pressTime; // milliseconds before the touch event becomes a "tap and hold" + friend class QDeclarativeWebView; +}; + +class QDeclarativeWebViewAttached; + +// TODO: browser plugins + +class QDeclarativeWebView : public QDeclarativeItem { + Q_OBJECT + + Q_ENUMS(Status SelectionMode) + + Q_PROPERTY(QString title READ title NOTIFY titleChanged) + Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged) + Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged) + + Q_PROPERTY(QString html READ html WRITE setHtml NOTIFY htmlChanged) + + Q_PROPERTY(int pressGrabTime READ pressGrabTime WRITE setPressGrabTime NOTIFY pressGrabTimeChanged) + + Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged) + Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged) + Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) + Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged) + +#ifndef QT_NO_ACTION + Q_PROPERTY(QAction* reload READ reloadAction CONSTANT) + Q_PROPERTY(QAction* back READ backAction CONSTANT) + Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) + Q_PROPERTY(QAction* stop READ stopAction CONSTANT) +#endif + + Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT) + + Q_PROPERTY(QDeclarativeListProperty<QObject> javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT) + + Q_PROPERTY(QDeclarativeComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent NOTIFY newWindowComponentChanged) + Q_PROPERTY(QDeclarativeItem* newWindowParent READ newWindowParent WRITE setNewWindowParent NOTIFY newWindowParentChanged) + + Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged) + + Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged) + Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged) + +public: + QDeclarativeWebView(QDeclarativeItem *parent = 0); + ~QDeclarativeWebView(); + + QUrl url() const; + void setUrl(const QUrl &); + + QString title() const; + + QPixmap icon() const; + + Q_INVOKABLE bool heuristicZoom(int clickX, int clickY, qreal maxzoom); + QRect elementAreaAt(int x, int y, int minwidth, int minheight) const; + + int pressGrabTime() const; + void setPressGrabTime(int); + + int preferredWidth() const; + void setPreferredWidth(int); + int preferredHeight() const; + void setPreferredHeight(int); + + enum Status { Null, Ready, Loading, Error }; + Status status() const; + qreal progress() const; + QString statusText() const; + +#ifndef QT_NO_ACTION + QAction *reloadAction() const; + QAction *backAction() const; + QAction *forwardAction() const; + QAction *stopAction() const; +#endif + + QWebPage *page() const; + void setPage(QWebPage *page); + + void load(const QNetworkRequest &request, + QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, + const QByteArray &body = QByteArray()); + + QString html() const; + + void setHtml(const QString &html, const QUrl &baseUrl = QUrl()); + void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl()); + + QWebHistory* history() const; + QWebSettings* settings() const; + QDeclarativeWebSettings *settingsObject() const; + + bool renderingEnabled() const; + void setRenderingEnabled(bool); + + QDeclarativeListProperty<QObject> javaScriptWindowObjects(); + + static QDeclarativeWebViewAttached* qmlAttachedProperties(QObject*); + + QDeclarativeComponent *newWindowComponent() const; + void setNewWindowComponent(QDeclarativeComponent *newWindow); + QDeclarativeItem* newWindowParent() const; + void setNewWindowParent(QDeclarativeItem* newWindow); + + bool isComponentCompletePublic() const { return isComponentComplete(); } + + QSize contentsSize() const; + + void setContentsScale(qreal scale); + qreal contentsScale() const; + +Q_SIGNALS: + void preferredWidthChanged(); + void preferredHeightChanged(); + void urlChanged(); + void progressChanged(); + void statusChanged(Status); + void titleChanged(const QString&); + void iconChanged(); + void statusTextChanged(); + void htmlChanged(); + void pressGrabTimeChanged(); + void newWindowComponentChanged(); + void newWindowParentChanged(); + void renderingEnabledChanged(); + void contentsSizeChanged(const QSize&); + void contentsScaleChanged(); + + void loadStarted(); + void loadFinished(); + void loadFailed(); + + void doubleClick(int clickX, int clickY); + + void zoomTo(qreal zoom, int centerX, int centerY); + + void alert(const QString& message); + +public Q_SLOTS: + QVariant evaluateJavaScript(const QString&); + +private Q_SLOTS: + void doLoadStarted(); + void doLoadProgress(int p); + void doLoadFinished(bool ok); + void setStatusText(const QString&); + void windowObjectCleared(); + void pageUrlChanged(); + void initialLayout(); + + void updateDeclarativeWebViewSize(); + + virtual void geometryChanged(const QRectF &newGeometry, + const QRectF &oldGeometry); + QDeclarativeWebView* createWindow(QWebPage::WebWindowType type); + +private: + void updateContentsSize(); + void init(); + virtual void componentComplete(); + Q_DISABLE_COPY(QDeclarativeWebView) + QDeclarativeWebViewPrivate* d; + QMouseEvent* sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent*); + QMouseEvent* sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent*); + friend class QDeclarativeWebPage; +}; + +class QDeclarativeWebViewAttached : public QObject { + Q_OBJECT + Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName) +public: + QDeclarativeWebViewAttached(QObject* parent) + : QObject(parent) + { + } + + QString windowObjectName() const + { + return m_windowObjectName; + } + + void setWindowObjectName(const QString &n) + { + m_windowObjectName = n; + } + +private: + QString m_windowObjectName; +}; + +class QDeclarativeWebSettings : public QObject { + Q_OBJECT + + Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily) + Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily) + Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily) + Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily) + Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily) + Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily) + + Q_PROPERTY(int minimumFontSize READ minimumFontSize WRITE setMinimumFontSize) + Q_PROPERTY(int minimumLogicalFontSize READ minimumLogicalFontSize WRITE setMinimumLogicalFontSize) + Q_PROPERTY(int defaultFontSize READ defaultFontSize WRITE setDefaultFontSize) + Q_PROPERTY(int defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize) + + Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages) + Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled) + Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled) + Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled) + Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled) + Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows) + Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard) + Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled) + Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain) + Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly) + Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds) + Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled) + Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled) + Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled) + Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls) + +public: + QDeclarativeWebSettings() {} + + QString standardFontFamily() const { return s->fontFamily(QWebSettings::StandardFont); } + void setStandardFontFamily(const QString& f) { s->setFontFamily(QWebSettings::StandardFont, f); } + QString fixedFontFamily() const { return s->fontFamily(QWebSettings::FixedFont); } + void setFixedFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FixedFont, f); } + QString serifFontFamily() const { return s->fontFamily(QWebSettings::SerifFont); } + void setSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SerifFont, f); } + QString sansSerifFontFamily() const { return s->fontFamily(QWebSettings::SansSerifFont); } + void setSansSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SansSerifFont, f); } + QString cursiveFontFamily() const { return s->fontFamily(QWebSettings::CursiveFont); } + void setCursiveFontFamily(const QString& f) { s->setFontFamily(QWebSettings::CursiveFont, f); } + QString fantasyFontFamily() const { return s->fontFamily(QWebSettings::FantasyFont); } + void setFantasyFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FantasyFont, f); } + + int minimumFontSize() const { return s->fontSize(QWebSettings::MinimumFontSize); } + void setMinimumFontSize(int size) { s->setFontSize(QWebSettings::MinimumFontSize, size); } + int minimumLogicalFontSize() const { return s->fontSize(QWebSettings::MinimumLogicalFontSize); } + void setMinimumLogicalFontSize(int size) { s->setFontSize(QWebSettings::MinimumLogicalFontSize, size); } + int defaultFontSize() const { return s->fontSize(QWebSettings::DefaultFontSize); } + void setDefaultFontSize(int size) { s->setFontSize(QWebSettings::DefaultFontSize, size); } + int defaultFixedFontSize() const { return s->fontSize(QWebSettings::DefaultFixedFontSize); } + void setDefaultFixedFontSize(int size) { s->setFontSize(QWebSettings::DefaultFixedFontSize, size); } + + bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); } + void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); } + bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); } + void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); } + bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); } + void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); } + bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); } + void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); } + bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); } + void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); } + bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); } + void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); } + bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); } + void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); } + bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); } + void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); } + bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); } + void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); } + bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); } + void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); } + bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); } + void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); } + bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); } + void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); } + bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); } + void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); } + bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); } + void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); } + bool localContentCanAccessRemoteUrls() const { return s->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); } + void setLocalContentCanAccessRemoteUrls(bool on) { s->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, on); } + + QWebSettings *s; +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QDeclarativeWebView) +QML_DECLARE_TYPE(QDeclarativeWebSettings) +QML_DECLARE_TYPEINFO(QDeclarativeWebView, QML_HAS_ATTACHED_PROPERTIES) + +QT_END_HEADER + +#endif diff --git a/WebKit/qt/declarative/qmldir b/WebKit/qt/declarative/qmldir new file mode 100644 index 0000000..dcfdd06 --- /dev/null +++ b/WebKit/qt/declarative/qmldir @@ -0,0 +1 @@ +plugin qmlwebkitplugin diff --git a/WebKit/qt/docs/qtwebkit-bridge.qdoc b/WebKit/qt/docs/qtwebkit-bridge.qdoc index fa93293..c2a38fd 100644 --- a/WebKit/qt/docs/qtwebkit-bridge.qdoc +++ b/WebKit/qt/docs/qtwebkit-bridge.qdoc @@ -8,7 +8,7 @@ The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection, - a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment, + a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment, for example \l{QObject} properties map directly to JavaScript properties. For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter @@ -24,7 +24,7 @@ applications. For example, an application that contains a media-player, playlist manager, and music store. The playlist manager is usually best authored as a classic desktop application, with the native-looking robust \l{QWidget}s helping with producing that application. - The media-player control, which usually looks custom, can be written using \l{The Graphics View framework} + The media-player control, which usually looks custom, can be written using the \l{Graphics View framework} or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content from the internet and gets modified rapidly, is best authored in HTML and maintained on the server. diff --git a/WebKit/qt/docs/qtwebkit.qdocconf b/WebKit/qt/docs/qtwebkit.qdocconf index 292c124..5f877c2 100644 --- a/WebKit/qt/docs/qtwebkit.qdocconf +++ b/WebKit/qt/docs/qtwebkit.qdocconf @@ -3,8 +3,8 @@ project = qtwebkit description = "Qt WebKit API Documentation" -headerdirs = $SRCDIR/WebKit/qt/Api -sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/JavaScriptCore/qt/api +headerdirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/declarative +sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/JavaScriptCore/qt/api $SRCDIR/WebKit/qt/declarative outputdir = $OUTPUT_DIR/doc/html outputformats = HTML sources.fileextensions = "*.cpp *.doc *.qdoc *.h" diff --git a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp index 62eeeca..6a517c2 100644 --- a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp +++ b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp @@ -12,10 +12,10 @@ void wrapInFunction() //! [1] { width: ..., - height: ..., - toDataURL: function() { ... }, - assignToHTMLImageElement: function(element) { ... } - } + height: ..., + toDataURL: function() { ... }, + assignToHTMLImageElement: function(element) { ... } + } //! [1] #endif //! [2] @@ -24,7 +24,7 @@ void wrapInFunction() Q_PROPERTY(QPixmap myPixmap READ getPixmap) public: - QPixmap getPixmap() const; + QPixmap getPixmap() const; }; /* ... */ @@ -36,21 +36,22 @@ void wrapInFunction() #if 0 //! [3] <html> - <head> + <head> <script> - function loadImage() { - myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement")); - } - </script> - </head> - <body onload="loadImage()"> - <img id="imageElement" width="300" height="200" /> - </body> - </html> - //! [3] + function loadImage() + { + myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement")); + } + </script> + </head> + <body onload="loadImage()"> + <img id="imageElement" width="300" height="200" /> + </body> + </html> +//! [3] #endif - //! [4] - class MyObject : QObject { +//! [4] +class MyObject : QObject { Q_OBJECT public slots: @@ -161,11 +162,7 @@ void wrapInFunction() myQObject.enabled = !myQObject.enabled; //! [24] //! [25] - myQObject.enabled = true; - - ... - - myQObject.enabled = !myQObject.enabled; + myDialog.okButton //! [25] //! [26] myDialog.okButton diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp index 1f3877c..c3efb80 100644 --- a/WebKit/qt/examples/platformplugin/WebPlugin.cpp +++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp @@ -221,4 +221,4 @@ bool WebPlugin::supportsExtension(Extension extension) const return false; } -Q_EXPORT_PLUGIN2(qwebselectim, WebPlugin) +Q_EXPORT_PLUGIN2(platformplugin, WebPlugin) diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h index bac618c..32d22d4 100644 --- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h +++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -31,7 +31,7 @@ class QWebSelectData { public: - inline ~QWebSelectData() {} + virtual ~QWebSelectData() {} enum ItemType { Option, Group, Separator }; @@ -48,7 +48,7 @@ class QWebSelectMethod : public QObject { Q_OBJECT public: - inline ~QWebSelectMethod() {} + virtual ~QWebSelectMethod() {} virtual void show(const QWebSelectData&) = 0; virtual void hide() = 0; @@ -61,6 +61,8 @@ Q_SIGNALS: class QWebNotificationData { public: + virtual ~QWebNotificationData() {} + virtual const QString title() const = 0; virtual const QString message() const = 0; virtual const QByteArray iconData() const = 0; diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def index 93fd33c..3fefb4d 100644 --- a/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -760,7 +760,7 @@ EXPORTS _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @759 NONAME _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @760 NONAME _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @761 NONAME - _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME + _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME ABSENT _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @763 NONAME _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @764 NONAME _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @765 NONAME @@ -776,3 +776,9 @@ EXPORTS _ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME _ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME _ZN23DumpRenderTreeSupportQt31removeWhiteListAccessFromOriginERK7QStringS2_S2_b @ 777 NONAME + _ZN23DumpRenderTreeSupportQt11shouldCloseEP9QWebFrame @ 778 NONAME + _ZN23DumpRenderTreeSupportQt12isTargetItemERK15QWebHistoryItem @ 779 NONAME + _ZN23DumpRenderTreeSupportQt17historyItemTargetERK15QWebHistoryItem @ 780 NONAME + _ZN23DumpRenderTreeSupportQt20getChildHistoryItemsERK15QWebHistoryItem @ 781 NONAME + _ZN23DumpRenderTreeSupportQt23setMockGeolocationErrorEiRK7QString @ 782 NONAME + _ZN23DumpRenderTreeSupportQt26setMockGeolocationPositionEddd @ 783 NONAME diff --git a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp index 49a606b..783214c 100644 --- a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp +++ b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp @@ -84,7 +84,7 @@ void tst_QWebHistory::init() { page = new QWebPage(this); frame = page->mainFrame(); - connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit())); + connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit()), Qt::QueuedConnection); for (int i = 1;i < 6;i++) { loadPage(i); @@ -126,6 +126,7 @@ void tst_QWebHistory::back() } //try one more time (too many). crash test hist->back(); + QCOMPARE(page->mainFrame()->toPlainText(), QString("page1")); } /** @@ -146,6 +147,7 @@ void tst_QWebHistory::forward() } //try one more time (too many). crash test hist->forward(); + QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(histsize)); } /** diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 85f67b6..18f2d73 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,82 @@ +2010-06-21 Nate Chapin <japhet@chromium.org> + + Unreviewed, Windows build fix. + + Update WebFrame to use FrameLoaderStateMachine in + firstLayoutDone(). + + * WebFrame.cpp: + (WebFrame::firstLayoutDone): + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * WebView.cpp: + (WebView::notifyPreferencesChanged): + +2010-06-16 Adam Roben <aroben@apple.com> + + Add a "forPrinting" boolean parameter to + IWebFramePrivate::renderTreeAsExternalRepresentation + + Fixes <http://webkit.org/b/40727> Respect + LayoutTestController::isPrinting on Windows. + + Reviewed by Dan Bernstein. + + * Interfaces/IWebFramePrivate.idl: Renamed the current + renderTreeAsExternalRepresentation to unused1, and added a new version + that takes a boolean "forPrinting" parameter. + + * Interfaces/WebKit.idl: Touched to force a build. + + * WebFrame.cpp: + (WebFrame::renderTreeAsExternalRepresentation): Added a boolean + "forPrinting" parameter, and used it to tell externalRepresentation + what kind of behavior to use. + + * WebFrame.h: Renamed the old renderTreeAsExternalRepresentation and + added the new one. + +2010-06-15 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions out of Frame class that were marked "move to Chrome" + https://bugs.webkit.org/show_bug.cgi?id=39636 + + * WebView.cpp: + (WebView::shouldClose): Call shouldClose on FrameLoader instead of + going through Frame. + +2010-06-14 Adam Roben <aroben@apple.com> + + Add WebKitLauncherWin to WebKit.sln + + Fixes <http://webkit.org/b/40583>. + + Reviewed by Darin Adler. + + * WebKit.vcproj/WebKit.sln: Added WebKitLauncherWin.vcproj. It depends + on WebKitAPITest, so is the last project to build. (Also removed + QTMovieWin's direct dependency on JavaScriptCore, since it already has + an indirect dependency on it.) + +2010-06-14 Chang Shu <chang.shu@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [win] Make windows compile after API changes. + + https://bugs.webkit.org/show_bug.cgi?id=40434 + + * WebKitGraphics.cpp: + (WebDrawText): + 2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl index 1b7209d..b04edfe 100755 --- a/WebKit/win/Interfaces/IWebFramePrivate.idl +++ b/WebKit/win/Interfaces/IWebFramePrivate.idl @@ -57,7 +57,7 @@ typedef enum { interface IWebFramePrivate : IUnknown { - HRESULT renderTreeAsExternalRepresentation([out, retval] BSTR* result); + HRESULT unused1([out, retval] BSTR*); HRESULT scrollOffset([out, retval] SIZE* offset); // FIXME: This shouldn't be needed once IWebDocumentView is implemented. @@ -112,4 +112,6 @@ interface IWebFramePrivate : IUnknown HRESULT layerTreeAsText([out, retval] BSTR* result); HRESULT paintScrollViewRectToContextAtPoint([in] RECT rect, [in] POINT pt, [in] OLE_HANDLE deviceContext); + + HRESULT renderTreeAsExternalRepresentation([in] BOOL forPrinting, [out, retval] BSTR* result); } diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl index d25cdfe..98f5da8 100644 --- a/WebKit/win/Interfaces/WebKit.idl +++ b/WebKit/win/Interfaces/WebKit.idl @@ -300,3 +300,4 @@ library WebKit [default] interface IWebUserContentURLPattern; } } + diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index 75a9c8d..5705f1e 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -845,8 +845,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::childFrames( // IWebFramePrivate ------------------------------------------------------ -HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation( - /* [retval][out] */ BSTR *result) +HRESULT WebFrame::renderTreeAsExternalRepresentation(BOOL forPrinting, BSTR *result) { if (!result) return E_POINTER; @@ -855,7 +854,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation( if (!coreFrame) return E_FAIL; - *result = BString(externalRepresentation(coreFrame)).release(); + *result = BString(externalRepresentation(coreFrame, forPrinting ? RenderAsTextPrintingMode : RenderAsTextBehaviorNormal)).release(); return S_OK; } @@ -964,7 +963,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::firstLayoutDone( if (!coreFrame) return E_FAIL; - *result = coreFrame->loader()->firstLayoutDone(); + *result = coreFrame->loader()->stateMachine()->firstLayoutDone(); return S_OK; } diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h index d839f17..c14ddc9 100644 --- a/WebKit/win/WebFrame.h +++ b/WebKit/win/WebFrame.h @@ -155,8 +155,8 @@ public: virtual /* [local] */ JSGlobalContextRef STDMETHODCALLTYPE globalContext(); // IWebFramePrivate - virtual HRESULT STDMETHODCALLTYPE renderTreeAsExternalRepresentation( - /* [retval][out] */ BSTR *result); + virtual HRESULT STDMETHODCALLTYPE unused1(BSTR*) { return E_NOTIMPL; } + virtual HRESULT STDMETHODCALLTYPE renderTreeAsExternalRepresentation(BOOL forPrinting, BSTR *result); virtual HRESULT STDMETHODCALLTYPE counterValueForElementById( /* [in] */ BSTR id, diff --git a/WebKit/win/WebKit.vcproj/WebKit.sln b/WebKit/win/WebKit.vcproj/WebKit.sln index 6f437f3..c205704 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.sln +++ b/WebKit/win/WebKit.vcproj/WebKit.sln @@ -66,7 +66,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QTMovieWin", "..\..\..\WebCore\WebCore.vcproj\QTMovieWin.vcproj", "{E498CA9D-3BD2-4D52-8E37-C8DC76526325}"
ProjectSection(ProjectDependencies) = postProject
{0A324352-B3B6-496C-9E5B-4C7E923E628B} = {0A324352-B3B6-496C-9E5B-4C7E923E628B}
- {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinLauncher", "..\..\..\WebKitTools\WinLauncher\WinLauncher.vcproj", "{114FCA11-216B-4C8C-957E-30A75AE80443}"
@@ -86,6 +85,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitAPITest", "..\..\..\W {6567DFD4-D6DE-4CD5-825D-17E353D160E1} = {6567DFD4-D6DE-4CD5-825D-17E353D160E1}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitLauncherWin", "..\..\..\WebKitTools\WebKitLauncherWin\WebKitLauncherWin.vcproj", "{D09806DB-E58B-4646-8C9B-61101906C1E2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {626089A3-25D3-4883-A96C-B8C66E036397} = {626089A3-25D3-4883-A96C-B8C66E036397}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Cairo|Win32 = Debug_Cairo|Win32
@@ -236,6 +240,14 @@ Global {626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.Build.0 = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.ActiveCfg = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.Build.0 = Debug|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug_Cairo|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug_Cairo|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release_Cairo|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release_Cairo|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/WebKit/win/WebKitGraphics.cpp b/WebKit/win/WebKitGraphics.cpp index d7123b4..e9e25ab 100644 --- a/WebKit/win/WebKitGraphics.cpp +++ b/WebKit/win/WebKitGraphics.cpp @@ -112,7 +112,7 @@ void WebDrawText(WebTextRenderInfo* info) // Set shadow setting if (info->structSize == sizeof(WebTextRenderInfo) && (info->shadowOffset.cx || info->shadowOffset.cy || info->shadowBlur || info->shadowColor)) - context.setShadow(info->shadowOffset, info->shadowBlur, info->shadowColor, DeviceColorSpace); + context.setShadow(FloatSize(info->shadowOffset.cx, info->shadowOffset.cy), info->shadowBlur, info->shadowColor, DeviceColorSpace); WebCoreDrawTextAtPoint(context, drawString, info->pt, makeFont(*(info->description)), info->color, info->underlinedIndex); context.restore(); diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index a85cc92..a1aa5c2 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -62,6 +62,7 @@ #include <JavaScriptCore/InitializeThreading.h> #include <JavaScriptCore/JSLock.h> #include <JavaScriptCore/JSValue.h> +#include <WebCore/AbstractDatabase.h> #include <WebCore/AXObjectCache.h> #include <WebCore/ApplicationCacheStorage.h> #include <WebCore/BString.h> @@ -73,7 +74,6 @@ #include <WebCore/ContextMenuController.h> #include <WebCore/CookieStorageWin.h> #include <WebCore/Cursor.h> -#include <WebCore/Database.h> #include <WebCore/Document.h> #include <WebCore/DragController.h> #include <WebCore/DragData.h> @@ -4710,7 +4710,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) hr = prefsPrivate->databasesEnabled(&enabled); if (FAILED(hr)) return hr; - Database::setIsAvailable(enabled); + AbstractDatabase::setIsAvailable(enabled); #endif hr = prefsPrivate->localStorageEnabled(&enabled); @@ -5197,7 +5197,7 @@ HRESULT STDMETHODCALLTYPE WebView::shouldClose( *result = TRUE; if (Frame* frame = m_page->mainFrame()) - *result = frame->shouldClose() ? TRUE : FALSE; + *result = frame->loader()->shouldClose(); return S_OK; } diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index aefe2a1..36c9990 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,32 @@ +2010-06-21 Kevin Ollivier <kevino@theolliviers.com> + + Build fix after conversion of WebInterfaceSystem to Obj-C++. + + * WebView.cpp: + * wscript: + +2010-06-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Adam Barth. + + Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase. + https://bugs.webkit.org/show_bug.cgi?id=39041 + + * WebView.cpp: + (wxWebView::SetDatabasesEnabled): + (wxWebView::AreDatabasesEnabled): + +2010-06-15 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions out of Frame class that were marked "move to Chrome" + https://bugs.webkit.org/show_bug.cgi?id=39636 + + * WebFrame.cpp: + (wxWebFrame::ShouldClose): Call shouldClose on FrameLoader instead + of going through Frame. + 2010-06-14 Ilya Tikhonovsky <loislo@chromium.org> Reviewed by Pavel Feldman. diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp index cb66a72..e1f7ecc 100644 --- a/WebKit/wx/WebFrame.cpp +++ b/WebKit/wx/WebFrame.cpp @@ -414,7 +414,7 @@ wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const bool wxWebFrame::ShouldClose() const { if (m_impl->frame) - return m_impl->frame->shouldClose(); + return m_impl->frame->loader()->shouldClose(); return true; } diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp index d9a22cb..a2897b5 100644 --- a/WebKit/wx/WebView.cpp +++ b/WebKit/wx/WebView.cpp @@ -74,7 +74,7 @@ #include <wtf/text/CString.h> #if ENABLE(DATABASE) -#include "Database.h" +#include "AbstractDatabase.h" #include "DatabaseTracker.h" #endif @@ -258,10 +258,8 @@ wxWebViewCachePolicy wxWebView::GetCachePolicy() } #if OS(DARWIN) -// prototype - function is in WebKitSystemInterface.mm -extern "C" { +// prototype - function is in WebSystemInterface.mm void InitWebCoreSystemInterface(void); -} #endif BEGIN_EVENT_TABLE(wxWebView, wxWindow) @@ -995,7 +993,7 @@ wxString wxWebView::GetDatabaseDirectory() void wxWebView::SetDatabasesEnabled(bool enabled) { #if ENABLE(DATABASE) - WebCore::Database::setIsAvailable(enabled); + WebCore::AbstractDatabase::setIsAvailable(enabled); #endif } @@ -1003,7 +1001,7 @@ void wxWebView::SetDatabasesEnabled(bool enabled) bool wxWebView::AreDatabasesEnabled() { #if ENABLE(DATABASE) - return WebCore::Database::isAvailable(); + return WebCore::AbstractDatabase::isAvailable(); #endif return false; } diff --git a/WebKit/wx/wscript b/WebKit/wx/wscript index fe934f1..d0594b3 100644 --- a/WebKit/wx/wscript +++ b/WebKit/wx/wscript @@ -109,7 +109,7 @@ def build(bld): if sys.platform.startswith('darwin'): exts.append('.mm') obj.includes += '../mac/WebCoreSupport ../../WebCore/platform/mac' - obj.source = "../mac/WebCoreSupport/WebSystemInterface.m" + obj.source = "../mac/WebCoreSupport/WebSystemInterface.mm" obj.find_sources_in_dirs(webkit_dirs) if building_on_win32: |