diff options
Diffstat (limited to 'WebKit/chromium')
56 files changed, 1500 insertions, 276 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index bd2faa8..9eeb48b 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,703 @@ +2010-10-29 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + Change BackForwardList clients to use BackForwardListImpl to prepare for further refactoring + https://bugs.webkit.org/show_bug.cgi?id=48574 + + * src/BackForwardListClientImpl.h: Use BackForwardListImpl.h. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): Cast to BackForwardList* before calling setClient. + +2010-10-28 Michael Nordman <michaeln@google.com> + + Reviewed by ap. + + [Chrome] Fix an appcache regression introduced in r69226 + https://bugs.webkit.org/show_bug.cgi?id=48592 + Provide a noop method body ApplicationCacheHost::maybeLoadMainResourceForRedirect. + + * src/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect): + +2010-10-29 Aaron Colwell <acolwell@chromium.org> + + Reviewed by James Robinson. + + Fix globalAlpha support when using drawImage() to copy a video frame + to a 2D canvas context. + https://bugs.webkit.org/show_bug.cgi?id=48094 + + This fix applies the globalAlpha value to the canvas before passing it + down to the lower layers that don't have access to the graphics + context. This makes sure that any drawing on the canvas will have the + proper global alpha value applied. + + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::paint): + +2010-10-29 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + https://bugs.webkit.org/show_bug.cgi?id=48576 + Let WebKit2 client know when a frame is a frameset + + Added a blank implementation of the new FrameLoaderClient method. + + * src/FrameLoaderClientImpl.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidBecomeFrameset): + +2010-10-29 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Timothy Hatcher. + + Web Inspector: add close button to network view, make tests pass + for resource manager on all ports. + https://bugs.webkit.org/show_bug.cgi?id=48628 + + * src/js/Tests.js: + +2010-10-29 Csaba Osztrogonác <ossy@webkit.org> + + Reviewed by Adam Roben and David Kilzer. + + Fix and cleanup of build systems + https://bugs.webkit.org/show_bug.cgi?id=48342 + + * features.gypi: Remove unnecessary ENABLE_SANDBOX. + +2010-10-29 Leandro Gracia Gil <leandrogracia@google.com> + + Reviewed by Jeremy Orlow. + + Patch the current speech input implementation to use the nearest + language tag. The language is now passed to the startRecognition + methods so that language-specific recognition could be used. Also added + a second parameter to setMockSpeechInputResult for the language used in + speech recognition. + https://bugs.webkit.org/show_bug.cgi?id=47089 + + This is the 2nd of a 4-sided patch in Chromium and WebKit. For more + details see http://codereview.chromium.org/3615005/show, + http://codereview.chromium.org/3595018/show and + https://bugs.webkit.org/show_bug.cgi?id=47420. + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * public/WebSpeechInputControllerMock.h: + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::create): + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-10-28 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel, Peter Kasting, and Darin Fisher. + (Eric reviewed the CoreGraphics interactions, Peter reviewed the image + decoder interaction, and Darin Fisher SGTMed the policy decision.) + + [chromium] Chromium Mac should use WebKit's image decoders + https://bugs.webkit.org/show_bug.cgi?id=47974 + + Enable WebKit's image decoders. + + * features.gypi: + +2010-10-28 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Darin Adler. + + [Chromium] History related tests REGRESSED after r70723 + https://bugs.webkit.org/show_bug.cgi?id=48513 + + Since r70723 made BackForwardList::currentItem no longer be virtual, + we were not reaching the implementation in Chromium's + BackForwardListClientImpl, and for Chromium currentItem is not the same + as itemAtIndex(0). + + The fix is to make itemAtIndex(0) have the currentItem() behavior, which + lets us keep currentItem as non-virtual (and remove its implementation + from the Chromium side). + + This also switches Chromium to use the default implementation of + backItem() and forwardItem() (vs. the old stubs that just had + ASSERT_NOT_REACHED) since they're actually reacheable with Chromium + code thanks to the calls in FrameLoader::checkDidPerformFirstNavigation. + + * src/BackForwardListClientImpl.cpp: + (WebKit::BackForwardListClientImpl::itemAtIndex): + * src/BackForwardListClientImpl.h: + +2010-10-28 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + [Chromium] Support FileSystem in chromium DRT + https://bugs.webkit.org/show_bug.cgi?id=47643 + Update the chromium DEPS to pick up corresponding webkit_support change. + Also add a temporary glue implementation with FIXME comment to + WebFrameClient::openFileSystem. + + * DEPS: + * public/WebFrameClient.h: + (WebKit::WebFrameClient::openFileSystem): + +2010-10-28 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Remove obsolete public/API methods in chromium port + https://bugs.webkit.org/show_bug.cgi?id=48504 + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + +2010-10-27 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + [Chromium] Metadata queries should return full file info, not just modification time + https://bugs.webkit.org/show_bug.cgi?id=48098 + + * src/AssertMatchingEnums.cpp: Ensure WebFileInfo and FileMetadata use the same values for file/directory indicators. + * src/WebFileSystemCallbacksImpl.cpp: + (WebKit::WebFileSystemCallbacksImpl::didReadMetadata): Pass through the new information. + +2010-10-27 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + [chromium] WebGL does not work with the compositor in test_shell + https://bugs.webkit.org/show_bug.cgi?id=48470 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer): + - Properly restore the draw framebuffer after resolving. + (WebKit::WebGraphicsContext3DDefaultImpl::prepareTexture): + - Make the context current before calling resolveMultisampledFramebuffer. + +2010-10-27 Stuart Morgan <stuartmorgan@chromium.org> + + Reviewed by David Levin. + + Include caps lock state when converting NSEvent modifiers to + WebInputEvent + + https://bugs.webkit.org/show_bug.cgi?id=47917 + + * src/mac/WebInputEventFactory.mm: + (WebKit::modifiersFromEvent): + +2010-10-27 Chris Rogers <crogers@google.com> + + Reviewed by James Robinson. + + Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) for Chromium + https://bugs.webkit.org/show_bug.cgi?id=48465 + + * features.gypi: + +2010-10-25 Tony Chang <tony@chromium.org> + + Reviewed by Anders Carlsson. + + compile TestNetscapePlugIn on chromium linux + https://bugs.webkit.org/show_bug.cgi?id=48274 + + * WebKit.gyp: Enable compilation of TestNetscapePlugIn on Linux. + +2010-10-27 Satish Sampath <satish@chromium.org> + + Unreviewed, rolling out r70665. + http://trac.webkit.org/changeset/70665 + https://bugs.webkit.org/show_bug.cgi?id=47089 + + Need to address Alexey's review comments. + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * public/WebSpeechInputControllerMock.h: + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-10-27 ZHenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Must enable GL_POINT_SPRITE in GraphicsContext3D implementations + https://bugs.webkit.org/show_bug.cgi?id=45908 + + * src/WebGraphicsContext3DDefaultImpl.cpp: Enable for chromium --in-process-webgl port. + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + +2010-10-27 Leandro Gracia Gil <leandrogracia@google.com> + + Reviewed by Jeremy Orlow. + + Patch the current speech input implementation to use the nearest + language tag. The language is now passed to the startRecognition + methods so that language-specific recognition could be used. Also added + a second parameter to setMockSpeechInputResult for the language used in + speech recognition. + https://bugs.webkit.org/show_bug.cgi?id=47089 + + This is the 2nd of a 4-sided patch in Chromium and WebKit. For more + details see http://codereview.chromium.org/3615005/show and + http://codereview.chromium.org/3595018/show. The last of the 4 patches + depends also on the language tag validation provided by this patch: + https://bugs.webkit.org/show_bug.cgi?id=48225. + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * public/WebSpeechInputControllerMock.h: + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::create): + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-10-26 Victoria Kirst <vrk@google.com> + + Reviewed by David Levin. + + Fix compile when ACCELERATED_COMPOSITING flag is not set + https://bugs.webkit.org/show_bug.cgi?id=48373 + + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl): + (WebKit::WebMediaPlayerClientImpl::readyStateChanged): + (WebKit::WebMediaPlayerClientImpl::load): + * src/WebMediaPlayerClientImpl.h: + +2010-10-26 MORITA Hajime <morrita@google.com> + + Reviewed by Tony Chang. + + Rolling in r70512 again. + + spellcheck='' should be the same as spellcheck="true" + https://bugs.webkit.org/show_bug.cgi?id=25539 + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::shouldSpellcheckByDefault): + +2010-10-26 Jenn Braithwaite <jennb@chromium.org> + + Reviewed by Dmitry Titov. + + Resource tracking failure when trying to move a frame between documents + https://bugs.webkit.org/show_bug.cgi?id=44713 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::transferLoadingResourceFromPage): + Empty method. + * src/FrameLoaderClientImpl.h: + +2010-10-26 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Add a 'grammar' attribute for speech input. + https://bugs.webkit.org/show_bug.cgi?id=48339 + + To differentiate between various types of speech input, we add a 'x-webkit-grammar' attribute to a + speech enabled input element. This is passed without validation to the speech recognizer. Typical values + could be "builtin:search", "builtin:dictation" and even an externally hosted SRGS grammar XML file URI. + It is up to the recognizer to interpret the value and use it as an aid in recognition. + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + +2010-10-26 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + IndexedDB: update stale comments referring to WebIndexedDatabase. + https://bugs.webkit.org/show_bug.cgi?id=48325 + + WebIndexedDatabase was renamed to WebIDBFactory in + http://trac.webkit.org/changeset/64344, but some comments referring to + it were left unchanged. + + * public/WebIDBCursor.h: + * public/WebIDBDatabase.h: + * public/WebIDBDatabaseError.h: + * public/WebIDBIndex.h: + * public/WebIDBObjectStore.h: + * public/WebIDBTransaction.h: + * src/WebIDBDatabaseImpl.h: + +2010-10-22 Stephen White <senorblanco@chromium.org> + + Reviewed by Kenneth Russell. + + Implement copy-texture-to-parent-texture API for WebGraphicsContext3DDefaultImpl. + https://bugs.webkit.org/show_bug.cgi?id=48152 + + This allows the in-process implementation to do accelerated canvas and + accelerated compositing together. It requires some changes landed + in chromium 63528, so this patch also rolls chromium DEPS to 63722 + (current LKGR). + + Covered by fast/canvas/arc360.html, and many more when run with + --accelerated-compositing and --accelerated-2d-canvas. + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): + Add member vars to save the currently-bound texture and for the + texture-to-texture FBO. + (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl): + Delete the texture-to-texture FBO on destruction. + + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + Generate the texture-to-texture FBO. + (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM): + Check for support of the glGetTexLevelParameteriv function (required + for this implementation). + (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM): + Implement the extension: bind the FBO, bind the child texture, then + do a glCopyTexImage2D() into the parent texture. + (WebKit::WebGraphicsContext3DDefaultImpl::bindTexture): + Record the newly-bound texture in m_boundTexture. + * src/WebGraphicsContext3DDefaultImpl.h: + Add the two new member variables. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::graphicsContext3D): + Make sure the graphics context is reshaped to the correct size on all + platforms. + +2010-10-26 Alexey Marinichev <amarinichev@chromium.org> + + Reviewed by Kenneth Russell. + + [chromium] Check getGraphicsResetStatusARB and reinitialize the + renderer in an error is returned. + https://bugs.webkit.org/show_bug.cgi?id=47848 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::composite): added getGraphicsResetStatusARB check + (WebKit::WebViewImpl::reallocateRenderer): added + * src/WebViewImpl.h: + +2010-10-26 Kenneth Russell <kbr@google.com> + + Reviewed by Andreas Kling. + + Valgrind failure in GraphicsContext3DInternal::reshape + https://bugs.webkit.org/show_bug.cgi?id=48284 + + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl): + +2010-10-26 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Fix IndexedDB crashes + https://bugs.webkit.org/show_bug.cgi?id=48266 + + Make WebIDBObjectStoreImpl match the way that WebIDBIndexImpl passes + in cursor parameters (which is the correct way). KeyRange knows how + to convert itself to a WebCore type--even if the value is null. + + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::openCursor): + +2010-10-26 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Remove obsolete public/API methods in chromium port. + https://bugs.webkit.org/show_bug.cgi?id=48330 + + * public/WebSpeechInputListener.h: + +2010-10-26 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Quota for IndexedDB should be per origin not per database + https://bugs.webkit.org/show_bug.cgi?id=48064 + + * public/WebIDBFactory.h: + * public/WebSecurityOrigin.h: + * src/WebIDBFactory.cpp: + (WebKit::WebIDBFactory::databaseFileName): + * src/WebSecurityOrigin.cpp: + (WebKit::WebSecurityOrigin::get): + +2010-10-26 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r70512. + http://trac.webkit.org/changeset/70512 + https://bugs.webkit.org/show_bug.cgi?id=48314 + + crashes many tests (Requested by inferno-sec on #webkit). + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::shouldSpellcheckByDefault): + +2010-10-25 MORITA Hajime <morrita@google.com> + + Reviewed by Tony Chang. + + spellcheck='' should be the same as spellcheck="true" + https://bugs.webkit.org/show_bug.cgi?id=25539 + + Followed API rename in WebCore. + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::shouldSpellcheckByDefault): + +2010-10-25 Satish Sampath <satish@chromium.org> + + Unreviewed, fix for a build break caused by my earlier patch. + + * public/WebSpeechInputListener.h: + (WebKit::WebSpeechInputListener::setRecognitionResult): Explicitly invoking the correct constructor. + +2010-10-21 Satish Sampath <satish@chromium.org> + + Reviewed by Jeremy Orlow. + + Allow embedder to pass on all the speech recognition results to the input element. + https://bugs.webkit.org/show_bug.cgi?id=48068 + + * WebKit.gyp: Added new files + * public/WebSpeechInputListener.h: + * public/WebSpeechInputResult.h: Added, wrapper around WebCore::SpeechInputResult + (WebKit::WebSpeechInputResult::WebSpeechInputResult): + (WebKit::WebSpeechInputResult::~WebSpeechInputResult): + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::setRecognitionResult): Accepts an array instead of a single string. + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setRecognitionResult): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebSpeechInputResult.cpp: Added. + (WebKit::WebSpeechInputResult::reset): + (WebKit::WebSpeechInputResult::WebSpeechInputResult): + (WebKit::WebSpeechInputResult::set): + (WebKit::WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>): + +2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r70451. + http://trac.webkit.org/changeset/70451 + https://bugs.webkit.org/show_bug.cgi?id=48249 + + Broke set-unloaded-frame-location.html under Qt (Requested by + caseq on #webkit). + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeScript): + (WebKit::WebFrameImpl::executeScriptInIsolatedWorld): + (WebKit::WebFrameImpl::executeScriptAndReturnValue): + +2010-10-25 Peter Rybin <peter.rybin@gmail.com> + + Reviewed by Adam Barth. + + HTML parser should provide script column position within HTML document to JavaScript engine + https://bugs.webkit.org/show_bug.cgi?id=45271 + + Replaces script line number with TextPosition structure. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeScript): + (WebKit::WebFrameImpl::executeScriptInIsolatedWorld): + (WebKit::WebFrameImpl::executeScriptAndReturnValue): + +2010-10-20 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Jian Li. + + Renumber FileError/FileException error codes per latest File API spec changes + https://bugs.webkit.org/show_bug.cgi?id=47936 + + * public/WebFileError.h: + * src/AssertMatchingEnums.cpp: + * src/AsyncFileWriterChromium.cpp: + (WebCore::AsyncFileWriterChromium::didFail): + +2010-10-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r70361. + http://trac.webkit.org/changeset/70361 + https://bugs.webkit.org/show_bug.cgi?id=48217 + + Chromium tests NoInitialAutocompleteForReadOnly and + InitialAutocomplete don't complete (Requested by yuzo on + #webkit). + + * public/WebDocument.h: + +2010-10-22 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Turning on the Autocomplete implementation on the Chromium side. + https://bugs.webkit.org/show_bug.cgi?id=41283 + + * public/WebDocument.h: + +2010-10-22 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + WebKit2 needs to pass the current event modifier flags when requesting a new window + https://bugs.webkit.org/show_bug.cgi?id=48140 + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::createWindow): + * src/ChromeClientImpl.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchCreatePage): + * src/FrameLoaderClientImpl.h: + Add NavigationAction parameter. + +2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r70301. + http://trac.webkit.org/changeset/70301 + https://bugs.webkit.org/show_bug.cgi?id=48126 + + "Lang attribute layout tests failing" (Requested by satish on + #webkit). + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * public/WebSpeechInputControllerMock.h: + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-10-22 Leandro Gracia Gil <leandrogracia@google.com> + + Reviewed by Jeremy Orlow. + + Patch the current speech input implementation to use and validate the + nearest language tag. The language is now passed to the startRecognition + methods so that language-specific recognition could be used. Also added + a second parameter to setMockSpeechInputResult for the language used in + speech recognition. + https://bugs.webkit.org/show_bug.cgi?id=47089 + + This is the 2nd of a 4-sided patch in Chromium and WebKit. For more + details see http://codereview.chromium.org/3615005/show and + http://codereview.chromium.org/3595018/show. + + * public/WebSpeechInputController.h: + (WebKit::WebSpeechInputController::startRecognition): + * public/WebSpeechInputControllerMock.h: + * src/SpeechInputClientImpl.cpp: + (WebKit::SpeechInputClientImpl::create): + (WebKit::SpeechInputClientImpl::startRecognition): + * src/SpeechInputClientImpl.h: + * src/WebSpeechInputControllerMockImpl.cpp: + (WebKit::WebSpeechInputControllerMockImpl::setMockRecognitionResult): + (WebKit::WebSpeechInputControllerMockImpl::startRecognition): + * src/WebSpeechInputControllerMockImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + +2010-10-21 Yuzo Fujishima <yuzo@google.com> + + Unreviewed build fix attempt for Chromium Linux Debug Clang + + * public/WebExternalPopupMenu.h: + +2010-10-21 Tony Chang <tony@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] roll chromium DEPS to include forwarding headers refactor + https://bugs.webkit.org/show_bug.cgi?id=48097 + + * DEPS: Roll chromium forward to include new forwarding headers script + * WebKit.gyp: This dependency always existed, it's just exposed now + that the header files are in a different include dir. + +2010-10-21 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium: use dedicated event listener type in EventListenerWrapper. + https://bugs.webkit.org/show_bug.cgi?id=48059 + + * src/EventListenerWrapper.cpp: + (WebKit::EventListenerWrapper::EventListenerWrapper): + +2010-10-21 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Adding an API that allows external + popup menus, without the use of WebCore::PopupMenuChromium. + Once this is hooked up in Chromium, the plan is to remove + entirely the external case from PopupMenuChromium. + https://bugs.webkit.org/show_bug.cgi?id=46016 + + * WebKit.gyp: + * public/WebExternalPopupMenu.h: Added. + * public/WebExternalPopupMenuClient.h: Added. + * public/WebMenuItemInfo.h: + (WebKit::WebMenuItemInfo::WebMenuItemInfo): + * public/WebView.h: + * public/WebViewClient.h: + (WebKit::WebViewClient::createExternalPopupMenu): + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::createPopupMenu): + * src/ExternalPopupMenu.cpp: Added. + * src/ExternalPopupMenu.h: Added. + * src/WebViewImpl.cpp: + (WebKit::WebView::setUseExternalPopupMenus): + (WebKit::WebViewImpl::useExternalPopupMenus): + * src/WebViewImpl.h: + 2010-10-20 Sheriff Bot <webkit.review.bot@gmail.com> Unreviewed, rolling out r70165. @@ -66,10 +766,10 @@ (WebKit::WebViewImpl::WebViewImpl): * src/WebViewImpl.h: -2010-10-19 Leandro Gracia Gil <leandrogracia@google.com> +2010-10-20 Leandro Gracia Gil <leandrogracia@google.com> Reviewed by Jeremy Orlow. - + Patch the current speech input implementation to use and validate the nearest language tag. The language is now passed to the startRecognition methods so that language-specific recognition could be used. Also added diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 86a9387..aaf0b0a 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': '63057' + 'chromium_rev': '64214' } deps = { diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index e1e1a5f..f121c5f 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -150,6 +150,8 @@ 'public/WebEditingAction.h', 'public/WebElement.h', 'public/WebExceptionCode.h', + 'public/WebExternalPopupMenu.h', + 'public/WebExternalPopupMenuClient.h', 'public/WebFileChooserCompletion.h', 'public/WebFileChooserParams.h', 'public/WebFileError.h', @@ -255,6 +257,7 @@ 'public/WebSpeechInputController.h', 'public/WebSpeechInputControllerMock.h', 'public/WebSpeechInputListener.h', + 'public/WebSpeechInputResult.h', 'public/WebStorageArea.h', 'public/WebStorageEventDispatcher.h', 'public/WebStorageNamespace.h', @@ -325,6 +328,8 @@ 'src/EditorClientImpl.h', 'src/EventListenerWrapper.cpp', 'src/EventListenerWrapper.h', + 'src/ExternalPopupMenu.cpp', + 'src/ExternalPopupMenu.h', 'src/FrameLoaderClientImpl.cpp', 'src/FrameLoaderClientImpl.h', 'src/FrameNetworkingContextImpl.h', @@ -514,6 +519,7 @@ 'src/WebSharedWorkerImpl.h', 'src/WebSpeechInputControllerMockImpl.cpp', 'src/WebSpeechInputControllerMockImpl.h', + 'src/WebSpeechInputResult.cpp', 'src/WebStorageAreaImpl.cpp', 'src/WebStorageAreaImpl.h', 'src/WebStorageEventDispatcherImpl.cpp', @@ -875,6 +881,9 @@ 'sources/': [ ['exclude', 'Win\\.cpp$'], ], + 'dependencies': [ + 'TestNetscapePlugIn', + ], 'actions': [ { 'action_name': 'repack_locale', @@ -902,7 +911,6 @@ 'dependencies': [ 'copy_mesa', 'LayoutTestHelper', - 'TestNetscapePlugIn', ], 'mac_bundle_resources': [ '<(ahem_path)', @@ -957,6 +965,11 @@ ['exclude', '(Gtk|Linux)\\.cpp$'] ] }], + ['inside_chromium_build==0', { + 'dependencies': [ + '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers', + ] + }], ], }, ], # targets @@ -967,6 +980,54 @@ 'type': 'executable', 'sources': ['../../WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'], }], + }, { # OS!="win" + 'targets': [ + { + 'target_name': 'TestNetscapePlugIn', + 'type': 'loadable_module', + 'sources': [ '<@(test_plugin_files)' ], + 'dependencies': [ + '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', + ], + 'include_dirs': [ + '<(chromium_src_dir)', + '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn', + '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders', + ], + + 'conditions': [ + ['OS=="mac"', { + 'mac_bundle': 1, + # It would be nice to name this + # TestNetscapePlugIn, but that name is already + # used by the fork of this plugin in Chromium. + 'product_name': 'WebKitTestNetscapePlugIn', + 'product_extension': 'plugin', + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', + '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', + ] + }, + 'xcode_settings': { + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', + # This is a temporary fork of + # DRT/TestNetscapePlugIn/mac/Info.plist. Once + # we get rid of our forked plugin in the + # chromium repo, we can share the same + # Info.plist. + 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist', + }, + }], + ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { + 'cflags': [ + '-fvisibility=default', + ], + }], + ], + }, + ], }], ['OS=="mac"', { 'targets': [ @@ -989,42 +1050,6 @@ 'files': ['<(PRODUCT_DIR)/osmesa.so'], }], }, - { - 'target_name': 'TestNetscapePlugIn', - 'type': 'loadable_module', - 'sources': [ '<@(test_plugin_files)' ], - 'dependencies': [ - '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi', - ], - 'include_dirs': [ - '<(chromium_src_dir)', - '../../WebKitTools/DumpRenderTree/TestNetscapePlugIn', - '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders', - ], - - # Mac specific stuff. - 'mac_bundle': 1, - # It would be nice to name this TestNetscapePlugIn, but - # that name is already used by the fork of this plugin in - # Chromium. - 'product_name': 'WebKitTestNetscapePlugIn', - 'product_extension': 'plugin', - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework', - '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework', - ] - }, - 'xcode_settings': { - 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', - # This is a temporary fork of - # DRT/TestNetscapePlugIn/mac/Info.plist. Once we get - # rid of our forked plugin in the chromium repo, we - # can share the same Info.plist. - 'INFOPLIST_FILE': '../../WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist', - }, - } ], }], ], # conditions diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index 1e78b04..cd6bf20 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -69,7 +69,6 @@ 'ENABLE_ORIENTATION_EVENTS=0', 'ENABLE_PROGRESS_TAG=1', 'ENABLE_RUBY=1', - 'ENABLE_SANDBOX=1', 'ENABLE_SHARED_WORKERS=1', 'ENABLE_SVG=1', 'ENABLE_SVG_ANIMATION=1', @@ -80,6 +79,7 @@ 'ENABLE_TOUCH_EVENTS=1', 'ENABLE_V8_SCRIPT_DEBUG_SERVER=1', 'ENABLE_VIDEO=1', + 'ENABLE_WEB_AUDIO=0', 'ENABLE_WEB_SOCKETS=1', 'ENABLE_WEB_TIMING=1', 'ENABLE_WORKERS=1', @@ -88,6 +88,7 @@ 'ENABLE_XSLT=1', 'WTF_USE_ACCELERATED_COMPOSITING=1', 'WTF_USE_WEBP=1', + 'WTF_USE_WEBKIT_IMAGE_DECODERS=1', ], 'use_accelerated_compositing%': 1, diff --git a/WebKit/chromium/public/WebExternalPopupMenu.h b/WebKit/chromium/public/WebExternalPopupMenu.h new file mode 100644 index 0000000..49630cf --- /dev/null +++ b/WebKit/chromium/public/WebExternalPopupMenu.h @@ -0,0 +1,46 @@ +/* + * 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 WebExternalPopupMenu_h +#define WebExternalPopupMenu_h + +namespace WebKit { + +struct WebRect; + +class WebExternalPopupMenu { +public: + virtual void show(const WebRect& bounds) = 0; + virtual void close() = 0; +}; + +} // namespace WebKit + +#endif // WebExternalPopupMenu_h diff --git a/WebKit/chromium/public/WebExternalPopupMenuClient.h b/WebKit/chromium/public/WebExternalPopupMenuClient.h new file mode 100644 index 0000000..e01bc2d --- /dev/null +++ b/WebKit/chromium/public/WebExternalPopupMenuClient.h @@ -0,0 +1,56 @@ +/* + * 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 WebExternalPopupMenuClient_h +#define WebExternalPopupMenuClient_h + +namespace WebKit { + +class WebExternalPopupMenuClient { +public: + // Should be called when the currently selected item in the popup menu + // changed. Can be -1 if there is no selection. + virtual void didChangeSelection(int index) = 0; + + // Should be called when an index has been accepted. + // Note that it is not safe to access this WebExternalPopupClientMenu after + // this has been called as it might not be valid anymore. + virtual void didAcceptIndex(int index) = 0; + + // Should be called when the popup menu was discarded (closed without a + // selection. + // Note that it is not safe to access this WebExternalPopupClientMenu after + // this has been called as it might not be valid anymore. + virtual void didCancel() = 0; +}; + +} // namespace WebKit + +#endif // WebExternalPopupMenuClient_h diff --git a/WebKit/chromium/public/WebFileError.h b/WebKit/chromium/public/WebFileError.h index cfe8882..e7a17c3 100644 --- a/WebKit/chromium/public/WebFileError.h +++ b/WebKit/chromium/public/WebFileError.h @@ -34,15 +34,18 @@ namespace WebKit { // File-related error code defined in HTML5 File API. enum WebFileError { - WebFileErrorNoModificationAllowed = 7, - WebFileErrorNotFound = 8, - WebFileErrorInvalidState = 11, - WebFileErrorInvalidModification = 13, - WebFileErrorSecurity = 18, - WebFileErrorAbort = 20, - WebFileErrorQuotaExceeded = 22, - WebFileErrorNotReadable = 24, - WebFileErrorEncoding = 26, + WebFileErrorNotFound = 1, + WebFileErrorSecurity = 2, + WebFileErrorAbort = 3, + WebFileErrorNotReadable = 4, + WebFileErrorEncoding = 5, + WebFileErrorNoModificationAllowed = 6, + WebFileErrorInvalidState = 7, + WebFileErrorSyntax = 8, + WebFileErrorInvalidModification = 9, + WebFileErrorQuotaExceeded = 10, + WebFileErrorTypeMismatch = 11, + WebFileErrorPathExists = 12, }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebFrameClient.h b/WebKit/chromium/public/WebFrameClient.h index 458604e..c5cfc21 100644 --- a/WebKit/chromium/public/WebFrameClient.h +++ b/WebKit/chromium/public/WebFrameClient.h @@ -355,10 +355,8 @@ public: WebFrame*, WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*) { } - // This method will be deleted once chromium uses the new method above. - virtual void openFileSystem( - WebFrame*, WebFileSystem::Type, long long size, - WebFileSystemCallbacks*) { } + // FIXME: This method should be deleted once chromium implements the new method above. + virtual void openFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks) { return openFileSystem(frame, type, size, true, callbacks); } protected: ~WebFrameClient() { } diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h index 2e5e98b..98f7a6b 100644 --- a/WebKit/chromium/public/WebIDBCursor.h +++ b/WebKit/chromium/public/WebIDBCursor.h @@ -35,7 +35,7 @@ namespace WebKit { -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBCursor { public: virtual ~WebIDBCursor() { } diff --git a/WebKit/chromium/public/WebIDBDatabase.h b/WebKit/chromium/public/WebIDBDatabase.h index c67a117..19096cc 100644 --- a/WebKit/chromium/public/WebIDBDatabase.h +++ b/WebKit/chromium/public/WebIDBDatabase.h @@ -37,7 +37,7 @@ class WebIDBCallbacks; class WebIDBObjectStore; class WebIDBTransaction; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBDatabase { public: virtual ~WebIDBDatabase() { } diff --git a/WebKit/chromium/public/WebIDBDatabaseError.h b/WebKit/chromium/public/WebIDBDatabaseError.h index a237d5f..c181f78 100644 --- a/WebKit/chromium/public/WebIDBDatabaseError.h +++ b/WebKit/chromium/public/WebIDBDatabaseError.h @@ -37,7 +37,7 @@ namespace WebCore { class IDBDatabaseError; } namespace WebKit { -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBDatabaseError { public: ~WebIDBDatabaseError() { reset(); } diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h index c7fbe02..66ceadb 100755 --- a/WebKit/chromium/public/WebIDBFactory.h +++ b/WebKit/chromium/public/WebIDBFactory.h @@ -58,6 +58,8 @@ public: } // The file name that would be used for persisting a given indexed database on the file system. + WEBKIT_API static WebString databaseFileName(const WebSecurityOrigin&); + // FIXME: Remove after roll. WEBKIT_API static WebString databaseFileName(const WebString& name, const WebSecurityOrigin&); }; diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h index 7c77878..0c0d79a 100644 --- a/WebKit/chromium/public/WebIDBIndex.h +++ b/WebKit/chromium/public/WebIDBIndex.h @@ -36,7 +36,7 @@ class WebIDBCallbacks; class WebIDBKey; class WebIDBKeyRange; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBIndex { public: virtual ~WebIDBIndex() { } diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 60d3325..171fe78 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -82,7 +82,6 @@ public: #endif private: - WebPrivatePtr<WebCore::IDBKey> m_private; }; diff --git a/WebKit/chromium/public/WebIDBObjectStore.h b/WebKit/chromium/public/WebIDBObjectStore.h index f5f1473..89dae02 100755 --- a/WebKit/chromium/public/WebIDBObjectStore.h +++ b/WebKit/chromium/public/WebIDBObjectStore.h @@ -38,7 +38,7 @@ namespace WebKit { class WebIDBKeyRange; class WebIDBTransaction; -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBObjectStore { public: virtual ~WebIDBObjectStore() { } diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h index 6a739c3..385dd1e 100644 --- a/WebKit/chromium/public/WebIDBTransaction.h +++ b/WebKit/chromium/public/WebIDBTransaction.h @@ -35,7 +35,7 @@ namespace WebKit { class WebIDBObjectStore; class WebIDBTransactionCallbacks; -// See comment in WebIndexedDatabase for a high level overview of these classes. +// See comment in WebIDBFactory for a high level overview of these classes. class WebIDBTransaction { public: virtual ~WebIDBTransaction() { } diff --git a/WebKit/chromium/public/WebMenuItemInfo.h b/WebKit/chromium/public/WebMenuItemInfo.h index d513e66..445dfb4 100644 --- a/WebKit/chromium/public/WebMenuItemInfo.h +++ b/WebKit/chromium/public/WebMenuItemInfo.h @@ -44,6 +44,15 @@ struct WebMenuItemInfo { Group, Separator, }; + + WebMenuItemInfo() + : type(Option) + , action(0) + , enabled(false) + , checked(false) + { + } + WebString label; Type type; unsigned action; diff --git a/WebKit/chromium/public/WebSecurityOrigin.h b/WebKit/chromium/public/WebSecurityOrigin.h index efcb2e9..a241682 100644 --- a/WebKit/chromium/public/WebSecurityOrigin.h +++ b/WebKit/chromium/public/WebSecurityOrigin.h @@ -100,6 +100,7 @@ public: WebSecurityOrigin(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); WebSecurityOrigin& operator=(const WTF::PassRefPtr<WebCore::SecurityOrigin>&); operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const; + WebCore::SecurityOrigin* get() const; #endif private: diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h index 5408741..6ed546f 100644 --- a/WebKit/chromium/public/WebSpeechInputController.h +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -35,7 +35,9 @@ namespace WebKit { +class WebString; struct WebRect; +class WebString; // Provides an embedder API called by WebKit. class WebSpeechInputController { @@ -43,7 +45,7 @@ public: // Starts speech recognition. Speech will get recorded until the endpointer detects silence, // runs to the limit or stopRecording is called. Progress indications and the recognized // text are returned via the listener interface. - virtual bool startRecognition(int requestId, const WebRect&) + virtual bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar) { WEBKIT_ASSERT_NOT_REACHED(); return false; diff --git a/WebKit/chromium/public/WebSpeechInputControllerMock.h b/WebKit/chromium/public/WebSpeechInputControllerMock.h index 9a26235..b4c50a0 100644 --- a/WebKit/chromium/public/WebSpeechInputControllerMock.h +++ b/WebKit/chromium/public/WebSpeechInputControllerMock.h @@ -44,6 +44,10 @@ public: WebSpeechInputListener* listener); virtual ~WebSpeechInputControllerMock() { } + virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; + + // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched. + // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch. virtual void setMockRecognitionResult(const WebString& result) = 0; }; diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h index 6dc3d49..091f984 100644 --- a/WebKit/chromium/public/WebSpeechInputListener.h +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -31,6 +31,8 @@ #ifndef WebSpeechInputListener_h #define WebSpeechInputListener_h +#include "WebSpeechInputResult.h" + namespace WebKit { class WebString; @@ -47,19 +49,19 @@ public: // WebSpeechInputController::stopRecording() was called. // Typically after this call the listener would update the UI to reflect that recognition is // in progress. - virtual void didCompleteRecording(int) = 0; + virtual void didCompleteRecording(int) { WEBKIT_ASSERT_NOT_REACHED(); } // Gives results from speech recognition, either partial or the final results. // This method can potentially get called multiple times if there are partial results // available as the user keeps speaking. If the speech could not be recognized properly // or if there was any other errors in the process, this method may never be called. - virtual void setRecognitionResult(int, const WebString&) = 0; + virtual void setRecognitionResult(int, const WebSpeechInputResultArray&) { WEBKIT_ASSERT_NOT_REACHED(); } // Informs that speech recognition has completed. This gets invoked irrespective of whether // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The // handler typically frees up any temporary resources allocated and waits for the next speech // recognition request. - virtual void didCompleteRecognition(int) = 0; + virtual void didCompleteRecognition(int) { WEBKIT_ASSERT_NOT_REACHED(); } protected: ~WebSpeechInputListener() { } diff --git a/WebKit/chromium/public/WebSpeechInputResult.h b/WebKit/chromium/public/WebSpeechInputResult.h new file mode 100644 index 0000000..8f1a8f5 --- /dev/null +++ b/WebKit/chromium/public/WebSpeechInputResult.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebSpeechInputResult_h +#define WebSpeechInputResult_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" +#include "WebString.h" +#include "WebVector.h" + +namespace WebCore { +class SpeechInputResult; +} + +namespace WebKit { + +// This class holds one speech recognition result including the text and other related +// fields, as received from the embedder. +class WebSpeechInputResult { +public: + WebSpeechInputResult() { } + ~WebSpeechInputResult() { reset(); } + + WEBKIT_API void set(const WebString& utterance, double confidence); + WEBKIT_API void reset(); + +#if WEBKIT_IMPLEMENTATION + WebSpeechInputResult(const WTF::PassRefPtr<WebCore::SpeechInputResult>&); + operator WTF::PassRefPtr<WebCore::SpeechInputResult>() const; +#endif + +private: + WebPrivatePtr<WebCore::SpeechInputResult> m_private; +}; + +typedef WebVector<WebSpeechInputResult> WebSpeechInputResultArray; + +} // namespace WebKit + +#endif // WebSpeechInputResult_h diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index e504bd7..ce8e512 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -69,13 +69,13 @@ public: UserContentInjectInAllFrames, UserContentInjectInTopFrameOnly }; - + // Controls which documents user styles are injected into. enum UserStyleInjectionTime { UserStyleInjectInExistingDocuments, UserStyleInjectInSubsequentDocuments }; - + // Initialization ------------------------------------------------------ @@ -315,6 +315,12 @@ public: virtual void performCustomContextMenuAction(unsigned action) = 0; + // Popup menu ---------------------------------------------------------- + + // Sets whether select popup menus should be rendered by the browser. + WEBKIT_API static void setUseExternalPopupMenus(bool); + + // Visited link state -------------------------------------------------- // Tells all WebView instances to update the visited link state for the diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 858cb2a..edd9579 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -48,6 +48,8 @@ class WebAccessibilityObject; class WebDeviceOrientationClient; class WebDragData; class WebElement; +class WebExternalPopupMenu; +class WebExternalPopupMenuClient; class WebFileChooserCompletion; class WebFrame; class WebGeolocationService; @@ -87,6 +89,8 @@ public: // responsible for rendering the contents of the popup menu. virtual WebWidget* createPopupMenu(WebPopupType) { return 0; } virtual WebWidget* createPopupMenu(const WebPopupMenuInfo&) { return 0; } + virtual WebExternalPopupMenu* createExternalPopupMenu( + const WebPopupMenuInfo&, WebExternalPopupMenuClient*) { return 0; } // Create a session storage namespace object associated with this WebView. virtual WebStorageNamespace* createSessionStorageNamespace(unsigned quota) { return 0; } diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp index f1b1a91..a6e66c6 100644 --- a/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -113,6 +113,11 @@ void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL) } } +void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&) +{ + // N/A to the chromium port +} + bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse& response) { if (m_internal) { diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 9647a44..c6ab85a 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -37,6 +37,8 @@ #include "ApplicationCacheHost.h" #include "AsyncFileSystem.h" #include "EditorInsertAction.h" +#include "FileError.h" +#include "FileMetadata.h" #include "FontDescription.h" #include "FontSmoothingMode.h" #include "HTMLInputElement.h" @@ -56,6 +58,8 @@ #include "WebClipboard.h" #include "WebCursorInfo.h" #include "WebEditingAction.h" +#include "WebFileError.h" +#include "WebFileInfo.h" #include "WebFileSystem.h" #include "WebFontDescription.h" #include "WebIDBKey.h" @@ -361,4 +365,20 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); +COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown); +COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile); +COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory); #endif + +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNotFound, FileError::NOT_FOUND_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorSecurity, FileError::SECURITY_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorAbort, FileError::ABORT_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNotReadable, FileError::NOT_READABLE_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorEncoding, FileError::ENCODING_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorNoModificationAllowed, FileError::NO_MODIFICATION_ALLOWED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorInvalidState, FileError::INVALID_STATE_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorSyntax, FileError::SYNTAX_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorInvalidModification, FileError::INVALID_MODIFICATION_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorQuotaExceeded, FileError::QUOTA_EXCEEDED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorTypeMismatch, FileError::TYPE_MISMATCH_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebFileErrorPathExists, FileError::PATH_EXISTS_ERR); diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/WebKit/chromium/src/AsyncFileWriterChromium.cpp index 8969094..71cf3b5 100644 --- a/WebKit/chromium/src/AsyncFileWriterChromium.cpp +++ b/WebKit/chromium/src/AsyncFileWriterChromium.cpp @@ -85,7 +85,7 @@ void AsyncFileWriterChromium::didTruncate() void AsyncFileWriterChromium::didFail(WebKit::WebFileError error) { - m_client->didFail(error); + m_client->didFail(static_cast<FileError::ErrorCode>(error)); } } // namespace diff --git a/WebKit/chromium/src/BackForwardListClientImpl.cpp b/WebKit/chromium/src/BackForwardListClientImpl.cpp index 2976329..af659bc 100644 --- a/WebKit/chromium/src/BackForwardListClientImpl.cpp +++ b/WebKit/chromium/src/BackForwardListClientImpl.cpp @@ -84,14 +84,15 @@ void BackForwardListClientImpl::goToItem(HistoryItem* item) m_pendingHistoryItem = 0; } -HistoryItem* BackForwardListClientImpl::currentItem() -{ - return m_currentItem.get(); -} - HistoryItem* BackForwardListClientImpl::itemAtIndex(int index) { - if (!m_webView->client() || index > forwardListCount() || -index > backListCount()) + if (!m_webView->client()) + return 0; + + if (!index) + return m_currentItem.get(); + + if (index > forwardListCount() || -index > backListCount()) return 0; // Since we don't keep the entire back/forward list, we have no way to diff --git a/WebKit/chromium/src/BackForwardListClientImpl.h b/WebKit/chromium/src/BackForwardListClientImpl.h index 1d8beb0..b795ecf 100644 --- a/WebKit/chromium/src/BackForwardListClientImpl.h +++ b/WebKit/chromium/src/BackForwardListClientImpl.h @@ -31,7 +31,7 @@ #ifndef BackForwardListClientImpl_h #define BackForwardListClientImpl_h -#include "BackForwardList.h" +#include "BackForwardListImpl.h" namespace WebKit { class WebViewImpl; @@ -50,7 +50,6 @@ private: // WebCore::BackForwardListClient methods: virtual void addItem(PassRefPtr<WebCore::HistoryItem>); virtual void goToItem(WebCore::HistoryItem*); - virtual WebCore::HistoryItem* currentItem(); virtual WebCore::HistoryItem* itemAtIndex(int index); virtual int backListCount(); virtual int forwardListCount(); diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 4f1705f..df13b29 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -40,6 +40,7 @@ #include "DatabaseTracker.h" #include "Document.h" #include "DocumentLoader.h" +#include "ExternalPopupMenu.h" #include "FileChooser.h" #include "FloatRect.h" #include "FrameLoadRequest.h" @@ -51,6 +52,7 @@ #include "HTMLNames.h" #include "HitTestResult.h" #include "IntRect.h" +#include "NavigationAction.h" #include "Node.h" #include "NotificationPresenterImpl.h" #include "Page.h" @@ -251,7 +253,7 @@ void ChromeClientImpl::focusedNodeChanged(Node* node) } Page* ChromeClientImpl::createWindow( - Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features) + Frame* frame, const FrameLoadRequest& r, const WindowFeatures& features, const NavigationAction&) { if (!m_webView->client()) return 0; @@ -833,6 +835,9 @@ bool ChromeClientImpl::selectItemWritingDirectionIsNatural() PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(PopupMenuClient* client) const { + if (WebViewImpl::useExternalPopupMenus()) + return adoptRef(new ExternalPopupMenu(client, m_webView->client())); + return adoptRef(new PopupMenuChromium(client)); } diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h index b1208f7..039fc1b 100644 --- a/WebKit/chromium/src/ChromeClientImpl.h +++ b/WebKit/chromium/src/ChromeClientImpl.h @@ -71,7 +71,7 @@ public: virtual void takeFocus(WebCore::FocusDirection); virtual void focusedNodeChanged(WebCore::Node*); virtual WebCore::Page* createWindow( - WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&); + WebCore::Frame*, const WebCore::FrameLoadRequest&, const WebCore::WindowFeatures&, const WebCore::NavigationAction&); virtual void show(); virtual bool canRunModal(); virtual void runModal(); diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp index d9ccb17..d33a06b 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -241,7 +241,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; // Spellchecking might be enabled for the field, but could be disabled on the node. - if (m_webView->focusedWebCoreFrame()->editor()->spellCheckingEnabledInFocusedNode()) + if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); } } diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp index 11977b6..bc1d206 100644 --- a/WebKit/chromium/src/EditorClientImpl.cpp +++ b/WebKit/chromium/src/EditorClientImpl.cpp @@ -124,7 +124,7 @@ bool EditorClientImpl::shouldSpellcheckByDefault() const Editor* editor = frame->editor(); if (!editor) return false; - if (editor->spellCheckingEnabledInFocusedNode()) + if (editor->isSpellCheckingEnabledInFocusedNode()) return true; const Document* document = frame->document(); if (!document) diff --git a/WebKit/chromium/src/EventListenerWrapper.cpp b/WebKit/chromium/src/EventListenerWrapper.cpp index 706ba21..6360932 100644 --- a/WebKit/chromium/src/EventListenerWrapper.cpp +++ b/WebKit/chromium/src/EventListenerWrapper.cpp @@ -40,7 +40,7 @@ namespace WebKit { EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener) - : EventListener(EventListener::JSEventListenerType) + : EventListener(EventListener::NativeEventListenerType) , m_webDOMEventListener(webDOMEventListener) { } diff --git a/WebKit/chromium/src/ExternalPopupMenu.cpp b/WebKit/chromium/src/ExternalPopupMenu.cpp new file mode 100644 index 0000000..a0243eb --- /dev/null +++ b/WebKit/chromium/src/ExternalPopupMenu.cpp @@ -0,0 +1,141 @@ +/* + * 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 "ExternalPopupMenu.h" + +#include "FrameView.h" +#include "IntPoint.h" +#include "PopupMenuClient.h" +#include "TextDirection.h" +#include "WebExternalPopupMenu.h" +#include "WebMenuItemInfo.h" +#include "WebPopupMenuInfo.h" +#include "WebVector.h" +#include "WebViewClient.h" + +using namespace WebCore; + +namespace WebKit { + +ExternalPopupMenu::ExternalPopupMenu(PopupMenuClient* popupMenuClient, + WebViewClient* webViewClient) + : m_popupMenuClient(popupMenuClient) + , m_webViewClient(webViewClient) + , m_webExternalPopupMenu(0) +{ +} + +ExternalPopupMenu::~ExternalPopupMenu() +{ +} + +void ExternalPopupMenu::show(const IntRect& rect, FrameView* v, int index) +{ + // WebCore reuses the PopupMenu of a page. + // For simplicity, we do recreate the actual external popup everytime. + hide(); + + WebPopupMenuInfo info; + getPopupMenuInfo(&info); + m_webExternalPopupMenu = + m_webViewClient->createExternalPopupMenu(info, this); + m_webExternalPopupMenu->show(v->contentsToWindow(rect)); +} + +void ExternalPopupMenu::hide() +{ + if (m_popupMenuClient) + m_popupMenuClient->popupDidHide(); + if (!m_webExternalPopupMenu) + return; + m_webExternalPopupMenu->close(); + m_webExternalPopupMenu = 0; +} + +void ExternalPopupMenu::updateFromElement() +{ +} + +void ExternalPopupMenu::disconnectClient() +{ + hide(); + m_popupMenuClient = 0; +} + +void ExternalPopupMenu::didChangeSelection(int index) +{ + if (m_popupMenuClient) + m_popupMenuClient->selectionChanged(index); +} + +void ExternalPopupMenu::didAcceptIndex(int index) +{ + if (m_popupMenuClient) { + m_popupMenuClient->valueChanged(index); + m_popupMenuClient->popupDidHide(); + } + m_webExternalPopupMenu = 0; +} + +void ExternalPopupMenu::didCancel() +{ + if (m_popupMenuClient) + m_popupMenuClient->popupDidHide(); + m_webExternalPopupMenu = 0; +} + +void ExternalPopupMenu::getPopupMenuInfo(WebPopupMenuInfo* info) +{ + int itemCount = m_popupMenuClient->listSize(); + WebVector<WebPopupMenuInfo::Item> items( + static_cast<size_t>(itemCount)); + for (int i = 0; i < itemCount; ++i) { + WebPopupMenuInfo::Item& popupItem = items[i]; + popupItem.label = m_popupMenuClient->itemText(i); + if (m_popupMenuClient->itemIsSeparator(i)) + popupItem.type = WebMenuItemInfo::Separator; + else if (m_popupMenuClient->itemIsLabel(i)) + popupItem.type = WebMenuItemInfo::Group; + else + popupItem.type = WebMenuItemInfo::Option; + popupItem.enabled = m_popupMenuClient->itemIsEnabled(i); + } + + info->itemHeight = m_popupMenuClient->menuStyle().font().height(); + info->itemFontSize = + static_cast<int>(m_popupMenuClient->menuStyle().font().size()); + info->selectedIndex = m_popupMenuClient->selectedIndex(); + info->rightAligned = + m_popupMenuClient->menuStyle().textDirection() == WebCore::RTL; + info->items.swap(items); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/ExternalPopupMenu.h b/WebKit/chromium/src/ExternalPopupMenu.h new file mode 100644 index 0000000..6963e8d --- /dev/null +++ b/WebKit/chromium/src/ExternalPopupMenu.h @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ExternalPopupMenu_h +#define ExternalPopupMenu_h + +#include "PopupMenu.h" +#include "WebExternalPopupMenuClient.h" + +namespace WebCore { +class FrameView; +class IntRect; +class PopupMenuClient; +} + +namespace WebKit { + +class WebExternalPopupMenu; +class WebViewClient; +struct WebPopupMenuInfo; + +// The ExternalPopupMenu connects the actual implementation of the popup menu +// to the WebCore popup menu. +class ExternalPopupMenu : public WebCore::PopupMenu, + public WebExternalPopupMenuClient { +public: + ExternalPopupMenu(WebCore::PopupMenuClient*, WebViewClient*); + virtual ~ExternalPopupMenu(); + +private: + // WebCore::PopupMenu methods: + virtual void show(const WebCore::IntRect&, WebCore::FrameView*, int index); + virtual void hide(); + virtual void updateFromElement(); + virtual void disconnectClient(); + + // WebExternalPopupClient methods: + virtual void didChangeSelection(int index); + virtual void didAcceptIndex(int index); + virtual void didCancel(); + + // Fills |info| with the popup menu information contained in the + // WebCore::PopupMenuClient associated with this ExternalPopupMenu. + void getPopupMenuInfo(WebPopupMenuInfo* info); + + WebCore::PopupMenuClient* m_popupMenuClient; + WebViewClient* m_webViewClient; + + // The actual implementor of the show menu. + WebExternalPopupMenu* m_webExternalPopupMenu; +}; + +} // namespace WebKit + +#endif // ExternalPopupMenu_h diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index b4c62f4..29141ac 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -812,11 +812,11 @@ void FrameLoaderClientImpl::dispatchDidFirstVisuallyNonEmptyLayout() m_webFrame->client()->didFirstVisuallyNonEmptyLayout(m_webFrame); } -Frame* FrameLoaderClientImpl::dispatchCreatePage() +Frame* FrameLoaderClientImpl::dispatchCreatePage(const NavigationAction& action) { struct WindowFeatures features; Page* newPage = m_webFrame->frame()->page()->chrome()->createWindow( - m_webFrame->frame(), FrameLoadRequest(), features); + m_webFrame->frame(), FrameLoadRequest(), features, action); // Make sure that we have a valid disposition. This should have been set in // the preceeding call to dispatchDecidePolicyForNewWindowAction. @@ -1342,6 +1342,10 @@ void FrameLoaderClientImpl::transitionToCommittedForNewPage() makeDocumentView(); } +void FrameLoaderClientImpl::dispatchDidBecomeFrameset(bool) +{ +} + bool FrameLoaderClientImpl::canCachePage() const { // Since we manage the cache, always report this page as non-cacheable to @@ -1385,6 +1389,11 @@ void FrameLoaderClientImpl::didTransferChildFrameToNewDocument(Page*) m_webFrame->setClient(newParent->client()); } +void FrameLoaderClientImpl::transferLoadingResourceFromPage(unsigned long, DocumentLoader*, const ResourceRequest&, Page*) +{ + notImplemented(); +} + PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( const IntSize& size, // FIXME: how do we use this? HTMLPlugInElement* element, diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h index 0b15db6..ef00ed3 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -112,7 +112,7 @@ public: virtual void dispatchDidFinishLoad(); virtual void dispatchDidFirstLayout(); virtual void dispatchDidFirstVisuallyNonEmptyLayout(); - virtual WebCore::Frame* dispatchCreatePage(); + virtual WebCore::Frame* dispatchCreatePage(const WebCore::NavigationAction&); virtual void dispatchShow(); virtual void dispatchDecidePolicyForMIMEType(WebCore::FramePolicyFunction function, const WTF::String& mime_type, const WebCore::ResourceRequest&); virtual void dispatchDecidePolicyForNewWindowAction(WebCore::FramePolicyFunction function, const WebCore::NavigationAction& action, const WebCore::ResourceRequest& request, PassRefPtr<WebCore::FormState> form_state, const WTF::String& frame_name); @@ -169,6 +169,7 @@ public: virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedForNewPage(); + virtual void dispatchDidBecomeFrameset(bool); virtual bool canCachePage() const; virtual void download( WebCore::ResourceHandle*, const WebCore::ResourceRequest&, @@ -180,6 +181,7 @@ public: const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); virtual void didTransferChildFrameToNewDocument(WebCore::Page*); + virtual void transferLoadingResourceFromPage(unsigned long, WebCore::DocumentLoader*, const WebCore::ResourceRequest&, WebCore::Page*); virtual PassRefPtr<WebCore::Widget> createPlugin( const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WTF::String>&, const Vector<WTF::String>&, diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp index 963d440..b5ed384 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.cpp +++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp @@ -32,15 +32,21 @@ #include "SpeechInputClientImpl.h" #include "PlatformString.h" +#include "SpeechInputListener.h" #include "WebSpeechInputController.h" #include "WebString.h" #include "WebViewClient.h" -#include "page/SpeechInputListener.h" +#include <wtf/PassOwnPtr.h> #if ENABLE(INPUT_SPEECH) namespace WebKit { +PassOwnPtr<SpeechInputClientImpl> SpeechInputClientImpl::create(WebViewClient* client) +{ + return adoptPtr(new SpeechInputClientImpl(client)); +} + SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client) : m_controller(web_view_client ? web_view_client->speechInputController(this) : 0) , m_listener(0) @@ -56,10 +62,10 @@ void SpeechInputClientImpl::setListener(WebCore::SpeechInputListener* listener) m_listener = listener; } -bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect) +bool SpeechInputClientImpl::startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar) { ASSERT(m_listener); - return m_controller->startRecognition(requestId, elementRect); + return m_controller->startRecognition(requestId, elementRect, language, grammar); } void SpeechInputClientImpl::stopRecording(int requestId) @@ -86,10 +92,13 @@ void SpeechInputClientImpl::didCompleteRecognition(int requestId) m_listener->didCompleteRecognition(requestId); } -void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebString& result) +void SpeechInputClientImpl::setRecognitionResult(int requestId, const WebSpeechInputResultArray& results) { ASSERT(m_listener); - m_listener->setRecognitionResult(requestId, result); + WebCore::SpeechInputResultArray webcoreResults(results.size()); + for (size_t i = 0; i < results.size(); ++i) + webcoreResults[i] = results[i]; + m_listener->setRecognitionResult(requestId, webcoreResults); } } // namespace WebKit diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h index 817b32b..520803a 100644 --- a/WebKit/chromium/src/SpeechInputClientImpl.h +++ b/WebKit/chromium/src/SpeechInputClientImpl.h @@ -33,8 +33,11 @@ #if ENABLE(INPUT_SPEECH) +#include "SpeechInputClient.h" #include "WebSpeechInputListener.h" -#include "page/SpeechInputClient.h" +#include <wtf/Forward.h> +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> namespace WebCore { class SpeechInputListener; @@ -49,21 +52,23 @@ class SpeechInputClientImpl : public WebCore::SpeechInputClient, public WebSpeechInputListener { public: - SpeechInputClientImpl(WebViewClient*); + static PassOwnPtr<SpeechInputClientImpl> create(WebViewClient*); virtual ~SpeechInputClientImpl(); // SpeechInputClient methods. void setListener(WebCore::SpeechInputListener*); - bool startRecognition(int, const WebCore::IntRect&); + bool startRecognition(int requestId, const WebCore::IntRect& elementRect, const AtomicString& language, const String& grammar); void stopRecording(int); void cancelRecognition(int); // WebSpeechInputListener methods. void didCompleteRecording(int); - void setRecognitionResult(int, const WebString&); + void setRecognitionResult(int, const WebSpeechInputResultArray&); void didCompleteRecognition(int); private: + SpeechInputClientImpl(WebViewClient*); + WebSpeechInputController* m_controller; // To call into the embedder. WebCore::SpeechInputListener* m_listener; }; diff --git a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp index f44e8f1..52a4032 100644 --- a/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp +++ b/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp @@ -34,6 +34,7 @@ #include "AsyncFileSystemCallbacks.h" #include "AsyncFileSystemChromium.h" +#include "FileMetadata.h" #include "ScriptExecutionContext.h" #include "WebFileSystemEntry.h" #include "WebFileInfo.h" @@ -63,9 +64,13 @@ void WebFileSystemCallbacksImpl::didSucceed() delete this; } -void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& info) +void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& webFileInfo) { - m_callbacks->didReadMetadata(info.modificationTime); + FileMetadata fileMetadata; + fileMetadata.modificationTime = webFileInfo.modificationTime; + fileMetadata.length = webFileInfo.length; + fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); + m_callbacks->didReadMetadata(fileMetadata); delete this; } diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 1625eb8..e805c55 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -73,10 +73,14 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl() , m_texture(0) , m_fbo(0) , m_depthStencilBuffer(0) + , m_cachedWidth(0) + , m_cachedHeight(0) , m_multisampleFBO(0) , m_multisampleDepthStencilBuffer(0) , m_multisampleColorBuffer(0) , m_boundFBO(0) + , m_boundTexture(0) + , m_copyTextureToParentTextureFBO(0) #ifdef FLIP_FRAMEBUFFER_VERTICALLY , m_scanline(0) #endif @@ -101,6 +105,7 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer); } glDeleteTextures(1, &m_texture); + glDeleteFramebuffersEXT(1, &m_copyTextureToParentTextureFBO); #ifdef FLIP_FRAMEBUFFER_VERTICALLY if (m_scanline) delete[] m_scanline; @@ -165,12 +170,15 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute validateAttributes(); glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + glEnable(GL_POINT_SPRITE); if (!angleCreateCompilers()) { angleDestroyCompilers(); return false; } + glGenFramebuffersEXT(1, &m_copyTextureToParentTextureFBO); + m_initialized = true; return true; } @@ -211,12 +219,10 @@ void WebGraphicsContext3DDefaultImpl::validateAttributes() void WebGraphicsContext3DDefaultImpl::resolveMultisampledFramebuffer(unsigned x, unsigned y, unsigned width, unsigned height) { if (m_attributes.antialias) { - bool mustRestoreFBO = (m_boundFBO != m_multisampleFBO); glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO); glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo); glBlitFramebufferEXT(x, y, x + width, y + height, x, y, x + width, y + height, GL_COLOR_BUFFER_BIT, GL_LINEAR); - if (mustRestoreFBO) - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); } } @@ -280,6 +286,7 @@ void WebGraphicsContext3DDefaultImpl::prepareTexture() { if (!m_renderDirectlyToWebView) { // We need to prepare our rendering results for the compositor. + makeContextCurrent(); resolveMultisampledFramebuffer(0, 0, m_cachedWidth, m_cachedHeight); } } @@ -558,12 +565,33 @@ void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM() { - // We don't claim support for this extension at this time - return false; + // This extension requires this desktopGL-only function (GLES2 doesn't + // support it), so check for its existence here. + return glGetTexLevelParameteriv; } void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2) { + makeContextCurrent(); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_copyTextureToParentTextureFBO); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER, + GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, + id, + 0); // level + glBindTexture(GL_TEXTURE_2D, id2); + GLsizei width, height; + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height); + glCopyTexImage2D(GL_TEXTURE_2D, + 0, // level + GL_RGBA, + 0, 0, // x, y + width, + height, + 0); // border + glBindTexture(GL_TEXTURE_2D, m_boundTexture); + glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO); } // Helper macros to reduce the amount of code. @@ -688,7 +716,12 @@ void WebGraphicsContext3DDefaultImpl::bindFramebuffer(unsigned long target, WebG DELEGATE_TO_GL_2(bindRenderbuffer, BindRenderbufferEXT, unsigned long, WebGLId) -DELEGATE_TO_GL_2(bindTexture, BindTexture, unsigned long, WebGLId) +void WebGraphicsContext3DDefaultImpl::bindTexture(unsigned long target, WebGLId texture) +{ + makeContextCurrent(); + glBindTexture(target, texture); + m_boundTexture = texture; +} DELEGATE_TO_GL_4(blendColor, BlendColor, double, double, double, double) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index 124ceac..5eebf12 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -288,6 +288,12 @@ private: // For tracking which FBO is bound unsigned int m_boundFBO; + // For tracking which texture is bound + unsigned int m_boundTexture; + + // FBO used for copying child texture to parent texture. + unsigned m_copyTextureToParentTextureFBO; + #ifdef FLIP_FRAMEBUFFER_VERTICALLY unsigned char* m_scanline; void flipVertically(unsigned char* framebuffer, diff --git a/WebKit/chromium/src/WebIDBDatabaseImpl.h b/WebKit/chromium/src/WebIDBDatabaseImpl.h index fda4265..94f1101 100644 --- a/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -39,7 +39,7 @@ namespace WebKit { class WebIDBObjectStore; class WebIDBTransaction; -// See comment in WebIndexedDatabase for a high level overview these classes. +// See comment in WebIDBFactory for a high level overview these classes. class WebIDBDatabaseImpl : public WebIDBDatabase { public: WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>); diff --git a/WebKit/chromium/src/WebIDBFactory.cpp b/WebKit/chromium/src/WebIDBFactory.cpp index b186b68..40eff97 100755 --- a/WebKit/chromium/src/WebIDBFactory.cpp +++ b/WebKit/chromium/src/WebIDBFactory.cpp @@ -31,22 +31,23 @@ #include "config.h" #include "WebIDBFactory.h" -#if ENABLE(INDEXED_DATABASE) - #include "IDBFactoryBackendImpl.h" -#include "SecurityOrigin.h" +#include "WebSecurityOrigin.h" +#include <wtf/UnusedParam.h> using namespace WebCore; namespace WebKit { -WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin) +WebString WebIDBFactory::databaseFileName(const WebSecurityOrigin& origin) { - RefPtr<SecurityOrigin> securityOrigin; - securityOrigin = origin; - return IDBFactoryBackendImpl::databaseFileName(name, securityOrigin.get()); + return IDBFactoryBackendImpl::databaseFileName(origin.get()); } +WebString WebIDBFactory::databaseFileName(const WebString& name, const WebSecurityOrigin& origin) +{ + UNUSED_PARAM(name); + return databaseFileName(origin); } -#endif // ENABLE(INDEXED_DATABASE) +} diff --git a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 96495fe..5dd2652 100755 --- a/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -104,7 +104,7 @@ void WebIDBObjectStoreImpl::removeIndex(const WebString& name, const WebIDBTrans void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) { - m_objectStore->openCursor(IDBKeyRange::create(keyRange.left(), keyRange.right(), keyRange.flags()), direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); + m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } } // namespace WebCore diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index e19308a..65f0fde 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -99,8 +99,10 @@ WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl() { // VideoLayerChromium may outlive this object so make sure all frames are // released. +#if USE(ACCELERATED_COMPOSITING) if (m_videoLayer.get()) m_videoLayer->releaseCurrentFrame(); +#endif } void WebMediaPlayerClientImpl::networkStateChanged() @@ -113,8 +115,10 @@ void WebMediaPlayerClientImpl::readyStateChanged() { ASSERT(m_mediaPlayer); m_mediaPlayer->readyStateChanged(); +#if USE(ACCELERATED_COMPOSITING) if (hasVideo() && supportsAcceleratedRendering() && !m_videoLayer.get()) m_videoLayer = VideoLayerChromium::create(0, this); +#endif } void WebMediaPlayerClientImpl::volumeChanged(float newVolume) @@ -185,8 +189,10 @@ void WebMediaPlayerClientImpl::load(const String& url) // Video frame object is owned by WebMediaPlayer. Before destroying // WebMediaPlayer all frames need to be released. +#if USE(ACCELERATED_COMPOSITING) if (m_videoLayer.get()) m_videoLayer->releaseCurrentFrame(); +#endif m_webMediaPlayer.set(createWebMediaPlayer(this, frame)); if (m_webMediaPlayer.get()) @@ -396,7 +402,14 @@ void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re // check. if (m_webMediaPlayer.get() && !context->paintingDisabled()) { #if WEBKIT_USING_SKIA - m_webMediaPlayer->paint(context->platformContext()->canvas(), rect); + PlatformGraphicsContext* platformContext = context->platformContext(); + WebCanvas* canvas = platformContext->canvas(); + + canvas->saveLayerAlpha(0, platformContext->getNormalizedAlpha()); + + m_webMediaPlayer->paint(canvas, rect); + + canvas->restore(); #elif WEBKIT_USING_CG m_webMediaPlayer->paint(context->platformContext(), rect); #else @@ -418,13 +431,6 @@ bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const return false; } -#if USE(ACCELERATED_COMPOSITING) -bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const -{ - return m_supportsAcceleratedCompositing; -} -#endif - MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const { if (m_webMediaPlayer.get()) @@ -433,6 +439,12 @@ MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const return MediaPlayer::Unknown; } +#if USE(ACCELERATED_COMPOSITING) +bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const +{ + return m_supportsAcceleratedCompositing; +} + VideoFrameChromium* WebMediaPlayerClientImpl::getCurrentFrame() { VideoFrameChromium* videoFrame = 0; @@ -454,6 +466,7 @@ void WebMediaPlayerClientImpl::putCurrentFrame(VideoFrameChromium* videoFrame) delete videoFrame; } } +#endif MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* player) { diff --git a/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 6535094..ca7c43c 100644 --- a/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -48,7 +48,9 @@ class WebMediaPlayer; // This class serves as a bridge between WebCore::MediaPlayer and // WebKit::WebMediaPlayer. class WebMediaPlayerClientImpl : public WebCore::MediaPlayerPrivateInterface +#if USE(ACCELERATED_COMPOSITING) , public WebCore::VideoFrameProvider +#endif , public WebMediaPlayerClient { public: @@ -110,15 +112,14 @@ public: virtual void setSize(const WebCore::IntSize&); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); virtual bool hasSingleSecurityOrigin() const; + virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; #if USE(ACCELERATED_COMPOSITING) virtual bool supportsAcceleratedRendering() const; -#endif - - virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; // VideoFrameProvider methods: virtual WebCore::VideoFrameChromium* getCurrentFrame(); virtual void putCurrentFrame(WebCore::VideoFrameChromium*); +#endif private: WebMediaPlayerClientImpl(); diff --git a/WebKit/chromium/src/WebSecurityOrigin.cpp b/WebKit/chromium/src/WebSecurityOrigin.cpp index 8685738..adccb31 100644 --- a/WebKit/chromium/src/WebSecurityOrigin.cpp +++ b/WebKit/chromium/src/WebSecurityOrigin.cpp @@ -143,6 +143,11 @@ WebSecurityOrigin::operator WTF::PassRefPtr<WebCore::SecurityOrigin>() const return PassRefPtr<SecurityOrigin>(const_cast<WebSecurityOriginPrivate*>(m_private)); } +SecurityOrigin* WebSecurityOrigin::get() const +{ + return m_private; +} + void WebSecurityOrigin::assign(WebSecurityOriginPrivate* p) { // p is already ref'd for us by the caller diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp index 60c4fed..3b56338 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp @@ -57,7 +57,12 @@ WebSpeechInputControllerMockImpl::~WebSpeechInputControllerMockImpl() void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result) { - m_webcoreMock->setRecognitionResult(result); + m_webcoreMock->setRecognitionResult(result, WebString::fromUTF8("")); +} + +void WebSpeechInputControllerMockImpl::setMockRecognitionResult(const WebString& result, const WebString &language) +{ + m_webcoreMock->setRecognitionResult(result, language); } void WebSpeechInputControllerMockImpl::didCompleteRecording(int requestId) @@ -70,14 +75,14 @@ void WebSpeechInputControllerMockImpl::didCompleteRecognition(int requestId) m_listener->didCompleteRecognition(requestId); } -void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WTF::String& result) +void WebSpeechInputControllerMockImpl::setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result) { m_listener->setRecognitionResult(requestId, result); } -bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect) +bool WebSpeechInputControllerMockImpl::startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar) { - return m_webcoreMock->startRecognition(requestId, elementRect); + return m_webcoreMock->startRecognition(requestId, elementRect, language, grammar); } void WebSpeechInputControllerMockImpl::cancelRecognition(int requestId) diff --git a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h index edbfca3..c98f92a 100644 --- a/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h +++ b/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h @@ -54,14 +54,18 @@ public: // WebCore::SpeechInputListener methods. void didCompleteRecording(int requestId); void didCompleteRecognition(int requestId); - void setRecognitionResult(int requestId, const WTF::String& result); + void setRecognitionResult(int requestId, const WebCore::SpeechInputResultArray& result); // WebSpeechInputController methods. - bool startRecognition(int requestId, const WebRect& elementRect); + bool startRecognition(int requestId, const WebRect& elementRect, const WebString& language, const WebString& grammar); void cancelRecognition(int requestId); void stopRecording(int requestId); // WebSpeechInputControllerMock methods. + void setMockRecognitionResult(const WebString& result, const WebString& language); + + // FIXME: this is a fix for a two-sided patch. Delete as soon as the chromium side is patched. + // Chromium patch not uploaded yet, but will depend on http://codereview.chromium.org/3615005/show patch. void setMockRecognitionResult(const WebString& result); private: @@ -72,4 +76,3 @@ private: } // namespace WebKit #endif // WebSpeechInputControllerMockImpl_h - diff --git a/WebKit/chromium/src/WebSpeechInputResult.cpp b/WebKit/chromium/src/WebSpeechInputResult.cpp new file mode 100644 index 0000000..1cafc84 --- /dev/null +++ b/WebKit/chromium/src/WebSpeechInputResult.cpp @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebSpeechInputResult.h" + +#include "SpeechInputResult.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +void WebSpeechInputResult::reset() +{ + m_private.reset(); +} + +WebSpeechInputResult::WebSpeechInputResult(const PassRefPtr<WebCore::SpeechInputResult>& value) + : m_private(value) +{ +} + +void WebSpeechInputResult::set(const WebString& utterance, double confidence) +{ + m_private = WebCore::SpeechInputResult::create(utterance, confidence); +} + +WebSpeechInputResult::operator PassRefPtr<WebCore::SpeechInputResult>() const +{ + return m_private.get(); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index aeab400..57d0ca4 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -33,6 +33,7 @@ #include "AutoFillPopupMenuClient.h" #include "AXObjectCache.h" +#include "BackForwardListImpl.h" #include "Chrome.h" #include "ColorSpace.h" #include "CompositionUnderlineVectorBuilder.h" @@ -88,6 +89,7 @@ #include "SecurityOrigin.h" #include "SelectionController.h" #include "Settings.h" +#include "SpeechInputClientImpl.h" #include "Timer.h" #include "TypingCommand.h" #include "UserGestureIndicator.h" @@ -182,6 +184,8 @@ static const PopupContainerSettings autoFillPopupSettings = { PopupContainerSettings::DOMElementDirection, }; +static bool shouldUseExternalPopupMenus = false; + // WebView ---------------------------------------------------------------- WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient) @@ -193,6 +197,11 @@ WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devTools return adoptRef(new WebViewImpl(client, devToolsClient)).leakRef(); } +void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus) +{ + shouldUseExternalPopupMenus = useExternalPopupMenus; +} + void WebView::updateVisitedLinkState(unsigned long long linkHash) { Page::visitedStateChanged(PageGroup::pageGroup(pageGroupName), linkHash); @@ -275,7 +284,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_compositorCreationFailed(false) #endif #if ENABLE(INPUT_SPEECH) - , m_speechInputClient(client) + , m_speechInputClient(SpeechInputClientImpl::create(client)) #endif , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0)) { @@ -298,13 +307,13 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools pageClients.dragClient = &m_dragClientImpl; pageClients.inspectorClient = &m_inspectorClientImpl; #if ENABLE(INPUT_SPEECH) - pageClients.speechInputClient = &m_speechInputClient; + pageClients.speechInputClient = m_speechInputClient.get(); #endif pageClients.deviceOrientationClient = m_deviceOrientationClientProxy.get(); m_page.set(new Page(pageClients)); - m_page->backForwardList()->setClient(&m_backForwardListClientImpl); + static_cast<BackForwardListImpl*>(m_page->backForwardList())->setClient(&m_backForwardListClientImpl); m_page->setGroupName(pageGroupName); m_inspectorSettingsMap.set(new SettingsMap); @@ -1039,6 +1048,10 @@ void WebViewImpl::composite(bool finish) // Put result onscreen. m_layerRenderer->present(); + + GraphicsContext3D* context = m_layerRenderer->context(); + if (context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) + reallocateRenderer(); #endif } @@ -2107,6 +2120,11 @@ void WebViewImpl::didCommitLoad(bool* isNewNavigation) m_observedNewNavigation = false; } +bool WebViewImpl::useExternalPopupMenus() +{ + return shouldUseExternalPopupMenus; +} + bool WebViewImpl::navigationPolicyFromMouseEvent(unsigned short button, bool ctrl, bool shift, bool alt, bool meta, @@ -2476,6 +2494,22 @@ void WebViewImpl::doComposite() // Draw the actual layers... m_layerRenderer->drawLayers(visibleRect, contentRect); } + +void WebViewImpl::reallocateRenderer() +{ + GraphicsContext3D* context = m_layerRenderer->context(); + RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create(context->getContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext); + + // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. + if (layerRenderer) + m_layerRenderer->transferRootLayer(layerRenderer.get()); + m_layerRenderer = layerRenderer; + + // Enable or disable accelerated compositing and request a refresh. + setRootGraphicsLayer(m_layerRenderer ? m_layerRenderer->rootLayer() : 0); +} #endif @@ -2491,10 +2525,8 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D() else { GraphicsContext3D::Attributes attributes; m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); -#if OS(DARWIN) if (m_temporaryOnscreenGraphicsContext3D) m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); -#endif context = m_temporaryOnscreenGraphicsContext3D.get(); } return GraphicsContext3DInternal::extractWebGraphicsContext3D(context); diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index 050b5e1..0388770 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -49,7 +49,6 @@ #include "IntRect.h" #include "LayerRendererChromium.h" #include "NotificationPresenterImpl.h" -#include "SpeechInputClientImpl.h" #include <wtf/OwnPtr.h> #include <wtf/RefCounted.h> @@ -74,6 +73,7 @@ class AutoFillPopupMenuClient; class ContextMenuClientImpl; class DeviceOrientationClientProxy; class DragScrollTimer; +class SpeechInputClientImpl; class WebAccessibilityObject; class WebDevToolsAgentClient; class WebDevToolsAgentPrivate; @@ -273,6 +273,10 @@ public: // load. void didCommitLoad(bool* isNewNavigation); + // Returns true if popup menus should be rendered by the browser, false if + // they should be rendered by WebKit (which is the default). + static bool useExternalPopupMenus(); + bool contextMenuAllowed() const { return m_contextMenuAllowed; @@ -406,6 +410,7 @@ private: void updateRootLayerContents(const WebCore::IntRect&); void doComposite(); void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); + void reallocateRenderer(); #endif WebViewClient* m_client; @@ -543,7 +548,7 @@ private: static const WebInputEvent* m_currentInputEvent; #if ENABLE(INPUT_SPEECH) - SpeechInputClientImpl m_speechInputClient; + OwnPtr<SpeechInputClientImpl> m_speechInputClient; #endif // If we attempt to fetch the on-screen GraphicsContext3D before // the compositor has been turned on, we need to instantiate it diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index 5cebb52..2b264ee 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -245,146 +245,6 @@ TestSuite.prototype.testEnableResourcesTab = function() /** - * Tests that correct content length is reported for resources. - */ -TestSuite.prototype.testResourceContentLength = function() -{ - this.showPanel("resources"); - var test = this; - - var png = false; - var html = false; - this.addSniffer(WebInspector, "updateResource", - function(payload) { - if (!payload.didLengthChange) - return; - var resource = WebInspector.resources[payload.id]; - if (!resource || !resource.url) - return; - if (resource.url.search("image.html") !== -1) { - var expectedLength = 87; - test.assertTrue( - resource.resourceSize <= expectedLength, - "image.html content length is greater thatn expected."); - if (expectedLength === resource.resourceSize) - html = true; - } else if (resource.url.search("image.png") !== -1) { - var expectedLength = 257796; - test.assertTrue( - resource.resourceSize <= expectedLength, - "image.png content length is greater than expected."); - if (expectedLength === resource.resourceSize) - png = true; - } - if (html && png) { - // Wait 1 second before releasing control to check that the content - // lengths are not updated anymore. - setTimeout(function() { - test.releaseControl(); - }, 1000); - } - }, true); - - // Make sure resource tracking is on. - WebInspector.panels.resources._enableResourceTracking(); - // Reload inspected page to update all resources. - test.evaluateInConsole_( - "window.location.reload(true);", - function(resultText) { - test.assertEquals("undefined", resultText, "Unexpected result of reload()."); - }); - - // We now have some time to report results to controller. - this.takeControl(); -}; - - -/** - * Tests resource headers. - */ -TestSuite.prototype.testResourceHeaders = function() -{ - this.showPanel("resources"); - - var test = this; - - var responseOk = false; - var timingOk = false; - - this.addSniffer(WebInspector, "updateResource", - function(payload) { - var resource = this.resources[payload.id]; - if (!resource || resource.mainResource) { - // We are only interested in secondary resources in this test. - return; - } - - var requestHeaders = JSON.stringify(resource.requestHeaders); - test.assertContains(requestHeaders, "Accept"); - - if (payload.didResponseChange) { - var responseHeaders = JSON.stringify(resource.responseHeaders); - test.assertContains(responseHeaders, "Content-type"); - test.assertContains(responseHeaders, "Content-Length"); - test.assertTrue(typeof resource.responseReceivedTime !== "undefined"); - responseOk = true; - } - - if (payload.didTimingChange) { - test.assertTrue(typeof resource.startTime !== "undefined"); - timingOk = true; - } - - if (payload.didCompletionChange) { - test.assertTrue(responseOk); - test.assertTrue(timingOk); - test.assertTrue(typeof resource.endTime !== "undefined"); - test.releaseControl(); - } - }, true); - - WebInspector.panels.resources._enableResourceTracking(); - this.takeControl(); -}; - - -/** - * Tests the mime type of a cached (HTTP 304) resource. - */ -TestSuite.prototype.testCachedResourceMimeType = function() -{ - this.showPanel("resources"); - - var test = this; - var hasReloaded = false; - - this.addSniffer(WebInspector, "updateResource", - function(payload) { - var resource = this.resources[payload.id]; - if (!resource || resource.mainResource) { - // We are only interested in secondary resources in this test. - return; - } - - if (payload.didResponseChange) { - // Test server uses a default mime type for JavaScript files. - test.assertEquals("text/html", payload.mimeType); - if (!hasReloaded) { - hasReloaded = true; - // Reload inspected page to update all resources. - test.evaluateInConsole_("window.location.reload(true);", function() {}); - } else - test.releaseControl(); - } - - }, true); - - WebInspector.panels.resources._enableResourceTracking(); - this.takeControl(); -}; - - -/** * Tests that profiler works. */ TestSuite.prototype.testProfilerTab = function() diff --git a/WebKit/chromium/src/mac/WebInputEventFactory.mm b/WebKit/chromium/src/mac/WebInputEventFactory.mm index b4e09c0..015409e 100644 --- a/WebKit/chromium/src/mac/WebInputEventFactory.mm +++ b/WebKit/chromium/src/mac/WebInputEventFactory.mm @@ -856,6 +856,8 @@ static inline int modifiersFromEvent(NSEvent* event) { modifiers |= WebInputEvent::AltKey; if ([event modifierFlags] & NSCommandKeyMask) modifiers |= WebInputEvent::MetaKey; + if ([event modifierFlags] & NSAlphaShiftKeyMask) + modifiers |= WebInputEvent::CapsLockOn; // TODO(port): Set mouse button states return modifiers; |