diff options
Diffstat (limited to 'WebKit')
135 files changed, 3455 insertions, 979 deletions
diff --git a/WebKit/CMakeLists.txt b/WebKit/CMakeLists.txt index 6fb9582..0d3edca 100644 --- a/WebKit/CMakeLists.txt +++ b/WebKit/CMakeLists.txt @@ -14,6 +14,7 @@ SET(WebKit_INCLUDE_DIRECTORIES "${WEBCORE_DIR}/inspector" "${WEBCORE_DIR}/loader" "${WEBCORE_DIR}/loader/icon" + "${WEBCORE_DIR}/loader/cache" "${WEBCORE_DIR}/page" "${WEBCORE_DIR}/page/animation" "${WEBCORE_DIR}/platform" diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 9a6a950..ff4ab64 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,19 @@ +2010-11-08 Leandro Pereira <leandro@profusion.mobi> + + [EFL] Unreviewed. Build fix after r71496. + + * CMakeLists.txt: Add WebCore/loader/cache directory to WebKit's + include directories list. + +2010-11-04 Mike Thole <mthole@apple.com> + + Reviewed by Dan Bernstein. + + Title for images should use localized numerals + https://bugs.webkit.org/show_bug.cgi?id=49017 + + * English.lproj/Localizable.strings: Updated. + 2010-10-28 Mark Rowe <mrowe@apple.com> Stop allowing deprecated methods to be used in NetscapePluginHostProxy.mm now diff --git a/WebKit/English.lproj/Localizable.strings b/WebKit/English.lproj/Localizable.strings Binary files differindex 3d09f86..9e9018b 100644 --- a/WebKit/English.lproj/Localizable.strings +++ b/WebKit/English.lproj/Localizable.strings diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 9eeb48b..6867714 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,479 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::focusedFrameChanged): + * src/ChromeClientImpl.h: + +2010-11-08 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Only call WebInspector_syncDispatch if it's actually a function. + https://bugs.webkit.org/show_bug.cgi?id=49180 + + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl): + (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend): + * src/WebDevToolsFrontendImpl.h: + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * public/WebCache.h: + * src/WebCache.cpp: + (WebKit::ToResourceTypeStat): + (WebKit::WebCache::setCapacities): + (WebKit::WebCache::clear): + (WebKit::WebCache::getUsageStats): + (WebKit::WebCache::getResourceTypeStats): + +2010-11-07 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Kent Tamura. + + Fixing a crasher with the select popup on Mac that happens when a + page removes the select node when the select changes. + https://bugs.webkit.org/show_bug.cgi?id=49108 + + * src/ExternalPopupMenu.cpp: + (WebKit::ExternalPopupMenu::didAcceptIndex): + (WebKit::ExternalPopupMenu::didCancel): + +2010-11-06 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed. Chromium DevTools: disable filesystem inspection + until polished. + https://bugs.webkit.org/show_bug.cgi?id=48963 + + * src/js/DevTools.js: + +2010-11-05 Ilya Sherman <isherman@chromium.org> + + Reviewed by Simon Fraser. + + Querying selection start and end should be const + https://bugs.webkit.org/show_bug.cgi?id=48786 + + * public/WebInputElement.h: + * src/WebInputElement.cpp: + (WebKit::WebInputElement::selectionStart): + (WebKit::WebInputElement::selectionEnd): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * src/WebAnimationControllerImpl.cpp: + (WebKit::WebAnimationControllerImpl::suspendAnimations): + (WebKit::WebAnimationControllerImpl::resumeAnimations): + +2010-11-04 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Need to simulate DEPTH_STENCIL in framebufferRenderbuffer / getFramebufferAttachmentParameter + https://bugs.webkit.org/show_bug.cgi?id=49020 + + * src/WebGraphicsContext3DDefaultImpl.cpp: Remove DEPTH_STENCIL_ATTACHMENT emulation at this level. + +2010-11-05 Darin Fisher <darin@chromium.org> + + Pull chromium@65229 to fix the build. + + * DEPS: + +2010-11-05 Darin Fisher <darin@chromium.org> + + Reviewed by Nate Chapin. + + Replace deprecated TargetIsSub{Frame,Resource} with TargetIsSub{frame,resource}. + https://bugs.webkit.org/show_bug.cgi?id=49074 + + * public/WebURLRequest.h: + * src/FrameLoaderClientImpl.cpp: + +2010-11-05 Charlie Reis <creis@chromium.org> + + Reviewed by Darin Fisher. + + WebFrame::previousHistoryItem() should return last committed item. + https://bugs.webkit.org/show_bug.cgi?id=48809 + + * src/WebFrameImpl.cpp: + +2010-10-27 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Clean up IDBTransactionBackend/Coordinator + https://bugs.webkit.org/show_bug.cgi?id=48425 + + Remove obsolete ::id() method. + + * public/WebIDBTransaction.h: + * src/IDBTransactionBackendProxy.cpp: + * src/IDBTransactionBackendProxy.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2010-11-04 usaini <usaini08@gmail.com> + + Reviewed by Antonio Gomes. + + WebWindowFeatures has a faulty constructor for WebCore::WindowFeatures + https://bugs.webkit.org/show_bug.cgi?id=48035 + + * public/WebWindowFeatures.h: + (WebKit::WebWindowFeatures::WebWindowFeatures): updated the constructor + that takes in a WebCore::WindowFeature and had it copy all the variables + over properly so that after calling the constructor WebWindowFeatures is + always in a valid state. Before, the x,y,width,height booleans may be true, but + the corresponding int values would not be updated. + +2010-11-04 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Remove IMPLEMENTATION_COLOR_READ_FORMAT and TYPE + https://bugs.webkit.org/show_bug.cgi?id=48938 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::getIntegerv): + +2010-11-04 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Adam Barth. + + Web Inspector: Enable files ystem UI for chromium + https://bugs.webkit.org/show_bug.cgi?id=48963 + + * src/js/DevTools.js: + +2010-11-03 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPS + https://bugs.webkit.org/show_bug.cgi?id=48978 + + * DEPS: + +2010-11-03 Vincent Scheib <scheib@chromium.org> + + Reviewed by James Robinson. + + [chromium] GraphicsContext3D creation attributes include canRecoverFromContextLoss option + https://bugs.webkit.org/show_bug.cgi?id=48850 + + Implementations of GraphicsContext3D may respect the creation attribute + canRecoverFromContextLoss being false, and then only succeeding initialization if + the context can satisfy that request of never being lost. DX9 on XP can not satisfy + such a request. + + Test by use of accelerated canvas 2d in Chromium with ANGLE on XP machines. + + * public/WebGraphicsContext3D.h: + (WebKit::WebGraphicsContext3D::Attributes::Attributes): + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::initialize): + +2010-11-03 Jenn Braithwaite <jennb@chromium.org> + + Reviewed by Dmitry Titov. + + Chromium: Update resource tracking when moving a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=48363 + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::removeIdentifierForRequest): + Added + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::transferLoadingResourceFromPage): + Notify current WebFrameClient of the resource and remove from + former WebFrameClient. + +2010-11-03 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPs + https://bugs.webkit.org/show_bug.cgi?id=48959 + + * DEPS: + +2010-11-03 Kenneth Russell <kbr@google.com> + + Reviewed by Chris Marrin. + + Redesign extension mechanism in GraphicsContext3D + https://bugs.webkit.org/show_bug.cgi?id=46894 + + Upon request, factored out extension support from GraphicsContext3D + into a new Extensions3D class. (The plural was chosen because the + class and subclasses hold multiple extensions.) + + Unlike GraphicsContext3D, Extensions3D contains only pure virtual + methods. This was done because Extensions3D's inheritance diagram + and usage pattern is very different from that of GraphicsContext3D, + and the concrete subclasses need to decide how to implement the + various entry points. Requiring them to be placed at the + Extensions3D level will cause implementation details to leak into + the base class, which is highly undesirable. Any virtual call + overhead to these entry points will be negligible. + + Changed call sites utilizing these extensions to call through the + Extensions3D object or its subclasses. + + Tested: + - Chromium on Linux with accelerated 2D canvas and HTML5 video + - Chromium on Mac OS X with WebGL and CSS 3D content + - Safari on Mac OS X with WebGL and CSS 3D content + + No new tests. Covered by existing tests. + + * WebKit.gyp: + * public/WebGraphicsContext3D.h: + * src/Extensions3DChromium.cpp: Added. + (WebCore::Extensions3DChromium::Extensions3DChromium): + (WebCore::Extensions3DChromium::~Extensions3DChromium): + (WebCore::Extensions3DChromium::supports): + (WebCore::Extensions3DChromium::getGraphicsResetStatusARB): + (WebCore::Extensions3DChromium::mapBufferSubDataCHROMIUM): + (WebCore::Extensions3DChromium::unmapBufferSubDataCHROMIUM): + (WebCore::Extensions3DChromium::mapTexSubImage2DCHROMIUM): + (WebCore::Extensions3DChromium::unmapTexSubImage2DCHROMIUM): + (WebCore::Extensions3DChromium::copyTextureToParentTextureCHROMIUM): + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::getExtensions): + (WebCore::GraphicsContext3DInternal::supportsExtension): + * src/GraphicsContext3DInternal.h: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::getString): + * src/WebGraphicsContext3DDefaultImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::composite): + +2010-11-03 Daniel Bates <dbates@rim.com> + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the Chromium port. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::name): + +2010-11-02 Al Patrick <apatrick@chromium.org> + + Reviewed by Kenneth Russell. + + [chromium] Plugin instances can propagate the ID of the OpenGL texture they render to. + + https://bugs.webkit.org/show_bug.cgi?id=48032 + + * public/WebPlugin.h: + (WebKit::WebPlugin::getBackingTextureId): + * public/WebPluginContainer.h: + (WebKit::WebPluginContainer::commitBackingTexture): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::commitBackingTexture): + (WebKit::WebPluginContainerImpl::platformLayer): + (WebKit::WebPluginContainerImpl::WebPluginContainerImpl): + * src/WebPluginContainerImpl.h: + +2010-11-02 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Dumitru Daniliuc. + + [FileSystem] Support not creating directories when queried by inspector. + https://bugs.webkit.org/show_bug.cgi?id=48169 + + * src/LocalFileSystemChromium.cpp: + (WebCore::LocalFileSystem::readFileSystem): + (WebCore::LocalFileSystem::requestFileSystem): + +2010-11-02 Chris Guillory <chris.guillory@google.com> + + Reviewed by Chris Fleizach. + + Chromium: Propagate a document value changed notification on scroll. + https://bugs.webkit.org/show_bug.cgi?id=48817 + + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::boundingBoxRect): + +2010-10-29 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium]: Allow plugins to use optimized scrolling + https://bugs.webkit.org/show_bug.cgi?id=48660 + + * public/WebPluginContainer.h: + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::scrollRect): + * src/WebPluginContainerImpl.h: + +2010-11-02 Marc-Antoine Ruel <maruel@chromium.org> + + Reviewed by Dimitri Glazkov. + + Disable incremental linking for webkit_unit_test and DumpRenderTRee on x86 Windows on chromium build. + https://bugs.webkit.org/show_bug.cgi?id=48836 + + It fails to link otherwise due to lack of virtual address space. + + * WebKit.gyp: + +2010-11-02 Ilya Sherman <isherman@chromium.org> + + Reviewed by Kent Tamura. + + Expose the sendChangeEvent parameter in WebInputElement::setValue() API, + primarily so that chromium form autofill can fire the onChange event. + https://bugs.webkit.org/show_bug.cgi?id=48177 + + * public/WebInputElement.h: + * src/WebInputElement.cpp: + (WebKit::WebInputElement::setValue): + +2010-11-02 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: make properties and event listeners look consistent with the styles section. + https://bugs.webkit.org/show_bug.cgi?id=48827 + + * src/js/devTools.css: + +2010-11-01 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] Compile TestNetscapePlugin on chromium win + https://bugs.webkit.org/show_bug.cgi?id=48802 + + It creates npTestNetscapePlugin.dll in the build directory, so + it's not yet loaded by DRT or test_shell. + + * WebKit.gyp: + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * src/ChromeClientImpl.h: + (WebKit::ChromeClientImpl::showContextMenu): + +2010-11-01 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: Chromium build fix. + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::WebDevToolsAgentImpl): + +2010-11-01 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: remove old resources panel. + https://bugs.webkit.org/show_bug.cgi?id=45657 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + * src/WebDevToolsAgentImpl.h: + +2010-11-01 Leandro Gracia Gil <leandrogracia@google.com> + + Reviewed by Jeremy Orlow. + + This is the last part of a 4-sided patch for the language attribute + in speech text buttons. This patch removes what now is dead code + and re-enables the layout test introduced by bug 47089. + https://bugs.webkit.org/show_bug.cgi?id=47420 + + * public/WebSpeechInputControllerMock.h: + * src/WebSpeechInputControllerMockImpl.cpp: + * src/WebSpeechInputControllerMockImpl.h: + +2010-10-31 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: unhide new network and resources panels. + https://bugs.webkit.org/show_bug.cgi?id=48725 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::name): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Added the corresponding Chromium setting to WebCore's EditingUnixBehavior: EditingBehaviorUnix. + + * public/WebSettings.h: + * src/AssertMatchingEnums.cpp: + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified Chromium-port to use FrameTree::uniqueName(). + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::name): + +2010-10-29 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: FileSystem integration + https://bugs.webkit.org/show_bug.cgi?id=45982 + + * public/WebFileUtilities.h: + (WebKit::WebFileUtilities::revealFolderInOS): + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::revealFolderInOS): + + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index aaf0b0a..4fc0372 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': '64214' + 'chromium_rev': '65229' } deps = { @@ -91,14 +91,12 @@ deps = { Var('chromium_svn')+'/media@'+Var('chromium_rev'), 'printing': Var('chromium_svn')+'/printing@'+Var('chromium_rev'), + 'ppapi': + Var('chromium_svn')+'/ppapi@'+Var('chromium_rev'), 'third_party/angle': # needed by the gpu process From('chromium_deps', 'src/third_party/angle'), '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/libwebp': Var('chromium_svn')+'/third_party/libwebp@'+Var('chromium_rev'), 'tools/grit': @@ -111,8 +109,6 @@ deps = { Var('chromium_svn')+'/third_party@'+Var('chromium_rev'), 'third_party/icu': From('chromium_deps', 'src/third_party/icu'), - 'third_party/ppapi': - From('chromium_deps', 'src/third_party/ppapi'), 'third_party/ots': From('chromium_deps', 'src/third_party/ots'), } diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index f121c5f..4dcc61a 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -328,6 +328,7 @@ 'src/EditorClientImpl.h', 'src/EventListenerWrapper.cpp', 'src/EventListenerWrapper.h', + 'src/Extensions3DChromium.cpp', 'src/ExternalPopupMenu.cpp', 'src/ExternalPopupMenu.h', 'src/FrameLoaderClientImpl.cpp', @@ -741,7 +742,6 @@ 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], }], }, - { 'target_name': 'webkit_unit_tests', 'type': 'executable', @@ -801,6 +801,17 @@ }], ], }], + ['inside_chromium_build==1 and OS=="win" and component!="shared_library"', { + 'configurations': { + 'Debug_Base': { + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', + }, + }, + }, + }, + }], ], }, { @@ -826,6 +837,7 @@ 'dependencies': [ 'ImageDiff', 'inspector_resources', + 'TestNetscapePlugIn', 'webkit', '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config', '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc', @@ -872,6 +884,17 @@ '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', ], }], + ['inside_chromium_build==1', { + 'configurations': { + 'Debug_Base': { + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', + }, + }, + }, + }, + }], ], 'copies': [{ 'destination': '<(PRODUCT_DIR)', @@ -881,9 +904,6 @@ 'sources/': [ ['exclude', 'Win\\.cpp$'], ], - 'dependencies': [ - 'TestNetscapePlugIn', - ], 'actions': [ { 'action_name': 'repack_locale', @@ -972,6 +992,63 @@ }], ], }, + { + 'target_name': 'TestNetscapePlugIn', + 'type': 'loadable_module', + 'sources': [ '<@(test_plugin_files)' ], + 'dependencies': [ + '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', + ], + 'include_dirs': [ + '<(chromium_src_dir)', + '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn', + '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders', + ], + 'conditions': [ + ['OS=="mac"', { + 'mac_bundle': 1, + # It would be nice to name this + # TestNetscapePlugIn, but that name is already + # used by the fork of this plugin in Chromium. + 'product_name': 'WebKitTestNetscapePlugIn', + 'product_extension': 'plugin', + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + ] + }, + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + # This is a temporary fork of + # DRT/TestNetscapePlugIn/mac/Info.plist. Once + # we get rid of our forked plugin in the + # chromium repo, we can share the same + # Info.plist. + 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist', + }, + }], + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { + 'cflags': [ + '-fvisibility=default', + ], + }], + ['OS=="win"', { + 'defines': [ + # This seems like a hack, but this is what Safari Win does. + 'snprintf=_snprintf', + ], + 'sources': [ + '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def', + '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc', + ], + # The .rc file requires that the name of the dll is npTestNetscapePlugin.dll. + # This adds the 'np' to the dll name. + 'product_prefix': 'np', + }], + ], + }, ], # targets 'conditions': [ ['OS=="win"', { @@ -980,54 +1057,6 @@ 'type': 'executable', 'sources': ['../../WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'], }], - }, { # OS!="win" - 'targets': [ - { - 'target_name': 'TestNetscapePlugIn', - 'type': 'loadable_module', - 'sources': [ '<@(test_plugin_files)' ], - 'dependencies': [ - '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', - ], - 'include_dirs': [ - '<(chromium_src_dir)', - '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn', - '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders', - ], - - 'conditions': [ - ['OS=="mac"', { - 'mac_bundle': 1, - # It would be nice to name this - # TestNetscapePlugIn, but that name is already - # used by the fork of this plugin in Chromium. - 'product_name': 'WebKitTestNetscapePlugIn', - 'product_extension': 'plugin', - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', - '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', - ] - }, - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', - # This is a temporary fork of - # DRT/TestNetscapePlugIn/mac/Info.plist. Once - # we get rid of our forked plugin in the - # chromium repo, we can share the same - # Info.plist. - 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist', - }, - }], - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { - 'cflags': [ - '-fvisibility=default', - ], - }], - ], - }, - ], }], ['OS=="mac"', { 'targets': [ diff --git a/WebKit/chromium/public/WebCache.h b/WebKit/chromium/public/WebCache.h index 433eb1a..e8a18d3 100644 --- a/WebKit/chromium/public/WebCache.h +++ b/WebKit/chromium/public/WebCache.h @@ -48,7 +48,7 @@ public: size_t deadSize; }; - // A struct mirroring WebCore::Cache::TypeStatistic. + // A struct mirroring WebCore::MemoryCache::TypeStatistic. struct ResourceTypeStat { size_t count; size_t size; @@ -56,7 +56,7 @@ public: size_t decodedSize; }; - // A struct mirroring WebCore::Cache::Statistics. + // A struct mirroring WebCore::MemoryCache::Statistics. struct ResourceTypeStats { ResourceTypeStat images; ResourceTypeStat cssStyleSheets; diff --git a/WebKit/chromium/public/WebFileUtilities.h b/WebKit/chromium/public/WebFileUtilities.h index 456ba69..c8876f2 100644 --- a/WebKit/chromium/public/WebFileUtilities.h +++ b/WebKit/chromium/public/WebFileUtilities.h @@ -48,7 +48,7 @@ public: #else typedef int FileHandle; #endif - + virtual void revealFolderInOS(const WebString& path) { } virtual bool fileExists(const WebString& path) { return false; } virtual bool deleteFile(const WebString& path) { return false; } virtual bool deleteEmptyDirectory(const WebString& path) { return false; } diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index c5cfc21..9063350 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -240,6 +240,10 @@ public: virtual void assignIdentifierToRequest( WebFrame*, unsigned identifier, const WebURLRequest&) { } + // Remove the association between an identifier assigned to a request if + // the client keeps such an association. + virtual void removeIdentifierForRequest(unsigned identifier) { } + // A request is about to be sent out, and the client may modify it. Request // is writable, and changes to the URL, for example, will change the request // made. If this request is the result of a redirect, then redirectResponse diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 15e6365..9656887 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -64,6 +64,7 @@ public: , stencil(true) , antialias(true) , premultipliedAlpha(true) + , canRecoverFromContextLoss(true) { } @@ -72,6 +73,7 @@ public: bool stencil; bool antialias; bool premultipliedAlpha; + bool canRecoverFromContextLoss; }; // This destructor needs to be public so that using classes can destroy instances if initialization fails. @@ -134,18 +136,13 @@ public: // getError in the order they were added. virtual void synthesizeGLError(unsigned long error) = 0; - // EXT_texture_format_BGRA8888 - virtual bool supportsBGRA() = 0; - // GL_CHROMIUM_map_sub - virtual bool supportsMapSubCHROMIUM() = 0; virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) = 0; virtual void unmapBufferSubDataCHROMIUM(const void*) = 0; virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) = 0; virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0; // GL_CHROMIUM_copy_texture_to_parent_texture - virtual bool supportsCopyTextureToParentTextureCHROMIUM() = 0; virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) = 0; // The entry points below map directly to the OpenGL ES 2.0 API. diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h index 385dd1e..cff7c67 100644 --- a/WebKit/chromium/public/WebIDBTransaction.h +++ b/WebKit/chromium/public/WebIDBTransaction.h @@ -52,11 +52,6 @@ public: } virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); } virtual void didCompleteTaskEvents() { WEBKIT_ASSERT_NOT_REACHED(); } - virtual int id() const - { - WEBKIT_ASSERT_NOT_REACHED(); - return 0; - } virtual void setCallbacks(WebIDBTransactionCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } // FIXME: this is never called from WebCore. Find a cleaner solution. diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h index 8fea4fa..0c0764c 100644 --- a/WebKit/chromium/public/WebInputElement.h +++ b/WebKit/chromium/public/WebInputElement.h @@ -66,7 +66,7 @@ namespace WebKit { WEBKIT_API bool isActivatedSubmit() const; WEBKIT_API void setActivatedSubmit(bool); WEBKIT_API int size() const; - WEBKIT_API void setValue(const WebString&); + WEBKIT_API void setValue(const WebString&, bool sendChangeEvent = false); WEBKIT_API WebString value() const; WEBKIT_API void setSuggestedValue(const WebString&); WEBKIT_API WebString suggestedValue() const; @@ -76,8 +76,8 @@ namespace WebKit { WEBKIT_API void setAutofilled(bool); WEBKIT_API void dispatchFormControlChangeEvent(); WEBKIT_API void setSelectionRange(int, int); - WEBKIT_API int selectionStart(); - WEBKIT_API int selectionEnd(); + WEBKIT_API int selectionStart() const; + WEBKIT_API int selectionEnd() const; WEBKIT_API bool isValidValue(const WebString&) const; #if WEBKIT_IMPLEMENTATION diff --git a/WebKit/chromium/public/WebPlugin.h b/WebKit/chromium/public/WebPlugin.h index 17e29e2..4a6f081 100644 --- a/WebKit/chromium/public/WebPlugin.h +++ b/WebKit/chromium/public/WebPlugin.h @@ -64,6 +64,10 @@ public: virtual void updateGeometry( const WebRect& frameRect, const WebRect& clipRect, const WebVector<WebRect>& cutOutsRects, bool isVisible) = 0; + + // If the plugin instance is backed by an OpenGL texture, return its ID in the + // compositors namespace. Otherwise return 0. Returns 0 by default. + virtual unsigned getBackingTextureId() { return 0; } virtual void updateFocus(bool) = 0; virtual void updateVisibility(bool) = 0; diff --git a/WebKit/chromium/public/WebPluginContainer.h b/WebKit/chromium/public/WebPluginContainer.h index af20c66..c580f81 100644 --- a/WebKit/chromium/public/WebPluginContainer.h +++ b/WebKit/chromium/public/WebPluginContainer.h @@ -49,11 +49,15 @@ public: virtual void invalidate() = 0; virtual void invalidateRect(const WebRect&) = 0; + virtual void scrollRect(int dx, int dy, const WebRect&) = 0; // Causes the container to report its current geometry via // WebPlugin::updateGeometry. virtual void reportGeometry() = 0; - + + // Called when the backing texture is ready to be composited. + virtual void commitBackingTexture() {} + // Drop any references to script objects allocated by the plugin. // These are objects derived from WebPlugin::scriptableObject. This is // called when the plugin is being destroyed or if it needs to be diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 6a37e08..469db05 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -45,7 +45,8 @@ class WebSettings { public: enum EditingBehavior { EditingBehaviorMac, - EditingBehaviorWin + EditingBehaviorWin, + EditingBehaviorUnix }; virtual void setStandardFontFamily(const WebString&) = 0; diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h index b4c50a0..0a7f6f9 100644 --- a/WebKit/chromium/public/WebSpeechInputControllerMock.h +++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h @@ -45,10 +45,6 @@ public: virtual ~WebSpeechInputControllerMock() { } virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; - - // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched. - // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch. - virtual void setMockRecognitionResult(const WebString& result) = 0; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebURLRequest.h b/WebKit/chromium/public/WebURLRequest.h index e64ce80..c800452 100644 --- a/WebKit/chromium/public/WebURLRequest.h +++ b/WebKit/chromium/public/WebURLRequest.h @@ -58,9 +58,7 @@ public: enum TargetType { TargetIsMainFrame = 0, - TargetIsSubFrame = 1, // Temporary for backward compatibility. TargetIsSubframe = 1, - TargetIsSubResource = 2, // Temporary for backward comptibility. TargetIsSubresource = 2, TargetIsStyleSheet = 3, TargetIsScript = 4, diff --git a/WebKit/chromium/public/WebWindowFeatures.h b/WebKit/chromium/public/WebWindowFeatures.h index 2e7278a..99d8580 100644 --- a/WebKit/chromium/public/WebWindowFeatures.h +++ b/WebKit/chromium/public/WebWindowFeatures.h @@ -81,9 +81,13 @@ struct WebWindowFeatures { #if WEBKIT_IMPLEMENTATION WebWindowFeatures(const WebCore::WindowFeatures& f) - : xSet(f.xSet) + : x(f.x) + , xSet(f.xSet) + , y(f.y) , ySet(f.ySet) + , width(f.width) , widthSet(f.widthSet) + , height(f.height) , heightSet(f.heightSet) , menuBarVisible(f.menuBarVisible) , statusBarVisible(f.statusBarVisible) diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index c6ab85a..3fffd60 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -344,6 +344,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebScrollbar::ScrollByPixel, ScrollByPixel); COMPILE_ASSERT_MATCHING_ENUM(WebSettings::EditingBehaviorMac, EditingMacBehavior); COMPILE_ASSERT_MATCHING_ENUM(WebSettings::EditingBehaviorWin, EditingWindowsBehavior); +COMPILE_ASSERT_MATCHING_ENUM(WebSettings::EditingBehaviorUnix, EditingUnixBehavior); COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM); COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM); diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index df13b29..18f7a02 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -252,6 +252,10 @@ void ChromeClientImpl::focusedNodeChanged(Node* node) m_webView->client()->setKeyboardFocusURL(focusURL); } +void ChromeClientImpl::focusedFrameChanged(Frame*) +{ +} + Page* ChromeClientImpl::createWindow( Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features, const NavigationAction&) { diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h index 039fc1b..87c1653 100644 --- a/WebKit/chromium/src/ChromeClientImpl.h +++ b/WebKit/chromium/src/ChromeClientImpl.h @@ -70,6 +70,7 @@ public: virtual bool canTakeFocus(WebCore::FocusDirection); virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); + virtual void focusedFrameChanged(WebCore::Frame*); virtual WebCore::Page* createWindow( WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); virtual void show(); @@ -174,6 +175,10 @@ public: virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const; virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + private: void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*); diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 1af32cf..39d2566 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -345,6 +345,11 @@ bool ChromiumBridge::getFileSize(const String& path, long long& result) return webKitClient()->fileUtilities()->getFileSize(path, result); } +void ChromiumBridge::revealFolderInOS(const String& path) +{ + webKitClient()->fileUtilities()->revealFolderInOS(path); +} + bool ChromiumBridge::getFileModificationTime(const String& path, time_t& result) { double modificationTime; diff --git a/WebKit/chromium/src/Extensions3DChromium.cpp b/WebKit/chromium/src/Extensions3DChromium.cpp new file mode 100644 index 0000000..c36040b --- /dev/null +++ b/WebKit/chromium/src/Extensions3DChromium.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#if ENABLE(3D_CANVAS) + +#include "Extensions3DChromium.h" + +#include "GraphicsContext3D.h" +#include "GraphicsContext3DInternal.h" + +namespace WebCore { + +Extensions3DChromium::Extensions3DChromium(GraphicsContext3DInternal* internal) + : m_internal(internal) +{ +} + +Extensions3DChromium::~Extensions3DChromium() +{ +} + +bool Extensions3DChromium::supports(const String& name) +{ + return m_internal->supportsExtension(name); +} + +int Extensions3DChromium::getGraphicsResetStatusARB() +{ + // FIXME: implement this in GraphicsContext3DInternal / WebGraphicsContext3DInternal. + return GraphicsContext3D::NO_ERROR; +} + +void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) +{ + return m_internal->mapBufferSubDataCHROMIUM(target, offset, size, access); +} + +void Extensions3DChromium::unmapBufferSubDataCHROMIUM(const void* data) +{ + m_internal->unmapBufferSubDataCHROMIUM(data); +} + +void* Extensions3DChromium::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) +{ + return m_internal->mapTexSubImage2DCHROMIUM(target, level, xoffset, yoffset, width, height, format, type, access); +} + +void Extensions3DChromium::unmapTexSubImage2DCHROMIUM(const void* data) +{ + m_internal->unmapTexSubImage2DCHROMIUM(data); +} + +void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) +{ + m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture); +} + +} // namespace WebCore + +#endif // ENABLE(3D_CANVAS) diff --git a/WebKit/chromium/src/ExternalPopupMenu.cpp b/WebKit/chromium/src/ExternalPopupMenu.cpp index a0243eb..0f208fb 100644 --- a/WebKit/chromium/src/ExternalPopupMenu.cpp +++ b/WebKit/chromium/src/ExternalPopupMenu.cpp @@ -98,15 +98,26 @@ void ExternalPopupMenu::didChangeSelection(int index) void ExternalPopupMenu::didAcceptIndex(int index) { + // Calling methods on the PopupMenuClient might lead to this object being + // derefed. This ensures it does not get deleted while we are running this + // method. + RefPtr<ExternalPopupMenu> guard(this); + if (m_popupMenuClient) { m_popupMenuClient->valueChanged(index); - m_popupMenuClient->popupDidHide(); + // The call to valueChanged above might have lead to a call to + // disconnectClient, so we might not have a PopupMenuClient anymore. + if (m_popupMenuClient) + m_popupMenuClient->popupDidHide(); } m_webExternalPopupMenu = 0; } void ExternalPopupMenu::didCancel() { + // See comment in didAcceptIndex on why we need this. + RefPtr<ExternalPopupMenu> guard(this); + if (m_popupMenuClient) m_popupMenuClient->popupDidHide(); m_webExternalPopupMenu = 0; diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 29141ac..ef28981 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -288,7 +288,7 @@ void FrameLoaderClientImpl::assignIdentifierToInitialRequest( // this includes images and xmlhttp requests. It is important to note that a // subresource is NOT limited to stuff loaded through the frame's subresource // loader. Synchronous xmlhttp requests for example, do not go through the -// subresource loader, but we still label them as TargetIsSubResource. +// subresource loader, but we still label them as TargetIsSubresource. // // The important edge cases to consider when modifying this function are // how synchronous resource loads are treated during load/unload threshold. @@ -1389,9 +1389,13 @@ void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*) m_webFrame->setClient(newParent->client()); } -void FrameLoaderClientImpl::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +void FrameLoaderClientImpl::transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage) { - notImplemented(); + assignIdentifierToInitialRequest(identifier, loader, request); + + WebFrameImpl* oldWebFrame = WebFrameImpl::fromFrame(oldPage->mainFrame()); + if (oldWebFrame && oldWebFrame->client()) + oldWebFrame->client()->removeIdentifierForRequest(identifier); } PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( diff --git a/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/WebKit/chromium/src/GraphicsContext3DChromium.cpp index afc2707..4d9e40b 100644 --- a/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -39,6 +39,7 @@ #include "CanvasRenderingContext.h" #include "Chrome.h" #include "ChromeClientImpl.h" +#include "Extensions3DChromium.h" #include "GraphicsContext3DInternal.h" #include "HTMLCanvasElement.h" #include "HTMLImageElement.h" @@ -83,6 +84,7 @@ namespace WebCore { GraphicsContext3DInternal::GraphicsContext3DInternal() : m_webViewImpl(0) + , m_initializedAvailableExtensions(false) #if PLATFORM(SKIA) #elif PLATFORM(CG) , m_renderOutput(0) @@ -108,6 +110,7 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, webAttributes.stencil = attrs.stencil; webAttributes.antialias = attrs.antialias; webAttributes.premultipliedAlpha = attrs.premultipliedAlpha; + webAttributes.canRecoverFromContextLoss = attrs.canRecoverFromContextLoss; WebKit::WebGraphicsContext3D* webContext = WebKit::webKitClient()->createGraphicsContext3D(); if (!webContext) return false; @@ -675,13 +678,31 @@ DELEGATE_TO_IMPL_1(deleteShader, unsigned) DELEGATE_TO_IMPL_1(deleteTexture, unsigned) DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long) -DELEGATE_TO_IMPL_R(supportsBGRA, bool) -DELEGATE_TO_IMPL_R(supportsMapSubCHROMIUM, bool) + +Extensions3D* GraphicsContext3DInternal::getExtensions() +{ + if (!m_extensions) + m_extensions = adoptPtr(new Extensions3DChromium(this)); + return m_extensions.get(); +} + +bool GraphicsContext3DInternal::supportsExtension(const String& name) +{ + if (!m_initializedAvailableExtensions) { + String extensionsString = getString(GraphicsContext3D::EXTENSIONS); + Vector<String> availableExtensions; + extensionsString.split(" ", availableExtensions); + for (size_t i = 0; i < availableExtensions.size(); ++i) + m_availableExtensions.add(availableExtensions[i]); + m_initializedAvailableExtensions = true; + } + return m_availableExtensions.contains(name); +} + DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*) DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*) DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*) DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) -DELEGATE_TO_IMPL_R(supportsCopyTextureToParentTextureCHROMIUM, bool) DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned) //---------------------------------------------------------------------- @@ -1023,14 +1044,7 @@ DELEGATE_TO_INTERNAL_1(deleteShader, unsigned) DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned) DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long) -DELEGATE_TO_INTERNAL_R(supportsBGRA, bool) -DELEGATE_TO_INTERNAL_R(supportsMapSubCHROMIUM, bool) -DELEGATE_TO_INTERNAL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*) -DELEGATE_TO_INTERNAL_1(unmapBufferSubDataCHROMIUM, const void*) -DELEGATE_TO_INTERNAL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*) -DELEGATE_TO_INTERNAL_1(unmapTexSubImage2DCHROMIUM, const void*) -DELEGATE_TO_INTERNAL_R(supportsCopyTextureToParentTextureCHROMIUM, bool) -DELEGATE_TO_INTERNAL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned) +DELEGATE_TO_INTERNAL_R(getExtensions, Extensions3D*) bool GraphicsContext3D::isGLES2Compliant() const { @@ -1047,11 +1061,6 @@ bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const return m_internal->isErrorGeneratedOnOutOfBoundsAccesses(); } -int GraphicsContext3D::getGraphicsResetStatusARB() -{ - return NO_ERROR; -} - } // namespace WebCore #endif // ENABLE(3D_CANVAS) diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h index f12fff0..17163a4 100644 --- a/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -27,6 +27,7 @@ #define GraphicsContext3DInternal_h #include "GraphicsContext3D.h" +#include <wtf/HashSet.h> #include <wtf/OwnPtr.h> #if PLATFORM(SKIA) #include "SkBitmap.h" @@ -39,6 +40,7 @@ class WebViewImpl; namespace WebCore { +class Extensions3DChromium; #if USE(ACCELERATED_COMPOSITING) class WebGLLayerChromium; #endif @@ -260,7 +262,9 @@ public: void synthesizeGLError(unsigned long error); - void swapBuffers(); + // Extensions3D support. + Extensions3D* getExtensions(); + bool supportsExtension(const String& name); // EXT_texture_format_BGRA8888 bool supportsBGRA(); @@ -278,7 +282,10 @@ public: private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; + OwnPtr<Extensions3DChromium> m_extensions; WebKit::WebViewImpl* m_webViewImpl; + bool m_initializedAvailableExtensions; + HashSet<String> m_availableExtensions; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebGLLayerChromium> m_compositingLayer; #endif diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index 4b19ee4..7a88b13 100644 --- a/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -84,11 +84,6 @@ void IDBTransactionBackendProxy::didCompleteTaskEvents() m_webIDBTransaction->didCompleteTaskEvents(); } -int IDBTransactionBackendProxy::id() const -{ - return m_webIDBTransaction->id(); -} - void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks) { m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks)); diff --git a/WebKit/chromium/src/IDBTransactionBackendProxy.h b/WebKit/chromium/src/IDBTransactionBackendProxy.h index 0c56f19..0bf84da 100644 --- a/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -47,7 +47,6 @@ public: virtual void abort(); virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task>); virtual void didCompleteTaskEvents(); - virtual int id() const; virtual void setCallbacks(IDBTransactionCallbacks*); WebKit::WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } diff --git a/WebKit/chromium/src/LocalFileSystemChromium.cpp b/WebKit/chromium/src/LocalFileSystemChromium.cpp index 25b1feb..a9c61d0 100644 --- a/WebKit/chromium/src/LocalFileSystemChromium.cpp +++ b/WebKit/chromium/src/LocalFileSystemChromium.cpp @@ -57,13 +57,21 @@ LocalFileSystem& LocalFileSystem::localFileSystem() return *localFileSystem; } +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) +{ + ASSERT(context && context->isDocument()); + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, false, new WebFileSystemCallbacksImpl(callbacks)); +} + void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) { ASSERT(context); if (context->isDocument()) { Document* document = static_cast<Document*>(context); WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks)); + webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, true, new WebFileSystemCallbacksImpl(callbacks)); } else { WorkerContext* workerContext = static_cast<WorkerContext*>(context); WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy(); diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp index 96a3173..9df69cf 100644 --- a/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -351,7 +351,7 @@ WebRect WebAccessibilityObject::boundingBoxRect() const return WebRect(); m_private->updateBackingStore(); - return m_private->documentFrameView()->contentsToWindow(m_private->boundingBoxRect()); + return m_private->boundingBoxRect(); } WebString WebAccessibilityObject::helpText() const diff --git a/WebKit/chromium/src/WebAnimationControllerImpl.cpp b/WebKit/chromium/src/WebAnimationControllerImpl.cpp index 15df140..e6eb828 100644 --- a/WebKit/chromium/src/WebAnimationControllerImpl.cpp +++ b/WebKit/chromium/src/WebAnimationControllerImpl.cpp @@ -94,7 +94,7 @@ void WebAnimationControllerImpl::suspendAnimations() const return; if (!m_frameImpl->frame()) return; - controller->suspendAnimations(m_frameImpl->frame()->document()); + controller->suspendAnimations(); } void WebAnimationControllerImpl::resumeAnimations() const @@ -104,7 +104,7 @@ void WebAnimationControllerImpl::resumeAnimations() const return; if (!m_frameImpl->frame()) return; - controller->resumeAnimations(m_frameImpl->frame()->document()); + controller->resumeAnimations(); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebCache.cpp b/WebKit/chromium/src/WebCache.cpp index c124bdf..2203498 100644 --- a/WebKit/chromium/src/WebCache.cpp +++ b/WebKit/chromium/src/WebCache.cpp @@ -31,20 +31,20 @@ #include "config.h" #include "WebCache.h" -// Instead of providing accessors, we make all members of Cache public. -// This will make it easier to track WebCore changes to the Cache class. -// FIXME: We should introduce public getters on the Cache class. +// Instead of providing accessors, we make all members of MemoryCache public. +// This will make it easier to track WebCore changes to the MemoryCache class. +// FIXME: We should introduce public getters on the MemoryCache class. #define private public -#include "Cache.h" +#include "MemoryCache.h" #undef private using namespace WebCore; namespace WebKit { -// A helper method for coverting a Cache::TypeStatistic to a +// A helper method for coverting a MemoryCache::TypeStatistic to a // WebCache::ResourceTypeStat. -static void ToResourceTypeStat(const Cache::TypeStatistic& from, +static void ToResourceTypeStat(const MemoryCache::TypeStatistic& from, WebCache::ResourceTypeStat& to) { to.count = static_cast<size_t>(from.count); @@ -56,7 +56,7 @@ static void ToResourceTypeStat(const Cache::TypeStatistic& from, void WebCache::setCapacities( size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity) { - Cache* cache = WebCore::cache(); + MemoryCache* cache = WebCore::cache(); if (cache) cache->setCapacities(static_cast<unsigned int>(minDeadCapacity), static_cast<unsigned int>(maxDeadCapacity), @@ -65,7 +65,7 @@ void WebCache::setCapacities( void WebCache::clear() { - Cache* cache = WebCore::cache(); + MemoryCache* cache = WebCore::cache(); if (cache && !cache->disabled()) { cache->setDisabled(true); cache->setDisabled(false); @@ -76,7 +76,7 @@ void WebCache::getUsageStats(UsageStats* result) { ASSERT(result); - Cache* cache = WebCore::cache(); + MemoryCache* cache = WebCore::cache(); if (cache) { result->minDeadCapacity = cache->m_minDeadCapacity; result->maxDeadCapacity = cache->m_maxDeadCapacity; @@ -89,9 +89,9 @@ void WebCache::getUsageStats(UsageStats* result) void WebCache::getResourceTypeStats(ResourceTypeStats* result) { - Cache* cache = WebCore::cache(); + MemoryCache* cache = WebCore::cache(); if (cache) { - Cache::Statistics stats = cache->getStatistics(); + MemoryCache::Statistics stats = cache->getStatistics(); ToResourceTypeStat(stats.images, result->images); ToResourceTypeStat(stats.cssStyleSheets, result->cssStyleSheets); ToResourceTypeStat(stats.scripts, result->scripts); diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 9b7b2bd..880adb4 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -177,7 +177,6 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl( , m_client(client) , m_webViewImpl(webViewImpl) , m_apuAgentEnabled(false) - , m_resourceTrackingWasEnabled(false) , m_attached(false) { DebuggerAgentManager::setExposeV8DebuggerProtocol( @@ -264,20 +263,12 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) if (enabled) { if (!ic->hasFrontend()) connectFrontend(true); - m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); + ic->startTimelineProfiler(); - if (!m_resourceTrackingWasEnabled) { - // TODO(knorton): Introduce some kind of agents dependency here so that - // user could turn off resource tracking while apu agent is on. - ic->setResourceTrackingEnabled(true); - } m_debuggerAgentImpl->setAutoContinueOnException(true); - } else { + } else ic->stopTimelineProfiler(); - if (!m_resourceTrackingWasEnabled) - ic->setResourceTrackingEnabled(false); - m_resourceTrackingWasEnabled = false; - } + m_client->runtimePropertyChanged( kApuAgentFeatureName, enabled ? String("true") : String("false")); diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index 47c4ccf..feb4bdd 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -109,7 +109,6 @@ private: WebViewImpl* m_webViewImpl; OwnPtr<DebuggerAgentImpl> m_debuggerAgentImpl; bool m_apuAgentEnabled; - bool m_resourceTrackingWasEnabled; bool m_attached; }; diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index 905bc6d..ea59ab6 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -92,7 +92,6 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl( : m_webViewImpl(webViewImpl) , m_client(client) , m_applicationLocale(applicationLocale) - , m_loaded(false) { InspectorController* ic = m_webViewImpl->page()->inspectorController(); ic->setInspectorFrontendClient(new InspectorFrontendClientImpl(m_webViewImpl->page(), m_client, this)); @@ -113,7 +112,9 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame()); v8::Context::Scope contextScope(frameContext); v8::Handle<v8::Value> dispatchFunction = frameContext->Global()->Get(v8::String::New("WebInspector_syncDispatch")); - ASSERT(dispatchFunction->IsFunction()); + // The frame might have navigated away from the front-end page (which is still weird). + if (!dispatchFunction->IsFunction()) + return; v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(dispatchFunction); Vector< v8::Handle<v8::Value> > args; args.append(ToV8String(message)); diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.h b/WebKit/chromium/src/WebDevToolsFrontendImpl.h index bde906f..866a1cb 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.h +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.h @@ -73,7 +73,6 @@ private: WebKit::WebViewImpl* m_webViewImpl; WebKit::WebDevToolsFrontendClient* m_client; String m_applicationLocale; - bool m_loaded; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index b4d23c0..41b8321 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -486,7 +486,7 @@ WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element) WebString WebFrameImpl::name() const { - return m_frame->tree()->name(); + return m_frame->tree()->uniqueName(); } void WebFrameImpl::setName(const WebString& name) @@ -986,7 +986,7 @@ WebHistoryItem WebFrameImpl::previousHistoryItem() const // only get saved to history when it becomes the previous item. The caller // is expected to query the history item after a navigation occurs, after // the desired history item has become the previous entry. - return WebHistoryItem(viewImpl()->previousHistoryItem()); + return WebHistoryItem(m_frame->loader()->history()->previousItem()); } WebHistoryItem WebFrameImpl::currentHistoryItem() const diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index e805c55..4cb701f 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -40,7 +40,8 @@ #include "WebView.h" #include <wtf/OwnArrayPtr.h> #include <wtf/PassOwnPtr.h> -#include <wtf/text/CString.h> +#include <wtf/text/StringBuilder.h> +#include <wtf/text/WTFString.h> #include <stdio.h> #include <string.h> @@ -48,8 +49,6 @@ namespace WebKit { enum { - IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B, - IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A, MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB, MAX_VARYING_VECTORS = 0x8DFC, MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD @@ -531,20 +530,6 @@ void WebGraphicsContext3DDefaultImpl::synthesizeGLError(unsigned long error) m_syntheticErrors.add(error); } -bool WebGraphicsContext3DDefaultImpl::supportsBGRA() -{ - // Supported since OpenGL 1.2. However, glTexImage2D() must be modified - // to translate the internalFormat from GL_BGRA to GL_RGBA, since the - // former is not accepted by desktop GL. Return false until this is done. - return false; -} - -bool WebGraphicsContext3DDefaultImpl::supportsMapSubCHROMIUM() -{ - // We don't claim support for this extension at this time - return false; -} - void* WebGraphicsContext3DDefaultImpl::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) { return 0; @@ -563,15 +548,11 @@ void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem { } -bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM() -{ - // This extension requires this desktopGL-only function (GLES2 doesn't - // support it), so check for its existence here. - return glGetTexLevelParameteriv; -} - void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2) { + if (!glGetTexLevelParameteriv) + return; + makeContextCurrent(); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_copyTextureToParentTextureFBO); glFramebufferTexture2DEXT(GL_FRAMEBUFFER, @@ -855,16 +836,7 @@ DELEGATE_TO_GL(finish, Finish) DELEGATE_TO_GL(flush, Flush) -void WebGraphicsContext3DDefaultImpl::framebufferRenderbuffer(unsigned long target, unsigned long attachment, - unsigned long renderbuffertarget, WebGLId buffer) -{ - makeContextCurrent(); - if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { - glFramebufferRenderbufferEXT(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, buffer); - glFramebufferRenderbufferEXT(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, buffer); - } else - glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer); -} +DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbufferEXT, unsigned long, unsigned long, unsigned long, WebGLId) DELEGATE_TO_GL_5(framebufferTexture2D, FramebufferTexture2DEXT, unsigned long, unsigned long, unsigned long, WebGLId, long) @@ -979,21 +951,12 @@ void WebGraphicsContext3DDefaultImpl::getFramebufferAttachmentParameteriv(unsign void WebGraphicsContext3DDefaultImpl::getIntegerv(unsigned long pname, int* value) { - // Need to emulate IMPLEMENTATION_COLOR_READ_FORMAT/TYPE for GL. Any valid - // combination should work, but GL_RGB/GL_UNSIGNED_BYTE might be the most - // useful for desktop WebGL users. // Need to emulate MAX_FRAGMENT/VERTEX_UNIFORM_VECTORS and MAX_VARYING_VECTORS // because desktop GL's corresponding queries return the number of components // whereas GLES2 return the number of vectors (each vector has 4 components). // Therefore, the value returned by desktop GL needs to be divided by 4. makeContextCurrent(); switch (pname) { - case IMPLEMENTATION_COLOR_READ_FORMAT: - *value = GL_RGB; - break; - case IMPLEMENTATION_COLOR_READ_TYPE: - *value = GL_UNSIGNED_BYTE; - break; case MAX_FRAGMENT_UNIFORM_VECTORS: glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, value); *value /= 4; @@ -1130,7 +1093,16 @@ WebString WebGraphicsContext3DDefaultImpl::getShaderSource(WebGLId shader) WebString WebGraphicsContext3DDefaultImpl::getString(unsigned long name) { makeContextCurrent(); - return WebString::fromUTF8(reinterpret_cast<const char*>(glGetString(name))); + StringBuilder result; + result.append(reinterpret_cast<const char*>(glGetString(name))); + if (name == GL_EXTENSIONS) { + // GL_CHROMIUM_copy_texture_to_parent_texture requires this + // desktopGL-only function (GLES2 doesn't support it), so + // check for its existence here. + if (glGetTexLevelParameteriv) + result.append(" GL_CHROMIUM_copy_texture_to_parent_texture"); + } + return WebString(result.toString()); } DELEGATE_TO_GL_3(getTexParameterfv, GetTexParameterfv, unsigned long, unsigned long, float*) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index 5eebf12..c1de77c 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -81,13 +81,10 @@ public: virtual void prepareTexture(); virtual void synthesizeGLError(unsigned long error); - virtual bool supportsBGRA(); - virtual bool supportsMapSubCHROMIUM(); virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access); virtual void unmapBufferSubDataCHROMIUM(const void*); virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access); virtual void unmapTexSubImage2DCHROMIUM(const void*); - virtual bool supportsCopyTextureToParentTextureCHROMIUM(); virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture); virtual void activeTexture(unsigned long texture); diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/WebKit/chromium/src/WebIDBTransactionImpl.cpp index f5d8748..4307cb5 100644 --- a/WebKit/chromium/src/WebIDBTransactionImpl.cpp +++ b/WebKit/chromium/src/WebIDBTransactionImpl.cpp @@ -69,11 +69,6 @@ void WebIDBTransactionImpl::didCompleteTaskEvents() m_backend->didCompleteTaskEvents(); } -int WebIDBTransactionImpl::id() const -{ - return m_backend->id(); -} - void WebIDBTransactionImpl::setCallbacks(WebIDBTransactionCallbacks* callbacks) { RefPtr<IDBTransactionCallbacks> idbCallbacks = IDBTransactionCallbacksProxy::create(callbacks); diff --git a/WebKit/chromium/src/WebIDBTransactionImpl.h b/WebKit/chromium/src/WebIDBTransactionImpl.h index 24bab91..b26b3ac 100644 --- a/WebKit/chromium/src/WebIDBTransactionImpl.h +++ b/WebKit/chromium/src/WebIDBTransactionImpl.h @@ -45,7 +45,6 @@ public: virtual WebIDBObjectStore* objectStore(const WebString& name); virtual void abort(); virtual void didCompleteTaskEvents(); - virtual int id() const; virtual void setCallbacks(WebIDBTransactionCallbacks*); virtual WebCore::IDBTransactionBackendInterface* getIDBTransactionBackendInterface() const; diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp index 7779dbc..d032ef8 100644 --- a/WebKit/chromium/src/WebInputElement.cpp +++ b/WebKit/chromium/src/WebInputElement.cpp @@ -95,9 +95,9 @@ int WebInputElement::size() const return constUnwrap<HTMLInputElement>()->size(); } -void WebInputElement::setValue(const WebString& value) +void WebInputElement::setValue(const WebString& value, bool sendChangeEvent) { - unwrap<HTMLInputElement>()->setValue(value); + unwrap<HTMLInputElement>()->setValue(value, sendChangeEvent); } WebString WebInputElement::value() const @@ -145,14 +145,14 @@ void WebInputElement::setSelectionRange(int start, int end) unwrap<HTMLInputElement>()->setSelectionRange(start, end); } -int WebInputElement::selectionStart() +int WebInputElement::selectionStart() const { - return unwrap<HTMLInputElement>()->selectionStart(); + return constUnwrap<HTMLInputElement>()->selectionStart(); } -int WebInputElement::selectionEnd() +int WebInputElement::selectionEnd() const { - return unwrap<HTMLInputElement>()->selectionEnd(); + return constUnwrap<HTMLInputElement>()->selectionEnd(); } bool WebInputElement::isValidValue(const WebString& value) const diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp index 58deecc..43d9757 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -33,6 +33,7 @@ #include "Chrome.h" #include "ChromeClientImpl.h" +#include "PluginLayerChromium.h" #include "WebClipboard.h" #include "WebCursorInfo.h" #include "WebDataSourceImpl.h" @@ -275,6 +276,25 @@ void WebPluginContainerImpl::invalidateRect(const WebRect& rect) invalidateRect(static_cast<IntRect>(rect)); } +void WebPluginContainerImpl::scrollRect(int dx, int dy, const WebRect& rect) +{ + Widget* parentWidget = parent(); + if (parentWidget->isFrameView()) { + FrameView* parentFrameView = static_cast<FrameView*>(parentWidget); + if (!parentFrameView->isOverlapped()) { + IntRect damageRect = convertToContainingWindow(static_cast<IntRect>(rect)); + IntSize scrollDelta(dx, dy); + // scroll() only uses the second rectangle, clipRect, and ignores the first + // rectangle. + parent()->hostWindow()->scroll(scrollDelta, damageRect, damageRect); + return; + } + } + + // Use slow scrolling instead. + invalidateRect(rect); +} + void WebPluginContainerImpl::reportGeometry() { if (!parent()) @@ -287,6 +307,14 @@ void WebPluginContainerImpl::reportGeometry() m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); } +void WebPluginContainerImpl::commitBackingTexture() +{ +#if USE(ACCELERATED_COMPOSITING) + if (platformLayer()) + platformLayer()->setNeedsDisplay(); +#endif +} + void WebPluginContainerImpl::clearScriptObjects() { Frame* frame = m_element->document()->frame(); @@ -393,8 +421,33 @@ void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver m_pluginLoadObservers.remove(pos); } +#if USE(ACCELERATED_COMPOSITING) +WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const +{ + // FIXME: In the event of a context lost, the texture needs to be recreated on the compositor's + // context and rebound to the platform layer here. + unsigned backingTextureId = m_webPlugin->getBackingTextureId(); + if (!backingTextureId) + return 0; + + m_platformLayer->setTextureId(backingTextureId); + + return m_platformLayer.get(); +} +#endif + // Private methods ------------------------------------------------------------- +WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin) + : WebCore::PluginViewBase(0) + , m_element(element) + , m_webPlugin(webPlugin) +#if USE(ACCELERATED_COMPOSITING) + , m_platformLayer(PluginLayerChromium::create(0)) +#endif +{ +} + WebPluginContainerImpl::~WebPluginContainerImpl() { for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) diff --git a/WebKit/chromium/src/WebPluginContainerImpl.h b/WebKit/chromium/src/WebPluginContainerImpl.h index 27f5f2e..ebe6983 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/WebKit/chromium/src/WebPluginContainerImpl.h @@ -31,9 +31,10 @@ #ifndef WebPluginContainerImpl_h #define WebPluginContainerImpl_h +#include "PluginViewBase.h" #include "WebPluginContainer.h" - #include "Widget.h" + #include <wtf/PassRefPtr.h> #include <wtf/Vector.h> @@ -43,7 +44,9 @@ namespace WebCore { class HTMLPlugInElement; class IntRect; class KeyboardEvent; +class LayerChromium; class MouseEvent; +class PluginLayerChromium; class ResourceError; class ResourceResponse; class WheelEvent; @@ -54,7 +57,7 @@ namespace WebKit { class WebPlugin; class WebPluginLoadObserver; -class WebPluginContainerImpl : public WebCore::Widget, public WebPluginContainer { +class WebPluginContainerImpl : public WebCore::PluginViewBase, public WebPluginContainer { public: static PassRefPtr<WebPluginContainerImpl> create(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin) { @@ -79,12 +82,14 @@ public: virtual WebElement element(); virtual void invalidate(); virtual void invalidateRect(const WebRect&); + virtual void scrollRect(int dx, int dy, const WebRect&); virtual void reportGeometry(); + virtual void commitBackingTexture(); virtual void clearScriptObjects(); virtual NPObject* scriptableObjectForElement(); virtual WebString executeScriptURL(const WebURL&, bool popupsAllowed); virtual void loadFrameRequest(const WebURLRequest&, const WebString& target, bool notifyNeeded, void* notifyData); - virtual void zoomLevelChanged(double zoomLevel); + virtual void zoomLevelChanged(double zoomLevel); // This cannot be null. WebPlugin* plugin() { return m_webPlugin; } @@ -117,10 +122,12 @@ public: void willDestroyPluginLoadObserver(WebPluginLoadObserver*); +#if USE(ACCELERATED_COMPOSITING) + virtual WebCore::LayerChromium* platformLayer() const; +#endif + private: - WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin) - : m_element(element) - , m_webPlugin(webPlugin) { } + WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin); ~WebPluginContainerImpl(); void handleMouseEvent(WebCore::MouseEvent*); @@ -138,6 +145,10 @@ private: WebCore::HTMLPlugInElement* m_element; WebPlugin* m_webPlugin; Vector<WebPluginLoadObserver*> m_pluginLoadObservers; + +#if USE(ACCELERATED_COMPOSITING) + RefPtr<WebCore::PluginLayerChromium> m_platformLayer; +#endif }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 3b56338..ce8eba6 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -55,11 +55,6 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl() m_webcoreMock->setListener(0); } -void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result) -{ - m_webcoreMock->setRecognitionResult(result, WebString::fromUTF8("")); -} - void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language) { m_webcoreMock->setRecognitionResult(result, language); diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index c98f92a..7b50a8b 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -64,10 +64,6 @@ public: // WebSpeechInputControllerMock methods. void setMockRecognitionResult(const WebString& result, const WebString& language); - // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched. - // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch. - void setMockRecognitionResult(const WebString& result); - private: OwnPtr<WebCore::SpeechInputClientMock> m_webcoreMock; WebSpeechInputListener* m_listener; diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 57d0ca4..490c620 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -52,6 +52,7 @@ #include "DragData.h" #include "Editor.h" #include "EventHandler.h" +#include "Extensions3D.h" #include "FocusController.h" #include "FontDescription.h" #include "FrameLoader.h" @@ -1050,7 +1051,7 @@ void WebViewImpl::composite(bool finish) m_layerRenderer->present(); GraphicsContext3D* context = m_layerRenderer->context(); - if (context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) + if (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) reallocateRenderer(); #endif } diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 4c23057..8b3aea0 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -46,6 +46,7 @@ var context = {}; // Used by WebCore's inspector routines. Preferences.canEditScriptSource = true; Preferences.onlineDetectionEnabled = false; Preferences.nativeInstrumentationEnabled = true; + Preferences.fileSystemEnabled = false; })(); var devtools = devtools || {}; diff --git a/WebKit/chromium/src/js/devTools.css b/WebKit/chromium/src/js/devTools.css index 9495fb8..64ea9d5 100644 --- a/WebKit/chromium/src/js/devTools.css +++ b/WebKit/chromium/src/js/devTools.css @@ -37,11 +37,6 @@ body.platform-linux #scripts-files { line-height: 12px; } -.section > .header { - border: 1px solid rgb(92, 116, 157); - background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(105, 133, 180)), to(rgb(92, 116, 157))); -} - .console-group-messages .section > .header { padding: 0 8px 0 0; background-image: none; diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog index bf9af1e..b436e58 100644 --- a/WebKit/efl/ChangeLog +++ b/WebKit/efl/ChangeLog @@ -1,3 +1,105 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::focusedFrameChanged): + * WebCoreSupport/ChromeClientEfl.h: + +2010-11-05 Patrick Gansterer <paroga@webkit.org> + + Reviewed by David Kilzer. + + Replace ARRAYSIZE with WTF_ARRAY_LENGTH + https://bugs.webkit.org/show_bug.cgi?id=48903 + + * WebCoreSupport/EditorClientEfl.cpp: + (WebCore::EditorClientEfl::interpretKeyEvent): + +2010-11-04 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Adam Barth. + + [EFL] Reflect latest EFL changes related to stride. + https://bugs.webkit.org/show_bug.cgi?id=48971 + + Remove adjustment code to compare stride of cairo_image_surfece and evas_object_image, as following changes of latest EFL. + + * ewk/ewk_util.cpp: + (ewk_util_image_from_cairo_surface_add): + +2010-11-03 Daniel Bates <dbates@rim.com> + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the EFL port. + + * ewk/ewk_frame.cpp: + (ewk_frame_name_get): + +2010-11-02 Daniel Bates <dbates@rim.com> + + Reviewed by Martin Robinson. + + Set frame name before appending it to the frame tree in the Apple Windows, + GTK, and EFL ports + https://bugs.webkit.org/show_bug.cgi?id=48806 + + Make the frame creation process in the EFL-port consistent with the + Mac, Qt, and Haiku ports. In particular, set the name of the new + frame before it's appended to the frame tree. + + At this time we cannot test this change since it is being masked by + HTMLFrameElementBase::setName() <http://trac.webkit.org/browser/trunk/WebCore/html/HTMLFrameElementBase.cpp?rev=70976#L160>. + We'll be able to test this once we fix bug #6751. + + * ewk/ewk_frame.cpp: + (ewk_frame_child_add): + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientEfl.h: + (WebCore::ChromeClientEfl::showContextMenu): + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * ewk/ewk_frame.cpp: + (ewk_frame_name_get): + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified EFL-port to use FrameTree::uniqueName(). + + * ewk/ewk_frame.cpp: + (ewk_frame_name_get): + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index d99f0bc..1aac4ff 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -91,6 +91,10 @@ void ChromeClientEfl::focusedNodeChanged(Node*) notImplemented(); } +void ChromeClientEfl::focusedFrameChanged(Frame*) +{ +} + FloatRect ChromeClientEfl::windowRect() { Ecore_Evas* ee = 0; diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h index f0aeb8d..c6c82d4 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h @@ -53,6 +53,7 @@ public: virtual void takeFocus(FocusDirection); virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); virtual void show(); @@ -115,6 +116,10 @@ public: virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); virtual void formStateDidChange(const Node*); diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp index a63b712..9184812 100644 --- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp @@ -292,8 +292,6 @@ static const KeyPressEntry keyPressEntries[] = { { '\r', AltKey | ShiftKey, "InsertNewline" }, }; -#define ARRAYSIZE(array) (sizeof(array) / sizeof((array)[0])) - const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event) { ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent); @@ -305,10 +303,10 @@ const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event) keyDownCommandsMap = new HashMap<int, const char*>; keyPressCommandsMap = new HashMap<int, const char*>; - for (unsigned i = 0; i < ARRAYSIZE(keyDownEntries); i++) + for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); - for (unsigned i = 0; i < ARRAYSIZE(keyPressEntries); i++) + for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); } diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index 1395fa5..5076be5 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -474,7 +474,7 @@ const char* ewk_frame_name_get(const Evas_Object* o) return 0; } - WTF::String s = sd->frame->tree()->name(); + WTF::String s = sd->frame->tree()->uniqueName(); WTF::CString cs = s.utf8(); sd->name = eina_stringshare_add_length(cs.data(), cs.length()); return sd->name; @@ -1623,11 +1623,11 @@ Evas_Object* ewk_frame_child_add(Evas_Object* o, WTF::PassRefPtr<WebCore::Frame> } cf = child.get(); - sd->frame->tree()->appendChild(child); if (cf->tree()) cf->tree()->setName(name); else ERR("no tree for child object"); + sd->frame->tree()->appendChild(child); if (!ewk_frame_init(frame, sd->view, cf)) { evas_object_del(frame); diff --git a/WebKit/efl/ewk/ewk_util.cpp b/WebKit/efl/ewk/ewk_util.cpp index bf82695..6830f76 100644 --- a/WebKit/efl/ewk/ewk_util.cpp +++ b/WebKit/efl/ewk/ewk_util.cpp @@ -81,9 +81,9 @@ Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t evas_object_image_size_set(image, w, h); evas_object_image_alpha_set(image, format == CAIRO_FORMAT_ARGB32); - if (evas_object_image_stride_get(image) * 4 != stride) { + if (evas_object_image_stride_get(image) != stride) { ERR("evas' stride %d diverges from cairo's %d.", - evas_object_image_stride_get(image) * 4, stride); + evas_object_image_stride_get(image), stride); evas_object_del(image); return 0; } diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index cd11751..3a7e381 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,341 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::focusedFrameChanged): + * WebCoreSupport/ChromeClientGtk.h: + +2010-11-08 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Andreas Kling. + + [GTK] Error page templates are not filled properly + https://bugs.webkit.org/show_bug.cgi?id=49148 + + Replace a call to makeString with String::format. This was mistakenly + changed to makeString in an earlier commit. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::dispatchDidFailLoad): + +2010-11-08 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + * NEWS: update for release. + +2010-11-08 Csaba Osztrogonac <ossy@webkit.org> + + Unreviewed, rolling out r71466. + http://trac.webkit.org/changeset/71466 + https://bugs.webkit.org/show_bug.cgi?id=48865 + + It broke layout tests on GTK bots. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::closeWindowSoon): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_init): + (webkit_web_view_set_group_name): + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * webkit/webkitwebview.cpp: + +2010-11-05 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> + + Reviewed by Martin Robinson. + + [GTK] Link with target name set does not work correctly + https://bugs.webkit.org/show_bug.cgi?id=48865 + + When a new page is created with a name (target=myFrame), the new + mainFrame could not be found because they where not stored in the + same PageGroup. As PageGroup are not exposed externally so the + simpliest solution is to use a global page group name. This also fixes + issue with visited link coloration across pages. After this change the + private function webkit_web_view_set_group_name() was no longer used + so it was removed completly. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::closeWindowSoon): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_init): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_suspend_animations): + (webkit_web_frame_resume_animations): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Unreviewed. + + Small fix to GTK build + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_suspend_animations): + (webkit_web_frame_resume_animations): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state + https://bugs.webkit.org/show_bug.cgi?id=46945 + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_suspend_animations): + (webkit_web_frame_resume_animations): + +2010-11-03 Daniel Bates <dbates@rim.com> + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the GTK port. + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_get_name): + +2010-11-02 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Adam Barth. + + [Cairo] Remove PlatformRefPtrCairo + https://bugs.webkit.org/show_bug.cgi?id=48192 + + Replace instances of PlatformRefPtr smart pointers that wrap Cairo + types with RefPtrs. + + * WebCoreSupport/DragClientGtk.cpp: Use RefPtr instead of PlatformRefPtr. + (WebKit::dragIconWindowDrawEventCallback): + * WebCoreSupport/DragClientGtk.h: Ditto. + +2010-11-02 Daniel Bates <dbates@rim.com> + + Reviewed by Martin Robinson. + + Set frame name before appending it to the frame tree in the Apple Windows, + GTK, and EFL ports + https://bugs.webkit.org/show_bug.cgi?id=48806 + + Make the frame creation process in the GTK-port consistent with the + Mac, Qt, and Haiku ports. In particular, set the name of the new + frame before it's appended to the frame tree. + + At this time we cannot test this change since it is being masked by + HTMLFrameElementBase::setName() <http://trac.webkit.org/browser/trunk/WebCore/html/HTMLFrameElementBase.cpp?rev=70976#L160>. + We'll be able to test this once we fix bug #6751. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::createFrame): + +2010-11-01 Jennifer Braithwaite <jennb@google.com> + + Reviewed by Martin Robinson. + + GTK: Update resource tracking when moving a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=48362 + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::transferLoadingResourceFromPage): + Assign resource id to current web view and remove from former web view. + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_remove_resource): + Added. + +2010-11-01 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Cleanup needed in testatk.c file + https://bugs.webkit.org/show_bug.cgi?id=48759 + + Cleanup done in testatk.c, mainly addressing the following issues: + + - Removed any trace of extra main loops in tests, so now we just + spin the original main loop in all of them to get the a11y + objects. + + - As we no longer use the extra main loops, removed the bail_out + function, used along with g_idle_add() to stop those extra loops. + + - As we now spin the loop in every test, created a new function + waitForAccessibilityObjects() to write the loop just once. + + - Fixed name in incorrectly named test testWekitAtkTextSelections. + + - Alphabetically sorted the list of includes. + + - Renamed all identifiers to camel Case notation. + + - Declare variables when needed only (instead of declaring all of + them at the beginning of the function). + + - Don't declare two variables of the same type in the same line. + + - No more short names like 'obj', 'textObj' or 'alloc'. Use names + like 'object', 'textObject' and 'allocation' instead. + + - Fixed indentation. + + - Make sure all comments finish with '.' + + - Replace NULL's with 0's. + + * tests/testatk.c: + (waitForAccessibleObjects): New, manually spins the main context + to make sure accessible objects are created before continuing. + (testGetTextFunction): Fixed this function to be compliant with + the WebKit's coding style. + (runGetTextTests): Ditto. + (testWebkitAtkGetTextAtOffsetForms): Ditto. + (testWebkitAtkGetTextAtOffset): Ditto. + (testWebkitAtkGetTextAtOffsetNewlines): Ditto. + (testWebkitAtkGetTextAtOffsetTextarea): Ditto. + (testWebkitAtkGetTextAtOffsetTextInput): Ditto. + (testWebkitAtkGetTextInParagraphAndBodySimple): Ditto. + (testWebkitAtkGetTextInParagraphAndBodyModerate): Ditto. + (testWebkitAtkGetTextInTable): Ditto. + (testWebkitAtkGetHeadersInTable): Ditto. + (compAtkAttribute): Ditto. + (atkAttributeSetAttributeNameHasValue): Ditto. + (testWebkitAtkTextAttributes): Ditto. + (testWebkitAtkTextSelections): Ditto. + (testWebkitAtkGetExtents): Ditto. + (testWebkitAtkLayoutAndDataTables): Ditto. + (testWebkitAtkLinksWithInlineImages): Ditto. + (testWebkitAtkHypertextAndHyperlinks): Ditto. + (testWebkitAtkListsOfItems): Ditto. + (testWebkitAtkTextChangedNotifications): Ditto. + (main): Ditto. + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientGtk.h: + (WebKit::ChromeClient::showContextMenu): + +2010-11-01 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Pasting markup into Thunderbird compose window produces no text + https://bugs.webkit.org/show_bug.cgi?id=43737 + + Added a test verifying that the meta tag prefix on markup data exists. + + * tests/testcopyandpaste.c: + (load_status_cb): Add a check for the meta tag prefix. + +2010-11-01 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Martin Robinson. + + [Gtk] AtkHyperlink needs to be implemented + https://bugs.webkit.org/show_bug.cgi?id=33785 + + New test to ensure the AtkHypertext/AtkHyperlink stuff works. + + * tests/testatk.c: + (testWebkitAtkHypertextAndHyperlinks): New test, checking both the + implementation of the AtkHypertext interface, the subclass of the + AtkHyperlink abstract class, and the implementation of the + AtkAction interface in that subclass. + (main): Added the new unit test. + +2010-10-30 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Use new width for height APIs in GTK+ 3.x + https://bugs.webkit.org/show_bug.cgi?id=48709 + + Use the new width for height APIs in GTK+ 3.x, since size-request + is deprecated. + + For now we just return the same value for preferred and minimum + width/height, which should match the 2.x behavior. Probably we + could do something smarter for the minimum values. + + * webkit/webkitwebview.cpp: + (webkit_web_view_get_preferred_width): return our preferred width. + (webkit_web_view_get_preferred_height): return our preferred height. + (webkit_web_view_class_init): hook the new default handlers. + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_get_name): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Added the corresponding GTK+ setting to WebCore's EditingUnixBehavior: WEBKIT_EDITING_BEHAVIOR_UNIX. + + * webkit/webkitwebsettings.cpp: + (webkit_web_settings_class_init): + * webkit/webkitwebsettings.h: + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified GTK-port to use FrameTree::uniqueName(). + + * webkit/webkitwebframe.cpp: + (webkit_web_frame_get_name): + +2010-10-29 Martin Robinson <mrobinson@igalia.com> + + Build fix for GTK+ after BackForwardListImpl introduction. + + * webkit/webkitwebbackforwardlist.cpp: + (webkit_web_back_forward_list_new_with_web_view): + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS index ed4cd81..ead8923 100644 --- a/WebKit/gtk/NEWS +++ b/WebKit/gtk/NEWS @@ -1,4 +1,13 @@ ================ +WebKitGTK+ 1.3.6 +================ + +What's new in WebKitGTK+ 1.3.6? + + - Update to compile with GTK+ 3.x 2.91.4. + - Many, many other bugfixes. + +================ WebKitGTK+ 1.3.5 ================ diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index e864ea7..d4ab7ab 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -275,6 +275,10 @@ void ChromeClient::focusedNodeChanged(Node*) { } +void ChromeClient::focusedFrameChanged(Frame*) +{ +} + bool ChromeClient::canRunBeforeUnloadConfirmPanel() { return true; diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h index b925313..8252f06 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h @@ -55,6 +55,7 @@ namespace WebKit { virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); + virtual void focusedFrameChanged(WebCore::Frame*); virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); virtual void show(); @@ -117,6 +118,9 @@ namespace WebKit { virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp index b850cec..be0fb10 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp @@ -44,7 +44,7 @@ namespace WebKit { #ifdef GTK_API_VERSION_2 static gboolean dragIconWindowDrawEventCallback(GtkWidget* widget, GdkEventExpose* event, DragClient* client) { - PlatformRefPtr<cairo_t> context = adoptPlatformRef(gdk_cairo_create(event->window)); + RefPtr<cairo_t> context = adoptRef(gdk_cairo_create(event->window)); client->drawDragIconWindow(widget, context.get()); return TRUE; } diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.h b/WebKit/gtk/WebCoreSupport/DragClientGtk.h index 0d07c88..086ec69 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.h @@ -32,7 +32,7 @@ #include "DragClient.h" #include "GRefPtr.h" -#include "PlatformRefPtrCairo.h" +#include "RefPtrCairo.h" typedef struct _WebKitWebView WebKitWebView; @@ -60,7 +60,7 @@ namespace WebKit { WebKitWebView* m_webView; WebCore::IntPoint m_startPos; PlatformRefPtr<GtkWidget> m_dragIconWindow; - PlatformRefPtr<cairo_surface_t> m_dragImage; + RefPtr<cairo_surface_t> m_dragImage; }; } diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 20aafc2..b23bd70 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -584,8 +584,8 @@ PassRefPtr<Frame> FrameLoaderClient::createFrame(const KURL& url, const String& RefPtr<Frame> childFrame = Frame::create(page, ownerElement, new FrameLoaderClient(kitFrame)); framePrivate->coreFrame = childFrame.get(); - parentFrame->tree()->appendChild(childFrame); childFrame->tree()->setName(name); + parentFrame->tree()->appendChild(childFrame); childFrame->init(); // The creation of the frame may have run arbitrary JavaScript that removed it from the page already. @@ -620,8 +620,16 @@ void FrameLoaderClient::didTransferChildFrameToNewDocument(WebCore::Page*) ASSERT(core(getViewFromFrame(m_frame)) == coreFrame->page()); } -void FrameLoaderClient::transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*) +void FrameLoaderClient::transferLoadingResourceFromPage(unsigned long identifier, WebCore::DocumentLoader* docLoader, const WebCore::ResourceRequest& request, WebCore::Page* oldPage) { + ASSERT(oldPage != core(m_frame)->page()); + + GOwnPtr<gchar> identifierString(toString(identifier)); + ASSERT(!webkit_web_view_get_resource(getViewFromFrame(m_frame), identifierString.get())); + + assignIdentifierToInitialRequest(identifier, docLoader, request); + + webkit_web_view_remove_resource(kit(oldPage), identifierString.get()); } void FrameLoaderClient::redirectDataToPlugin(Widget* pluginWidget) @@ -1131,7 +1139,7 @@ void FrameLoaderClient::dispatchDidFailLoad(const ResourceError& error) if (!loaded) content = makeString("<html><body>", webError->message, "</body></html>"); else - content = makeString(fileContent, error.failingURL(), webError->message); + content = String::format(fileContent, error.failingURL().utf8().data(), webError->message); } webkit_web_frame_load_alternate_string(m_frame, content.utf8().data(), 0, error.failingURL().utf8().data()); diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c index bd6473a..509cb86 100644 --- a/WebKit/gtk/tests/testatk.c +++ b/WebKit/gtk/tests/testatk.c @@ -18,10 +18,10 @@ */ #include <errno.h> -#include <unistd.h> #include <glib.h> #include <glib/gstdio.h> #include <gtk/gtk.h> +#include <unistd.h> #include <webkit/webkit.h> #if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) @@ -46,6 +46,8 @@ static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo< static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; +static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p></body></html>"; + static const char* layoutAndDataTables = "<html><body><table><tr><th>Odd</th><th>Even</th></tr><tr><td>1</td><td>2</td></tr></table><table><tr><td>foo</td><td>bar</td></tr></table></body></html>"; static const char* linksWithInlineImages = "<html><head><style>a.http:before {content: url(no-image.png);}</style><body><p><a class='http' href='foo'>foo</a> bar baz</p><p>foo <a class='http' href='bar'>bar</a> baz</p><p>foo bar <a class='http' href='baz'>baz</a></p></body></html>"; @@ -56,474 +58,411 @@ static const char* textForSelections = "<html><body><p>A paragraph with plain te static const char* textWithAttributes = "<html><head><style>.st1 {font-family: monospace; color:rgb(120,121,122);} .st2 {text-decoration:underline; background-color:rgb(80,81,82);}</style></head><body><p style=\"font-size:14; text-align:right;\">This is the <i>first</i><b> sentence of this text.</b></p><p class=\"st1\">This sentence should have an style applied <span class=\"st2\">and this part should have another one</span>.</p><p>x<sub>1</sub><sup>2</sup>=x<sub>2</sub><sup>3</sup></p><p style=\"text-align:center;\">This sentence is the <strike>last</strike> one.</p></body></html>"; -static gboolean bail_out(GMainLoop* loop) +static void waitForAccessibleObjects() { - if (g_main_loop_is_running(loop)) - g_main_loop_quit(loop); - - return FALSE; + /* Manually spin the main context to make sure the accessible + objects are properly created before continuing. */ + while (g_main_context_pending(0)) + g_main_context_iteration(0, TRUE); } typedef gchar* (*AtkGetTextFunction) (AtkText*, gint, AtkTextBoundary, gint*, gint*); -static void test_get_text_function(AtkText* text_obj, AtkGetTextFunction fn, AtkTextBoundary boundary, gint offset, const char* text_result, gint start_offset_result, gint end_offset_result) +static void testGetTextFunction(AtkText* textObject, AtkGetTextFunction fn, AtkTextBoundary boundary, gint offset, const char* textResult, gint startOffsetResult, gint endOffsetResult) { - gint start_offset, end_offset; - char* text; - - text = fn(text_obj, offset, boundary, &start_offset, &end_offset); - g_assert_cmpstr(text, ==, text_result); - g_assert_cmpint(start_offset, ==, start_offset_result); - g_assert_cmpint(end_offset, ==, end_offset_result); + gint startOffset; + gint endOffset; + char* text = fn(textObject, offset, boundary, &startOffset, &endOffset); + g_assert_cmpstr(text, ==, textResult); + g_assert_cmpint(startOffset, ==, startOffsetResult); + g_assert_cmpint(endOffset, ==, endOffsetResult); g_free(text); } -static void run_get_text_tests(AtkText* text_obj) +static void runGetTextTests(AtkText* textObject) { - char* text = atk_text_get_text(text_obj, 0, -1); + char* text = atk_text_get_text(textObject, 0, -1); g_assert_cmpstr(text, ==, "This is a test. This is the second sentence. And this the third."); g_free(text); /* ATK_TEXT_BOUNDARY_CHAR */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "T", 0, 1); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "T", 0, 1); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "h", 1, 2); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "h", 1, 2); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, - 0, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, + 0, "", 0, 0); + + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, + 1, "T", 0, 1); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_CHAR, - 1, "T", 0, 1); - /* ATK_TEXT_BOUNDARY_WORD_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 0, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 0, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 4, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 4, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 10, "test. ", 10, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 10, "test. ", 10, 16); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, - 58, "third.", 58, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_START, + 58, "third.", 58, 64); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, - 5, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, + 5, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, - 7, "This ", 0, 5); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_START, + 7, "This ", 0, 5); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 0, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 0, "is ", 5, 8); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 4, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 4, "is ", 5, 8); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, - 3, "is ", 5, 8); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_START, + 3, "is ", 5, 8); /* ATK_TEXT_BOUNDARY_WORD_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 0, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 0, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 9, " test", 9, 14); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 9, " test", 9, 14); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, "This", 0, 4); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, "This", 0, 4); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, - 7, " is", 4, 7); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_WORD_END, + 7, " is", 4, 7); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, - 5, " a", 7, 9); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, + 5, " a", 7, 9); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, - 4, " a", 7, 9); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_WORD_END, + 4, " a", 7, 9); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, - 58, " third", 57, 63); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_WORD_END, + 58, " third", 57, 63); /* ATK_TEXT_BOUNDARY_SENTENCE_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 0, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 0, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 0, "This is the second sentence. ", 16, 45); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 0, "This is the second sentence. ", 16, 45); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "This is the second sentence. ", 16, 45); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "This is the second sentence. ", 16, 45); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 16, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 16, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 44, "This is a test. ", 0, 16); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 44, "This is a test. ", 0, 16); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, - 15, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_START, + 15, "", 0, 0); /* ATK_TEXT_BOUNDARY_SENTENCE_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 0, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 0, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 16, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 16, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 17, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 17, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 0, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 0, " This is the second sentence.", 15, 44); - test_get_text_function(text_obj, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, " And this the third.", 44, 64); + testGetTextFunction(textObject, atk_text_get_text_after_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, " And this the third.", 44, 64); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 16, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 16, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 15, "This is a test.", 0, 15); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 15, "This is a test.", 0, 15); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 14, "", 0, 0); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 14, "", 0, 0); - test_get_text_function(text_obj, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, - 44, " This is the second sentence.", 15, 44); + testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END, + 44, " This is the second sentence.", 15, 44); /* It's trick to test these properly right now, since our a11y - implementation splits different lines in different a11y - items */ + implementation splits different lines in different a11y items. */ /* ATK_TEXT_BOUNDARY_LINE_START */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, - 0, "This is a test. This is the second sentence. And this the third.", 0, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, + 0, "This is a test. This is the second sentence. And this the third.", 0, 64); /* ATK_TEXT_BOUNDARY_LINE_END */ - test_get_text_function(text_obj, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, - 0, "This is a test. This is the second sentence. And this the third.", 0, 64); + testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, + 0, "This is a test. This is the second sentence. And this the third.", 0, 64); } -static void test_webkit_atk_get_text_at_offset_forms(void) +static void testWebkitAtkGetTextAtOffsetForms() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contents, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset(void) +static void testWebkitAtkGetTextAtOffset() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contents, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_newlines(void) +static void testWebkitAtkGetTextAtOffsetNewlines() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsWithNewlines, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsWithNewlines, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_textarea(void) +static void testWebkitAtkGetTextAtOffsetTextarea() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTextarea, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTextarea, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void test_webkit_atk_get_text_at_offset_text_input(void) +static void testWebkitAtkGetTextAtOffsetTextInput() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - AtkText* text_obj; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTextInput, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTextInput, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - text_obj = ATK_TEXT(obj); - g_assert(ATK_IS_TEXT(text_obj)); + AtkText* textObject = ATK_TEXT(object); + g_assert(ATK_IS_TEXT(textObject)); - run_get_text_tests(text_obj); + runGetTextTests(textObject); g_object_unref(webView); } -static void testWebkitAtkGetTextInParagraphAndBodySimple(void) +static void testWebkitAtkGetTextInParagraphAndBodySimple() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* obj1; - AtkObject* obj2; - GMainLoop* loop; - AtkText* textObj1; - AtkText* textObj2; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInParagraphAndBodySimple, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj1 = atk_object_ref_accessible_child(obj, 0); - g_assert(obj1); - obj2 = atk_object_ref_accessible_child(obj, 1); - g_assert(obj2); - - textObj1 = ATK_TEXT(obj1); - g_assert(ATK_IS_TEXT(textObj1)); - textObj2 = ATK_TEXT(obj2); - g_assert(ATK_IS_TEXT(textObj2)); - - char *text = atk_text_get_text(textObj1, 0, -1); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInParagraphAndBodySimple, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + AtkObject* object1 = atk_object_ref_accessible_child(object, 0); + g_assert(object1); + AtkObject* object2 = atk_object_ref_accessible_child(object, 1); + g_assert(object2); + + AtkText* textObject1 = ATK_TEXT(object1); + g_assert(ATK_IS_TEXT(textObject1)); + AtkText* textObject2 = ATK_TEXT(object2); + g_assert(ATK_IS_TEXT(textObject2)); + + char *text = atk_text_get_text(textObject1, 0, -1); g_assert_cmpstr(text, ==, "This is a test."); - text = atk_text_get_text(textObj2, 0, 12); + text = atk_text_get_text(textObject2, 0, 12); g_assert_cmpstr(text, ==, "Hello world."); - g_object_unref(obj1); - g_object_unref(obj2); + g_object_unref(object1); + g_object_unref(object2); g_object_unref(webView); } -static void testWebkitAtkGetTextInParagraphAndBodyModerate(void) +static void testWebkitAtkGetTextInParagraphAndBodyModerate() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* obj1; - AtkObject* obj2; - GMainLoop* loop; - AtkText* textObj1; - AtkText* textObj2; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInParagraphAndBodyModerate, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - /* Get to the inner AtkText object */ - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj1 = atk_object_ref_accessible_child(obj, 0); - g_assert(obj1); - obj2 = atk_object_ref_accessible_child(obj, 1); - g_assert(obj2); - - textObj1 = ATK_TEXT(obj1); - g_assert(ATK_IS_TEXT(textObj1)); - textObj2 = ATK_TEXT(obj2); - g_assert(ATK_IS_TEXT(textObj2)); - - char *text = atk_text_get_text(textObj1, 0, -1); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInParagraphAndBodyModerate, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + /* Get to the inner AtkText object. */ + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + AtkObject* object1 = atk_object_ref_accessible_child(object, 0); + g_assert(object1); + AtkObject* object2 = atk_object_ref_accessible_child(object, 1); + g_assert(object2); + + AtkText* textObject1 = ATK_TEXT(object1); + g_assert(ATK_IS_TEXT(textObject1)); + AtkText* textObject2 = ATK_TEXT(object2); + g_assert(ATK_IS_TEXT(textObject2)); + + char *text = atk_text_get_text(textObject1, 0, -1); g_assert_cmpstr(text, ==, "This is a test."); - text = atk_text_get_text(textObj2, 0, 53); + text = atk_text_get_text(textObject2, 0, 53); g_assert_cmpstr(text, ==, "Hello world.\nThis sentence is green.\nThis one is not."); - g_object_unref(obj1); - g_object_unref(obj2); + g_object_unref(object1); + g_object_unref(object2); g_object_unref(webView); } -static void testWebkitAtkGetTextInTable(void) +static void testWebkitAtkGetTextInTable() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTable, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTable, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - obj = atk_object_ref_accessible_child(obj, 0); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + object = atk_object_ref_accessible_child(object, 0); + g_assert(object); - /* Tables should not implement AtkText */ - g_assert(G_TYPE_INSTANCE_GET_INTERFACE(obj, ATK_TYPE_TEXT, AtkTextIface) == NULL); + /* Tables should not implement AtkText. */ + g_assert(!G_TYPE_INSTANCE_GET_INTERFACE(object, ATK_TYPE_TEXT, AtkTextIface)); - g_object_unref(obj); + g_object_unref(object); g_object_unref(webView); } -static void testWebkitAtkGetHeadersInTable(void) +static void testWebkitAtkGetHeadersInTable() { - WebKitWebView* webView; - AtkObject* axWebView; - AtkObject* table; - AtkObject* colHeader; - AtkObject* rowHeader; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, contentsInTableWithHeaders, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, contentsInTableWithHeaders, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - axWebView = gtk_widget_get_accessible(GTK_WIDGET(webView)); + AtkObject* axWebView = gtk_widget_get_accessible(GTK_WIDGET(webView)); g_assert(axWebView); - // Check table with both column and row headers - table = atk_object_ref_accessible_child(axWebView, 0); + /* Check table with both column and row headers. */ + AtkObject* table = atk_object_ref_accessible_child(axWebView, 0); g_assert(table); g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); - colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); + AtkObject* colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); g_assert(colHeader); g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(colHeader) == 0); @@ -543,7 +482,7 @@ static void testWebkitAtkGetHeadersInTable(void) g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(colHeader) == 2); - rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); + AtkObject* rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); g_assert(rowHeader); g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); g_assert(atk_object_get_index_in_parent(rowHeader) == 0); @@ -565,7 +504,7 @@ static void testWebkitAtkGetHeadersInTable(void) g_object_unref(table); - // Check table with no headers at all + /* Check table with no headers at all. */ table = atk_object_ref_accessible_child(axWebView, 1); g_assert(table); g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); @@ -588,8 +527,7 @@ static void testWebkitAtkGetHeadersInTable(void) static gint compAtkAttribute(AtkAttribute* a1, AtkAttribute* a2) { - gint strcmpVal; - strcmpVal = g_strcmp0(a1->name, a2->name); + gint strcmpVal = g_strcmp0(a1->name, a2->name); if (strcmpVal) return strcmpVal; return g_strcmp0(a1->value, a2->value); @@ -602,10 +540,9 @@ static gint compAtkAttributeName(AtkAttribute* a1, AtkAttribute* a2) static gboolean atkAttributeSetAttributeNameHasValue(AtkAttributeSet* set, const gchar* attributeName, const gchar* value) { - GSList* element; AtkAttribute at; at.name = (gchar*)attributeName; - element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName); + GSList* element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName); return element && !g_strcmp0(((AtkAttribute*)(element->data))->value, value); } @@ -640,52 +577,42 @@ static gboolean atkAttributeSetAreEqual(AtkAttributeSet* set1, AtkAttributeSet* return (!set2); } -static void testWebkitAtkTextAttributes(void) +static void testWebkitAtkTextAttributes() { - WebKitWebView* webView; - AtkObject* obj; - AtkObject* child; - GMainLoop* loop; - AtkText* childText; - AtkAttributeSet* set1; - AtkAttributeSet* set2; - AtkAttributeSet* set3; - AtkAttributeSet* set4; - gint startOffset, endOffset; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - - webkit_web_view_load_string(webView, textWithAttributes, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, textWithAttributes, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - child = atk_object_ref_accessible_child(obj, 0); + AtkObject* child = atk_object_ref_accessible_child(object, 0); g_assert(child && ATK_IS_TEXT(child)); - childText = ATK_TEXT(child); - set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); + AtkText* childText = ATK_TEXT(child); + + gint startOffset; + gint endOffset; + AtkAttributeSet* set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); g_assert_cmpint(endOffset, ==, 12); - g_assert(atkAttributeSetAreEqual(set1, NULL)); + g_assert(atkAttributeSetAreEqual(set1, 0)); - set2 = atk_text_get_run_attributes(childText, 15, &startOffset, &endOffset); + AtkAttributeSet* set2 = atk_text_get_run_attributes(childText, 15, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 12); g_assert_cmpint(endOffset, ==, 17); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_STYLE, "italic")); - set3 = atk_text_get_run_attributes(childText, 17, &startOffset, &endOffset); + AtkAttributeSet* set3 = atk_text_get_run_attributes(childText, 17, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 17); g_assert_cmpint(endOffset, ==, 40); g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_WEIGHT, "700")); - set4 = atk_text_get_default_attributes(childText); + AtkAttributeSet* set4 = atk_text_get_default_attributes(childText); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_STYLE, "normal")); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_JUSTIFICATION, "right")); g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_SIZE, "14")); @@ -694,7 +621,7 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); atk_attribute_set_free(set4); - child = atk_object_ref_accessible_child(obj, 1); + child = atk_object_ref_accessible_child(object, 1); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); @@ -708,14 +635,14 @@ static void testWebkitAtkTextAttributes(void) set2 = atk_text_get_run_attributes(childText, 43, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 43); g_assert_cmpint(endOffset, ==, 80); - // Checks that default attributes of text are not returned when called to atk_text_get_run_attributes + /* Checks that default attributes of text are not returned when called to atk_text_get_run_attributes. */ g_assert(!atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_FG_COLOR, "120,121,122")); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_UNDERLINE, "single")); g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_BG_COLOR, "80,81,82")); atk_attribute_set_free(set1); atk_attribute_set_free(set2); - child = atk_object_ref_accessible_child(obj, 2); + child = atk_object_ref_accessible_child(object, 2); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); @@ -740,7 +667,7 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); atk_attribute_set_free(set4); - child = atk_object_ref_accessible_child(obj, 3); + child = atk_object_ref_accessible_child(object, 3); g_assert(child && ATK_IS_TEXT(child)); childText = ATK_TEXT(child); set1 = atk_text_get_run_attributes(childText, 24, &startOffset, &endOffset); @@ -751,7 +678,7 @@ static void testWebkitAtkTextAttributes(void) set2 = atk_text_get_run_attributes(childText, 25, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 25); g_assert_cmpint(endOffset, ==, 30); - g_assert(atkAttributeSetAreEqual(set2, NULL)); + g_assert(atkAttributeSetAreEqual(set2, 0)); set3 = atk_text_get_default_attributes(childText); g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_JUSTIFICATION, "center")); @@ -760,53 +687,49 @@ static void testWebkitAtkTextAttributes(void) atk_attribute_set_free(set3); } -static void testWekitAtkTextSelections(void) +static void testWebkitAtkTextSelections() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - gchar* selectedText; - gint startOffset; - gint endOffset; - gboolean result; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, textForSelections, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, textForSelections, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0)); + AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); g_assert(ATK_IS_TEXT(paragraph1)); - AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 1)); + AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); g_assert(ATK_IS_TEXT(paragraph2)); AtkText* link = ATK_TEXT(atk_object_ref_accessible_child(ATK_OBJECT(paragraph2), 0)); g_assert(ATK_IS_TEXT(link)); - // First paragraph (simple text) + /* First paragraph (simple text). */ - // Basic initial checks + /* Basic initial checks. */ g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0); - selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); + + gint startOffset; + gint endOffset; + gchar* selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); g_assert_cmpint(endOffset, ==, 0); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); - // Try removing a non existing (yet) selection - result = atk_text_remove_selection(paragraph1, 0); + + /* Try removing a non existing (yet) selection. */ + gboolean result = atk_text_remove_selection(paragraph1, 0); g_assert(!result); - // Try setting a 0-char selection + + /* Try setting a 0-char selection. */ result = atk_text_set_selection(paragraph1, 0, 5, 5); g_assert(result); - // Make a selection and test it + /* Make a selection and test it. */ result = atk_text_set_selection(paragraph1, 0, 5, 25); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 1); @@ -815,29 +738,29 @@ static void testWekitAtkTextSelections(void) g_assert_cmpint(endOffset, ==, 25); g_assert_cmpstr(selectedText, ==, "agraph with plain te"); g_free (selectedText); - // Try removing the selection from other AtkText object (should fail) + /* Try removing the selection from other AtkText object (should fail). */ result = atk_text_remove_selection(paragraph2, 0); g_assert(!result); - // Remove the selection and test everything again + /* Remove the selection and test everything again. */ result = atk_text_remove_selection(paragraph1, 0); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph1), ==, 0); selectedText = atk_text_get_selection(paragraph1, 0, &startOffset, &endOffset); - // Now offsets should be the same, set to the last position of the caret + /* Now offsets should be the same, set to the last position of the caret. */ g_assert_cmpint(startOffset, ==, endOffset); g_assert_cmpint(startOffset, ==, 25); g_assert_cmpint(endOffset, ==, 25); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); - // Second paragraph (text + link + text) + /* Second paragraph (text + link + text). */ - // Set a selection partially covering the link and test it + /* Set a selection partially covering the link and test it. */ result = atk_text_set_selection(paragraph2, 0, 7, 21); g_assert(result); - // Test the paragraph first + /* Test the paragraph first. */ g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 1); selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 7); @@ -845,7 +768,7 @@ static void testWekitAtkTextSelections(void) g_assert_cmpstr(selectedText, ==, "raph with a li"); g_free (selectedText); - // Now test just the link + /* Now test just the link. */ g_assert_cmpint(atk_text_get_n_selections(link), ==, 1); selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset); g_assert_cmpint(startOffset, ==, 0); @@ -853,21 +776,21 @@ static void testWekitAtkTextSelections(void) g_assert_cmpstr(selectedText, ==, "a li"); g_free (selectedText); - // Remove selections and text everything again + /* Remove selections and text everything again. */ result = atk_text_remove_selection(paragraph2, 0); g_assert(result); g_assert_cmpint(atk_text_get_n_selections(paragraph2), ==, 0); selectedText = atk_text_get_selection(paragraph2, 0, &startOffset, &endOffset); - // Now offsets should be the same (no selection) + /* Now offsets should be the same (no selection). */ g_assert_cmpint(startOffset, ==, endOffset); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); g_assert_cmpint(atk_text_get_n_selections(link), ==, 0); selectedText = atk_text_get_selection(link, 0, &startOffset, &endOffset); - // Now offsets should be the same (no selection) + /* Now offsets should be the same (no selection). */ g_assert_cmpint(startOffset, ==, endOffset); - g_assert_cmpstr(selectedText, ==, NULL); + g_assert_cmpstr(selectedText, ==, 0); g_free (selectedText); g_object_unref(paragraph1); @@ -875,136 +798,133 @@ static void testWekitAtkTextSelections(void) g_object_unref(webView); } -static void testWebkitAtkGetExtents(void) +static void testWebkitAtkGetExtents() { - WebKitWebView* webView; - AtkObject* obj; - GMainLoop* loop; - - webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, centeredContents, NULL, NULL, NULL); - loop = g_main_loop_new(NULL, TRUE); - - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); - - obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); - - AtkText* short_text1 = ATK_TEXT(atk_object_ref_accessible_child(obj, 0)); - g_assert(ATK_IS_TEXT(short_text1)); - AtkText* long_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 1)); - g_assert(ATK_IS_TEXT(long_text)); - AtkText* short_text2 = ATK_TEXT(atk_object_ref_accessible_child(obj, 2)); - g_assert(ATK_IS_TEXT(short_text2)); - AtkText* multiline_text = ATK_TEXT(atk_object_ref_accessible_child(obj, 3)); - g_assert(ATK_IS_TEXT(multiline_text)); - - // Start with window extents. + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, centeredContents, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + AtkText* shortText1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); + g_assert(ATK_IS_TEXT(shortText1)); + AtkText* longText = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); + g_assert(ATK_IS_TEXT(longText)); + AtkText* shortText2 = ATK_TEXT(atk_object_ref_accessible_child(object, 2)); + g_assert(ATK_IS_TEXT(shortText2)); + AtkText* multilineText = ATK_TEXT(atk_object_ref_accessible_child(object, 3)); + g_assert(ATK_IS_TEXT(multilineText)); + + /* Start with window extents. */ AtkTextRectangle sline_window1, sline_window2, lline_window, mline_window; - atk_text_get_range_extents(short_text1, 0, 10, ATK_XY_WINDOW, &sline_window1); - atk_text_get_range_extents(long_text, 0, 44, ATK_XY_WINDOW, &lline_window); - atk_text_get_range_extents(short_text2, 0, 10, ATK_XY_WINDOW, &sline_window2); - atk_text_get_range_extents(multiline_text, 0, 60, ATK_XY_WINDOW, &mline_window); + atk_text_get_range_extents(shortText1, 0, 10, ATK_XY_WINDOW, &sline_window1); + atk_text_get_range_extents(longText, 0, 44, ATK_XY_WINDOW, &lline_window); + atk_text_get_range_extents(shortText2, 0, 10, ATK_XY_WINDOW, &sline_window2); + atk_text_get_range_extents(multilineText, 0, 60, ATK_XY_WINDOW, &mline_window); - // Check vertical line position. + /* Check vertical line position. */ g_assert_cmpint(sline_window1.y + sline_window1.height, <=, lline_window.y); g_assert_cmpint(lline_window.y + lline_window.height + sline_window2.height, <=, mline_window.y); - // Paragraphs 1 and 3 have identical text and alignment. + /* Paragraphs 1 and 3 have identical text and alignment. */ g_assert_cmpint(sline_window1.x, ==, sline_window2.x); g_assert_cmpint(sline_window1.width, ==, sline_window2.width); g_assert_cmpint(sline_window1.height, ==, sline_window2.height); - // All lines should be the same height; line 2 is the widest line. + /* All lines should be the same height; line 2 is the widest line. */ g_assert_cmpint(sline_window1.height, ==, lline_window.height); g_assert_cmpint(sline_window1.width, <, lline_window.width); - // Make sure the character extents jive with the range extents. - gint x, y, width, height; + /* Make sure the character extents jive with the range extents. */ + gint x; + gint y; + gint width; + gint height; - // First paragraph (short text) - atk_text_get_character_extents(short_text1, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* First paragraph (short text). */ + atk_text_get_character_extents(shortText1, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window1.x); g_assert_cmpint(y, ==, sline_window1.y); g_assert_cmpint(height, ==, sline_window1.height); - atk_text_get_character_extents(short_text1, 9, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(shortText1, 9, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window1.x + sline_window1.width - width); g_assert_cmpint(y, ==, sline_window1.y); g_assert_cmpint(height, ==, sline_window1.height); - // Second paragraph (long text) - atk_text_get_character_extents(long_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Second paragraph (long text). */ + atk_text_get_character_extents(longText, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, lline_window.x); g_assert_cmpint(y, ==, lline_window.y); g_assert_cmpint(height, ==, lline_window.height); - atk_text_get_character_extents(long_text, 43, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(longText, 43, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, lline_window.x + lline_window.width - width); g_assert_cmpint(y, ==, lline_window.y); g_assert_cmpint(height, ==, lline_window.height); - // Third paragraph (short text) - atk_text_get_character_extents(short_text2, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Third paragraph (short text). */ + atk_text_get_character_extents(shortText2, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window2.x); g_assert_cmpint(y, ==, sline_window2.y); g_assert_cmpint(height, ==, sline_window2.height); - atk_text_get_character_extents(short_text2, 9, &x, &y, &width, &height, ATK_XY_WINDOW); + atk_text_get_character_extents(shortText2, 9, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, sline_window2.x + sline_window2.width - width); g_assert_cmpint(y, ==, sline_window2.y); g_assert_cmpint(height, ==, sline_window2.height); - // Four paragraph (3 lines multi-line text) - atk_text_get_character_extents(multiline_text, 0, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Four paragraph (3 lines multi-line text). */ + atk_text_get_character_extents(multilineText, 0, &x, &y, &width, &height, ATK_XY_WINDOW); g_assert_cmpint(x, ==, mline_window.x); g_assert_cmpint(y, ==, mline_window.y); g_assert_cmpint(3 * height, ==, mline_window.height); - atk_text_get_character_extents(multiline_text, 59, &x, &y, &width, &height, ATK_XY_WINDOW); - // Last line won't fill the whole width of the rectangle + atk_text_get_character_extents(multilineText, 59, &x, &y, &width, &height, ATK_XY_WINDOW); + /* Last line won't fill the whole width of the rectangle. */ g_assert_cmpint(x, <=, mline_window.x + mline_window.width - width); g_assert_cmpint(y, ==, mline_window.y + mline_window.height - height); g_assert_cmpint(height, <=, mline_window.height); - g_object_unref(short_text1); - g_object_unref(short_text2); - g_object_unref(long_text); - g_object_unref(multiline_text); + g_object_unref(shortText1); + g_object_unref(shortText2); + g_object_unref(longText); + g_object_unref(multilineText); g_object_unref(webView); } -static void testWebkitAtkLayoutAndDataTables(void) +static void testWebkitAtkLayoutAndDataTables() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, layoutAndDataTables, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - // Check the non-layout table (data table) + /* Check the non-layout table (data table). */ - AtkObject* table1 = atk_object_ref_accessible_child(obj, 0); + AtkObject* table1 = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_TABLE(table1)); AtkAttributeSet* set1 = atk_object_get_attributes(table1); g_assert(set1); g_assert(!atkAttributeSetContainsAttributeName(set1, "layout-guess")); atk_attribute_set_free(set1); - // Check the layout table + /* Check the layout table. */ - AtkObject* table2 = atk_object_ref_accessible_child(obj, 1); + AtkObject* table2 = atk_object_ref_accessible_child(object, 1); g_assert(ATK_IS_TABLE(table2)); AtkAttributeSet* set2 = atk_object_get_attributes(table2); g_assert(set2); @@ -1017,22 +937,21 @@ static void testWebkitAtkLayoutAndDataTables(void) g_object_unref(webView); } -static void testWebkitAtkLinksWithInlineImages(void) +static void testWebkitAtkLinksWithInlineImages() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, linksWithInlineImages, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); g_assert(object); - // First paragraph (link at the beginning) + /* First paragraph (link at the beginning). */ AtkObject* paragraph = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_TEXT(paragraph)); gint startOffset; @@ -1045,7 +964,7 @@ static void testWebkitAtkLinksWithInlineImages(void) g_free(text); g_object_unref(paragraph); - // Second paragraph (link in the middle) + /* Second paragraph (link in the middle). */ paragraph = atk_object_ref_accessible_child(object, 1); g_assert(ATK_IS_TEXT(paragraph)); text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset); @@ -1056,7 +975,7 @@ static void testWebkitAtkLinksWithInlineImages(void) g_free(text); g_object_unref(paragraph); - // Third paragraph (link at the end) + /* Third paragraph (link at the end). */ paragraph = atk_object_ref_accessible_child(object, 2); g_assert(ATK_IS_TEXT(paragraph)); text = atk_text_get_text_at_offset(ATK_TEXT(paragraph), 0, ATK_TEXT_BOUNDARY_LINE_START, &startOffset, &endOffset); @@ -1070,24 +989,97 @@ static void testWebkitAtkLinksWithInlineImages(void) g_object_unref(webView); } -static void testWebkitAtkListsOfItems(void) +static void testWebkitAtkHypertextAndHyperlinks() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); - webkit_web_view_load_string(webView, listsOfItems, NULL, NULL, NULL); - GMainLoop* loop = g_main_loop_new(NULL, TRUE); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, hypertextAndHyperlinks, 0, 0, 0); - g_idle_add((GSourceFunc)bail_out, loop); - g_main_loop_run(loop); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - // Unordered list + AtkObject* paragraph1 = atk_object_ref_accessible_child(object, 0); + g_assert(ATK_OBJECT(paragraph1)); + g_assert(atk_object_get_role(paragraph1) == ATK_ROLE_PARAGRAPH); + g_assert(ATK_IS_HYPERTEXT(paragraph1)); + + /* No links in the first paragraph. */ + gint nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph1)); + g_assert_cmpint(nLinks, ==, 0); + + AtkObject* paragraph2 = atk_object_ref_accessible_child(object, 1); + g_assert(ATK_OBJECT(paragraph2)); + g_assert(atk_object_get_role(paragraph2) == ATK_ROLE_PARAGRAPH); + g_assert(ATK_IS_HYPERTEXT(paragraph2)); + + /* Check links in the second paragraph. + nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph2)); + g_assert_cmpint(nLinks, ==, 3); */ + + AtkHyperlink* hLink1 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 0); + g_assert(ATK_HYPERLINK(hLink1)); + AtkObject* hLinkObject1 = atk_hyperlink_get_object(hLink1, 0); + g_assert(ATK_OBJECT(hLinkObject1)); + g_assert(atk_object_get_role(hLinkObject1) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink1), ==, 0); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink1), ==, 6); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink1), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink1, 0), ==, "http://foo.bar.baz/"); + + AtkHyperlink* hLink2 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 1); + g_assert(ATK_HYPERLINK(hLink2)); + AtkObject* hLinkObject2 = atk_hyperlink_get_object(hLink2, 0); + g_assert(ATK_OBJECT(hLinkObject2)); + g_assert(atk_object_get_role(hLinkObject2) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink2), ==, 12); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink2), ==, 32); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink2), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink2, 0), ==, "http://bar.baz.foo/"); + + AtkHyperlink* hLink3 = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 2); + g_assert(ATK_HYPERLINK(hLink3)); + AtkObject* hLinkObject3 = atk_hyperlink_get_object(hLink3, 0); + g_assert(ATK_OBJECT(hLinkObject3)); + g_assert(atk_object_get_role(hLinkObject3) == ATK_ROLE_LINK); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink3), ==, 65); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink3), ==, 75); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink3), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink3, 0), ==, "http://baz.foo.bar/"); + + /* Finally check the AtkAction interface for a given AtkHyperlink. */ + g_assert(ATK_IS_ACTION(hLink1)); + g_assert_cmpint(atk_action_get_n_actions(ATK_ACTION(hLink1)), ==, 1); + g_assert_cmpstr(atk_action_get_keybinding(ATK_ACTION(hLink1), 0), ==, ""); + g_assert_cmpstr(atk_action_get_name(ATK_ACTION(hLink1), 0), ==, "jump"); + g_assert(atk_action_do_action(ATK_ACTION(hLink1), 0)); - AtkObject* uList = atk_object_ref_accessible_child(obj, 0); + g_object_unref(paragraph1); + g_object_unref(paragraph2); + g_object_unref(webView); +} + +static void testWebkitAtkListsOfItems() +{ + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, listsOfItems, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + /* Unordered list. */ + + AtkObject* uList = atk_object_ref_accessible_child(object, 0); g_assert(ATK_OBJECT(uList)); g_assert(atk_object_get_role(uList) == ATK_ROLE_LIST); g_assert_cmpint(atk_object_get_n_accessible_children(uList), ==, 3); @@ -1111,9 +1103,9 @@ static void testWebkitAtkListsOfItems(void) g_object_unref(item2); g_object_unref(item3); - // Ordered list + /* Ordered list. */ - AtkObject* oList = atk_object_ref_accessible_child(obj, 1); + AtkObject* oList = atk_object_ref_accessible_child(object, 1); g_assert(ATK_OBJECT(oList)); g_assert(atk_object_get_role(oList) == ATK_ROLE_LIST); g_assert_cmpint(atk_object_get_n_accessible_children(oList), ==, 3); @@ -1162,22 +1154,21 @@ static gboolean checkTextChanges(gpointer unused) return FALSE; } -static void testWebkitAtkTextChangedNotifications(void) +static void testWebkitAtkTextChangedNotifications() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); g_object_ref_sink(webView); - GtkAllocation alloc = { 0, 0, 800, 600 }; - gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); webkit_web_view_load_string(webView, formWithTextInputs, 0, 0, 0); - // Manually spin the main context to get the accessible objects - while (g_main_context_pending(0)) - g_main_context_iteration(0, TRUE); + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); - AtkObject* obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); - g_assert(obj); + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); - AtkObject* form = atk_object_ref_accessible_child(obj, 0); + AtkObject* form = atk_object_ref_accessible_child(object, 0); g_assert(ATK_IS_OBJECT(form)); AtkObject* textEntry = atk_object_ref_accessible_child(form, 0); @@ -1206,22 +1197,23 @@ static void testWebkitAtkTextChangedNotifications(void) int main(int argc, char** argv) { - g_thread_init(NULL); - gtk_test_init(&argc, &argv, NULL); + g_thread_init(0); + gtk_test_init(&argc, &argv, 0); g_test_bug_base("https://bugs.webkit.org/"); - g_test_add_func("/webkit/atk/get_text_at_offset", test_webkit_atk_get_text_at_offset); - g_test_add_func("/webkit/atk/get_text_at_offset_forms", test_webkit_atk_get_text_at_offset_forms); - g_test_add_func("/webkit/atk/get_text_at_offset_newlines", test_webkit_atk_get_text_at_offset_newlines); - g_test_add_func("/webkit/atk/get_text_at_offset_textarea", test_webkit_atk_get_text_at_offset_textarea); - g_test_add_func("/webkit/atk/get_text_at_offset_text_input", test_webkit_atk_get_text_at_offset_text_input); + g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); + g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); + g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); + g_test_add_func("/webkit/atk/getTextAtOffsetTextarea", testWebkitAtkGetTextAtOffsetTextarea); + g_test_add_func("/webkit/atk/getTextAtOffsetTextInput", testWebkitAtkGetTextAtOffsetTextInput); g_test_add_func("/webkit/atk/getTextInParagraphAndBodySimple", testWebkitAtkGetTextInParagraphAndBodySimple); g_test_add_func("/webkit/atk/getTextInParagraphAndBodyModerate", testWebkitAtkGetTextInParagraphAndBodyModerate); g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable); g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable); g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes); - g_test_add_func("/webkit/atk/textSelections", testWekitAtkTextSelections); + g_test_add_func("/webkit/atk/textSelections", testWebkitAtkTextSelections); g_test_add_func("/webkit/atk/getExtents", testWebkitAtkGetExtents); + g_test_add_func("/webkit/atk/hypertextAndHyperlinks", testWebkitAtkHypertextAndHyperlinks); g_test_add_func("/webkit/atk/layoutAndDataTables", testWebkitAtkLayoutAndDataTables); g_test_add_func("/webkit/atk/linksWithInlineImages", testWebkitAtkLinksWithInlineImages); g_test_add_func("/webkit/atk/listsOfItems", testWebkitAtkListsOfItems); diff --git a/WebKit/gtk/tests/testcopyandpaste.c b/WebKit/gtk/tests/testcopyandpaste.c index f7889bd..1b5fb7b 100644 --- a/WebKit/gtk/tests/testcopyandpaste.c +++ b/WebKit/gtk/tests/testcopyandpaste.c @@ -92,6 +92,17 @@ static void load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer da g_assert(!text || !strcmp(text, fixture->info->expectedContent)); g_free(text); + // Verify that the markup starts with the proper content-type meta tag prefix. + GtkSelectionData* selectionData = gtk_clipboard_wait_for_contents(clipboard, gdk_atom_intern("text/html", FALSE)); + if (selectionData) { + static const char* markupPrefix = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">"; + char* markup = g_strndup((const char*) gtk_selection_data_get_data(selectionData), + gtk_selection_data_get_length(selectionData)); + g_assert(strlen(markupPrefix) <= strlen(markup)); + g_assert(!strncmp(markupPrefix, markup, strlen(markupPrefix))); + g_free(markup); + } + g_assert(!gtk_clipboard_wait_is_uris_available(clipboard)); g_assert(!gtk_clipboard_wait_is_image_available(clipboard)); diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 261c437..3ac3563 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -278,6 +278,9 @@ extern "C" { void webkit_web_view_add_resource(WebKitWebView*, const char*, WebKitWebResource*); + void + webkit_web_view_remove_resource(WebKitWebView*, const char*); + WebKitWebResource* webkit_web_view_get_resource(WebKitWebView*, char*); diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp index c5913fd..9b5bf8b 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp @@ -19,17 +19,15 @@ */ #include "config.h" - #include "webkitwebbackforwardlist.h" + +#include "BackForwardListImpl.h" +#include "HistoryItem.h" #include "webkitprivate.h" #include "webkitwebhistoryitem.h" #include "webkitwebview.h" - #include <glib.h> -#include "BackForwardListImpl.h" -#include "HistoryItem.h" - /** * SECTION:webkitwebbackforwardlist * @short_description: The history of a #WebKitWebView @@ -115,7 +113,7 @@ WebKitWebBackForwardList* webkit_web_back_forward_list_new_with_web_view(WebKitW webBackForwardList = WEBKIT_WEB_BACK_FORWARD_LIST(g_object_new(WEBKIT_TYPE_WEB_BACK_FORWARD_LIST, NULL)); WebKitWebBackForwardListPrivate* priv = webBackForwardList->priv; - priv->backForwardList = static_cast<BackForwardListImpl*>(core(webView)->backForwardList()); + priv->backForwardList = static_cast<WebCore::BackForwardListImpl*>(core(webView)->backForwardList()); priv->backForwardList->setEnabled(TRUE); return webBackForwardList; diff --git a/WebKit/gtk/webkit/webkitwebframe.cpp b/WebKit/gtk/webkit/webkitwebframe.cpp index c581ce6..63a2413 100644 --- a/WebKit/gtk/webkit/webkitwebframe.cpp +++ b/WebKit/gtk/webkit/webkitwebframe.cpp @@ -480,7 +480,7 @@ G_CONST_RETURN gchar* webkit_web_frame_get_name(WebKitWebFrame* frame) if (!coreFrame) return ""; - String string = coreFrame->tree()->name(); + String string = coreFrame->tree()->uniqueName(); priv->name = g_strdup(string.utf8().data()); return priv->name; } @@ -1059,11 +1059,7 @@ void webkit_web_frame_suspend_animations(WebKitWebFrame* frame) if (!coreFrame) return; - AnimationController* controller = coreFrame->animation(); - if (!controller) - return; - - controller->suspendAnimations(coreFrame->document()); + coreFrame->animation()->suspendAnimations(); } void webkit_web_frame_resume_animations(WebKitWebFrame* frame) @@ -1072,11 +1068,7 @@ void webkit_web_frame_resume_animations(WebKitWebFrame* frame) if (!coreFrame) return; - AnimationController* controller = coreFrame->animation(); - if (!controller) - return; - - controller->resumeAnimations(coreFrame->document()); + coreFrame->animation()->resumeAnimations(); } gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame) diff --git a/WebKit/gtk/webkit/webkitwebsettings.cpp b/WebKit/gtk/webkit/webkitwebsettings.cpp index cd59bdb..2661b82 100644 --- a/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -689,6 +689,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass) COMPILE_ASSERT(static_cast<int>(WEBKIT_EDITING_BEHAVIOR_MAC) == static_cast<int>(WebCore::EditingMacBehavior), editing_behavior_type_mac_match); COMPILE_ASSERT(static_cast<int>(WEBKIT_EDITING_BEHAVIOR_WINDOWS) == static_cast<int>(WebCore::EditingWindowsBehavior), editing_behavior_type_windows_match); + COMPILE_ASSERT(static_cast<int>(WEBKIT_EDITING_BEHAVIOR_UNIX) == static_cast<int>(WebCore::EditingUnixBehavior), editing_behavior_type_unix_match); /** * WebKitWebSettings:editing-behavior @@ -713,7 +714,7 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass) _("Editing behavior"), _("The behavior mode to use in editing mode"), WEBKIT_TYPE_EDITING_BEHAVIOR, - WEBKIT_EDITING_BEHAVIOR_MAC, + WEBKIT_EDITING_BEHAVIOR_UNIX, flags)); /** diff --git a/WebKit/gtk/webkit/webkitwebsettings.h b/WebKit/gtk/webkit/webkitwebsettings.h index d8dafd9..eee0d04 100644 --- a/WebKit/gtk/webkit/webkitwebsettings.h +++ b/WebKit/gtk/webkit/webkitwebsettings.h @@ -36,7 +36,8 @@ G_BEGIN_DECLS typedef enum { WEBKIT_EDITING_BEHAVIOR_MAC, - WEBKIT_EDITING_BEHAVIOR_WINDOWS + WEBKIT_EDITING_BEHAVIOR_WINDOWS, + WEBKIT_EDITING_BEHAVIOR_UNIX } WebKitEditingBehavior; typedef struct _WebKitWebSettingsPrivate WebKitWebSettingsPrivate; diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index a295fce..314da16 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -43,7 +43,7 @@ #include "AXObjectCache.h" #include "AbstractDatabase.h" #include "BackForwardListImpl.h" -#include "Cache.h" +#include "MemoryCache.h" #include "ChromeClientGtk.h" #include "ClipboardUtilitiesGtk.h" #include "ContextMenuClientGtk.h" @@ -868,6 +868,7 @@ static gboolean webkit_web_view_scroll_event(GtkWidget* widget, GdkEventScroll* return frame->eventHandler()->handleWheelEvent(wheelEvent); } +#ifdef GTK_API_VERSION_2 static void webkit_web_view_size_request(GtkWidget* widget, GtkRequisition* requisition) { WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget); @@ -882,6 +883,35 @@ static void webkit_web_view_size_request(GtkWidget* widget, GtkRequisition* requ requisition->width = view->contentsWidth(); requisition->height = view->contentsHeight(); } +#else +static void webkit_web_view_get_preferred_width(GtkWidget* widget, gint* minimum, gint* natural) +{ + WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget); + Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view)); + if (!coreFrame) + return; + + FrameView* view = coreFrame->view(); + if (!view) + return; + + *minimum = *natural = view->contentsWidth(); +} + +static void webkit_web_view_get_preferred_height(GtkWidget* widget, gint* minimum, gint* natural) +{ + WebKitWebView* web_view = WEBKIT_WEB_VIEW(widget); + Frame* coreFrame = core(webkit_web_view_get_main_frame(web_view)); + if (!coreFrame) + return; + + FrameView* view = coreFrame->view(); + if (!view) + return; + + *minimum = *natural = view->contentsHeight(); +} +#endif static void webkit_web_view_size_allocate(GtkWidget* widget, GtkAllocation* allocation) { @@ -2602,7 +2632,12 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) widgetClass->motion_notify_event = webkit_web_view_motion_event; widgetClass->scroll_event = webkit_web_view_scroll_event; widgetClass->size_allocate = webkit_web_view_size_allocate; +#ifdef GTK_API_VERSION_2 widgetClass->size_request = webkit_web_view_size_request; +#else + widgetClass->get_preferred_width = webkit_web_view_get_preferred_width; + widgetClass->get_preferred_height = webkit_web_view_get_preferred_height; +#endif widgetClass->popup_menu = webkit_web_view_popup_menu_handler; widgetClass->grab_focus = webkit_web_view_grab_focus; widgetClass->focus_in_event = webkit_web_view_focus_in_event; @@ -4612,6 +4647,16 @@ void webkit_web_view_add_resource(WebKitWebView* webView, const char* identifier g_hash_table_insert(priv->subResources.get(), g_strdup(identifier), webResource); } +void webkit_web_view_remove_resource(WebKitWebView* webView, const char* identifier) +{ + WebKitWebViewPrivate* priv = webView->priv; + if (g_str_equal(identifier, priv->mainResourceIdentifier.data())) { + priv->mainResourceIdentifier = ""; + priv->mainResource = 0; + } else + g_hash_table_remove(priv->subResources.get(), identifier); +} + WebKitWebResource* webkit_web_view_get_resource(WebKitWebView* webView, char* identifier) { WebKitWebViewPrivate* priv = webView->priv; diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog index 7ed4fad..723c957 100644 --- a/WebKit/haiku/ChangeLog +++ b/WebKit/haiku/ChangeLog @@ -1,3 +1,29 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. Also, added missing "virtual" + keywords all over the place. + + * WebCoreSupport/ChromeClientHaiku.cpp: + (WebCore::ChromeClientHaiku::focusedFrameChanged): + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::scrollbarsModeDidChange): + (WebCore::ChromeClientHaiku::cancelGeolocationPermissionRequestForFrame): + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientHaiku.h: + (WebCore::ChromeClientHaiku::showContextMenu): + 2010-10-29 Alexey Proskuryakov <ap@apple.com> Reviewed by Darin Adler. diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp index 134cabe..01b9c1d 100644 --- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp +++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp @@ -108,6 +108,10 @@ void ChromeClientHaiku::focusedNodeChanged(Node*) { } +void ChromeClientHaiku::focusedFrameChanged(Frame*) +{ +} + Page* ChromeClientHaiku::createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&) { notImplemented(); diff --git a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h index 9409c69..deb3678 100644 --- a/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h +++ b/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h @@ -43,83 +43,84 @@ namespace WebCore { public: ChromeClientHaiku(); virtual ~ChromeClientHaiku(); - void chromeDestroyed(); + virtual void chromeDestroyed(); - void setWindowRect(const FloatRect&); - FloatRect windowRect(); + virtual void setWindowRect(const FloatRect&); + virtual FloatRect windowRect(); - FloatRect pageRect(); + virtual FloatRect pageRect(); - float scaleFactor(); + virtual float scaleFactor(); - void focus(); - void unfocus(); + virtual void focus(); + virtual void unfocus(); - bool canTakeFocus(FocusDirection); - void takeFocus(FocusDirection); + virtual bool canTakeFocus(FocusDirection); + virtual void takeFocus(FocusDirection); - void focusedNodeChanged(Node*); + virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); - Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); - Page* createModalDialog(Frame*, const FrameLoadRequest&); - void show(); + virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); + virtual Page* createModalDialog(Frame*, const FrameLoadRequest&); + virtual void show(); - bool canRunModal(); - void runModal(); + virtual bool canRunModal(); + virtual void runModal(); - void setToolbarsVisible(bool); - bool toolbarsVisible(); + virtual void setToolbarsVisible(bool); + virtual bool toolbarsVisible(); - void setStatusbarVisible(bool); - bool statusbarVisible(); + virtual void setStatusbarVisible(bool); + virtual bool statusbarVisible(); - void setScrollbarsVisible(bool); - bool scrollbarsVisible(); + virtual void setScrollbarsVisible(bool); + virtual bool scrollbarsVisible(); - void setMenubarVisible(bool); - bool menubarVisible(); + virtual void setMenubarVisible(bool); + virtual bool menubarVisible(); - void setResizable(bool); + virtual void setResizable(bool); - void addMessageToConsole(const String& message, unsigned int lineNumber, + virtual void addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID); - void addMessageToConsole(MessageSource, MessageLevel, const String& message, + virtual void addMessageToConsole(MessageSource, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID); - void addMessageToConsole(MessageSource, MessageType, MessageLevel, + virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String&, unsigned int, const String&); - bool canRunBeforeUnloadConfirmPanel(); + virtual bool canRunBeforeUnloadConfirmPanel(); - bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); + virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); - void closeWindowSoon(); + virtual void closeWindowSoon(); - void runJavaScriptAlert(Frame*, const String&); - bool runJavaScriptConfirm(Frame*, const String&); - bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); - bool shouldInterruptJavaScript(); + virtual void runJavaScriptAlert(Frame*, const String&); + virtual bool runJavaScriptConfirm(Frame*, const String&); + virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); + virtual bool shouldInterruptJavaScript(); - void setStatusbarText(const WTF::String&); - bool tabsToLinks() const; - IntRect windowResizerRect() const; + virtual void setStatusbarText(const WTF::String&); + virtual bool tabsToLinks() const; + virtual IntRect windowResizerRect() const; - void invalidateWindow(const IntRect&, bool); - void invalidateContentsAndWindow(const IntRect&, bool); - void invalidateContentsForSlowScroll(const IntRect&, bool); - void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); + virtual void invalidateWindow(const IntRect&, bool); + virtual void invalidateContentsAndWindow(const IntRect&, bool); + virtual void invalidateContentsForSlowScroll(const IntRect&, bool); + virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); - IntPoint screenToWindow(const IntPoint&) const; - IntRect windowToScreen(const IntRect&) const; - PlatformPageClient platformPageClient() const; - void contentsSizeChanged(Frame*, const IntSize&) const; - void scrollRectIntoView(const IntRect&, const ScrollView*) const; + virtual IntPoint screenToWindow(const IntPoint&) const; + virtual IntRect windowToScreen(const IntRect&) const; + virtual PlatformPageClient platformPageClient() const; + virtual void contentsSizeChanged(Frame*, const IntSize&) const; + virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const; void addToDirtyRegion(const IntRect&); void scrollBackingStore(int, int, const IntRect&, const IntRect&); void updateBackingStore(); - void scrollbarsModeDidChange() const { } - void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); + virtual void scrollbarsModeDidChange() const { } + virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); void setToolTip(const String&); @@ -127,7 +128,9 @@ namespace WebCore { void print(Frame*); - void exceededDatabaseQuota(Frame*, const String& databaseName); +#if ENABLE(DATABASE) + virtual void exceededDatabaseQuota(Frame*, const String& databaseName); +#endif virtual bool selectItemWritingDirectionIsNatural(); virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; @@ -137,22 +140,25 @@ namespace WebCore { virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif // This is an asynchronous call. The ChromeClient can display UI asking the user for permission // to use Geolococation. - void requestGeolocationPermissionForFrame(Frame*, Geolocation*); - void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } + virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); + virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } - void runOpenPanel(Frame*, PassRefPtr<FileChooser>); - void chooseIconForFiles(const Vector<String>&, FileChooser*); + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); + virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); - void setCursor(const Cursor&); + virtual void setCursor(const Cursor&); // Notification that the given form element has changed. This function // will be called frequently, so handling should be very fast. - void formStateDidChange(const Node*); + virtual void formStateDidChange(const Node*); - PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks(); + virtual PassOwnPtr<HTMLParserQuirks> createHTMLParserQuirks(); }; } // namespace WebCore diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index e7abf3d..8d54870 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,224 @@ +2010-11-08 Anders Carlsson <andersca@apple.com> + + Reviewed by Dan Bernstein. + + Plug-in views should not assume that plugins are RenderEmbeddedObjects + https://bugs.webkit.org/show_bug.cgi?id=49196 + <rdar://problem/8638467> + + * Plugins/Hosted/WebHostedNetscapePluginView.mm: + (-[WebHostedNetscapePluginView pluginHostDied]): + +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/WebChromeClient.h: + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::focusedFrameChanged): + +2010-11-08 Anders Carlsson <andersca@apple.com> + + Build fix. + + * MigrateHeaders.make: + +2010-11-08 Anders Carlsson <andersca@apple.com> + + Reviewed by Adam Roben. + + Remove use of HIGetScaleFactor + https://bugs.webkit.org/show_bug.cgi?id=49186 + <rdar://problem/8618410> + + Scale factors can vary on a display-by-display basis and it doesn't make sense + to compute scale factor event coordinates like this. + + * Plugins/WebNetscapePluginEventHandlerCarbon.mm: + (getCarbonEvent): + +2010-11-08 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Sam Weinig. + + Allow applets to participate in accelerated compositing + https://bugs.webkit.org/show_bug.cgi?id=49117 + <rdar://problem/8625819> + + If Java is being loaded via the Netscape Plugin API, create a + NetscapePluginWidget so that it has an implementation of platformLayer(). + + Also clean up by using early returns. + + * WebCoreSupport/WebFrameLoaderClient.mm: + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * Misc/WebCache.mm: + (+[WebCache statistics]): + * WebCoreSupport/WebDeviceOrientationClient.mm: + (WebDeviceOrientationClient::setController): + * WebView/WebView.mm: + +2010-11-05 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=49100 + ASSERT([self window]) fails in -[WebBaseNetscapePluginView restartTimers] + + * Plugins/WebBaseNetscapePluginView.mm: (-[WebBaseNetscapePluginView restartTimers]): + Removed the assertion. Multiple callers provide no guarantee that the plug-in is still alive + (see bug comments), and there seems to be no harm in executing this function in that case. + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * WebView/WebFrame.mm: + (-[WebFrame _suspendAnimations]): + (-[WebFrame _resumeAnimations]): + +2010-11-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=49008 + <rdar://problem/7906226> Frequent crashes on mail.yahoo.co.jp + + Callers of NetscapePluginInstanceProxy::waitForReply() are not prepared to be deleted during + the call, unless it returns 0. There are two reasons for NetscapePluginInstanceProxy to be + deleted during wait: + - plugin crashed; + - plugin was stopped (e.g. due to a DOM modification performed by another reply that came in + while waiting). + + We didn't recognize the latter. + + * Plugins/Hosted/NetscapePluginHostProxy.mm: + (WebKit::PluginDestroyDeferrer::~PluginDestroyDeferrer): + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + (WebKit::NetscapePluginInstanceProxy::waitForReply): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::didCallPluginFunction): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state + https://bugs.webkit.org/show_bug.cgi?id=46945 + + * WebView/WebFrame.mm: + (-[WebFrame _suspendAnimations]): + (-[WebFrame _resumeAnimations]): + +2010-11-04 Jia Pu <jpu@apple.com> + + Reviewed by Dan Bernstein. + + reversion bubble in WebViews + https://bugs.webkit.org/show_bug.cgi?id=47630 + <rdar://problem/8530960> + + This patch is to add reversion to correction panel. Please see WebCore/ChangeLog for detail. + + * WebCoreSupport/WebEditorClient.h: Adopted new signature of base class method. + * WebCoreSupport/WebEditorClient.mm: Adopted new signature of base class method. And code + change to use new reversion API in AppKit. + (WebEditorClient::WebEditorClient): + (WebEditorClient::~WebEditorClient): + (WebEditorClient::respondToChangedSelection): + (WebEditorClient::showCorrectionPanel): + (WebEditorClient::dismissCorrectionPanel): + (WebEditorClient::isShowingCorrectionPanel): + +2010-11-04 Mike Thole <mthole@apple.com> + + Reviewed by Dan Bernstein. + + Title for images should use localized numerals + https://bugs.webkit.org/show_bug.cgi?id=49017 + + * WebCoreSupport/WebPlatformStrategies.mm: + (WebPlatformStrategies::imageTitle): Use localized numerals on Snow Leopard or newer. + +2010-11-02 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the Mac port. + + * WebView/WebFrame.mm: + (-[WebFrame name]): + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::showContextMenu): + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * WebView/WebFrame.mm: + (-[WebFrame name]): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Added the corresponding GTK+ setting to WebCore's EditingUnixBehavior: WebKitEditingUnixBehavior. + + * WebView/WebFrame.mm: + (core): + * WebView/WebPreferencesPrivate.h: + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified Mac-port to use FrameTree::uniqueName(). + + * WebView/WebFrame.mm: + (-[WebFrame name]): + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index 8739787..56baf78 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 = 11; +MINOR_VERSION = 12; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make index 2e6f24a..d674d4d 100644 --- a/WebKit/mac/MigrateHeaders.make +++ b/WebKit/mac/MigrateHeaders.make @@ -222,7 +222,6 @@ all : \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedNumberList.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedNumberListInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPathData.h \ - $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPoints.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedPreserveAspectRatio.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGAnimatedPreserveAspectRatioInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGAnimatedRect.h \ diff --git a/WebKit/mac/Misc/WebCache.mm b/WebKit/mac/Misc/WebCache.mm index 747d213..0517bc4 100644 --- a/WebKit/mac/Misc/WebCache.mm +++ b/WebKit/mac/Misc/WebCache.mm @@ -31,7 +31,7 @@ #import "WebView.h" #import "WebViewInternal.h" #import <WebCore/ApplicationCacheStorage.h> -#import <WebCore/Cache.h> +#import <WebCore/MemoryCache.h> #import <WebCore/CrossOriginPreflightResultCache.h> @implementation WebCache @@ -43,7 +43,7 @@ + (NSArray *)statistics { - WebCore::Cache::Statistics s = WebCore::cache()->getStatistics(); + WebCore::MemoryCache::Statistics s = WebCore::cache()->getStatistics(); return [NSArray arrayWithObjects: [NSDictionary dictionaryWithObjectsAndKeys: diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm index 067b8bb..4506f03 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm @@ -74,7 +74,8 @@ public: ~PluginDestroyDeferrer() { - m_proxy->didCallPluginFunction(); + bool stopped; + m_proxy->didCallPluginFunction(stopped); } private: diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 3081120..f784ade 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -153,7 +153,7 @@ public: void invalidate(); void willCallPluginFunction(); - void didCallPluginFunction(); + void didCallPluginFunction(bool& stopped); bool shouldStop(); uint32_t nextRequestID(); @@ -262,8 +262,14 @@ public: ASSERT(reply->m_type == T::ReplyType); m_waitingForReply = false; - - didCallPluginFunction(); + + bool stopped = false; + didCallPluginFunction(stopped); + if (stopped) { + // The instance proxy may have been deleted from didCallPluginFunction(), so a null reply needs to be returned. + delete static_cast<T*>(reply); + return std::auto_ptr<T>(); + } return std::auto_ptr<T>(static_cast<T*>(reply)); } diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index a2d4a96..ecaa0d6 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -1455,7 +1455,7 @@ void NetscapePluginInstanceProxy::willCallPluginFunction() m_pluginFunctionCallDepth++; } -void NetscapePluginInstanceProxy::didCallPluginFunction() +void NetscapePluginInstanceProxy::didCallPluginFunction(bool& stopped) { ASSERT(m_pluginFunctionCallDepth > 0); m_pluginFunctionCallDepth--; @@ -1465,6 +1465,7 @@ void NetscapePluginInstanceProxy::didCallPluginFunction() if (!m_pluginFunctionCallDepth && m_shouldStopSoon) { m_shouldStopSoon = false; [m_pluginView stop]; + stopped = true; } } diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm index 63a7b6a..362dd97 100644 --- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm +++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm @@ -380,9 +380,11 @@ extern "C" { - (void)pluginHostDied { - RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer()); - if (renderer) + if (_element->renderer() && _element->renderer()->isEmbeddedObject()) { + // FIXME: The renderer could also be a RenderApplet, we should handle that. + RenderEmbeddedObject* renderer = toRenderEmbeddedObject(_element->renderer()); renderer->setShowsCrashedPluginIndicator(); + } _pluginLayer = nil; _proxy = 0; diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 708b017..b6b8b64 100644 --- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -326,8 +326,6 @@ String WebHaltablePlugin::pluginName() const - (void)restartTimers { - ASSERT([self window]); - [self stopTimers]; if (!_isStarted || [[self window] isMiniaturized]) diff --git a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm index 3d2b68e..a3aca1f 100644 --- a/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm +++ b/WebKit/mac/Plugins/WebNetscapePluginEventHandlerCarbon.mm @@ -49,8 +49,6 @@ static void getCarbonEvent(EventRecord* carbonEvent) carbonEvent->when = TickCount(); GetGlobalMouse(&carbonEvent->where); - carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor()); - carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor()); carbonEvent->modifiers = GetCurrentKeyModifiers(); if (!Button()) carbonEvent->modifiers |= btnState; @@ -87,11 +85,8 @@ static EventModifiers modifiersForEvent(NSEvent *event) static void getCarbonEvent(EventRecord *carbonEvent, NSEvent *cocoaEvent) { - if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) { - carbonEvent->where.h = static_cast<short>(carbonEvent->where.h * HIGetScaleFactor()); - carbonEvent->where.v = static_cast<short>(carbonEvent->where.v * HIGetScaleFactor()); + if (WKConvertNSEventToCarbonEvent(carbonEvent, cocoaEvent)) return; - } NSPoint where = [[cocoaEvent window] convertBaseToScreen:[cocoaEvent locationInWindow]]; diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index 209c2b9..a5f49e3 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -54,6 +54,7 @@ public: virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); + virtual void focusedFrameChanged(WebCore::Frame*); virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); virtual void show(); @@ -178,6 +179,9 @@ public: virtual PassRefPtr<WebCore::PopupMenu> createPopupMenu(WebCore::PopupMenuClient*) const; virtual PassRefPtr<WebCore::SearchPopupMenu> createSearchPopupMenu(WebCore::PopupMenuClient*) const; +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif private: WebView *m_webView; }; diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 3610896..fe95989 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -200,6 +200,10 @@ void WebChromeClient::focusedNodeChanged(Node*) { } +void WebChromeClient::focusedFrameChanged(Frame*) +{ +} + Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) { NSURLRequest *URLRequest = nil; diff --git a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm index f0c624d..3a4d5d7 100644 --- a/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm +++ b/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm @@ -41,7 +41,7 @@ WebDeviceOrientationClient::WebDeviceOrientationClient(WebView* webView) void WebDeviceOrientationClient::setController(DeviceOrientationController* controller) { // This is called by the Page constructor before our WebView has the provider set up. - // Cache the controller for later use. + // MemoryCache the controller for later use. m_controller = controller; } diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.h b/WebKit/mac/WebCoreSupport/WebEditorClient.h index ad324b9..23cf312 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.h +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.h @@ -133,8 +133,8 @@ public: virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - virtual void showCorrectionPanel(const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*); - virtual void dismissCorrectionPanel(bool correctionAccepted); + virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const WTF::String& replacedString, const WTF::String& replacementString, WebCore::Editor*); + virtual void dismissCorrectionPanel(WebCore::CorrectionWasRejectedOrNot); virtual bool isShowingCorrectionPanel(); #endif private: @@ -146,6 +146,6 @@ private: bool m_haveUndoRedoOperations; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - NSInteger m_correctionPanelTag; + BOOL m_correctionPanelIsShown; #endif }; diff --git a/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/WebKit/mac/WebCoreSupport/WebEditorClient.mm index 2bf3259..39b511e 100644 --- a/WebKit/mac/WebCoreSupport/WebEditorClient.mm +++ b/WebKit/mac/WebCoreSupport/WebEditorClient.mm @@ -186,7 +186,7 @@ WebEditorClient::WebEditorClient(WebView *webView) , m_undoTarget([[[WebEditorUndoTarget alloc] init] autorelease]) , m_haveUndoRedoOperations(false) #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - , m_correctionPanelTag(InvalidCorrectionPanelTag) + , m_correctionPanelIsShown(false) #endif { } @@ -194,7 +194,7 @@ WebEditorClient::WebEditorClient(WebView *webView) WebEditorClient::~WebEditorClient() { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - dismissCorrectionPanel(true); + dismissCorrectionPanel(WebCore::CorrectionWasNotRejected); #endif } @@ -310,10 +310,6 @@ void WebEditorClient::respondToChangedSelection() { [m_webView _selectionChanged]; -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) - dismissCorrectionPanel(true); -#endif - // FIXME: This quirk is needed due to <rdar://problem/5009625> - We can phase it out once Aperture can adopt the new behavior on their end if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_APERTURE_QUIRK) && [[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.Aperture"]) return; @@ -860,8 +856,8 @@ void WebEditorClient::updateSpellingUIWithGrammarString(const String& badGrammar } #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -void WebEditorClient::showCorrectionPanel(const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, Editor* editor) { - dismissCorrectionPanel(true); +void WebEditorClient::showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType panelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, Editor* editor) { + dismissCorrectionPanel(WebCore::CorrectionWasNotRejected); NSRect boundingBoxAsNSRect = boundingBoxOfReplacedString; NSRect webViewFrame = m_webView.frame; @@ -871,25 +867,33 @@ void WebEditorClient::showCorrectionPanel(const FloatRect& boundingBoxOfReplaced NSString *replacedStringAsNSString = replacedString; NSString *replacementStringAsNSString = replacementString; - m_correctionPanelTag = [[NSSpellChecker sharedSpellChecker] showCorrection:replacementStringAsNSString forStringInRect:boundingBoxAsNSRect view:m_webView completionHandler:^(BOOL accepted) { - if (!accepted) { + m_correctionPanelIsShown = YES; + NSCorrectionBubbleType bubbleType = panelType == WebCore::CorrectionPanelInfo::PanelTypeCorrection ? NSCorrectionBubbleTypeCorrection : NSCorrectionBubbleTypeReversion; + [[NSSpellChecker sharedSpellChecker] showCorrectionBubbleOfType:bubbleType primaryString:replacementStringAsNSString alternativeStrings:nil forStringInRect:boundingBoxAsNSRect view:m_webView completionHandler:^(NSString *acceptedString) { + if (!acceptedString && bubbleType == NSCorrectionBubbleTypeCorrection) { [[NSSpellChecker sharedSpellChecker] recordResponse:NSCorrectionResponseRejected toCorrection:replacementStringAsNSString forWord:replacedStringAsNSString language:nil inSpellDocumentWithTag:[m_webView spellCheckerDocumentTag]]; editor->handleRejectedCorrection(); + } else if (acceptedString && bubbleType == NSCorrectionBubbleTypeReversion) { + [[NSSpellChecker sharedSpellChecker] recordResponse:NSCorrectionResponseReverted toCorrection:replacedStringAsNSString forWord:replacementStringAsNSString language:nil inSpellDocumentWithTag:[m_webView spellCheckerDocumentTag]]; + editor->handleRejectedCorrection(); } }]; } -void WebEditorClient::dismissCorrectionPanel(bool correctionAccepted) +void WebEditorClient::dismissCorrectionPanel(WebCore::CorrectionWasRejectedOrNot correctionWasRejectedOrNot) { - if (m_correctionPanelTag != InvalidCorrectionPanelTag) { - [[NSSpellChecker sharedSpellChecker] dismissCorrection:m_correctionPanelTag acceptCorrection:correctionAccepted]; - m_correctionPanelTag = InvalidCorrectionPanelTag; + if (isShowingCorrectionPanel()) { + if (correctionWasRejectedOrNot == CorrectionWasRejected) + [[NSSpellChecker sharedSpellChecker] cancelCorrectionBubbleForView:m_webView]; + else + [[NSSpellChecker sharedSpellChecker] dismissCorrectionBubbleForView:m_webView]; + m_correctionPanelIsShown = NO; } } bool WebEditorClient::isShowingCorrectionPanel() { - return m_correctionPanelTag != InvalidCorrectionPanelTag; + return m_correctionPanelIsShown; } #endif diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index 3053b49..7ca27c0 100644 --- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -1752,6 +1752,8 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& s [values addObject:[NSString stringWithFormat:@"%d", size.height()]]; } view = pluginView(m_webFrame.get(), (WebPluginPackage *)pluginPackage, names, values, baseURL, kit(element), NO); + if (view) + return adoptRef(new PluginWidget(view)); } #if ENABLE(NETSCAPE_PLUGIN_API) else if ([pluginPackage isKindOfClass:[WebNetscapePluginPackage class]]) { @@ -1764,6 +1766,8 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& s attributeValues:kit(paramValues) loadManually:NO element:element] autorelease]; + if (view) + return adoptRef(new NetscapePluginWidget(view)); } else { ASSERT_NOT_REACHED(); } @@ -1781,15 +1785,9 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& s } } - ASSERT(view); - return adoptRef(new PluginWidget(view)); - END_BLOCK_OBJC_EXCEPTIONS; - - return adoptRef(new PluginWidget); -#else - return 0; #endif // ENABLE(JAVA_BRIDGE) + return 0; } #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm index 9d8fd11..f95594a 100644 --- a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm +++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm @@ -660,7 +660,13 @@ String WebPlatformStrategies::unknownFileSizeText() String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) { +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + NSString *widthString = [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInt:size.width()] numberStyle:NSNumberFormatterDecimalStyle]; + NSString *heightString = [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInt:size.height()] numberStyle:NSNumberFormatterDecimalStyle]; + return [NSString localizedStringWithFormat:UI_STRING("%@ %@×%@ pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, widthString, heightString]; +#else return [NSString stringWithFormat:UI_STRING("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, size.width(), size.height()]; +#endif } String WebPlatformStrategies::mediaElementLoadingStateText() diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm index 4f8c1ba..fb6d69c 100644 --- a/WebKit/mac/WebView/WebFrame.mm +++ b/WebKit/mac/WebView/WebFrame.mm @@ -203,6 +203,8 @@ WebCore::EditingBehaviorType core(WebKitEditingBehavior behavior) return WebCore::EditingMacBehavior; case WebKitEditingWinBehavior: return WebCore::EditingWindowsBehavior; + case WebKitEditingUnixBehavior: + return WebCore::EditingUnixBehavior; } ASSERT_NOT_REACHED(); return WebCore::EditingMacBehavior; @@ -1134,12 +1136,8 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) Frame* frame = core(self); if (!frame) return; - - AnimationController* controller = frame->animation(); - if (!controller) - return; - - controller->suspendAnimations(frame->document()); + + frame->animation()->suspendAnimations(); } - (void) _resumeAnimations @@ -1148,11 +1146,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) if (!frame) return; - AnimationController* controller = frame->animation(); - if (!controller) - return; - - controller->resumeAnimations(frame->document()); + frame->animation()->resumeAnimations(); } - (void)_replaceSelectionWithFragment:(DOMDocumentFragment *)fragment selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle @@ -1406,7 +1400,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) Frame* coreFrame = _private->coreFrame; if (!coreFrame) return nil; - return coreFrame->tree()->name(); + return coreFrame->tree()->uniqueName(); } - (WebFrameView *)frameView diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h index 2ec08e8..2ee07d7 100644 --- a/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -45,7 +45,8 @@ typedef enum { typedef enum { WebKitEditingMacBehavior, - WebKitEditingWinBehavior + WebKitEditingWinBehavior, + WebKitEditingUnixBehavior } WebKitEditingBehavior; extern NSString *WebPreferencesChangedNotification; diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 7456898..49bb451 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -111,7 +111,7 @@ #import <WebCore/AbstractDatabase.h> #import <WebCore/ApplicationCacheStorage.h> #import <WebCore/BackForwardListImpl.h> -#import <WebCore/Cache.h> +#import <WebCore/MemoryCache.h> #import <WebCore/ColorMac.h> #import <WebCore/CSSComputedStyleDeclaration.h> #import <WebCore/Cursor.h> @@ -2611,9 +2611,9 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) Frame* frame = core([self mainFrame]); if (suspended) - frame->animation()->suspendAnimations(frame->document()); + frame->animation()->suspendAnimations(); else - frame->animation()->resumeAnimations(frame->document()); + frame->animation()->resumeAnimations(); } + (void)_setDomainRelaxationForbidden:(BOOL)forbidden forURLScheme:(NSString *)scheme diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index df28626..f026827 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -140,6 +140,7 @@ void QGraphicsWebViewPrivate::updateResizesToContentsForPage() QObject::disconnect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), q, SLOT(_q_contentsSizeChanged(const QSize&))); } + page->d->page->settings()->setShouldDelegateScrolling(resizesToContents); } void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size) @@ -411,6 +412,8 @@ void QGraphicsWebViewPrivate::detachCurrentPage() if (!page) return; + page->d->page->settings()->setShouldDelegateScrolling(false); + page->d->view.clear(); // The client has always to be deleted. diff --git a/WebKit/qt/Api/qwebelement.cpp b/WebKit/qt/Api/qwebelement.cpp index 68fa17a..8121111 100644 --- a/WebKit/qt/Api/qwebelement.cpp +++ b/WebKit/qt/Api/qwebelement.cpp @@ -311,6 +311,11 @@ void QWebElement::setOuterXml(const QString &markup) \note This is currently implemented for (X)HTML elements only. + \note The format of the markup returned will obey the namespace of the + document containing the element. This means the return value will obey XML + formatting rules, such as self-closing tags, only if the document is + 'text/xhtml+xml'. + \sa setOuterXml(), setInnerXml(), toInnerXml() */ QString QWebElement::toOuterXml() const @@ -345,6 +350,11 @@ void QWebElement::setInnerXml(const QString &markup) \note This is currently implemented for (X)HTML elements only. + \note The format of the markup returned will obey the namespace of the + document containing the element. This means the return value will obey XML + formatting rules, such as self-closing tags, only if the document is + 'text/xhtml+xml'. + \sa setInnerXml(), setOuterXml(), toOuterXml() */ QString QWebElement::toInnerXml() const diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 39e74d9..7d423d5 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -97,6 +97,7 @@ #include "runtime_root.h" #endif #if USE(TEXTURE_MAPPER) +#include "texmap/TextureMapper.h" #include "texmap/TextureMapperPlatformLayer.h" #endif #include "wtf/HashMap.h" @@ -294,19 +295,38 @@ void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, con painter->restore(); } -#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) - // TextureMapper might use raw OpenGL or some other backend that requires native painting. On raster this doesn't have any effect. - if (rootGraphicsLayer) { - painter->beginNativePainting(); - rootGraphicsLayer->paint(context, view->size(), view->frameRect(), IntRect(clip.boundingRect()), TransformationMatrix(), painter->opacity()); - painter->endNativePainting(); - } +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + renderCompositedLayers(context, IntRect(clip.boundingRect())); renderRelativeCoords(context, (QWebFrame::RenderLayer)(QWebFrame::ScrollBarLayer | QWebFrame::PanIconLayer), clip); #endif } #endif +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +void QWebFramePrivate::renderCompositedLayers(GraphicsContext* context, const IntRect& clip) +{ + if (!rootGraphicsLayer) + return; + + textureMapper->setGraphicsContext(context); + textureMapper->setImageInterpolationQuality(context->imageInterpolationQuality()); + textureMapper->setTextDrawingMode(context->textDrawingMode()); + QPainter* painter = context->platformContext(); + FrameView* view = frame->view(); + painter->save(); + painter->beginNativePainting(); + TextureMapperContentLayer::PaintOptions options; + options.visibleRect = clip; + options.targetRect = view->frameRect(); + options.viewportSize = view->size(); + options.opacity = painter->opacity(); + rootGraphicsLayer->paint(textureMapper.get(), options); + painter->endNativePainting(); + painter->restore(); +} +#endif + void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip) { if (!frame->view() || !frame->contentRenderer()) @@ -349,16 +369,8 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: context->restore(); } painter->restore(); - #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) - if (rootGraphicsLayer) { - painter->save(); - painter->beginNativePainting(); - rootGraphicsLayer->paint(context, view->size(), view->frameRect(), IntRect(clip.boundingRect()), - TransformationMatrix(), context->platformContext()->opacity()); - painter->endNativePainting(); - painter->restore(); - } + renderCompositedLayers(context, IntRect(clip.boundingRect())); #endif } if (layer & (QWebFrame::PanIconLayer | QWebFrame::ScrollBarLayer)) { @@ -758,7 +770,7 @@ QIcon QWebFrame::icon() const */ QString QWebFrame::frameName() const { - return d->frame->tree()->name(); + return d->frame->tree()->uniqueName(); } /*! diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h index 5660bd1..7c0d235 100644 --- a/WebKit/qt/Api/qwebframe_p.h +++ b/WebKit/qt/Api/qwebframe_p.h @@ -33,6 +33,10 @@ #include "Frame.h" #include "ViewportArguments.h" +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) +#include "texmap/TextureMapper.h" +#endif + namespace WebCore { class FrameLoaderClientQt; class FrameView; @@ -94,6 +98,9 @@ public: void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip); #endif +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + void renderCompositedLayers(WebCore::GraphicsContext* context, const WebCore::IntRect& clip); +#endif QWebFrame *q; Qt::ScrollBarPolicy horizontalScrollBarPolicy; Qt::ScrollBarPolicy verticalScrollBarPolicy; @@ -106,6 +113,7 @@ public: int marginHeight; #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) WebCore::TextureMapperContentLayer* rootGraphicsLayer; + OwnPtr<WebCore::TextureMapper> textureMapper; #endif bool zoomTextOnly; }; diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h index a851d56..2ceaac1 100644 --- a/WebKit/qt/Api/qwebkitplatformplugin.h +++ b/WebKit/qt/Api/qwebkitplatformplugin.h @@ -102,6 +102,19 @@ public: virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; }; +class QWebTouchModifier : public QObject +{ + Q_OBJECT +public: + virtual ~QWebTouchModifier() {} + + enum PaddingDirection { + Up, Right, Down, Left + }; + + virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; +}; + class QWebKitPlatformPlugin { public: @@ -110,13 +123,14 @@ public: enum Extension { MultipleSelections, Notifications, - Haptics + Haptics, + TouchInteraction }; virtual bool supportsExtension(Extension extension) const = 0; virtual QObject* createExtension(Extension extension) const = 0; }; -Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5"); +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6"); #endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index 40f41c5..a6ca65a 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -31,13 +31,17 @@ #include "qwebinspector.h" #include "qwebinspector_p.h" #include "qwebsettings.h" +#include "qwebkitplatformplugin.h" #include "qwebkitversion.h" +#include "CSSComputedStyleDeclaration.h" +#include "CSSParser.h" #include "ApplicationCacheStorage.h" #include "BackForwardListImpl.h" -#include "Cache.h" +#include "MemoryCache.h" #include "Chrome.h" #include "ChromeClientQt.h" +#include "ClientRect.h" #include "ContextMenu.h" #include "ContextMenuClientQt.h" #include "ContextMenuController.h" @@ -60,6 +64,7 @@ #include "FrameView.h" #include "GeolocationPermissionClientQt.h" #include "HTMLFormElement.h" +#include "HTMLFrameOwnerElement.h" #include "HTMLInputElement.h" #include "HTMLNames.h" #include "HashMap.h" @@ -74,7 +79,9 @@ #include "MIMETypeRegistry.h" #include "NavigationAction.h" #include "NetworkingContext.h" +#include "NodeList.h" #include "NotificationPresenterClientQt.h" +#include "NotImplemented.h" #include "Page.h" #include "PageClientQt.h" #include "PageGroup.h" @@ -86,6 +93,7 @@ #include "PluginDatabase.h" #include "PluginPackage.h" #include "ProgressTracker.h" +#include "QtPlatformPlugin.h" #include "RefPtr.h" #include "RenderTextControl.h" #include "SchemeRegistry.h" @@ -657,6 +665,7 @@ void QWebPagePrivate::mousePressEvent(T* ev) } bool accepted = false; + adjustPointForClicking(ev); PlatformMouseEvent mev(ev, 1); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) @@ -736,6 +745,7 @@ void QWebPagePrivate::mouseReleaseEvent(T *ev) return; bool accepted = false; + adjustPointForClicking(ev); PlatformMouseEvent mev(ev, 0); // ignore the event if we can't map Qt's mouse buttons to WebCore::MouseButton if (mev.button() != NoButton) @@ -1024,9 +1034,9 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) return; } - RenderObject* renderer = 0; + Node* node = 0; if (frame->selection()->rootEditableElement()) - renderer = frame->selection()->rootEditableElement()->shadowAncestorNode()->renderer(); + node = frame->selection()->rootEditableElement()->shadowAncestorNode(); Vector<CompositionUnderline> underlines; bool hasSelection = false; @@ -1054,8 +1064,8 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev) case QInputMethodEvent::Selection: { hasSelection = true; // A selection in the inputMethodEvent is always reflected in the visible text - if (renderer && renderer->node()) - setSelectionRange(renderer->node(), qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length))); + if (node) + setSelectionRange(node, qMin(a.start, (a.start + a.length)), qMax(a.start, (a.start + a.length))); if (!ev->preeditString().isEmpty()) { editor->setComposition(ev->preeditString(), underlines, @@ -1263,6 +1273,42 @@ bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame) return frame->eventHandler()->scrollRecursively(direction, granularity); } +void QWebPagePrivate::adjustPointForClicking(QMouseEvent*) +{ + notImplemented(); +} + +void QWebPagePrivate::adjustPointForClicking(QGraphicsSceneMouseEvent* ev) +{ + QtPlatformPlugin platformPlugin; + QWebTouchModifier* touchModifier = platformPlugin.createTouchModifier(); + if (!touchModifier) + return; + + unsigned topPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Up); + unsigned rightPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Right); + unsigned bottomPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Down); + unsigned leftPadding = touchModifier->hitTestPaddingForTouch(QWebTouchModifier::Left); + + delete touchModifier; + touchModifier = 0; + + if (!topPadding && !rightPadding && !bottomPadding && !leftPadding) + return; + + Document* startingDocument = page->mainFrame()->document(); + if (!startingDocument) + return; + + IntPoint originalPoint(QPointF(ev->pos()).toPoint()); + TouchAdjuster touchAdjuster(topPadding, rightPadding, bottomPadding, leftPadding); + IntPoint adjustedPoint = touchAdjuster.findCandidatePointForTouch(originalPoint, startingDocument); + if (adjustedPoint == IntPoint::zero()) + return; + + ev->setPos(QPointF(adjustedPoint)); +} + bool QWebPagePrivate::touchEvent(QTouchEvent* event) { WebCore::Frame* frame = QWebFramePrivate::core(mainFrame); @@ -1319,14 +1365,11 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const return QVariant(QFont()); } case Qt::ImCursorPosition: { - if (renderTextControl) { - if (editor->hasComposition()) { - RefPtr<Range> range = editor->compositionRange(); - return QVariant(renderTextControl->selectionEnd() - TextIterator::rangeLength(range.get())); - } - return QVariant(frame->selection()->extent().offsetInContainerNode()); + if (editor->hasComposition()) { + RefPtr<Range> range = editor->compositionRange(); + return QVariant(frame->selection()->end().offsetInContainerNode() - TextIterator::rangeLength(range.get())); } - return QVariant(); + return QVariant(frame->selection()->extent().offsetInContainerNode()); } case Qt::ImSurroundingText: { if (renderTextControl) { @@ -1340,23 +1383,20 @@ QVariant QWebPage::inputMethodQuery(Qt::InputMethodQuery property) const } case Qt::ImCurrentSelection: { if (renderTextControl) { - int start = renderTextControl->selectionStart(); - int end = renderTextControl->selectionEnd(); + int start = frame->selection()->start().offsetInContainerNode(); + int end = frame->selection()->end().offsetInContainerNode(); if (end > start) - return QVariant(QString(renderTextControl->text()).mid(start,end-start)); + return QVariant(QString(renderTextControl->text()).mid(start, end - start)); } return QVariant(); } case Qt::ImAnchorPosition: { - if (renderTextControl) { - if (editor->hasComposition()) { - RefPtr<Range> range = editor->compositionRange(); - return QVariant(renderTextControl->selectionStart() - TextIterator::rangeLength(range.get())); - } - return QVariant(frame->selection()->base().offsetInContainerNode()); + if (editor->hasComposition()) { + RefPtr<Range> range = editor->compositionRange(); + return QVariant(frame->selection()->start().offsetInContainerNode() - TextIterator::rangeLength(range.get())); } - return QVariant(); + return QVariant(frame->selection()->base().offsetInContainerNode()); } case Qt::ImMaximumTextLength: { if (frame->selection()->isContentEditable()) { @@ -1435,6 +1475,124 @@ quint16 QWebPagePrivate::inspectorServerPort() return 0; } +static bool hasMouseListener(Element* element) +{ + ASSERT(element); + return element->hasEventListeners(eventNames().clickEvent) + || element->hasEventListeners(eventNames().mousedownEvent) + || element->hasEventListeners(eventNames().mouseupEvent); +} + +static bool isClickableElement(Element* element, RefPtr<NodeList> list) +{ + ASSERT(element); + bool isClickable = hasMouseListener(element); + if (!isClickable && list) { + Element* parent = element->parentElement(); + unsigned count = list->length(); + for (unsigned i = 0; i < count && parent; i++) { + if (list->item(i) != parent) + continue; + + isClickable = hasMouseListener(parent); + if (isClickable) + break; + + parent = parent->parentElement(); + } + } + + ExceptionCode ec = 0; + return isClickable + || element->webkitMatchesSelector("a,*:link,*:visited,*[role=button],button,input,select,label", ec) + || computedStyle(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer"; +} + +static bool isValidFrameOwner(Element* element) +{ + ASSERT(element); + return element->isFrameOwnerElement() && static_cast<HTMLFrameOwnerElement*>(element)->contentFrame(); +} + +static Element* nodeToElement(Node* node) +{ + if (node && node->isElementNode()) + return static_cast<Element*>(node); + return 0; +} + +QWebPagePrivate::TouchAdjuster::TouchAdjuster(unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding) + : m_topPadding(topPadding) + , m_rightPadding(rightPadding) + , m_bottomPadding(bottomPadding) + , m_leftPadding(leftPadding) +{ +} + +IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoint& touchPoint, Document* document) const +{ + if (!document) + return IntPoint(); + + int x = touchPoint.x(); + int y = touchPoint.y(); + + RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding, false); + if (!intersectedNodes) + return IntPoint(); + + Element* closestClickableElement = 0; + IntRect largestIntersectionRect; + FrameView* view = document->frame()->view(); + + // Touch rect in contents coordinates. + IntRect touchRect(HitTestResult::rectForPoint(view->windowToContents(IntPoint(x, y)), m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding)); + + // Iterate over the list of nodes hit looking for the one whose bounding area + // has largest intersection with the touch area (point + padding). + for (unsigned i = 0; i < intersectedNodes->length(); i++) { + Node* currentNode = intersectedNodes->item(i); + + Element* currentElement = nodeToElement(currentNode); + if (!currentElement || (!isClickableElement(currentElement, 0) && !isValidFrameOwner(currentElement))) + continue; + + IntRect currentElementBoundingRect = currentElement->getRect(); + currentElementBoundingRect.intersect(touchRect); + + if (currentElementBoundingRect.isEmpty()) + continue; + + int currentIntersectionRectArea = currentElementBoundingRect.width() * currentElementBoundingRect.height(); + int largestIntersectionRectArea = largestIntersectionRect.width() * largestIntersectionRect.height(); + if (currentIntersectionRectArea > largestIntersectionRectArea) { + closestClickableElement = currentElement; + largestIntersectionRect = currentElementBoundingRect; + } + } + + if (largestIntersectionRect.isEmpty()) + return IntPoint(); + + // Handle the case when user taps a inner frame. It is done in three steps: + // 1) Transform the original touch point to the inner document coordinates; + // 1) Call nodesFromRect for the inner document in case; + // 3) Re-add the inner frame offset (location) before passing the new clicking + // position to WebCore. + if (closestClickableElement->isFrameOwnerElement()) { + // Adjust client coordinates' origin to be top left of inner frame viewport. + PassRefPtr<ClientRect> rect = closestClickableElement->getBoundingClientRect(); + IntPoint newTouchPoint = touchPoint; + IntSize offset = IntSize(rect->left(), rect->top()); + newTouchPoint -= offset; + + HTMLFrameOwnerElement* owner = static_cast<HTMLFrameOwnerElement*>(closestClickableElement); + Document* childDocument = owner->contentFrame()->document(); + return findCandidatePointForTouch(newTouchPoint, childDocument); + } + return view->contentsToWindow(largestIntersectionRect).center(); +} + /*! \enum QWebPage::FindFlag @@ -2424,7 +2582,10 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest & QString QWebPage::selectedText() const { d->createMainFrame(); - return d->page->focusController()->focusedOrMainFrame()->editor()->selectedText(); + WebCore::Frame* frame = d->page->focusController()->focusedOrMainFrame(); + if (frame->selection()->selection().selectionType() == VisibleSelection::NoSelection) + return QString(); + return frame->editor()->selectedText(); } #ifndef QT_NO_ACTION diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h index 1f70293..1b9cd66 100644 --- a/WebKit/qt/Api/qwebpage_p.h +++ b/WebKit/qt/Api/qwebpage_p.h @@ -31,6 +31,7 @@ #include "qwebhistory.h" #include "qwebframe.h" +#include "IntPoint.h" #include "KURL.h" #include "PlatformString.h" @@ -43,10 +44,13 @@ namespace WebCore { class ContextMenuClientQt; class ContextMenuItem; class ContextMenu; + class Document; class EditorClientQt; class Element; class InspectorController; + class IntRect; class Node; + class NodeList; class Page; class Frame; } @@ -126,6 +130,22 @@ public: // Returns whether the default action was cancelled in the JS event handler bool touchEvent(QTouchEvent*); + class TouchAdjuster { + public: + TouchAdjuster(unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding); + + WebCore::IntPoint findCandidatePointForTouch(const WebCore::IntPoint&, WebCore::Document*) const; + + private: + unsigned m_topPadding; + unsigned m_rightPadding; + unsigned m_bottomPadding; + unsigned m_leftPadding; + }; + + void adjustPointForClicking(QMouseEvent*); + void adjustPointForClicking(QGraphicsSceneMouseEvent*); + void setInspector(QWebInspector*); QWebInspector* getOrCreateInspector(); WebCore::InspectorController* inspectorController(); diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp index 3cd36f2..ed425c2 100644 --- a/WebKit/qt/Api/qwebsettings.cpp +++ b/WebKit/qt/Api/qwebsettings.cpp @@ -25,7 +25,7 @@ #include "qwebplugindatabase_p.h" #include "AbstractDatabase.h" -#include "Cache.h" +#include "MemoryCache.h" #include "CrossOriginPreflightResultCache.h" #include "FontCache.h" #include "Page.h" diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index 98d6d45..fdfa41f 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,313 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::focusedNodeChanged): Removed unneeded namespace prefix. + (WebCore::ChromeClientQt::focusedFrameChanged): + * WebCoreSupport/ChromeClientQt.h: + +2010-11-08 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + Reorganized the textureMapper to be a member of QWebFramePrivate, to help with making + TextureMapper thread-safe. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderCompositedLayers): + * Api/qwebframe_p.h: + * WebCoreSupport/PageClientQt.cpp: + (WebCore::PlatformLayerProxyQt::setTextureMapper): + (WebCore::PlatformLayerProxyQt::textureMapper): + (WebCore::PlatformLayerProxyQWidget::PlatformLayerProxyQWidget): + (WebCore::PlatformLayerProxyQGraphicsObject::PlatformLayerProxyQGraphicsObject): + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * Api/qwebpage.cpp: + * Api/qwebsettings.cpp: + +2010-11-07 Chang Shu <chang.shu@nokia.com> + + Reviewed by Antonio Gomes. + + Add a helper function to avoid duplicated code. + https://bugs.webkit.org/show_bug.cgi?id=49085 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::suspendAnimations): + (DumpRenderTreeSupportQt::resumeAnimations): + +2010-11-03 Antonio Gomes <tonikitoo@webkit.org>, Andre Pedralho <andre.pedralho@gmail.com> + + Reviewed by Kenneth Rohde Christiansen and Antti Koivisto. + + [Qt] Making effective use of nodesFromRect. + https://bugs.webkit.org/show_bug.cgi?id=44089 + + Patch adds a helper class (named TouchAdjuster) to improve tap actions + on mobile touch devices. TouchAdjuster makes use of the newly added rect + based hit test extension through the Document::nodesFromRect method. + Given a rectangle as input, nodesFromRect returns a z-index ordered list + of nodes whose boundaries intersect the rectangle. + + Basically the TouchAdjuster class intercepts the QGraphicsSceneMouseEvent + passed to both QWebPagePrivate::mouse{Press,Release}Event methods before + they are passed down to WebCore. The goal is to infer the target click position. + For that, a rectangle is built up using the event position as a center point and + expanding it based on the values and directions set in the Platform Plugin + QWebTouchModifier::hitTestPadding. + + TouchAdjuster iterates over the list of nodes returned by nodesFromRect and + picks the clickable one that has the largest intersection area with the hit + test rectangle. The target position is then the center point of this intersection + area. + + In case of no clickable node intersects the hit test area, the click position + is not altered. + + TouchAdjuster is *only* working for QGraphicsWebView based views. + + * Api/qwebpage.cpp: + (QWebPagePrivate::mousePressEvent): + (QWebPagePrivate::mouseReleaseEvent): + (QWebPagePrivate::adjustPointForClicking): + (QWebPagePrivate::TouchAdjuster::TouchAdjuster): + (QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch): + (isClickableElement): + (hasMouseListener): + (isValidFrameOwner): + (nodeToElement): + * Api/qwebpage_p.h: + +2010-10-20 Chang Shu <chang.shu@nokia.com>, Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Simon Fraser. + + [Qt] Makes <input type=text> and <textarea> functional with + Spatial Navigation enabled. Before this patch, the focus cannot + move away from input box once it is in. This patch allows focus + move to neighbor nodes when the caret reaches the edge of the texts. + This patch does not support yet cases where the focused <input> + has a JS handler for the arrow keys. + https://bugs.webkit.org/show_bug.cgi?id=37153 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-11-04 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by David Hyatt. + + Delegate scrolling via a separate method + https://bugs.webkit.org/show_bug.cgi?id=48988 + + Implement delegatedScrollRequested and make it emit the + scrollRequested signal for Qt. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::delegatedScrollRequested): + * WebCoreSupport/ChromeClientQt.h: + +2010-11-04 Robert Hogan <robert@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] Clarify expected return values of innerXml(), outerXml() + + If you put HTML in (e.g. using setHTML()) you will get HTML out, + even if you marked it up as XML. + + https://bugs.webkit.org/show_bug.cgi?id=44876 + + * Api/qwebelement.cpp: + +2010-11-03 Andre Pedralho <andre.pedralho@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + Using the Platform Plugin to define the default values for the padding of HitTestResult. + https://bugs.webkit.org/show_bug.cgi?id=48450 + + * Api/qwebkitplatformplugin.h: + (QWebTouchModifier::~QWebTouchModifier): + * WebCoreSupport/QtPlatformPlugin.cpp: + (WebCore::QtPlatformPlugin::createTouchModifier): + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + (TouchModifier::hitTestPaddingForTouch): + * examples/platformplugin/qwebkitplatformplugin.h: + (QWebTouchModifier::~QWebTouchModifier): + +2010-11-03 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QGWV: Keep the scrolling delegation intact when switching pages + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::updateResizesToContentsForPage): Turn on/off + scrolling delegation depending on the resizeToContents mode. + (QGraphicsWebViewPrivate::detachCurrentPage): Turn off scrolling delegation. + (QGraphicsWebView::setResizesToContents): + +2010-11-03 Kenneth Rohde Christiansen <kenneth@webkit.org> + + Reviewed by Andreas Kling. + + Make it possible to delegate scrolling to the UI + https://bugs.webkit.org/show_bug.cgi?id=48907 + + Enable scrolling delegation when setResizesToContents is active. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebView::setResizesToContents): + +2010-11-03 Daniel Bates <dbates@rim.com> + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the Qt port. + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + +2010-11-02 Noam Rosenthal <noam.rosenthal@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + Some refactor for texmap to enable WebKit2: remove globals, and allow TextureMapper to exist without a GraphicsContext. + This will allow rendering the TextureMapperNode tree without an active QPainter, into the current GL context. + Most of the changes simply move the globas in TextureMapperGL into members of that class. + + [Texmap] [Qt] Texture mapper initial implementation + https://bugs.webkit.org/show_bug.cgi?id=47070 + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderFromTiledBackingStore): + (QWebFramePrivate::renderCompositedLayers): + (QWebFramePrivate::renderRelativeCoords): + * Api/qwebframe_p.h: + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::showContextMenu): + +2010-10-31 Robert Hogan <robert@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] Support nodesFromRect in DRT + + https://bugs.webkit.org/show_bug.cgi?id=48716 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::nodesFromRect): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-10-31 Andreas Kling <kling@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Short-circuit QWebPage::selectedText() if frame has no selection + https://bugs.webkit.org/show_bug.cgi?id=48736 + + Do an early return if the selection is empty. + + No new tests, this is covered by tst_QWebPage::findText(). + + * Api/qwebpage.cpp: + (QWebPage::selectedText): + +2010-10-30 Andreas Kling <kling@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] IM: Don't manipulate selection via RenderTextControl + https://bugs.webkit.org/show_bug.cgi?id=48700 + + Go directly through the Frame's SelectionController instead. + + No new tests, this is covered by tst_QWebPage::inputMethods. + + * Api/qwebpage.cpp: + (QWebPagePrivate::inputMethodEvent): + (QWebPage::inputMethodQuery): + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Adding support to Qt's DRTSupport class to test the newly introduced Unix editing behavior. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setEditingBehavior): + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified Qt-port to use FrameTree::uniqueName(). + + * Api/qwebframe.cpp: + (QWebFrame::frameName): + 2010-10-29 Andreas Kling <kling@webkit.org> Reviewed by Ariya Hidayat. diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index f0d3903..3fec1d3 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -165,10 +165,13 @@ void ChromeClientQt::takeFocus(FocusDirection) } -void ChromeClientQt::focusedNodeChanged(WebCore::Node*) +void ChromeClientQt::focusedNodeChanged(Node*) { } +void ChromeClientQt::focusedFrameChanged(Frame*) +{ +} Page* ChromeClientQt::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) { @@ -412,6 +415,13 @@ void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, emit m_webPage->scrollRequested(delta.width(), delta.height(), scrollViewRect); } +#if ENABLE(TILED_BACKING_STORE) +void ChromeClientQt::delegatedScrollRequested(const IntSize& delta) +{ + emit m_webPage->scrollRequested(delta.width(), delta.height(), QRect(QPoint(0, 0), m_webPage->viewportSize())); +} +#endif + IntRect ChromeClientQt::windowToScreen(const IntRect& rect) const { QWebPageClient* pageClient = platformPageClient(); diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h index bbd2452..b8bc72d 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -72,6 +72,7 @@ namespace WebCore { virtual void takeFocus(FocusDirection); virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); virtual void show(); @@ -115,6 +116,9 @@ namespace WebCore { virtual void invalidateContentsAndWindow(const IntRect&, bool); virtual void invalidateContentsForSlowScroll(const IntRect&, bool); virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); +#if ENABLE(TILED_BACKING_STORE) + virtual void delegatedScrollRequested(const IntSize& scrollDelta); +#endif virtual IntPoint screenToWindow(const IntPoint&) const; virtual IntRect windowToScreen(const IntRect&) const; @@ -134,6 +138,9 @@ namespace WebCore { virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif #if ENABLE(NOTIFICATIONS) virtual NotificationPresenter* notificationPresenter() const; diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index 4309e5c..f5fa06b 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -47,6 +47,7 @@ #include "HistoryItem.h" #include "HTMLInputElement.h" #include "InspectorController.h" +#include "NodeList.h" #include "NotificationPresenterClientQt.h" #include "Page.h" #include "PageGroup.h" @@ -278,7 +279,7 @@ void DumpRenderTreeSupportQt::suspendAnimations(QWebFrame *frame) if (!controller) return; - controller->suspendAnimations(coreFrame->document()); + controller->suspendAnimations(); } void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) @@ -291,7 +292,7 @@ void DumpRenderTreeSupportQt::resumeAnimations(QWebFrame *frame) if (!controller) return; - controller->resumeAnimations(coreFrame->document()); + controller->resumeAnimations(); } void DumpRenderTreeSupportQt::clearFrameName(QWebFrame* frame) @@ -544,6 +545,8 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& coreEditingBehavior = EditingWindowsBehavior; else if (editingBehavior == "mac") coreEditingBehavior = EditingMacBehavior; + else if (editingBehavior == "unix") + coreEditingBehavior = EditingUnixBehavior; else { ASSERT_NOT_REACHED(); return; @@ -778,6 +781,26 @@ QString DumpRenderTreeSupportQt::plainText(const QVariant& range) return map.value("innerText").toString(); } +QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping) +{ + QVariantList res; + WebCore::Element* webElement = document.m_element; + if (!webElement) + return res; + + Document* doc = webElement->document(); + if (!doc) + return res; + RefPtr<NodeList> nodes = doc->nodesFromRect(x, y, top, right, bottom, left, ignoreClipping); + for (int i = 0; i < nodes->length(); i++) { + QVariant v; + // QWebElement will be null if the Node is not an HTML Element + v.setValue(QWebElement(nodes->item(i))); + res << v; + } + return res; +} + // Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame) diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h index 356b226..82d9319 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -133,6 +133,8 @@ public: static void addUserStyleSheet(QWebPage* page, const QString& sourceCode); static void simulateDesktopNotificationClick(const QString& title); static QString viewportAsText(QWebPage*, const QSize&); + + static QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping); }; #endif diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 2dd3b37..91a0cc6 100644 --- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -46,6 +46,7 @@ #include "PlatformKeyboardEvent.h" #include "QWebPageClient.h" #include "Range.h" +#include "Settings.h" #include "WindowsKeyboardCodes.h" #include "qwebpage.h" #include "qwebpage_p.h" @@ -360,9 +361,21 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) // FIXME: refactor all of this to use Actions or something like them if (start->isContentEditable()) { + bool doSpatialNavigation = false; + if (isSpatialNavigationEnabled(frame)) { + if (!kevent->modifiers()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_LEFT: + case VK_RIGHT: + case VK_UP: + case VK_DOWN: + doSpatialNavigation = true; + } + } + } #ifndef QT_NO_SHORTCUT QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent()); - if (action != QWebPage::NoWebAction) { + if (action != QWebPage::NoWebAction && !doSpatialNavigation) { const char* cmd = QWebPagePrivate::editorCommandForWebActions(action); // WebKit doesn't have enough information about mode to decide how commands that just insert text if executed via Editor should be treated, // so we leave it upon WebCore to either handle them immediately (e.g. Tab that changes focus) or let a keypress event be generated @@ -386,26 +399,26 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) case VK_LEFT: if (kevent->shiftKey()) frame->editor()->command("MoveLeftAndModifySelection").execute(); - else - frame->editor()->command("MoveLeft").execute(); + else if (!frame->editor()->command("MoveLeft").execute()) + return; break; case VK_RIGHT: if (kevent->shiftKey()) frame->editor()->command("MoveRightAndModifySelection").execute(); - else - frame->editor()->command("MoveRight").execute(); + else if (!frame->editor()->command("MoveRight").execute()) + return; break; case VK_UP: if (kevent->shiftKey()) frame->editor()->command("MoveUpAndModifySelection").execute(); - else - frame->editor()->command("MoveUp").execute(); + else if (!frame->editor()->command("MoveUp").execute()) + return; break; case VK_DOWN: if (kevent->shiftKey()) frame->editor()->command("MoveDownAndModifySelection").execute(); - else - frame->editor()->command("MoveDown").execute(); + else if (!frame->editor()->command("MoveDown").execute()) + return; break; case VK_PRIOR: // PageUp if (kevent->shiftKey()) diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp index 4d42c39..9fa5bf7 100644 --- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp @@ -21,15 +21,19 @@ #include "config.h" #include "PageClientQt.h" +#include "TextureMapperQt.h" #include "texmap/TextureMapperPlatformLayer.h" - +#include <QGraphicsScene> +#include <QGraphicsView> #if defined(Q_WS_X11) #include <QX11Info> #endif #ifdef QT_OPENGL_LIB +#include "opengl/TextureMapperGL.h" #include <QGLWidget> #endif + namespace WebCore { #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) @@ -45,6 +49,11 @@ public: m_frame->d->rootGraphicsLayer = m_layer; } + void setTextureMapper(PassOwnPtr<TextureMapper> textureMapper) + { + m_frame->d->textureMapper = textureMapper; + } + virtual ~PlatformLayerProxyQt() { if (m_layer) @@ -53,6 +62,11 @@ public: m_frame->d->rootGraphicsLayer = 0; } + virtual TextureMapper* textureMapper() + { + return m_frame->d->textureMapper.get(); + } + // Since we just paint the composited tree and never create a special item for it, we don't have to handle its size changes. void setSizeChanged(const IntSize&) { } @@ -69,6 +83,11 @@ public: { if (m_widget) m_widget->installEventFilter(this); + + if (textureMapper()) + return; + + setTextureMapper(TextureMapperQt::create()); } // We don't want a huge region-clip on the compositing layers; instead we unite the rectangles together @@ -103,6 +122,17 @@ public: : PlatformLayerProxyQt(frame, layer, object) , m_graphicsItem(object) { + if (textureMapper()) + return; + +#ifdef QT_OPENGL_LIB + QGraphicsView* view = object->scene()->views()[0]; + if (view && view->viewport() && view->viewport()->inherits("QGLWidget")) { + setTextureMapper(TextureMapperGL::create()); + return; + } +#endif + setTextureMapper(TextureMapperQt::create()); } void setNeedsDisplay() diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp index 9786967..ede8a73 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -107,4 +107,10 @@ QWebHapticFeedbackPlayer* QtPlatformPlugin::createHapticFeedbackPlayer() return p ? static_cast<QWebHapticFeedbackPlayer*>(p->createExtension(QWebKitPlatformPlugin::Haptics)) : 0; } +QWebTouchModifier* QtPlatformPlugin::createTouchModifier() +{ + QWebKitPlatformPlugin* p = plugin(); + return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0; +} + } diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h index a3e50c2..ef14a1f 100644 --- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h +++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -28,6 +28,7 @@ class QWebKitPlatformPlugin; class QWebNotificationPresenter; class QWebHapticFeedbackPlayer; class QWebSelectData; +class QWebTouchModifier; namespace WebCore { @@ -39,6 +40,7 @@ public: QWebSelectMethod* createSelectInputMethod(); QWebNotificationPresenter* createNotificationPresenter(); QWebHapticFeedbackPlayer* createHapticFeedbackPlayer(); + QWebTouchModifier* createTouchModifier(); QWebKitPlatformPlugin* plugin(); diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp index 23b938e..d029b73 100644 --- a/WebKit/qt/examples/platformplugin/WebPlugin.cpp +++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp @@ -217,6 +217,8 @@ bool WebPlugin::supportsExtension(Extension extension) const case Notifications: return true; #endif + case TouchInteraction: + return true; default: return false; } @@ -231,6 +233,8 @@ QObject* WebPlugin::createExtension(Extension extension) const case Notifications: return new WebNotificationPresenter(); #endif + case TouchInteraction: + return new TouchModifier(); default: return 0; } diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.h b/WebKit/qt/examples/platformplugin/WebPlugin.h index 3df345f..0243f57 100644 --- a/WebKit/qt/examples/platformplugin/WebPlugin.h +++ b/WebKit/qt/examples/platformplugin/WebPlugin.h @@ -82,6 +82,18 @@ private: Popup* createMultipleSelectionPopup(const QWebSelectData& data); }; +class TouchModifier : public QWebTouchModifier +{ + Q_OBJECT +public: + unsigned hitTestPaddingForTouch(const PaddingDirection direction) const { + // Use 10 as padding in each direction but Up. + if (direction == QWebTouchModifier::Up) + return 15; + return 10; + } +}; + class WebPlugin : public QObject, public QWebKitPlatformPlugin { Q_OBJECT diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h index faa6989..f38a8fb 100644 --- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h +++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -98,6 +98,19 @@ public: virtual void playHapticFeedback(const HapticEvent, const QString& hapticType, const HapticStrength) = 0; }; +class QWebTouchModifier : public QObject +{ + Q_OBJECT +public: + virtual ~QWebTouchModifier() {} + + enum PaddingDirection { + Up, Right, Down, Left + }; + + virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; +}; + class QWebKitPlatformPlugin { public: @@ -106,13 +119,14 @@ public: enum Extension { MultipleSelections, Notifications, - Haptics + Haptics, + TouchInteraction }; virtual bool supportsExtension(Extension extension) const = 0; virtual QObject* createExtension(Extension extension) const = 0; }; -Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.5"); +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.6"); #endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index fb8f19e..e816b34 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,213 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Windows build fix. + + * WebCoreSupport/WebChromeClient.h: Added namespace prefix. + +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/WebChromeClient.cpp: + (WebChromeClient::focusedFrameChanged): + * WebCoreSupport/WebChromeClient.h: + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * WebCache.cpp: + (WebCache::statistics): + * WebFrame.cpp: + * WebView.cpp: + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Move resumeAnimations/suspendAnimations from Frame to AnimationController. + https://bugs.webkit.org/show_bug.cgi?id=49073 + + * WebFrame.cpp: + (WebFrame::suspendAnimations): + (WebFrame::resumeAnimations): + +2010-11-05 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Anders Carlsson. + + Assertion failure in PluginStream::~PluginStream when running userscripts/user-script-plugin-document.html + https://bugs.webkit.org/show_bug.cgi?id=48751 + <rdar://problem/8615536> + + Always call committedLoad in WebFrameLoaderClient::finishedLoading, even if we have a manual loader. We were + running into a case where we were trying to load an empty plugin document, which uses a manual loader, and + PluginStream::didFinishLoading was never being called. The stream was never being stopped, making us fire + an assert in the PluginStream destructor. + + * WebCoreSupport/WebFrameLoaderClient.cpp: + (WebFrameLoaderClient::finishedLoading): + +2010-11-05 Chris Marrin <cmarrin@apple.com> + + Reviewed by Simon Fraser. + + Make suspendAnimations/resumeAnimations and setCSSAnimations traverse through subframes and remember state + https://bugs.webkit.org/show_bug.cgi?id=46945 + + * WebFrame.cpp: + (WebFrame::suspendAnimations): + (WebFrame::resumeAnimations): + +2010-11-05 Patrick Gansterer <paroga@webkit.org> + + Reviewed by David Kilzer. + + Replace ARRAYSIZE with WTF_ARRAY_LENGTH + https://bugs.webkit.org/show_bug.cgi?id=48903 + + * WebCoreSupport/WebChromeClient.cpp: + (WebChromeClient::exceededDatabaseQuota): + * WebKitDLL.cpp: + (DllGetClassObject): + * WebView.cpp: + (WebView::mouseWheel): + +2010-11-02 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Part 1 of 2. + + Substitute FrameTree::uniqueName() for FrameTree::name() in the Apple Windows port. + + * WebFrame.cpp: + (WebFrame::name): + +2010-11-02 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/8346191> and https://bugs.webkit.org/show_bug.cgi?id=48868 + Implement IMutableWebRequest::setTimeoutInterval + + * WebMutableURLRequest.cpp: + (WebMutableURLRequest::setTimeoutInterval): + +2010-11-02 Daniel Bates <dbates@rim.com> + + Reviewed by Martin Robinson. + + Set frame name before appending it to the frame tree in the Apple Windows, + GTK, and EFL ports + https://bugs.webkit.org/show_bug.cgi?id=48806 + + Make the frame creation process in the Apple Windows-port consistent + with the Mac, Qt, and Haiku ports. In particular, set the name of + the new frame before it's appended to the frame tree. + + At this time we cannot test this change since it is being masked by + HTMLFrameElementBase::setName() <http://trac.webkit.org/browser/trunk/WebCore/html/HTMLFrameElementBase.cpp?rev=70976#L160>. + We'll be able to test this once we fix bug #6751. + + * WebCoreSupport/WebFrameLoaderClient.cpp: + (WebFrameLoaderClient::createFrame): + +2010-11-01 Jenn Braithwaite <jennb@chromium.org> + + Reviewed by Adam Roben. + + Windows: Update resource tracking when moving a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=48364 + + * Interfaces/IWebResourceLoadDelegatePrivate2.idl:Added + Added removeIdentifierForRequest. + * Interfaces/WebKit.idl: + Added IWebResourceLoadDelegatePrivate2.idl. + * WebCoreSupport/WebFrameLoaderClient.cpp: + (WebFrameLoaderClient::transferLoadingResourceFromPage): + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::showContextMenu): + +2010-11-01 Adam Roben <aroben@apple.com> + + Cancel main resource loads after we hand them off to the media engine + + This is the Windows equivalent of r51104. Clearly this code should be + moved to a cross-platform location someday. + + Fixes <http://webkit.org/b/48531> <rdar://problem/8606635> Assertion + failure in DocumentLoader::commitData when loading a media document in + WebKit1 on Windows + + Reviewed by Dan Bernstein. + + * WebCoreSupport/WebFrameLoaderClient.cpp: + (WebFrameLoaderClient::committedLoad): Cancel the main resource load + after handing off the load to the media engine. This code originally + came from -[WebHTMLRepresentation receivedData:withDataSource:]. + + * WebFrame.cpp: + (WebFrame::shouldFallBack): Don't fall back when handing the resource + load off to the media engine or a plugin. Added error domain checking + so that we don't rely on error codes being unique. + +2010-10-29 Daniel Bates <dbates@rim.com> + + No review, rolling out 70971. + http://trac.webkit.org/changeset/70971 + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Rolling out changeset 70971 <http://trac.webkit.org/changeset/70971> since + it caused layout test failures on all bots. In particular, the + child count in a generated frame name differs after this patch. We need + to look into this further. + + * WebFrame.cpp: + (WebFrame::name): + +2010-10-28 Antonio Gomes <agomes@rim.com> + + Reviewed by Ojan Vafai. + + Needs a "LinuxEditingBehavior", perhaps with a better name + https://bugs.webkit.org/show_bug.cgi?id=36627 + + Added the corresponding GTK+ setting to WebCore's EditingUnixBehavior: WebKitEditingUnixBehavior. + + * Interfaces/IWebPreferences.idl: + +2010-10-29 Daniel Bates <dbates@rim.com> + + Reviewed by Adam Barth. + + For unnamed frames, window.name returns a generated name + https://bugs.webkit.org/show_bug.cgi?id=6751 + + Modified Apple Windows-port to use FrameTree::uniqueName(). + + * WebFrame.cpp: + (WebFrame::name): + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/win/Interfaces/IWebPreferences.idl b/WebKit/win/Interfaces/IWebPreferences.idl index 4fb3de8..dd7f282 100644 --- a/WebKit/win/Interfaces/IWebPreferences.idl +++ b/WebKit/win/Interfaces/IWebPreferences.idl @@ -49,7 +49,8 @@ typedef enum WebKitEditableLinkBehavior { typedef enum WebKitEditingBehavior { WebKitEditingMacBehavior = 0, - WebKitEditingWinBehavior + WebKitEditingWinBehavior, + WebKitEditingUnixBehavior } WebKitEditingBehavior; diff --git a/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate2.idl b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate2.idl new file mode 100644 index 0000000..7e98e6a --- /dev/null +++ b/WebKit/win/Interfaces/IWebResourceLoadDelegatePrivate2.idl @@ -0,0 +1,52 @@ +/* + * 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 COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef DO_NO_IMPORTS +import "oaidl.idl"; +import "ocidl.idl"; +import "IWebView.idl"; +#endif + +interface IWebView; + +[ + object, + oleautomation, + uuid(3517ADDA-5870-4aab-9A4E-056E65989DF8), + pointer_default(unique) +] +interface IWebResourceLoadDelegatePrivate2 : IUnknown +{ + /*! + @method webView:removeIdentifierForRequest + @param webView The WebView sending the message. + @param identifier An identifier that can be used to track the progress of a resource load across + multiple call backs. + @discussion This message is sent to notify the delegate to stop using the identifier + to track the progress of a resource load. + - (void)webView:(WebView *)sender removeIdentifierForRequest:(id)identifier; + */ + HRESULT removeIdentifierForRequest([in] IWebView* webView, [in] unsigned long identifier); +} diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl index e936af6..3f401be 100644 --- a/WebKit/win/Interfaces/WebKit.idl +++ b/WebKit/win/Interfaces/WebKit.idl @@ -117,6 +117,7 @@ import "ocidl.idl"; #include "IWebResource.idl" #include "IWebResourceLoadDelegate.idl" #include "IWebResourceLoadDelegatePrivate.idl" +#include "IWebResourceLoadDelegatePrivate2.idl" #include "IWebScriptWorld.idl" #include "IWebScrollBarDelegatePrivate.idl" #include "IWebScrollBarPrivate.idl" @@ -300,3 +301,4 @@ library WebKit [default] interface IWebUserContentURLPattern; } } + diff --git a/WebKit/win/WebCache.cpp b/WebKit/win/WebCache.cpp index d82fc43..dff53fe 100644 --- a/WebKit/win/WebCache.cpp +++ b/WebKit/win/WebCache.cpp @@ -31,7 +31,7 @@ #pragma warning(push, 0) #include <WebCore/ApplicationCacheStorage.h> -#include <WebCore/Cache.h> +#include <WebCore/MemoryCache.h> #include <WebCore/CrossOriginPreflightResultCache.h> #pragma warning(pop) @@ -100,7 +100,7 @@ HRESULT STDMETHODCALLTYPE WebCache::statistics( if (!s) return S_OK; - WebCore::Cache::Statistics stat = WebCore::cache()->getStatistics(); + WebCore::MemoryCache::Statistics stat = WebCore::cache()->getStatistics(); static CFStringRef imagesKey = CFSTR("images"); static CFStringRef stylesheetsKey = CFSTR("style sheets"); diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index b1332ed..d046c21 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -172,6 +172,10 @@ void WebChromeClient::focusedNodeChanged(Node*) { } +void WebChromeClient::focusedFrameChanged(Frame*) +{ +} + static COMPtr<IPropertyBag> createWindowFeaturesPropertyBag(const WindowFeatures& features) { HashMap<String, COMVariant> map; @@ -592,7 +596,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database HMODULE safariHandle = GetModuleHandle(TEXT("Safari.exe")); if (!safariHandle) return; - GetModuleFileName(safariHandle, path, ARRAYSIZE(path)); + GetModuleFileName(safariHandle, path, WTF_ARRAY_LENGTH(path)); DWORD handle; DWORD versionSize = GetFileVersionInfoSize(path, &handle); if (!versionSize) diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index 5167c06..55167b6 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -57,6 +57,7 @@ public: virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); + virtual void focusedFrameChanged(WebCore::Frame*); virtual WebCore::Page* createWindow(WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); virtual void show(); @@ -122,6 +123,10 @@ public: virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + virtual void populateVisitedLinks(); virtual bool paintCustomScrollbar(WebCore::GraphicsContext*, const WebCore::FloatRect&, WebCore::ScrollbarControlSize, diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp index 6591347..24f97ca 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp @@ -494,11 +494,17 @@ void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* dat if (!m_manualLoader) loader->commitData(data, length); + // If the document is a stand-alone media document, now is the right time to cancel the WebKit load. + // FIXME: This code should be shared across all ports. <http://webkit.org/b/48762>. + Frame* coreFrame = core(m_webFrame); + if (coreFrame->document()->isMediaDocument()) + loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response())); + if (!m_manualLoader) return; if (!m_hasSentResponseToPlugin) { - m_manualLoader->didReceiveResponse(core(m_webFrame)->loader()->documentLoader()->response()); + m_manualLoader->didReceiveResponse(loader->response()); // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in // setting up this stream can cause the main document load to be cancelled, setting m_manualLoader // to null @@ -514,10 +520,10 @@ void WebFrameLoaderClient::finishedLoading(DocumentLoader* loader) // Telling the frame we received some data and passing 0 as the data is our // way to get work done that is normally done when the first bit of data is // received, even for the case of a document with no data (like about:blank) - if (!m_manualLoader) { - committedLoad(loader, 0, 0); + committedLoad(loader, 0, 0); + + if (!m_manualLoader) return; - } m_manualLoader->didFinishLoading(); m_manualLoader = 0; @@ -741,8 +747,22 @@ void WebFrameLoaderClient::didTransferChildFrameToNewDocument(Page*) m_webFrame->setWebView(webView); } -void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +void WebFrameLoaderClient::transferLoadingResourceFromPage(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request, Page* oldPage) { + assignIdentifierToInitialRequest(identifier, loader, request); + + WebView* oldWebView = kit(oldPage); + if (!oldWebView) + return; + + COMPtr<IWebResourceLoadDelegate> oldResourceLoadDelegate; + if (FAILED(oldWebView->resourceLoadDelegate(&oldResourceLoadDelegate))) + return; + + COMPtr<IWebResourceLoadDelegatePrivate2> oldResourceLoadDelegatePrivate2(Query, oldResourceLoadDelegate); + if (!oldResourceLoadDelegatePrivate2) + return; + oldResourceLoadDelegatePrivate2->removeIdentifierForRequest(oldWebView, identifier); } PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer) @@ -754,8 +774,8 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& URL, const Strin RefPtr<Frame> childFrame = webFrame->init(m_webFrame->webView(), coreFrame->page(), ownerElement); - coreFrame->tree()->appendChild(childFrame); childFrame->tree()->setName(name); + coreFrame->tree()->appendChild(childFrame); childFrame->init(); coreFrame->loader()->loadURLIntoChildFrame(URL, referrer, childFrame.get()); diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index 9db6a2a..60be4d5 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -55,7 +55,7 @@ #include "WebView.h" #pragma warning( push, 0 ) #include <WebCore/BString.h> -#include <WebCore/Cache.h> +#include <WebCore/MemoryCache.h> #include <WebCore/Document.h> #include <WebCore/DocumentLoader.h> #include <WebCore/DOMImplementation.h> @@ -438,7 +438,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::name( if (!coreFrame) return E_FAIL; - *frameName = BString(coreFrame->tree()->name()).release(); + *frameName = BString(coreFrame->tree()->uniqueName()).release(); return S_OK; } @@ -1299,11 +1299,7 @@ HRESULT WebFrame::suspendAnimations() if (!frame) return E_FAIL; - AnimationController* controller = frame->animation(); - if (!controller) - return E_FAIL; - - controller->suspendAnimations(frame->document()); + frame->animation()->suspendAnimations(); return S_OK; } @@ -1313,11 +1309,7 @@ HRESULT WebFrame::resumeAnimations() if (!frame) return E_FAIL; - AnimationController* controller = frame->animation(); - if (!controller) - return E_FAIL; - - controller->resumeAnimations(frame->document()); + frame->animation()->resumeAnimations(); return S_OK; } @@ -1718,7 +1710,13 @@ ResourceError WebFrame::pluginWillHandleLoadError(const ResourceResponse& respon bool WebFrame::shouldFallBack(const ResourceError& error) { - return error.errorCode() != WebURLErrorCancelled; + if (error.errorCode() == WebURLErrorCancelled && error.domain() == String(WebURLErrorDomain)) + return false; + + if (error.errorCode() == WebKitErrorPlugInWillHandleLoad && error.domain() == String(WebKitErrorDomain)) + return false; + + return true; } COMPtr<WebFramePolicyListener> WebFrame::setUpPolicyListener(WebCore::FramePolicyFunction function) diff --git a/WebKit/win/WebKitDLL.cpp b/WebKit/win/WebKitDLL.cpp index f8aa261..bc7aa60 100644 --- a/WebKit/win/WebKitDLL.cpp +++ b/WebKit/win/WebKitDLL.cpp @@ -78,7 +78,7 @@ STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpRe STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { bool found = false; - for (int i = 0; i < ARRAYSIZE(gRegCLSIDs); i++) { + for (size_t i = 0; i < WTF_ARRAY_LENGTH(gRegCLSIDs); ++i) { if (IsEqualGUID(rclsid, gRegCLSIDs[i])) { found = true; break; diff --git a/WebKit/win/WebMutableURLRequest.cpp b/WebKit/win/WebMutableURLRequest.cpp index 655b411..02829d7 100644 --- a/WebKit/win/WebMutableURLRequest.cpp +++ b/WebKit/win/WebMutableURLRequest.cpp @@ -320,10 +320,10 @@ HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setMainDocumentURL( } HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setTimeoutInterval( - /* [in] */ double /*timeoutInterval*/) + /* [in] */ double timeoutInterval) { - ASSERT_NOT_REACHED(); - return E_NOTIMPL; + m_request.setTimeoutInterval(timeoutInterval); + return S_OK; } HRESULT STDMETHODCALLTYPE WebMutableURLRequest::setURL( diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index fb62809..7ce7812 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -69,7 +69,7 @@ #include <WebCore/BString.h> #include <WebCore/BackForwardListImpl.h> #include <WebCore/BitmapInfo.h> -#include <WebCore/Cache.h> +#include <WebCore/MemoryCache.h> #include <WebCore/Chrome.h> #include <WebCore/ContextMenu.h> #include <WebCore/ContextMenuController.h> @@ -1634,9 +1634,9 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel) TCHAR className[256]; // Make sure truncation won't affect the comparison. - ASSERT(ARRAYSIZE(className) > _tcslen(PopupMenuWin::popupClassName())); + ASSERT(WTF_ARRAY_LENGTH(className) > _tcslen(PopupMenuWin::popupClassName())); - if (GetClassName(focusedWindow, className, ARRAYSIZE(className)) && !_tcscmp(className, PopupMenuWin::popupClassName())) { + if (GetClassName(focusedWindow, className, WTF_ARRAY_LENGTH(className)) && !_tcscmp(className, PopupMenuWin::popupClassName())) { // We don't let the WebView scroll here for two reasons - 1) To match Firefox behavior, 2) If we do scroll, we lose the // focus ring around the select menu. SetFocus(m_viewWindow); @@ -2331,7 +2331,7 @@ static String webKitVersion() } *lpTranslate; TCHAR path[MAX_PATH]; - GetModuleFileName(gInstance, path, ARRAYSIZE(path)); + GetModuleFileName(gInstance, path, WTF_ARRAY_LENGTH(path)); DWORD handle; DWORD versionSize = GetFileVersionInfoSize(path, &handle); if (!versionSize) @@ -2345,7 +2345,7 @@ static String webKitVersion() if (!VerQueryValue(data, TEXT("\\VarFileInfo\\Translation"), (LPVOID*)&lpTranslate, &cbTranslate)) goto exit; TCHAR key[256]; - _stprintf_s(key, ARRAYSIZE(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage); + _stprintf_s(key, WTF_ARRAY_LENGTH(key), TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), lpTranslate[0].wLanguage, lpTranslate[0].wCodePage); LPCTSTR productVersion; UINT productVersionLength; if (!VerQueryValue(data, (LPTSTR)(LPCTSTR)key, (void**)&productVersion, &productVersionLength)) diff --git a/WebKit/wince/ChangeLog b/WebKit/wince/ChangeLog index bbf5d59..0cbd925 100644 --- a/WebKit/wince/ChangeLog +++ b/WebKit/wince/ChangeLog @@ -1,3 +1,30 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebCoreSupport/ChromeClientWinCE.cpp: + (WebKit::ChromeClientWinCE::focusedFrameChanged): + * WebCoreSupport/ChromeClientWinCE.h: + +2010-11-02 Patrick Gansterer <paroga@webkit.org> + + Unreviewed, build fix after r71041. + + * WebCoreSupport/ChromeClientWinCE.h: + (WebKit::ChromeClientWinCE::showContextMenu): + +2010-10-30 Patrick Gansterer <paroga@webkit.org> + + Unreviewed, build fix after r70574. + + * WebCoreSupport/FrameLoaderClientWinCE.cpp: + (WebKit::FrameLoaderClientWinCE::transferLoadingResourceFromPage): + 2010-10-29 Alexey Proskuryakov <ap@apple.com> Reviewed by Darin Adler. diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp index c99635a..e19d6ad 100644 --- a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp +++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp @@ -174,6 +174,10 @@ void ChromeClientWinCE::focusedNodeChanged(Node*) notImplemented(); } +void ChromeClientWinCE::focusedFrameChanged(Frame*) +{ +} + bool ChromeClientWinCE::canRunBeforeUnloadConfirmPanel() { return true; diff --git a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h index 3818ce0..7219934 100644 --- a/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h +++ b/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h @@ -51,6 +51,7 @@ public: virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); + virtual void focusedFrameChanged(Frame*); // The Frame pointer provides the ChromeClient with context about which // Frame wants to create the new Page. Also, the newly created window @@ -125,6 +126,10 @@ public: virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0; #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + #if ENABLE(NOTIFICATIONS) virtual WebCore::NotificationPresenter* notificationPresenter() const = 0; #endif diff --git a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp index 0b95213..f3643b2 100644 --- a/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp +++ b/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp @@ -165,7 +165,7 @@ void FrameLoaderClientWinCE::didTransferChildFrameToNewDocument(Page*) { } -void FrameLoaderClientWinCE::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +void FrameLoaderClientWinCE::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const WebCore::ResourceRequest&, Page*) { } diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index 123b839..e0f0cd1 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,37 @@ +2010-11-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48685 + Notify UI process about focused frame + + Added an empty implementation of the new ChromeClient method. + + * WebKitSupport/ChromeClientWx.cpp: + (WebCore::ChromeClientWx::focusedFrameChanged): + * WebKitSupport/ChromeClientWx.h: + +2010-11-07 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Rename Cache to MemoryCache + https://bugs.webkit.org/show_bug.cgi?id=49159 + + * WebView.cpp: + (wxWebView::SetCachePolicy): + * WebView.h: + +2010-11-01 Brady Eidson <beidson@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/7660547> and https://bugs.webkit.org/show_bug.cgi?id=48699 + Context menu support for WebKit 2. + + * WebKitSupport/ChromeClientWx.h: + (WebCore::ChromeClientWx::showContextMenu): + 2010-10-29 Darin Adler <darin@apple.com> Reviewed by Sam Weinig. diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp index 97b98cf..65f0eea 100644 --- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp @@ -137,6 +137,10 @@ void ChromeClientWx::focusedNodeChanged(Node*) { } +void ChromeClientWx::focusedFrameChanged(Frame*) +{ +} + Page* ChromeClientWx::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features, const NavigationAction&) { Page* myPage = 0; diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h index 755beb7..2ccad43 100644 --- a/WebKit/wx/WebKitSupport/ChromeClientWx.h +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h @@ -56,6 +56,7 @@ public: virtual void takeFocus(FocusDirection); virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); virtual Page* createModalDialog(Frame*, const FrameLoadRequest&); @@ -129,6 +130,10 @@ public: virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif +#if ENABLE(CONTEXT_MENUS) + virtual void showContextMenu() { } +#endif + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp index 5980236..667aa88 100644 --- a/WebKit/wx/WebView.cpp +++ b/WebKit/wx/WebView.cpp @@ -24,13 +24,14 @@ */ #include "config.h" -#include "Cache.h" +#include "WebView.h" + #include "ContextMenu.h" -#include "ContextMenuItem.h" #include "ContextMenuController.h" +#include "ContextMenuItem.h" #include "Document.h" -#include "Element.h" #include "Editor.h" +#include "Element.h" #include "EmptyClients.h" #include "EventHandler.h" #include "FileChooser.h" @@ -41,7 +42,7 @@ #include "GraphicsContext.h" #include "HTMLFormElement.h" #include "Logging.h" -#include "markup.h" +#include "MemoryCache.h" #include "Page.h" #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" @@ -56,6 +57,7 @@ #include "Settings.h" #include "SubstituteData.h" #include "Threading.h" +#include "markup.h" #if __WXMSW__ #include "WebCoreInstanceHandle.h" #endif @@ -87,7 +89,6 @@ #include "WebDOMNode.h" #include "WebFrame.h" -#include "WebView.h" #include "WebViewPrivate.h" #include <wx/defs.h> @@ -269,12 +270,12 @@ static wxWebViewCachePolicy gs_cachePolicy; /* static */ void wxWebView::SetCachePolicy(const wxWebViewCachePolicy& cachePolicy) { - WebCore::Cache* globalCache = WebCore::cache(); + WebCore::MemoryCache* globalCache = WebCore::cache(); globalCache->setCapacities(cachePolicy.GetMinDeadCapacity(), cachePolicy.GetMaxDeadCapacity(), cachePolicy.GetCapacity()); - // store a copy since there is no getter for Cache values + // store a copy since there is no getter for MemoryCache values gs_cachePolicy = cachePolicy; } diff --git a/WebKit/wx/WebView.h b/WebKit/wx/WebView.h index 3ddb45e..4a6b081 100644 --- a/WebKit/wx/WebView.h +++ b/WebKit/wx/WebView.h @@ -54,7 +54,7 @@ namespace WebCore { extern WXDLLIMPEXP_WEBKIT const wxChar* wxWebViewNameStr; #endif -static const int defaultCacheCapacity = 8192 * 1024; // mirrors Cache.cpp +static const int defaultCacheCapacity = 8192 * 1024; // mirrors MemoryCache.cpp class WXDLLIMPEXP_WEBKIT wxWebViewCachePolicy { |