diff options
Diffstat (limited to 'WebKit')
127 files changed, 3130 insertions, 1348 deletions
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index fc1195b..7ba39c3 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,55 @@ +2010-06-30 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Implement windowRect() and setWindowRect() in ChromeClientEfl.cpp + https://bugs.webkit.org/show_bug.cgi?id=40876 + + * efl/WebCoreSupport/ChromeClientEfl.cpp: Implements two methods + to change window size. + + (WebCore::ChromeClientEfl::windowRect): + (WebCore::ChromeClientEfl::setWindowRect): + +2010-06-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Unreviewed build fix. + + [EFL] Build fix for latest version of Ecore library. + Ecore recently changed return type of callbacks from int to Eina_Bool. + + * efl/EWebLauncher/main.c: + * efl/ewk/ewk_view.cpp: + (_ewk_view_zoom_animator_cb): Return Eina_Bool instead of int. + +2010-06-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Simplify zoom setting by narrowing with WebCore API. + Instead of creating a zoom_text_only field, use the already defined enum + by WebCore. + https://bugs.webkit.org/show_bug.cgi?id=40993 + + * efl/ewk/ewk_frame.cpp: sd->zoom_text_only => sd->zoom_mode + (ewk_frame_zoom_set): + (ewk_frame_zoom_text_only_get): + (ewk_frame_zoom_text_only_set): + +2010-06-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Implement download requests + When a download request arrives through FrameLoaderClient, forward it to + browser in order to be possible to download files. + https://bugs.webkit.org/show_bug.cgi?id=40967 + + * efl/WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::download): get file names and + forward to ewk_view_download_request() + * efl/ewk/ewk_private.h: export private function to WebCoreSupport + 2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi> Reviewed by Kenneth Rohde Christiansen. diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 2a56d9d..29cf8f4 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,553 @@ +2010-07-05 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [v8] Web Inspector: remove v8-specific code dealing with getOwnPropertyNames from InjectedScript.js + https://bugs.webkit.org/show_bug.cgi?id=41595 + + * src/js/DebuggerScript.js: + +2010-07-03 Erik Arvidsson <arv@chromium.org> + + Reviewed by Ojan Vafai. + + Fix issue where a contextmenu event was reporting the wrong target + if the context menu was shown due to pressing the context menu key + (or Shift+F10). + + https://bugs.webkit.org/show_bug.cgi?id=38129 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::sendContextMenuEvent): + +2010-07-02 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [v8] Web Inspector: inspected page crashes on attempt to change iframe's src attribute + https://bugs.webkit.org/show_bug.cgi?id=41511 + + * src/WebBindings.cpp: + (WebKit::getEvent): + +2010-07-01 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r62349. + http://trac.webkit.org/changeset/62349 + https://bugs.webkit.org/show_bug.cgi?id=41499 + + It broke the chromium Linux build. (Requested by dave_levin on + #webkit). + + * public/WebNode.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::registerPasswordListener): + (WebKit::WebFrameImpl::notifiyPasswordListenerOfAutocomplete): + +2010-07-01 David Holloway <dhollowa@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Exposes WebNode::unwrap() and WebNode::constUnwrap() for + use by other code in WebKit/chromium/src. + + Specific use of these methods is made in WebFrameImpl.cpp. This is + preferred to the cast operator call that was happening prior to this + change. + + https://bugs.webkit.org/show_bug.cgi?id=41477 + + * public/WebNode.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::registerPasswordListener): + (WebKit::WebFrameImpl::notifiyPasswordListenerOfAutocomplete): + +2010-07-01 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Stop linking against opengl32.lib in Windows Chromium port + https://bugs.webkit.org/show_bug.cgi?id=41424 + + * WebKit.gyp: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl): + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::makeContextCurrent): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-07-01 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r62246. + http://trac.webkit.org/changeset/62246 + https://bugs.webkit.org/show_bug.cgi?id=41470 + + "Worker tests are broken in Chromium" (Requested by yurys on + #webkit). + + * src/WebBindings.cpp: + (WebKit::getEvent): + +2010-07-01 David Holloway <dhollowa@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Consolidates AutoFill and Autocomplete popup menus into a single popup menu. + + This change combines SuggestionsPopupMenuClient, AutoFillPopupMenuClient, and + AutocompletePopupMenuClient classes into a single consolidated AutoFillPopupMenuClient class. + Prior to this change the contents of the AutoFill popup menu only included AutoFill + suggestions and similarly the Autocomplete popup menu only included Autocomplete + suggestions. With this consolidation, both AutoFill and Autocomplete suggestions can + now be displayed in a single menu. + + https://bugs.webkit.org/show_bug.cgi?id=41236 + + * WebKit.gyp: + * public/WebFrame.h: + * public/WebView.h: + * src/AutoFillPopupMenuClient.cpp: + (WebKit::AutoFillPopupMenuClient::AutoFillPopupMenuClient): + (WebKit::AutoFillPopupMenuClient::~AutoFillPopupMenuClient): + (WebKit::AutoFillPopupMenuClient::valueChanged): + (WebKit::AutoFillPopupMenuClient::selectionCleared): + (WebKit::AutoFillPopupMenuClient::itemText): + (WebKit::AutoFillPopupMenuClient::itemStyle): + (WebKit::AutoFillPopupMenuClient::menuStyle): + (WebKit::AutoFillPopupMenuClient::clientPaddingLeft): + (WebKit::AutoFillPopupMenuClient::clientPaddingRight): + (WebKit::AutoFillPopupMenuClient::popupDidHide): + (WebKit::AutoFillPopupMenuClient::setTextFromItem): + (WebKit::AutoFillPopupMenuClient::fontSelector): + (WebKit::AutoFillPopupMenuClient::hostWindow): + (WebKit::AutoFillPopupMenuClient::createScrollbar): + (WebKit::AutoFillPopupMenuClient::initialize): + (WebKit::AutoFillPopupMenuClient::getWebView): + (WebKit::AutoFillPopupMenuClient::textFieldStyle): + * src/AutoFillPopupMenuClient.h: + (WebKit::AutoFillPopupMenuClient::itemToolTip): + (WebKit::AutoFillPopupMenuClient::itemAccessibilityText): + (WebKit::AutoFillPopupMenuClient::itemIsEnabled): + (WebKit::AutoFillPopupMenuClient::clientInsetLeft): + (WebKit::AutoFillPopupMenuClient::clientInsetRight): + (WebKit::AutoFillPopupMenuClient::listSize): + (WebKit::AutoFillPopupMenuClient::selectedIndex): + (WebKit::AutoFillPopupMenuClient::itemIsLabel): + (WebKit::AutoFillPopupMenuClient::itemIsSelected): + (WebKit::AutoFillPopupMenuClient::shouldPopOver): + (WebKit::AutoFillPopupMenuClient::valueShouldChangeOnHotTrack): + (WebKit::AutoFillPopupMenuClient::setAutocompleteMode): + (WebKit::AutoFillPopupMenuClient::getTextField): + (WebKit::AutoFillPopupMenuClient::getSelectedIndex): + (WebKit::AutoFillPopupMenuClient::setSelectedIndex): + * src/AutocompletePopupMenuClient.cpp: Removed. + * src/AutocompletePopupMenuClient.h: Removed. + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::textFieldDidEndEditing): + (WebKit::EditorClientImpl::doAutofill): + (WebKit::EditorClientImpl::onAutocompleteSuggestionAccepted): + * src/SuggestionsPopupMenuClient.cpp: Removed. + * src/SuggestionsPopupMenuClient.h: Removed. + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::currentHistoryItem): + (WebKit::WebFrameImpl::notifiyPasswordListenerOfAutocomplete): + * src/WebFrameImpl.h: + * src/WebViewImpl.cpp: + (WebKit::): + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::mouseDown): + (WebKit::WebViewImpl::mouseUp): + (WebKit::WebViewImpl::selectPopupHandleKeyEvent): + (WebKit::WebViewImpl::autocompleteHandleKeyEvent): + (WebKit::WebViewImpl::hideAutoFillPopup): + (WebKit::WebViewImpl::setFocus): + (WebKit::WebViewImpl::applyAutoFillSuggestions): + (WebKit::WebViewImpl::applyAutocompleteSuggestions): + (WebKit::WebViewImpl::hidePopups): + (WebKit::WebViewImpl::refreshAutoFillPopup): + * src/WebViewImpl.h: + (WebKit::WebViewImpl::autoFillPopupDidHide): + +2010-07-01 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Adam Barth. + + [v8] Web Inspector: inspected page crashes on attempt to change iframe's src attribute + https://bugs.webkit.org/show_bug.cgi?id=41350 + + * src/WebBindings.cpp: + (WebKit::getEvent): + +2010-07-01 Aaron Boodman <aa@chromium.org> + + Reviewed by Darin Fisher. + + Make the user script API static. This makes it more convenient to use + if you don't have a WebView instance yet. + + Added static versions of the three methods and re-route current ones + temporarily through the static versions. Will remove the non-static + versions once Chromium has been updated. + + Also, expose the URLPattern configuration for user stylesheets, since + they were not before. + + https://bugs.webkit.org/show_bug.cgi?id=41385 + + * public/WebView.h: + (WebKit::WebView::addUserScript): + (WebKit::WebView::addUserStyleSheet): + * src/WebViewImpl.cpp: + (WebKit::WebView::addUserScript): + (WebKit::WebView::addUserStyleSheet): + (WebKit::WebView::removeAllUserContent): + +2010-06-30 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + Roll forward Chromium DEPS to r51287 + https://bugs.webkit.org/show_bug.cgi?id=41430 + + * DEPS: + +2010-06-25 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chrome DevTools: Finalize migration to new WebView constructor + (devtools agent is now created within WebViewImpl only). + + https://bugs.webkit.org/show_bug.cgi?id=41212 + + * public/WebDevToolsAgent.h: + * public/WebView.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::initializeLoader): + * tests/PopupMenuTest.cpp: + (WebKit::SelectPopupMenuTest::SetUp): + +2010-06-29 Zhenyao Mo <zmo@google.com> + + Reviewed by Dimitri Glazkov. + + Implement getAttachedShaders + https://bugs.webkit.org/show_bug.cgi?id=31172 + + * public/WebGraphicsContext3D.h: Declaration of getAttachedShaders(). + * src/GraphicsContext3D.cpp: Implementation of getAttachedShaders(). + * src/WebGraphicsContext3DDefaultImpl.cpp: Ditto. + * src/WebGraphicsContext3DDefaultImpl.h: Declaration of getAttachedShaders(). + +2010-06-29 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Darin Fisher. + + Simplify the WebDatabase interface. + https://bugs.webkit.org/show_bug.cgi?id=40607 + + Do not ref()/deref() the private AbstractDatabase member. This + allows us to use WebDatabase in the destructors of the DB + classes. + + * public/WebDatabase.h: + (WebKit::WebDatabase::WebDatabase): + * src/WebDatabase.cpp: + (WebKit::WebDatabase::name): + (WebKit::WebDatabase::displayName): + (WebKit::WebDatabase::estimatedSize): + (WebKit::WebDatabase::securityOrigin): + (WebKit::WebDatabase::WebDatabase): + +2010-06-29 Zhe Su <suzhe@chromium.org> + + Reviewed by Darin Fisher. + + A crash caused by the patch of bug 40608. + https://bugs.webkit.org/show_bug.cgi?id=41334 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::caretOrSelectionBounds): + +2010-06-29 Victor Wang <victorw@chromium.org> + + Reviewed by Darin Fisher. + + [chromium]: Update webkit for chromium multi dll build. + + 1. Export more webkit APIs for chromium multi dll build. + 2. Update DumpRenderTree sources so it can build with webkit.dll + 3. Temp disable webkit unit tests for chromium multi dll build. + + https://bugs.webkit.org/show_bug.cgi?id=41231 + + * WebKit.gyp: + * public/WebAccessibilityCache.h: + * public/WebAccessibilityObject.h: + * public/WebEventListener.h: + * public/WebGeolocationServiceMock.h: + * public/WebGraphicsContext3D.h: + * public/WebIDBDatabaseError.h: + (WebKit::WebIDBDatabaseError::WebIDBDatabaseError): + (WebKit::WebIDBDatabaseError::operator=): + * public/WebNotification.h: + * public/WebPasswordFormData.h: + * public/WebSearchableFormData.h: + * public/WebStorageEventDispatcher.h: + * public/WebString.h: + (WebKit::WebString::WebString): + (WebKit::WebString::operator=): + +2010-06-29 Vangelis Kokkevis <vangelis@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Hooking up GraphicsContext3D to the gpu compositor. + GraphicsContext3DInternal is now initialized with a pointer to the HostWindow + that corresponds to the WebView containing the context. The initializer + forces a WebGLES2Context to be created for the WebView (if one doesn't already + exist) and uses the view's GL context as a parent to the GL context created + for WebGL. This allows the compositor to read the texture associated with + WebGL's frame buffer. We also plumb though GraphicsContext3D's prepareTexture + and platformLayer methods which are required by the compositor code. + https://bugs.webkit.org/show_bug.cgi?id=41243 + + * public/WebGraphicsContext3D.h: + * public/WebView.h: + Made gles2Context() a virtual method on WebView instead of WebViewImpl + to allow access to it from GraphicsContext3DInternal::initialize(). + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::initialize): + (WebCore::GraphicsContext3DInternal::platformGraphicsContext3D): + (WebCore::GraphicsContext3DInternal::platformTexture): + (WebCore::GraphicsContext3DInternal::prepareTexture): + (WebCore::GraphicsContext3DInternal::platformLayer): + (WebCore::GraphicsContext3D::create): + (WebCore::GraphicsContext3D::prepareTexture): + (WebCore::GraphicsContext3D::platformLayer): + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::getPlatformTextureId): + (WebKit::WebGraphicsContext3DDefaultImpl::prepareTexture): + * src/WebGraphicsContext3DDefaultImpl.h: + * src/WebViewImpl.h: + +2010-06-29 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: return line number where breakpoint was actually set by v8 from setBreakpoint function. + https://bugs.webkit.org/show_bug.cgi?id=40781 + + * src/js/DebuggerScript.js: + (): + +2010-06-23 John Gregg <johnnyg@google.com> + + Reviewed by Kent Tamura. + + add ENABLE_DIRECTORY_UPLOAD build support + https://bugs.webkit.org/show_bug.cgi?id=41100 + + * features.gypi: + +2010-06-28 Zhe Su <suzhe@chromium.org> + + Reviewed by Jian Li. + + [chromium]Remove deprecated code related to input method. + https://bugs.webkit.org/show_bug.cgi?id=41244 + + Also update TestWebWidget in tests/PopupMenuTest.cpp to add missing implementations. + + * WebKit.gyp: + * public/WebCompositionCommand.h: Removed. + * public/WebViewClient.h: + * public/WebWidget.h: + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::setInputMethodState): + * src/WebPopupMenuImpl.cpp: + * src/WebPopupMenuImpl.h: + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + * tests/PopupMenuTest.cpp: + (WebKit::TestWebWidget::setComposition): + (WebKit::TestWebWidget::confirmComposition): + (WebKit::TestWebWidget::textInputType): + (WebKit::TestWebWidget::caretOrSelectionBounds): + +2010-06-27 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Get the selected text from plugins for right click menu + https://bugs.webkit.org/show_bug.cgi?id=41242 + + * public/WebContextMenuData.h: + (WebKit::WebContextMenuData::): + * public/WebPlugin.h: + (WebKit::WebPlugin::selectedText): + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::selectedText): + * src/WebPluginContainerImpl.h: + +2010-06-28 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix Chromium debugger tests. + + * src/js/Tests.js: + (.TestSuite.prototype.testDebugIntrinsicProperties): + +2010-06-25 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Improve default value handling for page format properties. + https://bugs.webkit.org/show_bug.cgi?id=41150 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::pageSizeAndMarginsInPixels): + * src/WebFrameImpl.h: + +2010-06-26 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r61943. + http://trac.webkit.org/changeset/61943 + https://bugs.webkit.org/show_bug.cgi?id=41251 + + Totally breaks webkit_unit_tests on Chromium linux and mac + (Requested by mnaganov on #webkit). + + * WebKit.gyp: + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Removed. + * tests/data/iframes_test.html: Removed. + * tests/data/invisible_iframe.html: Removed. + * tests/data/visible_iframe.html: Removed. + * tests/data/zero_sized_iframe.html: Removed. + +2010-06-26 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Dimitri Glazkov. + + Disable Web Timing support by default for chromium port. + https://bugs.webkit.org/show_bug.cgi?id=38924 + + * features.gypi: + +2010-06-25 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Made WebFrame not report the text from hidden frames. + (some pages contain hidden frames with garbage text that + should not be indexed or used to detect the page's language). + https://bugs.webkit.org/show_bug.cgi?id=39456 + + * DEPS: + * WebKit.gyp: + * src/WebFrameImpl.cpp: + (WebKit::frameContentAsPlainText): + * tests/RunAllTests.cpp: + (main): + * tests/WebFrameTest.cpp: Added. + * tests/data: Added. + * tests/data/iframes_test.html: Added. + * tests/data/invisible_iframe.html: Added. + * tests/data/visible_iframe.html: Added. + * tests/data/zero_sized_iframe.html: Added. + +2010-06-25 Bernhard Bauer <bauerb@chromium.org> + + Reviewed by Darin Fisher. + + Add plugin accessors to WebPluginContainer. + https://bugs.webkit.org/show_bug.cgi?id=41145 + + * public/WebPluginContainer.h: + * src/WebPluginContainerImpl.h: + (WebKit::WebPluginContainerImpl::setPlugin): + +2010-06-25 Sterling Swigart <sswigart@google.com> + + Reviewed by David Levin. + + Resetting ENABLE_IMAGE_RESIZER to 0. Image.webkitGetImage needs to be developed under + a 0 value, at least until both the JSC and V8 bindings are in place. + https://bugs.webkit.org/show_bug.cgi?id=41116 + + * features.gypi: ENABLE_IMAGE_RESIZER=0 + +2010-06-25 Victor Wang <victorw@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Update chromium webkit gyp so it has + option to be built as DLL. + + Chromium webkit is built as webkit.dll on windows + if it is inside chromium build and variable component + is set to shared_library. + + https://bugs.webkit.org/show_bug.cgi?id=41161 + + * WebKit.gyp: + +2010-06-25 John Abd-El-Malek <jam@chromium.org> + + Reviewed by David Levin. + + [chromium] Send unhandled events to Node's default handler + https://bugs.webkit.org/show_bug.cgi?id=41223 + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleEvent): + +2010-06-25 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add new stubs for querying platform drag-and-drop and copy-and-paste data. + + This change adds new stubs for querying for data in a clipboard or drag operation. This is + so adding support for more data types in clipboard/drag operations doesn't become + increasingly expensive, since we currently copy all the drag data we need every time a new + web drop target is entered. It also adds a new mechanism to write back to the system + clipboard that isn't tied to one data type. + + https://bugs.webkit.org/show_bug.cgi?id=40540 + + * public/WebClipboard.h: + (WebKit::WebClipboard::): + (WebKit::WebClipboard::isFormatAvailable): + (WebKit::WebClipboard::readPlainText): + (WebKit::WebClipboard::readHTML): + (WebKit::WebClipboard::writePlainText): + (WebKit::WebClipboard::writeHTML): + (WebKit::WebClipboard::writeURL): + (WebKit::WebClipboard::writeImage): + (WebKit::WebClipboard::writeData): + (WebKit::WebClipboard::readAvailableTypes): + (WebKit::WebClipboard::readData): + (WebKit::WebClipboard::readFilenames): + * public/WebKitClient.h: + * src/AssertMatchingEnums.cpp: + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::clipboardWriteData): + (WebCore::ChromiumBridge::clipboardReadAvailableTypes): + (WebCore::ChromiumBridge::clipboardReadData): + (WebCore::ChromiumBridge::clipboardReadFilenames): + 2010-06-25 Lei Zheng <lzheng@chromium.org> Reviewed by Dimitri Glazkov. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index b6b35a5..fe3754f 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '50676', + 'chromium_rev': '51287', } deps = { diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index a53dd28..e2da1b4 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -52,7 +52,6 @@ 'targets': [ { 'target_name': 'webkit', - 'type': '<(webkit_target_type)', 'msvs_guid': '5ECEC9E5-8F23-47B6-93E0-C3B328B3BE65', 'dependencies': [ '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', @@ -93,7 +92,6 @@ 'public/WebColorName.h', 'public/WebCommon.h', 'public/WebCommonWorkerClient.h', - 'public/WebCompositionCommand.h', 'public/WebCompositionUnderline.h', 'public/WebConsoleMessage.h', 'public/WebContextMenuData.h', @@ -231,8 +229,6 @@ 'src/ApplicationCacheHost.cpp', 'src/ApplicationCacheHostInternal.h', 'src/AssertMatchingEnums.cpp', - 'src/AutocompletePopupMenuClient.cpp', - 'src/AutocompletePopupMenuClient.h', 'src/AutoFillPopupMenuClient.cpp', 'src/AutoFillPopupMenuClient.h', 'src/BackForwardListClientImpl.cpp', @@ -312,8 +308,6 @@ 'src/StorageEventDispatcherImpl.h', 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', - 'src/SuggestionsPopupMenuClient.cpp', - 'src/SuggestionsPopupMenuClient.h', 'src/TemporaryGlue.h', 'src/ToolsAgent.h', 'src/WebAccessibilityCache.cpp', @@ -447,6 +441,34 @@ 'src/win/WebScreenInfoFactory.cpp', ], 'conditions': [ + ['inside_chromium_build==1 and OS=="win"', { + 'type': '<(component)', + + 'conditions': [ + ['component=="shared_library"', { + 'defines': [ + 'WEBKIT_DLL', + 'USING_V8_SHARED', + ], + 'dependencies': [ + '../../WebCore/WebCore.gyp/WebCore.gyp:webcore_bindings', + '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', + '<(chromium_src_dir)/third_party/icu/icu.gyp:*', + '<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg', + '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng', + '<(chromium_src_dir)/third_party/libxml/libxml.gyp:libxml', + '<(chromium_src_dir)/third_party/libxslt/libxslt.gyp:libxslt', + '<(chromium_src_dir)/third_party/modp_b64/modp_b64.gyp:modp_b64', + '<(chromium_src_dir)/third_party/nss/nss.gyp:*', + '<(chromium_src_dir)/third_party/ots/ots.gyp:ots', + '<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib', + '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + ], + }], + ], + }, { + 'type': '<(webkit_target_type)' + }], ['OS=="linux" or OS=="freebsd"', { 'dependencies': [ '<(chromium_src_dir)/build/linux/system.gyp:fontconfig', @@ -504,13 +526,6 @@ 'GLEW_NO_GLU=1', ], 'conditions': [ - ['OS=="win"', { - 'link_settings': { - 'libraries': [ - '-lopengl32.lib', - ], - }, - }], ['OS=="mac"', { 'link_settings': { 'libraries': [ @@ -524,39 +539,46 @@ }, { 'target_name': 'webkit_unit_tests', - 'type': 'executable', - 'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD', - 'dependencies': [ - 'webkit', - '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', - '<(chromium_src_dir)/testing/gtest.gyp:gtest', - '<(chromium_src_dir)/base/base.gyp:base', - '<(chromium_src_dir)/base/base.gyp:base_i18n', - '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', - ], - 'include_dirs': [ - 'public', - 'src', - ], - 'sources': [ - 'tests/DragImageTest.cpp', - 'tests/KeyboardTest.cpp', - 'tests/KURLTest.cpp', - 'tests/RunAllTests.cpp', - ], 'conditions': [ - ['OS=="win"', { - 'sources': [ - # FIXME: Port PopupMenuTest to Linux and Mac. - 'tests/PopupMenuTest.cpp', - 'tests/TransparencyWinTest.cpp', - 'tests/UniscribeHelperTest.cpp', + # FIXME: make webkit unit tests working for multi dll build. + ['inside_chromium_build==1 and OS=="win" and component=="shared_library"', { + 'type': 'none', + }, { + 'type': 'executable', + 'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD', + 'dependencies': [ + 'webkit', + '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', + '<(chromium_src_dir)/testing/gtest.gyp:gtest', + '<(chromium_src_dir)/base/base.gyp:base', + '<(chromium_src_dir)/base/base.gyp:base_i18n', + '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib', ], - }], - ['OS=="mac"', { - 'sources!': [ - # FIXME: Port DragImageTest to Mac. + 'include_dirs': [ + 'public', + 'src', + ], + 'sources': [ 'tests/DragImageTest.cpp', + 'tests/KeyboardTest.cpp', + 'tests/KURLTest.cpp', + 'tests/RunAllTests.cpp', + ], + 'conditions': [ + ['OS=="win"', { + 'sources': [ + # FIXME: Port PopupMenuTest to Linux and Mac. + 'tests/PopupMenuTest.cpp', + 'tests/TransparencyWinTest.cpp', + 'tests/UniscribeHelperTest.cpp', + ], + }], + ['OS=="mac"', { + 'sources!': [ + # FIXME: Port DragImageTest to Mac. + 'tests/DragImageTest.cpp', + ], + }], ], }], ], @@ -614,6 +636,20 @@ '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc', ], + 'conditions': [ + ['inside_chromium_build==1 and component=="shared_library"', { + 'sources': [ + 'src/ChromiumCurrentTime.cpp', + 'src/ChromiumThreading.cpp', + ], + 'include_dirs': [ + 'public', + ], + 'dependencies': [ + '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + ], + }], + ], 'copies': [{ 'destination': '<(PRODUCT_DIR)', 'files': ['<(ahem_path)'], diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 256192b..a280f4f 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -45,6 +45,7 @@ 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', + 'ENABLE_DIRECTORY_UPLOAD=1', 'ENABLE_DOM_STORAGE=1', 'ENABLE_EVENTSOURCE=1', 'ENABLE_FILE_READER=1', @@ -52,7 +53,7 @@ 'ENABLE_FILTERS=1', 'ENABLE_GEOLOCATION=1', 'ENABLE_ICONDATABASE=0', - 'ENABLE_IMAGE_RESIZER=1', + 'ENABLE_IMAGE_RESIZER=0', 'ENABLE_INDEXED_DATABASE=1', 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', @@ -75,6 +76,7 @@ 'ENABLE_TOUCH_EVENTS=1', 'ENABLE_VIDEO=1', 'ENABLE_WEB_SOCKETS=1', + 'ENABLE_WEB_TIMING=0', 'ENABLE_WORKERS=1', 'ENABLE_XHTMLMP=0', 'ENABLE_XPATH=1', diff --git a/WebKit/chromium/public/WebAccessibilityCache.h b/WebKit/chromium/public/WebAccessibilityCache.h index 94704a0..52e438c 100644 --- a/WebKit/chromium/public/WebAccessibilityCache.h +++ b/WebKit/chromium/public/WebAccessibilityCache.h @@ -43,8 +43,8 @@ public: WebAccessibilityCache() {} virtual ~WebAccessibilityCache() {} - static WebAccessibilityCache* create(); - static void enableAccessibility(); + WEBKIT_API static WebAccessibilityCache* create(); + WEBKIT_API static void enableAccessibility(); virtual void initialize(WebView* view) = 0; virtual bool isInitialized() const = 0; diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h index 191d40f..f1b2474 100644 --- a/WebKit/chromium/public/WebAccessibilityObject.h +++ b/WebKit/chromium/public/WebAccessibilityObject.h @@ -64,44 +64,44 @@ public: bool isNull() const { return !m_private; } - WebString accessibilityDescription() const; - WebString actionVerb() const; - bool canSetFocusAttribute() const; - bool canSetValueAttribute() const; - - unsigned childCount() const; - - WebAccessibilityObject childAt(unsigned) const; - WebAccessibilityObject firstChild() const; - WebAccessibilityObject focusedChild() const; - WebAccessibilityObject lastChild() const; - WebAccessibilityObject nextSibling() const; - WebAccessibilityObject parentObject() const; - WebAccessibilityObject previousSibling() const; - - bool isAnchor() const; - bool isChecked() const; - bool isFocused() const; - bool isEnabled() const; - bool isHovered() const; - bool isIndeterminate() const; - bool isMultiSelectable() const; - bool isOffScreen() const; - bool isPasswordField() const; - bool isPressed() const; - bool isReadOnly() const; - bool isVisited() const; - - WebRect boundingBoxRect() const; - WebString helpText() const; - int headingLevel() const; - WebAccessibilityObject hitTest(const WebPoint&) const; - WebString keyboardShortcut() const; - bool performDefaultAction() const; - WebAccessibilityRole roleValue() const; - void setFocused(bool) const; - WebString stringValue() const; - WebString title() const; + WEBKIT_API WebString accessibilityDescription() const; + WEBKIT_API WebString actionVerb() const; + WEBKIT_API bool canSetFocusAttribute() const; + WEBKIT_API bool canSetValueAttribute() const; + + WEBKIT_API unsigned childCount() const; + + WEBKIT_API WebAccessibilityObject childAt(unsigned) const; + WEBKIT_API WebAccessibilityObject firstChild() const; + WEBKIT_API WebAccessibilityObject focusedChild() const; + WEBKIT_API WebAccessibilityObject lastChild() const; + WEBKIT_API WebAccessibilityObject nextSibling() const; + WEBKIT_API WebAccessibilityObject parentObject() const; + WEBKIT_API WebAccessibilityObject previousSibling() const; + + WEBKIT_API bool isAnchor() const; + WEBKIT_API bool isChecked() const; + WEBKIT_API bool isFocused() const; + WEBKIT_API bool isEnabled() const; + WEBKIT_API bool isHovered() const; + WEBKIT_API bool isIndeterminate() const; + WEBKIT_API bool isMultiSelectable() const; + WEBKIT_API bool isOffScreen() const; + WEBKIT_API bool isPasswordField() const; + WEBKIT_API bool isPressed() const; + WEBKIT_API bool isReadOnly() const; + WEBKIT_API bool isVisited() const; + + WEBKIT_API WebRect boundingBoxRect() const; + WEBKIT_API WebString helpText() const; + WEBKIT_API int headingLevel() const; + WEBKIT_API WebAccessibilityObject hitTest(const WebPoint&) const; + WEBKIT_API WebString keyboardShortcut() const; + WEBKIT_API bool performDefaultAction() const; + WEBKIT_API WebAccessibilityRole roleValue() const; + WEBKIT_API void setFocused(bool) const; + WEBKIT_API WebString stringValue() const; + WEBKIT_API WebString title() const; #if WEBKIT_IMPLEMENTATION WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); diff --git a/WebKit/chromium/public/WebClipboard.h b/WebKit/chromium/public/WebClipboard.h index 68e22b5..6755d96 100644 --- a/WebKit/chromium/public/WebClipboard.h +++ b/WebKit/chromium/public/WebClipboard.h @@ -32,11 +32,13 @@ #define WebClipboard_h #include "WebCommon.h" +#include "WebString.h" +#include "WebVector.h" namespace WebKit { +class WebDragData; class WebImage; -class WebString; class WebURL; class WebClipboard { @@ -51,22 +53,35 @@ public: BufferStandard, // Used on platforms like the X Window System that treat selection // as a type of clipboard. - BufferSelection + BufferSelection, + // Read-only buffer corresponding to the current drag operation, if any. + BufferDrag, }; - virtual bool isFormatAvailable(Format, Buffer) = 0; + virtual bool isFormatAvailable(Format, Buffer) { return false; } - virtual WebString readPlainText(Buffer) = 0; - virtual WebString readHTML(Buffer, WebURL*) = 0; + virtual WebString readPlainText(Buffer) { return WebString(); } + virtual WebString readHTML(Buffer, WebURL*) { return WebString(); } - virtual void writePlainText(const WebString&) = 0; + virtual void writePlainText(const WebString&) { } virtual void writeHTML( const WebString& htmlText, const WebURL&, - const WebString& plainText, bool writeSmartPaste) = 0; + const WebString& plainText, bool writeSmartPaste) { } virtual void writeURL( - const WebURL&, const WebString& title) = 0; + const WebURL&, const WebString& title) { } virtual void writeImage( - const WebImage&, const WebURL&, const WebString& title) = 0; + const WebImage&, const WebURL&, const WebString& title) { } + virtual void writeData(const WebDragData&) { } + + // The following functions are used for reading platform data for copy and + // paste, drag and drop, and selection copy (on X). + virtual WebVector<WebString> readAvailableTypes( + Buffer, bool* containsFilenames) { return WebVector<WebString>(); } + // Returns true if the requested type was successfully read from the buffer. + virtual bool readData( + Buffer, const WebString& type, WebString* data, + WebString* metadata) { return false; } + virtual WebVector<WebString> readFilenames(Buffer) { return WebVector<WebString>(); } protected: ~WebClipboard() {} diff --git a/WebKit/chromium/public/WebCompositionCommand.h b/WebKit/chromium/public/WebCompositionCommand.h deleted file mode 100644 index bda1eb1..0000000 --- a/WebKit/chromium/public/WebCompositionCommand.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2009 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef WebCompositionCommand_h -#define WebCompositionCommand_h - -namespace WebKit { - -// DEPRECATED. -enum WebCompositionCommand { - WebCompositionCommandDiscard, - WebCompositionCommandSet, - WebCompositionCommandConfirm, -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/public/WebContextMenuData.h b/WebKit/chromium/public/WebContextMenuData.h index 8ed1f1b..e3aee4e 100644 --- a/WebKit/chromium/public/WebContextMenuData.h +++ b/WebKit/chromium/public/WebContextMenuData.h @@ -124,6 +124,7 @@ struct WebContextMenuData { CanPaste = 0x10, CanDelete = 0x20, CanSelectAll = 0x40, + CanTranslate = 0x80, }; // Which edit operations are available in the context. diff --git a/WebKit/chromium/public/WebDatabase.h b/WebKit/chromium/public/WebDatabase.h index 4679f68..0a5d4f8 100644 --- a/WebKit/chromium/public/WebDatabase.h +++ b/WebKit/chromium/public/WebDatabase.h @@ -34,33 +34,15 @@ #include "WebCommon.h" #include "WebSecurityOrigin.h" -#if WEBKIT_IMPLEMENTATION namespace WebCore { class AbstractDatabase; } -namespace WTF { template <typename T> class PassRefPtr; } -#endif namespace WebKit { class WebDatabaseObserver; -class WebDatabasePrivate; class WebString; class WebDatabase { public: - WebDatabase() : m_private(0) { } - WebDatabase(const WebDatabase& d) : m_private(0) { assign(d); } - ~WebDatabase() { reset(); } - - WebDatabase& operator=(const WebDatabase& d) - { - assign(d); - return *this; - } - - WEBKIT_API void reset(); - WEBKIT_API void assign(const WebDatabase&); - bool isNull() const { return !m_private; } - WEBKIT_API WebString name() const; WEBKIT_API WebString displayName() const; WEBKIT_API unsigned long estimatedSize() const; @@ -76,15 +58,12 @@ public: const WebString& originIdentifier, const WebString& databaseName); #if WEBKIT_IMPLEMENTATION - WebDatabase(const WTF::PassRefPtr<WebCore::AbstractDatabase>&); - WebDatabase& operator=(const WTF::PassRefPtr<WebCore::AbstractDatabase>&); - operator WTF::PassRefPtr<WebCore::AbstractDatabase>() const; + WebDatabase(const WebCore::AbstractDatabase*); #endif private: - void assign(WebDatabasePrivate*); - - WebDatabasePrivate* m_private; + WebDatabase() { } + const WebCore::AbstractDatabase* m_database; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h index d1ad23c..3bdee3c 100644 --- a/WebKit/chromium/public/WebDevToolsAgent.h +++ b/WebKit/chromium/public/WebDevToolsAgent.h @@ -47,8 +47,6 @@ struct WebURLError; class WebDevToolsAgent { public: - WEBKIT_API static WebDevToolsAgent* create(WebView*, WebDevToolsAgentClient*); - virtual ~WebDevToolsAgent() {} virtual void attach() = 0; diff --git a/WebKit/chromium/public/WebEventListener.h b/WebKit/chromium/public/WebEventListener.h index 52de1cd..62ca0de 100644 --- a/WebKit/chromium/public/WebEventListener.h +++ b/WebKit/chromium/public/WebEventListener.h @@ -31,6 +31,8 @@ #ifndef WebEventListener_h #define WebEventListener_h +#include "WebCommon.h" + #if WEBKIT_IMPLEMENTATION namespace WebCore { class Node; } #endif @@ -45,8 +47,8 @@ class WebString; class WebEventListener { public: - WebEventListener(); - virtual ~WebEventListener(); + WEBKIT_API WebEventListener(); + WEBKIT_API virtual ~WebEventListener(); // Called when an event is received. virtual void handleEvent(const WebEvent&) = 0; diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index 319ce38..c4fa7ae 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -408,12 +408,16 @@ public: // Returns true if page box (margin boxes and page borders) is visible. virtual bool isPageBoxVisible(int pageIndex) = 0; - // Returns the page area rectangle in pixels, assuming 96 pixels per inch. - virtual WebRect pageAreaRectInPixels(int pageIndex) = 0; - - // Returns the preferred page size in pixels, assuming 96 pixels per inch. - virtual WebSize preferredPageSizeInPixels(int pageIndex) = 0; - + // Returns the preferred page size and margins in pixels, assuming 96 + // pixels per inch. pageSize, marginTop, marginRight, marginBottom, + // marginLeft must be initialized to the default values that are used if + // auto is specified. + virtual void pageSizeAndMarginsInPixels(int pageIndex, + WebSize& pageSize, + int& marginTop, + int& marginRight, + int& marginBottom, + int& marginLeft) = 0; // Find-in-page -------------------------------------------------------- @@ -484,6 +488,11 @@ public: WebInputElement, WebPasswordAutocompleteListener*) = 0; + // Dispatches an Autocompletion notification to registered listener if one + // exists that is registered against the WebInputElement specified. + virtual void notifiyPasswordListenerOfAutocomplete( + const WebInputElement&) = 0; + // Utility ------------------------------------------------------------- diff --git a/WebKit/chromium/public/WebGeolocationServiceMock.h b/WebKit/chromium/public/WebGeolocationServiceMock.h index d1a146b..407fe9d 100644 --- a/WebKit/chromium/public/WebGeolocationServiceMock.h +++ b/WebKit/chromium/public/WebGeolocationServiceMock.h @@ -31,6 +31,7 @@ #ifndef WebGeolocationServiceMock_h #define WebGeolocationServiceMock_h +#include "WebCommon.h" #include "WebGeolocationService.h" namespace WebKit { @@ -39,10 +40,10 @@ 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); + WEBKIT_API static WebGeolocationServiceMock* createWebGeolocationServiceMock(); + WEBKIT_API static void setMockGeolocationPermission(bool allowed); + WEBKIT_API static void setMockGeolocationPosition(double latitude, double longitude, double accuracy); + WEBKIT_API static void setMockGeolocationError(int errorCode, const WebString& message); protected: static bool s_mockGeolocationPermission; diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index dc4f534..4378afb 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -40,6 +40,8 @@ namespace WebKit { // Typedef for server-side objects like OpenGL textures and program objects. typedef unsigned int WebGLId; +class WebView; + // This interface abstracts the operations performed by the // GraphicsContext3D in order to implement WebGL. Nearly all of the // methods exposed on this interface map directly to entry points in @@ -77,11 +79,11 @@ public: // Creates a "default" implementation of WebGraphicsContext3D which calls // OpenGL directly. - static WebGraphicsContext3D* createDefault(); + WEBKIT_API static WebGraphicsContext3D* createDefault(); // Initializes the graphics context; should be the first operation performed // on newly-constructed instances. Returns true on success. - virtual bool initialize(Attributes) = 0; + virtual bool initialize(Attributes, WebView*) = 0; // Makes the OpenGL context current on the current thread. Returns true on // success. @@ -108,6 +110,15 @@ public: // Returns true on success. virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize) = 0; + // Returns the id of the texture which is used for storing the contents of + // the framebuffer associated with this context. This texture is accessible + // by the gpu-based page compositor. + virtual unsigned getPlatformTextureId() = 0; + + // Copies the contents of the off-screen render target used by the WebGL + // context to the corresponding texture used by the compositor. + virtual void prepareTexture() = 0; + // Synthesizes an OpenGL error which will be returned from a // later call to getError. This is used to emulate OpenGL ES // 2.0 behavior on the desktop and to enforce additional error @@ -169,6 +180,8 @@ public: virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&) = 0; virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&) = 0; + virtual void getAttachedShaders(WebGLId program, int maxCount, int* count, unsigned int* shaders) = 0; + virtual int getAttribLocation(WebGLId program, const char* name) = 0; virtual void getBooleanv(unsigned long pname, unsigned char* value) = 0; diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h index f56a0d0..255d175 100644 --- a/WebKit/chromium/public/WebIDBDatabaseError.h +++ b/WebKit/chromium/public/WebIDBDatabaseError.h @@ -40,11 +40,11 @@ namespace WebKit { // See comment in WebIndexedDatabase for a high level overview these classes. class WebIDBDatabaseError { public: - ~WebIDBDatabaseError(); + WEBKIT_API ~WebIDBDatabaseError(); - WebIDBDatabaseError(unsigned short code, const WebString& message) { assign(code, message); } - WebIDBDatabaseError(const WebIDBDatabaseError& e) { assign(e); } - WebIDBDatabaseError& operator=(const WebIDBDatabaseError& e) + WEBKIT_API WebIDBDatabaseError(unsigned short code, const WebString& message) { assign(code, message); } + WEBKIT_API WebIDBDatabaseError(const WebIDBDatabaseError& e) { assign(e); } + WEBKIT_API WebIDBDatabaseError& operator=(const WebIDBDatabaseError& e) { assign(e); return *this; diff --git a/WebKit/chromium/public/WebKitClient.h b/WebKit/chromium/public/WebKitClient.h index d1da883..48765ac 100644 --- a/WebKit/chromium/public/WebKitClient.h +++ b/WebKit/chromium/public/WebKitClient.h @@ -83,7 +83,6 @@ public: // May return null. virtual WebCookieJar* cookieJar() { return 0; } - // DOM Storage -------------------------------------------------- // Return a LocalStorage namespace that corresponds to the following path. diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h index 787d4f3..f872111 100644 --- a/WebKit/chromium/public/WebNotification.h +++ b/WebKit/chromium/public/WebNotification.h @@ -64,7 +64,7 @@ public: // Operators required to put WebNotification in an ordered map. bool equals(const WebNotification& other) const { return m_private == other.m_private; } - bool lessThan(const WebNotification& other) const; + WEBKIT_API bool lessThan(const WebNotification& other) const; // Is the notification HTML vs. icon-title-text? WEBKIT_API bool isHTML() const; diff --git a/WebKit/chromium/public/WebPasswordFormData.h b/WebKit/chromium/public/WebPasswordFormData.h index e1804d1..30ce5ca 100644 --- a/WebKit/chromium/public/WebPasswordFormData.h +++ b/WebKit/chromium/public/WebPasswordFormData.h @@ -40,7 +40,7 @@ namespace WebKit { struct WebPasswordFormData { // If the provided form is suitable for password completion, isValid() will // return true; - WebPasswordFormData(const WebFormElement&); + WEBKIT_API WebPasswordFormData(const WebFormElement&); // If creation failed, return false. bool isValid() const { return action.isValid(); } diff --git a/WebKit/chromium/public/WebPlugin.h b/WebKit/chromium/public/WebPlugin.h index f57c621..57f1cba 100644 --- a/WebKit/chromium/public/WebPlugin.h +++ b/WebKit/chromium/public/WebPlugin.h @@ -32,6 +32,7 @@ #define WebPlugin_h #include "WebCanvas.h" +#include "WebString.h" struct NPObject; @@ -93,6 +94,8 @@ public: // Ends the print operation. virtual void printEnd() { } + virtual WebString selectedText() { return WebString(); } + protected: ~WebPlugin() { } }; diff --git a/WebKit/chromium/public/WebPluginContainer.h b/WebKit/chromium/public/WebPluginContainer.h index 7b23f08..66ef9ab 100644 --- a/WebKit/chromium/public/WebPluginContainer.h +++ b/WebKit/chromium/public/WebPluginContainer.h @@ -36,6 +36,7 @@ struct NPObject; namespace WebKit { class WebElement; +class WebPlugin; class WebString; class WebURL; class WebURLRequest; @@ -77,6 +78,9 @@ public: virtual void loadFrameRequest( const WebURLRequest&, const WebString& target, bool notifyNeeded, void* notifyData) = 0; + virtual WebPlugin* plugin() = 0; + virtual void setPlugin(WebPlugin*) = 0; + protected: ~WebPluginContainer() { } }; diff --git a/WebKit/chromium/public/WebSearchableFormData.h b/WebKit/chromium/public/WebSearchableFormData.h index e453387..5cd1d9b 100644 --- a/WebKit/chromium/public/WebSearchableFormData.h +++ b/WebKit/chromium/public/WebSearchableFormData.h @@ -43,7 +43,7 @@ class WebSearchableFormData { public: // If the provided form is suitable for automated searching, isValid() // will return false. - WebSearchableFormData(const WebFormElement&); + WEBKIT_API WebSearchableFormData(const WebFormElement&); bool isValid() { return m_url.isValid(); } diff --git a/WebKit/chromium/public/WebStorageEventDispatcher.h b/WebKit/chromium/public/WebStorageEventDispatcher.h index 57750e8..37ceb7c 100644 --- a/WebKit/chromium/public/WebStorageEventDispatcher.h +++ b/WebKit/chromium/public/WebStorageEventDispatcher.h @@ -41,7 +41,7 @@ class WebURL; // FIXME: Make this (or something) work for SessionStorage! class WebStorageEventDispatcher { public: - static WebStorageEventDispatcher* create(); + WEBKIT_API static WebStorageEventDispatcher* create(); virtual ~WebStorageEventDispatcher() { } diff --git a/WebKit/chromium/public/WebString.h b/WebKit/chromium/public/WebString.h index d2cf9ea..2c9664e 100644 --- a/WebKit/chromium/public/WebString.h +++ b/WebKit/chromium/public/WebString.h @@ -131,7 +131,7 @@ public: WebString(const NullableString16& s) : m_private(0) { if (s.is_null()) - assign(0); + reset(); else assign(s.string().data(), s.string().length()); } @@ -139,7 +139,7 @@ public: WebString& operator=(const NullableString16& s) { if (s.is_null()) - assign(0); + reset(); else assign(s.string().data(), s.string().length()); return *this; diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index eadfc26..1efd752 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -32,6 +32,8 @@ #define WebView_h #include "WebDragOperation.h" +#include "WebString.h" +#include "WebVector.h" #include "WebWidget.h" namespace WebKit { @@ -42,13 +44,13 @@ class WebDevToolsAgentClient; class WebDragData; class WebFrame; class WebFrameClient; +class WebGLES2Context; class WebNode; class WebSettings; class WebString; class WebViewClient; struct WebMediaPlayerAction; struct WebPoint; -template <typename T> class WebVector; class WebView : public WebWidget { public: @@ -57,7 +59,7 @@ public: // Creates a WebView that is NOT yet initialized. You will need to // call initializeMainFrame to finish the initialization. It is valid // to pass null WebViewClient and WebDevToolsAgentClient pointers. - WEBKIT_API static WebView* create(WebViewClient*, WebDevToolsAgentClient* = 0); + WEBKIT_API static WebView* create(WebViewClient*, WebDevToolsAgentClient*); // After creating a WebView, you should immediately call this method. // You can optionally modify the settings before calling this method. @@ -224,7 +226,6 @@ public: // The embedder may optionally engage a WebDevToolsAgent. This may only // be set once per WebView. virtual WebDevToolsAgent* devToolsAgent() = 0; - virtual void setDevToolsAgent(WebDevToolsAgent*) = 0; // Accessibility ------------------------------------------------------- @@ -233,17 +234,18 @@ public: virtual WebAccessibilityObject accessibilityObject() = 0; - // AutoFill / Autocomplete --------------------------------------------- + // AutoFill ----------------------------------------------------------- // Notifies the WebView that AutoFill suggestions are available for a node. virtual void applyAutoFillSuggestions( const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, - int defaultSuggestionIndex) = 0; + int separatorIndex) = 0; // Notifies the WebView that Autocomplete suggestions are available for a // node. + // DEPRECATED: merging with applyAutoFillSuggestions. virtual void applyAutocompleteSuggestions( const WebNode&, const WebVector<WebString>& suggestions, @@ -281,10 +283,22 @@ public: unsigned inactiveForegroundColor) = 0; // User scripts -------------------------------------------------------- - virtual void addUserScript(const WebString& sourceCode, - bool runAtStart) = 0; - virtual void addUserStyleSheet(const WebString& sourceCode) = 0; - virtual void removeAllUserContent() = 0; + // FIXME: These two methods are DEPRECATED. Remove once Chromium has been rolled. + virtual void addUserScript(const WebString& sourceCode, bool runAtStart) + { + addUserScript(sourceCode, WebVector<WebString>(), runAtStart); + } + virtual void addUserStyleSheet(const WebString& sourceCode) + { + addUserStyleSheet(sourceCode, WebVector<WebString>()); + } + + WEBKIT_API static void addUserScript(const WebString& sourceCode, + const WebVector<WebString>& patterns, + bool runAtStart); + WEBKIT_API static void addUserStyleSheet(const WebString& sourceCode, + const WebVector<WebString>& patterns); + WEBKIT_API static void removeAllUserContent(); // Modal dialog support ------------------------------------------------ @@ -293,6 +307,12 @@ public: WEBKIT_API static void willEnterModalLoop(); WEBKIT_API static void didExitModalLoop(); + // GPU acceleration support -------------------------------------------- + + // Returns the GLES2Context associated with this WebView. One will be + // created if it doesn't already exist. + virtual WebGLES2Context* gles2Context() = 0; + protected: ~WebView() {} }; diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 0712815..a59289d 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -126,9 +126,6 @@ public: virtual bool isSmartInsertDeleteEnabled() { return true; } virtual bool isSelectTrailingWhitespaceEnabled() { return true; } - // DEPRECATED: replaced by WebWidgetClient::resetInputMethod(). - virtual void setInputMethodEnabled(bool enabled) { } - virtual void didBeginEditing() { } virtual void didChangeSelection(bool isSelectionEmpty) { } virtual void didChangeContents() { } diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h index 3da245b..5c9f54e 100644 --- a/WebKit/chromium/public/WebWidget.h +++ b/WebKit/chromium/public/WebWidget.h @@ -33,7 +33,6 @@ #include "WebCanvas.h" #include "WebCommon.h" -#include "WebCompositionCommand.h" #include "WebCompositionUnderline.h" #include "WebTextInputType.h" #include "WebTextDirection.h" @@ -79,13 +78,6 @@ public: // Called to inform the WebWidget that it has gained or lost keyboard focus. virtual void setFocus(bool) = 0; - // DEPRECATED. It's replaced by setComposition() and confirmComposition(). - virtual bool handleCompositionEvent(WebCompositionCommand command, - int cursorPosition, - int targetStart, - int targetEnd, - const WebString& text) = 0; - // Called to inform the WebWidget of a new composition text. // If selectionStart and selectionEnd has the same value, then it indicates // the input caret position. If the text is empty, then the existing @@ -101,10 +93,6 @@ public: // Returns true if there is an ongoing composition. virtual bool confirmComposition() = 0; - // DEPRECATED. It's replaced by textInputType() and - // caretOrSelectionBounds(). - virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) = 0; - // Returns the current text input type of this WebWidget. virtual WebTextInputType textInputType() = 0; diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 819339d..5736ca0 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -181,6 +181,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatSmartPaste, PasteboardPrivate:: COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::BufferStandard, PasteboardPrivate::StandardBuffer); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::BufferSelection, PasteboardPrivate::SelectionBuffer); +COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::BufferDrag, PasteboardPrivate::DragBuffer); COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypePointer, PlatformCursor::TypePointer); COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCross, PlatformCursor::TypeCross); diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp index 04c02f2..1294561 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp @@ -31,7 +31,12 @@ #include "config.h" #include "AutoFillPopupMenuClient.h" +#include "CSSStyleSelector.h" +#include "CSSValueKeywords.h" +#include "Chrome.h" +#include "FrameView.h" #include "HTMLInputElement.h" +#include "RenderTheme.h" #include "WebNode.h" #include "WebString.h" #include "WebVector.h" @@ -42,6 +47,18 @@ using namespace WebCore; namespace WebKit { +AutoFillPopupMenuClient::AutoFillPopupMenuClient() + : m_separatorIndex(-1) + , m_selectedIndex(-1) + , m_textField(0) + , m_AutocompleteModeEnabled(false) +{ +} + +AutoFillPopupMenuClient::~AutoFillPopupMenuClient() +{ +} + unsigned AutoFillPopupMenuClient::getSuggestionsCount() const { return m_names.size() + ((m_separatorIndex == -1) ? 0 : 1); @@ -75,19 +92,35 @@ void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents) { - WebViewImpl* webView = getWebView(); - if (!webView) - return; - - if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex)) - --listIndex; - - ASSERT(listIndex < m_names.size()); - - webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()), - m_names[listIndex], - m_labels[listIndex], - listIndex); + // DEPRECATED: Will be removed once AutoFill and Autocomplete merge is + // completed. + if (m_AutocompleteModeEnabled) { + m_textField->setValue(getSuggestion(listIndex)); + + WebViewImpl* webView = getWebView(); + if (!webView) + return; + + EditorClientImpl* editor = + static_cast<EditorClientImpl*>(webView->page()->editorClient()); + ASSERT(editor); + editor->onAutocompleteSuggestionAccepted( + static_cast<HTMLInputElement*>(m_textField.get())); + } else { + WebViewImpl* webView = getWebView(); + if (!webView) + return; + + if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex)) + --listIndex; + + ASSERT(listIndex < m_names.size()); + + webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()), + m_names[listIndex], + m_labels[listIndex], + listIndex); + } } void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents) @@ -108,22 +141,52 @@ void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEven void AutoFillPopupMenuClient::selectionCleared() { - WebViewImpl* webView = getWebView(); - if (!webView) - return; + // Same effect desired as popupDidHide, so call through. + popupDidHide(); +} - webView->suggestionsPopupDidHide(); - webView->client()->didClearAutoFillSelection(WebNode(getTextField())); +String AutoFillPopupMenuClient::itemText(unsigned listIndex) const +{ + return getSuggestion(listIndex); +} + +PopupMenuStyle AutoFillPopupMenuClient::itemStyle(unsigned listIndex) const +{ + return *m_style; +} + +PopupMenuStyle AutoFillPopupMenuClient::menuStyle() const +{ + return *m_style; +} + +int AutoFillPopupMenuClient::clientPaddingLeft() const +{ + // Bug http://crbug.com/7708 seems to indicate the style can be 0. + RenderStyle* style = textFieldStyle(); + if (!style) + return 0; + + return RenderTheme::defaultTheme()->popupInternalPaddingLeft(style); +} + +int AutoFillPopupMenuClient::clientPaddingRight() const +{ + // Bug http://crbug.com/7708 seems to indicate the style can be 0. + RenderStyle* style = textFieldStyle(); + if (!style) + return 0; + + return RenderTheme::defaultTheme()->popupInternalPaddingRight(style); } void AutoFillPopupMenuClient::popupDidHide() { - // FIXME: Refactor this method, as selectionCleared() and popupDidHide() - // share the exact same functionality. WebViewImpl* webView = getWebView(); if (!webView) return; + webView->autoFillPopupDidHide(); webView->client()->didClearAutoFillSelection(WebNode(getTextField())); } @@ -132,6 +195,29 @@ bool AutoFillPopupMenuClient::itemIsSeparator(unsigned listIndex) const return (m_separatorIndex != -1 && static_cast<unsigned>(m_separatorIndex) == listIndex); } +void AutoFillPopupMenuClient::setTextFromItem(unsigned listIndex) +{ + m_textField->setValue(getSuggestion(listIndex)); +} + +FontSelector* AutoFillPopupMenuClient::fontSelector() const +{ + return m_textField->document()->styleSelector()->fontSelector(); +} + +HostWindow* AutoFillPopupMenuClient::hostWindow() const +{ + return m_textField->document()->view()->hostWindow(); +} + +PassRefPtr<Scrollbar> AutoFillPopupMenuClient::createScrollbar( + ScrollbarClient* client, + ScrollbarOrientation orientation, + ScrollbarControlSize size) +{ + return Scrollbar::createNativeScrollbar(client, orientation, size); +} + void AutoFillPopupMenuClient::initialize( HTMLInputElement* textField, const WebVector<WebString>& names, @@ -141,11 +227,26 @@ void AutoFillPopupMenuClient::initialize( ASSERT(names.size() == labels.size()); ASSERT(separatorIndex < static_cast<int>(names.size())); + m_selectedIndex = -1; + m_textField = textField; + // The suggestions must be set before initializing the - // SuggestionsPopupMenuClient. + // AutoFillPopupMenuClient. setSuggestions(names, labels, separatorIndex); - SuggestionsPopupMenuClient::initialize(textField, -1); + FontDescription fontDescription; + RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl, + fontDescription); + RenderStyle* style = m_textField->computedStyle(); + fontDescription.setComputedSize(style->fontDescription().computedSize()); + + Font font(fontDescription, 0, 0); + font.update(textField->document()->styleSelector()->fontSelector()); + // The direction of text in popup menu is set the same as the direction of + // the input element: textField. + m_style.set(new PopupMenuStyle(Color::black, Color::white, font, true, + Length(WebCore::Fixed), + textField->renderer()->style()->direction())); } void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names, @@ -169,4 +270,30 @@ void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names, setSelectedIndex(-1); } +WebViewImpl* AutoFillPopupMenuClient::getWebView() const +{ + Frame* frame = m_textField->document()->frame(); + if (!frame) + return 0; + + Page* page = frame->page(); + if (!page) + return 0; + + return static_cast<ChromeClientImpl*>(page->chrome()->client())->webView(); +} + +RenderStyle* AutoFillPopupMenuClient::textFieldStyle() const +{ + RenderStyle* style = m_textField->computedStyle(); + if (!style) { + // It seems we can only have a 0 style in a TextField if the + // node is detached, in which case we the popup shoud not be + // showing. Please report this in http://crbug.com/7708 and + // include the page you were visiting. + ASSERT_NOT_REACHED(); + } + return style; +} + } // namespace WebKit diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h index 488bdb1..a7d6693 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.h +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h @@ -31,31 +31,64 @@ #ifndef AutoFillPopupMenuClient_h #define AutoFillPopupMenuClient_h -#include "SuggestionsPopupMenuClient.h" +#include "PopupMenuClient.h" namespace WebCore { class HTMLInputElement; +class PopupMenuStyle; +class RenderStyle; } namespace WebKit { class WebString; +class WebViewImpl; template <typename T> class WebVector; // The AutoFill suggestions popup menu client, used to display name suggestions // with right-justified labels. -class AutoFillPopupMenuClient : public SuggestionsPopupMenuClient { +class AutoFillPopupMenuClient : public WebCore::PopupMenuClient { public: - // SuggestionsPopupMenuClient implementation: + AutoFillPopupMenuClient(); + virtual ~AutoFillPopupMenuClient(); + + // Returns the number of suggestions available. virtual unsigned getSuggestionsCount() const; + + // Returns the suggestion at |listIndex|. virtual WebString getSuggestion(unsigned listIndex) const; + + // Removes the suggestion at |listIndex| from the list of suggestions. virtual void removeSuggestionAtIndex(unsigned listIndex); - // WebCore::PopupMenuClient implementation: + // WebCore::PopupMenuClient methods: virtual void valueChanged(unsigned listIndex, bool fireEvents = true); - virtual void selectionChanged(unsigned listIndex, bool fireEvents = true); + virtual void selectionChanged(unsigned, bool); virtual void selectionCleared(); + virtual WebCore::String itemText(unsigned listIndex) const; + virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); } + virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); } + virtual bool itemIsEnabled(unsigned listIndex) const { return true; } + virtual WebCore::PopupMenuStyle itemStyle(unsigned listIndex) const; + virtual WebCore::PopupMenuStyle menuStyle() const; + virtual int clientInsetLeft() const { return 0; } + virtual int clientInsetRight() const { return 0; } + virtual int clientPaddingLeft() const; + virtual int clientPaddingRight() const; + virtual int listSize() const { return getSuggestionsCount(); } + virtual int selectedIndex() const { return m_selectedIndex; } virtual void popupDidHide(); virtual bool itemIsSeparator(unsigned listIndex) const; + virtual bool itemIsLabel(unsigned listIndex) const { return false; } + virtual bool itemIsSelected(unsigned listIndex) const { return false; } + virtual bool shouldPopOver() const { return false; } + virtual bool valueShouldChangeOnHotTrack() const { return false; } + virtual void setTextFromItem(unsigned listIndex); + virtual WebCore::FontSelector* fontSelector() const; + virtual WebCore::HostWindow* hostWindow() const; + virtual PassRefPtr<WebCore::Scrollbar> createScrollbar( + WebCore::ScrollbarClient* client, + WebCore::ScrollbarOrientation orientation, + WebCore::ScrollbarControlSize size); void initialize(WebCore::HTMLInputElement*, const WebVector<WebString>& names, @@ -66,12 +99,34 @@ public: const WebVector<WebString>& labels, int separatorIndex); + // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is + // complete. + void setAutocompleteMode(bool enabled) { m_AutocompleteModeEnabled = enabled; } + private: + WebViewImpl* getWebView() const; + WebCore::HTMLInputElement* getTextField() const { return m_textField.get(); } + WebCore::RenderStyle* textFieldStyle() const; + + int getSelectedIndex() const { return m_selectedIndex; } + void setSelectedIndex(int index) { m_selectedIndex = index; } + + // The names and labels that make up the text of the menu items. Vector<WebCore::String> m_names; Vector<WebCore::String> m_labels; // The index of the separator. -1 if there is no separator. int m_separatorIndex; + + // The index of the selected item. -1 if there is no selected item. + int m_selectedIndex; + + RefPtr<WebCore::HTMLInputElement> m_textField; + OwnPtr<WebCore::PopupMenuStyle> m_style; + + // DEPRECATED: Will be removed once Autocomplete and AutoFill merge is + // complete. + bool m_AutocompleteModeEnabled; }; } // namespace WebKit diff --git a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp b/WebKit/chromium/src/AutocompletePopupMenuClient.cpp deleted file mode 100644 index ed4f670..0000000 --- a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "AutocompletePopupMenuClient.h" - -#include "HTMLInputElement.h" -#include "WebString.h" -#include "WebVector.h" - -using namespace WebCore; - -namespace WebKit { - -unsigned AutocompletePopupMenuClient::getSuggestionsCount() const -{ - return m_suggestions.size(); -} - -WebString AutocompletePopupMenuClient::getSuggestion(unsigned listIndex) const -{ - ASSERT(listIndex < m_suggestions.size()); - return m_suggestions[listIndex]; -} - -void AutocompletePopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) -{ - ASSERT(listIndex < m_suggestions.size()); - m_suggestions.remove(listIndex); -} - -void AutocompletePopupMenuClient::initialize( - HTMLInputElement* textField, - const WebVector<WebString>& suggestions, - int defaultSuggestionIndex) -{ - ASSERT(defaultSuggestionIndex < static_cast<int>(suggestions.size())); - - // The suggestions must be set before initializing the - // SuggestionsPopupMenuClient. - setSuggestions(suggestions); - - SuggestionsPopupMenuClient::initialize(textField, defaultSuggestionIndex); -} - -void AutocompletePopupMenuClient::setSuggestions(const WebVector<WebString>& suggestions) -{ - m_suggestions.clear(); - for (size_t i = 0; i < suggestions.size(); ++i) - m_suggestions.append(suggestions[i]); - - // Try to preserve selection if possible. - if (getSelectedIndex() >= static_cast<int>(suggestions.size())) - setSelectedIndex(-1); -} - -} // namespace WebKit diff --git a/WebKit/chromium/src/AutocompletePopupMenuClient.h b/WebKit/chromium/src/AutocompletePopupMenuClient.h deleted file mode 100644 index 16a3771..0000000 --- a/WebKit/chromium/src/AutocompletePopupMenuClient.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef AutocompletePopupMenuClient_h -#define AutocompletePopupMenuClient_h - -#include "SuggestionsPopupMenuClient.h" - -namespace WebCore { -class HTMLInputElement; -} - -namespace WebKit { -class WebString; -template <typename T> class WebVector; - -// The Autocomplete suggestions popup menu client, used to display a list of -// autocomplete suggestions. -class AutocompletePopupMenuClient : public SuggestionsPopupMenuClient { -public: - // SuggestionsPopupMenuClient implementation: - virtual unsigned getSuggestionsCount() const; - virtual WebString getSuggestion(unsigned listIndex) const; - virtual void removeSuggestionAtIndex(unsigned listIndex); - - void initialize(WebCore::HTMLInputElement*, - const WebVector<WebString>& suggestions, - int defaultSuggestionIndex); - - void setSuggestions(const WebVector<WebString>&); - -private: - Vector<WebCore::String> m_suggestions; -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 4963f78..5124a7f 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -40,6 +40,7 @@ #include "WebCookieJar.h" #include "WebCursorInfo.h" #include "WebData.h" +#include "WebDragData.h" #include "WebFileSystem.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" @@ -197,6 +198,48 @@ void ChromiumBridge::clipboardWriteImage(NativeImagePtr image, webKitClient()->clipboard()->writeImage(webImage, sourceURL, title); } +void ChromiumBridge::clipboardWriteData(ClipboardData* data) +{ + notImplemented(); + WebDragData dragData; // FIXME: Define the conversion from ClipboardData to WebDragData. + webKitClient()->clipboard()->writeData(dragData); +} + +HashSet<String> ChromiumBridge::clipboardReadAvailableTypes( + PasteboardPrivate::ClipboardBuffer buffer, bool* containsFilenames) +{ + WebVector<WebString> result = webKitClient()->clipboard()->readAvailableTypes( + static_cast<WebClipboard::Buffer>(buffer), containsFilenames); + HashSet<String> types; + for (size_t i = 0; i < result.size(); ++i) + types.add(result[i]); + return types; +} + +bool ChromiumBridge::clipboardReadData(PasteboardPrivate::ClipboardBuffer buffer, + const String& type, String& data, String& metadata) +{ + WebString resultData; + WebString resultMetadata; + bool succeeded = webKitClient()->clipboard()->readData( + static_cast<WebClipboard::Buffer>(buffer), type, &resultData, &resultMetadata); + if (succeeded) { + data = resultData; + metadata = resultMetadata; + } + return succeeded; +} + +Vector<String> ChromiumBridge::clipboardReadFilenames(PasteboardPrivate::ClipboardBuffer buffer) +{ + WebVector<WebString> result = webKitClient()->clipboard()->readFilenames( + static_cast<WebClipboard::Buffer>(buffer)); + Vector<String> convertedResult; + for (size_t i = 0; i < result.size(); ++i) + convertedResult.append(result[i]); + return convertedResult; +} + // Cookies -------------------------------------------------------------------- void ChromiumBridge::setCookies(const Document* document, const KURL& url, diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp index 8dd3393..f757d9c 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -46,6 +46,7 @@ #include "KURL.h" #include "MediaError.h" #include "PlatformString.h" +#include "RenderWidget.h" #include "TextBreakIterator.h" #include "Widget.h" @@ -53,6 +54,7 @@ #include "WebDataSourceImpl.h" #include "WebFrameImpl.h" #include "WebMenuItemInfo.h" +#include "WebPluginContainerImpl.h" #include "WebPoint.h" #include "WebString.h" #include "WebURL.h" @@ -147,6 +149,24 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( WebContextMenuData data; data.mousePosition = selectedFrame->view()->contentsToWindow(r.point()); + // Compute edit flags. + data.editFlags = WebContextMenuData::CanDoNone; + if (m_webView->focusedWebCoreFrame()->editor()->canUndo()) + data.editFlags |= WebContextMenuData::CanUndo; + if (m_webView->focusedWebCoreFrame()->editor()->canRedo()) + data.editFlags |= WebContextMenuData::CanRedo; + if (m_webView->focusedWebCoreFrame()->editor()->canCut()) + data.editFlags |= WebContextMenuData::CanCut; + if (m_webView->focusedWebCoreFrame()->editor()->canCopy()) + data.editFlags |= WebContextMenuData::CanCopy; + if (m_webView->focusedWebCoreFrame()->editor()->canPaste()) + data.editFlags |= WebContextMenuData::CanPaste; + if (m_webView->focusedWebCoreFrame()->editor()->canDelete()) + data.editFlags |= WebContextMenuData::CanDelete; + // We can always select all... + data.editFlags |= WebContextMenuData::CanSelectAll; + data.editFlags |= WebContextMenuData::CanTranslate; + // Links, Images, Media tags, and Image/Media-Links take preference over // all else. data.linkURL = r.absoluteLinkURL(); @@ -182,6 +202,21 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( data.mediaFlags |= WebContextMenuData::MediaHasVideo; if (mediaElement->controls()) data.mediaFlags |= WebContextMenuData::MediaControls; + } else if (r.innerNonSharedNode()->hasTagName(HTMLNames::objectTag) + || r.innerNonSharedNode()->hasTagName(HTMLNames::embedTag)) { + RenderObject* object = r.innerNonSharedNode()->renderer(); + if (object && object->isWidget()) { + Widget* widget = toRenderWidget(object)->widget(); + if (widget) { + WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget); + WebString text = plugin->selectedText(); + if (!text.isEmpty()) { + data.selectedText = text; + data.editFlags |= WebContextMenuData::CanCopy; + } + data.editFlags &= ~WebContextMenuData::CanTranslate; + } + } } data.isImageBlocked = @@ -226,23 +261,6 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (ds) data.securityInfo = ds->response().securityInfo(); - // Compute edit flags. - data.editFlags = WebContextMenuData::CanDoNone; - if (m_webView->focusedWebCoreFrame()->editor()->canUndo()) - data.editFlags |= WebContextMenuData::CanUndo; - if (m_webView->focusedWebCoreFrame()->editor()->canRedo()) - data.editFlags |= WebContextMenuData::CanRedo; - if (m_webView->focusedWebCoreFrame()->editor()->canCut()) - data.editFlags |= WebContextMenuData::CanCut; - if (m_webView->focusedWebCoreFrame()->editor()->canCopy()) - data.editFlags |= WebContextMenuData::CanCopy; - if (m_webView->focusedWebCoreFrame()->editor()->canPaste()) - data.editFlags |= WebContextMenuData::CanPaste; - if (m_webView->focusedWebCoreFrame()->editor()->canDelete()) - data.editFlags |= WebContextMenuData::CanDelete; - // We can always select all... - data.editFlags |= WebContextMenuData::CanSelectAll; - // Filter out custom menu elements and add them into the data. populateCustomMenuItems(defaultMenu, &data); diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index 2a40d78..864988a 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -658,7 +658,7 @@ void EditorClientImpl::textFieldDidEndEditing(Element* element) m_autofillTimer.stop(); // Hide any showing popup. - m_webView->hideSuggestionsPopup(); + m_webView->hideAutoFillPopup(); if (!m_webView->client()) return; // The page is getting closed, don't fill the password. @@ -754,7 +754,7 @@ void EditorClientImpl::doAutofill(Timer<EditorClientImpl>* timer) && inputElement->selectionEnd() == static_cast<int>(value.length()); if ((!args->autofillOnEmptyValue && value.isEmpty()) || !isCaretAtEnd) { - m_webView->hideSuggestionsPopup(); + m_webView->hideAutoFillPopup(); return; } @@ -796,11 +796,7 @@ void EditorClientImpl::onAutocompleteSuggestionAccepted(HTMLInputElement* textFi if (!webframe) return; - WebPasswordAutocompleteListener* listener = webframe->getPasswordListener(textField); - // Password listeners need to autocomplete other fields that depend on the - // input element with autofill suggestions. - if (listener) - listener->performInlineAutocomplete(textField->value(), false, false); + webframe->notifiyPasswordListenerOfAutocomplete(WebInputElement(textField)); } bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element, @@ -921,13 +917,8 @@ void EditorClientImpl::getGuessesForWord(const String&, void EditorClientImpl::setInputMethodState(bool enabled) { - if (m_webView->client()) { + if (m_webView->client()) m_webView->client()->resetInputMethod(); - - // Remove this line when WebViewClient::setInputMethodEnabled() gets - // removed. - m_webView->client()->setInputMethodEnabled(enabled); - } } } // namesace WebKit diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index 0681675..7ba0bce 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -35,6 +35,8 @@ #include "GraphicsContext3D.h" #include "CachedImage.h" +#include "Chrome.h" +#include "ChromeClientImpl.h" #include "HTMLCanvasElement.h" #include "HTMLImageElement.h" #include "ImageBuffer.h" @@ -50,10 +52,12 @@ #include "WebGLShader.h" #include "WebGLTexture.h" #include "Uint8Array.h" +#include "WebGLLayerChromium.h" #include "WebGraphicsContext3D.h" #include "WebGraphicsContext3DDefaultImpl.h" #include "WebKit.h" #include "WebKitClient.h" +#include "WebViewImpl.h" #include <stdio.h> #include <wtf/FastMalloc.h> @@ -97,7 +101,7 @@ public: GraphicsContext3DInternal(); ~GraphicsContext3DInternal(); - bool initialize(GraphicsContext3D::Attributes attrs); + bool initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow); PlatformGraphicsContext3D platformGraphicsContext3D() const; Platform3DObject platformTexture() const; @@ -111,6 +115,11 @@ public: void beginPaint(WebGLRenderingContext* context); void endPaint(); + void prepareTexture(); + +#if USE(ACCELERATED_COMPOSITING) + WebGLLayerChromium* platformLayer() const; +#endif bool isGLES2Compliant() const; //---------------------------------------------------------------------- @@ -165,6 +174,8 @@ public: bool getActiveAttrib(WebGLProgram* program, unsigned long index, ActiveInfo&); bool getActiveUniform(WebGLProgram* program, unsigned long index, ActiveInfo&); + void getAttachedShaders(WebGLProgram* program, int maxCount, int* count, unsigned int* shaders); + int getAttribLocation(WebGLProgram*, const String& name); void getBooleanv(unsigned long pname, unsigned char* value); @@ -297,6 +308,9 @@ public: private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; +#if USE(ACCELERATED_COMPOSITING) + RefPtr<WebGLLayerChromium> m_compositingLayer; +#endif #if PLATFORM(SKIA) // If the width and height of the Canvas's backing store don't // match those that we were given in the most recent call to @@ -329,7 +343,8 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal() #endif } -bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs) +bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, + HostWindow* hostWindow) { WebKit::WebGraphicsContext3D::Attributes webAttributes; webAttributes.alpha = attrs.alpha; @@ -340,23 +355,47 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs) WebKit::WebGraphicsContext3D* webContext = WebKit::webKitClient()->createGraphicsContext3D(); if (!webContext) return false; - if (!webContext->initialize(webAttributes)) { + + Chrome* chrome = static_cast<Chrome*>(hostWindow); + WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(chrome->client()); + + WebKit::WebViewImpl* webView = chromeClientImpl->webView(); + + if (!webView) + return false; + if (!webContext->initialize(webAttributes, webView)) { delete webContext; return false; } m_impl.set(webContext); + +#if USE(ACCELERATED_COMPOSITING) + m_compositingLayer = WebGLLayerChromium::create(0); +#endif return true; } PlatformGraphicsContext3D GraphicsContext3DInternal::platformGraphicsContext3D() const { - return 0; + return m_impl.get(); } Platform3DObject GraphicsContext3DInternal::platformTexture() const { - return 0; + return m_impl->getPlatformTextureId(); +} + +void GraphicsContext3DInternal::prepareTexture() +{ + m_impl->prepareTexture(); +} + +#if USE(ACCELERATED_COMPOSITING) +WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const +{ + return m_compositingLayer.get(); } +#endif void GraphicsContext3DInternal::beginPaint(WebGLRenderingContext* context) { @@ -556,6 +595,12 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ m_impl->name(a1, a2, a3, a4); \ } +#define DELEGATE_TO_IMPL_4_X1(name, t1, t2, t3, t4) \ +void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ +{ \ + m_impl->name(EXTRACT(a1), a2, a3, a4); \ +} + #define DELEGATE_TO_IMPL_4_X4(name, t1, t2, t3, t4) \ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ { \ @@ -734,6 +779,8 @@ bool GraphicsContext3DInternal::getActiveUniform(WebGLProgram* program, unsigned return true; } +DELEGATE_TO_IMPL_4_X1(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*) + int GraphicsContext3DInternal::getAttribLocation(WebGLProgram* program, const String& name) { return m_impl->getAttribLocation(EXTRACT(program), name.utf8().data()); @@ -1066,7 +1113,7 @@ GraphicsContext3D::~GraphicsContext3D() PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow) { GraphicsContext3DInternal* internal = new GraphicsContext3DInternal(); - if (!internal->initialize(attrs)) { + if (!internal->initialize(attrs, hostWindow)) { delete internal; return 0; } @@ -1085,6 +1132,20 @@ Platform3DObject GraphicsContext3D::platformTexture() const return m_internal->platformTexture(); } +void GraphicsContext3D::prepareTexture() +{ + return m_internal->prepareTexture(); +} + +#if USE(ACCELERATED_COMPOSITING) +PlatformLayer* GraphicsContext3D::platformLayer() const +{ + WebGLLayerChromium* webGLLayer = m_internal->platformLayer(); + webGLLayer->setContext(this); + return webGLLayer; +} +#endif + DELEGATE_TO_INTERNAL(makeContextCurrent) DELEGATE_TO_INTERNAL_1R(sizeInBytes, int, int) DELEGATE_TO_INTERNAL_2(reshape, int, int) @@ -1139,6 +1200,8 @@ DELEGATE_TO_INTERNAL_1(generateMipmap, unsigned long) DELEGATE_TO_INTERNAL_3R(getActiveAttrib, WebGLProgram*, unsigned long, ActiveInfo&, bool) DELEGATE_TO_INTERNAL_3R(getActiveUniform, WebGLProgram*, unsigned long, ActiveInfo&, bool) +DELEGATE_TO_INTERNAL_4(getAttachedShaders, WebGLProgram*, int, int*, unsigned int*) + DELEGATE_TO_INTERNAL_2R(getAttribLocation, WebGLProgram*, const String&, int) DELEGATE_TO_INTERNAL_2(getBooleanv, unsigned long, unsigned char*) diff --git a/WebKit/chromium/src/IDBCallbacksProxy.cpp b/WebKit/chromium/src/IDBCallbacksProxy.cpp index 42be08d..7a6571a 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -80,6 +80,11 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBIndex> idbIndex) m_callbacks.clear(); } +void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) +{ + ASSERT_NOT_REACHED(); +} + void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBObjectStore> idbObjectStore) { m_callbacks->onSuccess(new WebKit::WebIDBObjectStoreImpl(idbObjectStore)); diff --git a/WebKit/chromium/src/IDBCallbacksProxy.h b/WebKit/chromium/src/IDBCallbacksProxy.h index 8f2da28..fc424f8 100644 --- a/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/WebKit/chromium/src/IDBCallbacksProxy.h @@ -56,6 +56,7 @@ public: virtual void onSuccess(); // For "null". virtual void onSuccess(PassRefPtr<IDBDatabase>); virtual void onSuccess(PassRefPtr<IDBIndex>); + virtual void onSuccess(PassRefPtr<IDBKey>); virtual void onSuccess(PassRefPtr<IDBObjectStore>); virtual void onSuccess(PassRefPtr<SerializedScriptValue>); diff --git a/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp b/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp deleted file mode 100644 index dd7d9b8..0000000 --- a/WebKit/chromium/src/SuggestionsPopupMenuClient.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "SuggestionsPopupMenuClient.h" - -#include "CSSStyleSelector.h" -#include "CSSValueKeywords.h" -#include "Chrome.h" -#include "FrameView.h" -#include "HTMLInputElement.h" -#include "RenderTheme.h" -#include "WebViewImpl.h" - -using namespace WebCore; - -namespace WebKit { - -SuggestionsPopupMenuClient::SuggestionsPopupMenuClient() - : m_textField(0) - , m_selectedIndex(0) -{ -} - -SuggestionsPopupMenuClient::~SuggestionsPopupMenuClient() -{ -} - -// FIXME: Implement this per-derived class? -void SuggestionsPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents) -{ - m_textField->setValue(getSuggestion(listIndex)); - - WebViewImpl* webView = getWebView(); - if (!webView) - return; - - EditorClientImpl* editor = - static_cast<EditorClientImpl*>(webView->page()->editorClient()); - ASSERT(editor); - editor->onAutocompleteSuggestionAccepted( - static_cast<HTMLInputElement*>(m_textField.get())); -} - -String SuggestionsPopupMenuClient::itemText(unsigned listIndex) const -{ - return getSuggestion(listIndex); -} - -PopupMenuStyle SuggestionsPopupMenuClient::itemStyle(unsigned listIndex) const -{ - return *m_style; -} - -PopupMenuStyle SuggestionsPopupMenuClient::menuStyle() const -{ - return *m_style; -} - -int SuggestionsPopupMenuClient::clientPaddingLeft() const -{ - // Bug http://crbug.com/7708 seems to indicate the style can be 0. - RenderStyle* style = textFieldStyle(); - if (!style) - return 0; - - return RenderTheme::defaultTheme()->popupInternalPaddingLeft(style); -} - -int SuggestionsPopupMenuClient::clientPaddingRight() const -{ - // Bug http://crbug.com/7708 seems to indicate the style can be 0. - RenderStyle* style = textFieldStyle(); - if (!style) - return 0; - - return RenderTheme::defaultTheme()->popupInternalPaddingRight(style); -} - -void SuggestionsPopupMenuClient::popupDidHide() -{ - WebViewImpl* webView = getWebView(); - if (webView) - webView->suggestionsPopupDidHide(); -} - -void SuggestionsPopupMenuClient::setTextFromItem(unsigned listIndex) -{ - m_textField->setValue(getSuggestion(listIndex)); -} - -FontSelector* SuggestionsPopupMenuClient::fontSelector() const -{ - return m_textField->document()->styleSelector()->fontSelector(); -} - -HostWindow* SuggestionsPopupMenuClient::hostWindow() const -{ - return m_textField->document()->view()->hostWindow(); -} - -PassRefPtr<Scrollbar> SuggestionsPopupMenuClient::createScrollbar( - ScrollbarClient* client, - ScrollbarOrientation orientation, - ScrollbarControlSize size) -{ - return Scrollbar::createNativeScrollbar(client, orientation, size); -} - -RenderStyle* SuggestionsPopupMenuClient::textFieldStyle() const -{ - RenderStyle* style = m_textField->computedStyle(); - if (!style) { - // It seems we can only have a 0 style in a TextField if the - // node is detached, in which case we the popup shoud not be - // showing. Please report this in http://crbug.com/7708 and - // include the page you were visiting. - ASSERT_NOT_REACHED(); - } - return style; -} - -void SuggestionsPopupMenuClient::initialize(HTMLInputElement* textField, - int defaultSuggestionIndex) -{ - m_textField = textField; - m_selectedIndex = defaultSuggestionIndex; - - FontDescription fontDescription; - RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl, - fontDescription); - RenderStyle* style = m_textField->computedStyle(); - fontDescription.setComputedSize(style->fontDescription().computedSize()); - - Font font(fontDescription, 0, 0); - font.update(textField->document()->styleSelector()->fontSelector()); - // The direction of text in popup menu is set the same as the direction of - // the input element: textField. - m_style.set(new PopupMenuStyle(Color::black, Color::white, font, true, - Length(WebCore::Fixed), - textField->renderer()->style()->direction())); -} - -WebViewImpl* SuggestionsPopupMenuClient::getWebView() const -{ - Frame* frame = m_textField->document()->frame(); - if (!frame) - return 0; - - Page* page = frame->page(); - if (!page) - return 0; - - return static_cast<ChromeClientImpl*>(page->chrome()->client())->webView(); -} - -} // namespace WebKit diff --git a/WebKit/chromium/src/SuggestionsPopupMenuClient.h b/WebKit/chromium/src/SuggestionsPopupMenuClient.h deleted file mode 100644 index 7717593..0000000 --- a/WebKit/chromium/src/SuggestionsPopupMenuClient.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "PopupMenuClient.h" - -#ifndef SuggestionsPopupMenuClient_h -#define SuggestionsPopupMenuClient_h - -namespace WebCore { -class HTMLInputElement; -class PopupMenuStyle; -class RenderStyle; -} - -namespace WebKit { -class WebString; -class WebViewImpl; -template <typename T> class WebVector; - -// The Suggestions popup menu client, used to display a list of suggestions. -class SuggestionsPopupMenuClient : public WebCore::PopupMenuClient { -public: - SuggestionsPopupMenuClient(); - virtual ~SuggestionsPopupMenuClient(); - - // Returns the number of suggestions available. - virtual unsigned getSuggestionsCount() const = 0; - - // Returns the suggestion at |listIndex|. - virtual WebString getSuggestion(unsigned listIndex) const = 0; - - // Removes the suggestion at |listIndex| from the list of suggestions. - virtual void removeSuggestionAtIndex(unsigned listIndex) = 0; - - // WebCore::PopupMenuClient methods: - virtual void valueChanged(unsigned listIndex, bool fireEvents = true); - virtual void selectionChanged(unsigned, bool) {} - virtual void selectionCleared() {} - virtual WebCore::String itemText(unsigned listIndex) const; - virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); } - virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); } - virtual bool itemIsEnabled(unsigned listIndex) const { return true; } - virtual WebCore::PopupMenuStyle itemStyle(unsigned listIndex) const; - virtual WebCore::PopupMenuStyle menuStyle() const; - virtual int clientInsetLeft() const { return 0; } - virtual int clientInsetRight() const { return 0; } - virtual int clientPaddingLeft() const; - virtual int clientPaddingRight() const; - virtual int listSize() const { return getSuggestionsCount(); } - virtual int selectedIndex() const { return m_selectedIndex; } - virtual void popupDidHide(); - virtual bool itemIsSeparator(unsigned listIndex) const { return false; } - virtual bool itemIsLabel(unsigned listIndex) const { return false; } - virtual bool itemIsSelected(unsigned listIndex) const { return false; } - virtual bool shouldPopOver() const { return false; } - virtual bool valueShouldChangeOnHotTrack() const { return false; } - virtual void setTextFromItem(unsigned listIndex); - virtual WebCore::FontSelector* fontSelector() const; - virtual WebCore::HostWindow* hostWindow() const; - virtual PassRefPtr<WebCore::Scrollbar> createScrollbar( - WebCore::ScrollbarClient* client, - WebCore::ScrollbarOrientation orientation, - WebCore::ScrollbarControlSize size); - -protected: - void initialize(WebCore::HTMLInputElement* textField, - int defaultSuggestionIndex); - - int getSelectedIndex() const { return m_selectedIndex; } - void setSelectedIndex(int index) { m_selectedIndex = index; } - - WebViewImpl* getWebView() const; - WebCore::HTMLInputElement* getTextField() const { return m_textField.get(); } - -private: - WebCore::RenderStyle* textFieldStyle() const; - - RefPtr<WebCore::HTMLInputElement> m_textField; - int m_selectedIndex; - OwnPtr<WebCore::PopupMenuStyle> m_style; -}; - -} // namespace WebKit - -#endif diff --git a/WebKit/chromium/src/WebBindings.cpp b/WebKit/chromium/src/WebBindings.cpp index 2b20c0a..3aaebfd 100644 --- a/WebKit/chromium/src/WebBindings.cpp +++ b/WebKit/chromium/src/WebBindings.cpp @@ -45,6 +45,7 @@ #include "V8DOMWrapper.h" #include "V8Event.h" #include "V8Helpers.h" +#include "V8HiddenPropertyName.h" #include "V8NPUtils.h" #include "V8Proxy.h" #include "V8Range.h" @@ -208,8 +209,7 @@ void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NP static v8::Local<v8::Value> getEvent(const v8::Handle<v8::Context>& context) { - static v8::Persistent<v8::String> eventSymbol(v8::Persistent<v8::String>::New(v8::String::NewSymbol("event"))); - return context->Global()->GetHiddenValue(eventSymbol); + return context->Global()->GetHiddenValue(V8HiddenPropertyName::event()); } static bool getDragDataImpl(NPObject* npobj, int* eventId, WebDragData* data) diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp index 376509d..89522f1 100644 --- a/WebKit/chromium/src/WebDatabase.cpp +++ b/WebKit/chromium/src/WebDatabase.cpp @@ -32,11 +32,7 @@ #include "WebDatabase.h" #include "AbstractDatabase.h" -#include "DatabaseTask.h" -#include "DatabaseThread.h" #include "DatabaseTracker.h" -#include "Document.h" -#include "KURL.h" #include "QuotaTracker.h" #include "SecurityOrigin.h" #include "WebDatabaseObserver.h" @@ -50,44 +46,28 @@ namespace WebKit { static WebDatabaseObserver* databaseObserver = 0; -class WebDatabasePrivate : public AbstractDatabase { -}; - -void WebDatabase::reset() -{ - assign(0); -} - -void WebDatabase::assign(const WebDatabase& other) -{ - WebDatabasePrivate* d = const_cast<WebDatabasePrivate*>(other.m_private); - if (d) - d->ref(); - assign(d); -} - WebString WebDatabase::name() const { - ASSERT(m_private); - return m_private->stringIdentifier(); + ASSERT(m_database); + return m_database->stringIdentifier(); } WebString WebDatabase::displayName() const { - ASSERT(m_private); - return m_private->displayName(); + ASSERT(m_database); + return m_database->displayName(); } unsigned long WebDatabase::estimatedSize() const { - ASSERT(m_private); - return m_private->estimatedSize(); + ASSERT(m_database); + return m_database->estimatedSize(); } WebSecurityOrigin WebDatabase::securityOrigin() const { - ASSERT(m_private); - return WebSecurityOrigin(m_private->securityOrigin()); + ASSERT(m_database); + return WebSecurityOrigin(m_database->securityOrigin()); } void WebDatabase::setObserver(WebDatabaseObserver* observer) @@ -117,28 +97,9 @@ void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, co it->get()->closeImmediately(); } -WebDatabase::WebDatabase(const WTF::PassRefPtr<AbstractDatabase>& database) - : m_private(static_cast<WebDatabasePrivate*>(database.releaseRef())) -{ -} - -WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<AbstractDatabase>& database) -{ - assign(static_cast<WebDatabasePrivate*>(database.releaseRef())); - return *this; -} - -WebDatabase::operator WTF::PassRefPtr<AbstractDatabase>() const -{ - return PassRefPtr<AbstractDatabase>(const_cast<WebDatabasePrivate*>(m_private)); -} - -void WebDatabase::assign(WebDatabasePrivate* d) +WebDatabase::WebDatabase(const AbstractDatabase* database) + : m_database(database) { - // d is already ref'd for us by the caller - if (m_private) - m_private->deref(); - m_private = d; } } // namespace WebKit diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index c0e9b44..20ab1d3 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -643,11 +643,6 @@ void WebDevToolsAgentImpl::setTimelineProfilingEnabled(bool enabled) ic->stopTimelineProfiler(); } -WebDevToolsAgent* WebDevToolsAgent::create(WebView* webview, WebDevToolsAgentClient* client) -{ - return new WebDevToolsAgentImpl(static_cast<WebViewImpl*>(webview), client); -} - void WebDevToolsAgent::executeDebuggerCommand(const WebString& command, int callerId) { DebuggerAgentManager::executeDebuggerCommand(command, callerId); diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index c5fa1fe..ff4883e 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -962,7 +962,7 @@ WebHistoryItem WebFrameImpl::previousHistoryItem() const WebHistoryItem WebFrameImpl::currentHistoryItem() const { // If we are still loading, then we don't want to clobber the current - // history item as this could cause us to lose the scroll position and + // history item as this could cause us to lose the scroll position and // document state. However, it is OK for new navigations. if (m_frame->loader()->loadType() == FrameLoadTypeStandard || !m_frame->loader()->activeDocumentLoader()->isLoadingInAPISense()) @@ -1284,14 +1284,21 @@ bool WebFrameImpl::isPageBoxVisible(int pageIndex) return frame()->document()->isPageBoxVisible(pageIndex); } -WebRect WebFrameImpl::pageAreaRectInPixels(int pageIndex) +void WebFrameImpl::pageSizeAndMarginsInPixels(int pageIndex, + WebSize& pageSize, + int& marginTop, + int& marginRight, + int& marginBottom, + int& marginLeft) { - return frame()->document()->pageAreaRectInPixels(pageIndex); -} - -WebSize WebFrameImpl::preferredPageSizeInPixels(int pageIndex) -{ - return frame()->document()->preferredPageSizeInPixels(pageIndex); + IntSize size(pageSize.width, pageSize.height); + frame()->document()->pageSizeAndMarginsInPixels(pageIndex, + size, + marginTop, + marginRight, + marginBottom, + marginLeft); + pageSize = size; } bool WebFrameImpl::find(int identifier, @@ -1961,6 +1968,17 @@ bool WebFrameImpl::registerPasswordListener( return true; } +void WebFrameImpl::notifiyPasswordListenerOfAutocomplete( + const WebInputElement& inputElement) +{ + RefPtr<HTMLInputElement> element = inputElement.operator PassRefPtr<HTMLInputElement>(); + WebPasswordAutocompleteListener* listener = getPasswordListener(element.get()); + // Password listeners need to autocomplete other fields that depend on the + // input element with autofill suggestions. + if (listener) + listener->performInlineAutocomplete(element->value(), false, false); +} + WebPasswordAutocompleteListener* WebFrameImpl::getPasswordListener( HTMLInputElement* inputElement) { diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index c14ad9b..aa1edd6 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -150,8 +150,12 @@ public: virtual float getPrintPageShrink(int page); virtual void printEnd(); virtual bool isPageBoxVisible(int pageIndex); - virtual WebRect pageAreaRectInPixels(int pageIndex); - virtual WebSize preferredPageSizeInPixels(int pageIndex); + virtual void pageSizeAndMarginsInPixels(int pageIndex, + WebSize& pageSize, + int& marginTop, + int& marginRight, + int& marginBottom, + int& marginLeft); virtual bool find( int identifier, const WebString& searchText, const WebFindOptions&, bool wrapWithinFrame, WebRect* selectionRect); @@ -164,6 +168,8 @@ public: virtual void resetMatchCount(); virtual bool registerPasswordListener( WebInputElement, WebPasswordAutocompleteListener*); + virtual void notifiyPasswordListenerOfAutocomplete( + const WebInputElement&); virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index b23dc35..0863ec8 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -173,8 +173,8 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() glDeleteFramebuffersEXT(1, &m_fbo); #endif // !RENDER_TO_DEBUGGING_WINDOW #if OS(WINDOWS) - wglMakeCurrent(0, 0); - wglDeleteContext(m_contextObj); + wglewMakeCurrent(0, 0); + wglewDeleteContext(m_contextObj); ReleaseDC(m_canvasWindow, m_canvasDC); DestroyWindow(m_canvasWindow); #elif PLATFORM(CG) @@ -194,9 +194,17 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() } } -bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes) +bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView) { #if OS(WINDOWS) + if (!s_initializedGLEW) { + // Do this only the first time through. + if (!wglewInit()) { + printf("WebGraphicsContext3DDefaultImpl: wglewInit failed\n"); + return false; + } + } + WNDCLASS wc; if (!GetClassInfo(GetModuleHandle(0), L"CANVASGL", &wc)) { ZeroMemory(&wc, sizeof(WNDCLASS)); @@ -246,13 +254,13 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute } // create rendering context - m_contextObj = wglCreateContext(m_canvasDC); + m_contextObj = wglewCreateContext(m_canvasDC); if (!m_contextObj) { printf("WebGraphicsContext3DDefaultImpl: wglCreateContext failed\n"); return false; } - if (!wglMakeCurrent(m_canvasDC, m_contextObj)) { + if (!wglewMakeCurrent(m_canvasDC, m_contextObj)) { printf("WebGraphicsContext3DDefaultImpl: wglMakeCurrent failed\n"); return false; } @@ -260,7 +268,7 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute #ifdef RENDER_TO_DEBUGGING_WINDOW typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); PFNWGLSWAPINTERVALEXTPROC setSwapInterval = 0; - setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress("wglSwapIntervalEXT"); + setSwapInterval = (PFNWGLSWAPINTERVALEXTPROC) wglewGetProcAddress("wglSwapIntervalEXT"); if (setSwapInterval) setSwapInterval(1); #endif // RENDER_TO_DEBUGGING_WINDOW @@ -416,8 +424,8 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes() bool WebGraphicsContext3DDefaultImpl::makeContextCurrent() { #if OS(WINDOWS) - if (wglGetCurrentContext() != m_contextObj) - if (wglMakeCurrent(m_canvasDC, m_contextObj)) + if (wglewGetCurrentContext() != m_contextObj) + if (wglewMakeCurrent(m_canvasDC, m_contextObj)) return true; #elif PLATFORM(CG) if (CGLGetCurrentContext() != m_contextObj) @@ -469,6 +477,17 @@ bool WebGraphicsContext3DDefaultImpl::isGLES2Compliant() return false; } +unsigned int WebGraphicsContext3DDefaultImpl::getPlatformTextureId() +{ + ASSERT_NOT_REACHED(); + return 0; +} + +void WebGraphicsContext3DDefaultImpl::prepareTexture() +{ + ASSERT_NOT_REACHED(); +} + static int createTextureObject(GLenum target) { GLuint texture = 0; @@ -1059,6 +1078,8 @@ bool WebGraphicsContext3DDefaultImpl::getActiveUniform(WebGLId program, unsigned return true; } +DELEGATE_TO_GL_4(getAttachedShaders, GetAttachedShaders, WebGLId, int, int*, unsigned int*) + DELEGATE_TO_GL_2R(getAttribLocation, GetAttribLocation, WebGLId, const char*, int) DELEGATE_TO_GL_2(getBooleanv, GetBooleanv, unsigned long, unsigned char*) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index 2518a37..e409bf5 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -42,6 +42,9 @@ #endif #include "GL/glew.h" +#if OS(WINDOWS) +#include "GL/wglew.h" +#endif #if PLATFORM(CG) #include <OpenGL/OpenGL.h> @@ -67,7 +70,7 @@ public: //---------------------------------------------------------------------- // WebGraphicsContext3D methods - virtual bool initialize(WebGraphicsContext3D::Attributes attributes); + virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*); virtual bool makeContextCurrent(); virtual int width(); @@ -81,6 +84,9 @@ public: virtual bool readBackFramebuffer(unsigned char* pixels, size_t bufferSize); + virtual unsigned int getPlatformTextureId(); + virtual void prepareTexture(); + virtual void synthesizeGLError(unsigned long error); virtual void activeTexture(unsigned long texture); @@ -131,6 +137,8 @@ public: virtual bool getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo&); virtual bool getActiveUniform(WebGLId program, unsigned long index, ActiveInfo&); + virtual void getAttachedShaders(WebGLId program, int maxCount, int* count, unsigned int* shaders); + virtual int getAttribLocation(WebGLId program, const char* name); virtual void getBooleanv(unsigned long pname, unsigned char* value); diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp index d099048..41758d2 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -167,6 +167,11 @@ void WebPluginContainerImpl::handleEvent(Event* event) handleWheelEvent(static_cast<WheelEvent*>(event)); else if (event->isKeyboardEvent()) handleKeyboardEvent(static_cast<KeyboardEvent*>(event)); + + // FIXME: it would be cleaner if Widget::handleEvent returned true/false and + // HTMLPluginElement called setDefaultHandled or defaultEventHandler. + if (!event->defaultHandled()) + m_element->Node::defaultEventHandler(event); } void WebPluginContainerImpl::frameRectsChanged() @@ -241,6 +246,11 @@ void WebPluginContainerImpl::printEnd() return m_webPlugin->printEnd(); } +WebString WebPluginContainerImpl::selectedText() +{ + return m_webPlugin->selectedText(); +} + WebElement WebPluginContainerImpl::element() { return WebElement(m_element); diff --git a/WebKit/chromium/src/WebPluginContainerImpl.h b/WebKit/chromium/src/WebPluginContainerImpl.h index ad2fa95..dd0871a 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/WebKit/chromium/src/WebPluginContainerImpl.h @@ -84,6 +84,10 @@ public: virtual WebString executeScriptURL(const WebURL&, bool popupsAllowed); virtual void loadFrameRequest(const WebURLRequest&, const WebString& target, bool notifyNeeded, void* notifyData); + // This cannot be null. + WebPlugin* plugin() { return m_webPlugin; } + void setPlugin(WebPlugin* plugin) { m_webPlugin = plugin; } + // Printing interface. The plugin can support custom printing // (which means it controls the layout, number of pages etc). // Whether the plugin supports its own paginated print. The other print @@ -98,6 +102,8 @@ public: // Ends the print operation. void printEnd(); + WebString selectedText(); + // Resource load events for the plugin's source data: void didReceiveResponse(const WebCore::ResourceResponse&); void didReceiveData(const char *data, int dataLength); @@ -106,9 +112,6 @@ public: NPObject* scriptableObject(); - // This cannot be null. - WebPlugin* plugin() { return m_webPlugin; } - void willDestroyPluginLoadObserver(WebPluginLoadObserver*); private: diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp index 9ac4d34..dbf9183 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.cpp +++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp @@ -230,14 +230,6 @@ void WebPopupMenuImpl::setFocus(bool enable) { } -// DEPRECATED, will be removed later. -bool WebPopupMenuImpl::handleCompositionEvent( - WebCompositionCommand command, int cursorPosition, int targetStart, - int targetEnd, const WebString& imeString) -{ - return false; -} - bool WebPopupMenuImpl::setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd) @@ -250,12 +242,6 @@ bool WebPopupMenuImpl::confirmComposition() return false; } -// DEPRECATED, will be removed later. -bool WebPopupMenuImpl::queryCompositionStatus(bool* enabled, WebRect* caretRect) -{ - return false; -} - WebTextInputType WebPopupMenuImpl::textInputType() { return WebTextInputTypeNone; diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h index 95f776e..4f5c2de 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/WebKit/chromium/src/WebPopupMenuImpl.h @@ -66,19 +66,11 @@ public: virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); - - // DEPRECATED, will be removed later. - virtual bool handleCompositionEvent( - WebCompositionCommand command, int cursorPosition, - int targetStart, int targetEnd, const WebString& text); virtual bool setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd); virtual bool confirmComposition(); - - // DEPRECATED, will be removed later. - virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); virtual void setTextDirection(WebTextDirection direction); diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 257d646..45b9117 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -32,7 +32,6 @@ #include "WebViewImpl.h" #include "AutoFillPopupMenuClient.h" -#include "AutocompletePopupMenuClient.h" #include "AXObjectCache.h" #include "Chrome.h" #include "CompositionUnderlineVectorBuilder.h" @@ -104,6 +103,7 @@ #include "WebString.h" #include "WebVector.h" #include "WebViewClient.h" +#include "wtf/OwnPtr.h" #if OS(WINDOWS) #include "RenderThemeChromiumWin.h" @@ -153,7 +153,7 @@ COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); -static const PopupContainerSettings suggestionsPopupSettings = { +static const PopupContainerSettings autoFillPopupSettings = { false, // setTextOnIndexChange false, // acceptOnAbandon true, // loopSelectionNavigation @@ -239,9 +239,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_dropEffect(DropEffectDefault) , m_operationsAllowed(WebDragOperationNone) , m_dragOperation(WebDragOperationNone) - , m_suggestionsPopupShowing(false) - , m_suggestionsPopupClient(0) - , m_suggestionsPopup(0) + , m_autoFillPopupShowing(false) + , m_autoFillPopupClient(0) + , m_autoFillPopup(0) , m_isTransparent(false) , m_tabsToLinks(false) , m_dragScrollTimer(new DragScrollTimer()) @@ -261,7 +261,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools m_lastMousePosition = WebPoint(-1, -1); if (devToolsClient) - m_devToolsAgent = static_cast<WebDevToolsAgentImpl*>(WebDevToolsAgent::create(this, devToolsClient)); + m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0)); @@ -356,7 +356,7 @@ void WebViewImpl::mouseDown(const WebMouseEvent& event) m_mouseCaptureNode = hitNode; // If a text field that has focus is clicked again, we should display the - // suggestions popup. + // AutoFill popup. RefPtr<Node> focusedNode = focusedWebCoreNode(); if (focusedNode.get() && toHTMLInputElement(focusedNode.get())) { if (hitNode == focusedNode) { @@ -374,7 +374,7 @@ void WebViewImpl::mouseDown(const WebMouseEvent& event) PlatformMouseEventBuilder(mainFrameImpl()->frameView(), event)); if (clickedNode.get() && clickedNode == focusedWebCoreNode()) { - // Focus has not changed, show the suggestions popup. + // Focus has not changed, show the AutoFill popup. static_cast<EditorClientImpl*>(m_page->editorClient())-> showFormAutofillForNode(clickedNode.get()); } @@ -456,7 +456,7 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event) IntPoint contentPoint = view->windowToContents(clickPoint); HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, false, false, ShouldHitTestScrollbars); // We don't want to send a paste when middle clicking a scroll bar or a - // link (which will navigate later in the code). The main scrollbars + // link (which will navigate later in the code). The main scrollbars // have to be handled separately. if (!hitTestResult.scrollbar() && !hitTestResult.isLiveLink() && focused && !view->scrollbarAtPoint(clickPoint)) { Editor* editor = focused->editor(); @@ -557,13 +557,13 @@ bool WebViewImpl::selectPopupHandleKeyEvent(const WebKeyboardEvent& event) { if (!m_selectPopup) return false; - + return m_selectPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event)); } bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event) { - if (!m_suggestionsPopupShowing + if (!m_autoFillPopupShowing // Home and End should be left to the text field to process. || event.windowsKeyCode == VKEY_HOME || event.windowsKeyCode == VKEY_END) @@ -571,7 +571,7 @@ bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event) // Pressing delete triggers the removal of the selected suggestion from the DB. if (event.windowsKeyCode == VKEY_DELETE - && m_suggestionsPopup->selectedIndex() != -1) { + && m_autoFillPopup->selectedIndex() != -1) { Node* node = focusedWebCoreNode(); if (!node || (node->nodeType() != Node::ELEMENT_NODE)) { ASSERT_NOT_REACHED(); @@ -583,22 +583,22 @@ bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event) return false; } - int selectedIndex = m_suggestionsPopup->selectedIndex(); + int selectedIndex = m_autoFillPopup->selectedIndex(); HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element); WebString name = inputElement->name(); - WebString value = m_suggestionsPopupClient->itemText(selectedIndex); + WebString value = m_autoFillPopupClient->itemText(selectedIndex); m_client->removeAutofillSuggestions(name, value); // Update the entries in the currently showing popup to reflect the // deletion. - m_suggestionsPopupClient->removeSuggestionAtIndex(selectedIndex); - refreshSuggestionsPopup(); + m_autoFillPopupClient->removeSuggestionAtIndex(selectedIndex); + refreshAutoFillPopup(); return false; } - if (!m_suggestionsPopup->isInterestedInEventForKey(event.windowsKeyCode)) + if (!m_autoFillPopup->isInterestedInEventForKey(event.windowsKeyCode)) return false; - if (m_suggestionsPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event))) { + if (m_autoFillPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event))) { // We need to ignore the next Char event after this otherwise pressing // enter when selecting an item in the menu will go to the page. if (WebInputEvent::RawKeyDown == event.type) @@ -661,62 +661,10 @@ bool WebViewImpl::touchEvent(const WebTouchEvent& event) } #endif -// The WebViewImpl::SendContextMenuEvent function is based on the Webkit -// function -// bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) in -// webkit\webkit\win\WebView.cpp. The only significant change in this -// function is the code to convert from a Keyboard event to the Right -// Mouse button up event. -// -// This function is an ugly copy/paste and should be cleaned up when the -// WebKitWin version is cleaned: https://bugs.webkit.org/show_bug.cgi?id=20438 #if OS(WINDOWS) || OS(LINUX) -// FIXME: implement on Mac +// Mac has no way to open a context menu based on a keyboard event. bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event) { - static const int kContextMenuMargin = 1; - Frame* mainFrameImpl = page()->mainFrame(); - FrameView* view = mainFrameImpl->view(); - if (!view) - return false; - - IntPoint coords(-1, -1); -#if OS(WINDOWS) - int rightAligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); -#else - int rightAligned = 0; -#endif - IntPoint location; - - - Frame* focusedFrame = page()->focusController()->focusedOrMainFrame(); - Node* focusedNode = focusedFrame->document()->focusedNode(); - Position start = mainFrameImpl->selection()->selection().start(); - - if (start.node()) { - RenderObject* renderer = start.node()->renderer(); - if (!renderer) - return false; - - RefPtr<Range> selection = mainFrameImpl->selection()->toNormalizedRange(); - IntRect firstRect = mainFrameImpl->firstRectForRange(selection.get()); - - int x = rightAligned ? firstRect.right() : firstRect.x(); - location = IntPoint(x, firstRect.bottom()); - } else if (focusedNode) - location = focusedNode->getRect().bottomLeft(); - else { - location = IntPoint( - rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin, - kContextMenuMargin); - } - - location = view->contentsToWindow(location); - // FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in - // the selected element. Ideally we'd have the position of a context menu - // event be separate from its target node. - coords = location + IntSize(0, -1); - // The contextMenuController() holds onto the last context menu that was // popped up on the page until a new one is created. We need to clear // this menu before propagating the event through the DOM so that we can @@ -725,17 +673,9 @@ bool WebViewImpl::sendContextMenuEvent(const WebKeyboardEvent& event) // not run. page()->contextMenuController()->clearContextMenu(); - focusedFrame->view()->setCursor(pointerCursor()); - WebMouseEvent mouseEvent; - mouseEvent.button = WebMouseEvent::ButtonRight; - mouseEvent.x = coords.x(); - mouseEvent.y = coords.y(); - mouseEvent.type = WebInputEvent::MouseUp; - - PlatformMouseEventBuilder platformEvent(view, mouseEvent); - m_contextMenuAllowed = true; - bool handled = focusedFrame->eventHandler()->sendContextMenuEvent(platformEvent); + Frame* focusedFrame = page()->focusController()->focusedOrMainFrame(); + bool handled = focusedFrame->eventHandler()->sendContextMenuEventForKey(); m_contextMenuAllowed = false; return handled; } @@ -880,11 +820,11 @@ void WebViewImpl::popupClosed(WebCore::PopupContainer* popupContainer) } } -void WebViewImpl::hideSuggestionsPopup() +void WebViewImpl::hideAutoFillPopup() { - if (m_suggestionsPopupShowing) { - m_suggestionsPopup->hidePopup(); - m_suggestionsPopupShowing = false; + if (m_autoFillPopupShowing) { + m_autoFillPopup->hidePopup(); + m_autoFillPopupShowing = false; } } @@ -1142,7 +1082,7 @@ void WebViewImpl::setFocus(bool enable) } m_imeAcceptEvents = true; } else { - hideSuggestionsPopup(); + hideAutoFillPopup(); hideSelectPopup(); // Clear focus on the currently focused frame if any. @@ -1164,48 +1104,6 @@ void WebViewImpl::setFocus(bool enable) } } -// DEPRECATED, will be removed later. -bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command, - int cursorPosition, - int targetStart, - int targetEnd, - const WebString& imeString) -{ - if (command == WebKit::WebCompositionCommandSet) { - if (targetStart < 0) - targetStart = 0; - if (targetEnd < 0) - targetEnd = static_cast<int>(imeString.length()); - - // Create custom underlines. - // To emphasize the selection, the selected region uses a solid black - // for its underline while other regions uses a pale gray for theirs. - WebVector<WebCompositionUnderline> underlines(static_cast<size_t>(3)); - underlines[0].startOffset = 0; - underlines[0].endOffset = targetStart; - underlines[0].thick = true; - underlines[0].color = 0xffd3d3d3; - underlines[1].startOffset = targetStart; - underlines[1].endOffset = targetEnd; - underlines[1].thick = true; - underlines[1].color = 0xff000000; - underlines[2].startOffset = targetEnd; - underlines[2].endOffset = static_cast<unsigned>(imeString.length()); - underlines[2].thick = true; - underlines[2].color = 0xffd3d3d3; - return setComposition(imeString, underlines, cursorPosition, cursorPosition); - } - - if (command == WebKit::WebCompositionCommandDiscard) - setComposition(WebString(), WebVector<WebCompositionUnderline>(), 0, 0); - else if (command == WebKit::WebCompositionCommandConfirm) { - setComposition(imeString, WebVector<WebCompositionUnderline>(), 0, 0); - confirmComposition(); - } - - return true; -} - bool WebViewImpl::setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, @@ -1284,41 +1182,6 @@ bool WebViewImpl::confirmComposition() return true; } -// DEPRECATED, will be removed later. -bool WebViewImpl::queryCompositionStatus(bool* enableIME, WebRect* caretRect) -{ - // Store whether the selected node needs IME and the caret rectangle. - // This process consists of the following four steps: - // 1. Retrieve the selection controller of the focused frame; - // 2. Retrieve the caret rectangle from the controller; - // 3. Convert the rectangle, which is relative to the parent view, to the - // one relative to the client window, and; - // 4. Store the converted rectangle. - const Frame* focused = focusedWebCoreFrame(); - if (!focused) - return false; - - const Editor* editor = focused->editor(); - if (!editor || !editor->canEdit()) - return false; - - SelectionController* controller = focused->selection(); - if (!controller) - return false; - - const Node* node = controller->start().node(); - if (!node) - return false; - - *enableIME = node->shouldUseInputMethod() && !controller->isInPasswordField(); - const FrameView* view = node->document()->view(); - if (!view) - return false; - - *caretRect = view->contentsToWindow(controller->absoluteCaretBounds()); - return true; -} - WebTextInputType WebViewImpl::textInputType() { WebTextInputType type = WebTextInputTypeNone; @@ -1363,6 +1226,10 @@ WebRect WebViewImpl::caretOrSelectionBounds() if (!view) return rect; + const Node* node = controller->start().node(); + if (!node || !node->renderer()) + return rect; + if (controller->isCaret()) rect = view->contentsToWindow(controller->absoluteCaretBounds()); else if (controller->isRange()) { @@ -1832,12 +1699,6 @@ WebDevToolsAgent* WebViewImpl::devToolsAgent() return m_devToolsAgent.get(); } -void WebViewImpl::setDevToolsAgent(WebDevToolsAgent* devToolsAgent) -{ - ASSERT(!m_devToolsAgent.get()); // May only set once! - m_devToolsAgent.set(static_cast<WebDevToolsAgentPrivate*>(devToolsAgent)); -} - WebAccessibilityObject WebViewImpl::accessibilityObject() { if (!mainFrameImpl()) @@ -1858,7 +1719,7 @@ void WebViewImpl::applyAutoFillSuggestions( ASSERT(separatorIndex < static_cast<int>(names.size())); if (names.isEmpty()) { - hideSuggestionsPopup(); + hideAutoFillPopup(); return; } @@ -1867,7 +1728,7 @@ void WebViewImpl::applyAutoFillSuggestions( // focused node, then we have nothing to do. FIXME: also check the // caret is at the end and that the text has not changed. if (!focusedNode || focusedNode != PassRefPtr<Node>(node)) { - hideSuggestionsPopup(); + hideAutoFillPopup(); return; } @@ -1879,93 +1740,52 @@ void WebViewImpl::applyAutoFillSuggestions( if (!m_autoFillPopupClient.get()) m_autoFillPopupClient.set(new AutoFillPopupMenuClient); - m_autoFillPopupClient->initialize(inputElem, names, labels, - separatorIndex); - - if (m_suggestionsPopupClient != m_autoFillPopupClient.get()) { - hideSuggestionsPopup(); - m_suggestionsPopupClient = m_autoFillPopupClient.get(); - } + m_autoFillPopupClient->initialize(inputElem, names, labels, separatorIndex); if (!m_autoFillPopup.get()) { - m_autoFillPopup = PopupContainer::create(m_suggestionsPopupClient, + m_autoFillPopup = PopupContainer::create(m_autoFillPopupClient.get(), PopupContainer::Suggestion, - suggestionsPopupSettings); + autoFillPopupSettings); } - if (m_suggestionsPopup != m_autoFillPopup.get()) - m_suggestionsPopup = m_autoFillPopup.get(); - - if (m_suggestionsPopupShowing) { + if (m_autoFillPopupShowing) { m_autoFillPopupClient->setSuggestions(names, labels, separatorIndex); - refreshSuggestionsPopup(); + refreshAutoFillPopup(); } else { - m_suggestionsPopup->show(focusedNode->getRect(), + m_autoFillPopup->show(focusedNode->getRect(), focusedNode->ownerDocument()->view(), 0); - m_suggestionsPopupShowing = true; + m_autoFillPopupShowing = true; } + + // DEPRECATED: This special mode will go away once AutoFill and Autocomplete + // merge is complete. + if (m_autoFillPopupClient) + m_autoFillPopupClient->setAutocompleteMode(false); } +// DEPRECATED: replacing with applyAutoFillSuggestions. void WebViewImpl::applyAutocompleteSuggestions( const WebNode& node, const WebVector<WebString>& suggestions, int defaultSuggestionIndex) { - ASSERT(defaultSuggestionIndex < static_cast<int>(suggestions.size())); - - if (!m_page.get() || suggestions.isEmpty()) { - hideSuggestionsPopup(); - return; - } + WebVector<WebString> names(suggestions.size()); + WebVector<WebString> labels(suggestions.size()); - RefPtr<Node> focusedNode = focusedWebCoreNode(); - // If the node for which we queried the Autocomplete suggestions is not the - // focused node, then we have nothing to do. FIXME: also check the - // caret is at the end and that the text has not changed. - if (!focusedNode || focusedNode != PassRefPtr<Node>(node)) { - hideSuggestionsPopup(); - return; + for (size_t i = 0; i < suggestions.size(); ++i) { + names[i] = suggestions[i]; + labels[i] = WebString(); } - HTMLInputElement* inputElem = - static_cast<HTMLInputElement*>(focusedNode.get()); - - // The first time the Autocomplete is shown we'll create the client and the - // popup. - if (!m_autocompletePopupClient.get()) - m_autocompletePopupClient.set(new AutocompletePopupMenuClient); - - m_autocompletePopupClient->initialize(inputElem, suggestions, - defaultSuggestionIndex); - - if (m_suggestionsPopupClient != m_autocompletePopupClient.get()) { - hideSuggestionsPopup(); - m_suggestionsPopupClient = m_autocompletePopupClient.get(); - } - - if (!m_autocompletePopup.get()) { - m_autocompletePopup = PopupContainer::create(m_suggestionsPopupClient, - PopupContainer::Suggestion, - suggestionsPopupSettings); - } - - if (m_suggestionsPopup != m_autocompletePopup.get()) - m_suggestionsPopup = m_autocompletePopup.get(); - - if (m_suggestionsPopupShowing) { - m_autocompletePopupClient->setSuggestions(suggestions); - refreshSuggestionsPopup(); - } else { - m_suggestionsPopup->show(focusedNode->getRect(), - focusedNode->ownerDocument()->view(), 0); - m_suggestionsPopupShowing = true; - } + applyAutoFillSuggestions(node, names, labels, -1); + if (m_autoFillPopupClient) + m_autoFillPopupClient->setAutocompleteMode(true); } void WebViewImpl::hidePopups() { hideSelectPopup(); - hideSuggestionsPopup(); + hideAutoFillPopup(); } void WebViewImpl::performCustomContextMenuAction(unsigned action) @@ -2044,22 +1864,30 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor, #endif } -void WebViewImpl::addUserScript(const WebString& sourceCode, bool runAtStart) +void WebView::addUserScript(const WebString& sourceCode, const WebVector<WebString>& patternsIn, bool runAtStart) { + OwnPtr<Vector<String> > patterns(new Vector<String>); + for (size_t i = 0; i < patternsIn.size(); ++i) + patterns->append(patternsIn[i]); + PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create()); - pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), 0, 0, + pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0, runAtStart ? InjectAtDocumentStart : InjectAtDocumentEnd); } -void WebViewImpl::addUserStyleSheet(const WebString& sourceCode) +void WebView::addUserStyleSheet(const WebString& sourceCode, const WebVector<WebString>& patternsIn) { + OwnPtr<Vector<String> > patterns(new Vector<String>); + for (size_t i = 0; i < patternsIn.size(); ++i) + patterns->append(patternsIn[i]); + PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::create()); - pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), 0, 0); + pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), 0); } -void WebViewImpl::removeAllUserContent() +void WebView::removeAllUserContent() { PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName); pageGroup->removeAllUserContent(); @@ -2151,24 +1979,25 @@ NotificationPresenterImpl* WebViewImpl::notificationPresenterImpl() } #endif -void WebViewImpl::refreshSuggestionsPopup() +void WebViewImpl::refreshAutoFillPopup() { - ASSERT(m_suggestionsPopupShowing); + ASSERT(m_autoFillPopupShowing); // Hide the popup if it has become empty. - if (!m_suggestionsPopupClient->listSize()) { - hideSuggestionsPopup(); + if (!m_autoFillPopupClient->listSize()) { + hideAutoFillPopup(); return; } - IntRect oldBounds = m_suggestionsPopup->boundsRect(); - m_suggestionsPopup->refresh(); - IntRect newBounds = m_suggestionsPopup->boundsRect(); + IntRect oldBounds = m_autoFillPopup->boundsRect(); + m_autoFillPopup->refresh(); + IntRect newBounds = m_autoFillPopup->boundsRect(); // Let's resize the backing window if necessary. if (oldBounds != newBounds) { WebPopupMenuImpl* popupMenu = - static_cast<WebPopupMenuImpl*>(m_suggestionsPopup->client()); - popupMenu->client()->setWindowRect(newBounds); + static_cast<WebPopupMenuImpl*>(m_autoFillPopup->client()); + if (popupMenu) + popupMenu->client()->setWindowRect(newBounds); } } diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index a6fa131..db2a1d2 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -70,7 +70,6 @@ class AutocompletePopupMenuClient; class AutoFillPopupMenuClient; class ContextMenuClientImpl; class DragScrollTimer; -class SuggestionsPopupMenuClient; class WebAccessibilityObject; class WebDevToolsAgentClient; class WebDevToolsAgentPrivate; @@ -93,22 +92,12 @@ public: virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); - - // DEPRECATED, will be removed later. - virtual bool handleCompositionEvent(WebCompositionCommand command, - int cursorPosition, - int targetStart, - int targetEnd, - const WebString& text); virtual bool setComposition( const WebString& text, const WebVector<WebCompositionUnderline>& underlines, int selectionStart, int selectionEnd); virtual bool confirmComposition(); - - // DEPRECATED, will be removed later. - virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); virtual void setTextDirection(WebTextDirection direction); @@ -147,8 +136,8 @@ public: const WebPoint& screenPoint, WebDragOperation operation); virtual void dragSourceMovedTo( - const WebPoint& clientPoint, - const WebPoint& screenPoint, + const WebPoint& clientPoint, + const WebPoint& screenPoint, WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( @@ -174,13 +163,13 @@ public: virtual void setInspectorSetting(const WebString& key, const WebString& value); virtual WebDevToolsAgent* devToolsAgent(); - virtual void setDevToolsAgent(WebDevToolsAgent*); virtual WebAccessibilityObject accessibilityObject(); virtual void applyAutoFillSuggestions( const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, int separatorIndex); + // DEPRECATED: replacing with applyAutoFillSuggestions. virtual void applyAutocompleteSuggestions( const WebNode&, const WebVector<WebString>& suggestions, @@ -194,10 +183,7 @@ public: unsigned inactiveBackgroundColor, unsigned inactiveForegroundColor); virtual void performCustomContextMenuAction(unsigned action); - virtual void addUserScript(const WebString& sourceCode, - bool runAtStart); - virtual void addUserStyleSheet(const WebString& sourceCode); - virtual void removeAllUserContent(); + virtual WebGLES2Context* gles2Context(); // WebViewImpl @@ -296,9 +282,9 @@ public: const WebImage& dragImage, const WebPoint& dragImageOffset); - void suggestionsPopupDidHide() + void autoFillPopupDidHide() { - m_suggestionsPopupShowing = false; + m_autoFillPopupShowing = false; } #if ENABLE(NOTIFICATIONS) @@ -314,7 +300,7 @@ public: void popupOpened(WebCore::PopupContainer* popupContainer); void popupClosed(WebCore::PopupContainer* popupContainer); - void hideSuggestionsPopup(); + void hideAutoFillPopup(); // HACK: currentInputEvent() is for ChromeClientImpl::show(), until we can // fix WebKit to pass enough information up into ChromeClient::show() so we @@ -336,10 +322,6 @@ public: WebCore::ScrollDirection* scrollDirection, WebCore::ScrollGranularity* scrollGranularity); - // Returns the GLES2Context associated with this WebView. One will be created - // if it doesn't already exist. - WebGLES2Context* gles2Context(); - private: friend class WebView; // So WebView::Create can call our constructor friend class WTF::RefCounted<WebViewImpl>; @@ -361,10 +343,10 @@ private: // Returns true if the autocomple has consumed the event. bool autocompleteHandleKeyEvent(const WebKeyboardEvent&); - // Repaints the suggestions popup. Should be called when the suggestions - // have changed. Note that this should only be called when the suggestions + // Repaints the AutoFill popup. Should be called when the suggestions + // have changed. Note that this should only be called when the AutoFill // popup is showing. - void refreshSuggestionsPopup(); + void refreshAutoFillPopup(); // Returns true if the view was scrolled. bool scrollViewWithKeyboard(int keyCode, int modifiers); @@ -473,32 +455,18 @@ private: // current drop target in this WebView (the drop target can accept the drop). WebDragOperation m_dragOperation; - // Whether a suggestions popup is currently showing. - bool m_suggestionsPopupShowing; - - // A pointer to the current suggestions popup menu client. This can be - // either an AutoFillPopupMenuClient or an AutocompletePopupMenuClient. We - // do not own this pointer. - SuggestionsPopupMenuClient* m_suggestionsPopupClient; + // Whether an AutoFill popup is currently showing. + bool m_autoFillPopupShowing; // The AutoFill popup client. OwnPtr<AutoFillPopupMenuClient> m_autoFillPopupClient; - // The Autocomplete popup client. - OwnPtr<AutocompletePopupMenuClient> m_autocompletePopupClient; - - // A pointer to the current suggestions popup. We do not own this pointer. - WebCore::PopupContainer* m_suggestionsPopup; + // The AutoFill popup. + RefPtr<WebCore::PopupContainer> m_autoFillPopup; // The popup associated with a select element. RefPtr<WebCore::PopupContainer> m_selectPopup; - // The AutoFill suggestions popup. - RefPtr<WebCore::PopupContainer> m_autoFillPopup; - - // The AutoComplete suggestions popup. - RefPtr<WebCore::PopupContainer> m_autocompletePopup; - OwnPtr<WebDevToolsAgentPrivate> m_devToolsAgent; // Whether the webview is rendering transparently. diff --git a/WebKit/chromium/src/WebWorkerBase.cpp b/WebKit/chromium/src/WebWorkerBase.cpp index 244cceb..0ad0ccd 100644 --- a/WebKit/chromium/src/WebWorkerBase.cpp +++ b/WebKit/chromium/src/WebWorkerBase.cpp @@ -165,7 +165,7 @@ void WebWorkerBase::initializeLoader(const WebURL& url) // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. ASSERT(!m_webView); - m_webView = WebView::create(0); + m_webView = WebView::create(0, 0); m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled()); m_webView->initializeMainFrame(this); diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js index baddb7d..25d1903 100644 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ b/WebKit/chromium/src/js/DebuggerScript.js @@ -93,22 +93,19 @@ DebuggerScript._formatScript = function(script) DebuggerScript.setBreakpoint = function(execState, args) { args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber); - var key = args.scriptId + ":" + args.lineNumber; - var breakId = DebuggerScript._breakpoints[key]; - if (breakId) { - if (args.enabled) - Debug.enableScriptBreakPoint(breakId); - else - Debug.disableScriptBreakPoint(breakId); - Debug.changeScriptBreakPointCondition(breakId, args.condition); - return breakId; - } - - breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition); - DebuggerScript._breakpoints[key] = breakId; + var breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition); if (!args.enabled) Debug.disableScriptBreakPoint(breakId); - return breakId; + + var actualLineNumber = args.lineNumber; // TODO: replace with real stuff after v8 roll. + + var key = args.scriptId + ":" + actualLineNumber; + if (key in DebuggerScript._breakpoints) { + // Remove old breakpoint. + Debug.findBreakPoint(DebuggerScript._breakpoints[key], true); + } + DebuggerScript._breakpoints[key] = breakId; + return DebuggerScript._v8ToWebkitLineNumber(actualLineNumber); } DebuggerScript.removeBreakpoint = function(execState, args) @@ -240,6 +237,9 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) var scopeObject = {}; for (var j = 0; j < properties.length; j++) scopeObject[properties[j].name()] = properties[j].value_; + // Reset scope object prototype to null so that the proto properties + // don't appear in th local scope section. + scopeObject.__proto__ = null; scopeType.push(scopeMirror.scopeType()); scopeChain.push(scopeObject); } diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js index 806bf6a..bab73a9 100644 --- a/WebKit/chromium/src/js/DevToolsHostStub.js +++ b/WebKit/chromium/src/js/DevToolsHostStub.js @@ -37,5 +37,8 @@ if (!window["RemoteDebuggerAgent"]) { window["RemoteDebuggerAgent"] = { setDebuggerScriptSource: function() {} }; window["RemoteDebuggerCommandExecutor"] = {}; window["RemoteProfilerAgent"] = {}; - window["RemoteToolsAgent"] = { dispatchOnInjectedScript: function() {} }; + window["RemoteToolsAgent"] = { + dispatchOnInjectedScript: function() {}, + dispatchOnInspectorController: function() {} + }; } diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index 893bc56..cd4d9fb 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -1610,7 +1610,21 @@ TestSuite.prototype.testDebugIntrinsicProperties = function() if (window.v8ScriptDebugServerEnabled) { var scopeExpectations = [ "a", "Child", [ - "constructor", "function Child(n) {", null, + "__proto__", "Child", [ + "__proto__", "Parent", [ + "__proto__", "Object", null, + "constructor", "function Parent(n) {", [ + "name", '"Parent"', null, + "prototype", 'Parent', [ + "parentProtoField", "11", null, + ] + ], + "parentProtoField", "11", null, + ], + "constructor", "function Child(n) {", null, + "childProtoField", "21", null, + ], + "parentField", "10", null, "childField", "20", null, ] @@ -1655,7 +1669,7 @@ TestSuite.prototype.testDebugIntrinsicProperties = function() var propQueue = []; var index = 0; - var expectedFinalIndex = (window.v8ScriptDebugServerEnabled ? 1 : 8); + var expectedFinalIndex = (window.v8ScriptDebugServerEnabled ? 5 : 8); function expandAndCheckNextProperty() { if (index === propQueue.length) { diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp index 2756f9d..9a45dc2 100644 --- a/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/WebKit/chromium/tests/PopupMenuTest.cpp @@ -122,12 +122,14 @@ public: virtual bool handleInputEvent(const WebInputEvent&) { return true; } virtual void mouseCaptureLost() { } virtual void setFocus(bool) { } - virtual bool handleCompositionEvent(WebCompositionCommand command, - int cursorPosition, - int targetStart, - int targetEnd, - const WebString& text) { return true; } - virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) { return true; } + virtual bool setComposition( + const WebString& text, + const WebVector<WebCompositionUnderline>& underlines, + int selectionStart, + int selectionEnd) { return true; } + virtual bool confirmComposition() { return true; } + virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; } + virtual WebRect caretOrSelectionBounds() { return WebRect(); } virtual void setTextDirection(WebTextDirection) { } }; @@ -167,7 +169,7 @@ public: protected: virtual void SetUp() { - m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient)); + m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient, 0)); m_webView->initializeMainFrame(&m_webFrameClient); m_popupMenu = PopupMenu::create(&m_popupMenuClient); } diff --git a/WebKit/efl/EWebLauncher/main.c b/WebKit/efl/EWebLauncher/main.c index d36c807..6d484e4a 100644 --- a/WebKit/efl/EWebLauncher/main.c +++ b/WebKit/efl/EWebLauncher/main.c @@ -638,7 +638,7 @@ closeWindow(Ecore_Evas *ee) free(app); } -static int +static Eina_Bool main_signal_exit(void *data, int ev_type, void *ev) { ELauncher *app; @@ -649,7 +649,7 @@ main_signal_exit(void *data, int ev_type, void *ev) } if (!eina_list_count(windows)) ecore_main_loop_quit(); - return 1; + return EINA_TRUE; } static char * diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp index 8ec65b9..5fef33e 100644 --- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp @@ -49,9 +49,9 @@ #include "PlatformString.h" #include "WindowFeatures.h" #include "ewk_private.h" -#include <wtf/text/CString.h> - +#include <Ecore_Evas.h> #include <Evas.h> +#include <wtf/text/CString.h> using namespace WebCore; @@ -87,13 +87,28 @@ void ChromeClientEfl::focusedNodeChanged(Node*) FloatRect ChromeClientEfl::windowRect() { - notImplemented(); - return FloatRect(); + Ecore_Evas* ee = 0; + int x, y, w, h; + + if (!m_view) + return FloatRect(); + + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view)); + ecore_evas_geometry_get(ee, &x, &y, &w, &h); + return FloatRect(x, y, w, h); } void ChromeClientEfl::setWindowRect(const FloatRect& rect) { - notImplemented(); + Ecore_Evas* ee = 0; + IntRect intrect = IntRect(rect); + + if (!m_view) + return; + + ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view)); + ecore_evas_move(ee, intrect.x(), intrect.y()); + ecore_evas_resize(ee, intrect.width(), intrect.height()); } FloatRect ChromeClientEfl::pageRect() diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index 438d6a0..50356e9 100644 --- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -749,9 +749,16 @@ void FrameLoaderClientEfl::dispatchDidFailLoad(const ResourceError& err) m_loadError.failingURL().utf8().data()); } -void FrameLoaderClientEfl::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) +void FrameLoaderClientEfl::download(ResourceHandle*, const ResourceRequest& request, const ResourceRequest&, const ResourceResponse&) { - notImplemented(); + if (!m_view) + return; + + CString url = request.url().prettyURL().utf8(); + Ewk_Download download; + + download.url = url.data(); + ewk_view_download_request(m_view, &download); } // copied from WebKit/Misc/WebKitErrors[Private].h diff --git a/WebKit/efl/ewk/ewk_frame.cpp b/WebKit/efl/ewk/ewk_frame.cpp index 6cbcefe..ec56221 100644 --- a/WebKit/efl/ewk/ewk_frame.cpp +++ b/WebKit/efl/ewk/ewk_frame.cpp @@ -43,6 +43,7 @@ #include "ScriptValue.h" #include "SharedBuffer.h" #include "SubstituteData.h" +#include "ZoomMode.h" #include "WindowsKeyboardCodes.h" #include "ewk_private.h" #include <wtf/text/CString.h> @@ -68,7 +69,7 @@ struct Ewk_Frame_Smart_Data { struct { Evas_Coord w, h; } contents_size; - Eina_Bool zoom_text_only:1; + WebCore::ZoomMode zoom_mode; Eina_Bool editable:1; }; @@ -989,15 +990,10 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); - WebCore::ZoomMode zoomMode; - if (sd->zoom_text_only) - zoomMode = WebCore::ZoomTextOnly; - else - zoomMode = WebCore::ZoomPage; WebCore::FrameView* view = sd->frame->view(); if (!view) return EINA_FALSE; - view->setZoomFactor(zoom, zoomMode); + view->setZoomFactor(zoom, sd->zoom_mode); return EINA_TRUE; } @@ -1011,7 +1007,7 @@ Eina_Bool ewk_frame_zoom_set(Evas_Object* o, float zoom) Eina_Bool ewk_frame_zoom_text_only_get(const Evas_Object* o) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); - return sd->zoom_text_only; + return sd->zoom_mode == WebCore::ZoomTextOnly; } /** @@ -1026,20 +1022,15 @@ Eina_Bool ewk_frame_zoom_text_only_set(Evas_Object* o, Eina_Bool setting) { EWK_FRAME_SD_GET_OR_RETURN(o, sd, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(sd->frame, EINA_FALSE); - setting = !!setting; - if (sd->zoom_text_only == setting) + WebCore::ZoomMode zm = setting ? WebCore::ZoomTextOnly : WebCore::ZoomPage; + if (sd->zoom_mode == zm) return EINA_TRUE; - sd->zoom_text_only = setting; - WebCore::ZoomMode zoomMode; - if (sd->zoom_text_only) - zoomMode = WebCore::ZoomTextOnly; - else - zoomMode = WebCore::ZoomPage; + sd->zoom_mode = zm; WebCore::FrameView* view = sd->frame->view(); if (!view) return EINA_FALSE; - view->setZoomFactor(view->zoomFactor(), zoomMode); + view->setZoomFactor(view->zoomFactor(), sd->zoom_mode); return EINA_TRUE; } diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h index facd6aa..83eef91 100644 --- a/WebKit/efl/ewk/ewk_private.h +++ b/WebKit/efl/ewk/ewk_private.h @@ -96,6 +96,8 @@ WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Obj void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect); +void ewk_view_download_request(Evas_Object *o, Ewk_Download *download); + Ewk_History *ewk_history_new(WebCore::BackForwardList *history); void ewk_history_free(Ewk_History *history); diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp index 8d66734..ca26f64 100644 --- a/WebKit/efl/ewk/ewk_view.cpp +++ b/WebKit/efl/ewk/ewk_view.cpp @@ -880,7 +880,7 @@ static float _ewk_view_zoom_animated_current(Ewk_View_Private_Data* priv) + priv->animated_zoom.zoom.start); } -static int _ewk_view_zoom_animator_cb(void* data) +static Eina_Bool _ewk_view_zoom_animator_cb(void* data) { Ewk_View_Smart_Data* sd = (Ewk_View_Smart_Data*)data; Evas_Coord cx, cy; @@ -900,12 +900,12 @@ static int _ewk_view_zoom_animator_cb(void* data) || (now < priv->animated_zoom.time.start)) { _ewk_view_zoom_animated_finish(sd); ewk_view_zoom_set(sd->self, priv->animated_zoom.zoom.end, cx, cy); - return 0; + return EINA_FALSE; } sd->animated_zoom.zoom.current = _ewk_view_zoom_animated_current(priv); sd->api->zoom_weak_set(sd, sd->animated_zoom.zoom.current, cx, cy); - return 1; + return EINA_TRUE; } static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* sd) diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog index e13e9ce..a33506c 100644 --- a/WebKit/gtk/ChangeLog +++ b/WebKit/gtk/ChangeLog @@ -1,3 +1,245 @@ +2010-06-23 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] Separate DerivedSources per-project + https://bugs.webkit.org/show_bug.cgi?id=41109 + + Separate WebKitGTK+ DerivedSources into per-project subdirectories to prepare + for properly building WebKit2. + + * webkitmarshal.list: Touch this file to force a rebuild of the marshaling code. + +2010-07-01 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Stop using GdkRegion in 3.x mode + https://bugs.webkit.org/show_bug.cgi?id=41463 + + Make us compile without using GdkRegion, since it's gone from GTK+ + 3.x. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::scroll): + * webkit/webkitwebview.cpp: + (webkit_web_view_expose_event): + +2010-07-01 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Convert WebKitWebView's private draggingDataObjects member to a pointer + https://bugs.webkit.org/show_bug.cgi?id=40333 + + Convert draggingDataObjects to a pointer. The constructor and destructor of the + HashMap should be called explicitly. GObject memory allocation does not do this. + + * WebCoreSupport/DragClientGtk.cpp: + (WebKit::DragClient::startDrag): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_dispose): + (webkit_web_view_drag_end): + (webkit_web_view_drag_data_get): + (webkit_web_view_init): + +2010-06-30 Martin Robinson <mrobinson@igalia.com> + + Unreviewed, rolling out r62226. + http://trac.webkit.org/changeset/62226 + https://bugs.webkit.org/show_bug.cgi?id=40333 + + This change caused 13 new crashers. + + * WebCoreSupport/DragClientGtk.cpp: + (WebKit::DragClient::startDrag): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_dispose): + (webkit_web_view_drag_end): + (webkit_web_view_drag_data_get): + (webkit_web_view_init): + +2010-06-30 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Convert WebKitWebView's private draggingDataObjects member to a pointer + https://bugs.webkit.org/show_bug.cgi?id=40333 + + Convert draggingDataObjects to a pointer. The constructor and destructor of the + HashMap should be called explicitly. GObject memory allocation does not do this. + + * WebCoreSupport/DragClientGtk.cpp: + (WebKit::DragClient::startDrag): + * webkit/webkitprivate.h: + * webkit/webkitwebview.cpp: + (webkit_web_view_dispose): + (webkit_web_view_drag_end): + (webkit_web_view_drag_data_get): + (webkit_web_view_init): + +2010-06-30 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Unit test for DOM insertion methods + https://bugs.webkit.org/show_bug.cgi?id=40495 + + Add unit test for webkit_dom_node_remove_child. + + * tests/testdomnode.c: + (test_dom_node_insertion): + +2010-06-30 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Unit test for DOM insertion methods + https://bugs.webkit.org/show_bug.cgi?id=40495 + + Add unit tests for node insertion and replacement methods. + + * tests/testdomnode.c: + (test_dom_node_insertion): + (main): + +2010-06-30 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Random failure on 'testdownload' unit test + https://bugs.webkit.org/show_bug.cgi?id=38256 + + Make sure the set_filename function is called after handling the + 'download-requested' signal for the asynchronous test. This change + is needed because it could happen, with the current code, that the + set_filename () function got called too early in the mainloop, + therefore screwing the tests because the 'theDownload' global + variable wouldn't be properly set yet. + + With this modification we ensure the set_filename() function gets + called always after handling the download-requested signal, + therefore avoiding potentialproblems. + + * tests/testdownload.c: + (set_filename): + (handle_download_requested_cb): + (download_requested_cb): + (download_requested_asynch_cb): + (test_webkit_download_perform): + +2010-06-30 José Millán Soto <jmillan@igalia.com> + + Reviewed by Xan Lopez. + + [Gtk] Text attributes not exposed + https://bugs.webkit.org/show_bug.cgi?id=25528 + + Added new tests for accessible text attributes + + * tests/testatk.c: + (compAtkAttribute): + (compAtkAttributeName): + (atkAttributeSetAttributeHasValue): + (atkAttributeSetAreEqual): + (testWebkitAtkTextAttributes): + (main): + +2010-06-28 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + Update for 1.3.2. + + * NEWS: + +2010-06-28 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Does not compile with -DGSEAL_ENABLE + https://bugs.webkit.org/show_bug.cgi?id=37851 + + Fix build with GSEAL enabled. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::transitionToCommittedForNewPage): + * webkit/webkitsoupauthdialog.c: + (show_auth_dialog): + +2010-06-28 Xan Lopez <xlopez@igalia.com> + + Reviewed by Gustavo Noronha. + + [GTK] Add support for GTK+3 + https://bugs.webkit.org/show_bug.cgi?id=41253 + + Adapt build system to 3.x support, allow the JSCore gir and webkit + pc files to be configurable at build time for different API + versions. + + * JSCore-1.0.gir: Removed. + * JSCore.gir.in: Added. + * docs/GNUmakefile.am: + * webkit.pc.in: + +2010-06-25 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Xan Lopez. + + [Gtk] Implement atk_table_get_column_header + https://bugs.webkit.org/show_bug.cgi?id=30896 + + Replace g_timeout_add() with g_idle_add(). + + * tests/testatk.c: + (test_webkit_atk_get_text_at_offset_forms): + (test_webkit_atk_get_text_at_offset): + (test_webkit_atk_get_text_at_offset_newlines): + (test_webkit_atk_get_text_at_offset_textarea): + (test_webkit_atk_get_text_at_offset_text_input): + (testWebkitAtkGetTextInParagraphAndBodySimple): + (testWebkitAtkGetTextInParagraphAndBodyModerate): + (testWebkitAtkGetTextInTable): + (testWebkitAtkGetHeadersInTable): + +2010-06-25 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Xan Lopez. + + [Gtk] Implement atk_table_get_column_header + https://bugs.webkit.org/show_bug.cgi?id=30896 + + Added new test to check whether the implementation of + get_column_headers() and get_row_headers() works ok. + + * tests/testatk.c: + (testWebkitAtkGetHeadersInTable): + (main): + +2010-06-25 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [GTK] Pasteboard code does not take into account the nil character when getting and setting markup/netscape-url data + https://bugs.webkit.org/show_bug.cgi?id=41221 + + Add a test for this issue which simulates a paste keyboard event into an editable + body. The pasteboard should contain a markup portion containing a null terminator. + + * tests/testcopyandpaste.c: + (test_info_new): + (test_info_destroy): + (load_status_cb): + (runPasteTestCallback): + (window_object_cleared_callback): + (pasting_test_get_data_callback): + (pasting_test_clear_data_callback): + (test_pasting_markup): + (main): + 2010-06-24 Martin Robinson <mrobinson@igalia.com> Reviewed by Xan Lopez. diff --git a/WebKit/gtk/JSCore-1.0.gir b/WebKit/gtk/JSCore.gir.in index 2fb4d46..e979c33 100644 --- a/WebKit/gtk/JSCore-1.0.gir +++ b/WebKit/gtk/JSCore.gir.in @@ -1,8 +1,8 @@ <?xml version="1.0"?> -<repository version="1.0" +<repository version="1.1" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0"> - <namespace name="JSCore" version="1.0" shared-library="webkit-1.0"> + <namespace name="JSCore" version="@WEBKITGTK_API_VERSION@" shared-library="webkitgtk-@WEBKITGTK_API_VERSION@"> <alias name="GlobalContextRef" target="none" c:type="JSGlobalContextRef"/> diff --git a/WebKit/gtk/NEWS b/WebKit/gtk/NEWS index fc87b35..eb6d8cc 100644 --- a/WebKit/gtk/NEWS +++ b/WebKit/gtk/NEWS @@ -1,4 +1,31 @@ ================ +WebKitGTK+ 1.3.2 +================ + +What's new in WebKitGTK+ 1.3.2? + +*** This release is an ABI break *** + +The library has been renamed to libwebkitgtk, so you'll need to +recompile your applications when upgrading to 1.3.2. + + - Add support for GTK+ 3.x. A new configure flag, --with-gtk, has + been added, which allows to control which GTK+ version you want to + build against. The default value is '2.0', for GTK+ 2.x + support. With '3.0' the library will be compiled against GTK+ 3.x + (2.90.4 or newer required). In the 3.x mode the .pc file has been + renamed from webkit-X.X.pc to webkitgtk-X.X.pc, so you'll need to + update your autotools setup accordingly. + - Many fixes for the DOM bindings, including support to dispatch + events to any Node through webkit_event_target_dispatch_event. + - Added a 'inner-node' property to WebKitHitTestResult, carrying the + DOM node where the hit test happened. + - Many DnD fixes, including a fix for the infamous hang-of-death + while dragging the mouse. + - Support for <input type="range">. + - Many other bugfixes. + +================ WebKitGTK+ 1.3.1 ================ diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index fe5d9eb..bb469c5 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -372,6 +372,7 @@ void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, con sourceRect.x -= delta.width(); sourceRect.y -= delta.height(); +#ifdef GTK_API_VERSION_2 GdkRegion* invalidRegion = gdk_region_rectangle(&area); if (gdk_rectangle_intersect(&area, &sourceRect, &moveRect)) { @@ -384,6 +385,21 @@ void ChromeClient::scroll(const IntSize& delta, const IntRect& rectToScroll, con gdk_window_invalidate_region(window, invalidRegion, FALSE); gdk_region_destroy(invalidRegion); +#else + cairo_region_t* invalidRegion = cairo_region_create_rectangle(&area); + + if (gdk_rectangle_intersect(&area, &sourceRect, &moveRect)) { + cairo_region_t* moveRegion = cairo_region_create_rectangle(&moveRect); + gdk_window_move_region(window, moveRegion, delta.width(), delta.height()); + cairo_region_translate(moveRegion, delta.width(), delta.height()); + cairo_region_subtract(invalidRegion, moveRegion); + cairo_region_destroy(moveRegion); + } + + gdk_window_invalidate_region(window, invalidRegion, FALSE); + cairo_region_destroy(invalidRegion); +#endif + } // FIXME: this does not take into account the WM decorations diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp index 4bcc4c2..efce3dc 100644 --- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp @@ -77,7 +77,7 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin, GOwnPtr<GdkEvent> currentEvent(gtk_get_current_event()); GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get()); - webView->priv->draggingDataObjects.set(context, dataObject); + webView->priv->draggingDataObjects->set(context, dataObject); // A drag starting should prevent a double-click from happening. This might // happen if a drag is followed very quickly by another click (like in the DRT). diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index 17a3cd5..340b789 100644 --- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -1164,8 +1164,13 @@ void FrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cached void FrameLoaderClient::transitionToCommittedForNewPage() { WebKitWebView* containingWindow = getViewFromFrame(m_frame); - IntSize size = IntSize(GTK_WIDGET(containingWindow)->allocation.width, - GTK_WIDGET(containingWindow)->allocation.height); + GtkAllocation allocation; +#if GTK_CHECK_VERSION(2, 18, 0) + gtk_widget_get_allocation(GTK_WIDGET(containingWindow), &allocation); +#else + allocation = GTK_WIDGET(containingWindow)->allocation; +#endif + IntSize size = IntSize(allocation.width, allocation.height); bool transparent = webkit_web_view_get_transparent(containingWindow); Color backgroundColor = transparent ? WebCore::Color::transparent : WebCore::Color::white; Frame* frame = core(m_frame); diff --git a/WebKit/gtk/docs/GNUmakefile.am b/WebKit/gtk/docs/GNUmakefile.am index 968b7f6..105e277 100644 --- a/WebKit/gtk/docs/GNUmakefile.am +++ b/WebKit/gtk/docs/GNUmakefile.am @@ -84,7 +84,7 @@ INCLUDES= \ $(GTK_CFLAGS) \ $(LIBSOUP_CFLAGS) GTKDOC_LIBS= \ - $(top_builddir)/libwebkit-1.0.la \ + $(top_builddir)/libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \ $(GLIB_LIBS) \ $(GTK_LIBS) \ $(LIBSOUP_LIBS) diff --git a/WebKit/gtk/tests/testatk.c b/WebKit/gtk/tests/testatk.c index 1f1ab0c..8f13a95 100644 --- a/WebKit/gtk/tests/testatk.c +++ b/WebKit/gtk/tests/testatk.c @@ -40,6 +40,10 @@ static const char* contentsInParagraphAndBodyModerate = "<html><body><p>This is static const char* contentsInTable = "<html><body><table><tr><td>foo</td><td>bar</td></tr></table></body></html>"; +static const char* contentsInTableWithHeaders = "<html><body><table><tr><th>foo</th><th>bar</th><th colspan='2'>baz</th></tr><tr><th>qux</th><td>1</td><td>2</td><td>3</td></tr><tr><th rowspan='2'>quux</th><td>4</td><td>5</td><td>6</td></tr><tr><td>6</td><td>7</td><td>8</td></tr><tr><th>corge</th><td>9</td><td>10</td><td>11</td></tr></table><table><tr><td>1</td><td>2</td></tr><tr><td>3</td><td>4</td></tr></table></body></html>"; + +static const char* textWithAttributes = "<html><head><style>.st1 {font-family: monospace; color:rgb(120,121,122);} .st2 {text-decoration:underline; background-color:rgb(80,81,82);}</style></head><body><p style=\"font-size:14; text-align:right;\">This is the <i>first</i><b> sentence of this text.</b></p><p class=\"st1\">This sentence should have an style applied <span class=\"st2\">and this part should have another one</span>.</p><p>x<sub>1</sub><sup>2</sup>=x<sub>2</sub><sup>3</sup></p><p style=\"text-align:center;\">This sentence is the <strike>last</strike> one.</p></body></html>"; + static gboolean bail_out(GMainLoop* loop) { if (g_main_loop_is_running(loop)) @@ -219,7 +223,7 @@ static void test_webkit_atk_get_text_at_offset_forms(void) webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -250,7 +254,7 @@ static void test_webkit_atk_get_text_at_offset(void) webkit_web_view_load_string(webView, contents, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -281,7 +285,7 @@ static void test_webkit_atk_get_text_at_offset_newlines(void) webkit_web_view_load_string(webView, contentsWithNewlines, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -312,7 +316,7 @@ static void test_webkit_atk_get_text_at_offset_textarea(void) webkit_web_view_load_string(webView, contentsInTextarea, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -345,7 +349,7 @@ static void test_webkit_atk_get_text_at_offset_text_input(void) webkit_web_view_load_string(webView, contentsInTextInput, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -381,7 +385,7 @@ static void testWebkitAtkGetTextInParagraphAndBodySimple(void) webkit_web_view_load_string(webView, contentsInParagraphAndBodySimple, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -425,7 +429,7 @@ static void testWebkitAtkGetTextInParagraphAndBodyModerate(void) webkit_web_view_load_string(webView, contentsInParagraphAndBodyModerate, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); /* Get to the inner AtkText object */ @@ -465,7 +469,7 @@ static void testWebkitAtkGetTextInTable(void) webkit_web_view_load_string(webView, contentsInTable, NULL, NULL, NULL); loop = g_main_loop_new(NULL, TRUE); - g_timeout_add(100, (GSourceFunc)bail_out, loop); + g_idle_add((GSourceFunc)bail_out, loop); g_main_loop_run(loop); obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); @@ -480,6 +484,260 @@ static void testWebkitAtkGetTextInTable(void) g_object_unref(webView); } +static void testWebkitAtkGetHeadersInTable(void) +{ + WebKitWebView* webView; + AtkObject* axWebView; + AtkObject* table; + AtkObject* colHeader; + AtkObject* rowHeader; + GMainLoop* loop; + + webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation alloc = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + webkit_web_view_load_string(webView, contentsInTableWithHeaders, NULL, NULL, NULL); + loop = g_main_loop_new(NULL, TRUE); + + g_idle_add((GSourceFunc)bail_out, loop); + g_main_loop_run(loop); + + axWebView = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(axWebView); + + // Check table with both column and row headers + table = atk_object_ref_accessible_child(axWebView, 0); + g_assert(table); + g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); + g_assert(colHeader); + g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(colHeader) == 0); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 1); + g_assert(colHeader); + g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(colHeader) == 1); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 2); + g_assert(colHeader); + g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(colHeader) == 2); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 3); + g_assert(colHeader); + g_assert(atk_object_get_role(colHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(colHeader) == 2); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); + g_assert(rowHeader); + g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(rowHeader) == 0); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 1); + g_assert(rowHeader); + g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(rowHeader) == 3); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 2); + g_assert(rowHeader); + g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(rowHeader) == 7); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 3); + g_assert(rowHeader); + g_assert(atk_object_get_role(rowHeader) == ATK_ROLE_TABLE_CELL); + g_assert(atk_object_get_index_in_parent(rowHeader) == 7); + + g_object_unref(table); + + // Check table with no headers at all + table = atk_object_ref_accessible_child(axWebView, 1); + g_assert(table); + g_assert(atk_object_get_role(table) == ATK_ROLE_TABLE); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 0); + g_assert(colHeader == 0); + + colHeader = atk_table_get_column_header(ATK_TABLE(table), 1); + g_assert(colHeader == 0); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 0); + g_assert(rowHeader == 0); + + rowHeader = atk_table_get_row_header(ATK_TABLE(table), 1); + g_assert(rowHeader == 0); + + g_object_unref(table); + g_object_unref(webView); +} + +static gint compAtkAttribute(AtkAttribute* a1, AtkAttribute* a2) +{ + gint strcmpVal; + strcmpVal = g_strcmp0(a1->name, a2->name); + if (strcmpVal) + return strcmpVal; + return g_strcmp0(a1->value, a2->value); +} + +static gint compAtkAttributeName(AtkAttribute* a1, AtkAttribute* a2) +{ + return g_strcmp0(a1->name, a2->name); +} + +static gboolean atkAttributeSetAttributeHasValue(AtkAttributeSet* set, AtkTextAttribute attribute, const gchar* value) +{ + GSList *element; + AtkAttribute at; + gboolean result; + at.name = (gchar *)atk_text_attribute_get_name(attribute); + element = g_slist_find_custom(set, &at, (GCompareFunc)compAtkAttributeName); + result = element && !g_strcmp0(((AtkAttribute*)(element->data))->value, value); + return result; +} + +static gboolean atkAttributeSetAreEqual(AtkAttributeSet* set1, AtkAttributeSet* set2) +{ + if (!set1) + return !set2; + + set1 = g_slist_sort(set1, (GCompareFunc)compAtkAttribute); + set2 = g_slist_sort(set2, (GCompareFunc)compAtkAttribute); + + while (set1) { + if (!set2 || compAtkAttribute(set1->data, set2->data)) + return FALSE; + + set1 = set1->next; + set2 = set2->next; + } + + return (!set2); +} + +static void testWebkitAtkTextAttributes(void) +{ + WebKitWebView* webView; + AtkObject* obj; + AtkObject* child; + GMainLoop* loop; + AtkText* childText; + AtkAttributeSet* set1; + AtkAttributeSet* set2; + AtkAttributeSet* set3; + AtkAttributeSet* set4; + gint startOffset, endOffset; + + webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation alloc = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &alloc); + + webkit_web_view_load_string(webView, textWithAttributes, NULL, NULL, NULL); + loop = g_main_loop_new(NULL, TRUE); + + g_idle_add((GSourceFunc)bail_out, loop); + g_main_loop_run(loop); + + obj = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(obj); + + child = atk_object_ref_accessible_child(obj, 0); + g_assert(child && ATK_IS_TEXT(child)); + childText = ATK_TEXT(child); + set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 0); + g_assert_cmpint(endOffset, ==, 12); + g_assert(atkAttributeSetAreEqual(set1, NULL)); + + set2 = atk_text_get_run_attributes(childText, 15, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 12); + g_assert_cmpint(endOffset, ==, 17); + g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_STYLE, "italic")); + + set3 = atk_text_get_run_attributes(childText, 17, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 17); + g_assert_cmpint(endOffset, ==, 40); + g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_WEIGHT, "700")); + + set4 = atk_text_get_default_attributes(childText); + g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_STYLE, "normal")); + g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_JUSTIFICATION, "right")); + g_assert(atkAttributeSetAttributeHasValue(set4, ATK_TEXT_ATTR_SIZE, "14")); + atk_attribute_set_free(set1); + atk_attribute_set_free(set2); + atk_attribute_set_free(set3); + atk_attribute_set_free(set4); + + child = atk_object_ref_accessible_child(obj, 1); + g_assert(child && ATK_IS_TEXT(child)); + childText = ATK_TEXT(child); + + set1 = atk_text_get_default_attributes(childText); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_FAMILY_NAME, "monospace")); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_STYLE, "normal")); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_STRIKETHROUGH, "false")); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_WEIGHT, "400")); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_FG_COLOR, "120,121,122")); + + set2 = atk_text_get_run_attributes(childText, 43, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 43); + g_assert_cmpint(endOffset, ==, 80); + // Checks that default attributes of text are not returned when called to atk_text_get_run_attributes + g_assert(!atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_FG_COLOR, "120,121,122")); + g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_UNDERLINE, "single")); + g_assert(atkAttributeSetAttributeHasValue(set2, ATK_TEXT_ATTR_BG_COLOR, "80,81,82")); + atk_attribute_set_free(set1); + atk_attribute_set_free(set2); + + child = atk_object_ref_accessible_child(obj, 2); + g_assert(child && ATK_IS_TEXT(child)); + childText = ATK_TEXT(child); + + set1 = atk_text_get_run_attributes(childText, 0, &startOffset, &endOffset); + set2 = atk_text_get_run_attributes(childText, 3, &startOffset, &endOffset); + g_assert(atkAttributeSetAreEqual(set1, set2)); + atk_attribute_set_free(set2); + + set2 = atk_text_get_run_attributes(childText, 1, &startOffset, &endOffset); + set3 = atk_text_get_run_attributes(childText, 5, &startOffset, &endOffset); + g_assert(atkAttributeSetAreEqual(set2, set3)); + g_assert(!atkAttributeSetAreEqual(set1, set2)); + atk_attribute_set_free(set3); + + set3 = atk_text_get_run_attributes(childText, 2, &startOffset, &endOffset); + set4 = atk_text_get_run_attributes(childText, 6, &startOffset, &endOffset); + g_assert(atkAttributeSetAreEqual(set3, set4)); + g_assert(!atkAttributeSetAreEqual(set1, set3)); + g_assert(!atkAttributeSetAreEqual(set2, set3)); + atk_attribute_set_free(set1); + atk_attribute_set_free(set2); + atk_attribute_set_free(set3); + atk_attribute_set_free(set4); + + child = atk_object_ref_accessible_child(obj, 3); + g_assert(child && ATK_IS_TEXT(child)); + childText = ATK_TEXT(child); + set1 = atk_text_get_run_attributes(childText, 24, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 21); + g_assert_cmpint(endOffset, ==, 25); + g_assert(atkAttributeSetAttributeHasValue(set1, ATK_TEXT_ATTR_STRIKETHROUGH, "true")); + + set2 = atk_text_get_run_attributes(childText, 25, &startOffset, &endOffset); + g_assert_cmpint(startOffset, ==, 25); + g_assert_cmpint(endOffset, ==, 30); + g_assert(atkAttributeSetAreEqual(set2, NULL)); + + set3 = atk_text_get_default_attributes(childText); + g_assert(atkAttributeSetAttributeHasValue(set3, ATK_TEXT_ATTR_JUSTIFICATION, "center")); + atk_attribute_set_free(set1); + atk_attribute_set_free(set2); + atk_attribute_set_free(set3); +} + int main(int argc, char** argv) { g_thread_init(NULL); @@ -494,6 +752,8 @@ int main(int argc, char** argv) g_test_add_func("/webkit/atk/getTextInParagraphAndBodySimple", testWebkitAtkGetTextInParagraphAndBodySimple); g_test_add_func("/webkit/atk/getTextInParagraphAndBodyModerate", testWebkitAtkGetTextInParagraphAndBodyModerate); g_test_add_func("/webkit/atk/getTextInTable", testWebkitAtkGetTextInTable); + g_test_add_func("/webkit/atk/getHeadersInTable", testWebkitAtkGetHeadersInTable); + g_test_add_func("/webkit/atk/textAttributes", testWebkitAtkTextAttributes); return g_test_run (); } diff --git a/WebKit/gtk/tests/testcopyandpaste.c b/WebKit/gtk/tests/testcopyandpaste.c index 034a429..0ef91d1 100644 --- a/WebKit/gtk/tests/testcopyandpaste.c +++ b/WebKit/gtk/tests/testcopyandpaste.c @@ -30,7 +30,7 @@ typedef struct { char* page; - char* expectedPlainText; + char* expectedContent; } TestInfo; typedef struct { @@ -41,13 +41,13 @@ typedef struct { } CopyAndPasteFixture; TestInfo* -test_info_new(const char* page, const char* expectedPlainText) +test_info_new(const char* page, const char* expectedContent) { TestInfo* info; info = g_slice_new0(TestInfo); info->page = g_strdup(page); - if (expectedPlainText) - info->expectedPlainText = g_strdup(expectedPlainText); + if (expectedContent) + info->expectedContent = g_strdup(expectedContent); return info; } @@ -55,7 +55,7 @@ void test_info_destroy(TestInfo* info) { g_free(info->page); - g_free(info->expectedPlainText); + g_free(info->expectedContent); g_slice_free(TestInfo, info); } @@ -89,8 +89,8 @@ static void load_status_cb(WebKitWebView* webView, GParamSpec* spec, gpointer da 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_assert(text || !fixture->info->expectedContent); + g_assert(!text || !strcmp(text, fixture->info->expectedContent)); g_free(text); g_assert(!gtk_clipboard_wait_is_uris_available(clipboard)); @@ -124,6 +124,92 @@ static void test_copy_and_paste(CopyAndPasteFixture* fixture, gconstpointer data g_main_loop_run(fixture->loop); } +static CopyAndPasteFixture* currentFixture; +static JSValueRef runPasteTestCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) +{ + // Simulate a paste keyboard sequence. + GdkEvent event; + memset(&event, 0, sizeof(event)); + event.key.keyval = gdk_unicode_to_keyval('v'); + event.key.state = GDK_CONTROL_MASK; + event.key.window = gtk_widget_get_window(GTK_WIDGET(currentFixture->webView)); + GdkKeymapKey* keys; + gint n_keys; + if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), event.key.keyval, &keys, &n_keys)) { + event.key.hardware_keycode = keys[0].keycode; + g_free(keys); + } + event.key.type = GDK_KEY_PRESS; + gtk_main_do_event(&event); + event.key.type = GDK_KEY_RELEASE; + gtk_main_do_event(&event); + + JSStringRef scriptString = JSStringCreateWithUTF8CString("document.body.innerHTML;"); + JSValueRef value = JSEvaluateScript(context, scriptString, 0, 0, 0, 0); + JSStringRelease(scriptString); + + g_assert(JSValueIsString(context, value)); + JSStringRef actual = JSValueToStringCopy(context, value, exception); + g_assert(!exception || !*exception); + g_assert(currentFixture->info->expectedContent); + JSStringRef expected = JSStringCreateWithUTF8CString(currentFixture->info->expectedContent); + g_assert(JSStringIsEqual(expected, actual)); + + JSStringRelease(expected); + JSStringRelease(actual); + g_main_loop_quit(currentFixture->loop); + return JSValueMakeUndefined(context); +} + +static void window_object_cleared_callback(WebKitWebView* web_view, WebKitWebFrame* web_frame, JSGlobalContextRef context, JSObjectRef window_object, gpointer data) +{ + JSStringRef name = JSStringCreateWithUTF8CString("runTest"); + JSObjectRef testComplete = JSObjectMakeFunctionWithCallback(context, name, runPasteTestCallback); + JSObjectSetProperty(context, window_object, name, testComplete, kJSPropertyAttributeNone, 0); + JSStringRelease(name); +} + +static void pasting_test_get_data_callback(GtkClipboard* clipboard, GtkSelectionData* selection_data, guint info, gpointer data) +{ + gtk_selection_data_set(selection_data, gdk_atom_intern("text/html", FALSE), 8, (const guchar*) data, strlen((char*)data) + 1); +} + +static void pasting_test_clear_data_callback(GtkClipboard* clipboard, gpointer data) +{ + g_free(data); +} + +static void test_pasting_markup(CopyAndPasteFixture* fixture, gconstpointer data) +{ + fixture->info = (TestInfo*)data; + currentFixture = fixture; + + GtkTargetList* targetList = gtk_target_list_new(0, 0); + gtk_target_list_add(targetList, gdk_atom_intern("text/html", FALSE), 0, 0); + + int numberOfTargets = 1; + GtkTargetEntry* targetTable = gtk_target_table_new_from_list(targetList, &numberOfTargets); + gtk_clipboard_set_with_data(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD), + targetTable, numberOfTargets, + pasting_test_get_data_callback, + pasting_test_clear_data_callback, + g_strdup(fixture->info->expectedContent)); + gtk_target_list_unref(targetList); + gtk_target_table_free(targetTable, numberOfTargets); + + g_signal_connect(fixture->window, "map-event", + G_CALLBACK(map_event_cb), fixture); + g_signal_connect(fixture->webView, "window-object-cleared", + G_CALLBACK(window_object_cleared_callback), fixture); + + gtk_widget_show(fixture->window); + gtk_widget_show(GTK_WIDGET(fixture->webView)); + gtk_window_present(GTK_WINDOW(fixture->window)); + + g_main_loop_run(fixture->loop); +} + + int main(int argc, char** argv) { g_thread_init(NULL); @@ -151,6 +237,15 @@ int main(int argc, char** argv) test_copy_and_paste, copy_and_paste_fixture_teardown); + const char* paste_test_html = "<html>" + "<body onLoad=\"document.body.focus(); runTest();\" contentEditable=\"true\">" + "</body></html>"; + g_test_add("/webkit/copyandpaste/paste-markup", CopyAndPasteFixture, + test_info_new(paste_test_html, "bobby"), + copy_and_paste_fixture_setup, + test_pasting_markup, + copy_and_paste_fixture_teardown); + return g_test_run(); } diff --git a/WebKit/gtk/tests/testdomnode.c b/WebKit/gtk/tests/testdomnode.c index 1050587..b253d1d 100644 --- a/WebKit/gtk/tests/testdomnode.c +++ b/WebKit/gtk/tests/testdomnode.c @@ -27,6 +27,7 @@ #if GLIB_CHECK_VERSION(2, 16, 0) && GTK_CHECK_VERSION(2, 14, 0) #define HTML_DOCUMENT_HIERARCHY_NAVIGATION "<html><head><title>This is the title</title></head><body><p>1</p><p>2</p><p>3</p></body></html>" +#define HTML_DOCUMENT_NODE_INSERTION "<html><body></body></html>" typedef struct { GtkWidget* webView; @@ -119,6 +120,53 @@ static void test_dom_node_hierarchy_navigation(DomNodeFixture* fixture, gconstpo g_assert_cmpint(i, ==, 3); } +static void test_dom_node_insertion(DomNodeFixture* fixture, gconstpointer data) +{ + WebKitDOMDocument* document; + WebKitDOMHTMLElement* body; + WebKitDOMElement* p, *div; + WebKitDOMNodeList* list; + WebKitDOMNode* node; + + document = webkit_web_view_get_dom_document(WEBKIT_WEB_VIEW(fixture->webView)); + g_assert(document); + body = webkit_dom_document_get_body(document); + g_assert(body); + g_assert(WEBKIT_DOM_IS_HTML_ELEMENT(body)); + + /* Body shouldn't have any children at this point */ + g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body)) == FALSE); + + /* Insert one P element */ + p = webkit_dom_document_create_element(document, (char*)"P", NULL); + webkit_dom_node_append_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(p), NULL); + + /* Now it should have one, the same that we inserted */ + g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); + list = webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body)); + g_assert_cmpint(webkit_dom_node_list_get_length(list), ==, 1); + node = webkit_dom_node_list_item(list, 0); + g_assert(node); + g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(p), node)); + + /* Replace the P tag with a DIV tag */ + div = webkit_dom_document_create_element(document, (char*)"DIV", NULL); + webkit_dom_node_replace_child(WEBKIT_DOM_NODE(body), WEBKIT_DOM_NODE(div), WEBKIT_DOM_NODE(p), NULL); + g_assert(webkit_dom_node_has_child_nodes(WEBKIT_DOM_NODE(body))); + list = webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body)); + g_assert_cmpint(webkit_dom_node_list_get_length(list), ==, 1); + node = webkit_dom_node_list_item(list, 0); + g_assert(node); + g_assert(webkit_dom_node_is_same_node(WEBKIT_DOM_NODE(div), node)); + + /* Now remove the tag */ + webkit_dom_node_remove_child(WEBKIT_DOM_NODE(body), node, NULL); + list = webkit_dom_node_get_child_nodes(WEBKIT_DOM_NODE(body)); + g_assert_cmpint(webkit_dom_node_list_get_length(list), ==, 0); + + /* TODO: insert_before, which does not seem to be working correctly */ +} + int main(int argc, char** argv) { if (!g_thread_supported()) @@ -134,6 +182,12 @@ int main(int argc, char** argv) test_dom_node_hierarchy_navigation, dom_node_fixture_teardown); + g_test_add("/webkit/domnode/test_insertion", + DomNodeFixture, HTML_DOCUMENT_NODE_INSERTION, + dom_node_fixture_setup, + test_dom_node_insertion, + dom_node_fixture_teardown); + return g_test_run(); } diff --git a/WebKit/gtk/tests/testdownload.c b/WebKit/gtk/tests/testdownload.c index c7985d5..f6ae865 100644 --- a/WebKit/gtk/tests/testdownload.c +++ b/WebKit/gtk/tests/testdownload.c @@ -84,40 +84,63 @@ notify_status_cb(GObject* object, GParamSpec* pspec, gpointer data) } static gboolean -download_requested_cb(WebKitWebView* web_view, - WebKitDownload* download, - gboolean* beenThere) +set_filename(gchar* filename) +{ + gchar *uri = g_filename_to_uri(filename, NULL, NULL); + + webkit_download_set_destination_uri(theDownload, uri); + g_free(uri); + + webkit_download_start(theDownload); + return FALSE; +} + +static void +handle_download_requested_cb(WebKitDownload* download, + gboolean* beenThere, + gboolean asynch) { theDownload = download; *beenThere = TRUE; + if (temporaryFilename) { - gchar *uri = g_filename_to_uri(temporaryFilename, NULL, NULL); - if (uri) - webkit_download_set_destination_uri(download, uri); - g_free(uri); + if (asynch) { + g_idle_add((GSourceFunc)set_filename, temporaryFilename); + } else { + gchar *uri = g_filename_to_uri(temporaryFilename, NULL, NULL); + if (uri) + webkit_download_set_destination_uri(download, uri); + g_free(uri); + } } g_signal_connect(download, "notify::status", G_CALLBACK(notify_status_cb), NULL); +} +static gboolean +download_requested_cb(WebKitWebView* web_view, + WebKitDownload* download, + gboolean* beenThere) +{ + handle_download_requested_cb(download, beenThere, FALSE); return TRUE; } static gboolean -set_filename(gchar* filename) +download_requested_asynch_cb(WebKitWebView* web_view, + WebKitDownload* download, + gboolean* beenThere) { - gchar *uri = g_filename_to_uri(filename, NULL, NULL); - webkit_download_set_destination_uri(theDownload, uri); - g_free(uri); - temporaryFilename = filename; - webkit_download_start(theDownload); - return FALSE; + handle_download_requested_cb(download, beenThere, TRUE); + return TRUE; } static void test_webkit_download_perform(gboolean asynch) { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + GCallback downloadRequestCallback = NULL; g_object_ref_sink(G_OBJECT(webView)); @@ -125,10 +148,14 @@ test_webkit_download_perform(gboolean asynch) G_CALLBACK(navigation_policy_decision_requested_cb), NULL); + if (asynch) + downloadRequestCallback = G_CALLBACK(download_requested_asynch_cb); + else + downloadRequestCallback = G_CALLBACK(download_requested_cb); + gboolean beenThere = FALSE; g_signal_connect(webView, "download-requested", - G_CALLBACK(download_requested_cb), - &beenThere); + downloadRequestCallback, &beenThere); /* Preparation; FIXME: we should move this code to a test * utilities file, because we have a very similar one in @@ -144,12 +171,8 @@ test_webkit_download_perform(gboolean asynch) if (g_unlink(filename) == -1) g_critical("Failed to delete the temporary file: %s.", g_strerror(errno)); - if (asynch) - g_idle_add((GSourceFunc)set_filename, filename); - else - temporaryFilename = filename; - theDownload = NULL; + temporaryFilename = filename; loop = g_main_loop_new(NULL, TRUE); webkit_web_view_load_uri(webView, "http://gnome.org/"); @@ -161,6 +184,8 @@ test_webkit_download_perform(gboolean asynch) g_unlink(temporaryFilename); g_free(temporaryFilename); + temporaryFilename = NULL; + g_main_loop_unref(loop); g_object_unref(webView); } diff --git a/WebKit/gtk/webkit.pc.in b/WebKit/gtk/webkit.pc.in index 895aa19..9bed0f3 100644 --- a/WebKit/gtk/webkit.pc.in +++ b/WebKit/gtk/webkit.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: WebKit Description: Web content engine for GTK+ Version: @VERSION@ -Requires: glib-2.0 gtk+-2.0 libsoup-2.4 -Libs: -L${libdir} -lwebkit-1.0 -Cflags: -I${includedir}/webkit-1.0 +Requires: glib-2.0 gtk+-@GTK_API_VERSION@ libsoup-2.4 +Libs: -L${libdir} -lwebkitgtk-@WEBKITGTK_API_VERSION@ +Cflags: -I${includedir}/webkit-@WEBKITGTK_API_VERSION@ diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h index 556648d..fa74abc 100644 --- a/WebKit/gtk/webkit/webkitprivate.h +++ b/WebKit/gtk/webkit/webkitprivate.h @@ -158,7 +158,7 @@ extern "C" { guint previousClickButton; guint32 previousClickTime; - HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> > draggingDataObjects; + HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> >* draggingDataObjects; }; #define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate)) diff --git a/WebKit/gtk/webkit/webkitsoupauthdialog.c b/WebKit/gtk/webkit/webkitsoupauthdialog.c index 15863b3..daecc73 100644 --- a/WebKit/gtk/webkit/webkitsoupauthdialog.c +++ b/WebKit/gtk/webkit/webkitsoupauthdialog.c @@ -25,6 +25,7 @@ #include <gtk/gtk.h> #include <libsoup/soup.h> +#include "GtkVersioning.h" #include "webkitmarshal.h" #include "webkitsoupauthdialog.h" @@ -214,9 +215,9 @@ static void show_auth_dialog(WebKitAuthData* authData, const char* login, const /* Set the dialog up with HIG properties */ gtk_dialog_set_has_separator(dialog, FALSE); gtk_container_set_border_width(GTK_CONTAINER(dialog), 5); - gtk_box_set_spacing(GTK_BOX(dialog->vbox), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width(GTK_CONTAINER(dialog->action_area), 5); - gtk_box_set_spacing(GTK_BOX(dialog->action_area), 6); + gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_content_area(dialog)), 2); /* 2 * 5 + 2 = 12 */ + gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_action_area(dialog)), 5); + gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_action_area(dialog)), 6); gtk_window_set_resizable(window, FALSE); gtk_window_set_title(window, ""); @@ -233,7 +234,7 @@ static void show_auth_dialog(WebKitAuthData* authData, const char* login, const /* Build contents */ hbox = gtk_hbox_new(FALSE, 12); gtk_container_set_border_width(GTK_CONTAINER(hbox), 5); - gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(dialog)), hbox, TRUE, TRUE, 0); icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG); diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp index ce2bbc6..62997c5 100644 --- a/WebKit/gtk/webkit/webkitwebview.cpp +++ b/WebKit/gtk/webkit/webkitwebview.cpp @@ -517,10 +517,16 @@ static gboolean webkit_web_view_expose_event(GtkWidget* widget, GdkEventExpose* cairo_destroy(cr); ctx.setGdkExposeEvent(event); - GOwnPtr<GdkRectangle> rects; int rectCount; +#ifdef GTK_API_VERSION_2 + GOwnPtr<GdkRectangle> rects; gdk_region_get_rectangles(event->region, &rects.outPtr(), &rectCount); - +#else + rectCount = cairo_region_num_rectangles(event->region); + GOwnPtr<GdkRectangle> rects(g_new(GdkRectangle, rectCount)); + for (int i = 0; i < rectCount; i++) + cairo_region_get_rectangle(event->region, i, rects.get()+i); +#endif // Avoid recursing into the render tree excessively bool coalesce = shouldCoalesce(event->area, rects.get(), rectCount); @@ -1190,7 +1196,7 @@ static void webkit_web_view_dispose(GObject* object) priv->subResources = NULL; } - priv->draggingDataObjects.clear(); + priv->draggingDataObjects->clear(); G_OBJECT_CLASS(webkit_web_view_parent_class)->dispose(object); } @@ -1207,6 +1213,7 @@ static void webkit_web_view_finalize(GObject* object) g_free(priv->iconURI); delete priv->previousClickPoint; + delete priv->draggingDataObjects; G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object); } @@ -1309,10 +1316,10 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context) // This might happen if a drag is still in progress after a WebKitWebView // is disposed and before it is finalized. - if (!priv->draggingDataObjects.contains(context)) + if (!priv->draggingDataObjects->contains(context)) return; - priv->draggingDataObjects.remove(context); + priv->draggingDataObjects->remove(context); Frame* frame = core(webView)->focusController()->focusedOrMainFrame(); if (!frame) @@ -1347,10 +1354,10 @@ static void webkit_web_view_drag_data_get(GtkWidget* widget, GdkDragContext* con // This might happen if a drag is still in progress after a WebKitWebView // is diposed and before it is finalized. - if (!priv->draggingDataObjects.contains(context)) + if (!priv->draggingDataObjects->contains(context)) return; - pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects.get(context).get()); + pasteboardHelperInstance()->fillSelectionData(selectionData, info, priv->draggingDataObjects->get(context).get()); } #if GTK_CHECK_VERSION(2, 12, 0) @@ -2928,6 +2935,8 @@ static void webkit_web_view_init(WebKitWebView* webView) priv->previousClickPoint = new IntPoint(0, 0); priv->previousClickButton = 0; priv->previousClickTime = 0; + + priv->draggingDataObjects = new HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> >(); } GtkWidget* webkit_web_view_new(void) diff --git a/WebKit/gtk/webkitmarshal.list b/WebKit/gtk/webkitmarshal.list index d8caa4c..026a8af 100644 --- a/WebKit/gtk/webkitmarshal.list +++ b/WebKit/gtk/webkitmarshal.list @@ -19,3 +19,4 @@ VOID:OBJECT,POINTER,POINTER VOID:OBJECT,STRING VOID:STRING VOID:STRING,STRING + diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index ea2393a..c59d8b4 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,144 @@ +2010-06-23 Philippe Normand <pnormand@igalia.com> + + Reviewed by Eric Carlson. + + [GStreamer] on Mac OS use a runloop observer to process the glib context iterations + https://bugs.webkit.org/show_bug.cgi?id=35747 + + If VIDEO and GSTREAMER are enabled, make the WebView start a + runloop observer that will trigger the glib main context + iterations. Those are needed by the GStreamer player only at the + moment but could later be used for other GLib-dependant components + if required. + + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + (-[WebView _close]): + (-[WebView _clearGlibLoopObserver]): + (glibContextIterationCallback): + (-[WebView _scheduleGlibContextIterations]): + * WebView/WebViewData.h: + * WebView/WebViewInternal.h: + +2010-07-03 Jon Honeycutt <jhoneycutt@apple.com> + + The missing plug-in indicator should be clickable + + https://bugs.webkit.org/show_bug.cgi?id=41550 + <rdar://problem/8132162> + + From an original patch by Kevin Decker. + + Reviewed by Darin Adler. + + * WebCoreSupport/WebChromeClient.h: + Declare an override of missingPluginButtonClicked(). + + * WebCoreSupport/WebChromeClient.mm: + (WebChromeClient::missingPluginButtonClicked): + Call the UIDelegate's method. + + * WebView/WebUIDelegatePrivate.h: + Declare didPressMissingPluginButton. + +2010-07-01 Timothy Hatcher <timothy@apple.com> + + Provide a WebView preference to disable DNS prefetching. + + https://bugs.webkit.org/show_bug.cgi?id=28825 + rdar://problem/7181249 + + Reviewed by Darin Adler. + + * WebView/WebPreferenceKeysPrivate.h: Added WebKitDNSPrefetchingEnabledPreferenceKey. + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): Set WebKitDNSPrefetchingEnabledPreferenceKey to YES. + (-[WebPreferences isDNSPrefetchingEnabled]): Added. Return WebKitDNSPrefetchingEnabledPreferenceKey's value. + (-[WebPreferences setDNSPrefetchingEnabled:]): Added. Set WebKitDNSPrefetchingEnabledPreferenceKey's value. + * WebView/WebPreferencesPrivate.h: Added isDNSPrefetchingEnabled and setDNSPrefetchingEnabled:. + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): Call WebCore::Settings::setDNSPrefetchingEnabled. + +2010-07-01 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Anders Carlsson. + + <rdar://problem/8148656> <https://bugs.webkit.org/show_bug.cgi?id=41431> + REGRESSION (r49411): Various crashes due to JavaScript execution during plug-in destruction + + Strengthen m_inDestroy "swipe under the carpet" fix. + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: Added a long comment about m_inDestroy, and + changed it to static. + + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy): m_inDestroy is now + static, so we don't initialize it in constructor. + (WebKit::NetscapePluginInstanceProxy::destroy): Assert that we aren't already destroying + some plug-in. + (WebKit::NetscapePluginInstanceProxy::evaluate): This function accidentally lacked an + m_inDestroy check in r42789. + +2010-06-29 Zoltan Herczeg <zherczeg@webkit.org> + + Reviewed by Nikolas Zimmermann. + + Add ConvolveMatrixElement to MigrateHeaders.make + https://bugs.webkit.org/show_bug.cgi?id=5861 + + * MigrateHeaders.make: + +2010-06-23 John Gregg <johnnyg@google.com> + + Reviewed by Kent Tamura. + + add ENABLE_DIRECTORY_UPLOAD build support + https://bugs.webkit.org/show_bug.cgi?id=41100 + + * Configurations/FeatureDefines.xcconfig: + +2010-06-28 Eric Seidel <eric@webkit.org> + + Reviewed by Adam Barth. + + Make it possible to test the new HTML5 TreeBuilder + https://bugs.webkit.org/show_bug.cgi?id=41276 + + Adam was concerned that someone might make their port + depend on this setting (I guess we had some trouble with that + with the HTML5Parser setting), so I littered the code with warnings. + + test-html5-parser now tests this code path. + + * WebView/WebPreferenceKeysPrivate.h: + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): + (-[WebPreferences html5TreeBuilderEnabled]): + (-[WebPreferences setHTML5TreeBuilderEnabled:]): + * WebView/WebPreferencesPrivate.h: + * WebView/WebView.mm: + (-[WebView _preferencesChangedNotification:]): + +2010-06-25 Yuzo Fujishima <yuzo@google.com> + + Reviewed by Shinichiro Hamaji. + + Improve default value handling for page format properties. + https://bugs.webkit.org/show_bug.cgi?id=41150 + + * Misc/WebCoreStatistics.h: + * Misc/WebCoreStatistics.mm: + (-[WebFrame pageSizeAndMarginsInPixels:pageNumber:width:height:marginTop:marginRight:marginBottom:]): + +2010-06-26 Tony Gentilcore <tonyg@chromium.org> + + Reviewed by Dimitri Glazkov. + + Add an ENABLE_WEB_TIMING option for enabling Web Timing support. + https://bugs.webkit.org/show_bug.cgi?id=38924 + + * Configurations/FeatureDefines.xcconfig: + 2010-06-24 Jer Noble <jer.noble@apple.com> Reviewed by Eric Carlson. diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig index 08d9ef9..8d2ff72 100644 --- a/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -48,6 +48,7 @@ ENABLE_DATABASE = ENABLE_DATABASE; ENABLE_DATAGRID = ; ENABLE_DATALIST = ENABLE_DATALIST; ENABLE_DEVICE_ORIENTATION = ; +ENABLE_DIRECTORY_UPLOAD = ; ENABLE_DOM_STORAGE = ENABLE_DOM_STORAGE; ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE; ENABLE_FILTERS = ENABLE_FILTERS; @@ -76,10 +77,11 @@ ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT; ENABLE_SVG_USE = ENABLE_SVG_USE; ENABLE_VIDEO = ENABLE_VIDEO; ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS; +ENABLE_WEB_TIMING = ; ENABLE_WML = ; ENABLE_WORKERS = ENABLE_WORKERS; ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig index f775a54..2749545 100644 --- a/WebKit/mac/Configurations/Version.xcconfig +++ b/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 2; +MINOR_VERSION = 3; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/WebKit/mac/MigrateHeaders.make b/WebKit/mac/MigrateHeaders.make index 96c0a71..83e2e08 100644 --- a/WebKit/mac/MigrateHeaders.make +++ b/WebKit/mac/MigrateHeaders.make @@ -268,6 +268,8 @@ all : \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEComponentTransferElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFECompositeElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFECompositeElementInternal.h \ + $(PRIVATE_HEADERS_DIR)/DOMSVGFEConvolveMatrixElement.h \ + $(INTERNAL_HEADERS_DIR)/DOMSVGFEConvolveMatrixElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEDiffuseLightingElement.h \ $(INTERNAL_HEADERS_DIR)/DOMSVGFEDiffuseLightingElementInternal.h \ $(PRIVATE_HEADERS_DIR)/DOMSVGFEDisplacementMapElement.h \ diff --git a/WebKit/mac/Misc/WebCoreStatistics.h b/WebKit/mac/Misc/WebCoreStatistics.h index e357b72..33e3e0f 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.h +++ b/WebKit/mac/Misc/WebCoreStatistics.h @@ -89,6 +89,5 @@ - (int)numberOfPages:(float)pageWidthInPixels:(float)pageHeightInPixels; - (NSString *)pageProperty:(const char*)propertyName:(int)pageNumber; - (bool)isPageBoxVisible:(int)pageNumber; -- (NSString *)pageAreaRectInPixels:(int)pageNumber; -- (NSString *)preferredPageSizeInPixels:(int)pageNumber; +- (NSString *)pageSizeAndMarginsInPixels:(int)pageNumber:(int)width:(int)height:(int)marginTop:(int)marginRight:(int)marginBottom:(int)marginLeft; @end diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm index 9112d21..bbe07d5 100644 --- a/WebKit/mac/Misc/WebCoreStatistics.mm +++ b/WebKit/mac/Misc/WebCoreStatistics.mm @@ -285,13 +285,8 @@ using namespace WebCore; return PrintContext::isPageBoxVisible(_private->coreFrame, pageNumber); } -- (NSString *)pageAreaRectInPixels:(int)pageNumber +- (NSString *)pageSizeAndMarginsInPixels:(int)pageNumber:(int)width:(int)height:(int)marginTop:(int)marginRight:(int)marginBottom:(int)marginLeft { - return PrintContext::pageAreaRectInPixels(_private->coreFrame, pageNumber); -} - -- (NSString *)preferredPageSizeInPixels:(int)pageNumber; -{ - return PrintContext::preferredPageSizeInPixels(_private->coreFrame, pageNumber); + return PrintContext::pageSizeAndMarginsInPixels(_private->coreFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); } @end diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 5900b02..9ca5b5a 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -342,7 +342,19 @@ private: unsigned m_pluginFunctionCallDepth; bool m_shouldStopSoon; uint32_t m_currentRequestID; - bool m_inDestroy; + + // All NPRuntime functions will return false when destroying a plug-in. This is necessary because there may be unhandled messages waiting, + // and spinning in processRequests() will unexpectedly execute them from inside destroy(). That's not a good time to execute arbitrary JavaScript, + // since both loading and rendering data structures may be in inconsistent state. + // This suppresses calls from all plug-ins, even those in different pages, since JS might affect the frame with plug-in that's being stopped. + // + // FIXME: Plug-ins can execute arbitrary JS from destroy() in same process case, and other browsers also support that. + // A better fix may be to make sure that unrelated messages are postponed until after destroy() returns. + // Another possible fix may be to send destroy message at a time when internal structures are consistent. + // + // FIXME: We lack similar message suppression in other cases - resize() is also triggered by layout, so executing arbitrary JS is also problematic. + static bool m_inDestroy; + bool m_pluginIsWaitingForDraw; RefPtr<HostedNetscapePluginStream> m_manualStream; diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index ca012ee..8354c06 100644 --- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -206,6 +206,8 @@ bool NetscapePluginInstanceProxy::LocalObjectMap::forget(uint32_t objectID) static uint32_t pluginIDCounter; +bool NetscapePluginInstanceProxy::m_inDestroy; + #ifndef NDEBUG static WTF::RefCountedLeakCounter netscapePluginInstanceProxyCounter("NetscapePluginInstanceProxy"); #endif @@ -222,7 +224,6 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy , m_pluginFunctionCallDepth(0) , m_shouldStopSoon(false) , m_currentRequestID(0) - , m_inDestroy(false) , m_pluginIsWaitingForDraw(false) { ASSERT(m_pluginView); @@ -321,7 +322,8 @@ void NetscapePluginInstanceProxy::invalidate() void NetscapePluginInstanceProxy::destroy() { uint32_t requestID = nextRequestID(); - + + ASSERT(!m_inDestroy); m_inDestroy = true; FrameLoadMap::iterator end = m_pendingFrameLoads.end(); @@ -848,6 +850,9 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri resultData = 0; resultLength = 0; + if (m_inDestroy) + return false; + if (!m_localObjects.contains(objectID)) { LOG_ERROR("NetscapePluginInstanceProxy::evaluate: local object %u doesn't exist.", objectID); return false; diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index 7deea79..5587a8d 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -105,6 +105,7 @@ public: virtual void setStatusbarText(const WebCore::String&); virtual void scrollbarsModeDidChange() const { } + virtual void missingPluginButtonClicked(WebCore::Element*) const; virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 0a52a9f..e426f05 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -516,6 +516,11 @@ void WebChromeClient::scrollRectIntoView(const IntRect& r, const ScrollView*) co // End host window methods. +void WebChromeClient::missingPluginButtonClicked(Element* element) const +{ + CallUIDelegate(m_webView, @selector(webView:didPressMissingPluginButton:), kit(element)); +} + void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags) { WebElementDictionary *element = [[WebElementDictionary alloc] initWithHitTestResult:result]; diff --git a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h index c38b395..a28be49 100644 --- a/WebKit/mac/WebView/WebPreferenceKeysPrivate.h +++ b/WebKit/mac/WebView/WebPreferenceKeysPrivate.h @@ -94,7 +94,9 @@ #define WebKitPluginAllowedRunTimePreferenceKey @"WebKitPluginAllowedRunTime" #define WebKitFrameFlatteningEnabledPreferenceKey @"WebKitFrameFlatteningEnabled" #define WebKitHTML5ParserEnabledPreferenceKey @"WebKitHTML5ParserEnabled" +#define WebKitHTML5TreeBuilderEnabledPreferenceKey @"WebKitHTML5TreeBuilderEnabled" // Temporary, do not use. #define WebKitPaginateDuringLayoutEnabledPreferenceKey @"WebKitPaginateDuringLayoutEnabled" +#define WebKitDNSPrefetchingEnabledPreferenceKey @"WebKitDNSPrefetchingEnabled" // These are private both because callers should be using the cover methods and because the // cover methods themselves are private. diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm index 0a192f9..a376458 100644 --- a/WebKit/mac/WebView/WebPreferences.mm +++ b/WebKit/mac/WebView/WebPreferences.mm @@ -360,7 +360,9 @@ static WebCacheModel cacheModelForMainBundle(void) [NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey, [NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey, [NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey, - [NSNumber numberWithBool:YES], WebKitHTML5ParserEnabledPreferenceKey, + [NSNumber numberWithBool:YES], WebKitHTML5ParserEnabledPreferenceKey, + [NSNumber numberWithBool:NO], WebKitHTML5TreeBuilderEnabledPreferenceKey, + [NSNumber numberWithBool:YES], WebKitDNSPrefetchingEnabledPreferenceKey, nil]; // This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above @@ -755,6 +757,16 @@ static WebCacheModel cacheModelForMainBundle(void) @implementation WebPreferences (WebPrivate) +- (BOOL)isDNSPrefetchingEnabled +{ + return [self _boolValueForKey:WebKitDNSPrefetchingEnabledPreferenceKey]; +} + +- (void)setDNSPrefetchingEnabled:(BOOL)flag +{ + [self _setBoolValue:flag forKey:WebKitDNSPrefetchingEnabledPreferenceKey]; +} + - (BOOL)developerExtrasEnabled { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; @@ -1249,6 +1261,16 @@ static NSString *classIBCreatorID = nil; [self _setBoolValue:flag forKey:WebKitHTML5ParserEnabledPreferenceKey]; } +- (BOOL)html5TreeBuilderEnabled +{ + return [self _boolValueForKey:WebKitHTML5TreeBuilderEnabledPreferenceKey]; +} + +- (void)setHTML5TreeBuilderEnabled:(BOOL)flag +{ + [self _setBoolValue:flag forKey:WebKitHTML5TreeBuilderEnabledPreferenceKey]; +} + - (BOOL)paginateDuringLayoutEnabled { return [self _boolValueForKey:WebKitPaginateDuringLayoutEnabledPreferenceKey]; diff --git a/WebKit/mac/WebView/WebPreferencesPrivate.h b/WebKit/mac/WebView/WebPreferencesPrivate.h index c9a89ee..e94943f 100644 --- a/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -55,6 +55,9 @@ extern NSString *WebPreferencesRemovedNotification; // Preferences that might be public in a future release +- (BOOL)isDNSPrefetchingEnabled; +- (void)setDNSPrefetchingEnabled:(BOOL)flag; + - (BOOL)developerExtrasEnabled; - (void)setDeveloperExtrasEnabled:(BOOL)flag; @@ -178,6 +181,10 @@ extern NSString *WebPreferencesRemovedNotification; - (BOOL)html5ParserEnabled; - (void)setHTML5ParserEnabled:(BOOL)flag; +// Will be deleted soon, do not use. +- (BOOL)html5TreeBuilderEnabled; +- (void)setHTML5TreeBuilderEnabled:(BOOL)flag; + - (BOOL)paginateDuringLayoutEnabled; - (void)setPaginateDuringLayoutEnabled:(BOOL)flag; diff --git a/WebKit/mac/WebView/WebUIDelegatePrivate.h b/WebKit/mac/WebView/WebUIDelegatePrivate.h index 327a745..eccb10f 100644 --- a/WebKit/mac/WebView/WebUIDelegatePrivate.h +++ b/WebKit/mac/WebView/WebUIDelegatePrivate.h @@ -115,6 +115,7 @@ enum { - (void)webView:(WebView *)sender contextMenuItemSelected:(NSMenuItem *)item forElement:(NSDictionary *)element; - (void)webView:(WebView *)sender saveFrameView:(WebFrameView *)frameView showingPanel:(BOOL)showingPanel; - (BOOL)webView:(WebView *)sender shouldHaltPlugin:(DOMNode *)pluginNode isWindowed:(BOOL)isWindowed pluginName:(NSString *)pluginName; +- (BOOL)webView:(WebView *)sender didPressMissingPluginButton:(DOMElement *)element; /*! @method webView:frame:exceededDatabaseQuotaForSecurityOrigin:database: @param sender The WebView sending the delegate method. diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index 631dd63..ada00b5 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -178,6 +178,10 @@ #import <WebCore/GeolocationError.h> #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) +#import <glib.h> +#endif + @interface NSSpellChecker (WebNSSpellCheckerDetails) - (void)_preflightChosenSpellServer; @end @@ -369,6 +373,9 @@ static const char webViewIsOpen[] = "At least one WebView is still open."; #if USE(ACCELERATED_COMPOSITING) - (void)_clearLayerSyncLoopObserver; #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) +- (void)_clearGlibLoopObserver; +#endif @end static void patchMailRemoveAttributesMethod(); @@ -722,6 +729,11 @@ static bool shouldEnableLoadDeferring() if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_CONTENT_SNIFFING_FOR_FILE_URLS)) ResourceHandle::forceContentSniffing(); + +#if ENABLE(VIDEO) && USE(GSTREAMER) + [self _scheduleGlibContextIterations]; +#endif + } - (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews @@ -1119,6 +1131,10 @@ static bool fastDocumentTeardownEnabled() [self _clearLayerSyncLoopObserver]; #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) + [self _clearGlibLoopObserver]; +#endif + [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -1403,6 +1419,7 @@ static bool fastDocumentTeardownEnabled() settings->setJavaScriptCanAccessClipboard([preferences javaScriptCanAccessClipboard]); settings->setXSSAuditorEnabled([preferences isXSSAuditorEnabled]); settings->setEnforceCSSMIMETypeInStrictMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1)); + settings->setDNSPrefetchingEnabled([preferences isDNSPrefetchingEnabled]); // FIXME: Enabling accelerated compositing when WebGL is enabled causes tests to fail on Leopard which expect HW compositing to be disabled. // Until we fix that, I will comment out the test (CFM) @@ -1414,6 +1431,7 @@ static bool fastDocumentTeardownEnabled() settings->setLoadDeferringEnabled(shouldEnableLoadDeferring()); settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]); settings->setHTML5ParserEnabled([preferences html5ParserEnabled]); + settings->setHTML5TreeBuilderEnabled_DO_NOT_USE([preferences html5TreeBuilderEnabled]); settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]); } @@ -5456,6 +5474,18 @@ static WebFrameView *containingFrameView(NSView *view) _private->layerSyncRunLoopObserver = 0; } #endif + +#if ENABLE(VIDEO) && USE(GSTREAMER) +- (void)_clearGlibLoopObserver +{ + if (!_private->glibRunLoopObserver) + return; + + CFRunLoopObserverInvalidate(_private->glibRunLoopObserver); + CFRelease(_private->glibRunLoopObserver); + _private->glibRunLoopObserver = 0; +} +#endif @end @implementation WebView (WebViewInternal) @@ -5763,6 +5793,33 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) + +static void glibContextIterationCallback(CFRunLoopObserverRef, CFRunLoopActivity, void*) +{ + g_main_context_iteration(0, FALSE); +} + +- (void)_scheduleGlibContextIterations +{ + if (_private->glibRunLoopObserver) + return; + + NSRunLoop* myRunLoop = [NSRunLoop currentRunLoop]; + + // Create a run loop observer and attach it to the run loop. + CFRunLoopObserverContext context = {0, self, 0, 0, 0}; + _private->glibRunLoopObserver = CFRunLoopObserverCreate(kCFAllocatorDefault, kCFRunLoopBeforeWaiting, YES, 0, &glibContextIterationCallback, &context); + + if (_private->glibRunLoopObserver) { + CFRunLoopRef cfLoop = [myRunLoop getCFRunLoop]; + CFRunLoopAddObserver(cfLoop, _private->glibRunLoopObserver, kCFRunLoopDefaultMode); + } + +} +#endif + + @end @implementation WebView (WebViewGeolocation) diff --git a/WebKit/mac/WebView/WebViewData.h b/WebKit/mac/WebView/WebViewData.h index 2b51f3c..06fee4f 100644 --- a/WebKit/mac/WebView/WebViewData.h +++ b/WebKit/mac/WebView/WebViewData.h @@ -169,6 +169,9 @@ extern int pluginDatabaseClientCount; WebVideoFullscreenController *fullscreenController; #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) + CFRunLoopObserverRef glibRunLoopObserver; +#endif id<WebGeolocationProvider> _geolocationProvider; } @end diff --git a/WebKit/mac/WebView/WebViewInternal.h b/WebKit/mac/WebView/WebViewInternal.h index 4643573..bf9b732 100644 --- a/WebKit/mac/WebView/WebViewInternal.h +++ b/WebKit/mac/WebView/WebViewInternal.h @@ -86,6 +86,10 @@ namespace WebCore { - (void)_scheduleCompositingLayerSync; #endif +#if ENABLE(VIDEO) && USE(GSTREAMER) +- (void)_scheduleGlibContextIterations; +#endif + @end #endif diff --git a/WebKit/qt/Api/headers.pri b/WebKit/qt/Api/headers.pri index e9fe28d..29bb125 100644 --- a/WebKit/qt/Api/headers.pri +++ b/WebKit/qt/Api/headers.pri @@ -12,5 +12,4 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \ $$PWD/qwebpluginfactory.h \ $$PWD/qwebhistory.h \ $$PWD/qwebinspector.h \ - $$PWD/qwebkitversion.h \ - $$PWD/qwebscriptworld.h + $$PWD/qwebkitversion.h diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp index 8361970..6d6acc5 100644 --- a/WebKit/qt/Api/qgraphicswebview.cpp +++ b/WebKit/qt/Api/qgraphicswebview.cpp @@ -151,6 +151,8 @@ void QGraphicsWebViewPrivate::_q_contentsSizeChanged(const QSize& size) void QGraphicsWebViewPrivate::_q_scaleChanged() { #if ENABLE(TILED_BACKING_STORE) + if (!page) + return; static_cast<PageClientQGraphicsWidget*>(page->d->client)->updateTiledBackingStoreScale(); #endif } diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index c42cfa3..c4cb597 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -1378,22 +1378,6 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource) return rc; } -QVariant QWebFrame::evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource) -{ - ScriptController *proxy = d->frame->script(); - QVariant rc; - - if (proxy) { - JSC::JSValue v = proxy->executeScriptInWorld(scriptWorld->world(), scriptSource, true).jsValue(); - if (!d->frame) // In case the script removed our frame from the page. - return QString(); - int distance = 0; - rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance); - } - return rc; -} - - /*! \since 4.5 diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h index 5f3dbd4..e78fb07 100644 --- a/WebKit/qt/Api/qwebframe.h +++ b/WebKit/qt/Api/qwebframe.h @@ -200,7 +200,6 @@ public: public Q_SLOTS: QVariant evaluateJavaScript(const QString& scriptSource); - QVariant evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource); #ifndef QT_NO_PRINTER void print(QPrinter *printer) const; #endif diff --git a/WebKit/qt/Api/qwebscriptworld.cpp b/WebKit/qt/Api/qwebscriptworld.cpp index 5d912cc..84b678d 100644 --- a/WebKit/qt/Api/qwebscriptworld.cpp +++ b/WebKit/qt/Api/qwebscriptworld.cpp @@ -35,6 +35,17 @@ QWebScriptWorld::QWebScriptWorld() d = new QWebScriptWorldPrivate(ScriptController::createWorld()); } +QWebScriptWorld::QWebScriptWorld(const QWebScriptWorld& other) + : d(other.d) +{ +} + +QWebScriptWorld &QWebScriptWorld::operator=(const QWebScriptWorld& other) +{ + d = other.d; + return *this; +} + DOMWrapperWorld* QWebScriptWorld::world() const { return d->world.get(); diff --git a/WebKit/qt/Api/qwebscriptworld.h b/WebKit/qt/Api/qwebscriptworld.h index 6e728ab..6a9d6e0 100644 --- a/WebKit/qt/Api/qwebscriptworld.h +++ b/WebKit/qt/Api/qwebscriptworld.h @@ -35,6 +35,8 @@ class QWebFrame; class QWEBKIT_EXPORT QWebScriptWorld { public: QWebScriptWorld(); + QWebScriptWorld(const QWebScriptWorld&); + QWebScriptWorld &operator=(const QWebScriptWorld&); ~QWebScriptWorld(); WebCore::DOMWrapperWorld* world() const; diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp index b2766a7..ff7c101 100644 --- a/WebKit/qt/Api/qwebsettings.cpp +++ b/WebKit/qt/Api/qwebsettings.cpp @@ -90,6 +90,7 @@ static WebGraphicHash* graphics() hash->insert(QWebSettings::DefaultFrameIconGraphic, QPixmap(QLatin1String(":webkit/resources/urlIcon.png"))); hash->insert(QWebSettings::TextAreaSizeGripCornerGraphic, QPixmap(QLatin1String(":webkit/resources/textAreaResizeCorner.png"))); hash->insert(QWebSettings::DeleteButtonGraphic, QPixmap(QLatin1String(":webkit/resources/deleteButton.png"))); + hash->insert(QWebSettings::InputSpeechButtonGraphic, QPixmap(QLatin1String(":webkit/resources/inputSpeech.png"))); } return hash; diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h index 38a2b3f..8967e7c 100644 --- a/WebKit/qt/Api/qwebsettings.h +++ b/WebKit/qt/Api/qwebsettings.h @@ -82,7 +82,8 @@ public: MissingPluginGraphic, DefaultFrameIconGraphic, TextAreaSizeGripCornerGraphic, - DeleteButtonGraphic + DeleteButtonGraphic, + InputSpeechButtonGraphic }; enum FontSize { MinimumFontSize, diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index 2e565ae..2a649f6 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,228 @@ +2010-07-03 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Return usable property names from DRT's computedStyleIncludingVisitedInfo() + + Object property names such as 'background-color' need to be returned in camel + case, i.e. backgroundColor so that JS can reference them. Add support for this + to DumpRenderTreeSupportQt. + + https://bugs.webkit.org/show_bug.cgi?id=40445 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (convertToPropertyName): + (DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo): + +2010-07-01 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] dump frames in ascending alphabetical order of title + + https://bugs.webkit.org/show_bug.cgi?id=41261 + + Unskip: + http/tests/navigation/metaredirect-frames.html + http/tests/navigation/redirect302-frames.html + http/tests/navigation/redirect302-subframeload.html + http/tests/navigation/timerredirect-frames.html + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::getChildHistoryItems): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2010-07-01 Bea Lam <bea.lam@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] Doc improvements for QDeclarativeWebView + + * declarative/qdeclarativewebview.cpp: + +2010-07-01 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Create QComboBoxes when clicked and destroy on hide. + https://bugs.webkit.org/show_bug.cgi?id=41451 + + Currently a QComboBox is created for each RenderMenuList and + it gets destroyed either when the RenderMenuList or the + QWebView (its Qt parent) is destroyed. This cause a crash + when the QWebView is destroyed before the render tree (which + is kept in cache). + + This patch aim to destroy the QComboBox as soon as its popup + gets hidden, and likewise, create it only when the popup is + requested to be shown. + It also removes the unneeded reference to the QGraphicsProxyWidget, + destroying the QComboBox automatically destroys its bound + proxywidget. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::hidePopup): + (WebCore::QtFallbackWebPopup::QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + (WebCore::QtFallbackWebPopup::show): + (WebCore::QtFallbackWebPopup::hide): + (WebCore::QtFallbackWebPopup::destroyPopup): + (WebCore::QtFallbackWebPopup::populate): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-07-01 Satish Sampath <satish@chromium.org> + + Reviewed by Kent Tamura. + + Rendering the speech button in input elements. + https://bugs.webkit.org/show_bug.cgi?id=40984 + + * Api/qwebsettings.cpp: + (graphics): + * Api/qwebsettings.h: + +2010-06-30 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Make sure we catch closed QComboBox popups. + https://bugs.webkit.org/show_bug.cgi?id=39019 + + The way it works currently is using the QComboBox::show/hidePopup + virtual method to catch popup requests in the middle. There is + some cases however that the popup widget gets closed without + going through the hidePopup method. + + This patch adds an event filter to the popup's view to know when + it gets closed and calls hidePopup to call our handling code. + This may get hidePopup called twice but this shouldn't have any + effect. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopupCombo::QtFallbackWebPopupCombo): + (WebCore::QtFallbackWebPopupCombo::eventFilter): + * WebCoreSupport/QtFallbackWebPopup.h: + +2010-06-30 Simon Hausmann <simon.hausmann@nokia.com> + + Unreviewed Symbian build fix. + + [Qt] Update the def files to link DumpRenderTree. + + * symbian/eabi/QtWebKitu.def: + +2010-06-30 Samuel Nevala <samuel.nevala@digia.com> + + Reviewed by Simon Hausmann. + + [Qt] Auto test wont compile from \3rdparty\webkit\WebKit\qt\tests + https://bugs.webkit.org/show_bug.cgi?id=38720 + + Load qttest_p4.prf under QTDIR_build. + + * tests/tests.pri: + +2010-06-29 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] support dumpResourceResponseMIMETypes + https://bugs.webkit.org/show_bug.cgi?id=41260 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-06-28 Laszlo Gombos <laszlo.1.gombos@nokia.com> + + Unreviewed Symbian build fix. + + [Qt] Update the def file after r61879. + + * symbian/eabi/QtWebKitu.def: + +2010-06-28 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Simon Hausmann. + + [Qt] QGraphicsWebView crash when calling setScale() before setUrl() + https://bugs.webkit.org/show_bug.cgi?id=40000 + + Check 'page' before dereference in _q_scaleChanged() + Autotest included. + + * Api/qgraphicswebview.cpp: + (QGraphicsWebViewPrivate::_q_scaleChanged): + * tests/qgraphicswebview/tst_qgraphicswebview.cpp: + (tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl): + +2010-06-26 Simon Hausmann <hausmann@webkit.org> + + [Qt] Prospective build fix for MSVC + + In order for the forward declaration of QWebScriptWorldPrivate + to work with QExplicitlySharedDataPointer, then copy constructor + and assignment operators must not be compiler generated, to + avoid them ending up in places where the private class is not + declared. + + * Api/qwebscriptworld.cpp: + (QWebScriptWorld::QWebScriptWorld): + (QWebScriptWorld::operator=): + * Api/qwebscriptworld.h: + +2010-06-26 Robert Hogan <robert@webkit.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] DRT Support for setCustomPolicyDelegate + + https://bugs.webkit.org/show_bug.cgi?id=39564 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setCustomPolicyDelegate): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + * WebCoreSupport/FrameLoaderClientQt.cpp: + (drtDescriptionSuitableForTestResult): + (WebCore::navigationTypeToString): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + * WebCoreSupport/FrameLoaderClientQt.h: + +2010-06-25 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QtWebKit crashes if <select>'s render changes in its onchange event + https://bugs.webkit.org/show_bug.cgi?id=41164 + + QtWebKit crashes if <select>'s renderer changes in its onchange event. + + * WebCoreSupport/QtFallbackWebPopup.cpp: + (WebCore::QtFallbackWebPopup::~QtFallbackWebPopup): + +2010-06-25 Robert Hogan <robert@webkit.org> + + Reviewed by Simon Hausmann. + + [Qt] Support evaluateScriptInIsolatedWorld() + + https://bugs.webkit.org/show_bug.cgi?id=40079 + + Remove evaluateScriptInIsolatedWorld() from QtWebKit API. + Remove QWebScriptWorld from exported headers. + Confine support to DumpRenderTreeSupportQt so that the tests can pass. + + * Api/headers.pri: + * Api/qwebframe.cpp: + * Api/qwebframe.h: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::clearScriptWorlds): + (DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + 2010-06-24 Simon Hausmann <simon.hausmann@nokia.com> Unreviewed Symbian build fix. diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index 0ae55d7..09dec71 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -49,6 +49,7 @@ #include "PrintContext.h" #include "RenderListItem.h" #include "RenderTreeAsText.h" +#include "ScriptController.h" #include "SecurityOrigin.h" #include "Settings.h" #if ENABLE(SVG) @@ -65,11 +66,13 @@ #include "qwebhistory_p.h" #include "qwebpage.h" #include "qwebpage_p.h" +#include "qwebscriptworld.h" using namespace WebCore; CheckPermissionFunctionType* checkPermissionFunction = 0; RequestPermissionFunctionType* requestPermissionFunction = 0; +QMap<int, QWebScriptWorld*> m_worldMap; DumpRenderTreeSupportQt::DumpRenderTreeSupportQt() { @@ -392,6 +395,20 @@ QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listIt return WebCore::markerTextForListItem(listItem.m_element); } +static QString convertToPropertyName(const QString& name) +{ + QStringList parts = name.split('-'); + QString camelCaseName; + for (int j = 0; j < parts.count(); ++j) { + QString part = parts.at(j); + if (j) + camelCaseName.append(part.replace(0, 1, part.left(1).toUpper())); + else + camelCaseName.append(part); + } + return camelCaseName; +} + QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element) { QVariantMap res; @@ -404,7 +421,7 @@ QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWe for (int i = 0; i < style->length(); i++) { QString name = style->item(i); QString value = (static_cast<WebCore::CSSStyleDeclaration*>(style.get()))->getPropertyValue(name); - res[name] = QVariant(value); + res[convertToPropertyName(name)] = QVariant(value); } return res; } @@ -510,6 +527,11 @@ void DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(const QString& path) FrameLoaderClientQt::dumpResourceLoadCallbacksPath = path; } +void DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(bool b) +{ + FrameLoaderClientQt::dumpResourceResponseMIMETypes = b; +} + void DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(bool b) { FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = b; @@ -525,6 +547,12 @@ void DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(const QStringList& FrameLoaderClientQt::sendRequestClearHeaders = headers; } +void DumpRenderTreeSupportQt::setCustomPolicyDelegate(bool enabled, bool permissive) +{ + FrameLoaderClientQt::policyDelegateEnabled = enabled; + FrameLoaderClientQt::policyDelegatePermissive = permissive; +} + void DumpRenderTreeSupportQt::dumpEditingCallbacks(bool b) { EditorClientQt::dumpEditingCallbacks = b; @@ -596,17 +624,17 @@ QString DumpRenderTreeSupportQt::historyItemTarget(const QWebHistoryItem& histor return (QWebHistoryItemPrivate::core(&it)->target()); } -QList<QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebHistoryItem& historyItem) +QMap<QString, QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebHistoryItem& historyItem) { QWebHistoryItem it = historyItem; HistoryItem* item = QWebHistoryItemPrivate::core(&it); const WebCore::HistoryItemVector& children = item->children(); unsigned size = children.size(); - QList<QWebHistoryItem> kids; + QMap<QString, QWebHistoryItem> kids; for (unsigned i = 0; i < size; ++i) { QWebHistoryItem kid(new QWebHistoryItemPrivate(children[i].get())); - kids.prepend(kid); + kids.insert(DumpRenderTreeSupportQt::historyItemTarget(kid), kid); } return kids; } @@ -617,6 +645,30 @@ bool DumpRenderTreeSupportQt::shouldClose(QWebFrame* frame) return coreFrame->loader()->shouldClose(); } +void DumpRenderTreeSupportQt::clearScriptWorlds() +{ + m_worldMap.clear(); +} + +void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldID, const QString& script) +{ + QWebScriptWorld* scriptWorld; + if (!worldID) { + scriptWorld = new QWebScriptWorld(); + } else if (!m_worldMap.contains(worldID)) { + scriptWorld = new QWebScriptWorld(); + m_worldMap.insert(worldID, scriptWorld); + } else + scriptWorld = m_worldMap.value(worldID); + + WebCore::Frame* coreFrame = QWebFramePrivate::core(frame); + + ScriptController* proxy = coreFrame->script(); + + if (proxy) + proxy->executeScriptInWorld(scriptWorld->world(), script, true); +} + // 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 0b94a03..304e65b 100644 --- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -30,6 +30,7 @@ class QWebElement; class QWebFrame; class QWebPage; class QWebHistoryItem; +class QWebScriptWorld; enum NotificationPermission { NotificationAllowed, @@ -42,6 +43,7 @@ typedef void (RequestPermissionFunctionType) (QObject* receiver, const QString&) extern CheckPermissionFunctionType* checkPermissionFunction; extern RequestPermissionFunctionType* requestPermissionFunction; +extern QMap<int, QWebScriptWorld*> m_worldMap; class QWEBKIT_EXPORT DumpRenderTreeSupportQt { @@ -74,6 +76,8 @@ public: static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone); static void setJavaScriptProfilingEnabled(QWebFrame*, bool enabled); static int javaScriptObjectsCount(); + static void clearScriptWorlds(); + static void evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldID, const QString& script); static void setTimelineProfilingEnabled(QWebPage*, bool enabled); static void webInspectorExecuteScript(QWebPage* page, long callId, const QString& script); @@ -106,6 +110,7 @@ public: static void dumpFrameLoader(bool b); static void dumpResourceLoadCallbacks(bool b); + static void dumpResourceResponseMIMETypes(bool b); static void dumpResourceLoadCallbacksPath(const QString& path); static void setWillSendRequestReturnsNullOnRedirect(bool b); static void setWillSendRequestReturnsNull(bool b); @@ -115,6 +120,7 @@ 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(QObject* receiver); @@ -122,11 +128,13 @@ public: static void setCheckPermissionFunction(CheckPermissionFunctionType*); static void setRequestPermissionFunction(RequestPermissionFunctionType*); - static QList<QWebHistoryItem> getChildHistoryItems(const QWebHistoryItem& historyItem); + static QMap<QString, QWebHistoryItem> getChildHistoryItems(const QWebHistoryItem& historyItem); static bool isTargetItem(const QWebHistoryItem& historyItem); static QString historyItemTarget(const QWebHistoryItem& historyItem); static bool shouldClose(QWebFrame* frame); + + static void setCustomPolicyDelegate(bool enabled, bool permissive); }; #endif diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index 42b0c49..db731d8 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -38,7 +38,9 @@ #include "FrameTree.h" #include "FrameView.h" #include "DocumentLoader.h" +#include "HitTestResult.h" #include "MIMETypeRegistry.h" +#include "MouseEvent.h" #include "ResourceResponse.h" #include "Page.h" #include "PluginData.h" @@ -127,6 +129,25 @@ static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceRespon return QString::fromLatin1("<NSURLResponse %1, http status code %2>").arg(url).arg(httpStatusCode); } +static QString drtDescriptionSuitableForTestResult(const RefPtr<WebCore::Node> node, int exception) +{ + QString result; + if (exception) { + result.append("ERROR"); + return result; + } + if (!node) { + result.append("NULL"); + return result; + } + result.append(node->nodeName()); + RefPtr<WebCore::Node> parent = node->parentNode(); + if (parent) { + result.append(" > "); + result.append(drtDescriptionSuitableForTestResult(parent, 0)); + } + return result; +} namespace WebCore { @@ -135,8 +156,32 @@ bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false; bool FrameLoaderClientQt::dumpResourceLoadCallbacks = false; bool FrameLoaderClientQt::sendRequestReturnsNullOnRedirect = false; bool FrameLoaderClientQt::sendRequestReturnsNull = false; +bool FrameLoaderClientQt::dumpResourceResponseMIMETypes = false; + QStringList FrameLoaderClientQt::sendRequestClearHeaders; QString FrameLoaderClientQt::dumpResourceLoadCallbacksPath; +bool FrameLoaderClientQt::policyDelegateEnabled = false; +bool FrameLoaderClientQt::policyDelegatePermissive = false; + +// Taken from DumpRenderTree/chromium/WebViewHost.cpp +static const char* navigationTypeToString(NavigationType type) +{ + switch (type) { + case NavigationTypeLinkClicked: + return "link clicked"; + case NavigationTypeFormSubmitted: + return "form submitted"; + case NavigationTypeBackForward: + return "back/forward"; + case NavigationTypeReload: + return "reload"; + case NavigationTypeFormResubmitted: + return "form resubmitted"; + case NavigationTypeOther: + return "other"; + } + return "illegal value"; +} FrameLoaderClientQt::FrameLoaderClientQt() : m_frame(0) @@ -910,7 +955,12 @@ void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, u printf("%s - didReceiveResponse %s\n", qPrintable(dumpAssignedUrls[identifier]), qPrintable(drtDescriptionSuitableForTestResult(response))); - //qDebug() << " got response from" << response.url().string(); + + if (dumpResourceResponseMIMETypes) { + printf("%s has MIME type %s\n", + qPrintable(QFileInfo(drtDescriptionSuitableForTestResult(response.url())).fileName()), + qPrintable(QString(response.mimeType()))); + } } void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long, int) @@ -1046,6 +1096,32 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun Q_ASSERT(m_webFrame); QNetworkRequest r(request.toNetworkRequest(m_webFrame)); QWebPage*page = m_webFrame->page(); + PolicyAction result; + + // Currently, this is only enabled by DRT + if (policyDelegateEnabled) { + RefPtr<Node> node; + for (const Event* event = action.event(); event; event = event->underlyingEvent()) { + if (event->isMouseEvent()) { + const MouseEvent* mouseEvent = static_cast<const MouseEvent*>(event); + node = QWebFramePrivate::core(m_webFrame)->eventHandler()->hitTestResultAtPoint( + mouseEvent->absoluteLocation(), false).innerNonSharedNode(); + break; + } + } + + printf("Policy delegate: attempt to load %s with navigation type '%s'%s\n", + qPrintable(drtDescriptionSuitableForTestResult(request.url())), navigationTypeToString(action.type()), + (node) ? qPrintable(" originating from " + drtDescriptionSuitableForTestResult(node, 0)) : ""); + + if (policyDelegatePermissive) + result = PolicyUse; + else + result = PolicyIgnore; + + callPolicyFunction(function, result); + return; + } if (!page->d->acceptNavigationRequest(m_webFrame, r, QWebPage::NavigationType(action.type()))) { if (action.type() == NavigationTypeFormSubmitted || action.type() == NavigationTypeFormResubmitted) diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h index d858589..b4a3c7e 100644 --- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h +++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h @@ -214,10 +214,13 @@ public: static bool dumpFrameLoaderCallbacks; static bool dumpResourceLoadCallbacks; + static bool dumpResourceResponseMIMETypes; static QString dumpResourceLoadCallbacksPath; static bool sendRequestReturnsNullOnRedirect; static bool sendRequestReturnsNull; static QStringList sendRequestClearHeaders; + static bool policyDelegateEnabled; + static bool policyDelegatePermissive; private: Frame *m_frame; diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp index 26420e5..59ac87b 100644 --- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp +++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.cpp @@ -47,6 +47,10 @@ namespace WebCore { QtFallbackWebPopupCombo::QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup) : m_ownerPopup(ownerPopup) { + // Install an event filter on the view inside the combo box popup to make sure we know + // when the popup got closed. E.g. QComboBox::hidePopup() won't be called when the popup + // is closed by a mouse wheel event outside its window. + view()->installEventFilter(this); } void QtFallbackWebPopupCombo::showPopup() @@ -71,14 +75,24 @@ void QtFallbackWebPopupCombo::hidePopup() QComboBox::hidePopup(); - if (QGraphicsProxyWidget* proxy = graphicsProxyWidget()) - proxy->setVisible(false); - if (!m_ownerPopup.m_popupVisible) return; m_ownerPopup.m_popupVisible = false; m_ownerPopup.popupDidHide(); + m_ownerPopup.destroyPopup(); +} + +bool QtFallbackWebPopupCombo::eventFilter(QObject* watched, QEvent* event) +{ + Q_ASSERT(watched == view()); + + if (event->type() == QEvent::Show && !m_ownerPopup.m_popupVisible) + showPopup(); + else if (event->type() == QEvent::Hide && m_ownerPopup.m_popupVisible) + hidePopup(); + + return false; } // QtFallbackWebPopup @@ -86,19 +100,13 @@ void QtFallbackWebPopupCombo::hidePopup() QtFallbackWebPopup::QtFallbackWebPopup() : QtAbstractWebPopup() , m_popupVisible(false) - , m_combo(new QtFallbackWebPopupCombo(*this)) - , m_proxy(0) + , m_combo(0) { - connect(m_combo, SIGNAL(activated(int)), - SLOT(activeChanged(int)), Qt::QueuedConnection); } QtFallbackWebPopup::~QtFallbackWebPopup() { - // If we create a proxy, then the deletion of the proxy and the - // combo will be done by the proxy's parent (QGraphicsWebView) - if (!m_proxy) - delete m_combo; + destroyPopup(); } void QtFallbackWebPopup::show() @@ -109,17 +117,20 @@ void QtFallbackWebPopup::show() #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) TRAP_IGNORE(showS60BrowserDialog()); #else + + destroyPopup(); + m_combo = new QtFallbackWebPopupCombo(*this); + connect(m_combo, SIGNAL(activated(int)), + SLOT(activeChanged(int)), Qt::QueuedConnection); + populate(); m_combo->setCurrentIndex(currentIndex()); QRect rect = geometry(); if (QGraphicsWebView *webView = qobject_cast<QGraphicsWebView*>(pageClient()->pluginParent())) { - if (!m_proxy) { - m_proxy = new QGraphicsProxyWidget(webView); - m_proxy->setWidget(m_combo); - } else - m_proxy->setVisible(true); - m_proxy->setGeometry(rect); + QGraphicsProxyWidget* proxy = new QGraphicsProxyWidget(webView); + proxy->setWidget(m_combo); + proxy->setGeometry(rect); } else { m_combo->setParent(pageClient()->ownerWidget()); m_combo->setGeometry(QRect(rect.left(), rect.top(), @@ -188,13 +199,21 @@ void QtFallbackWebPopup::showS60BrowserDialog() void QtFallbackWebPopup::hide() { - m_combo->hidePopup(); + // Destroying the QComboBox here cause problems if the popup is in the + // middle of its show animation. Instead we rely on the fact that the + // Qt::Popup window will hide itself on mouse events outside its window. } -void QtFallbackWebPopup::populate() +void QtFallbackWebPopup::destroyPopup() { - m_combo->clear(); + if (m_combo) { + m_combo->deleteLater(); + m_combo = 0; + } +} +void QtFallbackWebPopup::populate() +{ QStandardItemModel* model = qobject_cast<QStandardItemModel*>(m_combo->model()); Q_ASSERT(model); diff --git a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h index 6d2e1ff..e6c371f 100644 --- a/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h +++ b/WebKit/qt/WebCoreSupport/QtFallbackWebPopup.h @@ -42,6 +42,8 @@ public: virtual void show(); virtual void hide(); + void destroyPopup(); + private slots: void activeChanged(int); @@ -49,7 +51,6 @@ private: friend class QtFallbackWebPopupCombo; bool m_popupVisible; QtFallbackWebPopupCombo* m_combo; - QGraphicsProxyWidget* m_proxy; void populate(); #if ENABLE(SYMBIAN_DIALOG_PROVIDERS) @@ -62,6 +63,7 @@ public: QtFallbackWebPopupCombo(QtFallbackWebPopup& ownerPopup); virtual void showPopup(); virtual void hidePopup(); + virtual bool eventFilter(QObject* watched, QEvent* event); private: QtFallbackWebPopup& m_ownerPopup; diff --git a/WebKit/qt/declarative/qdeclarativewebview.cpp b/WebKit/qt/declarative/qdeclarativewebview.cpp index a349bec..0342c9f 100644 --- a/WebKit/qt/declarative/qdeclarativewebview.cpp +++ b/WebKit/qt/declarative/qdeclarativewebview.cpp @@ -180,6 +180,8 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event) When this item has keyboard focus, all keyboard input will be sent directly to the web page within. + + \sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo} */ /*! diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def index 3fefb4d..548add1 100644 --- a/WebKit/qt/symbian/eabi/QtWebKitu.def +++ b/WebKit/qt/symbian/eabi/QtWebKitu.def @@ -760,7 +760,7 @@ EXPORTS _ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @759 NONAME _ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @760 NONAME _ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @761 NONAME - _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME ABSENT + _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME _ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @763 NONAME _ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @764 NONAME _ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @765 NONAME @@ -782,3 +782,20 @@ EXPORTS _ZN23DumpRenderTreeSupportQt20getChildHistoryItemsERK15QWebHistoryItem @ 781 NONAME _ZN23DumpRenderTreeSupportQt23setMockGeolocationErrorEiRK7QString @ 782 NONAME _ZN23DumpRenderTreeSupportQt26setMockGeolocationPositionEddd @ 783 NONAME + _ZN23DumpRenderTreeSupportQt17clearScriptWorldsEv @ 784 NONAME + _ZN23DumpRenderTreeSupportQt23setCustomPolicyDelegateEbb @ 785 NONAME + _ZN15QWebScriptWorldC1ERKS_ @ 786 NONAME + _ZN15QWebScriptWorldC1Ev @ 787 NONAME + _ZN15QWebScriptWorldC2ERKS_ @ 788 NONAME + _ZN15QWebScriptWorldC2Ev @ 789 NONAME + _ZN15QWebScriptWorldD1Ev @ 790 NONAME + _ZN15QWebScriptWorldD2Ev @ 791 NONAME + _ZN15QWebScriptWorldaSERKS_ @ 792 NONAME + _ZN23DumpRenderTreeSupportQt29dumpResourceResponseMIMETypesEb @ 793 NONAME + _ZN23DumpRenderTreeSupportQtC1Ev @ 794 NONAME + _ZN23DumpRenderTreeSupportQtC2Ev @ 795 NONAME + _ZN23DumpRenderTreeSupportQtD1Ev @ 796 NONAME + _ZN23DumpRenderTreeSupportQtD2Ev @ 797 NONAME + _ZN8QWebPage23allowGeolocationRequestEP9QWebFrame @ 798 NONAME + _ZN8QWebPage23viewportChangeRequestedERKNS_13ViewportHintsE @ 799 NONAME + _ZNK15QWebScriptWorld5worldEv @ 800 NONAME diff --git a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp index e06524d..a04ff17 100644 --- a/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp +++ b/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -34,6 +34,7 @@ private slots: void crashOnViewlessWebPages(); void microFocusCoordinates(); void focusInputTypes(); + void crashOnSetScaleBeforeSetUrl(); }; void tst_QGraphicsWebView::qgraphicswebview() @@ -132,6 +133,13 @@ void tst_QGraphicsWebView::crashOnViewlessWebPages() delete page; } +void tst_QGraphicsWebView::crashOnSetScaleBeforeSetUrl() +{ + QGraphicsWebView* webView = new QGraphicsWebView; + webView->setScale(2.0); + delete webView; +} + void tst_QGraphicsWebView::microFocusCoordinates() { QWebPage* page = new QWebPage; diff --git a/WebKit/qt/tests/tests.pri b/WebKit/qt/tests/tests.pri index 525e662..a795ff8 100644 --- a/WebKit/qt/tests/tests.pri +++ b/WebKit/qt/tests/tests.pri @@ -3,7 +3,8 @@ CONFIG -= app_bundle VPATH += $$_PRO_FILE_PWD_ # Add the tst_ prefix, In QTDIR_build it's done by qttest_p4.prf -!CONFIG(QTDIR_build):TARGET = tst_$$TARGET +CONFIG(QTDIR_build) { load(qttest_p4) } +ELSE { TARGET = tst_$$TARGET } SOURCES += $${TARGET}.cpp INCLUDEPATH += \ $$PWD \ diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 18f2d73..d943cc6 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,59 @@ +2010-07-03 Jon Honeycutt <jhoneycutt@apple.com> + + The missing plug-in indicator should be clickable + + https://bugs.webkit.org/show_bug.cgi?id=41550 + <rdar://problem/8132162> + + From an original patch by Kevin Decker. + + Reviewed by Darin Adler. + + * Interfaces/IWebUIDelegatePrivate.idl: + Added a new delegate interface, and declare a function + didPressMissingPluginButton(). + + * Interfaces/WebKit.idl: + Touch this file to force interfaces to be rebuilt. + + * WebCoreSupport/WebChromeClient.cpp: + (WebChromeClient::missingPluginButtonClicked): + Get the UI delegate, and query it for IWebUIDelegatePrivate3. Call its + didPressMissingPluginButton() function. + + * WebCoreSupport/WebChromeClient.h: + Declare an override of missingPluginButtonClicked(). + +2010-07-03 Erik Arvidsson <arv@chromium.org> + + Reviewed by Ojan Vafai. + + Fix issue where a contextmenu event was reporting the wrong target + if the context menu was shown due to pressing the context menu key + (or Shift+F10). + + * WebView.cpp: + (WebView::handleContextMenuEvent): + +2010-07-01 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adele Peterson. + + Provide a WebView preference to disable DNS prefetching on Windows + https://bugs.webkit.org/show_bug.cgi?id=41504 + <rdar://problem/8151939> + + * Interfaces/IWebPreferencesPrivate.idl: Added isDNSPrefetchingEnabled, setDNSPrefetchingEnabled. + * Interfaces/WebKit.idl: Touched to force IDL build. + * WebPreferenceKeysPrivate.h: Added WebKitDNSPrefetchingEnabledPreferenceKey. + * WebPreferences.cpp: + (WebPreferences::initializeDefaultSettings): Default prefetch to true. + (WebPreferences::setDNSPrefetchingEnabled): Added. + (WebPreferences::isDNSPrefetchingEnabled): Added. + * WebPreferences.h: Added isDNSPrefetchingEnabled, setDNSPrefetchingEnabled. + * WebView.cpp: + (WebView::notifyPreferencesChanged): Propagate prefetch pref into settings. + 2010-06-21 Nate Chapin <japhet@chromium.org> Unreviewed, Windows build fix. diff --git a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl index 2cb4037..119c3ff 100644 --- a/WebKit/win/Interfaces/IWebPreferencesPrivate.idl +++ b/WebKit/win/Interfaces/IWebPreferencesPrivate.idl @@ -112,4 +112,7 @@ interface IWebPreferencesPrivate : IUnknown HRESULT javaScriptCanAccessClipboard([out, retval] BOOL *enabled); HRESULT setJavaScriptCanAccessClipboard([in] BOOL enabled); + + HRESULT isDNSPrefetchingEnabled([out, retval] BOOL *enabled); + HRESULT setDNSPrefetchingEnabled([in] BOOL enabled); } diff --git a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl index 215c427..1431db2 100755 --- a/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl +++ b/WebKit/win/Interfaces/IWebUIDelegatePrivate.idl @@ -99,3 +99,14 @@ interface IWebUIDelegatePrivate2 : IWebUIDelegatePrivate HRESULT decidePolicyForGeolocationRequest([in] IWebView* sender, [in] IWebFrame* frame, [in] IWebSecurityOrigin* origin, [in] IWebGeolocationPolicyListener* listener); } + +[ + object, + oleautomation, + uuid(e9834891-233b-48a0-984b-8f8a19abdd0f), + pointer_default(unique) +] +interface IWebUIDelegatePrivate3 : IWebUIDelegatePrivate2 +{ + HRESULT didPressMissingPluginButton([in] IDOMElement*); +} diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl index 98f5da8..8938501 100644 --- a/WebKit/win/Interfaces/WebKit.idl +++ b/WebKit/win/Interfaces/WebKit.idl @@ -20,7 +20,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ cpp_quote("/*") @@ -300,4 +300,3 @@ library WebKit [default] interface IWebUserContentURLPattern; } } - diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 587637f..d45e10c 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -28,6 +28,7 @@ #include "COMPropertyBag.h" #include "COMVariantSetter.h" +#include "DOMCoreClasses.h" #include "WebElementPropertyBag.h" #include "WebFrame.h" #include "WebGeolocationPolicyListener.h" @@ -534,6 +535,20 @@ void WebChromeClient::mouseDidMoveOverElement(const HitTestResult& result, unsig uiDelegate->mouseDidMoveOverElement(m_webView, element.get(), modifierFlags); } +void WebChromeClient::missingPluginButtonClicked(Element* element) const +{ + COMPtr<IWebUIDelegate> uiDelegate; + if (FAILED(m_webView->uiDelegate(&uiDelegate))) + return; + + COMPtr<IWebUIDelegatePrivate3> uiDelegatePrivate3(Query, uiDelegate); + if (!uiDelegatePrivate3) + return; + + COMPtr<IDOMElement> e(AdoptCOM, DOMElement::createInstance(element)); + uiDelegatePrivate3->didPressMissingPluginButton(e.get()); +} + void WebChromeClient::setToolTip(const String& toolTip, TextDirection) { m_webView->setToolTip(toolTip); diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index 6954fde..c8a9451 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -105,6 +105,7 @@ public: virtual void scrollbarsModeDidChange() const { } virtual void mouseDidMoveOverElement(const WebCore::HitTestResult&, unsigned modifierFlags); + virtual void missingPluginButtonClicked(WebCore::Element*) const; virtual void setToolTip(const WebCore::String&, WebCore::TextDirection); diff --git a/WebKit/win/WebPreferenceKeysPrivate.h b/WebKit/win/WebPreferenceKeysPrivate.h index da63754..40c86c0 100644 --- a/WebKit/win/WebPreferenceKeysPrivate.h +++ b/WebKit/win/WebPreferenceKeysPrivate.h @@ -143,3 +143,5 @@ #define WebKitShowRepaintCounterPreferenceKey "WebKitShowRepaintCounter" #define WebKitCustomDragCursorsEnabledPreferenceKey "WebKitCustomDragCursorsEnabled" + +#define WebKitDNSPrefetchingEnabledPreferenceKey "WebKitDNSPrefetchingEnabled" diff --git a/WebKit/win/WebPreferences.cpp b/WebKit/win/WebPreferences.cpp index e49bd20..12b0a72 100644 --- a/WebKit/win/WebPreferences.cpp +++ b/WebKit/win/WebPreferences.cpp @@ -261,6 +261,8 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitShowDebugBordersPreferenceKey), kCFBooleanFalse); + CFDictionaryAddValue(defaults, CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), kCFBooleanTrue); + defaultSettings = defaults; } @@ -1471,6 +1473,18 @@ HRESULT WebPreferences::customDragCursorsEnabled(BOOL* enabled) return S_OK; } +HRESULT WebPreferences::setDNSPrefetchingEnabled(BOOL enabled) +{ + setBoolValue(CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey), enabled); + return S_OK; +} + +HRESULT WebPreferences::isDNSPrefetchingEnabled(BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitDNSPrefetchingEnabledPreferenceKey)); + return S_OK; +} + void WebPreferences::willAddToWebView() { ++m_numWebViews; diff --git a/WebKit/win/WebPreferences.h b/WebKit/win/WebPreferences.h index 1ea69c7..fc57241 100644 --- a/WebKit/win/WebPreferences.h +++ b/WebKit/win/WebPreferences.h @@ -420,7 +420,10 @@ public: virtual HRESULT STDMETHODCALLTYPE setShowRepaintCounter(BOOL); virtual HRESULT STDMETHODCALLTYPE showRepaintCounter(BOOL*); - // WebPreferences + virtual HRESULT STDMETHODCALLTYPE setDNSPrefetchingEnabled(BOOL); + virtual HRESULT STDMETHODCALLTYPE isDNSPrefetchingEnabled(BOOL*); + + // WebPreferences // This method accesses a different preference key than developerExtrasEnabled. // See <rdar://5343767> for the justification. diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index a1aa5c2..441f0f2 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -1188,60 +1188,19 @@ Page* WebView::page() bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) { - static const int contextMenuMargin = 1; - // Translate the screen coordinates into window coordinates POINT coords = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; if (coords.x == -1 || coords.y == -1) { - FrameView* view = m_page->mainFrame()->view(); - if (!view) - return false; + // The contextMenuController() holds onto the last context menu that was popped up on the + // page until a new one is created. We need to clear this menu before propagating the event + // through the DOM so that we can detect if we create a new menu for this event, since we + // won't create a new menu if the DOM swallows the event and the defaultEventHandler does + // not run. + m_page->contextMenuController()->clearContextMenu(); - int rightAligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); - IntPoint location; - - // The context menu event was generated from the keyboard, so show the context menu by the current selection. - Position start = m_page->mainFrame()->selection()->selection().start(); - Position end = m_page->mainFrame()->selection()->selection().end(); - - if (!start.node() || !end.node()) - location = IntPoint(rightAligned ? view->contentsWidth() - contextMenuMargin : contextMenuMargin, contextMenuMargin); - else { - RenderObject* renderer = start.node()->renderer(); - if (!renderer) - return false; - - // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:], - // now Frame::firstRectForRange(), which perhaps this should call). - int extraWidthToEndOfLine = 0; - - InlineBox* startInlineBox; - int startCaretOffset; - start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset); - IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine); - if (startCaretRect != IntRect()) - startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox(); - - InlineBox* endInlineBox; - int endCaretOffset; - end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset); - IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset); - if (endCaretRect != IntRect()) - endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox(); - - IntRect firstRect; - if (startCaretRect.y() == endCaretRect.y()) - firstRect = IntRect(min(startCaretRect.x(), endCaretRect.x()), startCaretRect.y(), abs(endCaretRect.x() - startCaretRect.x()), max(startCaretRect.height(), endCaretRect.height())); - else - firstRect = IntRect(startCaretRect.x(), startCaretRect.y(), startCaretRect.width() + extraWidthToEndOfLine, startCaretRect.height()); - - location = IntPoint(rightAligned ? firstRect.right() : firstRect.x(), firstRect.bottom()); - } + Frame* focusedFrame = m_page->focusController()->focusedOrMainFrame(); + return focusedFrame->eventHandler()->sendContextMenuEventForKey(); - location = view->contentsToWindow(location); - // FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in the selected element. - // Ideally we'd have the position of a context menu event be separate from its target node. - coords = location + IntSize(0, -1); } else { if (!::ScreenToClient(m_viewWindow, &coords)) return false; @@ -1249,11 +1208,6 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) lParam = MAKELPARAM(coords.x, coords.y); - // The contextMenuController() holds onto the last context menu that was popped up on the - // page until a new one is created. We need to clear this menu before propagating the event - // through the DOM so that we can detect if we create a new menu for this event, since we - // won't create a new menu if the DOM swallows the event and the defaultEventHandler does - // not run. m_page->contextMenuController()->clearContextMenu(); IntPoint documentPoint(m_page->mainFrame()->view()->windowToContents(coords)); @@ -4792,6 +4746,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) settings->setWebGLEnabled(true); #endif // ENABLE(3D_CANVAS) + hr = prefsPrivate->isDNSPrefetchingEnabled(&enabled); + if (FAILED(hr)) + return hr; + settings->setDNSPrefetchingEnabled(enabled); + if (!m_closeWindowTimer) m_mainFrame->invalidate(); // FIXME |