diff options
Diffstat (limited to 'WebKit')
132 files changed, 4386 insertions, 592 deletions
diff --git a/WebKit/CMakeListsEfl.txt b/WebKit/CMakeListsEfl.txt index 046b613..cbc0d92 100644 --- a/WebKit/CMakeListsEfl.txt +++ b/WebKit/CMakeListsEfl.txt @@ -25,12 +25,13 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES LIST(APPEND WebKit_SOURCES efl/WebCoreSupport/ChromeClientEfl.cpp - efl/WebCoreSupport/ContextMenuClientEfl + efl/WebCoreSupport/ContextMenuClientEfl.cpp efl/WebCoreSupport/DragClientEfl.cpp efl/WebCoreSupport/EditorClientEfl.cpp efl/WebCoreSupport/FrameLoaderClientEfl.cpp efl/WebCoreSupport/InspectorClientEfl.cpp + efl/ewk/ewk_contextmenu.cpp efl/ewk/ewk_frame.cpp efl/ewk/ewk_history.cpp efl/ewk/ewk_main.cpp diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index ea021c1..c283bb7 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,167 @@ +2010-05-31 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * efl/WebCoreSupport/EditorClientEfl.cpp: + (WebCore::EditorClientEfl::handleEditingKeyboardEvent): + +2010-05-31 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Add Context Menu implementation + https://bugs.webkit.org/show_bug.cgi?id=39821 + + * CMakeListsEfl.txt: add context menu files. + * efl/WebCoreSupport/ContextMenuClientEfl.cpp: + (WebCore::ContextMenuClientEfl::getCustomMenuFromDefaultItems): + (WebCore::ContextMenuClientEfl::newPlatformDescription): + (WebCore::ContextMenuClientEfl::freePlatformDescription): + (WebCore::ContextMenuClientEfl::appendItem): + (WebCore::ContextMenuClientEfl::show): + * efl/WebCoreSupport/ContextMenuClientEfl.h: + * efl/ewk/EWebKit.h: + * efl/ewk/ewk_contextmenu.cpp: Added. Implement the API used by + browser for manipulating context menus. + (ewk_context_menu_ref): + (ewk_context_menu_unref): + (ewk_context_menu_destroy): + (ewk_context_menu_item_list_get): + (ewk_context_menu_item_new): + (ewk_context_menu_item_select): + (ewk_context_menu_item_free): + (ewk_context_menu_item_type_get): + (ewk_context_menu_item_type_set): + (ewk_context_menu_item_action_get): + (ewk_context_menu_item_action_set): + (ewk_context_menu_item_title_get): + (ewk_context_menu_item_title_set): + (ewk_context_menu_item_checked_get): + (ewk_context_menu_item_checked_set): + (ewk_context_menu_item_enabled_get): + (ewk_context_menu_item_enabled_set): + (ewk_context_menu_new): + (ewk_context_menu_free): + (ewk_context_menu_item_append): + (ewk_context_menu_custom_get): + (ewk_context_menu_show): + * efl/ewk/ewk_contextmenu.h: Added. + * efl/ewk/ewk_private.h: + * efl/ewk/ewk_view.cpp: + (ewk_view_context_menu_forward_event): inform browser a new context + menu was created. + (ewk_view_exceeded_database_quota): small fix to previous + changed function. + * efl/ewk/ewk_view.h: + +2010-05-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EF] Remove compiler warnings and add test for switching page + encoding. + https://bugs.webkit.org/show_bug.cgi?id=39871 + + * efl/EWebLauncher/main.c: + (print_history): + (on_key_down): + (main): + +2010-05-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Allow client to override default database quota. We increase the + default database quota to 1MB (it was incorrectly set to 1KB, which is + too low) and add methods to allow client to iteratively database quota + when it becomes greater than the allowed value. + https://bugs.webkit.org/show_bug.cgi?id=39867 + + * efl/WebCoreSupport/ChromeClientEfl.cpp: + (WebCore::ChromeClientEfl::exceededDatabaseQuota): reimplement method + to allow client to increase database quota iteratively. + * efl/ewk/ewk_private.h: + * efl/ewk/ewk_settings.cpp: + * efl/ewk/ewk_view.h: + +2010-05-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Add default path to web database and methods to set it. + If a default path is not set, it will default to "/", in which a + normal user usually does not have write permission. + + * efl/EWebLauncher/main.c: overwrite default directory with another + one. + (main): + * efl/ewk/ewk_main.cpp: + (ewk_init): add default path + * efl/ewk/ewk_settings.cpp: add methods to set and get database path + (ewk_settings_web_database_path_set): + (ewk_settings_web_database_path_get): + * efl/ewk/ewk_settings.h: + +2010-05-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Fix wrongly set clipper. Now the scrollbars from main + frame are shown even on a zoom level lower than 1.0. + + * efl/ewk/ewk_view_single.c: + (_ewk_view_single_smart_add): + (_ewk_view_single_smart_backing_store_add): + (ewk_view_single_smart_set): + +2010-05-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Add support for Popup menus + https://bugs.webkit.org/show_bug.cgi?id=39629 + + * efl/WebCoreSupport/ChromeClientEfl.cpp: implement methods to create + and destroy popup menu. + (WebCore::ChromeClientEfl::createSelectPopup): ditto. + (WebCore::ChromeClientEfl::destroySelectPopup): ditto. + * efl/WebCoreSupport/ChromeClientEfl.h: ditto. + * efl/ewk/ewk_private.h: add function to call browser when a popup is + created/deleted + +2010-05-25 Joone Hur <joone.hur@samsung.com> + + Reviewed by Gustavo Noronha Silva. + + [EFL] Build fix. + http://webkit.org/b/39648 + + * efl/ewk/ewk_frame.cpp: + (ewk_frame_zoom_get): Add missed namespace + (ewk_frame_zoom_set): Ditto. + (ewk_frame_zoom_text_only_set): Ditto. + * efl/ewk/ewk_view.cpp: + (_ewk_view_priv_new): Add a null parameter when creating a Page. + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * efl/ewk/ewk_frame.cpp: + (ewk_frame_editable_set): Removed call to empty function, + removeEditingStyleFromBodyElement. + (ewk_frame_zoom_get): Call function on FrameView. + (ewk_frame_zoom_set): Ditto. + (ewk_frame_zoom_text_only_set): Ditto. + 2010-05-15 Leandro Pereira <leandro@profusion.mobi> Reviewed by Adam Treat. diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 07e6edb..50ae8ae 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,566 @@ +2010-05-31 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Chromium: save inspector settings as dictionary, not as string. + https://bugs.webkit.org/show_bug.cgi?id=32118 + + * public/WebView.h: + * public/WebViewClient.h: + (WebKit::WebViewClient::didUpdateInspectorSetting): + * src/InspectorClientImpl.cpp: + (WebKit::InspectorClientImpl::populateSetting): + (WebKit::InspectorClientImpl::storeSetting): + * src/InspectorClientImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::inspectorSetting): + (WebKit::WebViewImpl::setInspectorSetting): + * src/WebViewImpl.h: + +2010-05-31 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + Expose html5 parser enabled flag in WebSettings + https://bugs.webkit.org/show_bug.cgi?id=39913 + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setHTML5ParserEnabled): + * src/WebSettingsImpl.h: + +2010-05-31 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeCommand): + +2010-05-31 Roland Steiner <rolandsteiner@chromium.org> + + Bug 39977 - Missing Chromium bindings for InspectorController methods introduced in r60443 + https://bugs.webkit.org/show_bug.cgi?id=39977 + + add missing InspectorController JS bindings: + - getStyleSheet + - getRuleRangesForStyleSheetId + + Tests: inspector/styles-source-offsets.html + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-05-31 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r60456. + http://trac.webkit.org/changeset/60456 + https://bugs.webkit.org/show_bug.cgi?id=39974 + + Broke Chromium Linux/Max build (Requested by tkent on + #webkit). + + * DEPS: + +2010-05-31 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Checking out lighttpd + https://bugs.webkit.org/show_bug.cgi?id=39948 + + - Checking out lighttpd only on Windows. It is used by new-run-webkit-tests. + - Update Chromium revision to use Windows resource query code + + * DEPS: + +2010-05-31 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: allow hiding Scripts panel from Chromium code. This + is needed to support v8 debugging protocol which has an implementation + that conflicts with debugger provided by the inspector. + https://bugs.webkit.org/show_bug.cgi?id=39952 + + * public/WebDevToolsAgentClient.h: + (WebKit::WebDevToolsAgentClient::exposeV8DebuggerProtocol): + * public/WebDevToolsFrontendClient.h: + (WebKit::WebDevToolsFrontendClient::WebDevToolsFrontendClient): + (WebKit::WebDevToolsFrontendClient::sendMessageToAgent): + (WebKit::WebDevToolsFrontendClient::sendDebuggerCommandToAgent): + (WebKit::WebDevToolsFrontendClient::sendDebuggerPauseScript): + (WebKit::WebDevToolsFrontendClient::activateWindow): + (WebKit::WebDevToolsFrontendClient::closeWindow): + (WebKit::WebDevToolsFrontendClient::requestDockWindow): + (WebKit::WebDevToolsFrontendClient::requestUndockWindow): + (WebKit::WebDevToolsFrontendClient::hideScriptsPanel): + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::debugAttach): + (WebKit::DebuggerAgentManager::debugDetach): + (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol): + * src/DebuggerAgentManager.h: + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::hiddenPanels): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::WebDevToolsAgentImpl): + (WebKit::WebDevToolsAgentImpl::attach): + +2010-05-30 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + This is a coding style cleanup before fixing to bug 35530. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::find): + (WebKit::WebFrameImpl::scopeStringMatches): + (WebKit::WebFrameImpl::createChildFrame): + (WebKit::WebFrameImpl::shouldScopeMatches): + +2010-05-30 Daniel Bates <dbates@rim.com> + + Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418. + + I missed a few call sites in the Chromium source when I + landed http://trac.webkit.org/changeset/60419. + + Credit to Chris Jerdonek for looking over both this patch and the patch + committed in r60419. + + * src/WebSearchableFormData.cpp: + (WebCore::GetButtonToActivate): + (WebCore::HasSuitableTextElement): + +2010-05-30 Daniel Bates <dbates@rim.com> + + Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418. + + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::autofill): + * src/WebFormControlElement.cpp: + (WebKit::WebFormControlElement::formControlName): + (WebKit::WebFormControlElement::formControlType): + * src/WebFormElement.cpp: + (WebKit::WebFormElement::getFormControlElements): + * src/WebPasswordFormUtils.cpp: + (WebKit::findPasswordFormFields): + +2010-05-30 Jessie Berlin <jberlin@webkit.org> + + Reviewed by Pavel Feldman. + + https://bugs.webkit.org/show_bug.cgi?id=39224 + Bug 39224 - Web Inspector: There should be a way to clean up profiles + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-05-29 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + Adding support for a runtime flag to enable accelerated + compositing in chromium. + https://bugs.webkit.org/show_bug.cgi?id=39917 + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAcceleratedCompositingEnabled): + * src/WebSettingsImpl.h: + +2010-05-28 Aaron Boodman <aa@chromium.org> + + Reviewed by Darin Fisher. + + Add isXHTMLDocument() to WebDocument. + + https://bugs.webkit.org/show_bug.cgi?id=39887 + + * public/WebDocument.h: Add isXHTMLDocument(). + * src/WebDocument.cpp: ditto. + (WebKit::WebDocument::isXHTMLDocument): dittorama. + +2010-05-27 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Add IndexedDB's IDBIndex + https://bugs.webkit.org/show_bug.cgi?id=39850 + + Add WebKit layer for IDBIndex. + + * WebKit.gyp: + * public/WebCommon.h: + * public/WebIDBCallbacks.h: + (WebKit::WebIDBCallbacks::onError): + (WebKit::WebIDBCallbacks::onSuccess): + * public/WebIDBDatabase.h: + * public/WebIDBIndex.h: Added. + (WebKit::WebIDBIndex::~WebIDBIndex): + (WebKit::WebIDBIndex::name): + (WebKit::WebIDBIndex::keyPath): + (WebKit::WebIDBIndex::unique): + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBDatabaseProxy.cpp: + * src/IDBDatabaseProxy.h: + * src/IDBIndexProxy.cpp: Added. + (WebCore::IDBIndexProxy::create): + (WebCore::IDBIndexProxy::IDBIndexProxy): + (WebCore::IDBIndexProxy::~IDBIndexProxy): + (WebCore::IDBIndexProxy::name): + (WebCore::IDBIndexProxy::keyPath): + (WebCore::IDBIndexProxy::unique): + * src/IDBIndexProxy.h: Added. + * src/WebIDBCallbacksImpl.cpp: + (WebCore::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBIndexImpl.cpp: Added. + (WebKit::WebIDBIndexImpl::WebIDBIndexImpl): + (WebKit::WebIDBIndexImpl::~WebIDBIndexImpl): + (WebKit::WebIDBIndexImpl::name): + (WebKit::WebIDBIndexImpl::keyPath): + (WebKit::WebIDBIndexImpl::unique): + * src/WebIDBIndexImpl.h: Added. + +2010-05-28 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: check that ClientMessageLoopAdapter is not 0 before + accessing its fileds from inspectedViewClosed method. It may be 0 + if inspector frontend has not been open. + https://bugs.webkit.org/show_bug.cgi?id=39876 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + +2010-05-27 Eric Uhrhane <ericu@chromium.org> + + Reviewed by Adam Barth. + + Add v8 bindings for async DB API in workers + https://bugs.webkit.org/show_bug.cgi?id=39145 + + * src/DatabaseObserver.cpp: + We should check that we're on the context thread now, not the main + thread. + (WebCore::DatabaseObserver::databaseOpened): + (WebCore::DatabaseObserver::databaseModified): + (WebCore::DatabaseObserver::databaseClosed): + +2010-05-27 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Resume script execution if user tries to navigate to another URL + https://bugs.webkit.org/show_bug.cgi?id=39842 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::didNavigate): + +2010-05-27 Zhenyao Mo <zmo@google.com> + + Reviewed by Dimitri Glazkov. + + Implement lazy clearing of renderbuffers + https://bugs.webkit.org/show_bug.cgi?id=36248 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::reshape): Clear WebGL internal buffers. + +2010-05-26 Roland Steiner <rolandsteiner@chromium.org> + + Reviewed by NOBODY (layout test crashing fix). + + Bug 39811 - WebPluginListBuilderImpl::addMediaTypeToLastPlugin does not initialize pluginIndex + https://bugs.webkit.org/show_bug.cgi?id=39811 + + Initialize the pluginIndex field (quick fix). + + Tests: covered by fast/dom/prototype-inheritance-2.html + (crashed under Chromium Linux and Windows) + + * src/WebPluginListBuilderImpl.cpp: + (WebKit::WebPluginListBuilderImpl::addMediaTypeToLastPlugin): + +2010-05-26 Anders Carlsson <andersca@apple.com> + + Reviewed by Darin Adler. + + Clean up MimeClassInfo and PluginInfo + https://bugs.webkit.org/show_bug.cgi?id=39700 + + Update for WebCore changes. + + * src/WebPluginListBuilderImpl.cpp: + (WebKit::WebPluginListBuilderImpl::addPlugin): + (WebKit::WebPluginListBuilderImpl::addMediaTypeToLastPlugin): + (WebKit::WebPluginListBuilderImpl::addFileExtensionToLastMediaType): + * src/WebPluginListBuilderImpl.h: + (WebKit::WebPluginListBuilderImpl::WebPluginListBuilderImpl): + +2010-05-26 Jeremy Orlow <jorlow@chromium.org> + + Unreviewed chromium build fix + https://bugs.webkit.org/show_bug.cgi?id=39739 + + The backwards compat function needs to take in a WebSecurityOrigin + instead of a WebString. + + * public/WebIndexedDatabase.h: + (WebKit::WebIndexedDatabase::open): + +2010-05-26 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Darin Fisher. + + Implement WebDOMStorageList and make WebIDBDatabase use it + https://bugs.webkit.org/show_bug.cgi?id=39731 + + * WebKit.gyp: + * public/WebDOMStringList.h: Added. + (WebKit::WebDOMStringList::~WebDOMStringList): + (WebKit::WebDOMStringList::WebDOMStringList): + (WebKit::WebDOMStringList::operator=): + * public/WebIDBDatabase.h: + (WebKit::WebIDBDatabase::objectStores): + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::objectStores): + * src/WebDOMStringList.cpp: Added. + (WebKit::WebDOMStringList::reset): + (WebKit::WebDOMStringList::assign): + (WebKit::WebDOMStringList::append): + (WebKit::WebDOMStringList::length): + (WebKit::WebDOMStringList::item): + (WebKit::WebDOMStringList::WebDOMStringList): + (WebKit::WebDOMStringList::operator=): + (WebKit::WebDOMStringList::operator WTF::PassRefPtr<WebCore::DOMStringList>): + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::objectStores): + * src/WebIDBDatabaseImpl.h: + +2010-05-24 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Add IDBDatabase's attributes + https://bugs.webkit.org/show_bug.cgi?id=39602 + + Plumbing to hook up the synchronous attribute requests + on IDBDatabase. + + * public/WebIDBDatabase.h: + (WebKit::WebIDBDatabase::name): + (WebKit::WebIDBDatabase::description): + (WebKit::WebIDBDatabase::version): + (WebKit::WebIDBDatabase::objectStores): + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::name): + (WebCore::IDBDatabaseProxy::description): + (WebCore::IDBDatabaseProxy::version): + (WebCore::IDBDatabaseProxy::objectStores): + * src/IDBDatabaseProxy.h: + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::WebIDBDatabaseImpl): + (WebKit::WebIDBDatabaseImpl::name): + (WebKit::WebIDBDatabaseImpl::description): + (WebKit::WebIDBDatabaseImpl::version): + (WebKit::WebIDBDatabaseImpl::objectStores): + * src/WebIDBDatabaseImpl.h: + +2010-05-24 Dirk Pranke <dpranke@chromium.org> + + Reviewed by Dimitri Glazkov. + + Re-commit r58765 - it had been rolled out to see if it was causing + a perf regression (in r59787 and r59789), but that does not seem to + have been the case. + + * public/WebNotification.h: + * src/WebNotification.cpp: + (WebKit::WebNotification::dir): + (WebKit::WebNotification::replaceId): + +2010-05-25 Brett Wilson <brettw@chromium.org> + + Reviewed by Darin Fisher. + + Remove obsolete code for Mac & Windows plugin creation in the Chromium + port. This non-Windows code was to prevent a crash which we no longer + seem to have, and it is preventing other types of plugins from working. + https://bugs.webkit.org/show_bug.cgi?id=39684 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::createPlugin): + +2010-05-25 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Enable 3D_CANVAS, FILTERS, METER_TAG and PROGRESS_TAG + https://bugs.webkit.org/show_bug.cgi?id=39652 + + 3D_CANVAS and FILTERS have been enabled for Chromium tree + build. They fix dozens of unexpected test results in a case of + upstreaming build. + Enable METER_TAG and PROGRESS_TAG too because they will be enabled + in Chromium tree in the near future. + + * features.gypi: + +2010-05-25 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + The GraphicsContext that serves as a backing store for the root layer + updates when doing accelerated compositing is now stored in LayerRendererChromium + instead of the Layer itself. Updating code in WebViewImpl to reflect + that change. + https://bugs.webkit.org/show_bug.cgi?id=39640 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::updateRootLayerContents): + +2010-05-24 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + ScriptDebugServer is now implemented as DebugEventListener which means it doesn't + depend on v8 debugging protocol, instead it uses ExecState to collect debugging + info and pass it to the listeners. + + New implementation of ScriptDebugServer uses methods provided by client to dispatch + its messages while JS is paused(previously the messages was dispatched in a callback + passed to v8 along with DebugEventHandler). + + Pause command is dispatched on IO thread. + + https://bugs.webkit.org/show_bug.cgi?id=39594 + + * public/WebDevToolsAgentClient.h: + (WebKit::WebDevToolsAgentClient::ClientMessageLoop::~ClientMessageLoop): + (WebKit::WebDevToolsAgentClient::createClientMessageLoop): Returns an object that allows to run + nested client message loop while script execution is paused on a breakpoint. + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::setMessageLoopDispatchHandler): + * src/DebuggerAgentManager.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::): + (WebKit::WebDevToolsAgentImpl::~WebDevToolsAgentImpl): + (WebKit::WebDevToolsAgentImpl::attach): + * src/js/DebuggerScript.js: + (debuggerScriptConstructor.DebuggerScript.getAfterCompileScript): + (debuggerScriptConstructor.DebuggerScript.stepIntoStatement): + (debuggerScriptConstructor.DebuggerScript.stepOverStatement): + (debuggerScriptConstructor.DebuggerScript.stepOutOfFunction): + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + (else.devtools.InspectorBackendImpl.prototype.pauseInDebugger): Pause command should be handled on IO + thread so that script can be paused even if it's in an infinite loop. + +2010-05-25 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Add memory graph to Timeline overview pane. + + https://bugs.webkit.org/show_bug.cgi?id=37879 + + * src/js/devTools.css: + (.timeline-category-statusbar-item input): + +2010-05-24 Tony Chang <tony@chromium.org> + + Reviewed by David Levin. + + [chromium] Fix zoom tests after r60104 + https://bugs.webkit.org/show_bug.cgi?id=39645 + + m_zoomFactor moved from Frame to FrameView. FrameView has separate + notions of page zoom and text zoom. In my hurried compile fix, I + assumed that m_zoomFactor was for page zoom, but it's not always. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): + +2010-05-24 Kent Tamura <tkent@chromium.org> + + Unreviewed. Sort features. + + * features.gypi: + +2010-05-24 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Import layout_test_helper for Windows + https://bugs.webkit.org/show_bug.cgi?id=39581 + + * WebKit.gyp: Add a build rule for LayoutTestHelper.exe for Windows. + +2010-05-24 Marcus Bulach <bulach@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] Adds WebGeolocationServiceMockImpl to remove public dependency on wtf/HashMap.h + https://bugs.webkit.org/show_bug.cgi?id=39587 + + * public/WebGeolocationServiceMock.h: + * src/WebGeolocationServiceMock.cpp: + (WebKit::WebGeolocationServiceMockImpl::~WebGeolocationServiceMockImpl): + (WebKit::WebGeolocationServiceMock::createWebGeolocationServiceMock): + (WebKit::WebGeolocationServiceMockImpl::requestPermissionForFrame): + (WebKit::WebGeolocationServiceMockImpl::attachBridge): + (WebKit::WebGeolocationServiceMockImpl::detachBridge): + +2010-05-24 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] setup fonts on chromium linux DRT + https://bugs.webkit.org/show_bug.cgi?id=39644 + + * WebKit.gyp: + +2010-05-24 Tony Chang <tony@chromium.org> + + Not reviewed, build fix. + + Fix the chromium compile due to pageZoomFactor refactoring. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): Call setZoomLevel on FrameView. + +2010-05-24 Anders Carlsson <andersca@apple.com> + + Attempt to fix the Chromium build. + + * src/WebViewImpl.cpp: + 2010-05-21 Tony Chang <tony@chromium.org> Reviewed by Ojan Vafai. @@ -221,18 +784,6 @@ (WebKit::WebNotification::dir): (WebKit::WebNotification::replaceId): -2010-05-18 Dirk Pranke <dpranke@chromium.org> - - Reviewed by Dimitri Glazkov. - - Attempt to revert r58765 to see if it was causing a performance - regression. - - https://bugs.webkit.org/show_bug.cgi?id=39328 - - * public/WebNotification.h: - * src/WebNotification.cpp: - 2010-05-19 Jian Li <jianli@chromium.org> Reviewed by Darin Fisher. diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 94d7a46..937f4b3 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -100,6 +100,7 @@ 'public/WebCrossOriginPreflightResultCache.h', 'public/WebCString.h', 'public/WebCursorInfo.h', + 'public/WebDOMStringList.h', 'public/WebData.h', 'public/WebDatabase.h', 'public/WebDatabaseObserver.h', @@ -138,6 +139,7 @@ 'public/WebIDBCallbacks.h', 'public/WebIDBDatabase.h', 'public/WebIDBDatabaseError.h', + 'public/WebIDBIndex.h', 'public/WebIndexedDatabase.h', 'public/WebInputElement.h', 'public/WebInputEvent.h', @@ -265,6 +267,8 @@ 'src/IDBCallbacksProxy.h', 'src/IDBDatabaseProxy.cpp', 'src/IDBDatabaseProxy.h', + 'src/IDBIndexProxy.cpp', + 'src/IDBIndexProxy.h', 'src/IndexedDatabaseProxy.cpp', 'src/IndexedDatabaseProxy.h', 'src/InspectorClientImpl.cpp', @@ -313,6 +317,7 @@ 'src/WebCrossOriginPreflightResultCache.cpp', 'src/WebCString.cpp', 'src/WebCursorInfo.cpp', + 'src/WebDOMStringList.cpp', 'src/WebData.cpp', 'src/WebDatabase.cpp', 'src/WebDataSourceImpl.cpp', @@ -351,6 +356,8 @@ 'src/WebIDBDatabaseError.cpp', 'src/WebIDBDatabaseImpl.cpp', 'src/WebIDBDatabaseImpl.h', + 'src/WebIDBIndexImpl.cpp', + 'src/WebIDBIndexImpl.h', 'src/WebImageCG.cpp', 'src/WebImageDecoder.cpp', 'src/WebImageSkia.cpp', @@ -581,16 +588,18 @@ ], 'conditions': [ ['OS=="win"', { + 'dependencies': ['LayoutTestHelper'], + 'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'], 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', - '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', - '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc', - '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', + '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', ], 'copies': [{ - 'destination': '<(PRODUCT_DIR)', - 'files': ['<(ahem_path)'], + 'destination': '<(PRODUCT_DIR)', + 'files': ['<(ahem_path)'], }], }], ['OS=="mac"', { @@ -631,6 +640,15 @@ }, ], # actions }], + ['OS=="linux"', { + 'copies': [{ + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '<(ahem_path)', + '../../WebKitTools/DumpRenderTree/chromium/fonts.conf', + ], + }], + }], ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', { 'sources/': [ ['exclude', '(Gtk|Linux)\\.cpp$'] @@ -651,6 +669,13 @@ }, ], # targets 'conditions': [ + ['OS=="win"', { + 'targets': [{ + 'target_name': 'LayoutTestHelper', + 'type': 'executable', + 'sources': ['../../WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'], + }], + }], ['OS=="mac"', { 'targets': [ { diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 87a6e09..c7d40cf 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -39,40 +39,43 @@ # chromium build, overrides this list with its own values. See # features_override.gypi inline documentation for more details. 'feature_defines%': [ - 'ENABLE_3D_CANVAS=0', + 'ENABLE_3D_CANVAS=1', 'ENABLE_BLOB_SLICE=1', 'ENABLE_CHANNEL_MESSAGING=1', + 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', - 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', - 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DOM_STORAGE=1', 'ENABLE_FILE_READER=1', 'ENABLE_FILE_WRITER=0', + 'ENABLE_FILTERS=1', 'ENABLE_GEOLOCATION=1', - 'ENABLE_JAVASCRIPT_DEBUGGER=1', - 'ENABLE_JSC_MULTIPLE_THREADS=0', 'ENABLE_ICONDATABASE=0', 'ENABLE_INDEXED_DATABASE=1', + 'ENABLE_JAVASCRIPT_DEBUGGER=1', + 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_METER_TAG=1', 'ENABLE_NOTIFICATIONS=1', + 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', 'ENABLE_OPENTYPE_SANITIZER=1', 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_PROGRESS_TAG=1', 'ENABLE_RUBY=1', 'ENABLE_SANDBOX=1', - 'ENABLE_XHTMLMP=0', - 'ENABLE_XSLT=1', - 'ENABLE_XPATH=1', 'ENABLE_SHARED_WORKERS=1', 'ENABLE_SVG=1', 'ENABLE_SVG_ANIMATION=1', 'ENABLE_SVG_AS_IMAGE=1', - 'ENABLE_SVG_USE=1', - 'ENABLE_SVG_FOREIGN_OBJECT=1', 'ENABLE_SVG_FONTS=1', + 'ENABLE_SVG_FOREIGN_OBJECT=1', + 'ENABLE_SVG_USE=1', 'ENABLE_TOUCH_EVENTS=1', 'ENABLE_VIDEO=1', 'ENABLE_WEB_SOCKETS=1', 'ENABLE_WORKERS=1', + 'ENABLE_XHTMLMP=0', + 'ENABLE_XPATH=1', + 'ENABLE_XSLT=1', 'WTF_USE_ACCELERATED_COMPOSITING=0', ], diff --git a/WebKit/chromium/public/WebCommon.h b/WebKit/chromium/public/WebCommon.h index e7e38d3..7872729 100644 --- a/WebKit/chromium/public/WebCommon.h +++ b/WebKit/chromium/public/WebCommon.h @@ -106,4 +106,6 @@ WEBKIT_API void failedAssertion(const char* file, int line, const char* function } while (0) #endif +#define WEBKIT_ASSERT_NOT_REACHED() WEBKIT_ASSERT(0) + #endif diff --git a/WebKit/chromium/public/WebDOMStringList.h b/WebKit/chromium/public/WebDOMStringList.h new file mode 100644 index 0000000..b3fb533 --- /dev/null +++ b/WebKit/chromium/public/WebDOMStringList.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebDOMStringList_h +#define WebDOMStringList_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" +#include "WebString.h" + +namespace WebCore { class DOMStringList; } +#if WEBKIT_IMPLEMENTATION +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { + +class WebDOMStringList { +public: + ~WebDOMStringList() { reset(); } + + WebDOMStringList() { } + WebDOMStringList(const WebDOMStringList& l) { assign(l); } + WebDOMStringList& operator=(const WebDOMStringList& l) + { + assign(l); + return *this; + } + + WEBKIT_API void reset(); + WEBKIT_API void assign(const WebDOMStringList&); + + WEBKIT_API void append(const WebString&); + WEBKIT_API unsigned length() const; + WEBKIT_API WebString item(unsigned) const; + +#if WEBKIT_IMPLEMENTATION + WebDOMStringList(const WTF::PassRefPtr<WebCore::DOMStringList>&); + WebDOMStringList& operator=(const WTF::PassRefPtr<WebCore::DOMStringList>&); + operator WTF::PassRefPtr<WebCore::DOMStringList>() const; +#endif + +private: + WebPrivatePtr<WebCore::DOMStringList> m_private; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h index d78a6f1..0f7421d 100644 --- a/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -56,6 +56,16 @@ public: virtual WebCString injectedScriptSource() { return WebCString(); } virtual WebCString injectedScriptDispatcherSource() { return WebCString(); } + class WebKitClientMessageLoop { + public: + virtual ~WebKitClientMessageLoop() { } + virtual void run() = 0; + virtual void quitNow() = 0; + }; + virtual WebKitClientMessageLoop* createClientMessageLoop() { return 0; } + + virtual bool exposeV8DebuggerProtocol() { return false; } + protected: ~WebDevToolsAgentClient() { } }; diff --git a/WebKit/chromium/public/WebDevToolsFrontendClient.h b/WebKit/chromium/public/WebDevToolsFrontendClient.h index 754ecf9..159a3cd 100644 --- a/WebKit/chromium/public/WebDevToolsFrontendClient.h +++ b/WebKit/chromium/public/WebDevToolsFrontendClient.h @@ -38,16 +38,18 @@ struct WebDevToolsMessageData; class WebDevToolsFrontendClient { public: - WebDevToolsFrontendClient() {} + WebDevToolsFrontendClient() { } - virtual void sendMessageToAgent(const WebDevToolsMessageData&) {}; - virtual void sendDebuggerCommandToAgent(const WebString& command) {}; - virtual void sendDebuggerPauseScript() {} + virtual void sendMessageToAgent(const WebDevToolsMessageData&) { } + virtual void sendDebuggerCommandToAgent(const WebString& command) { } + virtual void sendDebuggerPauseScript() { } - virtual void activateWindow() {}; - virtual void closeWindow() {}; - virtual void requestDockWindow() {}; - virtual void requestUndockWindow() {}; + virtual void activateWindow() { } + virtual void closeWindow() { } + virtual void requestDockWindow() { } + virtual void requestUndockWindow() { } + + virtual bool shouldHideScriptsPanel() { return false; } protected: virtual ~WebDevToolsFrontendClient() {} diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h index 1f09653..c093c58 100644 --- a/WebKit/chromium/public/WebDocument.h +++ b/WebKit/chromium/public/WebDocument.h @@ -62,6 +62,7 @@ public: // Returns the frame the document belongs to or 0 if the document is frameless. WEBKIT_API WebFrame* frame() const; WEBKIT_API bool isHTMLDocument() const; + WEBKIT_API bool isXHTMLDocument() const; WEBKIT_API bool isPluginDocument() const; WEBKIT_API WebURL baseURL() const; WEBKIT_API WebURL firstPartyForCookies() const; diff --git a/WebKit/chromium/public/WebGeolocationServiceMock.h b/WebKit/chromium/public/WebGeolocationServiceMock.h index 285f70c..d1a146b 100644 --- a/WebKit/chromium/public/WebGeolocationServiceMock.h +++ b/WebKit/chromium/public/WebGeolocationServiceMock.h @@ -32,7 +32,6 @@ #define WebGeolocationServiceMock_h #include "WebGeolocationService.h" -#include <wtf/HashMap.h> namespace WebKit { @@ -40,18 +39,12 @@ class WebString; class WebGeolocationServiceMock : public WebGeolocationService { public: + static WebGeolocationServiceMock* createWebGeolocationServiceMock(); static void setMockGeolocationPermission(bool allowed); static void setMockGeolocationPosition(double latitude, double longitude, double accuracy); static void setMockGeolocationError(int errorCode, const WebString& message); - virtual void requestPermissionForFrame(int bridgeId, const WebURL& url); - virtual int attachBridge(WebGeolocationServiceBridge*); - virtual void detachBridge(int bridgeId); - -private: - typedef HashMap<int, WebGeolocationServiceBridge*> IdToBridgeMap; - IdToBridgeMap m_idToBridgeMap; - +protected: static bool s_mockGeolocationPermission; }; diff --git a/WebKit/chromium/public/WebIDBCallbacks.h b/WebKit/chromium/public/WebIDBCallbacks.h index 610f7d4..bba7c74 100644 --- a/WebKit/chromium/public/WebIDBCallbacks.h +++ b/WebKit/chromium/public/WebIDBCallbacks.h @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -35,6 +32,7 @@ namespace WebKit { class WebIDBDatabase; class WebIDBDatabaseError; +class WebIDBIndex; class WebSerializedScriptValue; class WebIDBCallbacks { @@ -43,9 +41,11 @@ public: // For classes that follow the PImpl pattern, pass a const reference. // For the rest, pass ownership to the callee via a pointer. - virtual void onError(const WebIDBDatabaseError&) = 0; - virtual void onSuccess(WebIDBDatabase*) = 0; - virtual void onSuccess(const WebSerializedScriptValue&) = 0; + virtual void onError(const WebIDBDatabaseError&) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void onSuccess() { WEBKIT_ASSERT_NOT_REACHED(); } // For "null". + virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void onSuccess(WebIDBIndex*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void onSuccess(const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h index 403b4e8..0f65c6f 100644 --- a/WebKit/chromium/public/WebIDBDatabase.h +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -30,15 +27,19 @@ #define WebIDBDatabase_h #include "WebCommon.h" +#include "WebDOMStringList.h" namespace WebKit { -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIndexedDatabase for a high level overview of these classes. class WebIDBDatabase { public: virtual ~WebIDBDatabase() { } - // FIXME: Implement. + virtual WebString name() { return WebString(); } + virtual WebString description() { return WebString(); } + virtual WebString version() { return WebString(); } + virtual WebDOMStringList objectStores() { return WebDOMStringList(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h new file mode 100644 index 0000000..dafea0e --- /dev/null +++ b/WebKit/chromium/public/WebIDBIndex.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBIndex_h +#define WebIDBIndex_h + +#include "WebString.h" + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview of these classes. +class WebIDBIndex { +public: + virtual ~WebIDBIndex() { } + + virtual WebString name() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return WebString(); + } + virtual WebString keyPath() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return WebString(); + } + virtual bool unique() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return false; + } +}; + +} // namespace WebKit + +#endif // WebIDBIndex_h diff --git a/WebKit/chromium/public/WebIndexedDatabase.h b/WebKit/chromium/public/WebIndexedDatabase.h index 61b77a0..8e4bf5b 100644 --- a/WebKit/chromium/public/WebIndexedDatabase.h +++ b/WebKit/chromium/public/WebIndexedDatabase.h @@ -51,16 +51,16 @@ public: virtual ~WebIndexedDatabase() { } // The WebKit implementation of open ignores the WebFrame* parameter. - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, + virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode) { - open(name, description, modifyDatabase, callbacks, origin.toString(), webFrame, exceptionCode); + open(name, description, false, callbacks, origin, webFrame, exceptionCode); } // FIXME: Delete soon. Compatability hack. virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, - WebIDBCallbacks* callbacks, const WebString& origin, WebFrame* webFrame, int& exceptionCode) + WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode) { - open(name, description, modifyDatabase, callbacks, WebSecurityOrigin::createFromString(origin), webFrame, exceptionCode); + open(name, description, callbacks, origin, webFrame, exceptionCode); } }; diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index 9d64e2a..ab747e3 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -75,6 +75,9 @@ public: WEBKIT_API WebString title() const; WEBKIT_API WebString body() const; + WEBKIT_API WebString dir() const; + WEBKIT_API WebString replaceId() const; + // Called to indicate the notification has been displayed. WEBKIT_API void dispatchDisplayEvent(); diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index dd31ea0..de895e1 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -90,6 +90,8 @@ public: virtual void setExperimentalWebGLEnabled(bool) = 0; virtual void setShowDebugBorders(bool) = 0; virtual void setEditingBehavior(EditingBehavior) = 0; + virtual void setAcceleratedCompositingEnabled(bool) = 0; + virtual void setHTML5ParserEnabled(bool) = 0; protected: ~WebSettings() { } diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index 9ed98c6..56ea68d 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -210,6 +210,10 @@ public: // Settings used by the inspector. virtual WebString inspectorSettings() const = 0; virtual void setInspectorSettings(const WebString&) = 0; + virtual bool inspectorSetting(const WebString& key, + WebString* value) const = 0; + virtual void setInspectorSetting(const WebString& key, + const WebString& value) = 0; // The embedder may optionally engage a WebDevToolsAgent. This may only // be set once per WebView. diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 9478df9..e0fe71d 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -270,6 +270,8 @@ public: // changed and should be saved. See WebView::inspectorSettings. virtual void didUpdateInspectorSettings() { } + virtual void didUpdateInspectorSetting(const WebString& key, const WebString& value) { } + // Autofill ------------------------------------------------------------ diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 01e91a6..3b8e5fa 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -505,7 +505,7 @@ String ChromiumBridge::preferredExtensionForMIMEType(const String& mimeType) // Plugin --------------------------------------------------------------------- -bool ChromiumBridge::plugins(bool refresh, Vector<PluginInfo*>* results) +bool ChromiumBridge::plugins(bool refresh, Vector<PluginInfo>* results) { WebPluginListBuilderImpl builder(results); webKitClient()->getPluginList(refresh, &builder); diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp index 1c5117c..be658fe 100644 --- a/WebKit/chromium/src/DatabaseObserver.cpp +++ b/WebKit/chromium/src/DatabaseObserver.cpp @@ -67,19 +67,19 @@ bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecut void DatabaseObserver::databaseOpened(Database* database) { - ASSERT(isMainThread()); + ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseOpened(WebDatabase(database)); } void DatabaseObserver::databaseModified(Database* database) { - ASSERT(isMainThread()); + ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseModified(WebDatabase(database)); } void DatabaseObserver::databaseClosed(Database* database) { - ASSERT(isMainThread()); + ASSERT(database->scriptExecutionContext()->isContextThread()); WebDatabase::observer()->databaseClosed(WebDatabase(database)); } diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp index d3f7fea..a30675d 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -54,6 +54,8 @@ bool DebuggerAgentManager::s_inUtilityContext = false; bool DebuggerAgentManager::s_debugBreakDelayed = false; +bool DebuggerAgentManager::s_exposeV8DebuggerProtocol = false; + namespace { class CallerIdWrapper : public v8::Debug::ClientData, public Noncopyable { @@ -73,42 +75,6 @@ private: } // namespace -void DebuggerAgentManager::hostDispatchHandler(const Vector<WebCore::Page*>& pages) -{ - if (!s_messageLoopDispatchHandler) - return; - - if (s_inHostDispatchHandler) - return; - - s_inHostDispatchHandler = true; - - Vector<WebViewImpl*> views; - // 1. Disable active objects and input events. - for (size_t i = 0; i < pages.size(); i++) { - WebCore::Page* page = pages[i]; - WebViewImpl* view = WebViewImpl::fromPage(page); - s_pageDeferrers.set(view , new WebCore::PageGroupLoadDeferrer(page, true)); - views.append(view); - view->setIgnoreInputEvents(true); - } - - // 2. Process messages. - s_messageLoopDispatchHandler(); - - // 3. Bring things back. - for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end(); ++it) { - if (s_pageDeferrers.contains(*it)) { - // The view was not closed during the dispatch. - (*it)->setIgnoreInputEvents(false); - } - } - deleteAllValues(s_pageDeferrers); - s_pageDeferrers.clear(); - - s_inHostDispatchHandler = false; -} - void DebuggerAgentManager::debugHostDispatchHandler() { if (!s_messageLoopDispatchHandler || !s_attachedAgentsMap) @@ -154,7 +120,8 @@ DebuggerAgentManager::AttachedAgentsMap* DebuggerAgentManager::s_attachedAgentsM void DebuggerAgentManager::debugAttach(DebuggerAgentImpl* debuggerAgent) { #if ENABLE(V8_SCRIPT_DEBUG_SERVER) - return; + if (!s_exposeV8DebuggerProtocol) + return; #endif if (!s_attachedAgentsMap) { s_attachedAgentsMap = new AttachedAgentsMap(); @@ -169,7 +136,8 @@ void DebuggerAgentManager::debugAttach(DebuggerAgentImpl* debuggerAgent) void DebuggerAgentManager::debugDetach(DebuggerAgentImpl* debuggerAgent) { #if ENABLE(V8_SCRIPT_DEBUG_SERVER) - return; + if (!s_exposeV8DebuggerProtocol) + return; #endif if (!s_attachedAgentsMap) { ASSERT_NOT_REACHED(); @@ -292,9 +260,14 @@ void DebuggerAgentManager::executeDebuggerCommand(const String& command, int cal void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler) { s_messageLoopDispatchHandler = handler; - WebCore::ScriptDebugServer::setMessageLoopDispatchHandler(DebuggerAgentManager::hostDispatchHandler); } +void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value) +{ + s_exposeV8DebuggerProtocol = value; +} + + void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId) { ASSERT(hostId > 0); diff --git a/WebKit/chromium/src/DebuggerAgentManager.h b/WebKit/chromium/src/DebuggerAgentManager.h index a8bc7a3..dbb600a 100644 --- a/WebKit/chromium/src/DebuggerAgentManager.h +++ b/WebKit/chromium/src/DebuggerAgentManager.h @@ -70,6 +70,7 @@ public: static void pauseScript(); static void executeDebuggerCommand(const WebCore::String& command, int callerId); static void setMessageLoopDispatchHandler(WebDevToolsAgent::MessageLoopDispatchHandler handler); + static void setExposeV8DebuggerProtocol(bool); // Sets |hostId| as the frame context data. This id is used to filter scripts // related to the inspected page. @@ -100,7 +101,6 @@ private: DebuggerAgentManager(); ~DebuggerAgentManager(); - static void hostDispatchHandler(const Vector<WebCore::Page*>&); static void debugHostDispatchHandler(); static void onV8DebugMessage(const v8::Debug::Message& message); static void sendCommandToV8(const WebCore::String& cmd, @@ -120,6 +120,7 @@ private: static bool s_inUtilityContext; static bool s_debugBreakDelayed; + static bool s_exposeV8DebuggerProtocol; }; } // namespace WebKit diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index 4ecdcf7..4eda1f6 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -705,6 +705,7 @@ bool EditorClientImpl::autofill(HTMLInputElement* inputElement, m_autofillArgs.clear(); m_autofillTimer.stop(); + // FIXME: Remove the extraneous isEnabledFormControl call below. // Let's try to trigger autofill for that field, if applicable. if (!inputElement->isEnabledFormControl() || !inputElement->isTextField() || inputElement->isPasswordField() || !inputElement->autoComplete() diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 17d9416..694d7c2 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1372,20 +1372,6 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( const String& mimeType, bool loadManually) { -#if !OS(WINDOWS) - // WebCore asks us to make a plugin even if we don't have a - // registered handler, with a comment saying it's so we can display - // the broken plugin icon. In Chromium, we normally register a - // fallback plugin handler that allows you to install a missing - // plugin. Since we don't yet have a default plugin handler, we - // need to return null here rather than going through all the - // plugin-creation IPCs only to discover we don't have a plugin - // registered, which causes a crash. - // FIXME: remove me once we have a default plugin. - if (objectContentType(url, mimeType) != ObjectContentNetscapePlugin) - return 0; -#endif - if (!m_webFrame->client()) return 0; diff --git a/WebKit/chromium/src/IDBCallbacksProxy.cpp b/WebKit/chromium/src/IDBCallbacksProxy.cpp index 2bdf140..3e5f00a 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -34,6 +34,7 @@ #include "WebIDBCallbacks.h" #include "WebIDBDatabaseImpl.h" #include "WebIDBDatabaseError.h" +#include "WebIDBIndexImpl.h" #include "WebSerializedScriptValue.h" #if ENABLE(INDEXED_DATABASE) @@ -60,12 +61,24 @@ void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError) m_callbacks.clear(); } +void IDBCallbacksProxy::onSuccess() +{ + m_callbacks->onSuccess(); + m_callbacks.clear(); +} + void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabase> idbDatabase) { m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(idbDatabase)); m_callbacks.clear(); } +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBIndex> idbIndex) +{ + m_callbacks->onSuccess(new WebKit::WebIDBIndexImpl(idbIndex)); + m_callbacks.clear(); +} + void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { m_callbacks->onSuccess(WebKit::WebSerializedScriptValue(serializedScriptValue)); diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h index 5d4bc0b..d98e2ed 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/WebKit/chromium/src/IDBCallbacksProxy.h @@ -51,7 +51,9 @@ public: virtual ~IDBCallbacksProxy(); virtual void onError(PassRefPtr<IDBDatabaseError>); + virtual void onSuccess(); // For "null". virtual void onSuccess(PassRefPtr<IDBDatabase>); + virtual void onSuccess(PassRefPtr<IDBIndex>); virtual void onSuccess(PassRefPtr<SerializedScriptValue>); private: diff --git a/WebKit/chromium/src/IDBDatabaseProxy.cpp b/WebKit/chromium/src/IDBDatabaseProxy.cpp index d12ec70..deb2f99 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/WebKit/chromium/src/IDBDatabaseProxy.cpp @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -29,7 +26,7 @@ #include "config.h" #include "IDBDatabaseProxy.h" -#include "IDBDatabaseError.h" +#include "DOMStringList.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" @@ -51,7 +48,26 @@ IDBDatabaseProxy::~IDBDatabaseProxy() { } +String IDBDatabaseProxy::name() +{ + return m_webIDBDatabase->name(); +} + +String IDBDatabaseProxy::description() +{ + return m_webIDBDatabase->description(); +} + +String IDBDatabaseProxy::version() +{ + return m_webIDBDatabase->version(); +} + +PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStores() +{ + return m_webIDBDatabase->objectStores(); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) - diff --git a/WebKit/chromium/src/IDBDatabaseProxy.h b/WebKit/chromium/src/IDBDatabaseProxy.h index ac96a15..e5e5125 100644 --- a/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/WebKit/chromium/src/IDBDatabaseProxy.h @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -45,6 +42,11 @@ public: static PassRefPtr<IDBDatabase> create(PassOwnPtr<WebKit::WebIDBDatabase>); virtual ~IDBDatabaseProxy(); + virtual String name(); + virtual String description(); + virtual String version(); + virtual PassRefPtr<DOMStringList> objectStores(); + // FIXME: Add other methods. private: @@ -58,4 +60,3 @@ private: #endif #endif // IDBDatabaseProxy_h - diff --git a/WebKit/chromium/src/IDBIndexProxy.cpp b/WebKit/chromium/src/IDBIndexProxy.cpp new file mode 100644 index 0000000..f80eff3 --- /dev/null +++ b/WebKit/chromium/src/IDBIndexProxy.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "IDBIndexProxy.h" + +#include "WebIDBDatabaseError.h" +#include "WebIDBIndex.h" + +#if ENABLE(INDEXED_DATABASE) + +namespace WebCore { + +PassRefPtr<IDBIndex> IDBIndexProxy::create(PassOwnPtr<WebKit::WebIDBIndex> Index) +{ + return adoptRef(new IDBIndexProxy(Index)); +} + +IDBIndexProxy::IDBIndexProxy(PassOwnPtr<WebKit::WebIDBIndex> Index) + : m_webIDBIndex(Index) +{ +} + +IDBIndexProxy::~IDBIndexProxy() +{ +} + +String IDBIndexProxy::name() +{ + return m_webIDBIndex->name(); +} + +String IDBIndexProxy::keyPath() +{ + return m_webIDBIndex->keyPath(); +} + +bool IDBIndexProxy::unique() +{ + return m_webIDBIndex->unique(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBIndexProxy.h b/WebKit/chromium/src/IDBIndexProxy.h new file mode 100644 index 0000000..35e6b30 --- /dev/null +++ b/WebKit/chromium/src/IDBIndexProxy.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef IDBIndexProxy_h +#define IDBIndexProxy_h + +#include "IDBIndex.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> + +#if ENABLE(INDEXED_DATABASE) + +namespace WebKit { class WebIDBIndex; } + +namespace WebCore { + +class IDBIndexProxy : public IDBIndex { +public: + static PassRefPtr<IDBIndex> create(PassOwnPtr<WebKit::WebIDBIndex>); + virtual ~IDBIndexProxy(); + + virtual String name(); + virtual String keyPath(); + virtual bool unique(); + + // FIXME: Add other methods. + +private: + IDBIndexProxy(PassOwnPtr<WebKit::WebIDBIndex>); + + OwnPtr<WebKit::WebIDBIndex> m_webIDBIndex; +}; + +} // namespace WebCore + +#endif + +#endif // IDBIndexProxy_h diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.cpp b/WebKit/chromium/src/IndexedDatabaseProxy.cpp index aed7c13..2572877 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.cpp +++ b/WebKit/chromium/src/IndexedDatabaseProxy.cpp @@ -57,12 +57,12 @@ IndexedDatabaseProxy::~IndexedDatabaseProxy() { } -void IndexedDatabaseProxy::open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, ExceptionCode& ec) +void IndexedDatabaseProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, ExceptionCode& ec) { if (!frame || !frame->document()) return; WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIndexedDatabase->open(name, description, modifyDatabase, new WebIDBCallbacksImpl(callbacks), origin, webFrame, ec); + m_webIndexedDatabase->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, ec); } } // namespace WebCore diff --git a/WebKit/chromium/src/IndexedDatabaseProxy.h b/WebKit/chromium/src/IndexedDatabaseProxy.h index e372e9a..206099c 100644 --- a/WebKit/chromium/src/IndexedDatabaseProxy.h +++ b/WebKit/chromium/src/IndexedDatabaseProxy.h @@ -42,7 +42,7 @@ public: static PassRefPtr<IndexedDatabase> create(); virtual ~IndexedDatabaseProxy(); - virtual void open(const String& name, const String& description, bool modifyDatabase, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, ExceptionCode&); + virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, ExceptionCode&); private: IndexedDatabaseProxy(); diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp index f69ef72..22b515f 100644 --- a/WebKit/chromium/src/InspectorClientImpl.cpp +++ b/WebKit/chromium/src/InspectorClientImpl.cpp @@ -33,10 +33,8 @@ #include "DOMWindow.h" #include "FloatRect.h" -#include "InspectorController.h" #include "NotImplemented.h" #include "Page.h" -#include "Settings.h" #include "WebRect.h" #include "WebURL.h" #include "WebURLRequest.h" @@ -94,65 +92,14 @@ void InspectorClientImpl::hideHighlight() void InspectorClientImpl::populateSetting(const String& key, String* value) { - loadSettings(); - if (m_settings->contains(key)) - *value = m_settings->get(key); + WebString string; + m_inspectedWebView->inspectorSetting(key, &string); + *value = string; } void InspectorClientImpl::storeSetting(const String& key, const String& value) { - loadSettings(); - m_settings->set(key, value); - saveSettings(); -} - -void InspectorClientImpl::loadSettings() -{ - if (m_settings) - return; - - m_settings.set(new SettingsMap); - String data = m_inspectedWebView->inspectorSettings(); - if (data.isEmpty()) - return; - - Vector<String> entries; - data.split("\n", entries); - for (Vector<String>::iterator it = entries.begin(); it != entries.end(); ++it) { - Vector<String> tokens; - it->split(":", tokens); - if (tokens.size() < 3) - continue; - - String name = decodeURLEscapeSequences(tokens[0]); - String type = tokens[1]; - String value = tokens[2]; - for (size_t i = 3; i < tokens.size(); ++i) - value += ":" + tokens[i]; - - if (type == "string") - value = decodeURLEscapeSequences(value); - - m_settings->set(name, value); - } -} - -void InspectorClientImpl::saveSettings() -{ - String data; - for (SettingsMap::iterator it = m_settings->begin(); it != m_settings->end(); ++it) { - String name = encodeWithURLEscapeSequences(it->first); - String value = it->second; - String entry = String::format( - "%s:string:%s", - name.utf8().data(), - encodeWithURLEscapeSequences(value).utf8().data()); - data.append(entry); - data.append("\n"); - } - m_inspectedWebView->setInspectorSettings(data); - if (m_inspectedWebView->client()) - m_inspectedWebView->client()->didUpdateInspectorSettings(); + m_inspectedWebView->setInspectorSetting(key, value); } } // namespace WebKit diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h index ccbcef7..7447d0c 100644 --- a/WebKit/chromium/src/InspectorClientImpl.h +++ b/WebKit/chromium/src/InspectorClientImpl.h @@ -56,14 +56,9 @@ public: const WebCore::String& value); private: - void loadSettings(); - void saveSettings(); // The WebViewImpl of the page being inspected; gets passed to the constructor WebViewImpl* m_inspectedWebView; - - typedef HashMap<WebCore::String, WebCore::String> SettingsMap; - OwnPtr<SettingsMap> m_settings; }; } // namespace WebKit diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp index 9ff3938..6f7ed95 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp @@ -90,6 +90,8 @@ String InspectorFrontendClientImpl::localizedStringsURL() String InspectorFrontendClientImpl::hiddenPanels() { + if (m_client->shouldHideScriptsPanel()) + return "scripts"; return ""; } diff --git a/WebKit/chromium/src/WebDOMStringList.cpp b/WebKit/chromium/src/WebDOMStringList.cpp new file mode 100644 index 0000000..cd145bf --- /dev/null +++ b/WebKit/chromium/src/WebDOMStringList.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebDOMStringList.h" + +#include "DOMStringList.h" +#include "WebString.h" + +using namespace WebCore; + +namespace WebKit { + +void WebDOMStringList::reset() +{ + m_private.reset(); +} + +void WebDOMStringList::assign(const WebDOMStringList& other) +{ + m_private = other.m_private; +} + +void WebDOMStringList::append(const WebString& string) +{ + m_private->append(string); +} + +unsigned WebDOMStringList::length() const +{ + return m_private->length(); +} + +WebString WebDOMStringList::item(unsigned index) const +{ + return m_private->item(index); +} + +WebDOMStringList::WebDOMStringList(const WTF::PassRefPtr<WebCore::DOMStringList>& item) + : m_private(item) +{ +} + +WebDOMStringList& WebDOMStringList::operator=(const WTF::PassRefPtr<WebCore::DOMStringList>& item) +{ + m_private = item; + return *this; +} + +WebDOMStringList::operator WTF::PassRefPtr<WebCore::DOMStringList>() const +{ + return m_private.get(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 0969d37..8dde31f 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -43,11 +43,13 @@ #include "InspectorResource.h" #include "Node.h" #include "Page.h" +#include "PageGroup.h" #include "PlatformString.h" #include "ProfilerAgentImpl.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "ResourceResponse.h" +#include "ScriptDebugServer.h" #include "ScriptObject.h" #include "ScriptState.h" #include "ScriptValue.h" @@ -129,6 +131,90 @@ public: } }; +class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop { +public: + static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) + { + if (s_instance) + return; + s_instance = new ClientMessageLoopAdapter(client->createClientMessageLoop()); + WebCore::ScriptDebugServer::shared().setClientMessageLoop(s_instance); + } + + static void inspectedViewClosed(WebViewImpl* view) + { + if (s_instance) + s_instance->m_frozenViews.remove(view); + } + + static void didNavigate() + { + // Release render thread if necessary. + if (s_instance && s_instance->m_running) + WebCore::ScriptDebugServer::shared().continueProgram(); + } + +private: + ClientMessageLoopAdapter(PassOwnPtr<WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop> messageLoop) + : m_running(false) + , m_messageLoop(messageLoop) { } + + + virtual void run(Page* page) + { + if (m_running) + return; + m_running = true; + + Vector<WebViewImpl*> views; + + // 1. Disable input events. + HashSet<Page*>::const_iterator end = page->group().pages().end(); + for (HashSet<Page*>::const_iterator it = page->group().pages().begin(); it != end; ++it) { + WebViewImpl* view = WebViewImpl::fromPage(*it); + m_frozenViews.add(view); + views.append(view); + view->setIgnoreInputEvents(true); + } + + // 2. Disable active objects + WebView::willEnterModalLoop(); + + // 3. Process messages until quitNow is called. + m_messageLoop->run(); + + // 4. Resume active objects + WebView::didExitModalLoop(); + + // 5. Resume input events. + for (Vector<WebViewImpl*>::iterator it = views.begin(); it != views.end(); ++it) { + if (m_frozenViews.contains(*it)) { + // The view was not closed during the dispatch. + (*it)->setIgnoreInputEvents(false); + } + } + + // 6. All views have been resumed, clear the set. + m_frozenViews.clear(); + + m_running = false; + } + + virtual void quitNow() + { + m_messageLoop->quitNow(); + } + + bool m_running; + OwnPtr<WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop> m_messageLoop; + typedef HashSet<WebViewImpl*> FrozenViewsSet; + FrozenViewsSet m_frozenViews; + static ClientMessageLoopAdapter* s_instance; + +}; + +ClientMessageLoopAdapter* ClientMessageLoopAdapter::s_instance = 0; + } // namespace WebDevToolsAgentImpl::WebDevToolsAgentImpl( @@ -141,6 +227,8 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl( , m_resourceTrackingWasEnabled(false) , m_attached(false) { + DebuggerAgentManager::setExposeV8DebuggerProtocol( + client->exposeV8DebuggerProtocol()); m_debuggerAgentDelegateStub.set(new DebuggerAgentDelegateStub(this)); m_toolsAgentDelegateStub.set(new ToolsAgentDelegateStub(this)); m_apuAgentDelegateStub.set(new ApuAgentDelegateStub(this)); @@ -149,6 +237,9 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl( WebDevToolsAgentImpl::~WebDevToolsAgentImpl() { DebuggerAgentManager::onWebViewClosed(m_webViewImpl); +#if ENABLE(V8_SCRIPT_DEBUG_SERVER) + ClientMessageLoopAdapter::inspectedViewClosed(m_webViewImpl); +#endif disposeUtilityContext(); } @@ -164,6 +255,12 @@ void WebDevToolsAgentImpl::attach() { if (m_attached) return; + +#if ENABLE(V8_SCRIPT_DEBUG_SERVER) + if (!m_client->exposeV8DebuggerProtocol()) + ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client); +#endif + m_debuggerAgentImpl.set( new DebuggerAgentImpl(m_webViewImpl, m_debuggerAgentDelegateStub.get(), @@ -203,6 +300,9 @@ void WebDevToolsAgentImpl::detach() void WebDevToolsAgentImpl::didNavigate() { +#if ENABLE(V8_SCRIPT_DEBUG_SERVER) + ClientMessageLoopAdapter::didNavigate(); +#endif DebuggerAgentManager::onNavigate(); } diff --git a/WebKit/chromium/src/WebDocument.cpp b/WebKit/chromium/src/WebDocument.cpp index 21e2bb8..017716d 100644 --- a/WebKit/chromium/src/WebDocument.cpp +++ b/WebKit/chromium/src/WebDocument.cpp @@ -62,6 +62,11 @@ bool WebDocument::isHTMLDocument() const return constUnwrap<Document>()->isHTMLDocument(); } +bool WebDocument::isXHTMLDocument() const +{ + return constUnwrap<Document>()->isXHTMLDocument(); +} + bool WebDocument::isPluginDocument() const { return constUnwrap<Document>()->isPluginDocument(); diff --git a/WebKit/chromium/src/WebFormControlElement.cpp b/WebKit/chromium/src/WebFormControlElement.cpp index 0530776..007673e 100644 --- a/WebKit/chromium/src/WebFormControlElement.cpp +++ b/WebKit/chromium/src/WebFormControlElement.cpp @@ -45,12 +45,12 @@ bool WebFormControlElement::isEnabled() const WebString WebFormControlElement::formControlName() const { - return constUnwrap<HTMLFormControlElement>()->formControlName(); + return constUnwrap<HTMLFormControlElement>()->name(); } WebString WebFormControlElement::formControlType() const { - return constUnwrap<HTMLFormControlElement>()->formControlType(); + return constUnwrap<HTMLFormControlElement>()->type(); } WebString WebFormControlElement::nameForAutofill() const diff --git a/WebKit/chromium/src/WebFormElement.cpp b/WebKit/chromium/src/WebFormElement.cpp index 7952479..8b4ce04 100644 --- a/WebKit/chromium/src/WebFormElement.cpp +++ b/WebKit/chromium/src/WebFormElement.cpp @@ -82,10 +82,13 @@ void WebFormElement::getFormControlElements(WebVector<WebFormControlElement>& re { const HTMLFormElement* form = constUnwrap<HTMLFormElement>(); Vector<RefPtr<HTMLFormControlElement> > tempVector; - for (size_t i = 0; i < form->formElements.size(); i++) { - if (form->formElements[i]->hasLocalName(HTMLNames::inputTag) - || form->formElements[i]->hasLocalName(HTMLNames::selectTag)) - tempVector.append(form->formElements[i]); + // FIXME: We should move the for-loop condition into a variable instead of + // re-evaluating size each time. Also, consider refactoring this code so that + // we don't call form->associatedElements() multiple times. + for (size_t i = 0; i < form->associatedElements().size(); i++) { + if (form->associatedElements()[i]->hasLocalName(HTMLNames::inputTag) + || form->associatedElements()[i]->hasLocalName(HTMLNames::selectTag)) + tempVector.append(form->associatedElements()[i]); } result.assign(tempVector); } diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index b678459..bb1f6ce 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -75,21 +75,20 @@ #include "ChromiumBridge.h" #include "ClipboardUtilitiesChromium.h" #include "Console.h" +#include "DOMUtilitiesPrivate.h" +#include "DOMWindow.h" #include "Document.h" #include "DocumentFragment.h" // Only needed for ReplaceSelectionCommand.h :( #include "DocumentLoader.h" #include "DocumentMarker.h" -#include "DOMUtilitiesPrivate.h" -#include "DOMWindow.h" #include "Editor.h" #include "EventHandler.h" #include "FormState.h" -#include "FrameLoader.h" #include "FrameLoadRequest.h" +#include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" #include "GraphicsContext.h" -#include "HistoryItem.h" #include "HTMLCollection.h" #include "HTMLFormElement.h" #include "HTMLFrameOwnerElement.h" @@ -97,8 +96,8 @@ #include "HTMLInputElement.h" #include "HTMLLinkElement.h" #include "HTMLNames.h" +#include "HistoryItem.h" #include "InspectorController.h" -#include "markup.h" #include "Page.h" #include "PlatformContextSkia.h" #include "PluginDocument.h" @@ -113,8 +112,8 @@ #include "ScriptController.h" #include "ScriptSourceCode.h" #include "ScriptValue.h" -#include "ScrollbarTheme.h" #include "ScrollTypes.h" +#include "ScrollbarTheme.h" #include "SelectionController.h" #include "Settings.h" #include "SkiaUtils.h" @@ -141,6 +140,7 @@ #include "WebVector.h" #include "WebViewImpl.h" #include "XPathResult.h" +#include "markup.h" #include <algorithm> #include <wtf/CurrentTime.h> @@ -1100,11 +1100,11 @@ bool WebFrameImpl::executeCommand(const WebString& name) // support. if (command == "DeleteToEndOfParagraph") { Editor* editor = frame()->editor(); - if (!editor->deleteWithDirection(SelectionController::FORWARD, + if (!editor->deleteWithDirection(SelectionController::DirectionForward, ParagraphBoundary, true, false)) { - editor->deleteWithDirection(SelectionController::FORWARD, + editor->deleteWithDirection(SelectionController::DirectionForward, CharacterGranularity, true, false); @@ -1290,7 +1290,7 @@ bool WebFrameImpl::find(int identifier, if (!options.findNext) frame()->page()->unmarkAllTextMatches(); else - setMarkerActive(m_activeMatch.get(), false); // Active match is changing. + setMarkerActive(m_activeMatch.get(), false); // Active match is changing. // Starts the search from the current selection. bool startInSelection = true; @@ -1330,7 +1330,7 @@ bool WebFrameImpl::find(int identifier, else { m_activeMatch = newSelection.toNormalizedRange(); currSelectionRect = m_activeMatch->boundingBox(); - setMarkerActive(m_activeMatch.get(), true); // Active. + setMarkerActive(m_activeMatch.get(), true); // Active. // WebKit draws the highlighting for all matches. executeCommand(WebString::fromUTF8("Unselect")); } @@ -1425,7 +1425,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, identifier, searchText, options, - false); // false=we just reset, so don't do it again. + false); // false=we just reset, so don't do it again. return; } @@ -1439,7 +1439,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, m_resumeScopingFromRange->startOffset(ec2) + 1, ec); if (ec || ec2) { - if (ec2) // A non-zero |ec| happens when navigating during search. + if (ec2) // A non-zero |ec| happens when navigating during search. ASSERT_NOT_REACHED(); return; } @@ -1448,7 +1448,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, // This timeout controls how long we scope before releasing control. This // value does not prevent us from running for longer than this, but it is // periodically checked to see if we have exceeded our allocated time. - const double maxScopingDuration = 0.1; // seconds + const double maxScopingDuration = 0.1; // seconds int matchCount = 0; bool timedOut = false; @@ -1555,8 +1555,8 @@ void WebFrameImpl::scopeStringMatches(int identifier, identifier, searchText, options, - false); // don't reset. - return; // Done for now, resume work later. + false); // don't reset. + return; // Done for now, resume work later. } // This frame has no further scoping left, so it is done. Other frames might, @@ -1738,7 +1738,7 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame( // it is necessary to check the value after calling init() and // return without loading URL. // (b:791612) - childFrame->init(); // create an empty document + childFrame->init(); // create an empty document if (!childFrame->tree()->parent()) return 0; @@ -2065,7 +2065,7 @@ bool WebFrameImpl::shouldScopeMatches(const String& searchText) searchText.substring(0, m_lastSearchString.length()); if (previousSearchPrefix == m_lastSearchString) - return false; // Don't search this frame, it will be fruitless. + return false; // Don't search this frame, it will be fruitless. } return true; diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp index 2eed352..00d819b 100644 --- a/WebKit/chromium/src/WebGeolocationServiceMock.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp @@ -36,6 +36,7 @@ #include "GeolocationServiceMock.h" #include "WebString.h" #include <wtf/CurrentTime.h> +#include <wtf/HashMap.h> #if ENABLE(GEOLOCATION) @@ -121,8 +122,25 @@ void GeolocationServiceChromiumMock::geolocationServiceErrorOccurred(Geolocation namespace WebKit { +class WebGeolocationServiceMockImpl : public WebGeolocationServiceMock { +public: + virtual ~WebGeolocationServiceMockImpl() { } + virtual void requestPermissionForFrame(int bridgeId, const WebURL& url); + virtual int attachBridge(WebGeolocationServiceBridge*); + virtual void detachBridge(int bridgeId); + +private: + typedef HashMap<int, WebGeolocationServiceBridge*> IdToBridgeMap; + IdToBridgeMap m_idToBridgeMap; +}; + bool WebGeolocationServiceMock::s_mockGeolocationPermission = false; +WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServiceMock() +{ + return new WebGeolocationServiceMockImpl; +} + void WebGeolocationServiceMock::setMockGeolocationPermission(bool allowed) { s_mockGeolocationPermission = allowed; @@ -142,7 +160,7 @@ void WebGeolocationServiceMock::setMockGeolocationError(int errorCode, const Web GeolocationServiceMock::setError(positionError); } -void WebGeolocationServiceMock::requestPermissionForFrame(int bridgeId, const WebURL& url) +void WebGeolocationServiceMockImpl::requestPermissionForFrame(int bridgeId, const WebURL& url) { IdToBridgeMap::iterator iter = m_idToBridgeMap.find(bridgeId); if (iter == m_idToBridgeMap.end()) @@ -150,7 +168,7 @@ void WebGeolocationServiceMock::requestPermissionForFrame(int bridgeId, const We iter->second->setIsAllowed(s_mockGeolocationPermission); } -int WebGeolocationServiceMock::attachBridge(WebGeolocationServiceBridge* bridge) +int WebGeolocationServiceMockImpl::attachBridge(WebGeolocationServiceBridge* bridge) { static int nextAvailableWatchId = 1; // In case of overflow, make sure the ID remains positive, but reuse the ID values. @@ -160,7 +178,7 @@ int WebGeolocationServiceMock::attachBridge(WebGeolocationServiceBridge* bridge) return nextAvailableWatchId++; } -void WebGeolocationServiceMock::detachBridge(int bridgeId) +void WebGeolocationServiceMockImpl::detachBridge(int bridgeId) { m_idToBridgeMap.remove(bridgeId); } diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index e7e0c32..4d24ea9 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -593,6 +593,50 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) notImplemented(); } + if (m_attributes.antialias) { + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_multisampleFBO); + if (m_boundFBO == m_multisampleFBO) + mustRestoreFBO = false; + } + + // Initialize renderbuffers to 0. + GLboolean colorMask[] = {GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE}, depthMask = GL_TRUE, stencilMask = GL_TRUE; + GLboolean isScissorEnabled = GL_FALSE; + GLboolean isDitherEnabled = GL_FALSE; + GLbitfield clearMask = GL_COLOR_BUFFER_BIT; + glGetBooleanv(GL_COLOR_WRITEMASK, colorMask); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + if (m_attributes.depth) { + glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask); + glDepthMask(GL_TRUE); + clearMask |= GL_DEPTH_BUFFER_BIT; + } + if (m_attributes.stencil) { + glGetBooleanv(GL_STENCIL_WRITEMASK, &stencilMask); + glStencilMask(GL_TRUE); + clearMask |= GL_STENCIL_BUFFER_BIT; + } + isScissorEnabled = glIsEnabled(GL_SCISSOR_TEST); + glDisable(GL_SCISSOR_TEST); + isDitherEnabled = glIsEnabled(GL_DITHER); + glDisable(GL_DITHER); + + glClear(clearMask); + + glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]); + if (m_attributes.depth) + glDepthMask(depthMask); + if (m_attributes.stencil) + glStencilMask(stencilMask); + if (isScissorEnabled) + glEnable(GL_SCISSOR_TEST); + else + glDisable(GL_SCISSOR_TEST); + if (isDitherEnabled) + glEnable(GL_DITHER); + else + glDisable(GL_DITHER); + if (mustRestoreFBO) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); #endif // RENDER_TO_DEBUGGING_WINDOW @@ -604,13 +648,6 @@ void WebGraphicsContext3DDefaultImpl::reshape(int width, int height) } m_scanline = new unsigned char[width * 4]; #endif // FLIP_FRAMEBUFFER_VERTICALLY - - GLbitfield clearMask = GL_COLOR_BUFFER_BIT; - if (m_attributes.stencil) - clearMask |= GL_STENCIL_BUFFER_BIT; - if (m_attributes.depth) - clearMask |= GL_DEPTH_BUFFER_BIT; - glClear(clearMask); } #ifdef FLIP_FRAMEBUFFER_VERTICALLY diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index 8f88cb6..ea1c0b1 100644 --- a/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -32,9 +29,11 @@ #include "IDBCallbacks.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" +#include "IDBIndexProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" +#include "WebIDBIndex.h" #include "WebSerializedScriptValue.h" #if ENABLE(INDEXED_DATABASE) @@ -56,12 +55,24 @@ void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error) m_callbacks.clear(); } +void WebIDBCallbacksImpl::onSuccess() +{ + m_callbacks->onSuccess(); + m_callbacks.clear(); +} + void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) { m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); m_callbacks.clear(); } +void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBIndex* webKitInstance) +{ + m_callbacks->onSuccess(IDBIndexProxy::create(webKitInstance)); + m_callbacks.clear(); +} + void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) { m_callbacks->onSuccess(serializedScriptValue); @@ -71,4 +82,3 @@ void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& seri } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) - diff --git a/WebKit/chromium/src/WebIDBCallbacksImpl.h b/WebKit/chromium/src/WebIDBCallbacksImpl.h index 9b53117..8e5ada7 100644 --- a/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -35,24 +32,20 @@ #if ENABLE(INDEXED_DATABASE) -namespace WebKit { -class WebIDBDatabase; -class WebIDBDatabaseError; -class WebSerializedScriptValue; -} - namespace WebCore { class IDBCallbacks; class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks { public: - WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks); + WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks>); virtual ~WebIDBCallbacksImpl(); - virtual void onError(const WebKit::WebIDBDatabaseError& error); - virtual void onSuccess(WebKit::WebIDBDatabase* webKitInstance); - virtual void onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue); + virtual void onError(const WebKit::WebIDBDatabaseError&); + virtual void onSuccess(); // For "null". + virtual void onSuccess(WebKit::WebIDBDatabase*); + virtual void onSuccess(WebKit::WebIDBIndex*); + virtual void onSuccess(const WebKit::WebSerializedScriptValue&); private: RefPtr<IDBCallbacks> m_callbacks; diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index e33edc2..3a00ccb 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -29,6 +26,7 @@ #include "config.h" #include "WebIDBDatabaseImpl.h" +#include "DOMStringList.h" #include "IDBDatabase.h" #if ENABLE(INDEXED_DATABASE) @@ -38,6 +36,7 @@ using namespace WebCore; namespace WebKit { WebIDBDatabaseImpl::WebIDBDatabaseImpl(PassRefPtr<IDBDatabase> idbDatabase) + : m_idbDatabase(idbDatabase) { } @@ -45,6 +44,26 @@ WebIDBDatabaseImpl::~WebIDBDatabaseImpl() { } +WebString WebIDBDatabaseImpl::name() +{ + return m_idbDatabase->name(); +} + +WebString WebIDBDatabaseImpl::description() +{ + return m_idbDatabase->description(); +} + +WebString WebIDBDatabaseImpl::version() +{ + return m_idbDatabase->version(); +} + +WebDOMStringList WebIDBDatabaseImpl::objectStores() +{ + return m_idbDatabase->objectStores(); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h index 758f84a..f99a759 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -10,9 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED @@ -44,7 +41,10 @@ public: WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabase> idbDatabase); virtual ~WebIDBDatabaseImpl(); - // FIXME: Implement. + virtual WebString name(); + virtual WebString description(); + virtual WebString version(); + virtual WebDOMStringList objectStores(); private: WTF::RefPtr<WebCore::IDBDatabase> m_idbDatabase; diff --git a/WebKit/chromium/src/WebIDBIndexImpl.cpp b/WebKit/chromium/src/WebIDBIndexImpl.cpp new file mode 100644 index 0000000..304217c --- /dev/null +++ b/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebIDBIndexImpl.h" + +#include "IDBIndex.h" + +#if ENABLE(INDEXED_DATABASE) + +using namespace WebCore; + +namespace WebKit { + +WebIDBIndexImpl::WebIDBIndexImpl(PassRefPtr<IDBIndex> idbIndex) + : m_idbIndex(idbIndex) +{ +} + +WebIDBIndexImpl::~WebIDBIndexImpl() +{ +} + +WebString WebIDBIndexImpl::name() const +{ + return m_idbIndex->name(); +} + +WebString WebIDBIndexImpl::keyPath() const +{ + return m_idbIndex->keyPath(); +} + +bool WebIDBIndexImpl::unique() const +{ + return m_idbIndex->unique(); +} + +} // namespace WebCore + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBIndexImpl.h b/WebKit/chromium/src/WebIDBIndexImpl.h new file mode 100644 index 0000000..e1f0538 --- /dev/null +++ b/WebKit/chromium/src/WebIDBIndexImpl.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebIDBIndexImpl_h +#define WebIDBIndexImpl_h + +#include "WebCommon.h" +#include "WebIDBIndex.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { class IDBIndex; } + +namespace WebKit { + +// See comment in WebIndexedDatabase for a high level overview these classes. +class WebIDBIndexImpl : public WebIDBIndex { +public: + WebIDBIndexImpl(WTF::PassRefPtr<WebCore::IDBIndex> idbIndex); + virtual ~WebIDBIndexImpl(); + + virtual WebString name() const; + virtual WebString keyPath() const; + virtual bool unique() const; + +private: + WTF::RefPtr<WebCore::IDBIndex> m_idbIndex; +}; + +} // namespace WebKit + +#endif // WebIDBIndexImpl_h diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp index 99aad39..00122ad 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.cpp @@ -57,9 +57,9 @@ WebIndexedDatabaseImpl::~WebIndexedDatabaseImpl() { } -void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, int& exceptionCode) +void WebIndexedDatabaseImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, int& exceptionCode) { - m_indexedDatabase->open(name, description, modifyDatabase, IDBCallbacksProxy::create(callbacks), origin, 0, exceptionCode); + m_indexedDatabase->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, exceptionCode); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebIndexedDatabaseImpl.h b/WebKit/chromium/src/WebIndexedDatabaseImpl.h index 57d20a6..072a92b 100644 --- a/WebKit/chromium/src/WebIndexedDatabaseImpl.h +++ b/WebKit/chromium/src/WebIndexedDatabaseImpl.h @@ -41,7 +41,7 @@ public: WebIndexedDatabaseImpl(); virtual ~WebIndexedDatabaseImpl(); - virtual void open(const WebString& name, const WebString& description, bool modifyDatabase, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, int& exceptionCode); + virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, int& exceptionCode); private: WTF::RefPtr<WebCore::IndexedDatabase> m_indexedDatabase; diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp index 5200d17..5ae1557 100644 --- a/WebKit/chromium/src/WebNotification.cpp +++ b/WebKit/chromium/src/WebNotification.cpp @@ -94,6 +94,16 @@ WebString WebNotification::body() const return m_private->contents().body(); } +WebString WebNotification::dir() const +{ + return m_private->dir(); +} + +WebString WebNotification::replaceId() const +{ + return m_private->replaceId(); +} + void WebNotification::dispatchDisplayEvent() { RefPtr<Event> event = Event::create("display", false, true); diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp index 766dc63..e5d5411 100644 --- a/WebKit/chromium/src/WebPasswordFormUtils.cpp +++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp @@ -65,7 +65,7 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields) int firstPasswordIndex = 0; // First, find the password fields and activated submit button - const Vector<HTMLFormControlElement*>& formElements = form->formElements; + const Vector<HTMLFormControlElement*>& formElements = form->associatedElements(); for (size_t i = 0; i < formElements.size(); i++) { HTMLFormControlElement* formElement = formElements[i]; if (formElement->isActivatedSubmit()) diff --git a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp index 6926a2d..8f5a1f7 100644 --- a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp +++ b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp @@ -41,27 +41,28 @@ namespace WebKit { void WebPluginListBuilderImpl::addPlugin(const WebString& name, const WebString& description, const WebString& fileName) { - PluginInfo* info = new PluginInfo(); - info->name = name; - info->desc = description; - info->file = fileName; + PluginInfo info; + info.name = name; + info.desc = description; + info.file = fileName; m_results->append(info); } void WebPluginListBuilderImpl::addMediaTypeToLastPlugin(const WebString& name, const WebString& description) { - MimeClassInfo* info = new MimeClassInfo(); - info->type = name; - info->desc = description; - m_results->last()->mimes.append(info); + MimeClassInfo info; + info.type = name; + info.desc = description; + info.pluginIndex = m_results->size() - 1; + m_results->last().mimes.append(info); } void WebPluginListBuilderImpl::addFileExtensionToLastMediaType(const WebString& extension) { - MimeClassInfo* info = m_results->last()->mimes.last(); - if (!info->suffixes.isEmpty()) - info->suffixes.append(','); - info->suffixes.append(extension); + MimeClassInfo& info = m_results->last().mimes.last(); + if (!info.suffixes.isEmpty()) + info.suffixes.append(','); + info.suffixes.append(extension); } } // namespace WebKit diff --git a/WebKit/chromium/src/WebPluginListBuilderImpl.h b/WebKit/chromium/src/WebPluginListBuilderImpl.h index 7a8a497..3d7977a 100644 --- a/WebKit/chromium/src/WebPluginListBuilderImpl.h +++ b/WebKit/chromium/src/WebPluginListBuilderImpl.h @@ -40,7 +40,7 @@ namespace WebKit { class WebPluginListBuilderImpl : public WebPluginListBuilder { public: - WebPluginListBuilderImpl(Vector<WebCore::PluginInfo*>* results) : m_results(results) { } + WebPluginListBuilderImpl(Vector<WebCore::PluginInfo>* results) : m_results(results) { } // WebPluginListBuilder methods: virtual void addPlugin(const WebString& name, const WebString& description, const WebString& fileName); @@ -48,7 +48,7 @@ public: virtual void addFileExtensionToLastMediaType(const WebString& extension); private: - Vector<WebCore::PluginInfo*>* m_results; + Vector<WebCore::PluginInfo>* m_results; }; } // namespace WebKit diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp index 8eef6cc..601a497 100644 --- a/WebKit/chromium/src/WebSearchableFormData.cpp +++ b/WebKit/chromium/src/WebSearchableFormData.cpp @@ -77,7 +77,8 @@ bool IsHTTPFormSubmit(const HTMLFormElement* form) HTMLFormControlElement* GetButtonToActivate(HTMLFormElement* form) { HTMLFormControlElement* firstSubmitButton = 0; - for (Vector<HTMLFormControlElement*>::const_iterator i(form->formElements.begin()); i != form->formElements.end(); ++i) { + // FIXME: Consider refactoring this code so that we don't call form->associatedElements() twice. + for (Vector<HTMLFormControlElement*>::const_iterator i(form->associatedElements().begin()); i != form->associatedElements().end(); ++i) { HTMLFormControlElement* formElement = *i; if (formElement->isActivatedSubmit()) // There's a button that is already activated for submit, return 0. @@ -154,7 +155,8 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt *encodingName = encoding.name(); HTMLInputElement* textElement = 0; - for (Vector<HTMLFormControlElement*>::const_iterator i(form->formElements.begin()); i != form->formElements.end(); ++i) { + // FIXME: Consider refactoring this code so that we don't call form->associatedElements() twice. + for (Vector<HTMLFormControlElement*>::const_iterator i(form->associatedElements().begin()); i != form->associatedElements().end(); ++i) { HTMLFormControlElement* formElement = *i; if (formElement->disabled() || formElement->name().isNull()) continue; diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 5f32346..946782b 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -274,4 +274,14 @@ void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior) m_settings->setEditingBehavior(static_cast<WebCore::EditingBehavior>(behavior)); } +void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) +{ + m_settings->setAcceleratedCompositingEnabled(enabled); +} + +void WebSettingsImpl::setHTML5ParserEnabled(bool enabled) +{ + m_settings->setHTML5ParserEnabled(enabled); +} + } // namespace WebKit diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index 0a90091..70bd792 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -86,6 +86,8 @@ public: virtual void setExperimentalWebGLEnabled(bool); virtual void setShowDebugBorders(bool); virtual void setEditingBehavior(EditingBehavior); + virtual void setAcceleratedCompositingEnabled(bool); + virtual void setHTML5ParserEnabled(bool); private: WebCore::Settings* m_settings; diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 4e8b7c8..a38995e 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -73,7 +73,6 @@ #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" #include "PlatformWheelEvent.h" -#include "PluginInfoStore.h" #include "PopupMenuChromium.h" #include "PopupMenuClient.h" #include "ProgressTracker.h" @@ -258,6 +257,8 @@ WebViewImpl::WebViewImpl(WebViewClient* client) m_page->backForwardList()->setClient(&m_backForwardListClientImpl); m_page->setGroupName(pageGroupName); + + m_inspectorSettingsMap.set(new SettingsMap); } WebViewImpl::~WebViewImpl() @@ -1462,9 +1463,12 @@ int WebViewImpl::setZoomLevel(bool textOnly, int zoomLevel) maxTextSizeMultiplier), minTextSizeMultiplier)); Frame* frame = mainFrameImpl()->frame(); - if (zoomFactor != frame->zoomFactor()) { + FrameView* view = frame->view(); + if (!view) + return m_zoomLevel; + if (zoomFactor != view->zoomFactor()) { m_zoomLevel = zoomLevel; - frame->setZoomFactor(zoomFactor, textOnly ? ZoomTextOnly : ZoomPage); + view->setZoomFactor(zoomFactor, textOnly ? ZoomTextOnly : ZoomPage); } return m_zoomLevel; } @@ -1692,6 +1696,21 @@ void WebViewImpl::setInspectorSettings(const WebString& settings) m_inspectorSettings = settings; } +bool WebViewImpl::inspectorSetting(const WebString& key, WebString* value) const +{ + if (!m_inspectorSettingsMap->contains(key)) + return false; + *value = m_inspectorSettingsMap->get(key); + return true; +} + +void WebViewImpl::setInspectorSetting(const WebString& key, + const WebString& value) +{ + m_inspectorSettingsMap->set(key, value); + client()->didUpdateInspectorSetting(key, value); +} + WebDevToolsAgent* WebViewImpl::devToolsAgent() { return m_devToolsAgent.get(); @@ -2115,12 +2134,12 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) if (rootLayer) { IntRect visibleRect = view->visibleContentRect(true); - // Update the root layer's backing store to be the size of the dirty rect. - // Unlike other layers the root layer doesn't have persistent storage for its - // contents in system memory. - rootLayer->setBackingStoreSize(IntSize(rect.width, rect.height)); - GraphicsContext* rootLayerContext = rootLayer->graphicsContext(); - skia::PlatformCanvas* platformCanvas = rootLayer->platformCanvas(); + m_layerRenderer->setRootLayerCanvasSize(IntSize(rect.width, rect.height)); + GraphicsContext* rootLayerContext = m_layerRenderer->rootLayerGraphicsContext(); + +#if PLATFORM(SKIA) + PlatformContextSkia* skiaContext = rootLayerContext->platformContext(); + skia::PlatformCanvas* platformCanvas = skiaContext->canvas(); platformCanvas->save(); @@ -2129,10 +2148,11 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) rootLayerContext->save(); - webframe->paintWithContext(*(rootLayer->graphicsContext()), rect); + webframe->paintWithContext(*rootLayerContext, rect); rootLayerContext->restore(); platformCanvas->restore(); +#endif } } diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index d545a42..b2fc680 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -152,6 +152,9 @@ public: virtual void inspectElementAt(const WebPoint& point); virtual WebString inspectorSettings() const; virtual void setInspectorSettings(const WebString& settings); + virtual bool inspectorSetting(const WebString& key, WebString* value) const; + virtual void setInspectorSetting(const WebString& key, + const WebString& value); virtual WebDevToolsAgent* devToolsAgent(); virtual void setDevToolsAgent(WebDevToolsAgent*); virtual WebAccessibilityObject accessibilityObject(); @@ -485,6 +488,9 @@ private: // Inspector settings. WebString m_inspectorSettings; + typedef HashMap<WebCore::String, WebCore::String> SettingsMap; + OwnPtr<SettingsMap> m_inspectorSettingsMap; + #if ENABLE(NOTIFICATIONS) // The provider of desktop notifications; NotificationPresenterImpl m_notificationPresenter; diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js index 7c4d126..7e5b430 100644 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ b/WebKit/chromium/src/js/DebuggerScript.js @@ -43,9 +43,9 @@ DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.D Debug.clearBreakOnException(); Debug.clearBreakOnUncaughtException(); -DebuggerScript.getAfterCompileScript = function(execState, args) +DebuggerScript.getAfterCompileScript = function(eventData) { - return DebuggerScript._formatScript(args.eventData.script_.script_); + return DebuggerScript._formatScript(eventData.script_.script_); } DebuggerScript.getScripts = function(contextData) @@ -137,17 +137,17 @@ DebuggerScript.currentCallFrame = function(execState, args) return topFrame; } -DebuggerScript.stepIntoStatement = function(execState, args) +DebuggerScript.stepIntoStatement = function(execState) { execState.prepareStep(Debug.StepAction.StepIn, 1); } -DebuggerScript.stepOverStatement = function(execState, args) +DebuggerScript.stepOverStatement = function(execState) { execState.prepareStep(Debug.StepAction.StepNext, 1); } -DebuggerScript.stepOutOfFunction = function(execState, args) +DebuggerScript.stepOutOfFunction = function(execState) { execState.prepareStep(Debug.StepAction.StepOut, 1); } diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js index 5c3e8bd..86f885a 100644 --- a/WebKit/chromium/src/js/InspectorControllerImpl.js +++ b/WebKit/chromium/src/js/InspectorControllerImpl.js @@ -56,6 +56,8 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("getEventListenersForNode"); this.installInspectorControllerDelegate_("getProfile"); this.installInspectorControllerDelegate_("getProfileHeaders"); + this.installInspectorControllerDelegate_("removeProfile"); + this.installInspectorControllerDelegate_("clearProfiles"); this.installInspectorControllerDelegate_("getResourceContent"); this.installInspectorControllerDelegate_("highlightDOMNode"); this.installInspectorControllerDelegate_("hideDOMNodeHighlight"); @@ -80,6 +82,8 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("getStyles"); this.installInspectorControllerDelegate_("getComputedStyle"); this.installInspectorControllerDelegate_("getInlineStyle"); + this.installInspectorControllerDelegate_("getStyleSheet"); + this.installInspectorControllerDelegate_("getRuleRangesForStyleSheetId"); this.installInspectorControllerDelegate_("applyStyleText"); this.installInspectorControllerDelegate_("setStyleText"); this.installInspectorControllerDelegate_("setStyleProperty"); @@ -94,7 +98,6 @@ devtools.InspectorBackendImpl = function() this.installInspectorControllerDelegate_("removeBreakpoint"); this.installInspectorControllerDelegate_("activateBreakpoints"); this.installInspectorControllerDelegate_("deactivateBreakpoints"); - this.installInspectorControllerDelegate_("pauseInDebugger"); this.installInspectorControllerDelegate_("resumeDebugger"); this.installInspectorControllerDelegate_("stepIntoStatementInDebugger"); this.installInspectorControllerDelegate_("stepOutOfFunctionInDebugger"); @@ -217,6 +220,13 @@ devtools.InspectorBackendImpl.prototype.setPauseOnExceptions = function(value) return devtools.tools.getDebuggerAgent().setPauseOnExceptions(value); }; +} else { + +devtools.InspectorBackendImpl.prototype.pauseInDebugger = function() +{ + RemoteDebuggerCommandExecutor.DebuggerPauseScript(); +}; + } diff --git a/WebKit/chromium/src/js/devTools.css b/WebKit/chromium/src/js/devTools.css index 6b4b3e5..2cb4ab3 100755 --- a/WebKit/chromium/src/js/devTools.css +++ b/WebKit/chromium/src/js/devTools.css @@ -237,6 +237,6 @@ select.status-bar-item { -webkit-box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.0); } -.timeline-category-tree-item input { +.timeline-category-statusbar-item input { vertical-align: middle; } diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c index b0c64bf..d36c807 100644 --- a/WebKit/efl/EWebLauncher/main.c +++ b/WebKit/efl/EWebLauncher/main.c @@ -153,8 +153,8 @@ print_history(Eina_List *list) Ewk_History_Item *item = (Ewk_History_Item*)d; cairo_surface_t *cs = ewk_history_item_icon_surface_get(item); char buf[PATH_MAX]; - ssize_t s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item)); - for (s--; s >= sizeof("/tmp/favicon-"); s--) { + int s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item)); + for (s--; s >= (int)sizeof("/tmp/favicon-"); s--) { if (!isalnum(buf[s]) && buf[s] != '.') buf[s] = '_'; } @@ -378,6 +378,12 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info; ELauncher *app = data; + static const char *encodings[] = { + "ISO-8859-1", + "UTF-8", + NULL + }; + static int currentEncoding = -1; if (!strcmp(ev->key, "Escape")) { closeWindow(app->ee); @@ -401,6 +407,11 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info) ewk_view_forward(obj); } else info("Forward ignored: No forward history\n"); + } else if (!strcmp(ev->key, "F3")) { + currentEncoding++; + currentEncoding %= (sizeof(encodings) / sizeof(encodings[0])); + info("Set encoding (F3) pressed. New encoding to %s", encodings[currentEncoding]); + ewk_view_setting_encoding_custom_set(obj, encodings[currentEncoding]); } else if (!strcmp(ev->key, "F4")) { Evas_Object *frame = ewk_view_frame_main_get(obj); Evas_Coord x, y; @@ -672,7 +683,7 @@ main(int argc, char *argv[]) Eina_Rectangle geometry = {0, 0, 0, 0}; char *url = NULL; char *userAgent = NULL; - char *tmp; + const char *tmp; char path[PATH_MAX]; char *engine = NULL; @@ -733,6 +744,7 @@ main(int argc, char *argv[]) snprintf(path, sizeof(path), "%s/.ewebkit-%u", tmp, getuid()); ecore_file_mkpath(path); ewk_settings_icon_database_path_set(path); + ewk_settings_web_database_path_set(path); browserCreate(url, theme, userAgent, geometry, engine, isFullscreen); ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows); diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index 92b95b6..c51befb 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -34,6 +34,7 @@ #include "ChromeClientEfl.h" #if ENABLE(DATABASE) +#include "DatabaseDetails.h" #include "DatabaseTracker.h" #endif #include "EWebKit.h" @@ -188,6 +189,16 @@ bool ChromeClientEfl::menubarVisible() return visible; } +void ChromeClientEfl::createSelectPopup(PopupMenuClient* client, int selected, const IntRect& rect) +{ + ewk_view_popup_new(m_view, client, selected, rect); +} + +bool ChromeClientEfl::destroySelectPopup() +{ + return ewk_view_popup_destroy(m_view); +} + void ChromeClientEfl::setResizable(bool) { notImplemented(); @@ -345,12 +356,21 @@ void ChromeClientEfl::reachedMaxAppCacheSize(int64_t spaceNeeded) #if ENABLE(DATABASE) void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& databaseName) { - uint64_t quota = ewk_settings_web_database_default_quota_get(); + uint64_t quota; + SecurityOrigin* origin = frame->document()->securityOrigin(); + + DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseName, origin); + quota = ewk_view_exceeded_database_quota(m_view, + kit(frame), databaseName.utf8().data(), + details.currentUsage(), details.expectedUsage()); - if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin())) - DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota); + /* if client did not set quota, and database is being created now, the + * default quota is applied + */ + if (!quota && !DatabaseTracker::tracker().hasEntryForOrigin(origin)) + quota = ewk_settings_web_database_default_quota_get(); - ewk_view_exceeded_database_quota(m_view, kit(frame), databaseName.utf8().data()); + DatabaseTracker::tracker().setQuota(origin, quota); } #endif diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h index 8df8483..399ef7f 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h @@ -25,6 +25,7 @@ #include "ChromeClient.h" #include "KURL.h" +#include "PopupMenu.h" #include <Evas.h> namespace WebCore { @@ -69,6 +70,9 @@ public: virtual void setMenubarVisible(bool); virtual bool menubarVisible(); + virtual void createSelectPopup(PopupMenuClient*, int selected, const IntRect& rect); + virtual bool destroySelectPopup(); + virtual void setResizable(bool); virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp index aaa64d7..19c3705 100644 --- a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.cpp @@ -29,9 +29,12 @@ #include "ContextMenuClientEfl.h" #include "ContextMenu.h" +#include "EWebKit.h" +#include "ewk_private.h" #include "HitTestResult.h" #include "KURL.h" #include "NotImplemented.h" +#include "PlatformMenuDescription.h" using namespace WebCore; @@ -47,10 +50,11 @@ void ContextMenuClientEfl::contextMenuDestroyed() delete this; } -PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu*) +PlatformMenuDescription ContextMenuClientEfl::getCustomMenuFromDefaultItems(ContextMenu* menu) { - notImplemented(); - return 0; + PlatformMenuDescription newmenu = ewk_context_menu_custom_get(static_cast<Ewk_Context_Menu*>(menu->releasePlatformDescription())); + + return newmenu; } void ContextMenuClientEfl::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) @@ -89,4 +93,24 @@ void ContextMenuClientEfl::stopSpeaking() notImplemented(); } +PlatformMenuDescription ContextMenuClientEfl::createPlatformDescription(ContextMenu* menu) +{ + return (PlatformMenuDescription) ewk_context_menu_new(m_view, menu->controller()); +} + +void ContextMenuClientEfl::freePlatformDescription(PlatformMenuDescription menu) +{ + ewk_context_menu_free(static_cast<Ewk_Context_Menu*>(menu)); +} + +void ContextMenuClientEfl::appendItem(PlatformMenuDescription menu, ContextMenuItem& item) +{ + ewk_context_menu_item_append(static_cast<Ewk_Context_Menu*>(menu), item); +} + +void ContextMenuClientEfl::show(PlatformMenuDescription menu) +{ + ewk_context_menu_show(static_cast<Ewk_Context_Menu*>(menu)); +} + } diff --git a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h index 2c3818c..8a289a1 100644 --- a/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h +++ b/WebKit/efl/WebCoreSupport/ContextMenuClientEfl.h @@ -50,6 +50,10 @@ class ContextMenuClientEfl : public ContextMenuClient { virtual bool isSpeaking(); virtual void stopSpeaking(); + PlatformMenuDescription createPlatformDescription(ContextMenu*); + void freePlatformDescription(PlatformMenuDescription); + void appendItem(PlatformMenuDescription, ContextMenuItem&); + void show(PlatformMenuDescription menu); private: Evas_Object* m_view; }; diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp index b87a91a..3c4016f 100644 --- a/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp @@ -339,26 +339,26 @@ bool EditorClientEfl::handleEditingKeyboardEvent(KeyboardEvent* event) if (caretBrowsing) { switch (keyEvent->windowsVirtualKeyCode()) { case VK_LEFT: - frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::LEFT, + frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionLeft, keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity, true); return true; case VK_RIGHT: - frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::RIGHT, + frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionRight, keyEvent->ctrlKey() ? WordGranularity : CharacterGranularity, true); return true; case VK_UP: - frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::BACKWARD, + frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionBackward, keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); return true; case VK_DOWN: - frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::FORWARD, + frame->selection()->modify(keyEvent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionForward, keyEvent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); return true; diff --git a/WebKit/efl/ewk/EWebKit.h b/WebKit/efl/ewk/EWebKit.h index d87d204..a61cc9d 100644 --- a/WebKit/efl/ewk/EWebKit.h +++ b/WebKit/efl/ewk/EWebKit.h @@ -22,6 +22,7 @@ #ifndef EWebKit_h #define EWebKit_h +#include "ewk_contextmenu.h" #include "ewk_eapi.h" #include "ewk_frame.h" #include "ewk_history.h" diff --git a/WebKit/efl/ewk/ewk_contextmenu.cpp b/WebKit/efl/ewk/ewk_contextmenu.cpp new file mode 100644 index 0000000..9daf27c --- /dev/null +++ b/WebKit/efl/ewk/ewk_contextmenu.cpp @@ -0,0 +1,263 @@ +/* + Copyright (C) 2010 ProFUSION embedded systems + Copyright (C) 2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "ewk_contextmenu.h" + +#include "ContextMenu.h" +#include "ContextMenuController.h" +#include "ContextMenuItem.h" +#include "EWebKit.h" +#include "ewk_private.h" + +#include <Eina.h> +#include <eina_safety_checks.h> +#include <wtf/text/CString.h> + +struct _Ewk_Context_Menu { + unsigned int __ref; + WebCore::ContextMenuController* controller; + Evas_Object* view; + + Eina_List* items; +}; + +struct _Ewk_Context_Menu_Item { + Ewk_Context_Menu_Item_Type type; + Ewk_Context_Menu_Action action; + + const char* title; + Ewk_Context_Menu* submenu; + + Eina_Bool checked:1; + Eina_Bool enabled:1; +}; + +void ewk_context_menu_ref(Ewk_Context_Menu* menu) +{ + EINA_SAFETY_ON_NULL_RETURN(menu); + menu->__ref++; +} + +void ewk_context_menu_unref(Ewk_Context_Menu* menu) +{ + EINA_SAFETY_ON_NULL_RETURN(menu); + void* item; + + if (--menu->__ref) + return; + + EINA_LIST_FREE(menu->items, item) + ewk_context_menu_item_free(static_cast<Ewk_Context_Menu_Item*>(item)); + + free(menu); +} + +Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(menu->controller, EINA_FALSE); + + menu->controller->clearContextMenu(); + return EINA_TRUE; +} + +const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); + + return o->items; +} + +Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, + Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, + const char* title, Eina_Bool checked, Eina_Bool enabled) +{ + Ewk_Context_Menu_Item* item = (Ewk_Context_Menu_Item*) malloc(sizeof(*item)); + if (!item) + return 0; + + item->type = type; + item->action = action; + item->title = eina_stringshare_add(title); + item->submenu = submenu; + item->checked = checked; + item->enabled = enabled; + + return item; +} + +Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(menu, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(item, EINA_FALSE); + WebCore::ContextMenuAction action = static_cast<WebCore::ContextMenuAction>(item->action); + WebCore::ContextMenuItemType type = static_cast<WebCore::ContextMenuItemType>(item->type); + + // Don't care about title and submenu as they're not used after this point. + WebCore::ContextMenuItem core(type, action, WebCore::String()); + menu->controller->contextMenuItemSelected(&core); + return EINA_TRUE; +} + +void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item) +{ + EINA_SAFETY_ON_NULL_RETURN(item); + + eina_stringshare_del(item->title); + free(item); +} + +Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(Ewk_Context_Menu_Item* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_ACTION_TYPE); + return o->type; +} + +Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + o->type = type; + return EINA_TRUE; +} + +Ewk_Context_Menu_Action ewk_context_menu_item_action_get(Ewk_Context_Menu_Item* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION); + return o->action; +} + +Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + o->action = action; + return EINA_TRUE; +} + +const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); + return o->title; +} + +const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); + eina_stringshare_replace(&o->title, title); + return o->title; +} + +Eina_Bool ewk_context_menu_item_checked_get(Ewk_Context_Menu_Item* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + return o->checked; +} + +Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool checked) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + o->checked = checked; + return EINA_TRUE; +} + +Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + return o->enabled; +} + +Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item *o, Eina_Bool enabled) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + o->enabled = enabled; + return EINA_TRUE; +} + + +/* internal methods ****************************************************/ + +/** + * @internal + * + * Creates context on view. + * + * @param view View. + * @param Controller Context Menu Controller. + * + * @return newly allocated context menu or @c 0 on errors. + */ +Ewk_Context_Menu* ewk_context_menu_new(Evas_Object* view, WebCore::ContextMenuController* controller) +{ + Ewk_Context_Menu* menu; + EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(controller, 0); + + menu = static_cast<Ewk_Context_Menu*>(malloc(sizeof(*menu))); + if (!menu) { + CRITICAL("Could not allocate context menu memory."); + return 0; + } + + menu->__ref = 1; + menu->view = view; + menu->controller = controller; + menu->items = 0; + evas_object_smart_callback_call(menu->view, "contextmenu,new", menu); + + return menu; +} + +Eina_Bool ewk_context_menu_free(Ewk_Context_Menu* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, EINA_FALSE); + evas_object_smart_callback_call(o->view, "contextmenu,free", o); + ewk_context_menu_unref(o); + return EINA_TRUE; +} + +void ewk_context_menu_item_append(Ewk_Context_Menu* o, WebCore::ContextMenuItem& core) +{ + Ewk_Context_Menu_Item_Type type = static_cast<Ewk_Context_Menu_Item_Type>(core.type()); + Ewk_Context_Menu_Action action = static_cast<Ewk_Context_Menu_Action>(core.action()); + Ewk_Context_Menu* submenu = static_cast<Ewk_Context_Menu*>(core.platformSubMenu()); + + Ewk_Context_Menu_Item* menu_item = ewk_context_menu_item_new + (type, action, submenu, core.title().utf8().data(), core.checked(), + core.enabled()); + EINA_SAFETY_ON_NULL_RETURN(menu_item); + + o->items = eina_list_append(o->items, menu_item); + evas_object_smart_callback_call(o->view, "contextmenu,item,appended", o); +} + +Ewk_Context_Menu* ewk_context_menu_custom_get(Ewk_Context_Menu* o) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(o, 0); + + evas_object_smart_callback_call(o->view, "contextmenu,customize", o->items); + return o; +} + +void ewk_context_menu_show(Ewk_Context_Menu* o) +{ + EINA_SAFETY_ON_NULL_RETURN(o); + + evas_object_smart_callback_call(o->view, "contextmenu,show", o); +} diff --git a/WebKit/efl/ewk/ewk_contextmenu.h b/WebKit/efl/ewk/ewk_contextmenu.h new file mode 100644 index 0000000..c5adb48 --- /dev/null +++ b/WebKit/efl/ewk/ewk_contextmenu.h @@ -0,0 +1,147 @@ +/* + Copyright (C) 2010 ProFUSION embedded systems + Copyright (C) 2010 Samsung Electronics + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef ewk_contextmenu_h +#define ewk_contextmenu_h + +#include "ewk_eapi.h" + +#include <Eina.h> +#include <Evas.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// keep this in sync with ContextMenuItem.h +enum _Ewk_Context_Menu_Action { + EWK_CONTEXT_MENU_ITEM_TAG_NO_ACTION = 0, // this item is not actually in web_uidelegate.h + EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK_IN_NEW_WINDOW = 1, + EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_LINK_TO_DISK, + EWK_CONTEXT_MENU_ITEM_TAG_COPY_LINK_TO_CLIPBOARD, + EWK_CONTEXT_MENU_ITEM_TAG_OPEN_IMAGE_IN_NEW_WINDOW, + EWK_CONTEXT_MENU_ITEM_TAG_DOWNLOAD_IMAGE_TO_DISK, + EWK_CONTEXT_MENU_ITEM_TAG_COPY_IMAGE_TO_CLIPBOARD, + EWK_CONTEXT_MENU_ITEM_TAG_OPEN_FRAME_IN_NEW_WINDOW, + EWK_CONTEXT_MENU_ITEM_TAG_COPY, + EWK_CONTEXT_MENU_ITEM_TAG_GO_BACK, + EWK_CONTEXT_MENU_ITEM_TAG_GO_FORWARD, + EWK_CONTEXT_MENU_ITEM_TAG_STOP, + EWK_CONTEXT_MENU_ITEM_TAG_RELOAD, + EWK_CONTEXT_MENU_ITEM_TAG_CUT, + EWK_CONTEXT_MENU_ITEM_TAG_PASTE, + EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_GUESS, + EWK_CONTEXT_MENU_ITEM_TAG_NO_GUESSES_FOUND, + EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_SPELLING, + EWK_CONTEXT_MENU_ITEM_TAG_LEARN_SPELLING, + EWK_CONTEXT_MENU_ITEM_TAG_OTHER, + EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_IN_SPOTLIGHT, + EWK_CONTEXT_MENU_ITEM_TAG_SEARCH_WEB, + EWK_CONTEXT_MENU_ITEM_TAG_LOOK_UP_IN_DICTIONARY, + EWK_CONTEXT_MENU_ITEM_TAG_OPEN_WITH_DEFAULT_APPLICATION, + EWK_CONTEXT_MENU_ITEM_PDFACTUAL_SIZE, + EWK_CONTEXT_MENU_ITEM_PDFZOOM_IN, + EWK_CONTEXT_MENU_ITEM_PDFZOOM_OUT, + EWK_CONTEXT_MENU_ITEM_PDFAUTO_SIZE, + EWK_CONTEXT_MENU_ITEM_PDFSINGLE_PAGE, + EWK_CONTEXT_MENU_ITEM_PDFFACING_PAGES, + EWK_CONTEXT_MENU_ITEM_PDFCONTINUOUS, + EWK_CONTEXT_MENU_ITEM_PDFNEXT_PAGE, + EWK_CONTEXT_MENU_ITEM_PDFPREVIOUS_PAGE, + EWK_CONTEXT_MENU_ITEM_TAG_OPEN_LINK = 2000, + EWK_CONTEXT_MENU_ITEM_TAG_IGNORE_GRAMMAR, + EWK_CONTEXT_MENU_ITEM_TAG_SPELLING_MENU, // spelling or spelling/grammar sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SHOW_SPELLING_PANEL, + EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING, + EWK_CONTEXT_MENU_ITEM_TAG_CHECK_SPELLING_WHILE_TYPING, + EWK_CONTEXT_MENU_ITEM_TAG_CHECK_GRAMMAR_WITH_SPELLING, + EWK_CONTEXT_MENU_ITEM_TAG_FONT_MENU, // font sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_SHOW_FONTS, + EWK_CONTEXT_MENU_ITEM_TAG_BOLD, + EWK_CONTEXT_MENU_ITEM_TAG_ITALIC, + EWK_CONTEXT_MENU_ITEM_TAG_UNDERLINE, + EWK_CONTEXT_MENU_ITEM_TAG_OUTLINE, + EWK_CONTEXT_MENU_ITEM_TAG_STYLES, + EWK_CONTEXT_MENU_ITEM_TAG_SHOW_COLORS, + EWK_CONTEXT_MENU_ITEM_TAG_SPEECH_MENU, // speech sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_START_SPEAKING, + EWK_CONTEXT_MENU_ITEM_TAG_STOP_SPEAKING, + EWK_CONTEXT_MENU_ITEM_TAG_WRITING_DIRECTION_MENU, // writing direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_DEFAULT_DIRECTION, + EWK_CONTEXT_MENU_ITEM_TAG_LEFT_TO_RIGHT, + EWK_CONTEXT_MENU_ITEM_TAG_RIGHT_TO_LEFT, + EWK_CONTEXT_MENU_ITEM_TAG_PDFSINGLE_PAGE_SCROLLING, + EWK_CONTEXT_MENU_ITEM_TAG_PDFFACING_PAGES_SCROLLING, + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, // text direction sub-menu + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_DEFAULT, + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_LEFT_TO_RIGHT, + EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_RIGHT_TO_LEFT, + EWK_CONTEXT_MENU_ITEM_BASE_CUSTOM_TAG = 5000, + EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG = 10000 +}; +typedef enum _Ewk_Context_Menu_Action Ewk_Context_Menu_Action; + +// keep this in sync with ContextMenuItem.h +enum _Ewk_Context_Menu_Item_Type { + EWK_ACTION_TYPE, + EWK_CHECKABLE_ACTION_TYPE, + EWK_SEPARATOR_TYPE, + EWK_SUBMENU_TYPE +}; +typedef enum _Ewk_Context_Menu_Item_Type Ewk_Context_Menu_Item_Type; + +/** + * The structure to contain Context Menu data + */ +typedef struct _Ewk_Context_Menu Ewk_Context_Menu; + +/** + * Represents one item from Ewk_Context_Menu + */ +typedef struct _Ewk_Context_Menu_Item Ewk_Context_Menu_Item; + + + +/************************** Exported functions ***********************/ + +EAPI void ewk_context_menu_ref(Ewk_Context_Menu* menu); +EAPI void ewk_context_menu_unref(Ewk_Context_Menu* menu); +EAPI Eina_Bool ewk_context_menu_destroy(Ewk_Context_Menu* menu); + +EAPI const Eina_List* ewk_context_menu_item_list_get(Ewk_Context_Menu* o); + +EAPI Ewk_Context_Menu_Item* ewk_context_menu_item_new(Ewk_Context_Menu_Item_Type type, Ewk_Context_Menu_Action action, Ewk_Context_Menu* submenu, const char* title, Eina_Bool checked, Eina_Bool enabled); +EAPI void ewk_context_menu_item_free(Ewk_Context_Menu_Item* item); +EAPI Eina_Bool ewk_context_menu_item_select(Ewk_Context_Menu* menu, Ewk_Context_Menu_Item* item); +EAPI Ewk_Context_Menu_Item_Type ewk_context_menu_item_type_get(Ewk_Context_Menu_Item* o); +EAPI Eina_Bool ewk_context_menu_item_type_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Item_Type type); +EAPI Ewk_Context_Menu_Action ewk_context_menu_item_action_get(Ewk_Context_Menu_Item* o); +EAPI Eina_Bool ewk_context_menu_item_action_set(Ewk_Context_Menu_Item* o, Ewk_Context_Menu_Action action); +EAPI const char* ewk_context_menu_item_title_get(Ewk_Context_Menu_Item* o); +EAPI const char* ewk_context_menu_item_title_set(Ewk_Context_Menu_Item* o, const char* title); +EAPI Eina_Bool ewk_context_menu_item_checked_get(Ewk_Context_Menu_Item* o); +EAPI Eina_Bool ewk_context_menu_item_checked_set(Ewk_Context_Menu_Item* o, Eina_Bool checked); +EAPI Eina_Bool ewk_context_menu_item_enabled_get(Ewk_Context_Menu_Item* o); +EAPI Eina_Bool ewk_context_menu_item_enabled_set(Ewk_Context_Menu_Item* o, Eina_Bool enabled); + +#ifdef __cplusplus +} +#endif +#endif // ewk_contextmenu_h diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index 5e93a05..6cbcefe 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -634,8 +634,6 @@ Eina_Bool ewk_frame_editable_set(Evas_Object* o, Eina_Bool editable) return EINA_TRUE; if (editable) sd->frame->applyEditingStyleToBodyElement(); - else - sd->frame->removeEditingStyleFromBodyElement(); return EINA_TRUE; } @@ -971,7 +969,10 @@ float ewk_frame_zoom_get(const Evas_Object* o) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, -1.0); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, -1.0); - return sd->frame->zoomFactor(); + WebCore::FrameView* view = sd->frame->view(); + if (!view) + return -1; + return view->zoomFactor(); } /** @@ -993,7 +994,10 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom) zoomMode = WebCore::ZoomTextOnly; else zoomMode = WebCore::ZoomPage; - sd->frame->setZoomFactor(zoom, zoomMode); + WebCore::FrameView* view = sd->frame->view(); + if (!view) + return EINA_FALSE; + view->setZoomFactor(zoom, zoomMode); return EINA_TRUE; } @@ -1032,7 +1036,10 @@ Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting) zoomMode = WebCore::ZoomTextOnly; else zoomMode = WebCore::ZoomPage; - sd->frame->setZoomFactor(sd->frame->zoomFactor(), zoomMode); + WebCore::FrameView* view = sd->frame->view(); + if (!view) + return EINA_FALSE; + view->setZoomFactor(view->zoomFactor(), zoomMode); return EINA_TRUE; } diff --git a/WebKit/efl/ewk/ewk_main.cpp b/WebKit/efl/ewk/ewk_main.cpp index 145357c..92346e7 100644 --- a/WebKit/efl/ewk/ewk_main.cpp +++ b/WebKit/efl/ewk/ewk_main.cpp @@ -26,6 +26,7 @@ #include "PageCache.h" #include "PageGroup.h" #include "ewk_private.h" +#include "ewk_settings.h" #include "runtime/InitializeThreading.h" #include "wtf/Threading.h" @@ -34,6 +35,7 @@ #include <Edje.h> #include <Eina.h> #include <Evas.h> +#include <stdlib.h> #ifdef ENABLE_GLIB_SUPPORT #include <glib-object.h> @@ -113,6 +115,9 @@ int ewk_init(void) WebCore::pageCache()->setCapacity(3); WebCore::PageGroup::setShouldTrackVisitedLinks(true); + // set default location of web database path + ewk_settings_web_database_path_set(getenv("HOME")); + // TODO: this should move to WebCore, already reported to webkit-gtk folks: if (1) { SoupSession* session = WebCore::ResourceHandle::defaultSession(); diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index 947bd79..5f66fd8 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -41,6 +41,13 @@ extern "C" { // If defined, ewk will do type checking to ensure objects are of correct type #define EWK_TYPE_CHECK 1 +// forward declarations +namespace WebCore { +struct PopupMenuClient; +struct ContextMenu; +struct ContextMenuItem; +} + void ewk_view_ready(Evas_Object *o); void ewk_view_title_set(Evas_Object *o, const char *title); void ewk_view_uri_changed(Evas_Object *o); @@ -74,7 +81,7 @@ void ewk_view_run_javascript_alert(Evas_Object *o, Evas_Object *fram Eina_Bool ewk_view_run_javascript_confirm(Evas_Object *o, Evas_Object *frame, const char *message); Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *frame, const char *message, const char *defaultValue, char **value); Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o); -void ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName); +uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size); void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame); @@ -84,9 +91,17 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Objec WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WebCore::String>& paramNames, const WTF::Vector<WebCore::String>& paramValues, const WebCore::String& mimeType, bool loadManually); +void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect); + Ewk_History *ewk_history_new(WebCore::BackForwardList *history); void ewk_history_free(Ewk_History *history); +Ewk_Context_Menu *ewk_context_menu_new(Evas_Object *view, WebCore::ContextMenuController *controller); +Eina_Bool ewk_context_menu_free(Ewk_Context_Menu *o); +void ewk_context_menu_item_append(Ewk_Context_Menu *o, WebCore::ContextMenuItem& core); +Ewk_Context_Menu *ewk_context_menu_custom_get(Ewk_Context_Menu *o); +void ewk_context_menu_show(Ewk_Context_Menu *o); + Evas_Object *ewk_frame_add(Evas *e); Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame); Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer); diff --git a/WebKit/efl/ewk/ewk_settings.cpp b/WebKit/efl/ewk/ewk_settings.cpp index 0822dc2..b50cd75 100644 --- a/WebKit/efl/ewk/ewk_settings.cpp +++ b/WebKit/efl/ewk/ewk_settings.cpp @@ -22,6 +22,9 @@ #include "ewk_settings.h" #include "EWebKit.h" +#if ENABLE(DATABASE) +#include "DatabaseTracker.h" +#endif #include "IconDatabase.h" #include "Image.h" #include "IntSize.h" @@ -36,7 +39,7 @@ #include <sys/types.h> #include <unistd.h> -static uint64_t _ewk_default_web_database_quota = 1 * 1024; +static uint64_t _ewk_default_web_database_quota = 1 * 1024 * 1024; /** * Returns the default quota for Web Database databases. By default @@ -50,6 +53,38 @@ uint64_t ewk_settings_web_database_default_quota_get() } /** + * Sets the current path to the directory WebKit will write Web + * Database databases. + * + * @path: the new database directory path + * + */ +void ewk_settings_web_database_path_set(const char *path) +{ +#if ENABLE(DATABASE) + WebCore::String corePath = WebCore::String::fromUTF8(path); + WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(corePath); +#endif +} + +/** + * Return directory path where web database is stored. + * + * @return newly allocated string with database path. Note that return must be + * freed with free() as it's a strdup()ed copy of the string due reference + * counting. + */ +const char *ewk_settings_web_database_path_get() +{ +#if ENABLE(DATABASE) + WebCore::String path = WebCore::DatabaseTracker::tracker().databaseDirectoryPath(); + return strdup(path.utf8().data()); +#else + return 0; +#endif +} + +/** * Sets directory where to store icon database, opening database. * * @param directory where to store icon database, must be diff --git a/WebKit/efl/ewk/ewk_settings.h b/WebKit/efl/ewk/ewk_settings.h index e843fd1..87d015c 100644 --- a/WebKit/efl/ewk/ewk_settings.h +++ b/WebKit/efl/ewk/ewk_settings.h @@ -38,6 +38,8 @@ extern "C" { */ EAPI uint64_t ewk_settings_web_database_default_quota_get(); +EAPI void ewk_settings_web_database_path_set(const char *path); +EAPI const char *ewk_settings_web_database_path_get(); EAPI Eina_Bool ewk_settings_icon_database_path_set(const char *path); EAPI char *ewk_settings_icon_database_path_get(void); diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index d981459..d5920e5 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -23,15 +23,18 @@ #include "ChromeClientEfl.h" #include "ContextMenuClientEfl.h" +#include "ContextMenuController.h" #include "DocumentLoader.h" #include "DragClientEfl.h" #include "EWebKit.h" #include "EditorClientEfl.h" +#include "EventHandler.h" #include "FocusController.h" #include "FrameLoaderClientEfl.h" #include "FrameView.h" #include "GraphicsContext.h" #include "InspectorClientEfl.h" +#include "PlatformMouseEvent.h" #include "PopupMenuClient.h" #include "ProgressTracker.h" #include "ewk_private.h" @@ -514,6 +517,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd) static_cast<WebCore::DragClient*>(new WebCore::DragClientEfl), static_cast<WebCore::InspectorClient*>(new WebCore::InspectorClientEfl), 0, + 0, 0); if (!priv->page) { CRITICAL("Could not create WebKit Page"); @@ -1476,6 +1480,46 @@ Eina_Bool ewk_view_select_word(Evas_Object* o) } /** + * Forwards a request of new Context Menu to WebCore. + * + * @param o View. + * @param ev Event data. + * + * @return @c EINA_TRUE if operation was executed, @c EINA_FALSE otherwise. + */ +Eina_Bool ewk_view_context_menu_forward_event(Evas_Object* o, const Evas_Event_Mouse_Down* ev) +{ + EWK_VIEW_SD_GET_OR_RETURN(o, sd, EINA_FALSE); + EWK_VIEW_PRIV_GET_OR_RETURN(sd, priv, EINA_FALSE); + Eina_Bool mouse_press_handled = EINA_FALSE; + + priv->page->contextMenuController()->clearContextMenu(); + WebCore::Frame* main_frame = priv->page->mainFrame(); + Evas_Coord x, y; + evas_object_geometry_get(sd->self, &x, &y, 0, 0); + + WebCore::PlatformMouseEvent event(ev, WebCore::IntPoint(x, y)); + + if (main_frame->view()) { + mouse_press_handled = + main_frame->eventHandler()->handleMousePressEvent(event); + } + + if (main_frame->eventHandler()->sendContextMenuEvent(event)) + return EINA_FALSE; + + WebCore::ContextMenu* coreMenu = + priv->page->contextMenuController()->contextMenu(); + if (!coreMenu) { + // WebCore decided not to create a context menu, return true if event + // was handled by handleMouseReleaseEvent + return mouse_press_handled; + } + + return EINA_TRUE; +} + +/** * Get current load progress estimate from 0.0 to 1.0. * * @param o view object to get current progress. @@ -3393,14 +3437,20 @@ Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object* o) * @param o View. * @param frame The frame whose web page exceeded its database quota. * @param databaseName Database name. + * @param current_size Current size of this database + * @param expected_size The expected size of this database in order to fulfill + * site's requirement. */ -void ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName) +uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, const char* databaseName, uint64_t current_size, uint64_t expected_size) { DBG("o=%p", o); - EWK_VIEW_SD_GET_OR_RETURN(o, sd); - EINA_SAFETY_ON_NULL_RETURN(sd->api); - EINA_SAFETY_ON_NULL_RETURN(sd->api->exceeded_database_quota); - sd->api->exceeded_database_quota(sd, frame, databaseName); + EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(sd->api, 0); + if (!sd->api->exceeded_database_quota) + return 0; + + ERR("##### %lu %lu", current_size, expected_size); + return sd->api->exceeded_database_quota(sd, frame, databaseName, current_size, expected_size); } /** diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h index 20df601..b029a68 100644 --- a/WebKit/efl/ewk/ewk_view.h +++ b/WebKit/efl/ewk/ewk_view.h @@ -125,7 +125,7 @@ struct _Ewk_View_Smart_Class { Eina_Bool (*run_javascript_confirm)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message); Eina_Bool (*run_javascript_prompt)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *message, const char *defaultValue, char **value); Eina_Bool (*should_interrupt_javascript)(Ewk_View_Smart_Data *sd); - void (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName); + uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size); Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames); }; @@ -305,6 +305,8 @@ EAPI Eina_Bool ewk_view_select_sentence(Evas_Object *o); EAPI Eina_Bool ewk_view_select_line(Evas_Object *o); EAPI Eina_Bool ewk_view_select_word(Evas_Object *o); +EAPI Eina_Bool ewk_view_context_menu_forward_event(Evas_Object *o, const Evas_Event_Mouse_Down *ev); + EAPI void ewk_view_popup_selected_set(Evas_Object *o, int index); EAPI Eina_Bool ewk_view_popup_destroy(Evas_Object *o); diff --git a/WebKit/efl/ewk/ewk_view_single.c b/WebKit/efl/ewk/ewk_view_single.c index 4111370..803b219 100644 --- a/WebKit/efl/ewk/ewk_view_single.c +++ b/WebKit/efl/ewk/ewk_view_single.c @@ -36,17 +36,28 @@ static void _ewk_view_single_on_del(void *data, Evas *e, Evas_Object *o, void *e evas_object_del(clip); } -static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd) +static void _ewk_view_single_smart_add(Evas_Object *o) { - Evas_Object *bs = evas_object_image_add(sd->base.evas); + Ewk_View_Smart_Data *sd; + + _parent_sc.sc.add(o); + + sd = (Ewk_View_Smart_Data *)evas_object_smart_data_get(o); + Evas_Object *clip = evas_object_rectangle_add(sd->base.evas); - evas_object_image_alpha_set(bs, EINA_FALSE); - evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale); - evas_object_clip_set(bs, clip); + evas_object_clip_set(sd->backing_store, clip); + evas_object_smart_member_add(clip, o); evas_object_show(clip); evas_object_event_callback_add - (bs, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip); + (sd->backing_store, EVAS_CALLBACK_DEL, _ewk_view_single_on_del, clip); +} + +static Evas_Object *_ewk_view_single_smart_backing_store_add(Ewk_View_Smart_Data *sd) +{ + Evas_Object *bs = evas_object_image_add(sd->base.evas); + evas_object_image_alpha_set(bs, EINA_FALSE); + evas_object_image_smooth_scale_set(bs, sd->zoom_weak_smooth_scale); return bs; } @@ -538,6 +549,7 @@ Eina_Bool ewk_view_single_smart_set(Ewk_View_Smart_Class *api) if (EINA_UNLIKELY(!_parent_sc.sc.add)) ewk_view_base_smart_set(&_parent_sc); + api->sc.add = _ewk_view_single_smart_add; api->sc.resize = _ewk_view_single_smart_resize; api->backing_store_add = _ewk_view_single_smart_backing_store_add; diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index 9db2729..ec1727d 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,85 @@ +2010-05-31 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Text copied from a WebView cannot be pasted into gnome-terminal + https://bugs.webkit.org/show_bug.cgi?id=39827 + + Add a test to prevent regressions for this issue. + + * tests/testcopyandpaste.c: Added. + (test_info_new): + (test_info_destroy): + (copy_and_paste_fixture_setup): + (copy_and_paste_fixture_teardown): + (load_status_cb): + (map_event_cb): + (test_copy_and_paste): + (main): + +2010-05-27 Gustavo Noronha Silva <gns@gnome.org> + + Update documentation control files, and fix Since tags for 1.3.1. + + * docs/webkitgtk-docs.sgml: + * docs/webkitgtk-sections.txt: + * webkit/webkitwebbackforwardlist.cpp: + * webkit/webkitwebview.cpp: + +2010-05-27 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + Update for 1.3.1 release. + + * NEWS: + +2010-05-27 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Dragging onto the desktop causes a critical GLib warning + https://bugs.webkit.org/show_bug.cgi?id=39718 + + Only increment the window reference count if it is not null during drag-end + signal processing. + + * webkit/webkitwebview.cpp: + (webkit_web_view_drag_end): Guard against null window values. + +2010-05-26 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Add support for DOM events in the GObject DOM bindings + https://bugs.webkit.org/show_bug.cgi?id=38844 + + Test DOMWindow signals. + + * tests/testdomdomwindow.c: Added. + (finish_loading): + (dom_domview_fixture_setup): + (dom_domview_fixture_teardown): + (loadedCallback): + (clickedCallback): + (map_event_cb): + (load_event_callback): + (test_dom_domview_signals): + (main): + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * webkit/webkitwebview.cpp: + (webkit_web_view_set_editable): Remove call to empty function + removeEditngStyleFromBodyElement. + (webkit_web_view_get_zoom_level): Call functions on FrameView. + (webkit_web_view_apply_zoom_level): Ditto. + 2010-05-22 Martin Robinson <mrobinson@igalia.com> Reviewed by Xan Lopez. diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS index 45e3121..fc87b35 100644 --- a/WebKit/gtk/NEWS +++ b/WebKit/gtk/NEWS @@ -1,3 +1,22 @@ +================ +WebKitGTK+ 1.3.1 +================ + +What's new in WebKitGTK+ 1.3.1? + + - Initial support for GObject DOM bindings. Present in this release + is a substantial subset of the basic DOM APIs (Document, HTML + elements, Node, etc) including access to the DOM events through + GObject signals. Keep in mind that all the APIs are still + unstable, and will probably be subject to changes before the next + stable release. + - Add webkit_web_back_forward_list_clear, to completely clear the + BackForward list. + - Lots of improvements in DOM clipboard and drag-drop access. + - Add support for GTK+ key themes. + - Significant improvements in a11y, including improved role support + and many bugfixes. + ================= WebKitGTK+ 1.1.90 ================= diff --git a/WebKit/gtk/docs/webkitgtk-docs.sgml b/WebKit/gtk/docs/webkitgtk-docs.sgml index fb9ae09..6201ca5 100644 --- a/WebKit/gtk/docs/webkitgtk-docs.sgml +++ b/WebKit/gtk/docs/webkitgtk-docs.sgml @@ -107,4 +107,7 @@ <index id="index-1.1.23" role="1.1.23"> <title>Index of new symbols in 1.1.23</title> </index> + <index id="index-1.3.1" role="1.3.1"> + <title>Index of new symbols in 1.3.1</title> + </index> </book> diff --git a/WebKit/gtk/docs/webkitgtk-sections.txt b/WebKit/gtk/docs/webkitgtk-sections.txt index 7f37484..864b991 100644 --- a/WebKit/gtk/docs/webkitgtk-sections.txt +++ b/WebKit/gtk/docs/webkitgtk-sections.txt @@ -25,6 +25,7 @@ WebKitWebSettingsClass <TITLE>WebKitWebBackForwardList</TITLE> WebKitWebBackForwardList webkit_web_back_forward_list_add_item +webkit_web_back_forward_list_clear webkit_web_back_forward_list_contains_item webkit_web_back_forward_list_get_back_item webkit_web_back_forward_list_get_back_length @@ -436,6 +437,7 @@ webkit_web_view_execute_script webkit_web_view_get_back_forward_list webkit_web_view_get_copy_target_list webkit_web_view_get_custom_encoding +webkit_web_view_get_dom_document webkit_web_view_get_editable webkit_web_view_get_encoding webkit_web_view_get_focused_frame diff --git a/WebKit/gtk/tests/testcopyandpaste.c b/WebKit/gtk/tests/testcopyandpaste.c new file mode 100644 index 0000000..034a429 --- /dev/null +++ b/WebKit/gtk/tests/testcopyandpaste.c @@ -0,0 +1,165 @@ +/* + * Copyright (C) 2010 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2,1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <errno.h> +#include <unistd.h> +#include <string.h> +#include <glib/gstdio.h> +#include <webkit/webkit.h> +#include <JavaScriptCore/JSStringRef.h> +#include <JavaScriptCore/JSContextRef.h> + + +#if GTK_CHECK_VERSION(2, 14, 0) + +typedef struct { + char* page; + char* expectedPlainText; +} TestInfo; + +typedef struct { + GtkWidget* window; + WebKitWebView* webView; + GMainLoop* loop; + TestInfo* info; +} CopyAndPasteFixture; + +TestInfo* +test_info_new(const char* page, const char* expectedPlainText) +{ + TestInfo* info; + info = g_slice_new0(TestInfo); + info->page = g_strdup(page); + if (expectedPlainText) + info->expectedPlainText = g_strdup(expectedPlainText); + return info; +} + +void +test_info_destroy(TestInfo* info) +{ + g_free(info->page); + g_free(info->expectedPlainText); + g_slice_free(TestInfo, info); +} + +static void copy_and_paste_fixture_setup(CopyAndPasteFixture* fixture, gconstpointer data) +{ + fixture->loop = g_main_loop_new(NULL, TRUE); + + fixture->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + fixture->webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + + gtk_container_add(GTK_CONTAINER(fixture->window), GTK_WIDGET(fixture->webView)); +} + +static void copy_and_paste_fixture_teardown(CopyAndPasteFixture* fixture, gconstpointer data) +{ + gtk_widget_destroy(fixture->window); + g_main_loop_unref(fixture->loop); + test_info_destroy(fixture->info); +} + +static void load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer data) +{ + CopyAndPasteFixture* fixture = (CopyAndPasteFixture*)data; + WebKitLoadStatus status = webkit_web_view_get_load_status(webView); + if (status != WEBKIT_LOAD_FINISHED) + return; + + GtkClipboard* clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + gtk_clipboard_clear(clipboard); + + webkit_web_view_copy_clipboard(webView); + + gchar* text = gtk_clipboard_wait_for_text(clipboard); + g_assert(text || !fixture->info->expectedPlainText); + g_assert(!text || !strcmp(text, fixture->info->expectedPlainText)); + g_free(text); + + g_assert(!gtk_clipboard_wait_is_uris_available(clipboard)); + g_assert(!gtk_clipboard_wait_is_image_available(clipboard)); + + g_main_loop_quit(fixture->loop); +} + +gboolean map_event_cb(GtkWidget *widget, GdkEvent* event, gpointer data) +{ + gtk_widget_grab_focus(widget); + CopyAndPasteFixture* fixture = (CopyAndPasteFixture*)data; + webkit_web_view_load_string(fixture->webView, fixture->info->page, + "text/html", "utf-8", "file://"); + return FALSE; +} + +static void test_copy_and_paste(CopyAndPasteFixture* fixture, gconstpointer data) +{ + fixture->info = (TestInfo*)data; + g_signal_connect(fixture->window, "map-event", + G_CALLBACK(map_event_cb), fixture); + + gtk_widget_show(fixture->window); + gtk_widget_show(GTK_WIDGET(fixture->webView)); + gtk_window_present(GTK_WINDOW(fixture->window)); + + g_signal_connect(fixture->webView, "notify::load-status", + G_CALLBACK(load_status_cb), fixture); + + g_main_loop_run(fixture->loop); +} + +int main(int argc, char** argv) +{ + g_thread_init(NULL); + gtk_test_init(&argc, &argv, NULL); + + g_test_bug_base("https://bugs.webkit.org/"); + const char* selected_span_html = "<html><body>" + "<span id=\"mainspan\">All work and no play <span>make Jack a dull</span> boy.</span>" + "<script>document.getSelection().collapse();\n" + "document.getSelection().selectAllChildren(document.getElementById('mainspan'));\n" + "</script></body></html>"; + const char* no_selection_html = "<html><body>" + "<span id=\"mainspan\">All work and no play <span>make Jack a dull</span> boy</span>" + "<script>document.getSelection().collapse();\n" + "</script></body></html>"; + + g_test_add("/webkit/copyandpaste/selection", CopyAndPasteFixture, + test_info_new(selected_span_html, "All work and no play make Jack a dull boy."), + copy_and_paste_fixture_setup, + test_copy_and_paste, + copy_and_paste_fixture_teardown); + g_test_add("/webkit/copyandpaste/no-selection", CopyAndPasteFixture, + test_info_new(no_selection_html, 0), + copy_and_paste_fixture_setup, + test_copy_and_paste, + copy_and_paste_fixture_teardown); + + return g_test_run(); +} + +#else + +int main(int argc, char** argv) +{ + g_critical("You will need at least GTK+ 2.14.0 to run the unit tests."); + return 0; +} + +#endif diff --git a/WebKit/gtk/tests/testdomdomwindow.c b/WebKit/gtk/tests/testdomdomwindow.c new file mode 100644 index 0000000..1796057 --- /dev/null +++ b/WebKit/gtk/tests/testdomdomwindow.c @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2010 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "test_utils.h" + +#include <glib.h> +#include <glib/gstdio.h> +#include <gtk/gtk.h> +#include <webkit/webkit.h> + +#if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) + +#define HTML_DOCUMENT "<html><head><title>This is the title</title></head><body></body></html>" + +typedef struct { + GtkWidget* webView; + GtkWidget* window; + WebKitDOMDOMWindow* domWindow; + GMainLoop* loop; + + gboolean loaded; + gboolean clicked; + gconstpointer data; +} DomDomviewFixture; + +static gboolean finish_loading(DomDomviewFixture* fixture) +{ + if (g_main_loop_is_running(fixture->loop)) + g_main_loop_quit(fixture->loop); + + return FALSE; +} + +static void dom_domview_fixture_setup(DomDomviewFixture* fixture, gconstpointer data) +{ + fixture->loop = g_main_loop_new(NULL, TRUE); + fixture->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + fixture->webView = webkit_web_view_new(); + fixture->data = data; + + gtk_container_add(GTK_CONTAINER(fixture->window), GTK_WIDGET(fixture->webView)); +} + +static void dom_domview_fixture_teardown(DomDomviewFixture* fixture, gconstpointer data) +{ + gtk_widget_destroy(fixture->window); + g_main_loop_unref(fixture->loop); +} + +static gboolean loadedCallback(WebKitDOMDOMWindow* view, WebKitDOMEvent* event, DomDomviewFixture* fixture) +{ + g_assert(fixture->loaded == FALSE); + fixture->loaded = TRUE; + + return FALSE; +} + +static gboolean clickedCallback(WebKitDOMDOMWindow* view, WebKitDOMEvent* event, DomDomviewFixture* fixture) +{ + WebKitDOMEventTarget* target; + gushort phase; + + g_assert(event); + g_assert(WEBKIT_DOM_IS_EVENT(event)); + + // We should catch this in the bubbling up phase, since we are connecting to the toplevel object + phase = webkit_dom_event_get_event_phase(event); + g_assert_cmpint(phase, ==, 3); + + target = webkit_dom_event_get_current_target(event); + g_assert(target == WEBKIT_DOM_EVENT_TARGET(view)); + + g_assert(fixture->clicked == FALSE); + fixture->clicked = TRUE; + + finish_loading(fixture); + + return FALSE; +} + +gboolean map_event_cb(GtkWidget *widget, GdkEvent* event, DomDomviewFixture* fixture) +{ + webkit_web_view_load_string(WEBKIT_WEB_VIEW (fixture->webView), (const char*)fixture->data, NULL, NULL, NULL); + + return FALSE; +} + +static void load_event_callback(WebKitWebView* webView, GParamSpec* spec, DomDomviewFixture* fixture) +{ + WebKitLoadStatus status = webkit_web_view_get_load_status(webView); + if (status == WEBKIT_LOAD_FINISHED) { + g_signal_connect(fixture->domWindow, "click-event", G_CALLBACK(clickedCallback), fixture); + + g_assert(fixture->clicked == FALSE); + gtk_test_widget_click (GTK_WIDGET(fixture->webView), 1, 0); + } + +} + +static void test_dom_domview_signals(DomDomviewFixture* fixture, gconstpointer data) +{ + g_assert(fixture); + WebKitWebView* view = (WebKitWebView*)fixture->webView; + g_assert(view); + WebKitDOMDocument* document = webkit_web_view_get_dom_document(view); + g_assert(document); + WebKitDOMDOMWindow* domWindow = webkit_dom_document_get_default_view(document); + g_assert(domWindow); + + fixture->domWindow = domWindow; + + g_signal_connect(fixture->domWindow, "load-event", G_CALLBACK(loadedCallback), fixture); + g_signal_connect(fixture->window, "map-event", G_CALLBACK(map_event_cb), fixture); + g_signal_connect(fixture->webView, "notify::load-status", G_CALLBACK(load_event_callback), fixture); + + gtk_widget_show_all(fixture->window); + gtk_window_present(GTK_WINDOW(fixture->window)); + + g_main_loop_run (fixture->loop); + + g_assert(fixture->loaded); + g_assert(fixture->clicked); +} + +int main(int argc, char** argv) +{ + if (!g_thread_supported()) + g_thread_init(NULL); + + gtk_test_init(&argc, &argv, NULL); + + g_test_bug_base("https://bugs.webkit.org/"); + + g_test_add("/webkit/domdomview/signals", + DomDomviewFixture, HTML_DOCUMENT, + dom_domview_fixture_setup, + test_dom_domview_signals, + dom_domview_fixture_teardown); + + return g_test_run(); +} + +#else +int main(int argc, char** argv) +{ + g_critical("You will need at least glib-2.16.0 and gtk-2.14.0 to run the unit tests. Doing nothing now."); + return 0; +} + +#endif diff --git a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp index b23aeb9..70fdea5 100644 --- a/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp +++ b/WebKit/gtk/webkit/webkitwebbackforwardlist.cpp @@ -445,7 +445,7 @@ void webkit_web_back_forward_list_add_item(WebKitWebBackForwardList *webBackForw * Clears the @webBackForwardList by removing all its elements. Note that not even * the current page is kept in list when cleared so you would have to add it later. * - * Since: 1.1.30 + * Since: 1.3.1 **/ void webkit_web_back_forward_list_clear(WebKitWebBackForwardList* webBackForwardList) { diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index f3bb5e6..2c95558 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -1257,7 +1257,11 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context) GdkDisplay* display = gdk_display_get_default(); gdk_display_get_pointer(display, 0, &xRoot, &yRoot, &modifiers); - event->button.window = static_cast<GdkWindow*>(g_object_ref(gdk_display_get_window_at_pointer(display, &x, &y))); + GdkWindow* window = gdk_display_get_window_at_pointer(display, &x, &y); + if (window) { + g_object_ref(window); + event->button.window = window; + } event->button.x = x; event->button.y = y; event->button.x_root = xRoot; @@ -3636,8 +3640,7 @@ void webkit_web_view_set_editable(WebKitWebView* webView, gboolean flag) // TODO: If the WebKitWebView is made editable and the selection is empty, set it to something. //if (!webkit_web_view_get_selected_dom_range(webView)) // mainFrame->setSelectionFromNone(); - } else - frame->removeEditingStyleFromBodyElement(); + } g_object_notify(G_OBJECT(webView), "editable"); } @@ -3761,7 +3764,11 @@ gfloat webkit_web_view_get_zoom_level(WebKitWebView* webView) if (!frame) return 1.0f; - return frame->zoomFactor(); + FrameView* view = frame->view(); + if (!view) + return 1; + + return view->zoomFactor(); } static void webkit_web_view_apply_zoom_level(WebKitWebView* webView, gfloat zoomLevel) @@ -3770,8 +3777,12 @@ static void webkit_web_view_apply_zoom_level(WebKitWebView* webView, gfloat zoom if (!frame) return; + FrameView* view = frame->view(); + if (!view) + return; + WebKitWebViewPrivate* priv = webView->priv; - frame->setZoomFactor(zoomLevel, priv->zoomFullContent ? ZoomPage : ZoomTextOnly); + view->setZoomFactor(zoomLevel, priv->zoomFullContent ? ZoomPage : ZoomTextOnly); } /** @@ -4370,7 +4381,7 @@ WebKitCacheModel webkit_get_cache_model() * * Returns: the #WebKitDOMDocument currently loaded in the @webView * - * Since: 1.3.0 + * Since: 1.3.1 **/ WebKitDOMDocument* webkit_web_view_get_dom_document(WebKitWebView* webView) diff --git a/WebKit/haiku/ChangeLog b/WebKit/haiku/ChangeLog index c821f12..35ad98a 100644 --- a/WebKit/haiku/ChangeLog +++ b/WebKit/haiku/ChangeLog @@ -1,3 +1,27 @@ +2010-05-31 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + +2010-05-30 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + This is a coding style cleanup before fixing to bug 35530. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + 2010-05-03 Jens Alfke <snej@chromium.org> Reviewed by Darin Fisher. diff --git a/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp b/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp index 48957a0..2e23af7 100644 --- a/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp +++ b/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp @@ -37,12 +37,11 @@ #include "FocusController.h" #include "Frame.h" #include "KeyboardEvent.h" +#include "NotImplemented.h" #include "Page.h" #include "PlatformKeyboardEvent.h" #include "WindowsKeyboardCodes.h" -#include "NotImplemented.h" - namespace WebCore { @@ -252,45 +251,45 @@ void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) return; if (start->isContentEditable()) { - switch(kevent->windowsVirtualKeyCode()) { + switch (kevent->windowsVirtualKeyCode()) { case VK_BACK: - frame->editor()->deleteWithDirection(SelectionController::BACKWARD, + frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); break; case VK_DELETE: - frame->editor()->deleteWithDirection(SelectionController::FORWARD, + frame->editor()->deleteWithDirection(SelectionController::DirectionForward, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, false, true); break; case VK_LEFT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::LEFT, + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionLeft, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, true); break; case VK_RIGHT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::RIGHT, + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionRight, kevent->ctrlKey() ? WordGranularity : CharacterGranularity, true); break; case VK_UP: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::BACKWARD, + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionBackward, kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); break; case VK_DOWN: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::FORWARD, + frame->selection()->modify(kevent->shiftKey() ? SelectionController::AlterationExtend : SelectionController::AlterationMove, + SelectionController::DirectionForward, kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, true); break; - case VK_PRIOR: // PageUp + case VK_PRIOR: // PageUp frame->editor()->command("MoveUpByPageAndModifyCaret"); break; - case VK_NEXT: // PageDown + case VK_NEXT: // PageDown frame->editor()->command("MoveDownByPageAndModifyCaret"); break; case VK_RETURN: @@ -336,7 +335,8 @@ void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) default: return; } - } else return; + } else + return; } } else { switch (kevent->windowsVirtualKeyCode()) { @@ -346,10 +346,10 @@ void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) case VK_DOWN: frame->editor()->command("MoveDown"); break; - case VK_PRIOR: // PageUp + case VK_PRIOR: // PageUp frame->editor()->command("MoveUpByPageAndModifyCaret"); break; - case VK_NEXT: // PageDown + case VK_NEXT: // PageDown frame->editor()->command("MoveDownByPageAndModifyCaret"); break; case VK_HOME: @@ -362,17 +362,18 @@ void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) break; default: if (kevent->ctrlKey()) { - switch(kevent->windowsVirtualKeyCode()) { - case VK_A: - frame->editor()->command("SelectAll"); - break; - case VK_C: case VK_X: - frame->editor()->command("Copy"); - break; - default: - return; + switch (kevent->windowsVirtualKeyCode()) { + case VK_A: + frame->editor()->command("SelectAll"); + break; + case VK_C: case VK_X: + frame->editor()->command("Copy"); + break; + default: + return; } - } else return; + } else + return; } } event->setDefaultHandled(); diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index 510ccfd..7d88fed 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,100 @@ +2010-05-30 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Make more HTML DOM members private, especially constructors, third and final batch + https://bugs.webkit.org/show_bug.cgi?id=39916 + + * WebView/WebHTMLRepresentation.mm: + (-[WebHTMLRepresentation elementWithName:inForm:]): Use the new HTMLFormElement + function, associatedElements, rather than getting directly at a data member + named formElements. + (-[WebHTMLRepresentation controlsInForm:]): Ditto. + +2010-05-28 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Sam Weinig, Gavin Barraclough, Oliver Hunt. + + Simplified the host calling convention. + + PART ONE: Functional code changes. + + [ None in WebKit ] + + PART TWO: Global search and replace. + + In the areas below, I used global search-and-replace to change + (ExecState*, JSObject*, JSValue, const ArgList&) => (ExecState*) + args.size() => exec->argumentCount() + args.at(i) => exec->argument(i) + + * Plugins/Hosted/ProxyInstance.h: + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyInstance::invoke): + (WebKit::ProxyInstance::invokeMethod): + (WebKit::ProxyInstance::invokeDefaultMethod): + +2010-05-27 Beth Dakin <bdakin@apple.com> + + Reviewed by Simon Fraser. + + Change z-component to 1. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView viewDidMoveToWindow]): + (-[WebHTMLView attachRootLayer:]): + +2010-05-26 Simon Fraser <simon.fraser@apple.com> + + Reviewed by Beth Dakin and Darin Adler. + + Fix for <rdar://problem/7464703> HiDPI: [Layers] Compositing layers + do not scale properly when running with a resolution independent + scale + + Apply the userSpaceScaleFactor as a scale on the layerHostingView. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView viewDidMoveToWindow]): + (-[WebHTMLView attachRootLayer:]): + +2010-05-25 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=39621 + <rdar://problem/8009738> Extreme memory growth on DOM Hanoi test + + Removed formStateDidChange support, which is not needed by any client. + + * WebCoreSupport/WebChromeClient.h: + (WebChromeClient::formStateDidChange): + * WebCoreSupport/WebChromeClient.mm: + * WebView/WebUIDelegatePrivate.h: + +2010-05-25 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler. + + Database origins aren't populated at launch (missing db in prefs sheet, possible other symptoms) + <rdar://problem/8013233> and https://bugs.webkit.org/show_bug.cgi?id=39486 + + * Storage/WebDatabaseManager.mm: + (WebKitInitializeDatabasesIfNecessary): Call initializeTracker() instead of trying to set the path on + an already created tracker that already has its origins populated. + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * WebView/WebView.mm: + (-[WebView _setZoomMultiplier:isTextOnly:]): Call function on FrameView. + (-[WebView setEditable:]): Get rid of call to empty function, + removeEditingStyleFromBodyElement. + 2010-05-21 David Hyatt <hyatt@apple.com> Reviewed by Dan Bernstein. diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.h b/WebKit/mac/Plugins/Hosted/ProxyInstance.h index c8fb118..b72e49a 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyInstance.h +++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.h @@ -64,10 +64,10 @@ private: virtual JSC::Bindings::Class* getClass() const; virtual JSC::JSValue getMethod(JSC::ExecState* exec, const JSC::Identifier& propertyName); - virtual JSC::JSValue invokeMethod(JSC::ExecState*, JSC::RuntimeMethod*, const JSC::ArgList& args); + virtual JSC::JSValue invokeMethod(JSC::ExecState*, JSC::RuntimeMethod*); virtual bool supportsInvokeDefaultMethod() const; - virtual JSC::JSValue invokeDefaultMethod(JSC::ExecState*, const JSC::ArgList&); + virtual JSC::JSValue invokeDefaultMethod(JSC::ExecState*); virtual bool supportsConstruct() const; virtual JSC::JSValue invokeConstruct(JSC::ExecState*, const JSC::ArgList&); @@ -81,7 +81,7 @@ private: JSC::JSValue numberValue(JSC::ExecState*) const; JSC::JSValue booleanValue() const; - JSC::JSValue invoke(JSC::ExecState*, InvokeType, uint64_t identifier, const JSC::ArgList& args); + JSC::JSValue invoke(JSC::ExecState*, InvokeType, uint64_t identifier, const JSC::ArgList&); template <typename T> std::auto_ptr<T> waitForReply(uint32_t requestID) const { diff --git a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm index b569a4f..b9a674d 100644 --- a/WebKit/mac/Plugins/Hosted/ProxyInstance.mm +++ b/WebKit/mac/Plugins/Hosted/ProxyInstance.mm @@ -141,7 +141,7 @@ JSC::Bindings::Class* ProxyInstance::getClass() const return proxyClass(); } -JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t identifier, const JSC::ArgList& args) +JSValue ProxyInstance::invoke(JSC::ExecState* exec, InvokeType type, uint64_t identifier, const ArgList& args) { if (!m_instanceProxy) return jsUndefined(); @@ -196,7 +196,7 @@ JSValue ProxyInstance::getMethod(JSC::ExecState* exec, const JSC::Identifier& pr return new (exec) ProxyRuntimeMethod(exec, exec->lexicalGlobalObject(), propertyName, methodList); } -JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod, const ArgList& args) +JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtimeMethod) { if (!asObject(runtimeMethod)->inherits(&ProxyRuntimeMethod::s_info)) return throwError(exec, TypeError, "Attempt to invoke non-plug-in method on plug-in object."); @@ -207,7 +207,7 @@ JSValue ProxyInstance::invokeMethod(ExecState* exec, JSC::RuntimeMethod* runtime ProxyMethod* method = static_cast<ProxyMethod*>(methodList[0]); - return invoke(exec, Invoke, method->serverIdentifier(), args); + return invoke(exec, Invoke, method->serverIdentifier(), ArgList(exec)); } bool ProxyInstance::supportsInvokeDefaultMethod() const @@ -228,10 +228,10 @@ bool ProxyInstance::supportsInvokeDefaultMethod() const return false; } - -JSValue ProxyInstance::invokeDefaultMethod(ExecState* exec, const ArgList& args) + +JSValue ProxyInstance::invokeDefaultMethod(ExecState* exec) { - return invoke(exec, InvokeDefault, 0, args); + return invoke(exec, InvokeDefault, 0, ArgList(exec)); } bool ProxyInstance::supportsConstruct() const diff --git a/WebKit/mac/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm index 782f422..8c5e8a2 100644 --- a/WebKit/mac/Storage/WebDatabaseManager.mm +++ b/WebKit/mac/Storage/WebDatabaseManager.mm @@ -138,7 +138,7 @@ void WebKitInitializeDatabasesIfNecessary() return; // Set the database root path in WebCore - DatabaseTracker::tracker().setDatabaseDirectoryPath(databasesDirectoryPath()); + DatabaseTracker::initializeTracker(databasesDirectoryPath()); // Set the DatabaseTrackerClient DatabaseTracker::tracker().setClient(WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient()); diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index f8f2b73..7deea79 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -143,7 +143,7 @@ public: virtual bool shouldReplaceWithGeneratedFileForUpload(const WebCore::String& path, WebCore::String &generatedFilename); virtual WebCore::String generateReplacementFile(const WebCore::String& path); - virtual void formStateDidChange(const WebCore::Node*); + virtual void formStateDidChange(const WebCore::Node*) { } virtual void formDidFocus(const WebCore::Node*); virtual void formDidBlur(const WebCore::Node*); diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 4e65751..0a52a9f 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -695,11 +695,6 @@ String WebChromeClient::generateReplacementFile(const String& path) return [[m_webView _UIDelegateForwarder] webView:m_webView generateReplacementFile:path]; } -void WebChromeClient::formStateDidChange(const WebCore::Node* node) -{ - CallUIDelegate(m_webView, @selector(webView:formStateDidChangeForNode:), kit(const_cast<WebCore::Node*>(node))); -} - void WebChromeClient::formDidFocus(const WebCore::Node* node) { CallUIDelegate(m_webView, @selector(webView:formDidFocusNode:), kit(const_cast<WebCore::Node*>(node))); diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm index 2684004..51fd5ba 100644 --- a/WebKit/mac/WebView/WebHTMLRepresentation.mm +++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm @@ -282,11 +282,11 @@ static HTMLFormElement* formElementFromDOMElement(DOMElement *element) HTMLFormElement* formElement = formElementFromDOMElement(form); if (!formElement) return nil; - Vector<HTMLFormControlElement*>& elements = formElement->formElements; + const Vector<HTMLFormControlElement*>& elements = formElement->associatedElements(); AtomicString targetName = name; for (unsigned i = 0; i < elements.size(); i++) { HTMLFormControlElement* elt = elements[i]; - if (elt->formControlName() == targetName) + if (elt->name() == targetName) return kit(elt); } return nil; @@ -331,7 +331,7 @@ static HTMLInputElement* inputElementFromDOMElement(DOMElement* element) if (!formElement) return nil; NSMutableArray *results = nil; - Vector<HTMLFormControlElement*>& elements = formElement->formElements; + const Vector<HTMLFormControlElement*>& elements = formElement->associatedElements(); for (unsigned i = 0; i < elements.size(); i++) { if (elements[i]->isEnumeratable()) { // Skip option elements, other duds DOMElement* de = kit(elements[i]); diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm index 5f9134f..a60ae12 100644 --- a/WebKit/mac/WebView/WebHTMLView.mm +++ b/WebKit/mac/WebView/WebHTMLView.mm @@ -3056,6 +3056,15 @@ WEBCORE_COMMAND(yankAndSelect) [[self _pluginController] startAllPlugins]; _private->lastScrollPosition = NSZeroPoint; + +#if USE(ACCELERATED_COMPOSITING) && !defined(BUILDING_ON_LEOPARD) + // We may have created the layer hosting view while outside the window. Update the scale factor + // now that we have a window to get it from. + if (_private->layerHostingView) { + CGFloat scaleFactor = [[self window] userSpaceScaleFactor]; + [[_private->layerHostingView layer] setTransform:CATransform3DMakeScale(scaleFactor, scaleFactor, 1)]; + } +#endif } } @@ -5561,6 +5570,13 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) [viewLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]]; #endif +#if !defined(BUILDING_ON_LEOPARD) + // If we aren't in the window yet, we'll use the screen's scale factor now, and reset the scale + // via -viewDidMoveToWindow. + CGFloat scaleFactor = [self window] ? [[self window] userSpaceScaleFactor] : [[NSScreen mainScreen] userSpaceScaleFactor]; + [viewLayer setTransform:CATransform3DMakeScale(scaleFactor, scaleFactor, 1)]; +#endif + [_private->layerHostingView setLayer:viewLayer]; [_private->layerHostingView setWantsLayer:YES]; diff --git a/WebKit/mac/WebView/WebTextCompletionController.mm b/WebKit/mac/WebView/WebTextCompletionController.mm index 2421fd7..ab0e621 100644 --- a/WebKit/mac/WebView/WebTextCompletionController.mm +++ b/WebKit/mac/WebView/WebTextCompletionController.mm @@ -172,8 +172,8 @@ using namespace std; // Get preceeding word stem WebFrame *frame = [_htmlView _frame]; DOMRange *selection = kit(core(frame)->selection()->toNormalizedRange().get()); - DOMRange *wholeWord = [frame _rangeByAlteringCurrentSelection:SelectionController::EXTEND - direction:SelectionController::BACKWARD granularity:WordGranularity]; + DOMRange *wholeWord = [frame _rangeByAlteringCurrentSelection:SelectionController::AlterationExtend + direction:SelectionController::DirectionBackward granularity:WordGranularity]; DOMRange *prefix = [wholeWord cloneRange]; [prefix setEnd:[selection startContainer] offset:[selection startOffset]]; diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h index a130b18..327a745 100644 --- a/WebKit/mac/WebView/WebUIDelegatePrivate.h +++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h @@ -141,7 +141,6 @@ enum { frame:(WebFrame *)frame listener:(id<WebGeolocationPolicyListener>)listener; -- (void)webView:(WebView *)sender formStateDidChangeForNode:(DOMNode *)node; - (void)webView:(WebView *)sender formDidFocusNode:(DOMNode *)node; - (void)webView:(WebView *)sender formDidBlurNode:(DOMNode *)node; diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 0df62ea..97c799b 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -3183,19 +3183,22 @@ static bool needsWebViewInitThreadWorkaround() return [self _realZoomMultiplierIsTextOnly] ? _private->zoomMultiplier : 1.0f; } -- (void)_setZoomMultiplier:(float)m isTextOnly:(BOOL)isTextOnly +- (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly { // NOTE: This has no visible effect when viewing a PDF (see <rdar://problem/4737380>) - _private->zoomMultiplier = m; + _private->zoomMultiplier = multiplier; + ASSERT(_private->page); if (_private->page) _private->page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage); - - // FIXME: it would be nice to rework this code so that _private->zoomMultiplier doesn't exist and callers - // all access _private->page->settings(). + + // FIXME: It would be nice to rework this code so that _private->zoomMultiplier doesn't exist + // and instead FrameView::zoomFactor is used. Frame* coreFrame = [self _mainCoreFrame]; - if (coreFrame) - coreFrame->setZoomFactor(m, isTextOnly ? ZoomTextOnly : ZoomPage); + if (coreFrame) { + if (FrameView* view = coreFrame->view()) + view->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage); + } } - (float)_zoomMultiplier:(BOOL)isTextOnly @@ -4664,8 +4667,7 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValu // If the WebView is made editable and the selection is empty, set it to something. if (![self selectedDOMRange]) mainFrame->setSelectionFromNone(); - } else - mainFrame->removeEditingStyleFromBodyElement(); + } } } } diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro index 389fb5f..22d4c8d 100644 --- a/WebKit/qt/Api/DerivedSources.pro +++ b/WebKit/qt/Api/DerivedSources.pro @@ -28,7 +28,7 @@ qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}define QT_QTWEBKIT_MOD qtheader_module.commands += echo $${QUOTE}$${LITERAL_HASH}include $${ESCAPE}<QtNetwork/QtNetwork$${ESCAPE}>$${QUOTE} >> $${qtheader_module.target} && WEBKIT_CLASS_HEADERS = $${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}$${LITERAL_DOLLAR}PWD/QtWebKit -regex = ".*\sclass\sQWEBKIT_EXPORT\s(\w+)\s(.*)" +regex = ".*\\sclass\\sQWEBKIT_EXPORT\\s(\\w+)\\s(.*)" for(HEADER, WEBKIT_API_HEADERS) { # 1. Append to QtWebKit header that includes all other header files @@ -70,7 +70,7 @@ for(HEADER, WEBKIT_API_HEADERS) { res = $$find(src, $$regex) isEmpty(res):break() - exp = $$replace(src, $$regex, "EXPORTED_CLASS = \1") + exp = $$replace(src, $$regex, "EXPORTED_CLASS = \\1") eval($$exp) CLASS_TARGET = "qtheader_$${EXPORTED_CLASS}" @@ -87,7 +87,7 @@ for(HEADER, WEBKIT_API_HEADERS) { # Qt's QRegExp does not support inline non-greedy matching, # so we'll have to work around it by updating the haystack - src = $$replace(src, $$regex, "\2") + src = $$replace(src, $$regex, "\\2") src_words = $$join(src, $${LITERAL_WHITESPACE}) } } diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 4b12545..7a28f83 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -55,6 +55,7 @@ #include "ScriptSourceCode.h" #include "ScriptValue.h" #include "Scrollbar.h" +#include "Settings.h" #include "SelectionController.h" #include "SubstituteData.h" #include "SVGSMILElement.h" @@ -1079,7 +1080,11 @@ void QWebFrame::render(QPainter* painter) */ void QWebFrame::setTextSizeMultiplier(qreal factor) { - d->frame->setZoomFactor(factor, ZoomTextOnly); + FrameView* view = d->frame->view(); + if (!view) + return; + + view->setZoomFactor(factor, ZoomTextOnly); } /*! @@ -1087,7 +1092,11 @@ void QWebFrame::setTextSizeMultiplier(qreal factor) */ qreal QWebFrame::textSizeMultiplier() const { - return d->frame->zoomFactor(); + FrameView* view = d->frame->view(); + if (!view) + return 1; + + return view->zoomFactor(); } /*! @@ -1098,12 +1107,24 @@ qreal QWebFrame::textSizeMultiplier() const void QWebFrame::setZoomFactor(qreal factor) { - d->frame->setZoomFactor(factor, d->frame->zoomMode()); + Page* page = d->frame->page(); + if (!page) + return; + + FrameView* view = d->frame->view(); + if (!view) + return; + + view->setZoomFactor(factor, page->settings()->zoomMode()); } qreal QWebFrame::zoomFactor() const { - return d->frame->zoomFactor(); + FrameView* view = d->frame->view(); + if (!view) + return 1; + + return view->zoomFactor(); } /*! diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp index 1ae8e35..0e9d92f 100644 --- a/WebKit/qt/Api/qwebpage.cpp +++ b/WebKit/qt/Api/qwebpage.cpp @@ -299,7 +299,7 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq) PageGroup::setShouldTrackVisitedLinks(true); #if ENABLE(NOTIFICATIONS) - notificationPresenterClient = new NotificationPresenterClientQt(); + notificationPresenterClient = new NotificationPresenterClientQt(q); #endif } @@ -1220,7 +1220,42 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev } else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") { double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble(); q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay); + } +#if ENABLE(TILED_BACKING_STORE) + else if (event->propertyName() == "_q_TiledBackingStoreTileSize") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + QSize tileSize = q->property("_q_TiledBackingStoreTileSize").toSize(); + frame->tiledBackingStore()->setTileSize(tileSize); + } else if (event->propertyName() == "_q_TiledBackingStoreTileCreationDelay") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + int tileCreationDelay = q->property("_q_TiledBackingStoreTileCreationDelay").toInt(); + frame->tiledBackingStore()->setTileCreationDelay(static_cast<double>(tileCreationDelay) / 1000.); + } else if (event->propertyName() == "_q_TiledBackingStoreKeepAreaMultiplier") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + FloatSize keepMultiplier; + FloatSize coverMultiplier; + frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + QSizeF qSize = q->property("_q_TiledBackingStoreKeepAreaMultiplier").toSizeF(); + keepMultiplier = FloatSize(qSize.width(), qSize.height()); + frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + } else if (event->propertyName() == "_q_TiledBackingStoreCoverAreaMultiplier") { + WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame()); + if (!frame->tiledBackingStore()) + return; + FloatSize keepMultiplier; + FloatSize coverMultiplier; + frame->tiledBackingStore()->getKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); + QSizeF qSize = q->property("_q_TiledBackingStoreCoverAreaMultiplier").toSizeF(); + coverMultiplier = FloatSize(qSize.width(), qSize.height()); + frame->tiledBackingStore()->setKeepAndCoverAreaMultipliers(keepMultiplier, coverMultiplier); } +#endif } void QWebPagePrivate::shortcutOverrideEvent(QKeyEvent* event) @@ -1543,6 +1578,7 @@ InspectorController* QWebPagePrivate::inspectorController() \value Back Navigate back in the history of navigated links. \value Forward Navigate forward in the history of navigated links. \value Stop Stop loading the current page. + \value StopScheduledPageRefresh Stop all pending page refresh/redirect requests. \value Reload Reload the current page. \value ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) \value Cut Cut the content currently selected into the clipboard. @@ -1948,6 +1984,15 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame) } } +static void collectChildFrames(QWebFrame* frame, QList<QWebFrame*>& list) +{ + list << frame->childFrames(); + QListIterator<QWebFrame*> it(frame->childFrames()); + while (it.hasNext()) { + collectChildFrames(it.next(), list); + } +} + /*! This function can be called to trigger the specified \a action. It is also called by QtWebKit if the user triggers the action, for example @@ -2044,6 +2089,16 @@ void QWebPage::triggerAction(WebAction action, bool) #endif break; } + case StopScheduledPageRefresh: { + QWebFrame* topFrame = mainFrame(); + topFrame->d->frame->redirectScheduler()->cancel(); + QList<QWebFrame*> childFrames; + collectChildFrames(topFrame, childFrames); + QListIterator<QWebFrame*> it(childFrames); + while (it.hasNext()) + it.next()->d->frame->redirectScheduler()->cancel(); + break; + } default: command = QWebPagePrivate::editorCommandForWebActions(action); break; @@ -2638,8 +2693,7 @@ void QWebPage::setContentEditable(bool editable) frame->applyEditingStyleToBodyElement(); // FIXME: mac port calls this if there is no selectedDOMRange //frame->setSelectionFromNone(); - } else - frame->removeEditingStyleFromBodyElement(); + } } d->updateEditorActions(); diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h index c085fd7..a4b555a 100644 --- a/WebKit/qt/Api/qwebpage.h +++ b/WebKit/qt/Api/qwebpage.h @@ -170,6 +170,8 @@ public: AlignLeft, AlignRight, + StopScheduledPageRefresh, + WebActionCount }; diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index bc1f45d..14548d9 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,204 @@ +2010-05-31 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + Change enum EAlteration from { MOVE, EXTEND } to { AlterationMove, AlterationExtend } and enum EDirection { FORWARD, BACKWARD, RIGHT, LEFT} to { DirectionForward, DirectionBackward, DirectionRight, DirectionLeft } to avoid macro conflict, and also better coding style conformance. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-05-31 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Escape backslashes in the .pro files + + qmake in Qt 4.7 warns about unescaped backspaces and deprecates them. + + * Api/DerivedSources.pro: + * docs/docs.pri: + +2010-05-30 Lyon Chen <liachen@rim.com> + + Reviewed by Kent Tamura. + + This is a coding style cleanup before fixing to bug 35530. + + Enum value FORWARD, BACKWARD, RIGHT, LEFT are causing macro conflicts. + https://bugs.webkit.org/show_bug.cgi?id=35530 + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::registerCommandForUndo): + (WebCore::EditorClientQt::handleKeyboardEvent): + +2010-05-29 Dawit Alemayehu <adawit@kde.org> + + Reviewed by Kenneth Rohde Christiansen. + + Added a WebAction to stop all pending page refresh/redirect + requests set through the <meta http-equiv="refresh"...> tag. + + https://bugs.webkit.org/show_bug.cgi?id=29899 + + * Api/qwebpage.cpp: + (QWebPage::triggerAction): + * Api/qwebpage.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::testStopScheduledPageRefresh): + +2010-05-28 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + Add a missing #if ENABLE(), some null checking. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-28 Antti Koivisto <koivisto@iki.fi> + + Reviewed by Kenneth Rohde Christiansen. + + https://bugs.webkit.org/show_bug.cgi?id=39874 + [Qt] Make tiled backing store more configurable + + Make tile size, tile creation delay and tiling area dynamically configurable. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dynamicPropertyChangeEvent): + +2010-05-28 Yael Aharon <yael.aharon@nokia.com> + + Unreviewed build fix after r60348. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setNotificationsReceiver): + +2010-05-28 Yael Aharon <yael.aharon@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Pass all web notification layout tests + https://bugs.webkit.org/show_bug.cgi?id=39146 + + Add support for multiple simultaneous notifications. + Add a private callback mechanism to the client for security checks. + Notifications are disabled if the client does not set the callbacks. + Support replaceId and cancel. + Send close and display events when needed. + + * Api/qwebpage.cpp: + (QWebPagePrivate::QWebPagePrivate): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setNotificationsReceiver): + (DumpRenderTreeSupportQt::allowNotificationForOrigin): + (DumpRenderTreeSupportQt::setCheckPermissionFunction): + (DumpRenderTreeSupportQt::setRequestPermissionFunction): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + * WebCoreSupport/NotificationPresenterClientQt.cpp: + (NotificationIconWrapper::NotificationIconWrapper): + (NotificationIconWrapper::~NotificationIconWrapper): + (NotificationPresenterClientQt::NotificationPresenterClientQt): + (NotificationPresenterClientQt::show): + (NotificationPresenterClientQt::cancel): + (NotificationPresenterClientQt::notificationObjectDestroyed): + (NotificationPresenterClientQt::requestPermission): + (NotificationPresenterClientQt::checkPermission): + (NotificationPresenterClientQt::allowNotificationForOrigin): + (NotificationPresenterClientQt::clearNotificationsList): + (NotificationPresenterClientQt::sendEvent): + * WebCoreSupport/NotificationPresenterClientQt.h: + (WebCore::NotificationPresenterClientQt::~NotificationPresenterClientQt): + (WebCore::NotificationPresenterClientQt::setReceiver): + +2010-05-27 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Platform plugin example + https://bugs.webkit.org/show_bug.cgi?id=39489 + + Adding a Qt platform plugin example to repository. + + * examples/platformplugin/README: Added. + * examples/platformplugin/WebPlugin.cpp: Added. + (Popup::populateList): + (Popup::onItemSelected): + (WebPopup::WebPopup): + (WebPopup::~WebPopup): + (WebPopup::createSingleSelectionPopup): + (WebPopup::createMultipleSelectionPopup): + (WebPopup::createPopup): + (WebPopup::show): + (WebPopup::hide): + (WebPopup::popupClosed): + (WebPopup::itemClicked): + (SingleSelectionPopup::SingleSelectionPopup): + (MultipleItemListDelegate::MultipleItemListDelegate): + (MultipleItemListDelegate::paint): + (MultipleSelectionPopup::MultipleSelectionPopup): + (WebPlugin::supportsExtension): + * examples/platformplugin/WebPlugin.h: Added. + (Popup::Popup): + (WebPlugin::createSelectInputMethod): + * examples/platformplugin/platformplugin.pro: Added. + * examples/platformplugin/qwebkitplatformplugin.h: Copied from WebKit/qt/Api/qwebkitplatformplugin.h. + (QWebSelectData::~QWebSelectData): + (QWebSelectData::): + (QWebSelectMethod::~QWebSelectMethod): + (QWebKitPlatformPlugin::~QWebKitPlatformPlugin): + (QWebKitPlatformPlugin::): + +2010-05-25 Antonio Gomes <tonikitoo@webkit.org> + + Reviewed by Ojan Vafai. + + [Qt] Expose the editing behavior setting in DRT to test all editing code paths + https://bugs.webkit.org/show_bug.cgi?id=39680 + + Add support to Qt's DRT to setting the editing behavior. Patch is a follow up of + bug 38603, which just stubbed out the Qt bits of it. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: Implementation of editing behavior control. + (DumpRenderTreeSupportQt::setEditingBehavior): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-24 Robert Hogan <robert@webkit.org> + + Reviewed by Laszlo Gombos. + + [Qt] DRT Support for removeOriginAccessWhitelistEntry + + Unskips http/tests/xmlhttprequest/origin-whitelisting-removal.html + + [Qt] DRT Support for removeOriginAccessWhitelistEntry + https://bugs.webkit.org/show_bug.cgi?id=39565 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * Api/qwebframe.cpp: + (QWebFrame::setTextSizeMultiplier): Call functions on FrameView. + (QWebFrame::textSizeMultiplier): Ditto. + (QWebFrame::setZoomFactor): Ditto. + (QWebFrame::zoomFactor): Ditto. + * Api/qwebpage.cpp: + (QWebPage::setContentEditable): Removed call to empty function, + removeEditingStyleFromBodyElement. + 2010-05-23 Noam Rosenthal <noam.rosenthal@nokia.com> Reviewed by Kenneth Rohde Christiansen. diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index 9d335b8..0b2e9a5 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -60,6 +60,9 @@ using namespace WebCore; +CheckPermissionFunctionType* checkPermissionFunction = 0; +RequestPermissionFunctionType* requestPermissionFunction = 0; + DumpRenderTreeSupportQt::DumpRenderTreeSupportQt() { } @@ -332,6 +335,11 @@ void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOri SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); } +void DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +{ + SecurityOrigin::removeOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains); +} + void DumpRenderTreeSupportQt::resetOriginAccessWhiteLists() { SecurityOrigin::resetOriginAccessWhitelists(); @@ -466,6 +474,22 @@ bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* && inputElement->autoComplete()); } +void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString& editingBehavior) +{ + WebCore::EditingBehavior coreEditingBehavior; + + if (editingBehavior == "win") + coreEditingBehavior = EditingWindowsBehavior; + else if (editingBehavior == "mac") + coreEditingBehavior = EditingMacBehavior; + + Page* corePage = QWebPagePrivate::core(page); + if (!corePage) + return; + + corePage->settings()->setEditingBehavior(coreEditingBehavior); +} + void DumpRenderTreeSupportQt::dumpFrameLoader(bool b) { FrameLoaderClientQt::dumpFrameLoaderCallbacks = b; @@ -512,6 +536,31 @@ void DumpRenderTreeSupportQt::dumpNotification(bool b) NotificationPresenterClientQt::dumpNotification = b; #endif } + +void DumpRenderTreeSupportQt::setNotificationsReceiver(QWebPage* page, QObject* receiver) +{ +#if ENABLE(NOTIFICATIONS) + page->d->notificationPresenterClient->setReceiver(receiver); +#endif +} + +void DumpRenderTreeSupportQt::allowNotificationForOrigin(QWebPage* page, const QString& origin) +{ +#if ENABLE(NOTIFICATIONS) + page->d->notificationPresenterClient->allowNotificationForOrigin(origin); +#endif +} + +void DumpRenderTreeSupportQt::setCheckPermissionFunction(CheckPermissionFunctionType* f) +{ + checkPermissionFunction = f; +} + +void DumpRenderTreeSupportQt::setRequestPermissionFunction(RequestPermissionFunctionType* f) +{ + requestPermissionFunction = f; +} + // 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 6045463..0d348cf 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -30,6 +30,18 @@ class QWebElement; class QWebFrame; class QWebPage; +enum NotificationPermission { + NotificationAllowed, + NotificationNotAllowed, + NotificationDenied +}; + +typedef void (CheckPermissionFunctionType) (QObject* receiver, const QUrl&, NotificationPermission&); +typedef void (RequestPermissionFunctionType) (QObject* receiver, QWebPage* page, const QString&); + +extern CheckPermissionFunctionType* checkPermissionFunction; +extern RequestPermissionFunctionType* requestPermissionFunction; + class QWEBKIT_EXPORT DumpRenderTreeSupportQt { public: @@ -78,8 +90,10 @@ public: static int pageNumberForElementById(QWebFrame* frame, const QString& id, float width, float height); static bool hasDocumentElement(QWebFrame* frame); static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId); + static void setEditingBehavior(QWebPage* page, const QString& editingBehavior); static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); + static void removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains); static void resetOriginAccessWhiteLists(); static int workerThreadCount(); @@ -98,7 +112,12 @@ public: static void dumpSetAcceptsEditing(bool b); static void dumpNotification(bool b); - + // These functions should eventually turn into public API + // and the "receiver" concept would go away + static void setNotificationsReceiver(QWebPage* page, QObject* receiver); + static void allowNotificationForOrigin(QWebPage* page, const QString& origin); + static void setCheckPermissionFunction(CheckPermissionFunctionType*); + static void setRequestPermissionFunction(RequestPermissionFunctionType*); }; #endif diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index 83aa2a9..0f54e21 100644 --- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -31,9 +31,6 @@ #include "config.h" #include "EditorClientQt.h" -#include "qwebpage.h" -#include "qwebpage_p.h" - #include "CSSStyleDeclaration.h" #include "Document.h" #include "EditCommandQt.h" @@ -46,15 +43,16 @@ #include "KeyboardEvent.h" #include "NotImplemented.h" #include "Page.h" -#include "Page.h" #include "PlatformKeyboardEvent.h" #include "QWebPageClient.h" #include "Range.h" #include "WindowsKeyboardCodes.h" +#include "qwebpage.h" +#include "qwebpage_p.h" +#include <QUndoStack> #include <stdio.h> -#include <QUndoStack> #define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__); static QString dumpPath(WebCore::Node *node) @@ -247,9 +245,8 @@ void EditorClientQt::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand { #ifndef QT_NO_UNDOSTACK Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame(); - if (m_inUndoRedo || (frame && !frame->editor()->lastEditCommand() /* HACK!! Don't recreate undos */)) { + if (m_inUndoRedo || (frame && !frame->editor()->lastEditCommand() /* HACK!! Don't recreate undos */)) return; - } m_page->undoStack()->push(new EditCommandQt(cmd)); #endif // QT_NO_UNDOSTACK } @@ -378,118 +375,120 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) } else #endif // QT_NO_SHORTCUT switch (kevent->windowsVirtualKeyCode()) { - case VK_BACK: - frame->editor()->deleteWithDirection(SelectionController::BACKWARD, - CharacterGranularity, false, true); - break; - case VK_DELETE: - frame->editor()->deleteWithDirection(SelectionController::FORWARD, - CharacterGranularity, false, true); - break; - case VK_LEFT: - if (kevent->shiftKey()) - frame->editor()->command("MoveLeftAndModifySelection").execute(); - else - frame->editor()->command("MoveLeft").execute(); - break; - case VK_RIGHT: - if (kevent->shiftKey()) - frame->editor()->command("MoveRightAndModifySelection").execute(); - else - frame->editor()->command("MoveRight").execute(); - break; - case VK_UP: - if (kevent->shiftKey()) - frame->editor()->command("MoveUpAndModifySelection").execute(); - else - frame->editor()->command("MoveUp").execute(); - break; - case VK_DOWN: - if (kevent->shiftKey()) - frame->editor()->command("MoveDownAndModifySelection").execute(); - else - frame->editor()->command("MoveDown").execute(); - break; - case VK_PRIOR: // PageUp - if (kevent->shiftKey()) - frame->editor()->command("MovePageUpAndModifySelection").execute(); - else - frame->editor()->command("MovePageUp").execute(); - break; - case VK_NEXT: // PageDown - if (kevent->shiftKey()) - frame->editor()->command("MovePageDownAndModifySelection").execute(); - else - frame->editor()->command("MovePageDown").execute(); - break; - case VK_TAB: - return; - default: - if (kevent->type() != PlatformKeyboardEvent::KeyDown && !kevent->ctrlKey() + case VK_BACK: + frame->editor()->deleteWithDirection(SelectionController::DirectionBackward, + CharacterGranularity, false, true); + break; + case VK_DELETE: + frame->editor()->deleteWithDirection(SelectionController::DirectionForward, + CharacterGranularity, false, true); + break; + case VK_LEFT: + if (kevent->shiftKey()) + frame->editor()->command("MoveLeftAndModifySelection").execute(); + else + frame->editor()->command("MoveLeft").execute(); + break; + case VK_RIGHT: + if (kevent->shiftKey()) + frame->editor()->command("MoveRightAndModifySelection").execute(); + else + frame->editor()->command("MoveRight").execute(); + break; + case VK_UP: + if (kevent->shiftKey()) + frame->editor()->command("MoveUpAndModifySelection").execute(); + else + frame->editor()->command("MoveUp").execute(); + break; + case VK_DOWN: + if (kevent->shiftKey()) + frame->editor()->command("MoveDownAndModifySelection").execute(); + else + frame->editor()->command("MoveDown").execute(); + break; + case VK_PRIOR: // PageUp + if (kevent->shiftKey()) + frame->editor()->command("MovePageUpAndModifySelection").execute(); + else + frame->editor()->command("MovePageUp").execute(); + break; + case VK_NEXT: // PageDown + if (kevent->shiftKey()) + frame->editor()->command("MovePageDownAndModifySelection").execute(); + else + frame->editor()->command("MovePageDown").execute(); + break; + case VK_TAB: + return; + default: + if (kevent->type() != PlatformKeyboardEvent::KeyDown && !kevent->ctrlKey() #ifndef Q_WS_MAC - // We need to exclude checking for Alt because it is just a different Shift - && !kevent->altKey() + // We need to exclude checking for Alt because it is just a different Shift + && !kevent->altKey() #endif - && !kevent->text().isEmpty()) { - frame->editor()->insertText(kevent->text(), event); - } else if (kevent->ctrlKey()) { - switch (kevent->windowsVirtualKeyCode()) { - case VK_A: - frame->editor()->command("SelectAll").execute(); - break; - case VK_B: - frame->editor()->command("ToggleBold").execute(); - break; - case VK_I: - frame->editor()->command("ToggleItalic").execute(); - break; - default: - // catch combination AltGr+key or Ctrl+Alt+key - if (kevent->type() != PlatformKeyboardEvent::KeyDown && kevent->altKey() && !kevent->text().isEmpty()) { - frame->editor()->insertText(kevent->text(), event); - break; - } - return; + && !kevent->text().isEmpty()) { + frame->editor()->insertText(kevent->text(), event); + } else if (kevent->ctrlKey()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_A: + frame->editor()->command("SelectAll").execute(); + break; + case VK_B: + frame->editor()->command("ToggleBold").execute(); + break; + case VK_I: + frame->editor()->command("ToggleItalic").execute(); + break; + default: + // catch combination AltGr+key or Ctrl+Alt+key + if (kevent->type() != PlatformKeyboardEvent::KeyDown && kevent->altKey() && !kevent->text().isEmpty()) { + frame->editor()->insertText(kevent->text(), event); + break; } - } else return; + return; + } + } else + return; } } else { #ifndef QT_NO_SHORTCUT - if (kevent->qtEvent() == QKeySequence::Copy) { + if (kevent->qtEvent() == QKeySequence::Copy) m_page->triggerAction(QWebPage::Copy); - } else + else #endif // QT_NO_SHORTCUT switch (kevent->windowsVirtualKeyCode()) { - case VK_UP: - frame->editor()->command("MoveUp").execute(); - break; - case VK_DOWN: - frame->editor()->command("MoveDown").execute(); - break; - case VK_PRIOR: // PageUp - frame->editor()->command("MovePageUp").execute(); - break; - case VK_NEXT: // PageDown - frame->editor()->command("MovePageDown").execute(); - break; - case VK_HOME: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToBeginningOfDocument").execute(); - break; - case VK_END: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToEndOfDocument").execute(); - break; - default: - if (kevent->ctrlKey()) { - switch (kevent->windowsVirtualKeyCode()) { - case VK_A: - frame->editor()->command("SelectAll").execute(); - break; - default: - return; - } - } else return; + case VK_UP: + frame->editor()->command("MoveUp").execute(); + break; + case VK_DOWN: + frame->editor()->command("MoveDown").execute(); + break; + case VK_PRIOR: // PageUp + frame->editor()->command("MovePageUp").execute(); + break; + case VK_NEXT: // PageDown + frame->editor()->command("MovePageDown").execute(); + break; + case VK_HOME: + if (kevent->ctrlKey()) + frame->editor()->command("MoveToBeginningOfDocument").execute(); + break; + case VK_END: + if (kevent->ctrlKey()) + frame->editor()->command("MoveToEndOfDocument").execute(); + break; + default: + if (kevent->ctrlKey()) { + switch (kevent->windowsVirtualKeyCode()) { + case VK_A: + frame->editor()->command("SelectAll").execute(); + break; + default: + return; + } + } else + return; } } event->setDefaultHandled(); diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 00359c0..3cf19a6 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -51,6 +51,7 @@ #include "HTMLFormElement.h" #include "HTMLPlugInElement.h" #include "HTTPParsers.h" +#include "NotificationPresenterClientQt.h" #include "NotImplemented.h" #include "QNetworkReplyHandler.h" #include "ResourceHandleInternal.h" @@ -638,8 +639,12 @@ void FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* w if (world != mainThreadNormalWorld()) return; - if (m_webFrame) + if (m_webFrame) { emit m_webFrame->javaScriptWindowObjectCleared(); +#if ENABLE(NOTIFICATIONS) + m_webFrame->page()->d->notificationPresenterClient->clearNotificationsList(); +#endif + } } void FrameLoaderClientQt::documentElementAvailable() diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp index d6546ae..f76868d 100644 --- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp @@ -32,13 +32,15 @@ #include "config.h" #include "NotificationPresenterClientQt.h" +#include "DumpRenderTreeSupportQt.h" #include "Document.h" +#include "EventNames.h" #include "KURL.h" -#include "NotImplemented.h" #include "SecurityOrigin.h" +#include "qwebframe.h" #include "qwebkitglobal.h" - +#include "qwebpage.h" #include <QtGui> @@ -48,25 +50,66 @@ using namespace WebCore; bool NotificationPresenterClientQt::dumpNotification = false; -NotificationPresenterClientQt::NotificationPresenterClientQt() +NotificationIconWrapper::NotificationIconWrapper() +{ +#ifndef QT_NO_SYSTEMTRAYICON + m_notificationIcon = 0; +#endif +} + +NotificationIconWrapper::~NotificationIconWrapper() +{ +#ifndef QT_NO_SYSTEMTRAYICON + delete m_notificationIcon; +#endif +} + +NotificationPresenterClientQt::NotificationPresenterClientQt(QWebPage* page) : m_page(page) { } bool NotificationPresenterClientQt::show(Notification* notification) { + QHash <Notification*, NotificationIconWrapper*>::Iterator end = m_notifications.end(); + QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.begin(); + + if (!notification->replaceId().isEmpty()) { + while (iter != end) { + Notification* existingNotification = iter.key(); + if (existingNotification->replaceId() == notification->replaceId() && existingNotification->url().protocol() == notification->url().protocol() && existingNotification->url().host() == notification->url().host()) + break; + iter++; + } + } else + iter = end; + if (dumpNotification) { + if (iter != end) { + Notification* oldNotification = iter.key(); + printf("REPLACING NOTIFICATION %s\n", oldNotification->isHTML() ? QString(oldNotification->url().string()).toUtf8().constData() : QString(oldNotification->contents().title()).toUtf8().constData()); + } if (notification->isHTML()) printf("DESKTOP NOTIFICATION: contents at %s\n", QString(notification->url().string()).toUtf8().constData()); else { - printf("DESKTOP NOTIFICATION: icon %s, title %s, text %s\n", + printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n", + notification->dir() == "rtl" ? "(RTL)" : "", QString(notification->contents().icon().string()).toUtf8().constData(), QString(notification->contents().title()).toUtf8().constData(), QString(notification->contents().body()).toUtf8().constData()); } } + if (iter != end) { + sendEvent(iter.key(), eventNames().closeEvent); + delete m_notifications.take(iter.key()); + } + NotificationIconWrapper* wrapper = new NotificationIconWrapper(); + m_notifications.insert(notification, wrapper); + sendEvent(notification, "display"); + #ifndef QT_NO_SYSTEMTRAYICON - m_tray.show(); - m_tray.showMessage(notification->contents().title(), notification->contents().body(), QSystemTrayIcon::Information); + wrapper->m_notificationIcon = new QSystemTrayIcon; + wrapper->m_notificationIcon->show(); + wrapper->m_notificationIcon->showMessage(notification->contents().title(), notification->contents().body()); #endif return true; } @@ -80,12 +123,17 @@ void NotificationPresenterClientQt::cancel(Notification* notification) printf("DESKTOP NOTIFICATION CLOSED: %s\n", QString(notification->contents().title()).toUtf8().constData()); } - notImplemented(); + QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.find(notification); + if (iter != m_notifications.end()) + sendEvent(iter.key(), eventNames().closeEvent); } void NotificationPresenterClientQt::notificationObjectDestroyed(Notification* notification) { - notImplemented(); + // Called from ~Notification(), Remove the entry from the notifications list and delete the icon. + QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.find(notification); + if (iter != m_notifications.end()) + delete m_notifications.take(notification); } void NotificationPresenterClientQt::requestPermission(SecurityOrigin* origin, PassRefPtr<VoidCallback> callback) @@ -93,13 +141,62 @@ void NotificationPresenterClientQt::requestPermission(SecurityOrigin* origin, Pa if (dumpNotification) printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n", QString(origin->toString()).toUtf8().constData()); - notImplemented(); + QString originString = origin->toString(); + QHash<QString, QList<RefPtr<VoidCallback> > >::iterator iter = m_pendingPermissionRequests.find(originString); + if (iter != m_pendingPermissionRequests.end()) + iter.value().append(callback); + else { + QList<RefPtr<VoidCallback> > callbacks; + RefPtr<VoidCallback> cb = callback; + callbacks.append(cb); + m_pendingPermissionRequests.insert(originString, callbacks); + if (requestPermissionFunction) + requestPermissionFunction(m_receiver, m_page, originString); + } +} + +NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(const KURL& url) +{ + NotificationPermission permission = NotificationNotAllowed; + QString origin = url.string(); + if (checkPermissionFunction) + checkPermissionFunction(m_receiver, origin, permission); + switch (permission) { + case NotificationAllowed: + return NotificationPresenter::PermissionAllowed; + case NotificationNotAllowed: + return NotificationPresenter::PermissionNotAllowed; + case NotificationDenied: + return NotificationPresenter::PermissionDenied; + } + ASSERT_NOT_REACHED(); + return NotificationPresenter::PermissionNotAllowed; +} + +void NotificationPresenterClientQt::allowNotificationForOrigin(const QString& origin) +{ + QHash<QString, QList<RefPtr<VoidCallback> > >::iterator iter = m_pendingPermissionRequests.find(origin); + if (iter != m_pendingPermissionRequests.end()) { + QList<RefPtr<VoidCallback> >& callbacks = iter.value(); + for (int i = 0; i < callbacks.size(); i++) + callbacks.at(i)->handleEvent(); + m_pendingPermissionRequests.remove(origin); + } +} + +void NotificationPresenterClientQt::clearNotificationsList() +{ + m_pendingPermissionRequests.clear(); + while (!m_notifications.isEmpty()) { + QHash <Notification*, NotificationIconWrapper*>::Iterator iter = m_notifications.begin(); + delete m_notifications.take(iter.key()); + } } -NotificationPresenter::Permission NotificationPresenterClientQt::checkPermission(const KURL&) +void NotificationPresenterClientQt::sendEvent(Notification* notification, const AtomicString& eventName) { - // FIXME Implement permission policy - return NotificationPresenter::PermissionAllowed; + RefPtr<Event> event = Event::create(eventName, false, true); + notification->dispatchEvent(event.release()); } #endif // ENABLE(NOTIFICATIONS) diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h index 5967867..c949513 100644 --- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h +++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h @@ -29,20 +29,35 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef NotificationPresenterClientQt_h +#define NotificationPresenterClientQt_h + #include "Notification.h" #include "NotificationPresenter.h" +#include <QMultiHash> #include <QSystemTrayIcon> + #if ENABLE(NOTIFICATIONS) +class QWebPage; namespace WebCore { class Document; class KURL; +struct NotificationIconWrapper { + NotificationIconWrapper(); + ~NotificationIconWrapper(); +#ifndef QT_NO_SYSTEMTRAYICON + QSystemTrayIcon* m_notificationIcon; +#endif +}; + class NotificationPresenterClientQt : public NotificationPresenter { public: - NotificationPresenterClientQt(); + NotificationPresenterClientQt(QWebPage*); + ~NotificationPresenterClientQt() {} /* WebCore::NotificationPresenter interface */ virtual bool show(Notification*); @@ -51,13 +66,22 @@ public: virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>); virtual NotificationPresenter::Permission checkPermission(const KURL&); + void allowNotificationForOrigin(const QString& origin); + void clearNotificationsList(); + static bool dumpNotification; -private: -#ifndef QT_NO_SYSTEMTRAYICON - QSystemTrayIcon m_tray; -#endif + void setReceiver(QObject* receiver) { m_receiver = receiver; } + +private: + void sendEvent(Notification*, const AtomicString& eventName); + QWebPage* m_page; + QMultiHash<QString, QList<RefPtr<VoidCallback> > > m_pendingPermissionRequests; + QHash <Notification*, NotificationIconWrapper*> m_notifications; + QObject* m_receiver; }; } #endif +#endif + diff --git a/WebKit/qt/docs/docs.pri b/WebKit/qt/docs/docs.pri index 804817b..a56ddb4 100644 --- a/WebKit/qt/docs/docs.pri +++ b/WebKit/qt/docs/docs.pri @@ -3,7 +3,7 @@ include(../../../WebKit.pri) unix { QDOC = SRCDIR=$$PWD/../../.. OUTPUT_DIR=$$OUTPUT_DIR $$(QTDIR)/bin/qdoc3 } else { - QDOC = $$(QTDIR)\bin\qdoc3.exe + QDOC = $$(QTDIR)\\bin\\qdoc3.exe } unix { diff --git a/WebKit/qt/examples/platformplugin/README b/WebKit/qt/examples/platformplugin/README new file mode 100644 index 0000000..47ef797 --- /dev/null +++ b/WebKit/qt/examples/platformplugin/README @@ -0,0 +1,11 @@ +Platform plugin example. + +This project will create a shared library named platformplugin in directory $$[QT_INSTALL_PLUGINS]/webkit +that will provide combo boxes popups to QtWebKit. + +QtWebKit will look for the plugins automatically so there is no need to make any other configuration to +put the plugin into use. To stop using the plugin just remove the directory $$[QT_INSTALL_PLUGINS]/webkit. + +This plugin can provide popups for <select multiple> elements but to use this feature QtWebKit must be +compiled with NO_LISTBOX_RENDERING enabled. + diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp new file mode 100644 index 0000000..79e583d --- /dev/null +++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ +#include "WebPlugin.h" + +#include <QHBoxLayout> +#include <QListWidget> +#include <QListWidgetItem> +#include <QPainter> +#include <QtPlugin> +#include <QPushButton> +#include <QStyledItemDelegate> +#include <QVBoxLayout> + +static const int gMaemoListItemSize = 70; +static const int gMaemoListPadding = 38; +static const int gMaemoMaxVisibleItems = 5; + +void Popup::populateList() +{ + QListWidgetItem* listItem; + for (int i = 0; i < m_data.itemCount(); ++i) { + if (m_data.itemType(i) == QWebSelectData::Option) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(m_data.itemIsSelected(i)); + } else if (m_data.itemType(i) == QWebSelectData::Group) { + listItem = new QListWidgetItem(m_data.itemText(i)); + m_list->addItem(listItem); + listItem->setSelected(false); + listItem->setFlags(Qt::NoItemFlags); + } + } + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(onItemSelected(QListWidgetItem*))); +} + +void Popup::onItemSelected(QListWidgetItem* item) +{ + if (item->flags() != Qt::NoItemFlags) + emit itemClicked(m_list->row(item)); +} + +WebPopup::WebPopup() + : m_popup(0) +{ +} + +WebPopup::~WebPopup() +{ + if (m_popup) + m_popup->deleteLater(); +} + +Popup* WebPopup::createSingleSelectionPopup(const QWebSelectData& data) +{ + return new SingleSelectionPopup(data); +} + +Popup* WebPopup::createMultipleSelectionPopup(const QWebSelectData& data) +{ + return new MultipleSelectionPopup(data); +} + +Popup* WebPopup::createPopup(const QWebSelectData& data) +{ + Popup* result = data.multiple() ? createMultipleSelectionPopup(data) : createSingleSelectionPopup(data); + connect(result, SIGNAL(finished(int)), this, SLOT(popupClosed())); + connect(result, SIGNAL(itemClicked(int)), this, SLOT(itemClicked(int))); + return result; +} + +void WebPopup::show(const QWebSelectData& data) +{ + if (m_popup) + return; + + m_popup = createPopup(data); + m_popup->show(); +} + +void WebPopup::hide() +{ + if (!m_popup) + return; + + m_popup->accept(); +} + +void WebPopup::popupClosed() +{ + if (!m_popup) + return; + + m_popup->deleteLater(); + m_popup = 0; + emit didHide(); +} + +void WebPopup::itemClicked(int idx) +{ + emit selectItem(idx, true, false); +} + +SingleSelectionPopup::SingleSelectionPopup(const QWebSelectData& data) + : Popup(data) +{ + const char* title = "select"; + if (qstrcmp(title, "weba_ti_texlist_single")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select item"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + populateList(); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + hLayout->addSpacing(gMaemoListPadding); + + connect(m_list, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(accept())); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + + +class MultipleItemListDelegate : public QStyledItemDelegate { +public: + MultipleItemListDelegate(QObject* parent = 0) + : QStyledItemDelegate(parent) + { + tickMark = QIcon::fromTheme("widgets_tickmark_list").pixmap(48, 48); + } + + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const + { + QStyledItemDelegate::paint(painter, option, index); + + if (option.state & QStyle::State_Selected) + painter->drawPixmap(option.rect.width() - tickMark.rect().width(), option.rect.y() + (option.rect.height() / 2 - tickMark.rect().height() / 2), tickMark); + } + +private: + QPixmap tickMark; +}; + +MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data) + : Popup(data) +{ + const char* title = "select"; + if (qstrcmp(title, "weba_ti_textlist_multi")) + setWindowTitle(QString::fromUtf8(title)); + else + setWindowTitle("Select items"); + + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setContentsMargins(0, 0, 0, 0); + + m_list = new QListWidget(this); + m_list->setSelectionMode(QAbstractItemView::MultiSelection); + populateList(); + + MultipleItemListDelegate* delegate = new MultipleItemListDelegate(this); + m_list->setItemDelegate(delegate); + + hLayout->addSpacing(gMaemoListPadding); + hLayout->addWidget(m_list); + + QVBoxLayout* vLayout = new QVBoxLayout(); + + const int visibleItemCount = (m_list->count() > gMaemoMaxVisibleItems) ? gMaemoMaxVisibleItems : m_list->count(); + vLayout->addSpacing((visibleItemCount - 1) * gMaemoListItemSize); + + QPushButton* done = new QPushButton(this); + title = "done"; + if (qstrcmp(title, "wdgt_bd_done")) + done->setText(QString::fromUtf8(title)); + else + done->setText("Done"); + + done->setMinimumWidth(178); + vLayout->addWidget(done); + + hLayout->addSpacing(8); + hLayout->addLayout(vLayout); + hLayout->addSpacing(18); + + connect(done, SIGNAL(clicked()), this, SLOT(accept())); + resize(size().width(), visibleItemCount * gMaemoListItemSize); +} + +bool WebPlugin::supportsExtension(Extension extension) const +{ + return extension == MultipleSelections; +} + +Q_EXPORT_PLUGIN2(qwebselectim, WebPlugin) diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.h b/WebKit/qt/examples/platformplugin/WebPlugin.h new file mode 100644 index 0000000..a46a07b --- /dev/null +++ b/WebKit/qt/examples/platformplugin/WebPlugin.h @@ -0,0 +1,95 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ +#ifndef WEBPLUGIN_H +#define WEBPLUGIN_H + +#include "qwebkitplatformplugin.h" + +#include <QDialog> + +class QListWidgetItem; +class QListWidget; + +class Popup : public QDialog { + Q_OBJECT +public: + Popup(const QWebSelectData& data) : m_data(data) { setModal(true); } + +signals: + void itemClicked(int idx); + +protected slots: + void onItemSelected(QListWidgetItem* item); + +protected: + void populateList(); + + const QWebSelectData& m_data; + QListWidget* m_list; +}; + + +class SingleSelectionPopup : public Popup { + Q_OBJECT +public: + SingleSelectionPopup(const QWebSelectData& data); +}; + + +class MultipleSelectionPopup : public Popup { + Q_OBJECT +public: + MultipleSelectionPopup(const QWebSelectData& data); +}; + + +class WebPopup : public QWebSelectMethod { + Q_OBJECT +public: + WebPopup(); + ~WebPopup(); + + virtual void show(const QWebSelectData& data); + virtual void hide(); + +private slots: + void popupClosed(); + void itemClicked(int idx); + +private: + Popup* m_popup; + + Popup* createPopup(const QWebSelectData& data); + Popup* createSingleSelectionPopup(const QWebSelectData& data); + Popup* createMultipleSelectionPopup(const QWebSelectData& data); +}; + +class WebPlugin : public QObject, public QWebKitPlatformPlugin +{ + Q_OBJECT + Q_INTERFACES(QWebKitPlatformPlugin) +public: + virtual QWebSelectMethod* createSelectInputMethod() const { return new WebPopup(); } + virtual bool supportsExtension(Extension extension) const; +}; + + + +#endif // WEBPLUGIN_H diff --git a/WebKit/qt/examples/platformplugin/platformplugin.pro b/WebKit/qt/examples/platformplugin/platformplugin.pro new file mode 100644 index 0000000..c5c665b --- /dev/null +++ b/WebKit/qt/examples/platformplugin/platformplugin.pro @@ -0,0 +1,13 @@ +QT += core gui +TARGET = $$qtLibraryTarget(platformplugin) +TEMPLATE = lib +CONFIG += plugin + +DESTDIR = $$[QT_INSTALL_PLUGINS]/webkit + +SOURCES += \ + WebPlugin.cpp + +HEADERS += \ + WebPlugin.h \ + qwebkitplatformplugin.h diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h new file mode 100644 index 0000000..7d024ae --- /dev/null +++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef QWEBKITPLATFORMPLUGIN_H +#define QWEBKITPLATFORMPLUGIN_H + +/* + * Warning: The contents of this file is not part of the public QtWebKit API + * and may be changed from version to version or even be completely removed. +*/ + +#include <QObject> + +class QWebSelectData +{ +public: + inline ~QWebSelectData() {} + + enum ItemType { Option, Group, Separator }; + + virtual ItemType itemType(int) const = 0; + virtual QString itemText(int index) const = 0; + virtual QString itemToolTip(int index) const = 0; + virtual bool itemIsEnabled(int index) const = 0; + virtual bool itemIsSelected(int index) const = 0; + virtual int itemCount() const = 0; + virtual bool multiple() const = 0; +}; + +class QWebSelectMethod : public QObject +{ + Q_OBJECT +public: + inline ~QWebSelectMethod() {} + + virtual void show(const QWebSelectData&) = 0; + virtual void hide() = 0; + +Q_SIGNALS: + void selectItem(int index, bool allowMultiplySelections, bool shift); + void didHide(); +}; + +class QWebKitPlatformPlugin +{ +public: + inline ~QWebKitPlatformPlugin() {} + + enum Extension { + MultipleSelections + }; + + virtual QWebSelectMethod* createSelectInputMethod() const = 0; + virtual bool supportsExtension(Extension extension) const = 0; + +}; + +Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.0"); + +#endif // QWEBKITPLATFORMPLUGIN_H diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index ceb8aff..630ccce 100644 --- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -122,7 +122,8 @@ private slots: void originatingObjectInNetworkRequests(); void testJSPrompt(); void showModalDialog(); - + void testStopScheduledPageRefresh(); + private: QWebView* m_view; QWebPage* m_page; @@ -2090,5 +2091,30 @@ void tst_QWebPage::showModalDialog() QCOMPARE(res, QString("This is a test")); } +void tst_QWebPage::testStopScheduledPageRefresh() +{ + // Without QWebPage::StopScheduledPageRefresh + QWebPage page1; + page1.setNetworkAccessManager(new TestNetworkManager(&page1)); + page1.mainFrame()->setHtml("<html><head>" + "<meta http-equiv=\"refresh\"content=\"0;URL=http://qt.nokia.com/favicon.ico\">" + "</head><body><h1>Page redirects immediately...</h1>" + "</body></html>"); + QVERIFY(::waitForSignal(&page1, SIGNAL(loadFinished(bool)))); + QTest::qWait(500); + QCOMPARE(page1.mainFrame()->url().toString(), QString("http://qt.nokia.com/favicon.ico")); + + // With QWebPage::StopScheduledPageRefresh + QWebPage page2; + page2.setNetworkAccessManager(new TestNetworkManager(&page2)); + page2.mainFrame()->setHtml("<html><head>" + "<meta http-equiv=\"refresh\"content=\"1;URL=http://qt.nokia.com/favicon.ico\">" + "</head><body><h1>Page redirect test with 1 sec timeout...</h1>" + "</body></html>"); + page2.triggerAction(QWebPage::StopScheduledPageRefresh); + QTest::qWait(1500); + QCOMPARE(page2.mainFrame()->url().toString(), QString("about:blank")); +} + QTEST_MAIN(tst_QWebPage) #include "tst_qwebpage.moc" diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 69d7ea9..2979556 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,108 @@ +2010-05-30 Daniel Bates <dbates@rim.com> + + Unreviewed, attempt to fix the build after http://trac.webkit.org/changeset/60418. + + * WebFrame.cpp: + (WebFrame::elementWithName): + (WebFrame::controlsInForm): + +2010-05-22 Jer Noble <jer.noble@apple.com> + + Reviewed by Adam Roben. + + Full screen doesn't work for video elements + https://bugs.webkit.org/show_bug.cgi?id=39557 + rdar://problem/8011813 + + Modified FullscreenVideoController to work with MediaPlayerPrivateFullscreenWindow. The FullscreenVideoController + is now MediaPlayerPrivate agnostic.. + + * FullscreenVideoController.cpp: + (FullscreenVideoController::LayoutClient::LayoutClient): New helper class which implements WKCACFLayerLayoutClient. + (FullscreenVideoController::LayoutClient::layoutSublayersOfLayer): + (FullscreenVideoController::FullscreenVideoController): + (FullscreenVideoController::~FullscreenVideoController): + (FullscreenVideoController::enterFullscreen): + (FullscreenVideoController::exitFullscreen): + (FullscreenVideoController::fullscreenClientWndProc): Handle WM_KEYDOWN. + (FullscreenVideoController::createHUDWindow): + (FullscreenVideoController::hudWndProc): Handle WM_KEYDOWN. + (FullscreenVideoController::onChar): + (FullscreenVideoController::onKeyDown): New function: handles the VK_ESCAPE case more reliably than WM_CHAR. + * FullscreenVideoController.h: + * WebView.h: + (WebView::viewWindow): Added a simple viewWindow() accessor. + +2010-05-25 Brady Eidson <beidson@apple.com> + + Reviewed by Darin Adler. + + Database origins aren't populated at launch (missing db in prefs sheet, possible other symptoms) + <rdar://problem/8013233> and https://bugs.webkit.org/show_bug.cgi?id=39486 + + * WebDatabaseManager.cpp: + (WebKitInitializeWebDatabasesIfNecessary): Call initializeTracker() instead of trying to set the path on + an already created tracker that already has its origins populated. + * WebDatabaseManager.h: + + * WebView.cpp: + (WebView::initWithFrame): Call a renamed method instead. + +2010-05-25 Ada Chan <adachan@apple.com> + + Reviewed by Steve Falkenburg. + + https://bugs.webkit.org/show_bug.cgi?id=39651 + + Make m_closeWindowTimer a SuspendableTimer, so it is properly suspended + when page loading is deferred. + + * WebView.cpp: + (WebView::WebView): m_closeWindowTimer is now a pointer to a SuspendableTimer. + (WindowCloseTimer::create): + (WindowCloseTimer::WindowCloseTimer): + (WindowCloseTimer::contextDestroyed): Make sure we delete the WindowCloseTimer in the end. + (WindowCloseTimer::fired): + (WebView::closeWindowSoon): + (WebView::closeWindowTimerFired): + (WebView::notifyPreferencesChanged): Can just check for the existence m_closeWindowTimer, since + we only create it when we need to start the timer. + * WebView.h: + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * WebFrame.cpp: + (WebFrame::setTextSizeMultiplier): Call function on FrameView. + * WebView.cpp: + (WebView::setZoomMultiplier): Ditto. + +2010-05-24 Anders Carlsson <andersca@apple.com> + + Yet another Windows build fix. + + * WebView.cpp: + (WebView::canShowMIMEType): + Use the right capitalizatinon of 'MIME' (which also happens to be incorrect according to our guidelines). + +2010-05-24 Anders Carlsson <andersca@apple.com> + + Another Windows build fix. + + * WebView.cpp: + Don't include PlugInInfoStore.h, instead include PluginData.h + +2010-05-24 Anders Carlsson <andersca@apple.com> + + Fix Windows build. + + * WebView.cpp: + (WebView::canShowMIMEType): + 2010-05-21 Steve Block <steveblock@google.com> Reviewed by Jeremy Orlow. diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp index 6132fca..3aeb1ba 100644 --- a/WebKit/win/FullscreenVideoController.cpp +++ b/WebKit/win/FullscreenVideoController.cpp @@ -30,12 +30,16 @@ #include "FullscreenVideoController.h" #include "WebKitDLL.h" +#include "WebView.h" #include <ApplicationServices/ApplicationServices.h> #include <WebCore/BitmapInfo.h> +#include <WebCore/Chrome.h> #include <WebCore/Font.h> #include <WebCore/FontSelector.h> #include <WebCore/GraphicsContext.h> +#include <WebCore/Page.h> #include <WebCore/TextRun.h> +#include <WebCore/WKCACFLayer.h> #include <WebKitSystemInterface/WebKitSystemInterface.h> #include <windowsx.h> #include <wtf/StdLibExtras.h> @@ -169,9 +173,53 @@ void HUDSlider::drag(const IntPoint& point, bool start) m_buttonPosition = max(0, min(m_rect.width() - m_buttonSize, point.x() - m_dragStartOffset)); } +#if USE(ACCELERATED_COMPOSITING) +class FullscreenVideoController::LayoutClient : public WKCACFLayerLayoutClient { +public: + LayoutClient(FullscreenVideoController* parent); + void layoutSublayersOfLayer(WKCACFLayer* layer); + + FullscreenVideoController* m_parent; +}; + +FullscreenVideoController::LayoutClient::LayoutClient(FullscreenVideoController* parent) + : m_parent(parent) +{ +} + +void FullscreenVideoController::LayoutClient::layoutSublayersOfLayer(WKCACFLayer* layer) +{ + ASSERT_ARG(layer, layer == m_parent->m_rootChild); + + HTMLMediaElement* mediaElement = m_parent->m_mediaElement.get(); + if (!mediaElement) + return; + + WKCACFLayer* videoLayer = mediaElement->platformLayer(); + if (!videoLayer || videoLayer->superlayer() != layer) + return; + + FloatRect layerBounds = layer->bounds(); + + FloatSize videoSize = mediaElement->player()->naturalSize(); + float scaleFactor; + if (videoSize.aspectRatio() > layerBounds.size().aspectRatio()) + scaleFactor = layerBounds.width() / videoSize.width(); + else + scaleFactor = layerBounds.height() / videoSize.height(); + videoSize.scale(scaleFactor); + + // Calculate the centered position based on the videoBounds and layerBounds: + FloatPoint videoPosition; + FloatPoint videoOrigin; + videoOrigin.setX((layerBounds.width() - videoSize.width()) * 0.5); + videoOrigin.setY((layerBounds.height() - videoSize.height()) * 0.5); + videoLayer->setFrame(FloatRect(videoOrigin, videoSize)); +} +#endif + FullscreenVideoController::FullscreenVideoController() : m_hudWindow(0) - , m_videoWindow(0) , m_playPauseButton(HUDButton::PlayPauseButton, IntPoint((windowWidth - buttonSize) / 2, marginTop)) , m_timeSliderButton(HUDButton::TimeSliderButton, IntPoint(0, 0)) , m_volumeUpButton(HUDButton::VolumeUpButton, IntPoint(margin + buttonMiniSize + volumeSliderWidth + buttonMiniSize / 2, marginTop + (buttonSize - buttonMiniSize) / 2)) @@ -183,25 +231,22 @@ FullscreenVideoController::FullscreenVideoController() , m_hitWidget(0) , m_movingWindow(false) , m_timer(this, &FullscreenVideoController::timerFired) +#if USE(ACCELERATED_COMPOSITING) + , m_rootChild(WKCACFLayer::create(WKCACFLayer::Layer)) + , m_layoutClient(new LayoutClient(this)) +#endif + , m_fullscreenWindow(new MediaPlayerPrivateFullscreenWindow(this)) { +#if USE(ACCELERATED_COMPOSITING) + m_rootChild->setLayoutClient(m_layoutClient.get()); +#endif } FullscreenVideoController::~FullscreenVideoController() { - if (movie()) - movie()->exitFullscreen(); -} - -QTMovieGWorld* FullscreenVideoController::movie() const -{ - if (!m_mediaElement) - return 0; - - PlatformMedia platformMedia = m_mediaElement->platformMedia(); - if (platformMedia.type != PlatformMedia::QTMovieGWorldType) - return 0; - - return platformMedia.media.qtMovieGWorld; +#if USE(ACCELERATED_COMPOSITING) + m_rootChild->setLayoutClient(0); +#endif } void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement) @@ -218,13 +263,23 @@ void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement) void FullscreenVideoController::enterFullscreen() { - if (!movie()) + if (!m_mediaElement) return; - m_videoWindow = movie()->enterFullscreen(this); + WebView* webView = kit(m_mediaElement->document()->page()); + HWND parentHwnd = webView ? webView->viewWindow() : 0; + + m_fullscreenWindow->createWindow(parentHwnd); +#if USE(ACCELERATED_COMPOSITING) + m_fullscreenWindow->setRootChildLayer(m_rootChild); + + WKCACFLayer* videoLayer = m_mediaElement->player()->platformLayer(); + m_rootChild->addSublayer(videoLayer); + m_rootChild->setNeedsLayout(); +#endif RECT windowRect; - GetClientRect(m_videoWindow, &windowRect); + GetClientRect(m_fullscreenWindow->hwnd(), &windowRect); m_fullscreenSize.setWidth(windowRect.right - windowRect.left); m_fullscreenSize.setHeight(windowRect.bottom - windowRect.top); @@ -234,12 +289,23 @@ void FullscreenVideoController::enterFullscreen() void FullscreenVideoController::exitFullscreen() { SetWindowLongPtr(m_hudWindow, 0, 0); - if (movie()) - movie()->exitFullscreen(); + + if (m_fullscreenWindow) + m_fullscreenWindow = 0; ASSERT(!IsWindow(m_hudWindow)); - m_videoWindow = 0; m_hudWindow = 0; + + // We previously ripped the mediaElement's platform layer out + // of its orginial layer tree to display it in our fullscreen + // window. Now, we need to get the layer back in its original + // tree. + // + // As a side effect of setting the player to invisible/visible, + // the player's layer will be recreated, and will be picked up + // the next time the layer tree is synched. + m_mediaElement->player()->setVisible(0); + m_mediaElement->player()->setVisible(1); } bool FullscreenVideoController::canPlay() const @@ -308,6 +374,9 @@ LRESULT FullscreenVideoController::fullscreenClientWndProc(HWND wnd, UINT messag case WM_CHAR: onChar(wParam); break; + case WM_KEYDOWN: + onKeyDown(wParam); + break; case WM_LBUTTONDOWN: onMouseDown(IntPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); break; @@ -364,7 +433,7 @@ void FullscreenVideoController::createHUDWindow() // Dirty the window so the HUD draws RECT clearRect = { m_hudPosition.x(), m_hudPosition.y(), m_hudPosition.x() + windowWidth, m_hudPosition.y() + windowHeight }; - InvalidateRect(m_videoWindow, &clearRect, true); + InvalidateRect(m_fullscreenWindow->hwnd(), &clearRect, true); m_playPauseButton.setShowAltButton(!canPlay()); m_volumeSlider.setValue(volume()); @@ -377,7 +446,7 @@ void FullscreenVideoController::createHUDWindow() m_hudWindow = CreateWindowEx(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW, fullscreenVideeoHUDWindowClassName, 0, WS_POPUP | WS_VISIBLE, - m_hudPosition.x(), m_hudPosition.y(), 0, 0, m_videoWindow, 0, gInstance, 0); + m_hudPosition.x(), m_hudPosition.y(), 0, 0, m_fullscreenWindow->hwnd(), 0, gInstance, 0); ASSERT(::IsWindow(m_hudWindow)); SetWindowLongPtr(m_hudWindow, 0, reinterpret_cast<LONG_PTR>(this)); @@ -488,6 +557,9 @@ LRESULT FullscreenVideoController::hudWndProc(HWND wnd, UINT message, WPARAM wPa case WM_CHAR: controller->onChar(wParam); break; + case WM_KEYDOWN: + controller->onKeyDown(wParam); + break; case WM_LBUTTONDOWN: controller->onMouseDown(IntPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); break; @@ -511,6 +583,14 @@ void FullscreenVideoController::onChar(int c) togglePlay(); } +void FullscreenVideoController::onKeyDown(int virtualKey) +{ + if (virtualKey == VK_ESCAPE) { + if (m_mediaElement) + m_mediaElement->exitFullscreen(); + } +} + void FullscreenVideoController::timerFired(Timer<FullscreenVideoController>*) { // Update the time slider diff --git a/WebKit/win/FullscreenVideoController.h b/WebKit/win/FullscreenVideoController.h index 31acc63..9ac8c69 100644 --- a/WebKit/win/FullscreenVideoController.h +++ b/WebKit/win/FullscreenVideoController.h @@ -28,7 +28,7 @@ #if ENABLE(VIDEO) -#include "QTMovieGWorld.h" +#include "MediaPlayerPrivateFullscreenWindow.h" #include <WebCore/HTMLMediaElement.h> #include <WebCore/Image.h> @@ -38,6 +38,9 @@ namespace WebCore { class GraphicsContext; +#if USE(ACCELERATED_COMPOSITING) +class WKCACFLayer; +#endif } class HUDWidget { @@ -99,7 +102,7 @@ private: int m_dragStartOffset; }; -class FullscreenVideoController : QTMovieGWorldFullscreenClient, public Noncopyable { +class FullscreenVideoController : WebCore::MediaPlayerPrivateFullscreenClient, public Noncopyable { public: FullscreenVideoController(); virtual ~FullscreenVideoController(); @@ -111,12 +114,11 @@ public: void exitFullscreen(); private: - // QTMovieGWorldFullscreenClient + // MediaPlayerPrivateFullscreenWindowClient virtual LRESULT fullscreenClientWndProc(HWND, UINT message, WPARAM, LPARAM); - + void ensureWindow(); - QTMovieGWorld* movie() const; - + bool canPlay() const; void play(); void pause(); @@ -145,13 +147,21 @@ private: void onMouseDown(const WebCore::IntPoint&); void onMouseMove(const WebCore::IntPoint&); void onMouseUp(const WebCore::IntPoint&); + void onKeyDown(int virtualKey); RefPtr<WebCore::HTMLMediaElement> m_mediaElement; - HWND m_hudWindow, m_videoWindow; + HWND m_hudWindow; OwnPtr<HBITMAP> m_bitmap; WebCore::IntSize m_fullscreenSize; WebCore::IntPoint m_hudPosition; + OwnPtr<WebCore::MediaPlayerPrivateFullscreenWindow> m_fullscreenWindow; +#if USE(ACCELERATED_COMPOSITING) + RefPtr<WebCore::WKCACFLayer> m_rootChild; + class LayoutClient; + friend class LayoutClient; + OwnPtr<LayoutClient> m_layoutClient; +#endif HUDButton m_playPauseButton; HUDButton m_timeSliderButton; diff --git a/WebKit/win/WebDatabaseManager.cpp b/WebKit/win/WebDatabaseManager.cpp index 989f33c..238aa61 100644 --- a/WebKit/win/WebDatabaseManager.cpp +++ b/WebKit/win/WebDatabaseManager.cpp @@ -370,16 +370,16 @@ void WebDatabaseManager::dispatchDidModifyDatabase(SecurityOrigin* origin, const notifyCenter->postNotificationName(databaseDidModifyOriginName, securityOrigin.get(), userInfoBag.get()); } -void WebKitSetWebDatabasesPathIfNecessary() +void WebKitInitializeWebDatabasesIfNecessary() { - static bool pathSet = false; - if (pathSet) + static bool initialized = false; + if (initialized) return; WebCore::String databasesDirectory = WebCore::pathByAppendingComponent(WebCore::localUserSpecificStorageDirectory(), "Databases"); - WebCore::DatabaseTracker::tracker().setDatabaseDirectoryPath(databasesDirectory); + WebCore::DatabaseTracker::initializeTracker(databasesDirectory); - pathSet = true; + initialized = true; } #endif diff --git a/WebKit/win/WebDatabaseManager.h b/WebKit/win/WebDatabaseManager.h index c932986..405c916 100644 --- a/WebKit/win/WebDatabaseManager.h +++ b/WebKit/win/WebDatabaseManager.h @@ -88,7 +88,7 @@ private: ULONG m_refCount; }; -void WebKitSetWebDatabasesPathIfNecessary(); +void WebKitInitializeWebDatabasesIfNecessary(); #endif diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index 319fbbc..22bd339 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -83,7 +83,7 @@ #include <WebCore/NotImplemented.h> #include <WebCore/Page.h> #include <WebCore/PlatformKeyboardEvent.h> -#include <WebCore/PluginInfoStore.h> +#include <WebCore/PluginData.h> #include <WebCore/PluginDatabase.h> #include <WebCore/PluginView.h> #include <WebCore/PrintContext.h> @@ -1103,7 +1103,9 @@ void WebFrame::setTextSizeMultiplier(float multiplier) { Frame* coreFrame = core(this); ASSERT(coreFrame); - coreFrame->setZoomFactor(multiplier, ZoomTextOnly); + + if (FrameView* view = coreFrame->view()) + view->setZoomFactor(multiplier, ZoomTextOnly); } HRESULT WebFrame::inViewSourceMode(BOOL* flag) @@ -1140,7 +1142,7 @@ HRESULT WebFrame::elementWithName(BSTR name, IDOMElement* form, IDOMElement** el HTMLFormElement *formElement = formElementFromDOMElement(form); if (formElement) { - Vector<HTMLFormControlElement*>& elements = formElement->formElements; + const Vector<HTMLFormControlElement*>& elements = formElement->associatedElements(); AtomicString targetName((UChar*)name, SysStringLen(name)); for (unsigned int i = 0; i < elements.size(); i++) { HTMLFormControlElement *elt = elements[i]; @@ -1338,7 +1340,7 @@ HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int* return E_FAIL; int inCount = *cControls; - int count = (int) formElement->formElements.size(); + int count = (int) formElement->associatedElements().size(); *cControls = count; if (!controls) return S_OK; @@ -1346,7 +1348,7 @@ HRESULT WebFrame::controlsInForm(IDOMElement* form, IDOMElement** controls, int* return E_FAIL; *cControls = 0; - Vector<HTMLFormControlElement*>& elements = formElement->formElements; + const Vector<HTMLFormControlElement*>& elements = formElement->associatedElements(); for (int i = 0; i < count; i++) { if (elements.at(i)->isEnumeratable()) { // Skip option elements, other duds controls[*cControls] = DOMElement::createInstance(elements.at(i)); diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 20f0f06..525108f 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -105,8 +105,8 @@ #include <WebCore/PlatformKeyboardEvent.h> #include <WebCore/PlatformMouseEvent.h> #include <WebCore/PlatformWheelEvent.h> +#include <WebCore/PluginData.h> #include <WebCore/PluginDatabase.h> -#include <WebCore/PluginInfoStore.h> #include <WebCore/PluginView.h> #include <WebCore/PopupMenu.h> #include <WebCore/ProgressTracker.h> @@ -330,7 +330,7 @@ WebView::WebView() , m_didClose(false) , m_inIMEComposition(0) , m_toolTipHwnd(0) - , m_closeWindowTimer(this, &WebView::closeWindowTimerFired) + , m_closeWindowTimer(0) , m_topLevelParent(0) , m_deleteBackingStoreTimerActive(false) , m_transparent(false) @@ -1079,13 +1079,67 @@ void WebView::frameRect(RECT* rect) ::GetWindowRect(m_viewWindow, rect); } +class WindowCloseTimer : public WebCore::SuspendableTimer { +public: + static WindowCloseTimer* create(WebView*); + +private: + WindowCloseTimer(ScriptExecutionContext*, WebView*); + virtual void contextDestroyed(); + virtual void fired(); + + WebView* m_webView; +}; + +WindowCloseTimer* WindowCloseTimer::create(WebView* webView) +{ + ASSERT_ARG(webView, webView); + Frame* frame = core(webView->topLevelFrame()); + ASSERT(frame); + if (!frame) + return 0; + + Document* document = frame->document(); + ASSERT(document); + if (!document) + return 0; + + return new WindowCloseTimer(document, webView); +} + +WindowCloseTimer::WindowCloseTimer(ScriptExecutionContext* context, WebView* webView) + : SuspendableTimer(context) + , m_webView(webView) +{ + ASSERT_ARG(context, context); + ASSERT_ARG(webView, webView); +} + +void WindowCloseTimer::contextDestroyed() +{ + SuspendableTimer::contextDestroyed(); + delete this; +} + +void WindowCloseTimer::fired() +{ + m_webView->closeWindowTimerFired(); +} + void WebView::closeWindowSoon() { - m_closeWindowTimer.startOneShot(0); + if (m_closeWindowTimer) + return; + + m_closeWindowTimer = WindowCloseTimer::create(this); + if (!m_closeWindowTimer) + return; + m_closeWindowTimer->startOneShot(0); + AddRef(); } -void WebView::closeWindowTimerFired(WebCore::Timer<WebView>*) +void WebView::closeWindowTimerFired() { closeWindow(); Release(); @@ -2425,7 +2479,7 @@ HRESULT STDMETHODCALLTYPE WebView::canShowMIMEType( *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr) || MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr) || - PluginInfoStore::supportsMIMEType(mimeTypeStr) || + (m_page && m_page->pluginData()->supportsMimeType(mimeTypeStr)) || shouldUseEmbeddedView(mimeTypeStr); return S_OK; @@ -2546,7 +2600,7 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( InitializeLoggingChannelsIfNecessary(); #if ENABLE(DATABASE) - WebKitSetWebDatabasesPathIfNecessary(); + WebKitInitializeWebDatabasesIfNecessary(); #endif WebKitSetApplicationCachePathIfNecessary(); @@ -2912,8 +2966,10 @@ void WebView::setZoomMultiplier(float multiplier, bool isTextOnly) { m_zoomMultiplier = multiplier; m_page->settings()->setZoomMode(isTextOnly ? ZoomTextOnly : ZoomPage); - if (Frame* coreFrame = core(m_mainFrame)) - coreFrame->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage); + if (Frame* coreFrame = core(m_mainFrame)) { + if (FrameView* view = coreFrame->view()) + view->setZoomFactor(multiplier, isTextOnly ? ZoomTextOnly : ZoomPage); + } } HRESULT STDMETHODCALLTYPE WebView::textSizeMultiplier( @@ -4735,7 +4791,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) settings->setWebGLEnabled(true); #endif // ENABLE(3D_CANVAS) - if (!m_closeWindowTimer.isActive()) + if (!m_closeWindowTimer) m_mainFrame->invalidate(); // FIXME hr = updateSharedSettingsFromPreferencesIfNeeded(preferences.get()); diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index 752c16d..d44e6c6 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -33,7 +33,7 @@ #include <WebCore/DragActions.h> #include <WebCore/IntRect.h> #include <WebCore/RefCountedGDIHandle.h> -#include <WebCore/Timer.h> +#include <WebCore/SuspendableTimer.h> #include <WebCore/WindowMessageListener.h> #include <WebCore/WKCACFLayer.h> #include <WebCore/WKCACFLayerRenderer.h> @@ -832,6 +832,7 @@ public: void frameRect(RECT* rect); void closeWindow(); void closeWindowSoon(); + void closeWindowTimerFired(); bool didClose() const { return m_didClose; } bool transparent() const { return m_transparent; } @@ -885,6 +886,7 @@ public: void cancelDeleteBackingStoreSoon(); HWND topLevelParent() const { return m_topLevelParent; } + HWND viewWindow() const { return m_viewWindow; } void updateActiveState(); @@ -939,7 +941,6 @@ protected: void preflightSpellChecker(); bool continuousCheckingAllowed(); void initializeToolTipWindow(); - void closeWindowTimerFired(WebCore::Timer<WebView>*); void prepareCandidateWindow(WebCore::Frame*, HIMC); void updateSelectionForIME(); LRESULT onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*); @@ -1011,7 +1012,7 @@ protected: static bool s_allowSiteSpecificHacks; - WebCore::Timer<WebView> m_closeWindowTimer; + WebCore::SuspendableTimer* m_closeWindowTimer; OwnPtr<TRACKMOUSEEVENT> m_mouseOutTracker; HWND m_topLevelParent; diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog index 51da133..ab25102 100644 --- a/WebKit/wx/ChangeLog +++ b/WebKit/wx/ChangeLog @@ -1,3 +1,32 @@ +2010-05-27 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Build fixes for Windows after recent changes. + + * WebView.cpp: + (wxWebView::Create): + * wscript: + +2010-05-26 Kevin Ollivier <kevino@theolliviers.com> + + Build fix after new client added to Page constructor. + + * WebView.cpp: + (wxWebView::Create): + +2010-05-24 Darin Adler <darin@apple.com> + + Reviewed by Eric Seidel. + + Move view-related functions from Frame to FrameView + https://bugs.webkit.org/show_bug.cgi?id=39366 + + * WebFrame.cpp: + (wxWebFrame::CanIncreaseTextSize): Check FrameView is not null. + (wxWebFrame::IncreaseTextSize): Call function on FrameView. + (wxWebFrame::CanDecreaseTextSize): Ditto. + (wxWebFrame::DecreaseTextSize): Ditto. + (wxWebFrame::ResetTextSize): Ditto. + 2010-05-11 Kevin Watters <kevinwatters@gmail.com> Reviewed by Kevin Ollivier. diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp index 2515de4..cb66a72 100644 --- a/WebKit/wx/WebFrame.cpp +++ b/WebKit/wx/WebFrame.cpp @@ -305,7 +305,7 @@ bool wxWebFrame::CanRedo() bool wxWebFrame::CanIncreaseTextSize() const { - if (m_impl->frame) { + if (m_impl->frame && m_impl->frame->view()) { if (m_textMagnifier*TextSizeMultiplierRatio <= MaximumTextSizeMultiplier) return true; } @@ -316,13 +316,13 @@ void wxWebFrame::IncreaseTextSize() { if (CanIncreaseTextSize()) { m_textMagnifier = m_textMagnifier*TextSizeMultiplierRatio; - m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); + m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); } } bool wxWebFrame::CanDecreaseTextSize() const { - if (m_impl->frame) { + if (m_impl->frame && m_impl->frame->view()) { if (m_textMagnifier/TextSizeMultiplierRatio >= MinimumTextSizeMultiplier) return true; } @@ -333,15 +333,15 @@ void wxWebFrame::DecreaseTextSize() { if (CanDecreaseTextSize()) { m_textMagnifier = m_textMagnifier/TextSizeMultiplierRatio; - m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); + m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); } } void wxWebFrame::ResetTextSize() { m_textMagnifier = 1.0; - if (m_impl->frame) - m_impl->frame->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); + if (m_impl->frame && m_impl->frame->view()) + m_impl->frame->view()->setZoomFactor(m_textMagnifier, WebCore::ZoomTextOnly); } void wxWebFrame::MakeEditable(bool enable) diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp index 2c5087c..d9a22cb 100644 --- a/WebKit/wx/WebView.cpp +++ b/WebKit/wx/WebView.cpp @@ -56,6 +56,9 @@ #include "Settings.h" #include "SubstituteData.h" #include "Threading.h" +#if __WXMSW__ +#include "WebCoreInstanceHandle.h" +#endif #include "ChromeClientWx.h" #include "ContextMenuClientWx.h" @@ -319,7 +322,7 @@ bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position, // due to a problem with exceptions getting eaten when using the callback // approach to timers (which wx itself uses). #if __WXMSW__ - WebCore::Page::setInstanceHandle(wxGetInstance()); + WebCore::setInstanceHandle(wxGetInstance()); #endif // this helps reduce flicker on platforms like MSW @@ -331,7 +334,11 @@ bool wxWebView::Create(wxWindow* parent, int id, const wxPoint& position, WebCore::HTMLFrameOwnerElement* parentFrame = 0; WebCore::EditorClientWx* editorClient = new WebCore::EditorClientWx(); - m_impl->page = new WebCore::Page(new WebCore::ChromeClientWx(this), new WebCore::ContextMenuClientWx(), editorClient, new WebCore::DragClientWx(), new WebCore::InspectorClientWx(), 0, 0); + m_impl->page = new WebCore::Page(new WebCore::ChromeClientWx(this), + new WebCore::ContextMenuClientWx(), + editorClient, + new WebCore::DragClientWx(), + new WebCore::InspectorClientWx(), 0, 0, 0); editorClient->setPage(m_impl->page); m_mainFrame = new wxWebFrame(this); diff --git a/WebKit/wx/wscript b/WebKit/wx/wscript index 61fa903..fe934f1 100644 --- a/WebKit/wx/wscript +++ b/WebKit/wx/wscript @@ -40,6 +40,9 @@ include_paths = webkit_dirs + common_includes + ['.', '..', os.path.join(wk_root, 'WebCore', 'platform', 'graphics', 'wx'), ] +if sys.platform.startswith("win"): + include_paths.append(os.path.join(wk_root, 'WebCore','platform','win')) + windows_deps = [ 'lib/pthreadVC2.dll', 'bin/icuuc40.dll', 'bin/icudt40.dll', 'bin/icuin40.dll', |