diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
| commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
| tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebKit/chromium | |
| parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
| download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz | |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebKit/chromium')
97 files changed, 4062 insertions, 633 deletions
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index b373ff1c0..f5157860d 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,1347 @@ +2012-05-18 MORITA Hajime <morrita@google.com> + + https://bugs.webkit.org/show_bug.cgi?id=85515 + Stale frame in WebCore::SpellChecker::didCheckSucceeded + + Added WebTextCheckingCompletionImpl::invalidate() to mark + pending spellcheck request as invalid, and added frameWillDetachPage() + to fire it. + + Reviewed by Ryosuke Niwa. + + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::frameWillDetachPage): + (WebKit): + (WebKit::EditorClientImpl::requestCheckingOfString): + (WebKit::EditorClientImpl::didCheckString): + * src/EditorClientImpl.h: + (WebKit): + (EditorClientImpl): + * src/WebTextCheckingCompletionImpl.cpp: + (WebKit::WebTextCheckingCompletionImpl::didFinishCheckingText): + (WebKit::WebTextCheckingCompletionImpl::didCancelCheckingText): + (WebKit::WebTextCheckingCompletionImpl::invalidate): + (WebKit): + * src/WebTextCheckingCompletionImpl.h: + (WebKit): + (WebKit::WebTextCheckingCompletionImpl::WebTextCheckingCompletionImpl): + (WebTextCheckingCompletionImpl): + (WebKit::WebTextCheckingCompletionImpl::spellChecker): + +2012-05-18 Jochen Eisinger <jochen@chromium.org> + + [chromium] plumb the frame for which a drag was initiated to the WebViewClient + https://bugs.webkit.org/show_bug.cgi?id=86670 + + Reviewed by Kent Tamura. + + * public/WebViewClient.h: + (WebKit::WebViewClient::startDragging): + (WebViewClient): + * src/DragClientImpl.cpp: + (WebKit::DragClientImpl::startDrag): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::startDragging): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-17 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Move Web Workers methods to Platform.h + https://bugs.webkit.org/show_bug.cgi?id=86799 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * WebKit.gyp: + * public/WebWorkerRunLoop.h: + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKitPlatformSupport): + * src/PlatformSupport.cpp: + (WebCore::PlatformSupport::didStartWorkerRunLoop): + (WebCore::PlatformSupport::didStopWorkerRunLoop): + +2012-05-17 Dana Jansens <danakj@chromium.org> + + [chromium] Scale all compositor output by the defaultDeviceScaleFactor + https://bugs.webkit.org/show_bug.cgi?id=86051 + + Reviewed by James Robinson. + + Add the applyDefaultDeviceScaleInCompositor setting. When enabled, we + apply the scale factor during compositing instead of applying it through + the pageScaleFactor. + + NonCompositedContentHost is the GraphicLayerClient for the GraphicsLayer + containing the document's body. It needs to report the page/device scale + that should be used when scaling the contents of the GraphicsLayer, and + when changes occur to them such that its contentsSize or contentsScale + is affected. + + Store the deviceScaleFactor being used in the compositor. The remainder + of the deviceScaleFactor() is being applied to the pageScale. + + * public/WebSettings.h: + * src/NonCompositedContentHost.cpp: + (WebKit::NonCompositedContentHost::NonCompositedContentHost): + (WebKit::NonCompositedContentHost::setViewport): + * src/NonCompositedContentHost.h: + (NonCompositedContentHost): + * src/WebLayerTreeView.cpp: + (WebKit::WebLayerTreeView::Settings::operator CCSettings): + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor): + (WebKit): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::applyDefaultDeviceScaleFactorInCompositor): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setPageScaleFactor): + (WebKit::WebViewImpl::setDeviceScaleFactor): + (WebKit::WebViewImpl::enableFixedLayoutMode): + (WebKit::WebViewImpl::computePageScaleFactorLimits): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::updateLayerTreeViewport): + * src/WebViewImpl.h: + * tests/CCLayerTreeHostTest.cpp: + (MockLayerTreeHostImpl): + (WTF::MockLayerTreeHost::createLayerTreeHostImpl): + (CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers): + (WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers): + (WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::beginTest): + (WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::commitCompleteOnCCThread): + (WTF::CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers::afterTest): + (WTF): + (WTF::TEST_F): + * tests/LayerRendererChromiumTest.cpp: + * tests/WebFrameTest.cpp: + (WebKit::TEST_F): + +2012-05-17 Vangelis Kokkevis <vangelis@chromium.org> + + Expose layer tiling size options to WebSettings. + https://bugs.webkit.org/show_bug.cgi?id=86425 + + This will allow tiling parameters to be set via command line flags + passed to the Renderer. + + Reviewed by Adrienne Walker. + + * public/WebSettings.h: + * src/WebLayerTreeView.cpp: + (WebKit::WebLayerTreeView::Settings::operator CCSettings): + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::WebSettingsImpl): + (WebKit::WebSettingsImpl::setDefaultTileSize): + (WebKit): + (WebKit::WebSettingsImpl::setMaxUntiledLayerSize): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::defaultTileSize): + (WebKit::WebSettingsImpl::maxUntiledLayerSize): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + +2012-05-17 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Move fileUtilities to Platform.h + https://bugs.webkit.org/show_bug.cgi?id=86777 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * WebKit.gyp: + * public/WebFileUtilities.h: + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKitPlatformSupport): + * src/PlatformSupport.cpp: + (WebCore::PlatformSupport::fileExists): + (WebCore::PlatformSupport::deleteFile): + (WebCore::PlatformSupport::deleteEmptyDirectory): + (WebCore::PlatformSupport::getFileSize): + (WebCore::PlatformSupport::revealFolderInOS): + (WebCore::PlatformSupport::getFileModificationTime): + (WebCore::PlatformSupport::directoryName): + (WebCore::PlatformSupport::pathByAppendingComponent): + (WebCore::PlatformSupport::makeAllDirectories): + (WebCore::PlatformSupport::getAbsolutePath): + (WebCore::PlatformSupport::isDirectory): + (WebCore::PlatformSupport::filePathToURL): + (WebCore::PlatformSupport::openFile): + (WebCore::PlatformSupport::closeFile): + (WebCore::PlatformSupport::seekFile): + (WebCore::PlatformSupport::truncateFile): + (WebCore::PlatformSupport::readFromFile): + (WebCore::PlatformSupport::writeToFile): + +2012-05-17 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Remove IDBIndex.storeName + https://bugs.webkit.org/show_bug.cgi?id=86676 + + Reviewed by Tony Chang. + + * public/WebIDBIndex.h: + (WebIDBIndex): Can't remove from here until Chromium is updated + * src/IDBIndexBackendProxy.cpp: Removed storeName() + * src/IDBIndexBackendProxy.h: Removed storeName() + (IDBIndexBackendProxy): + * src/WebIDBIndexImpl.cpp: Removed storeName() + * src/WebIDBIndexImpl.h: Removed storeName() + (WebIDBIndexImpl): + +2012-05-17 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Implement IDBObjectStore.autoIncrement + https://bugs.webkit.org/show_bug.cgi?id=86662 + + Reviewed by Dimitri Glazkov. + + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::autoIncrement): + (WebKit): + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::autoIncrement): + (WebKit): + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + +2012-05-17 Mikhail Naganov <mnaganov@chromium.org> + + Support Copy ... actions for the Web Inspector remote debugging mode. + https://bugs.webkit.org/show_bug.cgi?id=86621 + + Reviewed by Pavel Feldman. + + * src/js/DevTools.js: + (WebInspector.clipboardAccessDeniedMessage): + +2012-05-17 Hironori Bono <hbono@chromium.org> + + [Refactoring] Move platform-specific code in Editor::respondToChangedSelection to the WebKit layer + https://bugs.webkit.org/show_bug.cgi?id=86591 + + Reviewed by Ryosuke Niwa. + + This change adds a TextCheckerClient::shouldEraseMarkersAfterChangeSelection + function to remove platform-specific code from Editor::respondToChangedSelection + function. + + No new tests, no change in behavior. + + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::shouldEraseMarkersAfterChangeSelection): + (WebKit): + * src/EditorClientImpl.h: + (EditorClientImpl): + +2012-05-11 James Robinson <jamesr@chromium.org> + + [chromium] Convert GraphicsLayerChromium to use WebLayer types + https://bugs.webkit.org/show_bug.cgi?id=86269 + + Reviewed by Adrienne Walker. + + * WebKit.gyp: + * src/WebContentLayer.cpp: + (WebKit::WebContentLayer::clearClient): + (WebKit): + (WebKit::WebContentLayer::setDrawsContent): + (WebKit::WebContentLayer::drawsContent): + (WebKit::WebContentLayer::WebContentLayer): + (WebKit::WebContentLayer::operator=): + (WebKit::WebContentLayer::operator PassRefPtr<ContentLayerChromium>): + * src/WebContentLayerImpl.cpp: + * src/WebContentLayerImpl.h: + (WebContentLayerImpl): + * src/WebLayer.cpp: + (WebKit::WebLayer::setSublayerTransform): + (WebKit): + (WebKit::WebLayer::setTransform): + (WebKit::WebLayer::setIsDrawable): + (WebKit::WebLayer::setPreserves3D): + (WebKit::WebLayer::setDoubleSided): + (WebKit::WebLayer::setBackgroundColor): + (WebKit::WebLayer::setContentsScale): + * tests/ImageLayerChromiumTest.cpp: + (WebCore::TEST): + +2012-05-17 Dan Bernstein <mitz@apple.com> + + REGRESSION (r117428): WebKit API/SPI was removed + https://bugs.webkit.org/show_bug.cgi?id=86748 + + Reverted r117428. + + * public/WebView.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setDomainRelaxationForbidden): + (WebKit): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-17 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Convert setDomainRelaxationForbiddenForURLScheme to use InternalSettings interface + https://bugs.webkit.org/show_bug.cgi?id=86704 + + Reviewed by Eric Seidel. + + Remove setDomainRelaxationForbiddenForURLScheme functions, because it is able to work in the + cross-port way through the InternalSettings interface. + + * public/WebView.h: + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-17 MORITA Hajime <morrita@google.com> + + Unreviewed attempt to fix a Windows build breakage. + + * public/WebIntent.h: + (WebIntent): + +2012-05-16 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r117396. + http://trac.webkit.org/changeset/117396 + https://bugs.webkit.org/show_bug.cgi?id=86709 + + "breaks chromium tree" (Requested by morrita on #webkit). + + * WebKit.gyp: + * public/WebTextInputInfo.h: Removed. + * public/WebTextInputType.h: + * public/WebWidget.h: + (WebKit::WebWidget::textInputType): + * src/WebTextInputInfo.cpp: Removed. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::textInputType): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-16 Hao Zheng <zhenghao@chromium.org> + + [chromium] Get text direction at the start and end of selection. + https://bugs.webkit.org/show_bug.cgi?id=86573 + + Reviewed by Adam Barth. + + Add an interface to get text direction at the start and end of + selection for Android, as on Android different selection delimiters + are needed for RTL text. Unlike other platforms, the start and end + delimiters of selection are different, so we need determine the shape + of delimiter based on text direction. + + * public/WebWidget.h: + (WebWidget): + (WebKit::WebWidget::selectionTextDirection): + * src/WebViewImpl.cpp: + (WebKit): + (WebKit::WebViewImpl::selectionTextDirection): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-16 Adam Barth <abarth@webkit.org> + + [Chromium] Implement WebViewImpl::textInputInfo() for Android + https://bugs.webkit.org/show_bug.cgi?id=86440 + + Reviewed by Darin Fisher. + + This patch adds WebView::textInputInfo(), which describes the text + input that currently has focus. Android is planning to use this to + determine what sort of keyboard or text entry UI to show. This API + subsumes the textInputType() API, which will be removed once the + clients have been updated. + + * WebKit.gyp: + * public/WebTextInputInfo.h: Added. + (WebKit): + (WebTextInputInfo): + (WebKit::WebTextInputInfo::WebTextInputInfo): + (WebKit::operator==): + (WebKit::operator!=): + * public/WebTextInputType.h: + * public/WebWidget.h: + (WebWidget): + (WebKit::WebWidget::textInputInfo): + (WebKit::WebWidget::textInputType): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::textInputInfo): + (WebKit): + (WebKit::WebViewImpl::textInputType): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-16 Greg Billock <gbillock@google.com> + + IDL and implementation for Web Intents delivery + https://bugs.webkit.org/show_bug.cgi?id=83634 + + Reviewed by Adam Barth. + + The embedder will implement the WebDeliveredIntentClient interface, which + will get notifications of postResult/postFailure from the service page. + + * public/WebDeliveredIntentClient.h: + * public/WebFrame.h: + (WebKit): + (WebFrame): + * src/WebDeliveredIntentClient.cpp: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::deliverIntent): + (WebKit): + * src/WebFrameImpl.h: + (WebFrameImpl): + +2012-05-16 James Robinson <jamesr@chromium.org> + + GraphicsContext3D interface should not be aware of CanvasRenderingContext + https://bugs.webkit.org/show_bug.cgi?id=86550 + + Reviewed by Darin Adler. + + Updates chromium implementation of GraphicsContext3D for API change and removes a bunch of unnecessary + #includes. + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DPrivate::paintCompositedResultsToCanvas): + (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): + * src/GraphicsContext3DPrivate.h: + (GraphicsContext3DPrivate): + +2012-05-16 Joshua Bell <jsbell@chromium.org> + + [Chromium] IndexedDB: WebKit API for IDBObjectStore.autoIncrement property + https://bugs.webkit.org/show_bug.cgi?id=86661 + + Reviewed by Dimitri Glazkov. + + * public/WebIDBObjectStore.h: + (WebKit::WebIDBObjectStore::autoIncrement): + +2012-05-16 Varun Jain <varunjain@google.com> + + [chromium] No modifier flags (shift/ctrl/alt) in drag&drop events on chromium linux + https://bugs.webkit.org/show_bug.cgi?id=86236 + + Reviewed by Tony Chang. + + * public/WebView.h: + (WebView): + * src/WebViewImpl.cpp: + (WebKit::webInputEventKeyStateToPlatformEventKeyState): + (WebKit): + (WebKit::WebViewImpl::dragTargetDragEnter): + (WebKit::WebViewImpl::dragTargetDragOver): + (WebKit::WebViewImpl::dragTargetDrop): + (WebKit::WebViewImpl::dragTargetDragEnterOrOver): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-05-16 Yury Semikhatsky <yurys@chromium.org> + + [Chromium] Web Inspector: DevToolsSanityTest.TestScriptsTabIsPopulatedOnInspectedPageRefresh is broken + https://bugs.webkit.org/show_bug.cgi?id=86629 + + Reviewed by Pavel Feldman. + + Listen to DebuggerModel instead of DebuggerPresentationModel which is gone. + + * src/js/Tests.js: + (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.waitUntilScriptIsParsed): + +2012-05-16 Yury Semikhatsky <yurys@chromium.org> + + [Chromium] Web Inspector: debugger browser tests are broken + https://bugs.webkit.org/show_bug.cgi?id=86624 + + Reviewed by Vsevolod Vlasov. + + Use WebInspector.panels.scripts._scriptMapping instead of + WebInspector.panels.scripts._presentationModel as the latter + has been deleted. + + * src/js/Tests.js: + (.TestSuite.prototype.nonAnonymousUISourceCodes_): + +2012-05-16 Keishi Hattori <keishi@webkit.org> + + [chromium] Add WebKit API to access inner text value of input element + https://bugs.webkit.org/show_bug.cgi?id=85353 + + Reviewed by Kent Tamura. + + * public/WebInputElement.h: + (WebInputElement): + * src/WebInputElement.cpp: + (WebKit::WebInputElement::editingValue): + (WebKit): + (WebKit::WebInputElement::setEditingValue): + +2012-05-16 Hans Wennborg <hans@chromium.org> + + Speech JavaScript API: pass WebSecurityOrigin to embedder + https://bugs.webkit.org/show_bug.cgi?id=86348 + + Reviewed by Adam Barth. + + Pass the WebSecurityOrigin of the SpeecReco object to the embedder when calling + start(). The origin will be used to determine whether speech recognition is + allowed or not. + + * public/WebSpeechRecognitionParams.h: + (WebKit::WebSpeechRecognitionParams::WebSpeechRecognitionParams): + (WebKit::WebSpeechRecognitionParams::origin): + (WebSpeechRecognitionParams): + * src/SpeechRecognitionClientProxy.cpp: + (WebKit::SpeechRecognitionClientProxy::start): + +2012-05-15 Tien-Ren Chen <trchen@chromium.org> + + [Chromium] CCTimer::isActive() is incorrect inside tick callback + https://bugs.webkit.org/show_bug.cgi?id=86513 + + Update test cases to verify CCTimer::isActive() values. + + Reviewed by James Robinson. + + * tests/CCTimerTest.cpp: + (WebKitTests::TEST_F): + +2012-05-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r117204. + http://trac.webkit.org/changeset/117204 + https://bugs.webkit.org/show_bug.cgi?id=86559 + + causing win compilation failures (Requested by pilgrim_google_ + on #webkit). + + * WebKit.gyp: + * public/WebMessagePortChannel.h: + (WebKit): + (WebMessagePortChannel): + (WebKit::WebMessagePortChannel::~WebMessagePortChannel): + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKitPlatformSupport): + (WebKit::WebKitPlatformSupport::createMessagePortChannel): + * src/PlatformMessagePortChannel.cpp: + (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel): + * src/PlatformMessagePortChannel.h: + * src/SharedWorkerRepository.cpp: + * src/WebSharedWorkerImpl.cpp: + * src/WebWorkerClientImpl.cpp: + +2012-05-15 Shinya Kawanaka <shinyak@chromium.org> + + Rename Node::shadowTreeRootNode() to Node::shadowRoot() + https://bugs.webkit.org/show_bug.cgi?id=86449 + + Reviewed by Darin Adler. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::scopeStringMatches): + +2012-05-15 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Move createMessagePortChannel to Platform.h + https://bugs.webkit.org/show_bug.cgi?id=85764 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * WebKit.gyp: + * public/WebMessagePortChannel.h: + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKit::WebKitPlatformSupport::injectIDBKeyIntoSerializedValue): + * src/PlatformMessagePortChannel.cpp: + (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel): + * src/PlatformMessagePortChannel.h: + * src/SharedWorkerRepository.cpp: + * src/WebSharedWorkerImpl.cpp: + * src/WebWorkerClientImpl.cpp: + +2012-05-15 Fady Samuel <fsamuel@chromium.org> + + [Chromium] Reset ScriptInstance in HTMLPlugInElement on WebPluginContainerImpl::setPlugin + https://bugs.webkit.org/show_bug.cgi?id=86535 + + Reviewed by Darin Fisher. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::setPlugin): + (WebKit): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + +2012-05-15 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Move blobRegistry to Platform.h + https://bugs.webkit.org/show_bug.cgi?id=85765 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * WebKit.gyp: + * public/platform/WebBlobData.h: + * public/platform/WebBlobRegistry.h: + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKit::WebKitPlatformSupport::cookieJar): + * src/BlobRegistryProxy.cpp: + (WebCore::BlobRegistryProxy::BlobRegistryProxy): + * src/WebBlobData.cpp: + +2012-05-15 Kausalya Madhusudhanan <kmadhusu@chromium.org> + + [chromium] Overloaded printBegin() function to support auto fit to page functionality. + https://bugs.webkit.org/show_bug.cgi?id=84312 + + Reviewed by Darin Fisher. + + * WebKit.gyp: + * public/WebFrame.h: + (WebKit): + (WebFrame): + * public/WebPlugin.h: + (WebKit): + (WebPlugin): + (WebKit::WebPlugin::printBegin): + * public/WebPrintParams.h: Added. + (WebKit): + (WebPrintParams): + (WebKit::WebPrintParams::WebPrintParams): + * src/WebFrameImpl.cpp: + (WebKit::ChromePluginPrintContext::ChromePluginPrintContext): + (WebKit::ChromePluginPrintContext::computePageRects): + (ChromePluginPrintContext): + (WebKit): + (WebKit::WebFrameImpl::printBegin): + * src/WebFrameImpl.h: + (WebKit): + (WebFrameImpl): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::printBegin): + * src/WebPluginContainerImpl.h: + (WebKit): + (WebPluginContainerImpl): + +2012-05-15 Shawn Singh <shawnsingh@chromium.org> + + [chromium] Add unit testing to WebTransformationMatrix + https://bugs.webkit.org/show_bug.cgi?id=86421 + + Reviewed by Adrienne Walker. + + * WebKit.gypi: + * tests/WebTransformationMatrixTest.cpp: Added. + (WebKit): + (WebKit::printTransform): + (WebKit::initializeTestMatrix): + (WebKit::initializeTestMatrix2): + (WebKit::TEST): + +2012-05-15 James Robinson <jamesr@chromium.org> + + [chromium] Chromium port never sets USE(CG) so code behind it is dead + https://bugs.webkit.org/show_bug.cgi?id=86537 + + Reviewed by Adrienne Walker. + + Deletes code behind USE(CG) in chromium-specific code and removes unneeded USE(SKIA) guards. + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): + (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): + (WebCore::GraphicsContext3DPrivate::grContext): + (WebCore::GraphicsContext3DPrivate::paintFramebufferToCanvas): + (WebCore::GraphicsContext3D::grContext): + * src/GraphicsContext3DPrivate.h: + (GraphicsContext3DPrivate): + * src/PlatformSupport.cpp: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::doPixelReadbackToCanvas): + +2012-05-15 Anders Carlsson <andersca@apple.com> + + Set the new PlatformWheelEvent member variables to sane defaults + https://bugs.webkit.org/show_bug.cgi?id=86542 + + Reviewed by Andreas Kling. + + * src/WebInputEventConversion.cpp: + (WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder): + +2012-05-15 Ian Vollick <vollick@chromium.org> + + [chromium] Ensure animations get ticked at least once when added. + https://bugs.webkit.org/show_bug.cgi?id=86013 + + Reviewed by James Robinson. + + * tests/CCLayerTreeHostTest.cpp: + (WTF::CCLayerTreeHostTestTickAnimationWhileBackgrounded::animateLayers): + (WTF): + +2012-05-15 Alexandre Elias <aelias@google.com> + + [chromium] Fix unsafe viewport tag dispatch + https://bugs.webkit.org/show_bug.cgi?id=80554 + + Reviewed by Adam Barth. + + In some uncommon situations (such as window.open() new tab on + Android), dispatchViewportPropertiesDidChange may early-return without + setting the page scale because the window size is not yet + available from the embedder. At that point, the previous behavior was + to call it again in layoutUpdated(), but this is unsafe since it + leaves a pending needsLayout. + + I moved the dispatch call into WebViewImpl::didChangeContentsSize and + WebViewImpl::resize() instead -- these represent more explicitly the + situations where the inputs to the viewport tag calculation change. I + removed the other dispatch call from setFrameRect as it's now + redundant. + + Covered by FixedLayoutInitializeAtMinimumPageScale test introduced + in http://webk.it/82949 (an assertion will fire there without + this fix). + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::layoutUpdated): + (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + (WebKit::WebViewImpl::didChangeContentsSize): + +2012-05-15 James Robinson <jamesr@chromium.org> + + [chromium] Move createOffscreenGraphicsContext3D() from WebKitPlatformSupport to Platform + https://bugs.webkit.org/show_bug.cgi?id=86524 + + Reviewed by Adam Barth. + + Moves createOffscreenGraphicsContext3D() out (to WebKit::Platform) and updates GraphicsContext3DChromium to use + the new location. Also removes a few unnecessary includes from GraphicsContext3DChromium.cpp. + + * public/platform/WebKitPlatformSupport.h: + (WebKitPlatformSupport): + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3D::create): + +2012-05-15 Terry Anderson <tdanderson@chromium.org> + + [chromium] Compute the best target node on a GestureTap event + https://bugs.webkit.org/show_bug.cgi?id=85101 + + Reviewed by Adam Barth. + + * features.gypi: + Enable the touch adjustment code by default. + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + In the case of a GestureTap, deltaX represents the horizontal padding of the touch + area and deltaY represents the vertical padding of the touch area. + +2012-05-15 James Robinson <jamesr@chromium.org> + + Unreviewed, rolling out r116811. + http://trac.webkit.org/changeset/116811 + https://bugs.webkit.org/show_bug.cgi?id=86257 + + Introduced layering violation + + * WebKit.gyp: + * src/Extensions3DChromium.cpp: Renamed from Source/WebCore/platform/chromium/support/Extensions3DChromium.cpp. + (WebCore): + (WebCore::Extensions3DChromium::Extensions3DChromium): + (WebCore::Extensions3DChromium::~Extensions3DChromium): + (WebCore::Extensions3DChromium::supports): + (WebCore::Extensions3DChromium::ensureEnabled): + (WebCore::Extensions3DChromium::isEnabled): + (WebCore::Extensions3DChromium::getGraphicsResetStatusARB): + (WebCore::Extensions3DChromium::blitFramebuffer): + (WebCore::Extensions3DChromium::renderbufferStorageMultisample): + (WebCore::Extensions3DChromium::postSubBufferCHROMIUM): + (WebCore::Extensions3DChromium::mapBufferSubDataCHROMIUM): + (WebCore::Extensions3DChromium::unmapBufferSubDataCHROMIUM): + (WebCore::Extensions3DChromium::mapTexSubImage2DCHROMIUM): + (WebCore::Extensions3DChromium::unmapTexSubImage2DCHROMIUM): + (WebCore::Extensions3DChromium::setVisibilityCHROMIUM): + (WebCore::Extensions3DChromium::discardFramebufferEXT): + (WebCore::Extensions3DChromium::ensureFramebufferCHROMIUM): + (WebCore::Extensions3DChromium::setGpuMemoryAllocationChangedCallbackCHROMIUM): + (WebCore::Extensions3DChromium::createVertexArrayOES): + (WebCore::Extensions3DChromium::deleteVertexArrayOES): + (WebCore::Extensions3DChromium::isVertexArrayOES): + (WebCore::Extensions3DChromium::bindVertexArrayOES): + (WebCore::Extensions3DChromium::getTranslatedShaderSourceANGLE): + (WebCore::Extensions3DChromium::setSwapBuffersCompleteCallbackCHROMIUM): + (WebCore::Extensions3DChromium::rateLimitOffscreenContextCHROMIUM): + (WebCore::Extensions3DChromium::paintFramebufferToCanvas): + (WebCore::Extensions3DChromium::texImageIOSurface2DCHROMIUM): + (WebCore::Extensions3DChromium::texStorage2DEXT): + (WebCore::Extensions3DChromium::createQueryEXT): + (WebCore::Extensions3DChromium::deleteQueryEXT): + (WebCore::Extensions3DChromium::isQueryEXT): + (WebCore::Extensions3DChromium::beginQueryEXT): + (WebCore::Extensions3DChromium::endQueryEXT): + (WebCore::Extensions3DChromium::getQueryivEXT): + (WebCore::Extensions3DChromium::getQueryObjectuivEXT): + * src/GraphicsContext3DChromium.cpp: Renamed from Source/WebCore/platform/chromium/support/GraphicsContext3DChromium.cpp. + (WebCore): + (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate): + (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate): + (WebCore::GraphicsContext3DPrivate::createGraphicsContextFromWebContext): + (WebCore::GraphicsContext3DPrivate::extractWebGraphicsContext3D): + (WebCore::GraphicsContext3DPrivate::platformGraphicsContext3D): + (WebCore::GraphicsContext3DPrivate::platformTexture): + (GrMemoryAllocationChangedCallback): + (WebCore::GrMemoryAllocationChangedCallback::GrMemoryAllocationChangedCallback): + (WebCore::GrMemoryAllocationChangedCallback::onGpuMemoryAllocationChanged): + (WebCore::GraphicsContext3DPrivate::grContext): + (WebCore::GraphicsContext3DPrivate::prepareTexture): + (WebCore::GraphicsContext3DPrivate::markContextChanged): + (WebCore::GraphicsContext3DPrivate::markLayerComposited): + (WebCore::GraphicsContext3DPrivate::layerComposited): + (WebCore::GraphicsContext3DPrivate::paintFramebufferToCanvas): + (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DPrivate::paintCompositedResultsToCanvas): + (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToImageData): + (WebCore::GraphicsContext3DPrivate::reshape): + (WebCore::GraphicsContext3DPrivate::getInternalFramebufferSize): + (WebCore::GraphicsContext3DPrivate::isContextLost): + (WebCore::GraphicsContext3DPrivate::isGLES2Compliant): + (WebCore::GraphicsContext3DPrivate::bindAttribLocation): + (WebCore::GraphicsContext3DPrivate::bufferData): + (WebCore::GraphicsContext3DPrivate::bufferSubData): + (WebCore::GraphicsContext3DPrivate::getActiveAttrib): + (WebCore::GraphicsContext3DPrivate::getActiveUniform): + (WebCore::GraphicsContext3DPrivate::getAttribLocation): + (WebCore::GraphicsContext3DPrivate::getContextAttributes): + (WebCore::GraphicsContext3DPrivate::getProgramInfoLog): + (WebCore::GraphicsContext3DPrivate::getShaderInfoLog): + (WebCore::GraphicsContext3DPrivate::getShaderSource): + (WebCore::GraphicsContext3DPrivate::getString): + (WebCore::GraphicsContext3DPrivate::getUniformLocation): + (WebCore::GraphicsContext3DPrivate::shaderSource): + (WebCore::GraphicsContext3DPrivate::texImage2D): + (WebCore::GraphicsContext3DPrivate::texSubImage2D): + (WebCore::GraphicsContext3DPrivate::uniform1fv): + (WebCore::GraphicsContext3DPrivate::uniform1iv): + (WebCore::GraphicsContext3DPrivate::uniform2fv): + (WebCore::GraphicsContext3DPrivate::uniform2iv): + (WebCore::GraphicsContext3DPrivate::uniform3fv): + (WebCore::GraphicsContext3DPrivate::uniform3iv): + (WebCore::GraphicsContext3DPrivate::uniform4fv): + (WebCore::GraphicsContext3DPrivate::uniform4iv): + (WebCore::GraphicsContext3DPrivate::uniformMatrix2fv): + (WebCore::GraphicsContext3DPrivate::uniformMatrix3fv): + (WebCore::GraphicsContext3DPrivate::uniformMatrix4fv): + (WebCore::GraphicsContext3DPrivate::getExtensions): + (WebCore::GraphicsContext3DPrivate::isResourceSafe): + (WebCore::GraphicsContext3DPrivate::initializeExtensions): + (WebCore::GraphicsContext3DPrivate::supportsExtension): + (WebCore::GraphicsContext3DPrivate::ensureExtensionEnabled): + (WebCore::GraphicsContext3DPrivate::isExtensionEnabled): + (WebCore::GraphicsContext3D::GraphicsContext3D): + (WebCore::GraphicsContext3D::~GraphicsContext3D): + (WebCore::GraphicsContext3D::create): + (WebCore::GraphicsContext3D::platformGraphicsContext3D): + (WebCore::GraphicsContext3D::platformTexture): + (WebCore::GraphicsContext3D::grContext): + (WebCore::GraphicsContext3D::prepareTexture): + (WebCore::GraphicsContext3D::getInternalFramebufferSize): + (WebCore::GraphicsContext3D::isResourceSafe): + (WebCore::GraphicsContext3D::platformLayer): + (WebCore::GraphicsContext3D::layerComposited): + (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): + (GraphicsContextLostCallbackAdapter): + (WebCore::GraphicsContextLostCallbackAdapter::~GraphicsContextLostCallbackAdapter): + (WebCore::GraphicsContextLostCallbackAdapter::GraphicsContextLostCallbackAdapter): + (WebCore::GraphicsContextLostCallbackAdapter::onContextLost): + (WebCore::GraphicsContextLostCallbackAdapter::create): + (WebCore::GraphicsContext3DPrivate::setContextLostCallback): + (GraphicsErrorMessageCallbackAdapter): + (WebCore::GraphicsErrorMessageCallbackAdapter::~GraphicsErrorMessageCallbackAdapter): + (WebCore::GraphicsErrorMessageCallbackAdapter::GraphicsErrorMessageCallbackAdapter): + (WebCore::GraphicsErrorMessageCallbackAdapter::onErrorMessage): + (WebCore::GraphicsErrorMessageCallbackAdapter::create): + (WebCore::GraphicsContext3DPrivate::setErrorMessageCallback): + (WebCore::GraphicsContext3D::isGLES2Compliant): + (GraphicsContext3DSwapBuffersCompleteCallbackAdapter): + (WebCore::GraphicsContext3DSwapBuffersCompleteCallbackAdapter::~GraphicsContext3DSwapBuffersCompleteCallbackAdapter): + (WebCore::GraphicsContext3DSwapBuffersCompleteCallbackAdapter::GraphicsContext3DSwapBuffersCompleteCallbackAdapter): + (WebCore::GraphicsContext3DSwapBuffersCompleteCallbackAdapter::onSwapBuffersComplete): + (WebCore::GraphicsContext3DSwapBuffersCompleteCallbackAdapter::create): + (WebCore::GraphicsContext3DPrivate::setSwapBuffersCompleteCallbackCHROMIUM): + (GraphicsContext3DMemoryAllocationChangedCallbackAdapter): + (WebCore::GraphicsContext3DMemoryAllocationChangedCallbackAdapter::GraphicsContext3DMemoryAllocationChangedCallbackAdapter): + (WebCore::GraphicsContext3DMemoryAllocationChangedCallbackAdapter::~GraphicsContext3DMemoryAllocationChangedCallbackAdapter): + (WebCore::GraphicsContext3DMemoryAllocationChangedCallbackAdapter::onMemoryAllocationChanged): + (WebCore::GraphicsContext3DPrivate::setGpuMemoryAllocationChangedCallbackCHROMIUM): + * src/GraphicsContext3DPrivate.h: Renamed from Source/WebCore/platform/chromium/support/GraphicsContext3DPrivate.h. + (WebKit): + (WebCore): + (GraphicsContext3DPrivate): + +2012-05-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r116712. + http://trac.webkit.org/changeset/116712 + https://bugs.webkit.org/show_bug.cgi?id=86484 + + This patch is causing crashes in Chromium Canary builds + (Requested by pilgrim_google__ on #webkit). + + * WebKit.gyp: + * public/WebStorageArea.h: + (WebKit): + * public/WebStorageEventDispatcher.h: + (WebStorageEventDispatcher): + (WebKit::WebStorageEventDispatcher::~WebStorageEventDispatcher): + * public/WebStorageNamespace.h: + (WebStorageNamespace): + (WebKit::WebStorageNamespace::close): + * public/platform/WebKitPlatformSupport.h: + (WebKitPlatformSupport): + (WebKit::WebKitPlatformSupport::dispatchStorageEvent): + * src/StorageAreaProxy.cpp: + (WebCore::StorageAreaProxy::setItem): + (WebCore::StorageAreaProxy::removeItem): + (WebCore::StorageAreaProxy::clear): + (WebCore): + (WebCore::StorageAreaProxy::storageEvent): + (WebCore::StorageAreaProxy::dispatchLocalStorageEvent): + (WebCore::findPageWithSessionStorageNamespace): + (WebCore::StorageAreaProxy::dispatchSessionStorageEvent): + * src/StorageAreaProxy.h: + (WebCore): + (StorageAreaProxy): + * src/StorageEventDispatcherImpl.cpp: Added. + (WebCore): + (WebCore::StorageEventDispatcherImpl::StorageEventDispatcherImpl): + (WebCore::StorageEventDispatcherImpl::dispatchStorageEvent): + * src/StorageEventDispatcherImpl.h: Copied from Source/WebKit/chromium/public/WebStorageEventDispatcher.h. + (WebCore): + (StorageEventDispatcherImpl): + * src/WebStorageEventDispatcherImpl.cpp: + (WebKit): + (WebKit::WebStorageEventDispatcher::dispatchLocalStorageEvent): + (WebKit::WebStorageEventDispatcher::dispatchSessionStorageEvent): + (WebKit::WebStorageEventDispatcher::create): + (WebKit::WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl): + (WebKit::WebStorageEventDispatcherImpl::dispatchStorageEvent): + * src/WebStorageEventDispatcherImpl.h: Copied from Source/WebKit/chromium/public/WebStorageEventDispatcher.h. + (WebKit): + (WebStorageEventDispatcherImpl): + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + (WebCore): + (WebViewImpl): + +2012-05-15 Terry Anderson <tdanderson@chromium.org> + + [chromium] Remove unused code for tap target fuzzing + https://bugs.webkit.org/show_bug.cgi?id=86252 + + Reviewed by Adam Barth. + + * public/WebInputEvent.h: + (WebGestureEvent): + (WebKit::WebGestureEvent::WebGestureEvent): + * src/WebInputEvent.cpp: + (SameSizeAsWebGestureEvent): + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + A rectangular touch region is defined by the touch center and the + delta values only, so gammaX and gammaY are not needed. + +2012-05-15 Hans Wennborg <hans@chromium.org> + + Speech JavaScript API: Introduce error code enum in Chromium plumbing + https://bugs.webkit.org/show_bug.cgi?id=86353 + + Reviewed by Adam Barth. + + Introduce an enum for receiving error codes from the embedder. + This enum matches the enum in SpeechRecognitionError. + + * public/WebSpeechRecognizerClient.h: + * src/AssertMatchingEnums.cpp: + * src/SpeechRecognitionClientProxy.cpp: + (WebKit::SpeechRecognitionClientProxy::didReceiveError): + * src/SpeechRecognitionClientProxy.h: + (SpeechRecognitionClientProxy): + +2012-05-14 Shinya Kawanaka <shinyak@chromium.org> + + document.execCommand('Indent') in the direct child of ShadowRoot causes a crash. + https://bugs.webkit.org/show_bug.cgi?id=86341 + + Reviewed by Ryosuke Niwa. + + * src/WebRange.cpp: + (WebKit::WebRange::fromDocumentRange): + +2012-05-14 Shinya Kawanaka <shinyak@chromium.org> + + Node::shadowTreeRootNode() should return ShadowRoot instead of Node. + https://bugs.webkit.org/show_bug.cgi?id=86428 + + Reviewed by Hajime Morita. + + Adds include directive to build. + + * src/WebFrameImpl.cpp: + +2012-05-14 Gavin Peters <gavinp@chromium.org> + + Add Prerenderer, PrerenderHandle and a chromium interface for Prerendering. + https://bugs.webkit.org/show_bug.cgi?id=85005 + + Reviewed by Adam Barth. + + The prerender case isn't quite a resource load, and using resource loading to + retrieve them has constrained the API, and unnecessarily complicated the loader. + + The new Prerenderer and PrerenderHandle let <link rel=prerender...> elements signal + removal and unload to their platform. + + * WebKit.gyp: + * public/WebView.h: + * src/PrerendererClientImpl.cpp: Copied from Source/WebCore/html/LinkRelAttribute.h. + (WebKit): + (WebKit::PrerendererClientImpl::PrerendererClientImpl): + (WebKit::PrerendererClientImpl::willAddPrerender): + * src/PrerendererClientImpl.h: Copied from Source/WebCore/html/LinkRelAttribute.h. + (WebCore): + (WebKit): + (PrerendererClientImpl): + * src/WebKit.cpp: + (WebKit::shutdown): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setPrerendererClient): + (WebKit): + * src/WebViewImpl.h: + (WebKit): + (WebViewImpl): + +2012-05-14 Luke Macpherson <macpherson@chromium.org> + + Introduce ENABLE_CSS_VARIABLES compile flag. + https://bugs.webkit.org/show_bug.cgi?id=86338 + + Reviewed by Dimitri Glazkov. + + Add a configuration option for CSS Variables support, disabling it by default. + + * features.gypi: + +2012-05-14 Gavin Peters <gavinp@chromium.org> + + [Chromium] remove skia/third_party/glu from DEPS + https://bugs.webkit.org/show_bug.cgi?id=86431 + + Chromium rev 136872 removed skia/third_party/glu, but nobody updated it in WebKit. This + patch fixes that. + + Unreviewed, remove bad Chromium repo. + + * DEPS: + +2012-05-14 Dirk Pranke <dpranke@chromium.org> + + Unreviewed, roll Chromium DEPS to r136942. + +2012-05-14 Adam Barth <abarth@webkit.org> + + [Chromium] android/WebInputEventFactory should handle wheel events and gesture events + https://bugs.webkit.org/show_bug.cgi?id=86270 + + Reviewed by Eric Seidel. + + * public/android/WebInputEventFactory.h: + * src/android/WebInputEventFactory.cpp: + (WebKit::WebInputEventFactory::keyboardEvent): + (WebKit::WebInputEventFactory::mouseEvent): + (WebKit): + (WebKit::WebInputEventFactory::mouseWheelEvent): + (WebKit::WebInputEventFactory::gestureEvent): + +2012-05-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r116983. + http://trac.webkit.org/changeset/116983 + https://bugs.webkit.org/show_bug.cgi?id=86397 + + Does not compile on chromium-win (Requested by abarth on + #webkit). + + * features.gypi: + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + +2012-05-14 Terry Anderson <tdanderson@chromium.org> + + [chromium] Compute the best target node on a GestureTap event + https://bugs.webkit.org/show_bug.cgi?id=85101 + + Reviewed by Adam Barth. + + * features.gypi: + Enable the touch adjustment code by default. + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + In the case of a GestureTap, deltaX represents the horizontal padding of the touch + area and deltaY represents the vertical padding of the touch area. + +2012-05-14 Adrienne Walker <enne@google.com> + + [chromium] Add compositor debug asserts for blocked main thread + https://bugs.webkit.org/show_bug.cgi?id=86384 + + Reviewed by James Robinson. + + For tests that are just on the impl tree, pretend that the main thread + is always blocked. + + * tests/CCLayerTreeHostImplTest.cpp: + (CCLayerTreeHostImplTest): + +2012-05-12 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r116812. + http://trac.webkit.org/changeset/116812 + https://bugs.webkit.org/show_bug.cgi?id=86313 + + Appears to be causing a top crash (Requested by abarth on + #webkit). + + * WebKit.gyp: + * public/WebStorageArea.h: + (WebKit): + (WebStorageArea): + (WebKit::WebStorageArea::~WebStorageArea): + (WebKit::WebStorageArea::setItem): + (WebKit::WebStorageArea::removeItem): + (WebKit::WebStorageArea::clear): + * public/WebStorageNamespace.h: + (WebKit): + (WebStorageNamespace): + (WebKit::WebStorageNamespace::~WebStorageNamespace): + (WebKit::WebStorageNamespace::isSameNamespace): + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKitPlatformSupport): + (WebKit::WebKitPlatformSupport::createLocalStorageNamespace): + * src/StorageAreaProxy.cpp: + * src/StorageNamespaceProxy.cpp: + (WebCore::StorageNamespace::localStorageNamespace): + +2012-05-11 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Call isLinkVisited directly + https://bugs.webkit.org/show_bug.cgi?id=85412 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * src/PlatformSupport.cpp: + (WebCore): + +2012-05-11 Tony Chang <tony@chromium.org> + + [chromium] Port gtest WebViewTest.ActiveState from test_shell_tests to webkit_unit_tests + https://bugs.webkit.org/show_bug.cgi?id=86271 + + Reviewed by James Robinson. + + The original test is in src/webkit/glue/webview_unittest.cc. + + * tests/WebViewTest.cpp: + (WebKit::TEST_F): + (WebKit): + +2012-05-11 Shawn Singh <shawnsingh@chromium.org> + + [chromium] Plumb --show-paint-rects to accelerated compositor + https://bugs.webkit.org/show_bug.cgi?id=86255 + + Reviewed by James Robinson. + + * public/WebSettings.h: + * src/WebLayerTreeView.cpp: + (WebKit::WebLayerTreeView::Settings::operator CCSettings): + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::WebSettingsImpl): + (WebKit::WebSettingsImpl::setShowPaintRects): + (WebKit): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::showFPSCounter): + (WebKit::WebSettingsImpl::showPlatformLayerTree): + (WebKit::WebSettingsImpl::showPaintRects): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::settingsImpl): + (WebKit::WebViewImpl::settings): + (WebKit): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + * src/WebViewImpl.h: + +2012-05-11 Ryosuke Niwa <rniwa@webkit.org> + + Do a DEPS roll per build failure caused by r116810. + + See http://webkitmemes.tumblr.com/post/21734202168/the-solution-to-any-chromium-problem for the rationale. + + * DEPS: + +2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r116802. + http://trac.webkit.org/changeset/116802 + https://bugs.webkit.org/show_bug.cgi?id=86260 + + This patch causes compiling error to chromium builds + (Requested by jianli_ on #webkit). + + * features.gypi: + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + +2012-05-11 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Move createLocalStorageNamespace to Platform.h + https://bugs.webkit.org/show_bug.cgi?id=85766 + + Reviewed by Adam Barth. + + Part of a refactoring series. See tracking bug 82948. + + * WebKit.gyp: + * public/WebStorageArea.h: + * public/WebStorageNamespace.h: + * public/platform/WebKitPlatformSupport.h: + (WebKit): + (WebKit::WebKitPlatformSupport::blobRegistry): + * src/StorageAreaProxy.cpp: + * src/StorageNamespaceProxy.cpp: + (WebCore::StorageNamespace::localStorageNamespace): + +2012-05-11 James Robinson <jamesr@chromium.org> + + [chromium] Move implementation of WebCore::GraphicsContext3D and related from WebKit/chromium/src to WebCore/platform/chromium/support + https://bugs.webkit.org/show_bug.cgi?id=86257 + + Reviewed by Adam Barth. + + * WebKit.gyp: + +2012-05-11 Fady Samuel <fsamuel@chromium.org> + + [Chromium] Expose WebPluginContainer of WebPlugin to embedder + https://bugs.webkit.org/show_bug.cgi?id=85916 + + Reviewed by Darin Fisher. + + The browser plugin needs to access its current guest's WebPluginContainer + so that it can replace the guest with another guest WebPlugin when navigating + across processes. + + * public/WebPlugin.h: + (WebPlugin): + (WebKit::WebPlugin::container): + +2012-05-11 Terry Anderson <tdanderson@chromium.org> + + [chromium] Compute the best target node on a GestureTap event + https://bugs.webkit.org/show_bug.cgi?id=85101 + + Reviewed by Adam Barth. + + * features.gypi: + Enable the touch adjustment code by default. + * src/WebInputEventConversion.cpp: + (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder): + In the case of a GestureTap, deltaX represents the horizontal padding of the touch + area and deltaY represents the vertical padding of the touch area. + +2012-05-11 Ian Vollick <vollick@chromium.org> + + [chromium] Ensure that animations continue to run when transform-style is changed + https://bugs.webkit.org/show_bug.cgi?id=83283 + + Reviewed by James Robinson. + + * WebKit.gypi: + * tests/GraphicsLayerChromiumTest.cpp: Added. + (WebKitTests): + (MockGraphicsLayerClient): + (WebKitTests::MockGraphicsLayerClient::notifyAnimationStarted): + (WebKitTests::MockGraphicsLayerClient::notifySyncRequired): + (WebKitTests::MockGraphicsLayerClient::paintContents): + (WebKitTests::MockGraphicsLayerClient::showDebugBorders): + (WebKitTests::MockGraphicsLayerClient::showRepaintCounter): + (WebKitTests::TEST): + +2012-05-11 Min Qin <qinmin@google.com> + + split MediaPlayer::enterFullscreen into 2 seperate functions + https://bugs.webkit.org/show_bug.cgi?id=86052 + + Reviewed by Adam Barth. + + In WebCore, we splitted bool enterFullscreen() into two seperate calls: + void enterFullscreen() and bool canEnterFullscreen() + This is the change in the chromium part that we needed to support the WebCore change + No behavior change, just refactoring. + + * public/WebMediaPlayer.h: + (WebMediaPlayer): + (WebKit::WebMediaPlayer::enterFullscreen): + (WebKit::WebMediaPlayer::canEnterFullscreen): + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::enterFullscreen): + (WebKit): + (WebKit::WebMediaPlayerClientImpl::exitFullscreen): + * src/WebMediaPlayerClientImpl.h: + (WebMediaPlayerClientImpl): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::enterFullScreenForElement): + +2012-05-11 David Reveman <reveman@chromium.org> + + [Chromium] Move instantiation of texture uploader to LayerRendererChromium. + https://bugs.webkit.org/show_bug.cgi?id=85893 + + Reviewed by Adrienne Walker. + + * tests/CCLayerTreeHostImplTest.cpp: + (WebKitTests::CCLayerTreeHostImplTest::CCLayerTreeHostImplTest): + (WebKitTests::TEST_F): + * tests/LayerRendererChromiumTest.cpp: + (FakeLayerRendererChromium::FakeLayerRendererChromium): + (LayerRendererChromiumTest::LayerRendererChromiumTest): + (TEST): + 2012-05-11 Sheriff Bot <webkit.review.bot@gmail.com> Unreviewed, rolling out r116727. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 1346d5045..24ef4f526 100644 --- a/Source/WebKit/chromium/DEPS +++ b/Source/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '136044' + 'chromium_rev': '136942' } deps = { @@ -58,8 +58,6 @@ deps = { From('chromium_deps', 'src/third_party/skia/src'), 'third_party/skia/include': From('chromium_deps', 'src/third_party/skia/include'), - 'third_party/skia/third_party/glu': - From('chromium_deps', 'src/third_party/skia/third_party/glu'), # testing 'testing': diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index a775f545d..9ede5f96d 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -128,6 +128,7 @@ 'public/WebDataSource.h', 'public/WebDatabase.h', 'public/WebDatabaseObserver.h', + 'public/WebDeliveredIntentClient.h', 'public/WebDevToolsAgent.h', 'public/WebDevToolsAgentClient.h', 'public/WebDevToolsFrontend.h', @@ -149,7 +150,6 @@ 'public/WebFileInfo.h', 'public/WebFileSystemCallbacks.h', 'public/WebFileSystemEntry.h', - 'public/WebFileUtilities.h', 'public/WebFileWriter.h', 'public/WebFileWriterClient.h', 'public/WebFindOptions.h', @@ -223,6 +223,7 @@ 'public/WebPluginContainer.h', 'public/WebPluginDocument.h', 'public/WebPluginListBuilder.h', + 'public/WebPrintParams.h', 'public/WebPrintScalingOption.h', 'public/WebPopupMenu.h', 'public/WebPopupMenuInfo.h', @@ -282,7 +283,6 @@ 'public/WebWidget.h', 'public/WebWidgetClient.h', 'public/WebWorkerInfo.h', - 'public/WebWorkerRunLoop.h', 'public/android/WebInputEventFactory.h', 'public/android/WebSandboxSupport.h', 'public/gtk/WebInputEventFactory.h', @@ -296,8 +296,6 @@ 'public/platform/WebArrayBufferView.h', 'public/platform/WebAudioBus.h', 'public/platform/WebAudioDevice.h', - 'public/platform/WebBlobData.h', - 'public/platform/WebBlobRegistry.h', 'public/platform/WebCanvas.h', 'public/platform/WebColor.h', 'public/platform/WebCommon.h', @@ -389,6 +387,8 @@ 'src/ContextMenuClientImpl.cpp', 'src/ContextMenuClientImpl.h', 'src/DatabaseObserver.cpp', + 'src/DeliveredIntentClientImpl.cpp', + 'src/DeliveredIntentClientImpl.h', 'src/DeviceOrientationClientProxy.cpp', 'src/DeviceOrientationClientProxy.h', 'src/DOMUtilitiesPrivate.cpp', @@ -436,6 +436,8 @@ 'src/InspectorFrontendClientImpl.h', 'src/NonCompositedContentHost.cpp', 'src/NonCompositedContentHost.h', + 'src/PrerendererClientImpl.h', + 'src/PrerendererClientImpl.cpp', 'src/android/WebInputEventFactory.cpp', 'src/linux/WebFontInfo.cpp', 'src/linux/WebFontRendering.cpp', @@ -473,6 +475,8 @@ 'src/SpeechRecognitionClientProxy.h', 'src/StorageAreaProxy.cpp', 'src/StorageAreaProxy.h', + 'src/StorageEventDispatcherImpl.cpp', + 'src/StorageEventDispatcherImpl.h', 'src/StorageInfoChromium.cpp', 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', @@ -613,8 +617,8 @@ 'src/WebPasswordFormUtils.cpp', 'src/WebPasswordFormUtils.h', 'src/WebPerformance.cpp', - 'src/WebPluginContainerImpl.h', 'src/WebPluginContainerImpl.cpp', + 'src/WebPluginContainerImpl.h', 'src/WebPluginDocument.cpp', 'src/WebPluginListBuilderImpl.cpp', 'src/WebPluginListBuilderImpl.h', @@ -650,6 +654,7 @@ 'src/WebSpeechRecognitionHandle.cpp', 'src/WebSpeechRecognitionResult.cpp', 'src/WebStorageEventDispatcherImpl.cpp', + 'src/WebStorageEventDispatcherImpl.h', 'src/WebStorageQuotaCallbacksImpl.cpp', 'src/WebStorageQuotaCallbacksImpl.h', 'src/WebSurroundingText.cpp', diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi index f40951afe..cfb1d7b4e 100644 --- a/Source/WebKit/chromium/WebKit.gypi +++ b/Source/WebKit/chromium/WebKit.gypi @@ -105,6 +105,7 @@ 'tests/FrameLoaderClientImplTest.cpp', 'tests/FrameTestHelpers.cpp', 'tests/FrameTestHelpers.h', + 'tests/GraphicsLayerChromiumTest.cpp', 'tests/IDBBindingUtilitiesTest.cpp', 'tests/IDBKeyPathTest.cpp', 'tests/IDBLevelDBCodingTest.cpp', @@ -146,6 +147,7 @@ 'tests/WebPageSerializerTest.cpp', 'tests/WebSocketDeflaterTest.cpp', 'tests/WebSocketExtensionDispatcherTest.cpp', + 'tests/WebTransformationMatrixTest.cpp', 'tests/WebURLRequestTest.cpp', 'tests/WebURLResponseTest.cpp', 'tests/WebViewTest.cpp', diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index 3947a3826..076fc38a9 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -40,6 +40,7 @@ 'ENABLE_CSS_FILTERS=1', 'ENABLE_CSS_IMAGE_SET=1', 'ENABLE_CSS_SHADERS=1', + 'ENABLE_CSS_VARIABLES=0', 'ENABLE_DATALIST=1', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATA_TRANSFER_ITEMS=1', @@ -97,6 +98,7 @@ 'ENABLE_STYLE_SCOPED=1', 'ENABLE_SVG=<(enable_svg)', 'ENABLE_SVG_FONTS=<(enable_svg)', + 'ENABLE_TOUCH_ADJUSTMENT=1', 'ENABLE_TOUCH_EVENTS=<(enable_touch_events)', 'ENABLE_TOUCH_ICON_LOADING=<(enable_touch_icon_loading)', 'ENABLE_V8_SCRIPT_DEBUG_SERVER=1', diff --git a/Source/WebKit/chromium/public/WebDeliveredIntentClient.h b/Source/WebKit/chromium/public/WebDeliveredIntentClient.h new file mode 100644 index 000000000..2fb9af23b --- /dev/null +++ b/Source/WebKit/chromium/public/WebDeliveredIntentClient.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 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 WebDeliveredIntentClient_h +#define WebDeliveredIntentClient_h + +#include "platform/WebCommon.h" + +namespace WebKit { + +class WebSerializedScriptValue; + +// The embedder implements this interface to receive reply calls from the service +// in response to the delivery of a web intent. This client must remain valid +// until the destroy() method is called. +// See spec at http://www.chromium.org/developers/design-documents/webintentsapi +class WebDeliveredIntentClient { +public: + virtual ~WebDeliveredIntentClient() { } + + virtual void postResult(const WebSerializedScriptValue& data) const = 0; + virtual void postFailure(const WebSerializedScriptValue& data) const = 0; + virtual void destroy() = 0; +}; + +} // namespace WebKit + +#endif // WebDeliveredIntentClient_h diff --git a/Source/WebKit/chromium/public/WebFileUtilities.h b/Source/WebKit/chromium/public/WebFileUtilities.h index 8b3b7b26b..b2cca5f2f 100644 --- a/Source/WebKit/chromium/public/WebFileUtilities.h +++ b/Source/WebKit/chromium/public/WebFileUtilities.h @@ -28,50 +28,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebFileUtilities_h -#define WebFileUtilities_h - -#include "platform/WebCommon.h" -#include "platform/WebString.h" -#include "platform/WebURL.h" - -#ifdef WIN32 -typedef void *HANDLE; -#endif - -namespace WebKit { - -class WebFileUtilities { -public: -#ifdef WIN32 - typedef HANDLE FileHandle; -#else - typedef int FileHandle; -#endif - virtual void revealFolderInOS(const WebString& path) { } - virtual bool fileExists(const WebString& path) { return false; } - virtual bool deleteFile(const WebString& path) { return false; } - virtual bool deleteEmptyDirectory(const WebString& path) { return false; } - virtual bool getFileSize(const WebString& path, long long& result) { return false; } - virtual bool getFileModificationTime(const WebString& path, double& result) { return false; } - virtual WebString directoryName(const WebString& path) { return WebString(); } - virtual WebString pathByAppendingComponent(const WebString& path, const WebString& component) { return WebString(); } - virtual bool makeAllDirectories(const WebString& path) { return false; } - virtual WebString getAbsolutePath(const WebString& path) { return WebString(); } - virtual bool isDirectory(const WebString& path) { return false; } - virtual WebURL filePathToURL(const WebString& path) { return WebURL(); } - virtual FileHandle openFile(const WebString& path, int mode) { return FileHandle(); } - // Should set the FileHandle to a invalid value if the file is closed successfully. - virtual void closeFile(FileHandle&) { } - virtual long long seekFile(FileHandle, long long offset, int origin) { return 0; } - virtual bool truncateFile(FileHandle, long long offset) { return false; } - virtual int readFromFile(FileHandle, char* data, int length) { return 0; } - virtual int writeToFile(FileHandle, const char* data, int length) { return 0; } - -protected: - ~WebFileUtilities() {} -}; - -} // namespace WebKit - -#endif +#include "../../../Platform/chromium/public/WebFileUtilities.h" diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h index 017cb0de8..87659ee99 100644 --- a/Source/WebKit/chromium/public/WebFrame.h +++ b/Source/WebKit/chromium/public/WebFrame.h @@ -57,11 +57,13 @@ namespace WebKit { class WebAnimationController; class WebData; class WebDataSource; +class WebDeliveredIntentClient; class WebDocument; class WebElement; class WebFormElement; class WebHistoryItem; class WebInputElement; +class WebIntent; class WebPerformance; class WebRange; class WebSecurityOrigin; @@ -73,6 +75,7 @@ class WebView; struct WebConsoleMessage; struct WebFindOptions; struct WebPoint; +struct WebPrintParams; struct WebRect; struct WebScriptSource; struct WebSize; @@ -452,19 +455,35 @@ public: // Printing ------------------------------------------------------------ - // Reformats the WebFrame for printing. pageSize is the page size in - // points (a point in 1/72 of an inch). If |constrainToNode| node is - // specified, then only the given node is printed (for now only plugins are - // supported), instead of the entire frame. printerDPI is the user - // selected, DPI for the printer. Returns the number of pages that can be - // printed at the given page size. The out param useBrowserOverlays + // Reformats the WebFrame for printing. printContentSize is the print + // content size in points (a point is 1/72 of an inch). If constrainToNode + // node is specified, then only the given node is printed (for now only + // plugins are supported), instead of the entire frame. printerDPI is the + // user selected, DPI for the printer. Returns the number of pages that can + // be printed at the given page size. The out param useBrowserOverlays // specifies whether the browser process should use its overlays (header, // footer, margins etc) or whether the renderer controls this. - virtual int printBegin(const WebSize& pageSize, + // + // FIXME: This is a temporary interface to avoid the compile errors. Remove + // this interface after fixing crbug.com/85132. We will use the overloaded + // printBegin function. + virtual int printBegin(const WebSize& printContentSize, const WebNode& constrainToNode = WebNode(), int printerDPI = 72, bool* useBrowserOverlays = 0) = 0; + // Reformats the WebFrame for printing. WebPrintParams specifies the printable + // content size, paper size, printable area size, printer DPI and print + // scaling option. If constrainToNode node is specified, then only the given node + // is printed (for now only plugins are supported), instead of the entire frame. + // Returns the number of pages that can be printed at the given + // page size. The out param useBrowserOverlays specifies whether the browser + // process should use its overlays (header, footer, margins etc) or whether + // the renderer controls this. + virtual int printBegin(const WebPrintParams&, + const WebNode& constrainToNode = WebNode(), + bool* useBrowserOverlays = 0) = 0; + // Returns the page shrinking factor calculated by webkit (usually // between 1/1.25 and 1/2). Returns 0 if the page number is invalid or // not in printing mode. @@ -588,16 +607,8 @@ public: // Web Intents --------------------------------------------------------- - // Forwards a web intents reply from the invoked activity back to the - // appropriate registered Javascript callback. The |intentIdentifier| is - // the WebIntent parameter received from the dispatchIntent method. - virtual void handleIntentResult(int intentIdentifier, const WebString&) = 0; - - // Forwards a web intents failure notification from the invoked activity - // or intervening browser logic back to the appropriate registered - // Javascript callback. The |intentIdentifier| is the WebIntent parameter - // received from the dispatchIntent method. - virtual void handleIntentFailure(int intentIdentifier, const WebString&) = 0; + // Called on a target service page to deliver an intent to the window. + virtual void deliverIntent(const WebIntent&, WebDeliveredIntentClient*) = 0; // Utility ------------------------------------------------------------- diff --git a/Source/WebKit/chromium/public/WebIDBIndex.h b/Source/WebKit/chromium/public/WebIDBIndex.h index 37af02c0c..8c3df193e 100644 --- a/Source/WebKit/chromium/public/WebIDBIndex.h +++ b/Source/WebKit/chromium/public/WebIDBIndex.h @@ -47,6 +47,7 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return WebString(); } + // FIXME: Remove method once callers are updated. virtual WebString storeName() const { WEBKIT_ASSERT_NOT_REACHED(); diff --git a/Source/WebKit/chromium/public/WebIDBObjectStore.h b/Source/WebKit/chromium/public/WebIDBObjectStore.h index dcf485692..4008e1d2e 100644 --- a/Source/WebKit/chromium/public/WebIDBObjectStore.h +++ b/Source/WebKit/chromium/public/WebIDBObjectStore.h @@ -63,6 +63,11 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return WebDOMStringList(); } + virtual bool autoIncrement() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return false; + } virtual void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit/chromium/public/WebInputElement.h b/Source/WebKit/chromium/public/WebInputElement.h index b1c407c59..23e85aa73 100644 --- a/Source/WebKit/chromium/public/WebInputElement.h +++ b/Source/WebKit/chromium/public/WebInputElement.h @@ -74,6 +74,12 @@ namespace WebKit { WEBKIT_EXPORT int size() const; WEBKIT_EXPORT void setValue(const WebString&, bool sendChangeEvent = false); WEBKIT_EXPORT WebString value() const; + // This returns the non-sanitized, exact value inside the text field. + WEBKIT_EXPORT WebString editingValue() const; + // Sets the value inside the text field without being sanitized. + // Can't be used if a renderer doesn't exist or on a non text field type. + // Caret will be moved to the end. + WEBKIT_EXPORT void setEditingValue(const WebString&); WEBKIT_EXPORT void setSuggestedValue(const WebString&); WEBKIT_EXPORT WebString suggestedValue() const; WEBKIT_EXPORT void setPlaceholder(const WebString&); diff --git a/Source/WebKit/chromium/public/WebInputEvent.h b/Source/WebKit/chromium/public/WebInputEvent.h index d5d6394f8..6ac9f1f57 100644 --- a/Source/WebKit/chromium/public/WebInputEvent.h +++ b/Source/WebKit/chromium/public/WebInputEvent.h @@ -359,11 +359,9 @@ public: int globalX; int globalY; - // NOTE: |deltaX| and |deltaY| represents the amount to scroll for Scroll gesture events. For Pinch gesture events, |deltaX| represents the scaling/magnification factor. For Tap and Press events, |deltaX|,|deltaY| and |gammaX|,|gammaY| correspond to the top left and bottom right corners of the ellipse's enlosing rectangle for tap target fuzzing. + // NOTE: |deltaX| and |deltaY| represents the amount to scroll for Scroll gesture events. For Pinch gesture events, |deltaX| represents the scaling/magnification factor. For a GestureTap event, |deltaX| and |deltaY| represent the horizontal and vertical radii of the touch region. float deltaX; float deltaY; - float gammaX; - float gammaY; WebGestureEvent(unsigned sizeParam = sizeof(WebGestureEvent)) : WebInputEvent(sizeParam) @@ -373,8 +371,6 @@ public: , globalY(0) , deltaX(0.0f) , deltaY(0.0f) - , gammaX(0.0f) - , gammaY(0.0f) { } }; diff --git a/Source/WebKit/chromium/public/WebIntent.h b/Source/WebKit/chromium/public/WebIntent.h index cc080ad99..aefc3ebb3 100644 --- a/Source/WebKit/chromium/public/WebIntent.h +++ b/Source/WebKit/chromium/public/WebIntent.h @@ -48,6 +48,7 @@ namespace WebKit { class WebIntent { public: WebIntent() { } + WEBKIT_EXPORT WebIntent(const WebString& action, const WebString& type, const WebString& data); WebIntent(const WebIntent& other) { assign(other); } ~WebIntent() { reset(); } @@ -80,6 +81,7 @@ public: #if WEBKIT_IMPLEMENTATION WebIntent(const WTF::PassRefPtr<WebCore::Intent>&); + operator WebCore::Intent*() const; #endif private: diff --git a/Source/WebKit/chromium/public/WebMediaPlayer.h b/Source/WebKit/chromium/public/WebMediaPlayer.h index a2a9fb9b4..670630f95 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayer.h +++ b/Source/WebKit/chromium/public/WebMediaPlayer.h @@ -184,10 +184,11 @@ public: virtual MediaKeyException addKey(const WebString& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataLength, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; } - // Instuct WebMediaPlayer to enter/exit fullscreen. - // Returns true if the player can enter fullscreen. - virtual bool enterFullscreen() { return false; } + // Instruct WebMediaPlayer to enter/exit fullscreen. + virtual void enterFullscreen() { } virtual void exitFullscreen() { } + // Returns true if the player can enter fullscreen. + virtual bool canEnterFullscreen() const { return false; } }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebPlugin.h b/Source/WebKit/chromium/public/WebPlugin.h index edfda32a4..717f6a7e1 100644 --- a/Source/WebKit/chromium/public/WebPlugin.h +++ b/Source/WebKit/chromium/public/WebPlugin.h @@ -46,6 +46,7 @@ class WebPluginContainer; class WebURLResponse; struct WebCursorInfo; struct WebPluginParams; +struct WebPrintParams; struct WebPoint; struct WebRect; struct WebURLError; @@ -56,6 +57,8 @@ public: virtual bool initialize(WebPluginContainer*) = 0; virtual void destroy() = 0; + virtual WebPluginContainer* container() const { return 0; } + virtual NPObject* scriptableObject() = 0; // Returns true if the form submission value is successfully obtained @@ -94,10 +97,17 @@ public: // Returns true if the printed content should not be scaled to // the printer's printable area. virtual bool isPrintScalingDisabled() { return false; } - // Sets up printing at the given print rect and printer DPI. printableArea - // is in points (a point is 1/72 of an inch).Returns the number of pages to - // be printed at these settings. - virtual int printBegin(const WebRect& printableArea, int printerDPI) { return 0; } + + // Sets up printing at the given print rect and printer DPI. + // printContentArea is in points ( a point is 1/72 of an inch). Returns the + // number of pages to be printed at these settings. + // FIXME: Remove this function after fixing crbug.com/85132. For detailed + // information, please refer to the comments in WebFrame.h + virtual int printBegin(const WebRect& printContentArea, int printerDPI) { return 0; } + // Sets up printing with the specified printParams. Returns the number of + // pages to be printed at these settings. + virtual int printBegin(const WebPrintParams& printParams) { return 0; } + // Prints the page specified by pageNumber (0-based index) into the supplied canvas. virtual bool printPage(int pageNumber, WebCanvas* canvas) { return false; } // Ends the print operation. diff --git a/Source/WebKit/chromium/public/WebPrintParams.h b/Source/WebKit/chromium/public/WebPrintParams.h new file mode 100644 index 000000000..d2d25bdad --- /dev/null +++ b/Source/WebKit/chromium/public/WebPrintParams.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2012 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 WebPrintParams_h +#define WebPrintParams_h + +#include "WebPrintScalingOption.h" +#include "platform/WebRect.h" +#include "platform/WebSize.h" + +namespace WebKit { + +struct WebPrintParams { + // Specifies printable content rect in points (a point is 1/72 of an inch). + WebRect printContentArea; + + // Specifies the selected printer default printable area details in + // points. + WebRect printableArea; + + // Specifies the selected printer default paper size in points. + WebSize paperSize; + + // Specifies user selected DPI for printing. + int printerDPI; + + // Specifies whether to reduce/enlarge/retain the print contents to fit the + // printable area. (This is used only by plugin printing). + WebPrintScalingOption printScalingOption; + + WebPrintParams() + : printerDPI(72) + , printScalingOption(WebPrintScalingOptionFitToPrintableArea) { } + + WebPrintParams(const WebRect& printContentArea, const WebRect& printableArea, const WebSize& paperSize, int printerDPI, WebPrintScalingOption printScalingOption) + : printContentArea(printContentArea) + , printableArea(printableArea) + , paperSize(paperSize) + , printerDPI(printerDPI) + , printScalingOption(printScalingOption) { } +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index ec7d03785..7e11141ea 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -32,6 +32,7 @@ #define WebSettings_h #include "platform/WebCommon.h" +#include "platform/WebSize.h" #include <unicode/uscript.h> #define HAS_WEBAUDIO_FEATURE_ENABLE 1 @@ -63,6 +64,7 @@ public: virtual void setMinimumFontSize(int) = 0; virtual void setMinimumLogicalFontSize(int) = 0; virtual void setDefaultDeviceScaleFactor(int) = 0; + virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool) = 0; virtual void setDefaultTextEncodingName(const WebString&) = 0; virtual void setJavaScriptEnabled(bool) = 0; virtual void setWebSecurityEnabled(bool) = 0; @@ -104,9 +106,8 @@ public: virtual void setWebGLErrorsToConsoleEnabled(bool) = 0; virtual void setShowDebugBorders(bool) = 0; virtual void setShowFPSCounter(bool) = 0; - virtual bool showFPSCounter() const = 0; virtual void setShowPlatformLayerTree(bool) = 0; - virtual bool showPlatformLayerTree() const = 0; + virtual void setShowPaintRects(bool) = 0; virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; virtual void setForceCompositingMode(bool) = 0; @@ -146,6 +147,9 @@ public: virtual void setThreadedAnimationEnabled(bool) = 0; virtual void setViewportEnabled(bool) = 0; virtual bool viewportEnabled() const = 0; + virtual void setDefaultTileSize(WebSize) = 0; + virtual void setMaxUntiledLayerSize(WebSize) = 0; + protected: ~WebSettings() { } diff --git a/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h b/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h index b2dcce055..562bfa0c4 100644 --- a/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h +++ b/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h @@ -26,6 +26,7 @@ #ifndef WebSpeechRecognitionParams_h #define WebSpeechRecognitionParams_h +#include "WebSecurityOrigin.h" #include "WebSpeechGrammar.h" #include "platform/WebString.h" #include "platform/WebVector.h" @@ -36,21 +37,24 @@ class WebSpeechGrammar; class WebSpeechRecognitionParams { public: - WebSpeechRecognitionParams(const WebVector<WebSpeechGrammar>& grammars, const WebString& language, bool continuous) + WebSpeechRecognitionParams(const WebVector<WebSpeechGrammar>& grammars, const WebString& language, bool continuous, const WebSecurityOrigin& origin) : m_grammars(grammars) , m_language(language) , m_continuous(continuous) + , m_origin(origin) { } const WebVector<WebSpeechGrammar>& grammars() const { return m_grammars; } const WebString& language() const { return m_language; } bool continuous() const { return m_continuous; } + const WebSecurityOrigin& origin() const { return m_origin; } private: WebVector<WebSpeechGrammar> m_grammars; WebString m_language; bool m_continuous; + WebSecurityOrigin m_origin; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebSpeechRecognizerClient.h b/Source/WebKit/chromium/public/WebSpeechRecognizerClient.h index 35c637834..608bfb481 100644 --- a/Source/WebKit/chromium/public/WebSpeechRecognizerClient.h +++ b/Source/WebKit/chromium/public/WebSpeechRecognizerClient.h @@ -37,6 +37,18 @@ class WebString; // A client for reporting progress on speech recognition for a specific handle. class WebSpeechRecognizerClient { public: + enum ErrorCode { + OtherError = 0, + NoSpeechError = 1, + AbortedError = 2, + AudioCaptureError = 3, + NetworkError = 4, + NotAllowedError = 5, + ServiceNotAllowedError = 6, + BadGrammarError = 7, + LanguageNotSupportedError = 8 + }; + // These methods correspond to the events described in the spec: // http://speech-javascript-api-spec.googlecode.com/git/speechapi.html#speechreco-events @@ -74,8 +86,7 @@ public: virtual void didDeleteResult(const WebSpeechRecognitionHandle&, unsigned resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory) = 0; // To be called when a speech recognition error occurs. - // FIXME: Introduce an enum for the error code. - virtual void didReceiveError(const WebSpeechRecognitionHandle&, const WebString& message, unsigned short code) = 0; + virtual void didReceiveError(const WebSpeechRecognitionHandle&, const WebString& message, ErrorCode) = 0; // To be called when the recognizer has begun to listen to the audio with // the intention of recognizing. diff --git a/Source/WebKit/chromium/public/WebStorageArea.h b/Source/WebKit/chromium/public/WebStorageArea.h index 23b799af1..cb5ee8d36 100644 --- a/Source/WebKit/chromium/public/WebStorageArea.h +++ b/Source/WebKit/chromium/public/WebStorageArea.h @@ -38,6 +38,9 @@ namespace WebKit { class WebURL; +// In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This +// class wraps a StorageArea. All the methods have obvious connections to the spec: +// http://dev.w3.org/html5/webstorage/ class WebStorageArea { public: virtual ~WebStorageArea() { } @@ -60,34 +63,16 @@ public: virtual WebString getItem(const WebString& key) = 0; // Set the value that corresponds to a specific key. Result will either be ResultOK - // or some particular error. The value is NOT set when there's an error. |pageUrl| is the + // or some particular error. The value is NOT set when there's an error. url is the // url that should be used if a storage event fires. - virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& pageUrl, Result& result) - { - WebString unused; - setItem(key, newValue, pageUrl, result, unused); - } - + virtual void setItem(const WebString& key, const WebString& newValue, const WebURL&, Result&, WebString& oldValue) = 0; - // Remove the value associated with a particular key. |pageUrl| is the url that should be used + // Remove the value associated with a particular key. url is the url that should be used // if a storage event fires. - virtual void removeItem(const WebString& key, const WebURL& pageUrl) - { - WebString unused; - removeItem(key, pageUrl, unused); - } + virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue) = 0; - // Clear all key/value pairs. |pageUrl| is the url that should be used if a storage event fires. - virtual void clear(const WebURL& pageUrl) - { - bool unused; - clear(pageUrl, unused); - } - - // DEPRECATED - being replaced by the async variants above which do not return oldValues or block until completion. - virtual void setItem(const WebString& key, const WebString& newValue, const WebURL&, Result&, WebString& oldValue) = 0; - virtual void removeItem(const WebString& key, const WebURL& pageUrl, WebString& oldValue) = 0; - virtual void clear(const WebURL& pageUrl, bool& somethingCleared) = 0; + // Clear all key/value pairs. url is the url that should be used if a storage event fires. + virtual void clear(const WebURL& url, bool& somethingCleared) = 0; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebStorageEventDispatcher.h b/Source/WebKit/chromium/public/WebStorageEventDispatcher.h index b321bf0e9..4fbc596b2 100644 --- a/Source/WebKit/chromium/public/WebStorageEventDispatcher.h +++ b/Source/WebKit/chromium/public/WebStorageEventDispatcher.h @@ -55,8 +55,13 @@ public: const WebURL& pageUrl, const WebStorageNamespace&, WebStorageArea* sourceAreaInstance, bool originatedInProcess); - private: - WebStorageEventDispatcher() { } + // DEPRECATED - The instance methods are going away soon in favor + // of the two static dispatch methods above. + WEBKIT_EXPORT static WebStorageEventDispatcher* create(); + virtual ~WebStorageEventDispatcher() { } + virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue, + const WebString& newValue, const WebString& origin, + const WebURL& url, bool isLocalStorage) = 0; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebStorageNamespace.h b/Source/WebKit/chromium/public/WebStorageNamespace.h index dd4a8fd44..894330717 100644 --- a/Source/WebKit/chromium/public/WebStorageNamespace.h +++ b/Source/WebKit/chromium/public/WebStorageNamespace.h @@ -55,6 +55,9 @@ public: // Returns true of the two instances represent the same storage namespace. virtual bool isSameNamespace(const WebStorageNamespace&) const { return false; } + + // DEPRECATED + virtual void close() { } }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index 111ecc641..0f7093ac4 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -107,9 +107,7 @@ public: virtual void setAutofillClient(WebAutofillClient*) = 0; virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; virtual void setPermissionClient(WebPermissionClient*) = 0; - // FIXME: After the Prerendering API lands in chrome, remove this staging thunk - // for setPrerendererClient(). - virtual void setPrerendererClient(WebPrerendererClient*) { } + virtual void setPrerendererClient(WebPrerendererClient*) = 0; virtual void setSpellCheckClient(WebSpellCheckClient*) = 0; virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) = 0; @@ -307,16 +305,31 @@ public: // Callback methods when a drag-and-drop operation is trying to drop // something on the WebView. + // FIXME: Remove this method after chromium changes catch up. virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) = 0; + virtual WebDragOperation dragTargetDragEnter( + const WebDragData&, + const WebPoint& clientPoint, const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers) = 0; + // FIXME: Remove this method after chromium changes catch up. virtual WebDragOperation dragTargetDragOver( const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) = 0; + virtual WebDragOperation dragTargetDragOver( + const WebPoint& clientPoint, const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers) = 0; virtual void dragTargetDragLeave() = 0; + // FIXME: Remove this method after chromium changes catch up. virtual void dragTargetDrop( const WebPoint& clientPoint, const WebPoint& screenPoint) = 0; + virtual void dragTargetDrop( + const WebPoint& clientPoint, const WebPoint& screenPoint, + int keyModifiers) = 0; // Support for resource loading initiated by plugins ------------------- diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h index c4a5e40d2..21dc250a9 100644 --- a/Source/WebKit/chromium/public/WebViewClient.h +++ b/Source/WebKit/chromium/public/WebViewClient.h @@ -250,6 +250,8 @@ public: virtual void showContextMenu(WebFrame*, const WebContextMenuData&) { } // Called when a drag-n-drop operation should begin. + virtual void startDragging(WebFrame*, const WebDragData& dragData, WebDragOperationsMask mask, const WebImage& dragImage, const WebPoint& dragImageOffset) { startDragging(dragData, mask, dragImage, dragImageOffset); } + // FIXME: Remove once the chromium side has landed. virtual void startDragging( const WebDragData&, WebDragOperationsMask, const WebImage&, const WebPoint&) { } diff --git a/Source/WebKit/chromium/public/WebWidget.h b/Source/WebKit/chromium/public/WebWidget.h index fad319d78..c756eb2a6 100644 --- a/Source/WebKit/chromium/public/WebWidget.h +++ b/Source/WebKit/chromium/public/WebWidget.h @@ -177,6 +177,10 @@ public: // If the selection range is empty, it returns the caret bounds. virtual bool selectionBounds(WebRect& start, WebRect& end) const { return false; } + // Returns the text direction at the start and end bounds of the current selection. + // If the selection range is empty, it returns false. + virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const { return false; } + // Fetch the current selection range of this WebWidget. If there is no // selection, it will output a 0-length range with the location at the // caret. Returns true and fills the out-paramters on success; returns false diff --git a/Source/WebKit/chromium/public/WebWorkerRunLoop.h b/Source/WebKit/chromium/public/WebWorkerRunLoop.h index d15abed91..032024adb 100644 --- a/Source/WebKit/chromium/public/WebWorkerRunLoop.h +++ b/Source/WebKit/chromium/public/WebWorkerRunLoop.h @@ -22,46 +22,4 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebWorkerRunLoop_h -#define WebWorkerRunLoop_h - -#include "platform/WebCommon.h" - -namespace WebCore { -class WorkerRunLoop; -} - -namespace WebKit { - -class WebWorkerRunLoop { -public: - class Task { - public: - virtual ~Task() { } - virtual void Run() = 0; - }; - WEBKIT_EXPORT void postTask(Task*); - WEBKIT_EXPORT bool equals(const WebWorkerRunLoop&) const; - WEBKIT_EXPORT bool lessThan(const WebWorkerRunLoop&) const; - -#if WEBKIT_IMPLEMENTATION - WebWorkerRunLoop(WebCore::WorkerRunLoop*); -#endif - -private: - WebCore::WorkerRunLoop* m_workerRunLoop; -}; - -inline bool operator==(const WebWorkerRunLoop& a, const WebWorkerRunLoop& b) -{ - return a.equals(b); -} - -inline bool operator<(const WebWorkerRunLoop& a, const WebWorkerRunLoop& b) -{ - return a.lessThan(b); -} - -} - -#endif +#include "../../../Platform/chromium/public/WebWorkerRunLoop.h" diff --git a/Source/WebKit/chromium/public/android/WebInputEventFactory.h b/Source/WebKit/chromium/public/android/WebInputEventFactory.h index fb52787a7..f1edbb1a7 100644 --- a/Source/WebKit/chromium/public/android/WebInputEventFactory.h +++ b/Source/WebKit/chromium/public/android/WebInputEventFactory.h @@ -46,6 +46,13 @@ public: MouseEventTypeMove, }; + enum MouseWheelDirectionType { + MouseWheelDirectionTypeUp = 0, + MouseWheelDirectionTypeDown, + MouseWheelDirectionTypeLeft, + MouseWheelDirectionTypeRight, + }; + WEBKIT_EXPORT static WebKeyboardEvent keyboardEvent(WebInputEvent::Type, int modifiers, double timeStampSeconds, @@ -53,15 +60,27 @@ public: WebUChar unicodeCharacter, bool isSystemKey); - WEBKIT_EXPORT static WebMouseEvent mouseEvent(int x, - int y, + WEBKIT_EXPORT static WebMouseEvent mouseEvent(MouseEventType, + WebMouseEvent::Button, + double timeStampSeconds, int windowX, int windowY, - MouseEventType, - double timeStampSeconds, int modifiers, - int clickCount, - WebMouseEvent::Button = WebMouseEvent::ButtonLeft); + int clickCount); + + WEBKIT_EXPORT static WebMouseWheelEvent mouseWheelEvent(MouseWheelDirectionType, + double timeStampSeconds, + int windowX, + int windowY); + + WEBKIT_EXPORT static WebGestureEvent gestureEvent(WebInputEvent::Type, + double timeStampSeconds, + int x, + int y, + float deltaX, + float deltaY, + int modifiers); + }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/platform/WebBlobData.h b/Source/WebKit/chromium/public/platform/WebBlobData.h index 7fa32d3b6..e6c093e81 100644 --- a/Source/WebKit/chromium/public/platform/WebBlobData.h +++ b/Source/WebKit/chromium/public/platform/WebBlobData.h @@ -28,67 +28,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebBlobData_h -#define WebBlobData_h - -#include "WebString.h" -#include "WebThreadSafeData.h" -#include "WebURL.h" - -#if WEBKIT_IMPLEMENTATION -namespace WebCore { class BlobData; } -namespace WTF { template <typename T> class PassOwnPtr; } -#endif - -namespace WebKit { - -class WebBlobDataPrivate; - -class WebBlobData { -public: - struct Item { - enum { TypeData, TypeFile, TypeBlob } type; - WebThreadSafeData data; - WebString filePath; - WebURL blobURL; - long long offset; - long long length; // -1 means go to the end of the file/blob. - double expectedModificationTime; // 0.0 means that the time is not set. - }; - - ~WebBlobData() { reset(); } - - WebBlobData() : m_private(0) { } - - WEBKIT_EXPORT void initialize(); - WEBKIT_EXPORT void reset(); - - bool isNull() const { return !m_private; } - - // Returns the number of items. - WEBKIT_EXPORT size_t itemCount() const; - - // Retrieves the values of the item at the given index. Returns false if - // index is out of bounds. - WEBKIT_EXPORT bool itemAt(size_t index, Item& result) const; - - WEBKIT_EXPORT WebString contentType() const; - - WEBKIT_EXPORT WebString contentDisposition() const; - -#if WEBKIT_IMPLEMENTATION - WebBlobData(const WTF::PassOwnPtr<WebCore::BlobData>&); - WebBlobData& operator=(const WTF::PassOwnPtr<WebCore::BlobData>&); - operator WTF::PassOwnPtr<WebCore::BlobData>(); -#endif - -private: -#if WEBKIT_IMPLEMENTATION - void assign(const WTF::PassOwnPtr<WebCore::BlobData>&); -#endif - WebBlobDataPrivate* m_private; -}; - -} // namespace WebKit - -#endif // WebBlobData_h +#include "../../../../Platform/chromium/public/WebBlobData.h" diff --git a/Source/WebKit/chromium/public/platform/WebBlobRegistry.h b/Source/WebKit/chromium/public/platform/WebBlobRegistry.h index d882abad9..f5489df1a 100644 --- a/Source/WebKit/chromium/public/platform/WebBlobRegistry.h +++ b/Source/WebKit/chromium/public/platform/WebBlobRegistry.h @@ -28,31 +28,4 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebBlobRegistry_h -#define WebBlobRegistry_h - -#include "WebCommon.h" - -namespace WebKit { - -class WebBlobData; -class WebURL; - -class WebBlobRegistry { -public: - WEBKIT_EXPORT static WebBlobRegistry* create(); - - virtual ~WebBlobRegistry() { } - - // Registers a blob URL referring to the specified blob data. - virtual void registerBlobURL(const WebURL&, WebBlobData&) = 0; - - // Registers a blob URL referring to the blob data identified by the specified srcURL. - virtual void registerBlobURL(const WebURL&, const WebURL& srcURL) = 0; - - virtual void unregisterBlobURL(const WebURL&) = 0; -}; - -} // namespace WebKit - -#endif // WebBlobRegistry_h +#include "../../../../Platform/chromium/public/WebBlobRegistry.h" diff --git a/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h b/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h index cc5571ea6..43282315f 100644 --- a/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h +++ b/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h @@ -50,9 +50,7 @@ namespace WebKit { class WebApplicationCacheHost; // FIXME: Does this belong in platform? class WebApplicationCacheHostClient; // FIXME: Does this belong in platform? -class WebBlobRegistry; class WebCookieJar; -class WebFileUtilities; class WebIDBFactory; // FIXME: Does this belong in platform? class WebIDBKey; // FIXME: Does this belong in platform? class WebMessagePortChannel; // FIXME: Does this belong in platform? @@ -61,14 +59,10 @@ class WebSandboxSupport; class WebSharedWorkerRepository; // FIXME: Does this belong in platform? class WebStorageNamespace; // FIXME: Does this belong in platform? class WebThemeEngine; -class WebWorkerRunLoop; // FIXME: Eventually all these API will need to move to WebKit::Platform. class WebKitPlatformSupport : public Platform { public: - // Must return non-null. - virtual WebFileUtilities* fileUtilities() { return 0; } - // May return null if sandbox support is not necessary virtual WebSandboxSupport* sandboxSupport() { return 0; } @@ -78,16 +72,16 @@ public: // May return null. virtual WebCookieJar* cookieJar() { return 0; } - // Blob ---------------------------------------------------------------- - - // Must return non-null. - virtual WebBlobRegistry* blobRegistry() { return 0; } - // DOM Storage -------------------------------------------------- // Return a LocalStorage namespace that corresponds to the following path. virtual WebStorageNamespace* createLocalStorageNamespace(const WebString& path, unsigned quota) { return 0; } + // DEPRECATED + virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue, + const WebString& newValue, const WebString& origin, + const WebURL& url, bool isLocalStorage) { } + // HTML5 Database ------------------------------------------------------ @@ -154,10 +148,6 @@ public: virtual WebSharedWorkerRepository* sharedWorkerRepository() { return 0; } // GPU ---------------------------------------------------------------- - // - // May return null if GPU is not supported. - // Returns newly allocated and initialized offscreen WebGraphicsContext3D instance. - virtual WebGraphicsContext3D* createOffscreenGraphicsContext3D(const WebGraphicsContext3D::Attributes&) { return 0; } // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas. // This will return false if the platform cannot promise that contexts will be preserved across operations like @@ -167,11 +157,6 @@ public: virtual bool canAccelerate2dCanvas() { return false; } - // WebWorker ---------------------------------------------------------- - - virtual void didStartWorkerRunLoop(const WebWorkerRunLoop&) { } - virtual void didStopWorkerRunLoop(const WebWorkerRunLoop&) { } - protected: ~WebKitPlatformSupport() { } }; diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 322f15046..cd0f07ff6 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -62,7 +62,9 @@ #include "PeerConnection00.h" #include "PlatformCursor.h" #include "ReferrerPolicy.h" +#include "ResourceResponse.h" #include "Settings.h" +#include "SpeechRecognitionError.h" #include "StorageInfo.h" #include "TextAffinity.h" #include "TextChecking.h" @@ -92,6 +94,7 @@ #include "WebPageVisibilityState.h" #include "WebScrollbar.h" #include "WebSettings.h" +#include "WebSpeechRecognizerClient.h" #include "WebStorageQuotaError.h" #include "WebStorageQuotaType.h" #include "WebTextAffinity.h" @@ -107,6 +110,7 @@ #include <public/WebFileSystem.h> #include <public/WebFilterOperation.h> #include <public/WebReferrerPolicy.h> +#include <public/WebURLResponse.h> #include <wtf/Assertions.h> #include <wtf/text/StringImpl.h> @@ -563,6 +567,18 @@ COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateFailed, P COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateClosed, PeerConnection00::ICE_CLOSED); #endif +#if ENABLE(SCRIPTED_SPEECH) +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::OtherError, SpeechRecognitionError::OTHER); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::NoSpeechError, SpeechRecognitionError::NO_SPEECH); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::AbortedError, SpeechRecognitionError::ABORTED); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::AudioCaptureError, SpeechRecognitionError::AUDIO_CAPTURE); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::NetworkError, SpeechRecognitionError::NETWORK); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::NotAllowedError, SpeechRecognitionError::NOT_ALLOWED); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::ServiceNotAllowedError, SpeechRecognitionError::SERVICE_NOT_ALLOWED); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::BadGrammarError, SpeechRecognitionError::BAD_GRAMMAR); +COMPILE_ASSERT_MATCHING_ENUM(WebSpeechRecognizerClient::LanguageNotSupportedError, SpeechRecognitionError::LANGUAGE_NOT_SUPPORTED); +#endif + COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyAlways, ReferrerPolicyAlways); COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyDefault, ReferrerPolicyDefault); COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyNever, ReferrerPolicyNever); @@ -570,3 +586,8 @@ COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyOrigin, ReferrerPolicyOrigin); COMPILE_ASSERT_MATCHING_ENUM(WebContentSecurityPolicyTypeReportOnly, ContentSecurityPolicy::ReportOnly); COMPILE_ASSERT_MATCHING_ENUM(WebContentSecurityPolicyTypeEnforcePolicy, ContentSecurityPolicy::EnforcePolicy); + +COMPILE_ASSERT_MATCHING_ENUM(WebURLResponse::Unknown, ResourceResponse::Unknown); +COMPILE_ASSERT_MATCHING_ENUM(WebURLResponse::HTTP_0_9, ResourceResponse::HTTP_0_9); +COMPILE_ASSERT_MATCHING_ENUM(WebURLResponse::HTTP_1_0, ResourceResponse::HTTP_1_0); +COMPILE_ASSERT_MATCHING_ENUM(WebURLResponse::HTTP_1_1, ResourceResponse::HTTP_1_1); diff --git a/Source/WebKit/chromium/src/BlobRegistryProxy.cpp b/Source/WebKit/chromium/src/BlobRegistryProxy.cpp index 2bbc51f44..05fbb3638 100644 --- a/Source/WebKit/chromium/src/BlobRegistryProxy.cpp +++ b/Source/WebKit/chromium/src/BlobRegistryProxy.cpp @@ -38,10 +38,10 @@ #include "KURL.h" #include "ResourceHandle.h" #include "WebKit.h" -#include "platform/WebBlobData.h" -#include "platform/WebBlobRegistry.h" -#include "platform/WebKitPlatformSupport.h" #include "platform/WebURL.h" +#include <public/Platform.h> +#include <public/WebBlobData.h> +#include <public/WebBlobRegistry.h> #include <wtf/MainThread.h> #include <wtf/StdLibExtras.h> @@ -58,7 +58,7 @@ BlobRegistry& blobRegistry() } BlobRegistryProxy::BlobRegistryProxy() - : m_webBlobRegistry(WebKit::webKitPlatformSupport()->blobRegistry()) + : m_webBlobRegistry(WebKit::Platform::current()->blobRegistry()) { } diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 8808e5d6a..70d565c2e 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -586,15 +586,6 @@ void ChromeClientImpl::contentsSizeChanged(Frame* frame, const IntSize& size) co void ChromeClientImpl::layoutUpdated(Frame* frame) const { -#if ENABLE(VIEWPORT) - if (!m_webView->isPageScaleFactorSet() && frame == frame->page()->mainFrame()) { - // If the page does not have a viewport tag, then compute a scale - // factor to make the page width fit the device width based on the - // default viewport parameters. - ViewportArguments viewport = frame->document()->viewportArguments(); - dispatchViewportPropertiesDidChange(viewport); - } -#endif m_webView->layoutUpdated(WebFrameImpl::fromFrame(frame)); } diff --git a/Source/WebKit/chromium/src/DeliveredIntentClientImpl.cpp b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.cpp new file mode 100644 index 000000000..787efd464 --- /dev/null +++ b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.cpp @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011 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 "DeliveredIntentClientImpl.h" + +#include "WebDeliveredIntentClient.h" +#include "platform/WebSerializedScriptValue.h" + +namespace WebKit { + +DeliveredIntentClientImpl::DeliveredIntentClientImpl(WebDeliveredIntentClient* client) + : m_client(client) +{ +} + +DeliveredIntentClientImpl::~DeliveredIntentClientImpl() +{ + m_client->destroy(); + m_client = 0; +} + +void DeliveredIntentClientImpl::postResult(PassRefPtr<WebCore::SerializedScriptValue> data) +{ + m_client->postResult(data); +} + +void DeliveredIntentClientImpl::postFailure(PassRefPtr<WebCore::SerializedScriptValue> data) +{ + m_client->postFailure(data); +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h new file mode 100644 index 000000000..a94d39b7c --- /dev/null +++ b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 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 DeliveredIntentClientImpl_h +#define DeliveredIntentClientImpl_h + +#include "DeliveredIntent.h" +#include "SerializedScriptValue.h" +#include "platform/WebCommon.h" +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebDeliveredIntentClient; +class WebSerializedScriptValue; + +// The embedder implements this interface to receive reply calls from the service +// in response to the delivery of a web intent. This client must remain valid +// until the destroy() method is called, or until the WebFrame to which it is +// delivered is destroyed. +// See spec at http://www.chromium.org/developers/design-documents/webintentsapi +class DeliveredIntentClientImpl : public WebCore::DeliveredIntentClient { + WTF_MAKE_NONCOPYABLE(DeliveredIntentClientImpl); +public: + explicit DeliveredIntentClientImpl(WebDeliveredIntentClient*); + virtual ~DeliveredIntentClientImpl(); + + virtual void postResult(PassRefPtr<WebCore::SerializedScriptValue> data); + virtual void postFailure(PassRefPtr<WebCore::SerializedScriptValue> data); + +private: + WebDeliveredIntentClient* m_client; +}; + +} // namespace WebKit + +#endif // DeliveredIntentClientImpl_h diff --git a/Source/WebKit/chromium/src/DragClientImpl.cpp b/Source/WebKit/chromium/src/DragClientImpl.cpp index afa570611..a6fb0bd33 100644 --- a/Source/WebKit/chromium/src/DragClientImpl.cpp +++ b/Source/WebKit/chromium/src/DragClientImpl.cpp @@ -87,10 +87,7 @@ void DragClientImpl::startDrag(DragImageRef dragImage, IntSize offsetSize(eventPos - dragImageOrigin); WebPoint offsetPoint(offsetSize.width(), offsetSize.height()); - m_webView->startDragging( - dragData, static_cast<WebDragOperationsMask>(dragOperationMask), - dragImage ? WebImage(*dragImage) : WebImage(), - offsetPoint); + m_webView->startDragging(frame, dragData, static_cast<WebDragOperationsMask>(dragOperationMask), dragImage ? WebImage(*dragImage) : WebImage(), offsetPoint); } void DragClientImpl::dragControllerDestroyed() diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 934281a29..8d4774dbe 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -39,6 +39,7 @@ #include "PlatformKeyboardEvent.h" #include "PlatformString.h" #include "RenderObject.h" +#include "Settings.h" #include "SpellChecker.h" #include "UndoStep.h" @@ -87,6 +88,21 @@ void EditorClientImpl::pageDestroyed() // Our lifetime is bound to the WebViewImpl. } +void EditorClientImpl::frameWillDetachPage(WebCore::Frame* frame) +{ + HashSet<WebTextCheckingCompletionImpl*> validRequests; + + for (HashSet<WebTextCheckingCompletionImpl*>::iterator i = m_pendingTextChecks.begin(); + i != m_pendingTextChecks.end(); ++i) { + if (frame->editor()->spellChecker() == (*i)->spellChecker()) + (*i)->invalidate(); + else + validRequests.add(*i); + } + + m_pendingTextChecks.swap(validRequests); +} + bool EditorClientImpl::shouldShowDeleteInterface(HTMLElement* elem) { // Normally, we don't care to show WebCore's deletion UI, so we only enable @@ -694,6 +710,12 @@ void EditorClientImpl::textDidChangeInTextArea(Element*) { } +bool EditorClientImpl::shouldEraseMarkersAfterChangeSelection(TextCheckingType type) const +{ + const Frame* frame = m_webView->focusedWebCoreFrame(); + return !frame || !frame->settings() || !frame->settings()->asynchronousSpellCheckingEnabled(); +} + void EditorClientImpl::ignoreWordInSpellDocument(const String&) { notImplemented(); @@ -731,8 +753,17 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, const WebCore::TextCheckingRequest& request) { - if (m_webView->spellCheckClient()) - m_webView->spellCheckClient()->requestCheckingOfText(request.text(), new WebTextCheckingCompletionImpl(request.sequence(), sender)); + if (!m_webView->spellCheckClient()) + return; + + WebTextCheckingCompletionImpl* completion = new WebTextCheckingCompletionImpl(request.sequence(), sender, this); + m_pendingTextChecks.add(completion); + m_webView->spellCheckClient()->requestCheckingOfText(request.text(), completion); +} + +void EditorClientImpl::didCheckString(WebTextCheckingCompletionImpl* completion) +{ + m_pendingTextChecks.remove(completion); } String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) diff --git a/Source/WebKit/chromium/src/EditorClientImpl.h b/Source/WebKit/chromium/src/EditorClientImpl.h index b167b6c2d..47e8c508f 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.h +++ b/Source/WebKit/chromium/src/EditorClientImpl.h @@ -35,6 +35,7 @@ #include "TextCheckerClient.h" #include "Timer.h" #include <wtf/Deque.h> +#include <wtf/HashSet.h> namespace WebCore { class Frame; @@ -44,6 +45,7 @@ class SpellChecker; namespace WebKit { class WebViewImpl; +class WebTextCheckingCompletionImpl; class EditorClientImpl : public WebCore::EditorClient, public WebCore::TextCheckerClient { public: @@ -51,6 +53,7 @@ public: virtual ~EditorClientImpl(); virtual void pageDestroyed(); + virtual void frameWillDetachPage(WebCore::Frame*) OVERRIDE; virtual bool shouldShowDeleteInterface(WebCore::HTMLElement*); virtual bool smartInsertDeleteEnabled(); @@ -94,6 +97,7 @@ public: virtual bool doTextFieldCommandFromEvent(WebCore::Element*, WebCore::KeyboardEvent*); virtual void textWillBeDeletedInTextField(WebCore::Element*); virtual void textDidChangeInTextArea(WebCore::Element*); + virtual bool shouldEraseMarkersAfterChangeSelection(WebCore::TextCheckingType) const; virtual void ignoreWordInSpellDocument(const WTF::String&); virtual void learnWord(const WTF::String&); virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); @@ -113,6 +117,8 @@ public: virtual WebCore::TextCheckerClient* textChecker() { return this; } + void didCheckString(WebTextCheckingCompletionImpl*); + private: void modifySelection(WebCore::Frame*, WebCore::KeyboardEvent*); @@ -140,6 +146,8 @@ private: SpellCheckForcedOff }; int m_spellCheckThisFieldStatus; + + WTF::HashSet<WebTextCheckingCompletionImpl*> m_pendingTextChecks; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 60919a20c..3ef8cf8a2 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -34,38 +34,21 @@ #include "GraphicsContext3D.h" -#include "CachedImage.h" -#include "CanvasRenderingContext.h" -#include "Chrome.h" -#include "ChromeClientImpl.h" #include "DrawingBuffer.h" #include "Extensions3DChromium.h" +#include "GrContext.h" +#include "GrGLInterface.h" #include "GraphicsContext3DPrivate.h" -#include "HTMLCanvasElement.h" -#include "HTMLImageElement.h" #include "ImageBuffer.h" #include "ImageData.h" -#include "WebKit.h" -#include "WebViewClient.h" -#include "WebViewImpl.h" -#include "platform/WebGraphicsContext3D.h" -#include "platform/WebKitPlatformSupport.h" +#include <public/Platform.h> +#include <public/WebGraphicsContext3D.h> #include <stdio.h> #include <wtf/FastMalloc.h> #include <wtf/text/CString.h> +#include <wtf/text/StringHash.h> -#if USE(CG) -#include "GraphicsContext.h" -#include "WebGLRenderingContext.h" -#include <CoreGraphics/CGContext.h> -#include <CoreGraphics/CGImage.h> -#endif - -#if USE(SKIA) -#include "GrContext.h" -#include "GrGLInterface.h" -#endif namespace { @@ -100,24 +83,16 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphic , m_layerComposited(false) , m_preserveDrawingBuffer(preserveDrawingBuffer) , m_resourceSafety(ResourceSafetyUnknown) -#if USE(SKIA) , m_grContext(0) -#elif USE(CG) - , m_renderOutputSize(0) -#else -#error Must port to your platform -#endif { } GraphicsContext3DPrivate::~GraphicsContext3DPrivate() { -#if USE(SKIA) if (m_grContext) { m_grContext->contextDestroyed(); GrSafeUnref(m_grContext); } -#endif } PassRefPtr<GraphicsContext3D> GraphicsContext3DPrivate::createGraphicsContextFromWebContext(PassOwnPtr<WebKit::WebGraphicsContext3D> webContext, GraphicsContext3D::RenderStyle renderStyle, bool preserveDrawingBuffer) @@ -166,7 +141,6 @@ Platform3DObject GraphicsContext3DPrivate::platformTexture() const return m_impl->getPlatformTextureId(); } -#if USE(SKIA) class GrMemoryAllocationChangedCallback : public Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM { public: GrMemoryAllocationChangedCallback(GraphicsContext3DPrivate* context) @@ -205,7 +179,6 @@ GrContext* GraphicsContext3DPrivate::grContext() } return m_grContext; } -#endif void GraphicsContext3DPrivate::prepareTexture() { @@ -231,7 +204,7 @@ void GraphicsContext3DPrivate::paintFramebufferToCanvas(int framebuffer, int wid { unsigned char* pixels = 0; size_t bufferSize = 4 * width * height; -#if USE(SKIA) + const SkBitmap* canvasBitmap = imageBuffer->context()->platformContext()->bitmap(); const SkBitmap* readbackBitmap = 0; ASSERT(canvasBitmap->config() == SkBitmap::kARGB_8888_Config); @@ -257,16 +230,6 @@ void GraphicsContext3DPrivate::paintFramebufferToCanvas(int framebuffer, int wid // Read back the frame buffer. SkAutoLockPixels bitmapLock(*readbackBitmap); pixels = static_cast<unsigned char*>(readbackBitmap->getPixels()); -#elif USE(CG) - if (!m_renderOutput || m_renderOutputSize != bufferSize) { - m_renderOutput = adoptArrayPtr(new unsigned char[bufferSize]); - m_renderOutputSize = bufferSize; - } - - pixels = m_renderOutput.get(); -#else -#error Must port to your platform -#endif m_impl->readBackFramebuffer(pixels, 4 * width * height, framebuffer, width, height); @@ -278,7 +241,6 @@ void GraphicsContext3DPrivate::paintFramebufferToCanvas(int framebuffer, int wid } } -#if USE(SKIA) readbackBitmap->notifyPixelsChanged(); if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. @@ -287,23 +249,17 @@ void GraphicsContext3DPrivate::paintFramebufferToCanvas(int framebuffer, int wid dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height())); canvas.drawBitmapRect(m_resizingBitmap, 0, dst); } -#elif USE(CG) - GraphicsContext3D::paintToCanvas(pixels, width, height, imageBuffer->width(), imageBuffer->height(), imageBuffer->context()->platformContext()); -#else -#error Must port to your platform -#endif } -void GraphicsContext3DPrivate::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer) +void GraphicsContext3DPrivate::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer) { - ImageBuffer* imageBuffer = context->canvas()->buffer(); Platform3DObject framebufferId; int width, height; getDrawingParameters(drawingBuffer, m_impl.get(), &framebufferId, &width, &height); paintFramebufferToCanvas(framebufferId, width, height, !m_impl->getContextAttributes().premultipliedAlpha, imageBuffer); } -bool GraphicsContext3DPrivate::paintCompositedResultsToCanvas(CanvasRenderingContext* context) +bool GraphicsContext3DPrivate::paintCompositedResultsToCanvas(ImageBuffer*) { return false; } @@ -1043,7 +999,7 @@ PassRefPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attri webAttributes.shareResources = attrs.shareResources; webAttributes.preferDiscreteGPU = attrs.preferDiscreteGPU; - OwnPtr<WebKit::WebGraphicsContext3D> webContext = adoptPtr(WebKit::webKitPlatformSupport()->createOffscreenGraphicsContext3D(webAttributes)); + OwnPtr<WebKit::WebGraphicsContext3D> webContext = adoptPtr(WebKit::Platform::current()->createOffscreenGraphicsContext3D(webAttributes)); if (!webContext) return 0; @@ -1060,12 +1016,10 @@ Platform3DObject GraphicsContext3D::platformTexture() const return m_private->platformTexture(); } -#if USE(SKIA) GrContext* GraphicsContext3D::grContext() { return m_private->grContext(); } -#endif void GraphicsContext3D::prepareTexture() { @@ -1244,9 +1198,9 @@ bool GraphicsContext3D::layerComposited() const return m_private->layerComposited(); } -void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer) +void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer) { - return m_private->paintRenderingResultsToCanvas(context, drawingBuffer); + return m_private->paintRenderingResultsToCanvas(imageBuffer, drawingBuffer); } PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData(DrawingBuffer* drawingBuffer) @@ -1254,7 +1208,7 @@ PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData(Drawin return m_private->paintRenderingResultsToImageData(drawingBuffer); } -DELEGATE_TO_INTERNAL_1R(paintCompositedResultsToCanvas, CanvasRenderingContext*, bool) +DELEGATE_TO_INTERNAL_1R(paintCompositedResultsToCanvas, ImageBuffer*, bool) DELEGATE_TO_INTERNAL_R(createBuffer, Platform3DObject) DELEGATE_TO_INTERNAL_R(createFramebuffer, Platform3DObject) diff --git a/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h b/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h index b79898971..a269192a4 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h @@ -28,16 +28,12 @@ #include "Extensions3DChromium.h" #include "GraphicsContext3D.h" +#include "SkBitmap.h" #include <wtf/HashSet.h> #include <wtf/OwnArrayPtr.h> #include <wtf/OwnPtr.h> -#if USE(SKIA) -#include "SkBitmap.h" -#endif -#if USE(SKIA) class GrContext; -#endif namespace WebKit { class WebGraphicsContext3D; @@ -68,9 +64,7 @@ public: PlatformGraphicsContext3D platformGraphicsContext3D() const; Platform3DObject platformTexture() const; -#if USE(SKIA) GrContext* grContext(); -#endif bool makeContextCurrent(); @@ -82,10 +76,10 @@ public: bool layerComposited() const; void markLayerComposited(); - void paintRenderingResultsToCanvas(CanvasRenderingContext*, DrawingBuffer*); + void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*); void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*); PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*); - bool paintCompositedResultsToCanvas(CanvasRenderingContext*); + bool paintCompositedResultsToCanvas(ImageBuffer*); void prepareTexture(); @@ -324,6 +318,8 @@ public: private: GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer); + void initializeExtensions(); + OwnPtr<WebKit::WebGraphicsContext3D> m_impl; OwnPtr<Extensions3DChromium> m_extensions; OwnPtr<GraphicsContextLostCallbackAdapter> m_contextLostCallbackAdapter; @@ -343,7 +339,6 @@ private: }; ResourceSafety m_resourceSafety; -#if USE(SKIA) // If the width and height of the Canvas's backing store don't // match those that we were given in the most recent call to // reshape(), then we need an intermediate bitmap to read back the @@ -352,14 +347,6 @@ private: SkBitmap m_resizingBitmap; GrContext* m_grContext; -#endif - -#if USE(CG) - OwnArrayPtr<unsigned char> m_renderOutput; - size_t m_renderOutputSize; -#endif - - void initializeExtensions(); }; } // namespace WebCore diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 0014f2959..fc746aa6b 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -60,11 +60,6 @@ String IDBIndexBackendProxy::name() return m_webIDBIndex->name(); } -String IDBIndexBackendProxy::storeName() -{ - return m_webIDBIndex->storeName(); -} - String IDBIndexBackendProxy::keyPath() { return m_webIDBIndex->keyPath().string(); diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h index 42e0eabbe..d5cc8bbfe 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -42,7 +42,6 @@ public: virtual ~IDBIndexBackendProxy(); virtual String name(); - virtual String storeName(); virtual String keyPath(); virtual bool unique(); virtual bool multiEntry(); diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index 21a5dd856..24f23a595 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -74,6 +74,11 @@ PassRefPtr<DOMStringList> IDBObjectStoreBackendProxy::indexNames() const return m_webIDBObjectStore->indexNames(); } +bool IDBObjectStoreBackendProxy::autoIncrement() const +{ + return m_webIDBObjectStore->autoIncrement(); +} + void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h index 5e1189186..fb7781d60 100644 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -45,6 +45,7 @@ public: virtual String name() const; virtual String keyPath() const; virtual PassRefPtr<WebCore::DOMStringList> indexNames() const; + virtual bool autoIncrement() const; virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp index 6d11d8a59..b1eecddac 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp @@ -39,6 +39,7 @@ namespace WebKit { NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint) : m_contentPaint(contentPaint) , m_showDebugBorders(false) + , m_deviceScaleFactor(1.0) { m_graphicsLayer = WebCore::GraphicsLayer::create(this); #ifndef NDEBUG @@ -92,7 +93,7 @@ static void reserveScrollbarLayers(WebCore::LayerChromium* layer, WebCore::Layer layer->setAlwaysReserveTextures(true); } -void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float pageScale, int layerAdjustX) +void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float deviceScale, int layerAdjustX) { if (!scrollLayer()) return; @@ -105,6 +106,8 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, // Due to the possibility of pinch zoom, the noncomposited layer is always // assumed to be scrollable. scrollLayer()->setScrollable(true); + m_deviceScaleFactor = deviceScale; + m_graphicsLayer->deviceOrPageScaleFactorChanged(); m_graphicsLayer->setSize(contentsSize); m_layerAdjustX = layerAdjustX; @@ -119,9 +122,6 @@ void NonCompositedContentHost::setViewport(const WebCore::IntSize& viewportSize, } else if (visibleRectChanged) m_graphicsLayer->setNeedsDisplay(); - if (m_graphicsLayer->pageScaleFactor() != pageScale) - m_graphicsLayer->deviceOrPageScaleFactorChanged(); - WebCore::LayerChromium* clipLayer = scrollLayer()->parent(); WebCore::LayerChromium* rootLayer = clipLayer; while (rootLayer->parent()) diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h index be9f509a2..ace408af2 100644 --- a/Source/WebKit/chromium/src/NonCompositedContentHost.h +++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h @@ -57,7 +57,7 @@ public: void invalidateRect(const WebCore::IntRect&); void setBackgroundColor(const WebCore::Color&); void setScrollLayer(WebCore::GraphicsLayer*); - void setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float pageScale, int layerAdjustX); + void setViewport(const WebCore::IntSize& viewportSize, const WebCore::IntSize& contentsSize, const WebCore::IntPoint& scrollPosition, float deviceScale, int layerAdjustX); void protectVisibleTileTextures(); WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); } @@ -73,6 +73,11 @@ private: virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect); virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const; virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const; + // The deviceScaleFactor given to the GraphicsLayer can be non-1 when the + // contents are scaled in the compositor instead of by the pageScaleFactor. + // However, the pageScaleFactor is always baked into the GraphicsLayer's + // size, so it is always 1 for the GraphicsLayer. + virtual float deviceScaleFactor() const OVERRIDE { return m_deviceScaleFactor; } WebCore::LayerChromium* scrollLayer(); @@ -81,6 +86,7 @@ private: WebCore::IntSize m_viewportSize; int m_layerAdjustX; bool m_showDebugBorders; + float m_deviceScaleFactor; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index 717455688..bbd07ca7c 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -48,7 +48,6 @@ #include "WebViewClient.h" #include "WebViewImpl.h" #include "WebWorkerClientImpl.h" -#include "WebWorkerRunLoop.h" #include "platform/WebAudioBus.h" #include "platform/WebCookie.h" #include "platform/WebCookieJar.h" @@ -61,10 +60,6 @@ #include "platform/WebURL.h" #include "platform/WebVector.h" -#if USE(CG) -#include <CoreGraphics/CGContext.h> -#endif - #if OS(WINDOWS) #include "platform/WebRect.h" #include "platform/win/WebThemeEngine.h" @@ -100,6 +95,7 @@ #include "WorkerContextProxy.h" #include <public/WebClipboard.h> #include <public/WebMimeRegistry.h> +#include <public/WebWorkerRunLoop.h> #include <wtf/Assertions.h> // We are part of the WebKit implementation. @@ -305,33 +301,33 @@ bool PlatformSupport::cookiesEnabled(const Document* document) bool PlatformSupport::fileExists(const String& path) { - return webKitPlatformSupport()->fileUtilities()->fileExists(path); + return WebKit::Platform::current()->fileUtilities()->fileExists(path); } bool PlatformSupport::deleteFile(const String& path) { - return webKitPlatformSupport()->fileUtilities()->deleteFile(path); + return WebKit::Platform::current()->fileUtilities()->deleteFile(path); } bool PlatformSupport::deleteEmptyDirectory(const String& path) { - return webKitPlatformSupport()->fileUtilities()->deleteEmptyDirectory(path); + return WebKit::Platform::current()->fileUtilities()->deleteEmptyDirectory(path); } bool PlatformSupport::getFileSize(const String& path, long long& result) { - return webKitPlatformSupport()->fileUtilities()->getFileSize(path, result); + return WebKit::Platform::current()->fileUtilities()->getFileSize(path, result); } void PlatformSupport::revealFolderInOS(const String& path) { - webKitPlatformSupport()->fileUtilities()->revealFolderInOS(path); + WebKit::Platform::current()->fileUtilities()->revealFolderInOS(path); } bool PlatformSupport::getFileModificationTime(const String& path, time_t& result) { double modificationTime; - if (!webKitPlatformSupport()->fileUtilities()->getFileModificationTime(path, modificationTime)) + if (!WebKit::Platform::current()->fileUtilities()->getFileModificationTime(path, modificationTime)) return false; result = static_cast<time_t>(modificationTime); return true; @@ -339,62 +335,62 @@ bool PlatformSupport::getFileModificationTime(const String& path, time_t& result String PlatformSupport::directoryName(const String& path) { - return webKitPlatformSupport()->fileUtilities()->directoryName(path); + return WebKit::Platform::current()->fileUtilities()->directoryName(path); } String PlatformSupport::pathByAppendingComponent(const String& path, const String& component) { - return webKitPlatformSupport()->fileUtilities()->pathByAppendingComponent(path, component); + return WebKit::Platform::current()->fileUtilities()->pathByAppendingComponent(path, component); } bool PlatformSupport::makeAllDirectories(const String& path) { - return webKitPlatformSupport()->fileUtilities()->makeAllDirectories(path); + return WebKit::Platform::current()->fileUtilities()->makeAllDirectories(path); } String PlatformSupport::getAbsolutePath(const String& path) { - return webKitPlatformSupport()->fileUtilities()->getAbsolutePath(path); + return WebKit::Platform::current()->fileUtilities()->getAbsolutePath(path); } bool PlatformSupport::isDirectory(const String& path) { - return webKitPlatformSupport()->fileUtilities()->isDirectory(path); + return WebKit::Platform::current()->fileUtilities()->isDirectory(path); } KURL PlatformSupport::filePathToURL(const String& path) { - return webKitPlatformSupport()->fileUtilities()->filePathToURL(path); + return WebKit::Platform::current()->fileUtilities()->filePathToURL(path); } PlatformFileHandle PlatformSupport::openFile(const String& path, FileOpenMode mode) { - return webKitPlatformSupport()->fileUtilities()->openFile(path, mode); + return WebKit::Platform::current()->fileUtilities()->openFile(path, mode); } void PlatformSupport::closeFile(PlatformFileHandle& handle) { - webKitPlatformSupport()->fileUtilities()->closeFile(handle); + WebKit::Platform::current()->fileUtilities()->closeFile(handle); } long long PlatformSupport::seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin) { - return webKitPlatformSupport()->fileUtilities()->seekFile(handle, offset, origin); + return WebKit::Platform::current()->fileUtilities()->seekFile(handle, offset, origin); } bool PlatformSupport::truncateFile(PlatformFileHandle handle, long long offset) { - return webKitPlatformSupport()->fileUtilities()->truncateFile(handle, offset); + return WebKit::Platform::current()->fileUtilities()->truncateFile(handle, offset); } int PlatformSupport::readFromFile(PlatformFileHandle handle, char* data, int length) { - return webKitPlatformSupport()->fileUtilities()->readFromFile(handle, data, length); + return WebKit::Platform::current()->fileUtilities()->readFromFile(handle, data, length); } int PlatformSupport::writeToFile(PlatformFileHandle handle, const char* data, int length) { - return webKitPlatformSupport()->fileUtilities()->writeToFile(handle, data, length); + return WebKit::Platform::current()->fileUtilities()->writeToFile(handle, data, length); } #if ENABLE(FILE_SYSTEM) @@ -830,11 +826,6 @@ LinkHash PlatformSupport::visitedLinkHash(const KURL& base, return webKitPlatformSupport()->visitedLinkHash(buffer.data(), buffer.length()); } -bool PlatformSupport::isLinkVisited(LinkHash visitedLinkHash) -{ - return webKitPlatformSupport()->isLinkVisited(visitedLinkHash); -} - // These are temporary methods that the WebKit layer can use to call to the // Glue layer. Once the Glue layer moves entirely into the WebKit layer, these // methods will be deleted. @@ -915,12 +906,12 @@ bool PlatformSupport::popupsAllowed(NPP npp) #if ENABLE(WORKERS) void PlatformSupport::didStartWorkerRunLoop(WorkerRunLoop* loop) { - webKitPlatformSupport()->didStartWorkerRunLoop(WebWorkerRunLoop(loop)); + WebKit::Platform::current()->didStartWorkerRunLoop(WebWorkerRunLoop(loop)); } void PlatformSupport::didStopWorkerRunLoop(WorkerRunLoop* loop) { - webKitPlatformSupport()->didStopWorkerRunLoop(WebWorkerRunLoop(loop)); + WebKit::Platform::current()->didStopWorkerRunLoop(WebWorkerRunLoop(loop)); } WorkerContextProxy* WorkerContextProxy::create(Worker* worker) diff --git a/Source/WebKit/chromium/src/PrerendererClientImpl.cpp b/Source/WebKit/chromium/src/PrerendererClientImpl.cpp new file mode 100644 index 000000000..4651d279d --- /dev/null +++ b/Source/WebKit/chromium/src/PrerendererClientImpl.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2012 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 "PrerendererClientImpl.h" + +#include "Document.h" +#include "Frame.h" +#include "Prerender.h" +#include "PrerenderHandle.h" +#include "WebPrerendererClient.h" +#include "WebViewImpl.h" +#include <public/WebPrerender.h> +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +PrerendererClientImpl::PrerendererClientImpl(WebPrerendererClient* client) + : m_client(client) +{ +} + +void PrerendererClientImpl::willAddPrerender(WebCore::PrerenderHandle* prerenderHandle) +{ + if (!m_client) + return; + WebPrerender webPrerender(prerenderHandle->prerender()); + m_client->willAddPrerender(&webPrerender); +} + +} diff --git a/Source/WebKit/chromium/src/PrerendererClientImpl.h b/Source/WebKit/chromium/src/PrerendererClientImpl.h new file mode 100644 index 000000000..8517632ae --- /dev/null +++ b/Source/WebKit/chromium/src/PrerendererClientImpl.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2012 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 PrerendererClientImpl_h +#define PrerendererClientImpl_h + +#include "PrerendererClient.h" +#include <wtf/Noncopyable.h> +#include <wtf/PassRefPtr.h> + +namespace WebCore { +class PrerenderHandle; +} + +namespace WebKit { + +class WebPrerendererClient; + +class PrerendererClientImpl : public WebCore::PrerendererClient { + WTF_MAKE_NONCOPYABLE(PrerendererClientImpl); +public: + explicit PrerendererClientImpl(WebPrerendererClient*); + + void willAddPrerender(WebCore::PrerenderHandle*) OVERRIDE; + +private: + WebPrerendererClient* m_client; +}; + +} + +#endif // PrerendererClientImpl_h diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp index 2754c415a..cd35b2620 100644 --- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp +++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp @@ -26,11 +26,14 @@ #include "config.h" #include "SpeechRecognitionClientProxy.h" +#include "ScriptExecutionContext.h" +#include "SecurityOrigin.h" #include "SpeechGrammarList.h" #include "SpeechRecognition.h" #include "SpeechRecognitionError.h" #include "SpeechRecognitionResult.h" #include "SpeechRecognitionResultList.h" +#include "WebSecurityOrigin.h" #include "WebSpeechGrammar.h" #include "WebSpeechRecognitionHandle.h" #include "WebSpeechRecognitionParams.h" @@ -58,7 +61,8 @@ void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const S for (unsigned long i = 0; i < grammarList->length(); ++i) webSpeechGrammars[i] = grammarList->item(i); - m_recognizer->start(WebSpeechRecognitionHandle(recognition), WebSpeechRecognitionParams(webSpeechGrammars, lang, continuous), this); + WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin())); + m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this); } void SpeechRecognitionClientProxy::stop(SpeechRecognition* recognition) @@ -136,7 +140,7 @@ void SpeechRecognitionClientProxy::didDeleteResult(const WebSpeechRecognitionHan recognition->didDeleteResult(resultIndex, SpeechRecognitionResultList::create(resultHistoryVector)); } -void SpeechRecognitionClientProxy::didReceiveError(const WebSpeechRecognitionHandle& handle, const WebString& message, unsigned short code) +void SpeechRecognitionClientProxy::didReceiveError(const WebSpeechRecognitionHandle& handle, const WebString& message, WebSpeechRecognizerClient::ErrorCode code) { RefPtr<SpeechRecognition> recognition = PassRefPtr<SpeechRecognition>(handle); SpeechRecognitionError::Code errorCode = static_cast<SpeechRecognitionError::Code>(code); diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h index a35541ea4..0c3ecebaa 100644 --- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h +++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h @@ -60,7 +60,7 @@ public: virtual void didReceiveResult(const WebSpeechRecognitionHandle&, const WebSpeechRecognitionResult&, unsigned long resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory) OVERRIDE; virtual void didReceiveNoMatch(const WebSpeechRecognitionHandle&, const WebSpeechRecognitionResult&) OVERRIDE; virtual void didDeleteResult(const WebSpeechRecognitionHandle&, unsigned resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory) OVERRIDE; - virtual void didReceiveError(const WebSpeechRecognitionHandle&, const WebString& message, unsigned short code) OVERRIDE; + virtual void didReceiveError(const WebSpeechRecognitionHandle&, const WebString& message, WebSpeechRecognizerClient::ErrorCode) OVERRIDE; virtual void didStart(const WebSpeechRecognitionHandle&) OVERRIDE; virtual void didEnd(const WebSpeechRecognitionHandle&) OVERRIDE; diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.cpp b/Source/WebKit/chromium/src/StorageAreaProxy.cpp index 00cc4433b..11eb7cec3 100644 --- a/Source/WebKit/chromium/src/StorageAreaProxy.cpp +++ b/Source/WebKit/chromium/src/StorageAreaProxy.cpp @@ -80,29 +80,42 @@ String StorageAreaProxy::getItem(const String& key, Frame* frame) const return String(); } -void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) +String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame) { + WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; + WebKit::WebString oldValue; if (!canAccessStorage(frame)) ec = QUOTA_EXCEEDED_ERR; else { - WebKit::WebStorageArea::Result result = WebKit::WebStorageArea::ResultOK; - m_storageArea->setItem(key, value, frame->document()->url(), result); + m_storageArea->setItem(key, value, frame->document()->url(), result, oldValue); ec = (result == WebKit::WebStorageArea::ResultOK) ? 0 : QUOTA_EXCEEDED_ERR; + String oldValueString = oldValue; + if (oldValueString != value && result == WebKit::WebStorageArea::ResultOK) + storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame); } + return oldValue; } -void StorageAreaProxy::removeItem(const String& key, Frame* frame) +String StorageAreaProxy::removeItem(const String& key, Frame* frame) { if (!canAccessStorage(frame)) - return; - m_storageArea->removeItem(key, frame->document()->url()); + return String(); + WebKit::WebString oldValue; + m_storageArea->removeItem(key, frame->document()->url(), oldValue); + if (!oldValue.isNull()) + storageEvent(key, oldValue, String(), m_storageType, frame->document()->securityOrigin(), frame); + return oldValue; } -void StorageAreaProxy::clear(Frame* frame) +bool StorageAreaProxy::clear(Frame* frame) { if (!canAccessStorage(frame)) - return; - m_storageArea->clear(frame->document()->url()); + return false; + bool clearedSomething; + m_storageArea->clear(frame->document()->url(), clearedSomething); + if (clearedSomething) + storageEvent(String(), String(), String(), m_storageType, frame->document()->securityOrigin(), frame); + return clearedSomething; } bool StorageAreaProxy::contains(const String& key, Frame* frame) const @@ -110,6 +123,54 @@ bool StorageAreaProxy::contains(const String& key, Frame* frame) const return !getItem(key, frame).isNull(); } +// FIXME: remove this method and the calls to it from our setters after multi-side patch landing is done. +// Copied from WebCore/storage/StorageEventDispatcher.cpp out of necessity. It's probably best to keep it current. +void StorageAreaProxy::storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame) +{ + Page* page = sourceFrame->page(); + if (!page) + return; + + // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree + // of any given page in the group or mutate the page group itself. + Vector<RefPtr<Frame> > frames; + if (storageType == SessionStorage) { + // Send events only to our page. + for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) { + if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin)) + frames.append(frame); + } + + for (unsigned i = 0; i < frames.size(); ++i) { + // FIXME: maybe only raise if the window has an onstorage listener + // attached to avoid creating the Storage instance. + ExceptionCode ec = 0; + Storage* storage = frames[i]->domWindow()->sessionStorage(ec); + if (!ec) + frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); + } + } else { + // Send events to every page. + const HashSet<Page*>& pages = page->group().pages(); + HashSet<Page*>::const_iterator end = pages.end(); + for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { + for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { + if (sourceFrame != frame && frame->document()->securityOrigin()->equal(securityOrigin)) + frames.append(frame); + } + } + + for (unsigned i = 0; i < frames.size(); ++i) { + // FIXME: maybe only raise if the window has an onstorage listener + // attached to avoid creating the Storage instance. + ExceptionCode ec = 0; + Storage* storage = frames[i]->domWindow()->localStorage(ec); + if (!ec) + frames[i]->document()->enqueueWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), storage)); + } + } +} + bool StorageAreaProxy::canAccessStorage(Frame* frame) const { if (!frame->page()) @@ -119,10 +180,18 @@ bool StorageAreaProxy::canAccessStorage(Frame* frame) const return !webView->permissionClient() || webView->permissionClient()->allowStorage(webFrame, m_storageType == LocalStorage); } -void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue, +void StorageAreaProxy::dispatchLocalStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess) { - const HashSet<Page*>& pages = pageGroup->pages(); + // FIXME: Multi-sided patch engineering alert ! + // step 1: this method gets defined and implemented in webkit/webcore with the early return. + // step 2: this method starts getting called by chromium still with the early return. + // step 3: This class's setters are modified to no longer raise SessionStorage + // events for inprocess changes and this early return is removed. + if (originatedInProcess) + return; + + const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) { for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (frame->document()->securityOrigin()->equal(securityOrigin) && !isEventSource(frame->domWindow()->optionalLocalStorage(), sourceAreaInstance)) { @@ -136,9 +205,9 @@ void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const Str } } -static Page* findPageWithSessionStorageNamespace(PageGroup* pageGroup, const WebKit::WebStorageNamespace& sessionNamespace) +static Page* findPageWithSessionStorageNamespace(const String& pageGroupName, const WebKit::WebStorageNamespace& sessionNamespace) { - const HashSet<Page*>& pages = pageGroup->pages(); + const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroupName)->pages(); for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) { const bool createIfNeeded = true; StorageNamespaceProxy* proxy = static_cast<StorageNamespaceProxy*>((*it)->sessionStorage(createIfNeeded)); @@ -148,11 +217,19 @@ static Page* findPageWithSessionStorageNamespace(PageGroup* pageGroup, const Web return 0; } -void StorageAreaProxy::dispatchSessionStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue, +void StorageAreaProxy::dispatchSessionStorageEvent(const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, const WebKit::WebStorageNamespace& sessionNamespace, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess) { - Page* page = findPageWithSessionStorageNamespace(pageGroup, sessionNamespace); + // FIXME: Multi-sided patch engineering alert ! + // step 1: this method gets defined and implemented in webkit/webcore with the early return. + // step 2: this method starts getting called by chromium still with the early return. + // step 3: This class's setters are modified to no longer raise SessionStorage + // events for inprocess changes and this early return is removed. + if (originatedInProcess) + return; + + Page* page = findPageWithSessionStorageNamespace(pageGroupName, sessionNamespace); if (!page) return; diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.h b/Source/WebKit/chromium/src/StorageAreaProxy.h index 83f2eae17..ab2357470 100644 --- a/Source/WebKit/chromium/src/StorageAreaProxy.h +++ b/Source/WebKit/chromium/src/StorageAreaProxy.h @@ -38,7 +38,6 @@ namespace WebCore { class Frame; class KURL; class Page; -class PageGroup; class SecurityOrigin; class Storage; @@ -51,22 +50,23 @@ public: virtual unsigned length(Frame* sourceFrame) const; virtual String key(unsigned index, Frame* sourceFrame) const; virtual String getItem(const String& key, Frame* sourceFrame) const; - virtual void setItem(const String& key, const String& value, ExceptionCode&, Frame* sourceFrame); - virtual void removeItem(const String& key, Frame* sourceFrame); - virtual void clear(Frame* sourceFrame); + virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame); + virtual String removeItem(const String& key, Frame* sourceFrame); + virtual bool clear(Frame* sourceFrame); virtual bool contains(const String& key, Frame* sourceFrame) const; virtual bool disabledByPrivateBrowsingInFrame(const Frame*) const { return false; } static void dispatchLocalStorageEvent( - PageGroup*, const String& key, const String& oldValue, const String& newValue, + const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess); static void dispatchSessionStorageEvent( - PageGroup*, const String& key, const String& oldValue, const String& newValue, + const String& pageGroupName, const String& key, const String& oldValue, const String& newValue, SecurityOrigin*, const KURL& pageURL, const WebKit::WebStorageNamespace&, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess); private: + void storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame); bool canAccessStorage(Frame*) const; static bool isEventSource(Storage*, WebKit::WebStorageArea* sourceAreaInstance); diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp new file mode 100644 index 000000000..e948b597c --- /dev/null +++ b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.cpp @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "StorageEventDispatcherImpl.h" + +#include "DOMWindow.h" +#include "Document.h" +#include "EventNames.h" +#include "Frame.h" +#include "KURL.h" +#include "Page.h" +#include "PageGroup.h" +#include "SecurityOrigin.h" +#include "StorageEvent.h" + +// FIXME: delete this almost obsolete file soon + +namespace WebCore { + +StorageEventDispatcherImpl::StorageEventDispatcherImpl(const String& groupName) + : m_pageGroup(PageGroup::pageGroup(groupName)) +{ + ASSERT(m_pageGroup); +} + +void StorageEventDispatcherImpl::dispatchStorageEvent(const String& key, const String& oldValue, + const String& newValue, SecurityOrigin* securityOrigin, + const KURL& url, StorageType storageType) +{ + // FIXME: Implement + if (storageType == SessionStorage) + return; + + // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree + // of any given page in the group or mutate the page group itself. + Vector<RefPtr<Frame> > frames; + + const HashSet<Page*>& pages = m_pageGroup->pages(); + HashSet<Page*>::const_iterator end = pages.end(); + for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) { + for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) { + if (frame->document()->securityOrigin()->equal(securityOrigin)) + frames.append(frame); + } + } + + for (unsigned i = 0; i < frames.size(); ++i) { + ExceptionCode ec = 0; + Storage* storage = frames[i]->domWindow()->localStorage(ec); + if (!ec) + frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, url, storage)); + } +} + +} // namespace WebCore diff --git a/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h new file mode 100644 index 000000000..d3433851f --- /dev/null +++ b/Source/WebKit/chromium/src/StorageEventDispatcherImpl.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef StorageEventDispatcherImpl_h +#define StorageEventDispatcherImpl_h + +#include "PlatformString.h" +#include "StorageArea.h" + +namespace WebCore { + +class KURL; +class PageGroup; +class SecurityOrigin; + +class StorageEventDispatcherImpl { +public: + StorageEventDispatcherImpl(const String& groupName); + + void dispatchStorageEvent(const String& key, const String& oldValue, + const String& newValue, SecurityOrigin*, + const KURL&, StorageType); + +private: + PageGroup* m_pageGroup; +}; + +} // namespace WebCore + +#endif // StorageEventDispatcherImpl_h diff --git a/Source/WebKit/chromium/src/WebBlobData.cpp b/Source/WebKit/chromium/src/WebBlobData.cpp index c1f4ff1b8..c767d1bdd 100644 --- a/Source/WebKit/chromium/src/WebBlobData.cpp +++ b/Source/WebKit/chromium/src/WebBlobData.cpp @@ -29,9 +29,9 @@ */ #include "config.h" -#include "platform/WebBlobData.h" #include "BlobData.h" +#include <public/WebBlobData.h> #include <wtf/PassOwnPtr.h> using namespace WebCore; diff --git a/Source/WebKit/chromium/src/WebContentLayer.cpp b/Source/WebKit/chromium/src/WebContentLayer.cpp index 5290e2f35..2c041c2cb 100644 --- a/Source/WebKit/chromium/src/WebContentLayer.cpp +++ b/Source/WebKit/chromium/src/WebContentLayer.cpp @@ -24,11 +24,13 @@ */ #include "config.h" -#include "platform/WebContentLayer.h" +#include <public/WebContentLayer.h> -#include "platform/WebFloatRect.h" +#include "ContentLayerChromium.h" #include "WebContentLayerImpl.h" +using namespace WebCore; + namespace WebKit { WebContentLayer WebContentLayer::create(WebContentLayerClient* contentClient) @@ -36,30 +38,35 @@ WebContentLayer WebContentLayer::create(WebContentLayerClient* contentClient) return WebContentLayer(WebContentLayerImpl::create(contentClient)); } -void WebContentLayer::setDrawsContent(bool drawsContent) +void WebContentLayer::clearClient() +{ + unwrap<ContentLayerChromium>()->clearDelegate(); +} + +void WebContentLayer::setDoubleSided(bool doubleSided) { - unwrap<WebContentLayerImpl>()->setDrawsContent(drawsContent); + m_private->setDoubleSided(doubleSided); } -bool WebContentLayer::drawsContent() const +void WebContentLayer::setContentsScale(float scale) { - return constUnwrap<WebContentLayerImpl>()->drawsContent(); + m_private->setContentsScale(scale); } -WebContentLayer::WebContentLayer(const PassRefPtr<WebContentLayerImpl>& node) +WebContentLayer::WebContentLayer(const PassRefPtr<ContentLayerChromium>& node) : WebLayer(node) { } -WebContentLayer& WebContentLayer::operator=(const PassRefPtr<WebContentLayerImpl>& node) +WebContentLayer& WebContentLayer::operator=(const PassRefPtr<ContentLayerChromium>& node) { m_private = node; return *this; } -WebContentLayer::operator PassRefPtr<WebContentLayerImpl>() const +WebContentLayer::operator PassRefPtr<ContentLayerChromium>() const { - return static_cast<WebContentLayerImpl*>(m_private.get()); + return static_cast<ContentLayerChromium*>(m_private.get()); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp index 4d476095d..222fa2fa7 100644 --- a/Source/WebKit/chromium/src/WebContentLayerImpl.cpp +++ b/Source/WebKit/chromium/src/WebContentLayerImpl.cpp @@ -53,11 +53,6 @@ WebContentLayerImpl::~WebContentLayerImpl() clearDelegate(); } -void WebContentLayerImpl::setDrawsContent(bool drawsContent) -{ - setIsDrawable(drawsContent); -} - void WebContentLayerImpl::paintContents(GraphicsContext& gc, const IntRect& clip) { if (!m_contentClient) diff --git a/Source/WebKit/chromium/src/WebContentLayerImpl.h b/Source/WebKit/chromium/src/WebContentLayerImpl.h index 51f344f7c..a06cf9082 100644 --- a/Source/WebKit/chromium/src/WebContentLayerImpl.h +++ b/Source/WebKit/chromium/src/WebContentLayerImpl.h @@ -36,8 +36,6 @@ class WebContentLayerImpl : public WebCore::ContentLayerChromium, public WebCore public: static PassRefPtr<WebContentLayerImpl> create(WebContentLayerClient* contentClient); - void setDrawsContent(bool); - protected: explicit WebContentLayerImpl(WebContentLayerClient* contentClient); virtual ~WebContentLayerImpl(); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 6cccb9316..1464f929e 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -78,6 +78,9 @@ #include "Console.h" #include "DOMUtilitiesPrivate.h" #include "DOMWindow.h" +#include "DOMWindowIntents.h" +#include "DeliveredIntent.h" +#include "DeliveredIntentClientImpl.h" #include "Document.h" #include "DocumentLoader.h" #include "DocumentMarker.h" @@ -130,6 +133,7 @@ #include "ScrollbarTheme.h" #include "SecurityPolicy.h" #include "Settings.h" +#include "ShadowRoot.h" #include "SkiaUtils.h" #include "SpellChecker.h" #include "SubstituteData.h" @@ -141,6 +145,7 @@ #include "WebDOMEvent.h" #include "WebDOMEventListener.h" #include "WebDataSourceImpl.h" +#include "WebDeliveredIntentClient.h" #include "WebDevToolsAgentPrivate.h" #include "WebDocument.h" #include "WebFindOptions.h" @@ -149,10 +154,12 @@ #include "WebHistoryItem.h" #include "WebIconURL.h" #include "WebInputElement.h" +#include "WebIntent.h" #include "WebNode.h" #include "WebPerformance.h" #include "WebPlugin.h" #include "WebPluginContainerImpl.h" +#include "WebPrintParams.h" #include "WebRange.h" #include "WebScriptSource.h" #include "WebSecurityOrigin.h" @@ -162,6 +169,7 @@ #include "painting/GraphicsContextBuilder.h" #include "platform/WebPoint.h" #include "platform/WebRect.h" +#include "platform/WebSerializedScriptValue.h" #include "platform/WebSize.h" #include "platform/WebURLError.h" #include "platform/WebVector.h" @@ -169,6 +177,7 @@ #include <algorithm> #include <public/Platform.h> #include <wtf/CurrentTime.h> +#include <wtf/HashMap.h> #if USE(V8) #include "AsyncFileSystem.h" @@ -443,8 +452,8 @@ private: // want to delegate all printing related calls to the plugin. class ChromePluginPrintContext : public ChromePrintContext { public: - ChromePluginPrintContext(Frame* frame, WebPluginContainerImpl* plugin, int printerDPI) - : ChromePrintContext(frame), m_plugin(plugin), m_pageCount(0), m_printerDPI(printerDPI) + ChromePluginPrintContext(Frame* frame, WebPluginContainerImpl* plugin, const WebPrintParams& printParams) + : ChromePrintContext(frame), m_plugin(plugin), m_pageCount(0), m_printParams(printParams) { } @@ -467,7 +476,8 @@ public: virtual void computePageRects(const FloatRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, float& outPageHeight) { - m_pageCount = m_plugin->printBegin(IntRect(printRect), m_printerDPI); + m_printParams.printContentArea = IntRect(printRect); + m_pageCount = m_plugin->printBegin(m_printParams); } virtual int pageCount() const @@ -493,7 +503,9 @@ private: // Set when printing. WebPluginContainerImpl* m_plugin; int m_pageCount; - int m_printerDPI; + WebPrintParams m_printParams; + WebPrintScalingOption m_printScalingOption; + }; static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) @@ -501,7 +513,6 @@ static WebDataSource* DataSourceForDocLoader(DocumentLoader* loader) return loader ? WebDataSourceImpl::fromDocumentLoader(loader) : 0; } - // WebFrame ------------------------------------------------------------------- class WebFrameImpl::DeferredScopeStringMatches { @@ -1438,9 +1449,23 @@ VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& poin return node->renderer()->positionForPoint(result.localPoint()); } -int WebFrameImpl::printBegin(const WebSize& pageSize, +// TODO(kmadhusu@chromium.org): Remove this function after fixing +// crbug.com/85132. For more information, please refer to the comments in +// WebFrame.h +int WebFrameImpl::printBegin(const WebSize& printContentSize, const WebNode& constrainToNode, int printerDPI, + bool* useBrowserOverlays) { + WebRect printableArea(0, 0, printContentSize.width, printContentSize.height); + WebSize paperSize(printContentSize); + WebRect printContentArea(0, 0, printContentSize.width, printContentSize.height); + WebPrintParams printParams(printContentArea, printableArea, paperSize, + printerDPI, WebPrintScalingOptionSourceSize); + return printBegin(printParams, constrainToNode, useBrowserOverlays); +} + +int WebFrameImpl::printBegin(const WebPrintParams& printParams, + const WebNode& constrainToNode, bool* useBrowserOverlays) { ASSERT(!frame()->document()->isFrameSet()); @@ -1455,12 +1480,12 @@ int WebFrameImpl::printBegin(const WebSize& pageSize, } if (pluginContainer && pluginContainer->supportsPaginatedPrint()) - m_printContext = adoptPtr(new ChromePluginPrintContext(frame(), pluginContainer, printerDPI)); + m_printContext = adoptPtr(new ChromePluginPrintContext(frame(), pluginContainer, printParams)); else m_printContext = adoptPtr(new ChromePrintContext(frame())); - FloatRect rect(0, 0, static_cast<float>(pageSize.width), - static_cast<float>(pageSize.height)); + FloatRect rect(0, 0, static_cast<float>(printParams.printContentArea.width), + static_cast<float>(printParams.printContentArea.height)); m_printContext->begin(rect.width(), rect.height()); float pageHeight; // We ignore the overlays calculation for now since they are generated in the @@ -1765,7 +1790,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, // text nodes. searchRange->setStart(resultRange->endContainer(ec), resultRange->endOffset(ec), ec); - Node* shadowTreeRoot = searchRange->shadowTreeRootNode(); + Node* shadowTreeRoot = searchRange->shadowRoot(); if (searchRange->collapsed(ec) && shadowTreeRoot) searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), ec); @@ -1851,14 +1876,6 @@ void WebFrameImpl::resetMatchCount() m_framesScopingCount = 0; } -void WebFrameImpl::handleIntentResult(int intentIdentifier, const WebString& reply) -{ -} - -void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& reply) -{ -} - void WebFrameImpl::sendOrientationChangeEvent(int orientation) { #if ENABLE(ORIENTATION_EVENTS) @@ -1899,6 +1916,20 @@ void WebFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& m_frame->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0); } +void WebFrameImpl::deliverIntent(const WebIntent& intent, WebDeliveredIntentClient* intentClient) +{ +#if ENABLE(WEB_INTENTS) + OwnPtr<WebCore::DeliveredIntentClient> client(adoptPtr(new DeliveredIntentClientImpl(intentClient))); + + OwnPtr<MessagePortArray> ports; + WebSerializedScriptValue intentData = WebSerializedScriptValue::fromString(intent.data()); + const WebCore::Intent* webcoreIntent = intent; + RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_frame, client.release(), intent.action(), intent.type(), intentData, ports.release(), webcoreIntent->extras()); + + DOMWindowIntents::from(m_frame->domWindow())->deliver(deliveredIntent.release()); +#endif +} + WebString WebFrameImpl::contentAsText(size_t maxChars) const { if (!m_frame) diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 389946d05..5061cfadf 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -55,12 +55,15 @@ struct WindowFeatures; namespace WebKit { class ChromePrintContext; class WebDataSourceImpl; +class WebDeliveredIntentClient; class WebInputElement; +class WebIntent; class WebFrameClient; class WebPerformance; class WebPluginContainerImpl; class WebView; class WebViewImpl; +struct WebPrintParams; template <typename T> class WebVector; @@ -175,10 +178,15 @@ public: virtual bool selectWordAroundCaret(); virtual void selectRange(const WebPoint& start, const WebPoint& end); virtual void selectRange(const WebRange&); - virtual int printBegin(const WebSize& pageSize, + // FIXME: Remove this function after fixing crbug.com/85132. For detailed + // information, please refer to the comments in WebFrame.h + virtual int printBegin(const WebSize& printContentSize, const WebNode& constrainToNode, int printerDPI, bool* useBrowserOverlays); + virtual int printBegin(const WebPrintParams&, + const WebNode& constrainToNode, + bool* useBrowserOverlays); virtual float printPage(int pageToPrint, WebCanvas*); virtual float getPrintPageShrink(int page); virtual void printEnd(); @@ -204,9 +212,6 @@ public: virtual void increaseMatchCount(int count, int identifier); virtual void resetMatchCount(); - virtual void handleIntentResult(int, const WebString&); - virtual void handleIntentFailure(int, const WebString&); - virtual void sendOrientationChangeEvent(int orientation); virtual void addEventListener(const WebString& eventType, @@ -218,6 +223,8 @@ public: const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent&); + virtual void deliverIntent(const WebIntent&, WebDeliveredIntentClient*); + virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; virtual WebString renderTreeAsText(RenderAsTextControls toShow = RenderAsTextNormal) const; diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp index 170939567..752a86263 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -53,11 +53,6 @@ WebString WebIDBIndexImpl::name() const return m_backend->name(); } -WebString WebIDBIndexImpl::storeName() const -{ - return m_backend->storeName(); -} - WebIDBKeyPath WebIDBIndexImpl::keyPath() const { return WebIDBKeyPath(m_backend->keyPath()); diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.h b/Source/WebKit/chromium/src/WebIDBIndexImpl.h index d8b1129d0..90d836669 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.h +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.h @@ -44,7 +44,6 @@ public: virtual ~WebIDBIndexImpl(); virtual WebString name() const; - virtual WebString storeName() const; virtual WebIDBKeyPath keyPath() const; // FIXME: Remove this method once callers are updated. // http://webkit.org/b/84207 diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 624a4e5b3..5ec35df0f 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -74,6 +74,11 @@ WebDOMStringList WebIDBObjectStoreImpl::indexNames() const return m_objectStore->indexNames(); } +bool WebIDBObjectStoreImpl::autoIncrement() const +{ + return m_objectStore->autoIncrement(); +} + void WebIDBObjectStoreImpl::get(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) { m_objectStore->get(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec); diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index ee3b222ac..96ff6ee28 100644 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -51,6 +51,7 @@ public: // http://webkit.org/b/84207 WebString keyPathString() const; WebDOMStringList indexNames() const; + bool autoIncrement() const; void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); diff --git a/Source/WebKit/chromium/src/WebInputElement.cpp b/Source/WebKit/chromium/src/WebInputElement.cpp index c0037a0ef..adae9dac8 100644 --- a/Source/WebKit/chromium/src/WebInputElement.cpp +++ b/Source/WebKit/chromium/src/WebInputElement.cpp @@ -98,6 +98,16 @@ WebString WebInputElement::value() const return constUnwrap<HTMLInputElement>()->value(); } +WebString WebInputElement::editingValue() const +{ + return constUnwrap<HTMLInputElement>()->innerTextValue(); +} + +void WebInputElement::setEditingValue(const WebString& value) +{ + unwrap<HTMLInputElement>()->setEditingValue(value); +} + void WebInputElement::setSuggestedValue(const WebString& value) { unwrap<HTMLInputElement>()->setSuggestedValue(value); diff --git a/Source/WebKit/chromium/src/WebInputEvent.cpp b/Source/WebKit/chromium/src/WebInputEvent.cpp index d204dfac2..e61b4ac65 100644 --- a/Source/WebKit/chromium/src/WebInputEvent.cpp +++ b/Source/WebKit/chromium/src/WebInputEvent.cpp @@ -60,7 +60,7 @@ class SameSizeAsWebMouseWheelEvent : public SameSizeAsWebMouseEvent { }; class SameSizeAsWebGestureEvent : public SameSizeAsWebInputEvent { - int gestureData[8]; + int gestureData[6]; }; class SameSizeAsWebTouchEvent : public SameSizeAsWebInputEvent { diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp index b4055a91e..a45cae102 100644 --- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp +++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp @@ -128,6 +128,9 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo m_phase = static_cast<WebCore::PlatformWheelEventPhase>(e.phase); m_momentumPhase = static_cast<WebCore::PlatformWheelEventPhase>(e.momentumPhase); m_timestamp = e.timeStampSeconds; + m_scrollCount = 0; + m_unacceleratedScrollingDeltaX = e.deltaX; + m_unacceleratedScrollingDeltaY = e.deltaY; #endif } @@ -148,6 +151,7 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W break; case WebInputEvent::GestureTap: m_type = PlatformEvent::GestureTap; + m_area = IntSize(e.deltaX * 2, e.deltaY * 2); break; case WebInputEvent::GestureTapDown: m_type = PlatformEvent::GestureTapDown; @@ -174,8 +178,6 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W m_globalPosition = IntPoint(e.globalX, e.globalY); m_deltaX = e.deltaX; m_deltaY = e.deltaY; - m_gammaX = e.gammaX; - m_gammaY = e.gammaY; m_timestamp = e.timeStampSeconds; m_modifiers = 0; diff --git a/Source/WebKit/chromium/src/WebIntent.cpp b/Source/WebKit/chromium/src/WebIntent.cpp index ce4e15bd6..67723bf93 100644 --- a/Source/WebKit/chromium/src/WebIntent.cpp +++ b/Source/WebKit/chromium/src/WebIntent.cpp @@ -32,12 +32,26 @@ #include "WebIntent.h" #include "Intent.h" +#include "MessagePort.h" #include "PlatformMessagePortChannel.h" #include "SerializedScriptValue.h" #include <wtf/HashMap.h> namespace WebKit { +WebIntent::WebIntent(const WebString& action, const WebString& type, const WebString& data) +{ +#if ENABLE(WEB_INTENTS) + WebCore::ExceptionCode ec = 0; + WebCore::MessagePortArray ports; + RefPtr<WebCore::Intent> intent = WebCore::Intent::create(action, type, WebCore::SerializedScriptValue::createFromWire(data), ports, ec); + if (ec) + return; + + m_private = intent.release(); +#endif +} + #if ENABLE(WEB_INTENTS) WebIntent::WebIntent(const PassRefPtr<WebCore::Intent>& intent) : m_private(intent) @@ -130,6 +144,11 @@ WebMessagePortChannelArray* WebIntent::messagePortChannelsRelease() const return webChannels; } +WebIntent::operator WebCore::Intent*() const +{ + return m_private.get(); +} + WebVector<WebString> WebIntent::extrasNames() const { #if ENABLE(WEB_INTENTS) diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp index da54cca50..ee999a916 100644 --- a/Source/WebKit/chromium/src/WebKit.cpp +++ b/Source/WebKit/chromium/src/WebKit.cpp @@ -46,6 +46,7 @@ #include "platform/WebThread.h" #include "v8.h" #include <public/Platform.h> +#include <public/WebPrerenderingSupport.h> #include <wtf/Assertions.h> #include <wtf/MainThread.h> #include <wtf/Threading.h> @@ -163,6 +164,7 @@ void shutdown() #endif s_webKitPlatformSupport = 0; Platform::shutdown(); + WebPrerenderingSupport::shutdown(); } WebKitPlatformSupport* webKitPlatformSupport() diff --git a/Source/WebKit/chromium/src/WebLayer.cpp b/Source/WebKit/chromium/src/WebLayer.cpp index ecf7452fc..3e6db47f5 100644 --- a/Source/WebKit/chromium/src/WebLayer.cpp +++ b/Source/WebKit/chromium/src/WebLayer.cpp @@ -35,6 +35,7 @@ #include <public/WebFloatPoint.h> #include <public/WebFloatRect.h> #include <public/WebSize.h> +#include <public/WebTransformationMatrix.h> using namespace WebCore; @@ -228,6 +229,11 @@ void WebLayer::setSublayerTransform(const SkMatrix44& matrix) m_private->setSublayerTransform(transformationMatrixFromSkMatrix44(matrix)); } +void WebLayer::setSublayerTransform(const WebTransformationMatrix& matrix) +{ + m_private->setSublayerTransform(matrix.toWebCoreTransform()); +} + SkMatrix44 WebLayer::sublayerTransform() const { return skMatrix44FromTransformationMatrix(m_private->sublayerTransform()); @@ -238,19 +244,34 @@ void WebLayer::setTransform(const SkMatrix44& matrix) m_private->setTransform(transformationMatrixFromSkMatrix44(matrix)); } +void WebLayer::setTransform(const WebTransformationMatrix& matrix) +{ + m_private->setTransform(matrix.toWebCoreTransform()); +} + SkMatrix44 WebLayer::transform() const { return skMatrix44FromTransformationMatrix(m_private->transform()); } -void WebLayer::setDebugBorderColor(const WebColor& color) +void WebLayer::setDrawsContent(bool drawsContent) { - m_private->setDebugBorderColor(color); + m_private->setIsDrawable(drawsContent); } -void WebLayer::setDebugBorderWidth(float width) +bool WebLayer::drawsContent() const { - m_private->setDebugBorderWidth(width); + return m_private->drawsContent(); +} + +void WebLayer::setPreserves3D(bool preserve3D) +{ + m_private->setPreserves3D(preserve3D); +} + +void WebLayer::setBackgroundColor(WebColor color) +{ + m_private->setBackgroundColor(color); } void WebLayer::setFilters(const WebFilterOperations& filters) @@ -263,6 +284,16 @@ void WebLayer::setBackgroundFilters(const WebFilterOperations& filters) m_private->setBackgroundFilters(filters.toFilterOperations()); } +void WebLayer::setDebugBorderColor(const WebColor& color) +{ + m_private->setDebugBorderColor(color); +} + +void WebLayer::setDebugBorderWidth(float width) +{ + m_private->setDebugBorderWidth(width); +} + WebLayer::WebLayer(const PassRefPtr<LayerChromium>& node) : m_private(node) { diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp index 6c18f6742..a4d7d918a 100644 --- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp +++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp @@ -43,10 +43,14 @@ WebLayerTreeView::Settings::operator CCSettings() const settings.acceleratePainting = acceleratePainting; settings.showFPSCounter = showFPSCounter; settings.showPlatformLayerTree = showPlatformLayerTree; + settings.showPaintRects = showPaintRects; settings.refreshRate = refreshRate; settings.perTilePainting = perTilePainting; settings.partialSwapEnabled = partialSwapEnabled; settings.threadedAnimationEnabled = threadedAnimationEnabled; + settings.defaultTileSize = defaultTileSize; + settings.maxUntiledLayerSize = maxUntiledLayerSize; + settings.deviceScaleFactor = deviceScaleFactor; // FIXME: showFPSCounter / showPlatformLayerTree / maxPartialTextureUpdates aren't supported currently. return settings; diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index 8ba03f04a..950068d2f 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -340,11 +340,10 @@ void WebMediaPlayerClientImpl::pause() } #if USE(NATIVE_FULLSCREEN_VIDEO) -bool WebMediaPlayerClientImpl::enterFullscreen() const +void WebMediaPlayerClientImpl::enterFullscreen() { if (m_webMediaPlayer) - return m_webMediaPlayer->enterFullscreen(); - return false; + m_webMediaPlayer->enterFullscreen(); } void WebMediaPlayerClientImpl::exitFullscreen() @@ -352,6 +351,11 @@ void WebMediaPlayerClientImpl::exitFullscreen() if (m_webMediaPlayer) m_webMediaPlayer->exitFullscreen(); } + +bool WebMediaPlayerClientImpl::canEnterFullscreen() const +{ + return m_webMediaPlayer && m_webMediaPlayer->canEnterFullscreen(); +} #endif #if ENABLE(MEDIA_SOURCE) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 3afb1f5e5..e06d3e523 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -135,8 +135,9 @@ public: virtual unsigned audioDecodedByteCount() const; virtual unsigned videoDecodedByteCount() const; #if USE(NATIVE_FULLSCREEN_VIDEO) - virtual bool enterFullscreen() const; + virtual void enterFullscreen(); virtual void exitFullscreen(); + virtual bool canEnterFullscreen() const; #endif #if ENABLE(WEB_AUDIO) diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 6ee01efdd..400aabb00 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -72,6 +72,7 @@ #include "ScrollView.h" #include "ScrollbarTheme.h" #include "UserGestureIndicator.h" +#include "WebPrintParams.h" #include "WheelEvent.h" #include <public/Platform.h> #include <public/WebClipboard.h> @@ -233,6 +234,14 @@ void WebPluginContainerImpl::setParent(ScrollView* view) reportGeometry(); } +void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) +{ + if (plugin != m_webPlugin) { + m_element->resetInstance(); + m_webPlugin = plugin; + } +} + bool WebPluginContainerImpl::supportsPaginatedPrint() const { return m_webPlugin->supportsPaginatedPrint(); @@ -243,10 +252,12 @@ bool WebPluginContainerImpl::isPrintScalingDisabled() const return m_webPlugin->isPrintScalingDisabled(); } -int WebPluginContainerImpl::printBegin(const IntRect& printableArea, - int printerDPI) const +int WebPluginContainerImpl::printBegin(const WebPrintParams& printParams) const { - return m_webPlugin->printBegin(printableArea, printerDPI); + return m_webPlugin->printBegin(printParams.printContentArea, printParams.printerDPI); + // FIXME: After committing this CL, update the chrome plugin printBegin() + // function to use the overloaded printBegin function. + // return m_webPlugin->printBegin(printParams); } bool WebPluginContainerImpl::printPage(int pageNumber, diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index 04878455c..415cc544b 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -61,6 +61,8 @@ class PlatformGestureEvent; namespace WebKit { +struct WebPrintParams; + class ScrollbarGroup; class WebPlugin; class WebPluginLoadObserver; @@ -110,7 +112,7 @@ public: // This cannot be null. WebPlugin* plugin() { return m_webPlugin; } - void setPlugin(WebPlugin* plugin) { m_webPlugin = plugin; } + void setPlugin(WebPlugin*); // Printing interface. The plugin can support custom printing // (which means it controls the layout, number of pages etc). @@ -120,10 +122,8 @@ public: // If the plugin content should not be scaled to the printable area of // the page, then this method should return true. bool isPrintScalingDisabled() const; - // Sets up printing at the given print rect and printer DPI. printableArea - // is in points (a point is 1/72 of an inch).Returns the number of pages to - // be printed at these settings. - int printBegin(const WebCore::IntRect& printableArea, int printerDPI) const; + // Sets up printing at the specified WebPrintParams. Returns the number of pages to be printed at these settings. + int printBegin(const WebPrintParams&) const; // Prints the page specified by pageNumber (0-based index) into the supplied canvas. bool printPage(int pageNumber, WebCore::GraphicsContext* gc); // Ends the print operation. diff --git a/Source/WebKit/chromium/src/WebRange.cpp b/Source/WebKit/chromium/src/WebRange.cpp index be24dd793..85df0a3ba 100644 --- a/Source/WebKit/chromium/src/WebRange.cpp +++ b/Source/WebKit/chromium/src/WebRange.cpp @@ -32,9 +32,11 @@ #include "WebRange.h" #include "Document.h" +#include "Element.h" #include "Frame.h" #include "FrameView.h" #include "Range.h" +#include "ShadowRoot.h" #include "TextIterator.h" #include "WebFrameImpl.h" #include "WebNode.h" @@ -97,7 +99,7 @@ WebRange WebRange::fromDocumentRange(WebFrame* frame, int start, int length) { WebCore::Frame* webFrame = static_cast<WebFrameImpl*>(frame)->frame(); Element* selectionRoot = webFrame->selection()->rootEditableElement(); - Element* scope = selectionRoot ? selectionRoot : webFrame->document()->documentElement(); + ContainerNode* scope = selectionRoot ? selectionRoot : webFrame->document()->documentElement(); return TextIterator::rangeFromLocationAndLength(scope, start, length); } diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 190981988..a9b729df6 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -49,7 +49,11 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings) : m_settings(settings) , m_showFPSCounter(false) , m_showPlatformLayerTree(false) + , m_showPaintRects(false) , m_viewportEnabled(false) + , m_applyDefaultDeviceScaleFactorInCompositor(false) + , m_defaultTileSize(WebSize(256, 256)) + , m_maxUntiledLayerSize(WebSize(512, 512)) { ASSERT(settings); } @@ -114,6 +118,11 @@ void WebSettingsImpl::setDefaultDeviceScaleFactor(int defaultDeviceScaleFactor) m_settings->setDefaultDeviceScaleFactor(defaultDeviceScaleFactor); } +void WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDefaultDeviceScaleFactorInCompositor) +{ + m_applyDefaultDeviceScaleFactorInCompositor = applyDefaultDeviceScaleFactorInCompositor; +} + void WebSettingsImpl::setDefaultTextEncodingName(const WebString& encoding) { m_settings->setDefaultTextEncodingName((String)encoding); @@ -333,6 +342,11 @@ void WebSettingsImpl::setShowPlatformLayerTree(bool show) m_showPlatformLayerTree = show; } +void WebSettingsImpl::setShowPaintRects(bool show) +{ + m_showPaintRects = show; +} + void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior) { m_settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(behavior)); @@ -567,4 +581,14 @@ void WebSettingsImpl::setViewportEnabled(bool enabled) m_viewportEnabled = enabled; } +void WebSettingsImpl::setDefaultTileSize(WebSize size) +{ + m_defaultTileSize = size; +} + +void WebSettingsImpl::setMaxUntiledLayerSize(WebSize size) +{ + m_maxUntiledLayerSize = size; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 3ea9dce38..ebea771fe 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -55,6 +55,7 @@ public: virtual void setMinimumFontSize(int); virtual void setMinimumLogicalFontSize(int); virtual void setDefaultDeviceScaleFactor(int); + virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool); virtual void setDefaultTextEncodingName(const WebString&); virtual void setJavaScriptEnabled(bool); virtual void setWebSecurityEnabled(bool); @@ -96,9 +97,10 @@ public: virtual void setWebGLErrorsToConsoleEnabled(bool); virtual void setShowDebugBorders(bool); virtual void setShowFPSCounter(bool); - virtual bool showFPSCounter() const { return m_showFPSCounter; } virtual void setShowPlatformLayerTree(bool); - virtual bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } + virtual void setShowPaintRects(bool); + virtual void setDefaultTileSize(WebSize); + virtual void setMaxUntiledLayerSize(WebSize); virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); virtual void setForceCompositingMode(bool); @@ -142,11 +144,22 @@ public: virtual void setViewportEnabled(bool); virtual bool viewportEnabled() const { return m_viewportEnabled; } + bool showFPSCounter() const { return m_showFPSCounter; } + bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } + bool showPaintRects() const { return m_showPaintRects; } + bool applyDefaultDeviceScaleFactorInCompositor() const { return m_applyDefaultDeviceScaleFactorInCompositor; } + WebSize defaultTileSize() const { return m_defaultTileSize; } + WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; } + private: WebCore::Settings* m_settings; bool m_showFPSCounter; bool m_showPlatformLayerTree; + bool m_showPaintRects; bool m_viewportEnabled; + bool m_applyDefaultDeviceScaleFactorInCompositor; + WebSize m_defaultTileSize; + WebSize m_maxUntiledLayerSize; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp index cd77cb46b..c8036aa74 100644 --- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp +++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp @@ -29,20 +29,19 @@ */ #include "config.h" -#include "WebStorageEventDispatcher.h" +#include "WebStorageEventDispatcherImpl.h" #include "KURL.h" #include "SecurityOrigin.h" #include "StorageAreaProxy.h" -#include "WebViewImpl.h" #include "platform/WebURL.h" #include <wtf/PassOwnPtr.h> -// FIXME: move this file to WebStorageEventDispatcher.cpp - namespace WebKit { +extern const char* pageGroupName; + void WebStorageEventDispatcher::dispatchLocalStorageEvent( const WebString& key, const WebString& oldValue, const WebString& newValue, const WebURL& origin, @@ -51,7 +50,7 @@ void WebStorageEventDispatcher::dispatchLocalStorageEvent( { RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin); WebCore::StorageAreaProxy::dispatchLocalStorageEvent( - WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL, + pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL, sourceAreaInstance, originatedInProcess); } @@ -63,8 +62,31 @@ void WebStorageEventDispatcher::dispatchSessionStorageEvent( { RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin); WebCore::StorageAreaProxy::dispatchSessionStorageEvent( - WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL, + pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL, sessionNamespace, sourceAreaInstance, originatedInProcess); } + +// FIXME: remove the WebStorageEventDispatcherImpl class soon. + +WebStorageEventDispatcher* WebStorageEventDispatcher::create() +{ + return new WebStorageEventDispatcherImpl(); +} + +WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl() + : m_eventDispatcher(adoptPtr(new WebCore::StorageEventDispatcherImpl(pageGroupName))) +{ + ASSERT(m_eventDispatcher); +} + +void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue, + const WebString& newValue, const WebString& origin, + const WebURL& pageURL, bool isLocalStorage) +{ + WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage; + RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin); + m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), pageURL, storageType); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h new file mode 100644 index 000000000..b03c6b7a6 --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2009 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageEventDispatcherImpl_h +#define WebStorageEventDispatcherImpl_h + +#include "StorageEventDispatcherImpl.h" +#include "WebStorageEventDispatcher.h" +#include <wtf/OwnPtr.h> + +namespace WebKit { + +// DEPRECATED - to be removed when removing the instance methods in the public api. +class WebStorageEventDispatcherImpl : public WebStorageEventDispatcher { +public: + WebStorageEventDispatcherImpl(); + virtual void dispatchStorageEvent(const WebString& key, const WebString& oldValue, + const WebString& newValue, const WebString& origin, + const WebURL&, bool isLocalStorage); +private: + OwnPtr<WebCore::StorageEventDispatcherImpl> m_eventDispatcher; +}; + +} // namespace WebKit + +#endif // WebStorageEventDispatcherImpl_h diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index 957663634..d7a9be01c 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "WebTextCheckingCompletionImpl.h" +#include "EditorClientImpl.h" #include "SpellChecker.h" #include "TextCheckerClient.h" #include "WebTextCheckingResult.h" @@ -51,14 +52,28 @@ static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingR void WebTextCheckingCompletionImpl::didFinishCheckingText(const WebVector<WebTextCheckingResult>& results) { - m_spellChecker->didCheckSucceeded(m_identifier, toCoreResults(results)); + if (m_spellChecker) { + m_spellChecker->didCheckSucceeded(m_identifier, toCoreResults(results)); + m_editorClient->didCheckString(this); + } + delete this; } void WebTextCheckingCompletionImpl::didCancelCheckingText() { - m_spellChecker->didCheckCanceled(m_identifier); + if (m_spellChecker) { + m_spellChecker->didCheckCanceled(m_identifier); + m_editorClient->didCheckString(this); + } + delete this; } +void WebTextCheckingCompletionImpl::invalidate() +{ + m_spellChecker = 0; + m_editorClient = 0; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.h b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.h index 175d25cd4..06e34addc 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.h +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.h @@ -39,21 +39,29 @@ class SpellChecker; namespace WebKit { +class EditorClientImpl; + class WebTextCheckingCompletionImpl : public WebTextCheckingCompletion { public: - WebTextCheckingCompletionImpl(int identifier, WebCore::SpellChecker* spellchecker) - : m_identifier(identifier), m_spellChecker(spellchecker) + WebTextCheckingCompletionImpl(int identifier, WebCore::SpellChecker* spellchecker, EditorClientImpl* editorClient) + : m_identifier(identifier) + , m_spellChecker(spellchecker) + , m_editorClient(editorClient) { } virtual void didFinishCheckingText(const WebVector<WebTextCheckingResult>&); virtual void didCancelCheckingText(); + void invalidate(); + WebCore::SpellChecker* spellChecker() const { return m_spellChecker; } + private: virtual ~WebTextCheckingCompletionImpl() { } int m_identifier; WebCore::SpellChecker* m_spellChecker; + EditorClientImpl* m_editorClient; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 626da8a21..f74c802a9 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -99,6 +99,7 @@ #include "PointerLockController.h" #include "PopupContainer.h" #include "PopupMenuClient.h" +#include "PrerendererClientImpl.h" #include "ProgressTracker.h" #include "RenderLayerCompositor.h" #include "RenderView.h" @@ -164,11 +165,6 @@ #include "PlatformGestureEvent.h" #endif -#if USE(CG) -#include <CoreGraphics/CGBitmapContext.h> -#include <CoreGraphics/CGContext.h> -#endif - #if OS(WINDOWS) #include "RenderThemeChromiumWin.h" #else @@ -243,6 +239,20 @@ static const PopupContainerSettings autofillPopupSettings = { static bool shouldUseExternalPopupMenus = false; +static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyState) +{ + int platformEventKeyState = 0; + if (webInputEventKeyState & WebInputEvent::ShiftKey) + platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::ShiftKey; + if (webInputEventKeyState & WebInputEvent::ControlKey) + platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::CtrlKey; + if (webInputEventKeyState & WebInputEvent::AltKey) + platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::AltKey; + if (webInputEventKeyState & WebInputEvent::MetaKey) + platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::MetaKey; + return platformEventKeyState; +} + // WebView ---------------------------------------------------------------- WebView* WebView::create(WebViewClient* client) @@ -321,6 +331,11 @@ void WebViewImpl::setPermissionClient(WebPermissionClient* permissionClient) m_permissionClient = permissionClient; } +void WebViewImpl::setPrerendererClient(WebPrerendererClient* prerendererClient) +{ + providePrerendererClientTo(m_page.get(), new PrerendererClientImpl(prerendererClient)); +} + void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) { m_spellCheckClient = spellCheckClient; @@ -381,6 +396,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_compositorCreationFailed(false) , m_recreatingGraphicsContext(false) , m_compositorSurfaceReady(false) + , m_deviceScaleInCompositor(1) #endif #if ENABLE(INPUT_SPEECH) , m_speechInputClient(SpeechInputClientImpl::create(client)) @@ -1261,11 +1277,6 @@ WebViewImpl* WebViewImpl::fromPage(Page* page) return static_cast<WebViewImpl*>(chromeClient->webView()); } -PageGroup* WebViewImpl::defaultPageGroup() -{ - return PageGroup::pageGroup(pageGroupName); -} - // WebWidget ------------------------------------------------------------------ void WebViewImpl::close() @@ -1310,6 +1321,13 @@ void WebViewImpl::resize(const WebSize& newSize) return; m_size = newSize; +#if ENABLE(VIEWPORT) + if (settings()->viewportEnabled()) { + ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments(); + m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments); + } +#endif + WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); if (agentPrivate && agentPrivate->metricsOverridden()) agentPrivate->webViewResized(); @@ -1476,18 +1494,13 @@ void WebViewImpl::layout() void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect) { ASSERT(!m_layerTreeView.isNull()); -#if USE(SKIA) + PlatformContextSkia context(canvas); // PlatformGraphicsContext is actually a pointer to PlatformContextSkia GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); -#elif USE(CG) - GraphicsContext gc(canvas); - int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); -#else - notImplemented(); -#endif + // Compute rect to sample from inverted GPU buffer. IntRect invertRect(rect.x(), bitmapHeight - rect.maxY(), rect.width(), rect.height()); @@ -1602,8 +1615,10 @@ void WebViewImpl::enterFullScreenForElement(WebCore::Element* element) #if USE(NATIVE_FULLSCREEN_VIDEO) if (element && element->isMediaElement()) { HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(element); - if (mediaElement->player() && mediaElement->player()->enterFullscreen()) + if (mediaElement->player() && mediaElement->player()->canEnterFullscreen()) { + mediaElement->player()->enterFullscreen(); m_provisionalFullScreenElement = element; + } return; } #endif @@ -1965,6 +1980,21 @@ bool WebViewImpl::selectionBounds(WebRect& start, WebRect& end) const return true; } +bool WebViewImpl::selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const +{ + const Frame* frame = focusedWebCoreFrame(); + if (!frame) + return false; + FrameSelection* selection = frame->selection(); + if (!selection) + return false; + if (!selection->toNormalizedRange()) + return false; + start = selection->start().primaryDirection() == RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight; + end = selection->end().primaryDirection() == RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight; + return true; +} + bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length) { const Frame* focused = focusedWebCoreFrame(); @@ -2058,7 +2088,7 @@ void WebViewImpl::didChangeWindowResizerRect() // WebView -------------------------------------------------------------------- -WebSettings* WebViewImpl::settings() +WebSettingsImpl* WebViewImpl::settingsImpl() { if (!m_webSettings) m_webSettings = adoptPtr(new WebSettingsImpl(m_page->settings())); @@ -2066,6 +2096,11 @@ WebSettings* WebViewImpl::settings() return m_webSettings.get(); } +WebSettings* WebViewImpl::settings() +{ + return settingsImpl(); +} + WebString WebViewImpl::pageEncoding() const { if (!m_page) @@ -2327,6 +2362,12 @@ void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin) if (!scaleFactor) scaleFactor = 1; + if (m_deviceScaleInCompositor != 1) { + // Don't allow page scaling when compositor scaling is being used, + // as they are currently incompatible. + ASSERT(scaleFactor == 1); + } + scaleFactor = clampPageScaleFactorToLimits(scaleFactor); WebPoint clampedOrigin = clampOffsetAtScale(origin, scaleFactor); page()->setPageScaleFactor(scaleFactor, clampedOrigin); @@ -2347,6 +2388,13 @@ void WebViewImpl::setDeviceScaleFactor(float scaleFactor) return; page()->setDeviceScaleFactor(scaleFactor); + + if (m_deviceScaleInCompositor != 1) { + // Don't allow page scaling when compositor scaling is being used, + // as they are currently incompatible. This means the deviceScale + // needs to match the one in the compositor. + ASSERT(scaleFactor == m_deviceScaleInCompositor); + } } bool WebViewImpl::isFixedLayoutModeEnabled() const @@ -2374,10 +2422,8 @@ void WebViewImpl::enableFixedLayoutMode(bool enable) #if USE(ACCELERATED_COMPOSITING) // Also notify the base layer, which RenderLayerCompositor does not see. - if (m_nonCompositedContentHost) { - m_nonCompositedContentHost->topLevelRootLayer()->deviceOrPageScaleFactorChanged(); + if (m_nonCompositedContentHost) updateLayerTreeViewport(); - } #endif } @@ -2411,8 +2457,8 @@ bool WebViewImpl::computePageScaleFactorLimits() if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()->view()) return false; - m_minimumPageScaleFactor = min(max(m_pageDefinedMinimumPageScaleFactor, minPageScaleFactor), maxPageScaleFactor) * deviceScaleFactor(); - m_maximumPageScaleFactor = max(min(m_pageDefinedMaximumPageScaleFactor, maxPageScaleFactor), minPageScaleFactor) * deviceScaleFactor(); + m_minimumPageScaleFactor = min(max(m_pageDefinedMinimumPageScaleFactor, minPageScaleFactor), maxPageScaleFactor) * (deviceScaleFactor() / m_deviceScaleInCompositor); + m_maximumPageScaleFactor = max(min(m_pageDefinedMaximumPageScaleFactor, maxPageScaleFactor), minPageScaleFactor) * (deviceScaleFactor() / m_deviceScaleInCompositor); int viewWidthNotIncludingScrollbars = page()->mainFrame()->view()->visibleContentRect(false).width(); int contentsWidth = mainFrame()->contentsSize().width; @@ -2588,12 +2634,22 @@ WebDragOperation WebViewImpl::dragTargetDragEnter( const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) { + return dragTargetDragEnter(webDragData, clientPoint, screenPoint, operationsAllowed, 0); +} + +WebDragOperation WebViewImpl::dragTargetDragEnter( + const WebDragData& webDragData, + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers) +{ ASSERT(!m_currentDragData); m_currentDragData = webDragData; m_operationsAllowed = operationsAllowed; - return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); + return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter, keyModifiers); } WebDragOperation WebViewImpl::dragTargetDragOver( @@ -2601,9 +2657,18 @@ WebDragOperation WebViewImpl::dragTargetDragOver( const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) { + return dragTargetDragOver(clientPoint, screenPoint, operationsAllowed, 0); +} + +WebDragOperation WebViewImpl::dragTargetDragOver( + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers) +{ m_operationsAllowed = operationsAllowed; - return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver); + return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver, keyModifiers); } void WebViewImpl::dragTargetDragLeave() @@ -2627,6 +2692,13 @@ void WebViewImpl::dragTargetDragLeave() void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, const WebPoint& screenPoint) { + dragTargetDrop(clientPoint, screenPoint, 0); +} + +void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, + const WebPoint& screenPoint, + int keyModifiers) +{ ASSERT(m_currentDragData); // If this webview transitions from the "drop accepting" state to the "not @@ -2641,6 +2713,7 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, return; } + m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventKeyState(keyModifiers)); DragData dragData( m_currentDragData.get(), clientPoint, @@ -2655,10 +2728,11 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, m_dragScrollTimer->stop(); } -WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction) +WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction, int keyModifiers) { ASSERT(m_currentDragData); + m_currentDragData->setModifierKeyState(webInputEventKeyStateToPlatformEventKeyState(keyModifiers)); DragData dragData( m_currentDragData.get(), clientPoint, @@ -2993,9 +3067,21 @@ void WebViewImpl::layoutUpdated(WebFrameImpl* webframe) void WebViewImpl::didChangeContentsSize() { - bool didClampScale = computePageScaleFactorLimits(); +#if ENABLE(VIEWPORT) + if (!settings()->viewportEnabled()) + return; - if (!didClampScale) + bool didChangeScale = false; + if (!isPageScaleFactorSet()) { + // If the viewport tag failed to be processed earlier, we need + // to recompute it now. + ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments(); + m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments); + didChangeScale = true; + } else + didChangeScale = computePageScaleFactorLimits(); + + if (!didChangeScale) return; if (!mainFrameImpl()) @@ -3004,6 +3090,7 @@ void WebViewImpl::didChangeContentsSize() FrameView* view = mainFrameImpl()->frameView(); if (view && view->needsLayout()) view->layout(); +#endif } bool WebViewImpl::useExternalPopupMenus() @@ -3047,7 +3134,8 @@ bool WebViewImpl::navigationPolicyFromMouseEvent(unsigned short button, return true; } -void WebViewImpl::startDragging(const WebDragData& dragData, +void WebViewImpl::startDragging(Frame* frame, + const WebDragData& dragData, WebDragOperationsMask mask, const WebImage& dragImage, const WebPoint& dragImageOffset) @@ -3056,7 +3144,7 @@ void WebViewImpl::startDragging(const WebDragData& dragData, return; ASSERT(!m_doingDragAndDrop); m_doingDragAndDrop = true; - m_client->startDragging(dragData, mask, dragImage, dragImageOffset); + m_client->startDragging(WebFrameImpl::fromFrame(frame), dragData, mask, dragImage, dragImageOffset); } void WebViewImpl::observeNewNavigation() @@ -3306,16 +3394,31 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) WebLayerTreeView::Settings layerTreeViewSettings; layerTreeViewSettings.acceleratePainting = page()->settings()->acceleratedDrawingEnabled(); - layerTreeViewSettings.showFPSCounter = settings()->showFPSCounter(); - layerTreeViewSettings.showPlatformLayerTree = settings()->showPlatformLayerTree(); + layerTreeViewSettings.showFPSCounter = settingsImpl()->showFPSCounter(); + layerTreeViewSettings.showPlatformLayerTree = settingsImpl()->showPlatformLayerTree(); + layerTreeViewSettings.showPaintRects = settingsImpl()->showPaintRects(); layerTreeViewSettings.perTilePainting = page()->settings()->perTileDrawingEnabled(); layerTreeViewSettings.partialSwapEnabled = page()->settings()->partialSwapEnabled(); layerTreeViewSettings.threadedAnimationEnabled = page()->settings()->threadedAnimationEnabled(); + layerTreeViewSettings.defaultTileSize = settingsImpl()->defaultTileSize(); + layerTreeViewSettings.maxUntiledLayerSize = settingsImpl()->maxUntiledLayerSize(); + m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this)); m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders()); + if (m_webSettings->applyDefaultDeviceScaleFactorInCompositor() && page()->settings()->defaultDeviceScaleFactor() != 1) { + ASSERT(page()->settings()->defaultDeviceScaleFactor()); + + m_deviceScaleInCompositor = page()->settings()->defaultDeviceScaleFactor(); + layerTreeViewSettings.deviceScaleFactor = m_deviceScaleInCompositor; + setDeviceScaleFactor(m_deviceScaleInCompositor); + // When applying a scale factor in the compositor, we disallow page + // scaling as they are currently incompatible. + setPageScaleFactorLimits(1, 1); + } + m_layerTreeView.initialize(this, m_rootLayer, layerTreeViewSettings); if (!m_layerTreeView.isNull()) { m_layerTreeView.setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor); @@ -3459,7 +3562,12 @@ void WebViewImpl::updateLayerTreeViewport() // layer. layerAdjustX = -view->contentsSize().width() + view->visibleContentRect(false).width(); } - m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, pageScaleFactor(), layerAdjustX); + + // This part of the deviceScale will be used to scale the contents of + // the NCCH's GraphicsLayer. + float deviceScale = m_deviceScaleInCompositor; + m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, deviceScale, layerAdjustX); + m_layerTreeView.setViewportSize(size()); m_layerTreeView.setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor); } diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 9b44fb68d..db67dd54a 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -69,7 +69,6 @@ class HistoryItem; class HitTestResult; class KeyboardEvent; class Page; -class PageGroup; class PagePopup; class PagePopupClient; class PlatformGestureCurveTarget; @@ -91,6 +90,7 @@ class DeviceOrientationClientProxy; class DragScrollTimer; class GeolocationClientProxy; class NonCompositedContentHost; +class PrerendererClientImpl; class SpeechInputClientImpl; class SpeechRecognitionClientProxy; class UserMediaClientImpl; @@ -101,6 +101,7 @@ class WebDevToolsAgentPrivate; class WebFrameImpl; class WebGestureEvent; class WebPagePopupImpl; +class WebPrerendererClient; class WebImage; class WebKeyboardEvent; class WebMouseEvent; @@ -146,6 +147,7 @@ public: virtual bool compositionRange(size_t* location, size_t* length); virtual WebTextInputType textInputType(); virtual bool selectionBounds(WebRect& start, WebRect& end) const; + virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const; virtual bool caretOrSelectionRange(size_t* location, size_t* length); virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const; @@ -161,6 +163,7 @@ public: virtual void setAutofillClient(WebAutofillClient*); virtual void setDevToolsAgentClient(WebDevToolsAgentClient*); virtual void setPermissionClient(WebPermissionClient*); + virtual void setPrerendererClient(WebPrerendererClient*) OVERRIDE; virtual void setSpellCheckClient(WebSpellCheckClient*); virtual void addTextFieldDecoratorClient(WebTextFieldDecoratorClient*) OVERRIDE; virtual WebSettings* settings(); @@ -229,14 +232,29 @@ public: const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed); + virtual WebDragOperation dragTargetDragEnter( + const WebDragData&, + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers); virtual WebDragOperation dragTargetDragOver( const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed); + virtual WebDragOperation dragTargetDragOver( + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed, + int keyModifiers); virtual void dragTargetDragLeave(); virtual void dragTargetDrop( const WebPoint& clientPoint, const WebPoint& screenPoint); + virtual void dragTargetDrop( + const WebPoint& clientPoint, + const WebPoint& screenPoint, + int keyModifiers); virtual unsigned long createUniqueIdentifierForRequest(); virtual void inspectElementAt(const WebPoint& point); virtual WebString inspectorSettings() const; @@ -301,12 +319,6 @@ public: static WebViewImpl* fromPage(WebCore::Page*); - // A pageGroup identifies a namespace of pages. Page groups are used on PLATFORM(MAC) - // for some programs that use HTML views to display things that don't seem like - // web pages to the user (so shouldn't have visited link coloring). We only use - // one page group. - static WebCore::PageGroup* defaultPageGroup(); - WebViewClient* client() { return m_client; @@ -436,6 +448,7 @@ public: // Start a system drag and drop operation. void startDragging( + WebCore::Frame*, const WebDragData& dragData, WebDragOperationsMask mask, const WebImage& dragImage, @@ -582,7 +595,8 @@ private: // should be true. WebDragOperation dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, - DragAction); + DragAction, + int keyModifiers); void configureAutoResizeMode(); @@ -615,6 +629,8 @@ private: virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; + WebSettingsImpl* settingsImpl(); + WebViewClient* m_client; WebAutofillClient* m_autofillClient; WebPermissionClient* m_permissionClient; @@ -763,6 +779,7 @@ private: // If true, the graphics context is being restored. bool m_recreatingGraphicsContext; bool m_compositorSurfaceReady; + float m_deviceScaleInCompositor; #endif static const WebInputEvent* m_currentInputEvent; diff --git a/Source/WebKit/chromium/src/android/WebInputEventFactory.cpp b/Source/WebKit/chromium/src/android/WebInputEventFactory.cpp index 13166f344..fb723223b 100644 --- a/Source/WebKit/chromium/src/android/WebInputEventFactory.cpp +++ b/Source/WebKit/chromium/src/android/WebInputEventFactory.cpp @@ -66,23 +66,20 @@ WebKeyboardEvent WebInputEventFactory::keyboardEvent(WebInputEvent::Type type, return result; } -WebMouseEvent WebInputEventFactory::mouseEvent(int x, int y, - int windowX, int windowY, - MouseEventType type, +WebMouseEvent WebInputEventFactory::mouseEvent(MouseEventType type, + WebMouseEvent::Button button, double timeStampSeconds, + int windowX, + int windowY, int modifiers, - int clickCount, - WebMouseEvent::Button button) + int clickCount) { WebMouseEvent result; - result.x = x; - result.y = y; + result.x = windowX; + result.y = windowY; result.windowX = windowX; result.windowY = windowY; - // FIXME: We need to decide what to use for the globalX/Y. - result.globalX = windowX; - result.globalY = windowY; result.timeStampSeconds = timeStampSeconds; result.clickCount = clickCount; result.modifiers = modifiers; @@ -105,4 +102,69 @@ WebMouseEvent WebInputEventFactory::mouseEvent(int x, int y, return result; } +// WebMouseWheelEvent ------------------------------------------------------------ + +WebMouseWheelEvent WebInputEventFactory::mouseWheelEvent(MouseWheelDirectionType direction, + double timeStampSeconds, + int windowX, + int windowY) +{ + WebMouseWheelEvent result; + + result.type = WebInputEvent::MouseWheel; + result.x = windowX; + result.y = windowY; + result.windowX = windowX; + result.windowY = windowY; + result.timeStampSeconds = timeStampSeconds; + result.button = WebMouseEvent::ButtonNone; + + // The below choices are matched from GTK. + static const float scrollbarPixelsPerTick = 160.0f / 3.0f; + + switch (direction) { + case MouseWheelDirectionTypeUp: + result.deltaY = scrollbarPixelsPerTick; + result.wheelTicksY = 1; + break; + case MouseWheelDirectionTypeDown: + result.deltaY = -scrollbarPixelsPerTick; + result.wheelTicksY = -1; + break; + case MouseWheelDirectionTypeLeft: + result.deltaX = scrollbarPixelsPerTick; + result.wheelTicksX = 1; + break; + case MouseWheelDirectionTypeRight: + result.deltaX = -scrollbarPixelsPerTick; + result.wheelTicksX = -1; + break; + } + + return result; +} + +// WebGestureEvent ------------------------------------------------------------ + +WebGestureEvent WebInputEventFactory::gestureEvent(WebInputEvent::Type type, + double timeStampSeconds, + int x, + int y, + float deltaX, + float deltaY, + int modifiers) +{ + WebGestureEvent result; + + result.type = type; + result.x = x; + result.y = y; + result.deltaX = deltaX; + result.deltaY = deltaY; + result.timeStampSeconds = timeStampSeconds; + result.modifiers = modifiers; + + return result; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 499b6047d..c4d54238d 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -54,3 +54,8 @@ WebInspector.setInspectedTabId = function(tabId) { WebInspector._inspectedTabId = tabId; } + +WebInspector.clipboardAccessDeniedMessage = function() +{ + return "You need to install a Chrome extension that grants clipboard access to Developer Tools."; +} diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js index 8c7e26ab4..f7e3810c5 100644 --- a/Source/WebKit/chromium/src/js/Tests.js +++ b/Source/WebKit/chromium/src/js/Tests.js @@ -254,14 +254,14 @@ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function() var test = this; this.assertEquals(WebInspector.panels.elements, WebInspector.inspectorView.currentPanel(), "Elements panel should be current one."); - WebInspector.debuggerPresentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, waitUntilScriptIsParsed); + WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); // Reload inspected page. It will reset the debugger agent. test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); function waitUntilScriptIsParsed() { - WebInspector.debuggerPresentationModel.removeEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, waitUntilScriptIsParsed); + WebInspector.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, waitUntilScriptIsParsed); test.showPanel("scripts"); test._waitUntilScriptsAreParsed(["debugger_test_page.html"], function() { @@ -649,7 +649,7 @@ TestSuite.prototype.nonAnonymousUISourceCodes_ = function() return !!uiSourceCode.url; } - var uiSourceCodes = WebInspector.panels.scripts._presentationModel.uiSourceCodes(); + var uiSourceCodes = WebInspector.panels.scripts._uiSourceCodeProvider.uiSourceCodes(); return uiSourceCodes.filter(filterOutAnonymous); }; diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp index 58668d0ef..91c2d1dff 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp @@ -28,7 +28,6 @@ #include "CCAnimationTestCommon.h" #include "CCLayerTestCommon.h" -#include "CCTiledLayerTestCommon.h" #include "FakeWebGraphicsContext3D.h" #include "GraphicsContext3DPrivate.h" #include "LayerRendererChromium.h" @@ -60,7 +59,7 @@ public: { CCSettings settings; m_hostImpl = CCLayerTreeHostImpl::create(settings, this); - m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); m_hostImpl->setViewportSize(IntSize(10, 10)); } @@ -114,6 +113,8 @@ protected: } DebugScopedSetImplThread m_alwaysImplThread; + DebugScopedSetMainThreadBlocked m_alwaysMainThreadBlocked; + OwnPtr<CCLayerTreeHostImpl> m_hostImpl; bool m_didRequestCommit; bool m_didRequestRedraw; @@ -876,7 +877,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers) TEST_F(CCLayerTreeHostImplTest, viewportCovered) { - m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); m_hostImpl->setBackgroundColor(Color::gray); IntSize viewportSize(1000, 1000); @@ -987,7 +988,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw) { ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext(); RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), GraphicsContext3D::RenderDirectlyToHostWindow); - m_hostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(context, UnthrottledUploader); CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); root->setAnchorPoint(FloatPoint(0, 0)); @@ -1036,7 +1037,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect) CCSettings settings; settings.partialSwapEnabled = true; OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this); - layerTreeHostImpl->initializeLayerRenderer(context, adoptPtr(new FakeTextureUploader())); + layerTreeHostImpl->initializeLayerRenderer(context, UnthrottledUploader); layerTreeHostImpl->setViewportSize(IntSize(500, 500)); CCLayerImpl* root = new FakeDrawableCCLayerImpl(1); @@ -1135,7 +1136,7 @@ TEST_F(CCLayerTreeHostImplTest, contextLostAndRestoredNotificationSentToAllLayer EXPECT_FALSE(layer1->didLoseContextCalled()); EXPECT_FALSE(layer2->didLoseContextCalled()); - m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); EXPECT_TRUE(root->didLoseContextCalled()); EXPECT_TRUE(layer1->didLoseContextCalled()); @@ -1150,7 +1151,7 @@ public: TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost) { // The context initialization will fail, but we should still be able to call finishAllRendering() without any ill effects. - m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FakeWebGraphicsContext3DMakeCurrentFails), GraphicsContext3D::RenderDirectlyToHostWindow), UnthrottledUploader); m_hostImpl->finishAllRendering(); } @@ -1180,7 +1181,7 @@ TEST_F(CCLayerTreeHostImplTest, scrollbarLayerLostContext) // Scrollbar layer should always generate quads, even after lost context EXPECT_GT(renderPass->quadList().size(), 0u); m_hostImpl->didDrawAllLayers(frame); - m_hostImpl->initializeLayerRenderer(createContext(), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(createContext(), UnthrottledUploader); } } @@ -1355,7 +1356,7 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) // Lose the context, replacing it with a StrictWebGraphicsContext3D, that // will warn if any resource from the previous context gets used. - m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext(), adoptPtr(new FakeTextureUploader)); + m_hostImpl->initializeLayerRenderer(StrictWebGraphicsContext3D::createGraphicsContext(), UnthrottledUploader); EXPECT_TRUE(m_hostImpl->prepareToDraw(frame)); m_hostImpl->drawLayers(frame); m_hostImpl->didDrawAllLayers(frame); diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp index 44f87c6a9..77a3b8264 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp @@ -58,6 +58,12 @@ using namespace WebKit; using namespace WebKitTests; using namespace WTF; +#define EXPECT_EQ_RECT(a, b) \ + EXPECT_EQ(a.x(), b.x()); \ + EXPECT_EQ(a.y(), b.y()); \ + EXPECT_EQ(a.width(), b.width()); \ + EXPECT_EQ(a.height(), b.height()); + namespace { // Used by test stubs to notify the test when something interesting happens. @@ -113,6 +119,10 @@ public: m_testHooks->drawLayersOnCCThread(this); } + // Make these public. + typedef Vector<CCLayerImpl*> CCLayerList; + using CCLayerTreeHostImpl::calculateRenderSurfaceLayerList; + protected: virtual void animateLayers(double monotonicTime, double wallClockTime) { @@ -156,9 +166,9 @@ public: virtual PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHostImpl(CCLayerTreeHostImplClient* client) { // For these tests, we will enable threaded animations. - CCSettings settings; - settings.threadedAnimationEnabled = true; - return MockLayerTreeHostImpl::create(m_testHooks, settings, client); + CCSettings copySettings = settings(); + copySettings.threadedAnimationEnabled = true; + return MockLayerTreeHostImpl::create(m_testHooks, copySettings, client); } private: @@ -1140,9 +1150,11 @@ public: virtual void animateLayers(CCLayerTreeHostImpl* layerTreeHostImpl, double monotonicTime) { - if (!m_numAnimates) { - // We have a long animation running. It should continue to tick even if we are not visible. - postSetVisibleToMainThread(false); + if (m_numAnimates < 2) { + if (!m_numAnimates) { + // We have a long animation running. It should continue to tick even if we are not visible. + postSetVisibleToMainThread(false); + } m_numAnimates++; return; } @@ -1157,15 +1169,7 @@ private: int m_numAnimates; }; -#if OS(WINDOWS) -// http://webkit.org/b/74623 -TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, FLAKY_runMultiThread) -#else -TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded, runMultiThread) -#endif -{ - runTestThreaded(); -} +SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestTickAnimationWhileBackgrounded) // Ensures that animations continue to be ticked when we are backgrounded. class CCLayerTreeHostTestAddAnimationWithTimingFunction : public CCLayerTreeHostTestThreadOnly { @@ -1200,15 +1204,7 @@ public: private: }; -#if OS(WINDOWS) -// http://webkit.org/b/74623 -TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, FLAKY_runMultiThread) -#else -TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction, runMultiThread) -#endif -{ - runTestThreaded(); -} +SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAddAnimationWithTimingFunction) // Ensures that when opacity is being animated, this value does not cause the subtree to be skipped. class CCLayerTreeHostTestDoNotSkipLayersWithAnimatedOpacity : public CCLayerTreeHostTestThreadOnly { @@ -1290,10 +1286,7 @@ private: CCLayerTreeHostImpl* m_layerTreeHostImpl; }; -TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes, runMultiThread) -{ - runTestThreaded(); -} +SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestSynchronizeAnimationStartTimes) // Ensures that main thread animations have their start times synchronized with impl thread animations. class CCLayerTreeHostTestAnimationFinishedEvents : public CCLayerTreeHostTestThreadOnly { @@ -1319,10 +1312,7 @@ public: private: }; -TEST_F(CCLayerTreeHostTestAnimationFinishedEvents, runMultiThread) -{ - runTestThreaded(); -} +SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestAnimationFinishedEvents) class CCLayerTreeHostTestScrollSimple : public CCLayerTreeHostTestThreadOnly { public: @@ -1764,6 +1754,114 @@ public: void notifySyncRequired() { } }; +class CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public CCLayerTreeHostTest { +public: + + CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers() + : m_rootLayer(ContentLayerChromium::create(&m_delegate)) + , m_childLayer(ContentLayerChromium::create(&m_delegate)) + { + m_settings.deviceScaleFactor = 1.5; + } + + virtual void beginTest() + { + // The device viewport should be scaled by the device scale factor. + m_layerTreeHost->setViewportSize(IntSize(40, 40)); + EXPECT_EQ(IntSize(40, 40), m_layerTreeHost->viewportSize()); + EXPECT_EQ(IntSize(60, 60), m_layerTreeHost->deviceViewportSize()); + + m_rootLayer->addChild(m_childLayer); + + m_rootLayer->setIsDrawable(true); + m_rootLayer->setBounds(IntSize(30, 30)); + m_rootLayer->setAnchorPoint(FloatPoint(0, 0)); + + m_childLayer->setIsDrawable(true); + m_childLayer->setPosition(IntPoint(2, 2)); + m_childLayer->setBounds(IntSize(10, 10)); + m_childLayer->setAnchorPoint(FloatPoint(0, 0)); + + m_layerTreeHost->setRootLayer(m_rootLayer); + } + + virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) + { + // Get access to protected methods. + MockLayerTreeHostImpl* mockImpl = static_cast<MockLayerTreeHostImpl*>(impl); + + // Should only do one commit. + EXPECT_EQ(0, impl->sourceFrameNumber()); + // Device scale factor should come over to impl. + EXPECT_NEAR(impl->settings().deviceScaleFactor, 1.5, 0.00001); + + // Both layers are on impl. + ASSERT_EQ(1u, impl->rootLayer()->children().size()); + + // Device viewport is scaled. + EXPECT_EQ(IntSize(40, 40), impl->viewportSize()); + EXPECT_EQ(IntSize(60, 60), impl->deviceViewportSize()); + + CCLayerImpl* root = impl->rootLayer(); + CCLayerImpl* child = impl->rootLayer()->children()[0].get(); + + // Positions remain in layout pixels. + EXPECT_EQ(IntPoint(0, 0), root->position()); + EXPECT_EQ(IntPoint(2, 2), child->position()); + + // Compute all the layer transforms for the frame. + MockLayerTreeHostImpl::CCLayerList renderSurfaceLayerList; + mockImpl->calculateRenderSurfaceLayerList(renderSurfaceLayerList); + + // Both layers should be drawing into the root render surface. + ASSERT_EQ(1u, renderSurfaceLayerList.size()); + ASSERT_EQ(root->renderSurface(), renderSurfaceLayerList[0]->renderSurface()); + ASSERT_EQ(2u, root->renderSurface()->layerList().size()); + + // The root render surface is the size of the viewport. + EXPECT_EQ_RECT(IntRect(0, 0, 60, 60), root->renderSurface()->contentRect()); + + TransformationMatrix scaleTransform; + scaleTransform.scale(impl->settings().deviceScaleFactor); + + // The root layer is scaled by 2x. + TransformationMatrix rootScreenSpaceTransform = scaleTransform; + TransformationMatrix rootDrawTransform = scaleTransform; + rootDrawTransform.translate(root->bounds().width() * 0.5, root->bounds().height() * 0.5); + + EXPECT_EQ(rootDrawTransform, root->drawTransform()); + EXPECT_EQ(rootScreenSpaceTransform, root->screenSpaceTransform()); + + // The child is at position 2,2, so translate by 2,2 before applying the scale by 2x. + TransformationMatrix childScreenSpaceTransform = scaleTransform; + childScreenSpaceTransform.translate(2, 2); + TransformationMatrix childDrawTransform = scaleTransform; + childDrawTransform.translate(2, 2); + childDrawTransform.translate(child->bounds().width() * 0.5, child->bounds().height() * 0.5); + + EXPECT_EQ(childDrawTransform, child->drawTransform()); + EXPECT_EQ(childScreenSpaceTransform, child->screenSpaceTransform()); + + endTest(); + } + + virtual void afterTest() + { + m_rootLayer.clear(); + m_childLayer.clear(); + } + +private: + MockContentLayerDelegate m_delegate; + RefPtr<ContentLayerChromium> m_rootLayer; + RefPtr<ContentLayerChromium> m_childLayer; +}; + +TEST_F(CCLayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers, runMultiThread) +{ + runTest(true); +} + // Verify atomicity of commits and reuse of textures. class CCLayerTreeHostTestAtomicCommit : public CCLayerTreeHostTest { public: @@ -2017,12 +2115,6 @@ TEST_F(CCLayerTreeHostTestAtomicCommitWithPartialUpdate, runMultiThread) runTest(true); } -#define EXPECT_EQ_RECT(a, b) \ - EXPECT_EQ(a.x(), b.x()); \ - EXPECT_EQ(a.y(), b.y()); \ - EXPECT_EQ(a.width(), b.width()); \ - EXPECT_EQ(a.height(), b.height()); - class TestLayerChromium : public LayerChromium { public: static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); } diff --git a/Source/WebKit/chromium/tests/CCTimerTest.cpp b/Source/WebKit/chromium/tests/CCTimerTest.cpp index 398fca56e..c1b2efb77 100644 --- a/Source/WebKit/chromium/tests/CCTimerTest.cpp +++ b/Source/WebKit/chromium/tests/CCTimerTest.cpp @@ -55,8 +55,9 @@ TEST_F(CCTimerTest, OneShot) { CCTimer timer(&m_thread, this); timer.startOneShot(0.001); - + EXPECT_TRUE(timer.isActive()); m_thread.runPendingTask(); + EXPECT_FALSE(timer.isActive()); EXPECT_TRUE(m_flag); EXPECT_FALSE(m_thread.hasPendingTask()); } @@ -65,7 +66,9 @@ TEST_F(CCTimerTest, StopManually) { CCTimer timer(&m_thread, this); timer.startOneShot(0.001); + EXPECT_TRUE(timer.isActive()); timer.stop(); + EXPECT_FALSE(timer.isActive()); m_thread.runPendingTask(); EXPECT_FALSE(m_flag); diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp new file mode 100644 index 000000000..39ad32621 --- /dev/null +++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "GraphicsLayerChromium.h" + +#include "CCAnimationTestCommon.h" +#include "GraphicsLayer.h" +#include <gtest/gtest.h> +#include <wtf/PassOwnPtr.h> + +using namespace WebCore; +using namespace WebKitTests; + +namespace { + +class MockGraphicsLayerClient : public GraphicsLayerClient { + public: + virtual void notifyAnimationStarted(const GraphicsLayer*, double time) { } + virtual void notifySyncRequired(const GraphicsLayer*) { } + virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) { } + virtual bool showDebugBorders(const GraphicsLayer*) const { return false; } + virtual bool showRepaintCounter(const GraphicsLayer*) const { return false; } +}; + +TEST(GraphicsLayerChromiumTest, updateLayerPreserves3DWithAnimations) +{ + MockGraphicsLayerClient client; + OwnPtr<GraphicsLayerChromium> graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&client)); + ASSERT_TRUE(graphicsLayer.get()); + + LayerChromium* platformLayer = static_cast<LayerChromium*>(graphicsLayer->platformLayer()); + ASSERT_TRUE(platformLayer); + + ASSERT_FALSE(platformLayer->hasActiveAnimation()); + + OwnPtr<CCActiveAnimation> floatAnimation(CCActiveAnimation::create(adoptPtr(new FakeFloatAnimationCurve), 0, 1, CCActiveAnimation::Opacity)); + platformLayer->layerAnimationController()->add(floatAnimation.release()); + + ASSERT_TRUE(platformLayer->hasActiveAnimation()); + + graphicsLayer->setPreserves3D(true); + + platformLayer = static_cast<LayerChromium*>(graphicsLayer->platformLayer()); + ASSERT_TRUE(platformLayer); + + ASSERT_TRUE(platformLayer->hasActiveAnimation()); + platformLayer->removeAnimation(0); + ASSERT_FALSE(platformLayer->hasActiveAnimation()); + + graphicsLayer->setPreserves3D(false); + + platformLayer = static_cast<LayerChromium*>(graphicsLayer->platformLayer()); + ASSERT_TRUE(platformLayer); + + ASSERT_FALSE(platformLayer->hasActiveAnimation()); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp index bf889594c..ca17786bc 100644 --- a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp @@ -121,13 +121,13 @@ TEST(ImageLayerChromiumTest, opaqueImages) RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false); ASSERT_TRUE(nonOpaqueImage.get()); - ASSERT_FALSE(graphicsLayer->contentsLayer()); + ASSERT_TRUE(graphicsLayer->contentsLayer().isNull()); graphicsLayer->setContentsToImage(opaqueImage.get()); - ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque()); + ASSERT_TRUE(graphicsLayer->contentsLayer().opaque()); graphicsLayer->setContentsToImage(nonOpaqueImage.get()); - ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque()); + ASSERT_FALSE(graphicsLayer->contentsLayer().opaque()); } } // namespace diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp index 69d0ff5ff..8445feba7 100644 --- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp @@ -25,7 +25,6 @@ #include "config.h" #include "LayerRendererChromium.h" -#include "CCTiledLayerTestCommon.h" #include "FakeWebGraphicsContext3D.h" #include "GraphicsContext3D.h" #include "GraphicsContext3DPrivate.h" @@ -36,7 +35,6 @@ using namespace WebCore; using namespace WebKit; -using namespace WebKitTests; class FrameCountingMemoryAllocationSettingContext : public FakeWebGraphicsContext3D { public: @@ -73,7 +71,7 @@ public: } // LayerRendererChromiumClient methods. - virtual const IntSize& viewportSize() const OVERRIDE { static IntSize fakeSize; return fakeSize; } + virtual const IntSize& deviceViewportSize() const OVERRIDE { static IntSize fakeSize; return fakeSize; } virtual const CCSettings& settings() const OVERRIDE { static CCSettings fakeSettings; return fakeSettings; } virtual void didLoseContext() OVERRIDE { } virtual void onSwapBuffersComplete() OVERRIDE { } @@ -93,7 +91,7 @@ private: class FakeLayerRendererChromium : public LayerRendererChromium { public: - FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context, PassOwnPtr<TextureUploader> uploader) : LayerRendererChromium(client, context, uploader) { } + FakeLayerRendererChromium(LayerRendererChromiumClient* client, PassRefPtr<GraphicsContext3D> context) : LayerRendererChromium(client, context, UnthrottledUploader) { } // LayerRendererChromium methods. @@ -109,7 +107,7 @@ protected: , m_suggestHaveBackbufferNo(1, false) , m_context(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new FrameCountingMemoryAllocationSettingContext()), GraphicsContext3D::RenderDirectlyToHostWindow)) , m_mockContext(*static_cast<FrameCountingMemoryAllocationSettingContext*>(GraphicsContext3DPrivate::extractWebGraphicsContext3D(m_context.get()))) - , m_layerRendererChromium(&m_mockClient, m_context.release(), adoptPtr(new FakeTextureUploader())) + , m_layerRendererChromium(&m_mockClient, m_context.release()) { } @@ -273,7 +271,7 @@ public: TEST(LayerRendererChromiumTest2, initializationDoesNotMakeSynchronousCalls) { FakeLayerRendererChromiumClient mockClient; - FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow), adoptPtr(new FakeTextureUploader())); + FakeLayerRendererChromium layerRendererChromium(&mockClient, GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new ForbidSynchronousCallContext), GraphicsContext3D::RenderDirectlyToHostWindow)); EXPECT_TRUE(layerRendererChromium.initialize()); } diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 2fe01bf16..74251f3e8 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -30,12 +30,14 @@ #include "config.h" +#include "WebFrame.h" + +#include "Frame.h" #include "FrameTestHelpers.h" #include "ResourceError.h" #include "WebDocument.h" #include "WebFindOptions.h" #include "WebFormElement.h" -#include "WebFrame.h" #include "WebFrameClient.h" #include "WebRange.h" #include "WebScriptSource.h" @@ -226,18 +228,25 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client)); - webView->resize(WebSize(viewportWidth, viewportHeight)); webView->settings()->setViewportEnabled(true); webView->settings()->setDefaultDeviceScaleFactor(2); webView->enableFixedLayoutMode(true); + webView->resize(WebSize(viewportWidth, viewportHeight)); webView->layout(); EXPECT_EQ(2, webView->deviceScaleFactor()); + + // Device scale factor should be a component of page scale factor in fixed-layout, so a scale of 1 becomes 2. + webView->setPageScaleFactorLimits(1, 2); + EXPECT_EQ(2, webView->pageScaleFactor()); + + // Force the layout to happen before leaving the test. + webView->mainFrame()->contentAsText(1024).utf8(); } #endif #if ENABLE(GESTURE_EVENTS) -TEST_F(WebFrameTest, FAILS_DivAutoZoomParamsTest) +TEST_F(WebFrameTest, DivAutoZoomParamsTest) { registerMockedHttpURLLoad("get_scale_for_auto_zoom_into_div_test.html"); @@ -297,7 +306,6 @@ TEST_F(WebFrameTest, FAILS_DivAutoZoomParamsTest) webViewImpl->computeScaleAndScrollForHitRect(doubleTapPoint, WebViewImpl::DoubleTap, scale, scroll); EXPECT_FLOAT_EQ(3, scale); - // Test for Non-doubletap scaling webViewImpl->setPageScaleFactor(1, WebPoint(0, 0)); webViewImpl->setDeviceScaleFactor(4); @@ -305,6 +313,9 @@ TEST_F(WebFrameTest, FAILS_DivAutoZoomParamsTest) // Test zooming into div. webViewImpl->computeScaleAndScrollForHitRect(WebRect(250, 250, 10, 10), WebViewImpl::FindInPage, scale, scroll); EXPECT_NEAR(pageWidth / divWidth, scale, 0.1); + + // Drop any pending fake mouse events from zooming before leaving the test. + webViewImpl->page()->mainFrame()->eventHandler()->clear(); } #endif diff --git a/Source/WebKit/chromium/tests/WebTransformationMatrixTest.cpp b/Source/WebKit/chromium/tests/WebTransformationMatrixTest.cpp new file mode 100644 index 000000000..af291698a --- /dev/null +++ b/Source/WebKit/chromium/tests/WebTransformationMatrixTest.cpp @@ -0,0 +1,956 @@ +/* + * Copyright (C) 2012 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 INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "../../../../Platform/chromium/public/WebTransformationMatrix.h" + +#include <gtest/gtest.h> + +#define EXPECT_ROW1_EQ(a, b, c, d, matrix) \ + EXPECT_FLOAT_EQ((a), (matrix).m11()); \ + EXPECT_FLOAT_EQ((b), (matrix).m21()); \ + EXPECT_FLOAT_EQ((c), (matrix).m31()); \ + EXPECT_FLOAT_EQ((d), (matrix).m41()); + +#define EXPECT_ROW2_EQ(a, b, c, d, matrix) \ + EXPECT_FLOAT_EQ((a), (matrix).m12()); \ + EXPECT_FLOAT_EQ((b), (matrix).m22()); \ + EXPECT_FLOAT_EQ((c), (matrix).m32()); \ + EXPECT_FLOAT_EQ((d), (matrix).m42()); + +#define EXPECT_ROW3_EQ(a, b, c, d, matrix) \ + EXPECT_FLOAT_EQ((a), (matrix).m13()); \ + EXPECT_FLOAT_EQ((b), (matrix).m23()); \ + EXPECT_FLOAT_EQ((c), (matrix).m33()); \ + EXPECT_FLOAT_EQ((d), (matrix).m43()); + +#define EXPECT_ROW4_EQ(a, b, c, d, matrix) \ + EXPECT_FLOAT_EQ((a), (matrix).m14()); \ + EXPECT_FLOAT_EQ((b), (matrix).m24()); \ + EXPECT_FLOAT_EQ((c), (matrix).m34()); \ + EXPECT_FLOAT_EQ((d), (matrix).m44()); \ + +// Checking float values for equality close to zero is not robust using EXPECT_FLOAT_EQ +// (see gtest documentation). So, to verify rotation matrices, we must use a looser +// absolute error threshold in some places. +#define EXPECT_ROW1_NEAR(a, b, c, d, matrix, errorThreshold) \ + EXPECT_NEAR((a), (matrix).m11(), (errorThreshold)); \ + EXPECT_NEAR((b), (matrix).m21(), (errorThreshold)); \ + EXPECT_NEAR((c), (matrix).m31(), (errorThreshold)); \ + EXPECT_NEAR((d), (matrix).m41(), (errorThreshold)); + +#define EXPECT_ROW2_NEAR(a, b, c, d, matrix, errorThreshold) \ + EXPECT_NEAR((a), (matrix).m12(), (errorThreshold)); \ + EXPECT_NEAR((b), (matrix).m22(), (errorThreshold)); \ + EXPECT_NEAR((c), (matrix).m32(), (errorThreshold)); \ + EXPECT_NEAR((d), (matrix).m42(), (errorThreshold)); + +#define EXPECT_ROW3_NEAR(a, b, c, d, matrix, errorThreshold) \ + EXPECT_NEAR((a), (matrix).m13(), (errorThreshold)); \ + EXPECT_NEAR((b), (matrix).m23(), (errorThreshold)); \ + EXPECT_NEAR((c), (matrix).m33(), (errorThreshold)); \ + EXPECT_NEAR((d), (matrix).m43(), (errorThreshold)); + +#define ERROR_THRESHOLD 1e-14 + +using namespace WebKit; + +namespace { + +static void initializeTestMatrix(WebTransformationMatrix& transform) +{ + transform.setM11(10); + transform.setM12(11); + transform.setM13(12); + transform.setM14(13); + transform.setM21(14); + transform.setM22(15); + transform.setM23(16); + transform.setM24(17); + transform.setM31(18); + transform.setM32(19); + transform.setM33(20); + transform.setM34(21); + transform.setM41(22); + transform.setM42(23); + transform.setM43(24); + transform.setM44(25); + + // Sanity check + EXPECT_ROW1_EQ(10, 14, 18, 22, transform); + EXPECT_ROW2_EQ(11, 15, 19, 23, transform); + EXPECT_ROW3_EQ(12, 16, 20, 24, transform); + EXPECT_ROW4_EQ(13, 17, 21, 25, transform); +} + +static void initializeTestMatrix2(WebTransformationMatrix& transform) +{ + transform.setM11(30); + transform.setM12(31); + transform.setM13(32); + transform.setM14(33); + transform.setM21(34); + transform.setM22(35); + transform.setM23(36); + transform.setM24(37); + transform.setM31(38); + transform.setM32(39); + transform.setM33(40); + transform.setM34(41); + transform.setM41(42); + transform.setM42(43); + transform.setM43(44); + transform.setM44(45); + + // Sanity check + EXPECT_ROW1_EQ(30, 34, 38, 42, transform); + EXPECT_ROW2_EQ(31, 35, 39, 43, transform); + EXPECT_ROW3_EQ(32, 36, 40, 44, transform); + EXPECT_ROW4_EQ(33, 37, 41, 45, transform); +} + +TEST(WebTransformationMatrixTest, verifyDefaultConstructorCreatesIdentityMatrix) +{ + WebTransformationMatrix A; + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + EXPECT_TRUE(A.isIdentity()); +} + +TEST(WebTransformationMatrixTest, verifyConstructorFor2dElements) +{ + WebTransformationMatrix A(1, 2, 3, 4, 5, 6); + EXPECT_ROW1_EQ(1, 3, 0, 5, A); + EXPECT_ROW2_EQ(2, 4, 0, 6, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyCopyConstructor) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + + // Copy constructor should produce exact same elements as matrix A. + WebTransformationMatrix B(A); + EXPECT_ROW1_EQ(10, 14, 18, 22, B); + EXPECT_ROW2_EQ(11, 15, 19, 23, B); + EXPECT_ROW3_EQ(12, 16, 20, 24, B); + EXPECT_ROW4_EQ(13, 17, 21, 25, B); +} + +TEST(WebTransformationMatrixTest, verifyMatrixInversion) +{ + // Invert a translation + WebTransformationMatrix translation; + translation.translate3d(2, 3, 4); + EXPECT_TRUE(translation.isInvertible()); + + WebTransformationMatrix inverseTranslation = translation.inverse(); + EXPECT_ROW1_EQ(1, 0, 0, -2, inverseTranslation); + EXPECT_ROW2_EQ(0, 1, 0, -3, inverseTranslation); + EXPECT_ROW3_EQ(0, 0, 1, -4, inverseTranslation); + EXPECT_ROW4_EQ(0, 0, 0, 1, inverseTranslation); + + // Note that inversion should not have changed the original matrix. + EXPECT_ROW1_EQ(1, 0, 0, 2, translation); + EXPECT_ROW2_EQ(0, 1, 0, 3, translation); + EXPECT_ROW3_EQ(0, 0, 1, 4, translation); + EXPECT_ROW4_EQ(0, 0, 0, 1, translation); + + // Invert a non-uniform scale + WebTransformationMatrix scale; + scale.scale3d(4, 10, 100); + EXPECT_TRUE(scale.isInvertible()); + + WebTransformationMatrix inverseScale = scale.inverse(); + EXPECT_ROW1_EQ(0.25, 0, 0, 0, inverseScale); + EXPECT_ROW2_EQ(0, 0.1, 0, 0, inverseScale); + EXPECT_ROW3_EQ(0, 0, 0.01, 0, inverseScale); + EXPECT_ROW4_EQ(0, 0, 0, 1, inverseScale); + + // Try to invert a matrix that is not invertible. + // The inverse() function should simply return an identity matrix. + WebTransformationMatrix notInvertible; + notInvertible.setM11(0); + notInvertible.setM22(0); + notInvertible.setM33(0); + notInvertible.setM44(0); + EXPECT_FALSE(notInvertible.isInvertible()); + + WebTransformationMatrix inverseOfNotInvertible; + initializeTestMatrix(inverseOfNotInvertible); // initialize this to something non-identity, to make sure that assignment below actually took place. + inverseOfNotInvertible = notInvertible.inverse(); + EXPECT_TRUE(inverseOfNotInvertible.isIdentity()); +} + +TEST(WebTransformationMatrixTest, verifyTo2DTransform) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + + WebTransformationMatrix B = A.to2dTransform(); + + EXPECT_ROW1_EQ(10, 14, 0, 22, B); + EXPECT_ROW2_EQ(11, 15, 0, 23, B); + EXPECT_ROW3_EQ(0, 0, 1, 0, B); + EXPECT_ROW4_EQ(13, 17, 0, 25, B); + + // Note that to2DTransform should not have changed the original matrix. + EXPECT_ROW1_EQ(10, 14, 18, 22, A); + EXPECT_ROW2_EQ(11, 15, 19, 23, A); + EXPECT_ROW3_EQ(12, 16, 20, 24, A); + EXPECT_ROW4_EQ(13, 17, 21, 25, A); +} + +TEST(WebTransformationMatrixTest, verifyAssignmentOperator) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + WebTransformationMatrix B; + initializeTestMatrix2(B); + WebTransformationMatrix C; + initializeTestMatrix2(C); + C = B = A; + + // Both B and C should now have been re-assigned to the value of A. + EXPECT_ROW1_EQ(10, 14, 18, 22, B); + EXPECT_ROW2_EQ(11, 15, 19, 23, B); + EXPECT_ROW3_EQ(12, 16, 20, 24, B); + EXPECT_ROW4_EQ(13, 17, 21, 25, B); + + EXPECT_ROW1_EQ(10, 14, 18, 22, C); + EXPECT_ROW2_EQ(11, 15, 19, 23, C); + EXPECT_ROW3_EQ(12, 16, 20, 24, C); + EXPECT_ROW4_EQ(13, 17, 21, 25, C); +} + +TEST(WebTransformationMatrixTest, verifyEqualsBooleanOperator) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + + WebTransformationMatrix B; + initializeTestMatrix(B); + EXPECT_TRUE(A == B); + + // Modifying multiple elements should cause equals operator to return false. + WebTransformationMatrix C; + initializeTestMatrix2(C); + EXPECT_FALSE(A == C); + + // Modifying any one individual element should cause equals operator to return false. + WebTransformationMatrix D; + D = A; + D.setM11(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM12(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM13(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM14(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM21(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM22(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM23(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM24(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM31(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM32(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM33(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM34(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM41(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM42(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM43(0); + EXPECT_FALSE(A == D); + + D = A; + D.setM44(0); + EXPECT_FALSE(A == D); +} + +TEST(WebTransformationMatrixTest, verifyMultiplyOperator) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + + WebTransformationMatrix B; + initializeTestMatrix2(B); + + WebTransformationMatrix C = A * B; + EXPECT_ROW1_EQ(2036, 2292, 2548, 2804, C); + EXPECT_ROW2_EQ(2162, 2434, 2706, 2978, C); + EXPECT_ROW3_EQ(2288, 2576, 2864, 3152, C); + EXPECT_ROW4_EQ(2414, 2718, 3022, 3326, C); + + // Just an additional sanity check; matrix multiplication is not commutative. + EXPECT_FALSE(A * B == B * A); +} + +TEST(WebTransformationMatrixTest, verifyMatrixMultiplication) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + + WebTransformationMatrix B; + initializeTestMatrix2(B); + + A.multiply(B); + EXPECT_ROW1_EQ(2036, 2292, 2548, 2804, A); + EXPECT_ROW2_EQ(2162, 2434, 2706, 2978, A); + EXPECT_ROW3_EQ(2288, 2576, 2864, 3152, A); + EXPECT_ROW4_EQ(2414, 2718, 3022, 3326, A); +} + +TEST(WebTransformationMatrixTest, verifyMakeIdentiy) +{ + WebTransformationMatrix A; + initializeTestMatrix(A); + A.makeIdentity(); + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + EXPECT_TRUE(A.isIdentity()); +} + +TEST(WebTransformationMatrixTest, verifyTranslate) +{ + WebTransformationMatrix A; + A.translate(2, 3); + EXPECT_ROW1_EQ(1, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 1, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that translate() post-multiplies the existing matrix. + A.makeIdentity(); + A.scale(5); + A.translate(2, 3); + EXPECT_ROW1_EQ(5, 0, 0, 10, A); + EXPECT_ROW2_EQ(0, 5, 0, 15, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyTranslate3d) +{ + WebTransformationMatrix A; + A.translate3d(2, 3, 4); + EXPECT_ROW1_EQ(1, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 1, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 1, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that translate3d() post-multiplies the existing matrix. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.translate3d(2, 3, 4); + EXPECT_ROW1_EQ(6, 0, 0, 12, A); + EXPECT_ROW2_EQ(0, 7, 0, 21, A); + EXPECT_ROW3_EQ(0, 0, 8, 32, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyTranslateRight3d) +{ + WebTransformationMatrix A; + A.translateRight3d(2, 3, 4); + EXPECT_ROW1_EQ(1, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 1, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 1, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Note carefully, all other operations do post-multiply, this one is unique. + // Verify that translateRight3d() PRE-multiplies the existing matrix. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.translateRight3d(2, 3, 4); + EXPECT_ROW1_EQ(6, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 7, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 8, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyScale) +{ + WebTransformationMatrix A; + A.scale(5); + EXPECT_ROW1_EQ(5, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 5, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that scale() post-multiplies the existing matrix. + A.makeIdentity(); + A.translate3d(2, 3, 4); + A.scale(5); + EXPECT_ROW1_EQ(5, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 5, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 1, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyNonUniformScale) +{ + WebTransformationMatrix A; + A.scaleNonUniform(6, 7); + EXPECT_ROW1_EQ(6, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 7, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that scaleNonUniform() post-multiplies the existing matrix. + A.makeIdentity(); + A.translate3d(2, 3, 4); + A.scaleNonUniform(6, 7); + EXPECT_ROW1_EQ(6, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 7, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 1, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyScale3d) +{ + WebTransformationMatrix A; + A.scale3d(6, 7, 8); + EXPECT_ROW1_EQ(6, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 7, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that scale3d() post-multiplies the existing matrix. + A.makeIdentity(); + A.translate3d(2, 3, 4); + A.scale3d(6, 7, 8); + EXPECT_ROW1_EQ(6, 0, 0, 2, A); + EXPECT_ROW2_EQ(0, 7, 0, 3, A); + EXPECT_ROW3_EQ(0, 0, 8, 4, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyRotate) +{ + WebTransformationMatrix A; + A.rotate(90); + EXPECT_ROW1_NEAR(0, -1, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(1, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that rotate() post-multiplies the existing matrix. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.rotate(90); + EXPECT_ROW1_NEAR(0, -6, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(7, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyRotate3d) +{ + WebTransformationMatrix A; + + // Check rotation about z-axis + A.makeIdentity(); + A.rotate3d(0, 0, 90); + EXPECT_ROW1_NEAR(0, -1, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(1, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Check rotation about x-axis + A.makeIdentity(); + A.rotate3d(90, 0, 0); + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_NEAR(0, 0, -1, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_NEAR(0, 1, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Check rotation about y-axis. + // Note carefully, the expected pattern is inverted compared to rotating about x axis or z axis. + A.makeIdentity(); + A.rotate3d(0, 90, 0); + EXPECT_ROW1_NEAR(0, 0, 1, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_NEAR(-1, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that rotate3d(rx, ry, rz) post-multiplies the existing matrix. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.rotate3d(0, 0, 90); + EXPECT_ROW1_NEAR(0, -6, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(7, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyRotate3dOrderOfCompositeRotations) +{ + // Rotate3d(degreesX, degreesY, degreesZ) is actually composite transform consiting of + // three primitive rotations. This test verifies that the ordering of those three + // transforms is the intended ordering. + // + // The correct ordering for this test case should be: + // 1. rotate by 30 degrees about z-axis + // 2. rotate by 20 degrees about y-axis + // 3. rotate by 10 degrees about x-axis + // + // Note: there are 6 possible orderings of 3 transforms. For the specific transforms + // used in this test, all 6 combinations produce a unique matrix that is different + // from the other orderings. That way, this test verifies the exact ordering. + + WebTransformationMatrix A; + A.makeIdentity(); + A.rotate3d(10, 20, 30); + + EXPECT_ROW1_NEAR(0.8137976813493738026394908, + -0.4409696105298823720630708, + 0.3785223063697923939763257, + 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(0.4698463103929541584413698, + 0.8825641192593856043657752, + 0.0180283112362972230968694, + 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_NEAR(-0.3420201433256686573969318, + 0.1631759111665348205288950, + 0.9254165783983233639631294, + 0, A, ERROR_THRESHOLD); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyRotateAxisAngle3d) +{ + WebTransformationMatrix A; + + // Check rotation about z-axis + A.makeIdentity(); + A.rotate3d(0, 0, 1, 90); + EXPECT_ROW1_NEAR(0, -1, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(1, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Check rotation about x-axis + A.makeIdentity(); + A.rotate3d(1, 0, 0, 90); + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_NEAR(0, 0, -1, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_NEAR(0, 1, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Check rotation about y-axis. + // Note carefully, the expected pattern is inverted compared to rotating about x axis or z axis. + A.makeIdentity(); + A.rotate3d(0, 1, 0, 90); + EXPECT_ROW1_NEAR(0, 0, 1, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_NEAR(-1, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that rotate3d(axis, angle) post-multiplies the existing matrix. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.rotate3d(0, 0, 1, 90); + EXPECT_ROW1_NEAR(0, -6, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW2_NEAR(7, 0, 0, 0, A, ERROR_THRESHOLD); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifySkewX) +{ + WebTransformationMatrix A; + A.skewX(45); + EXPECT_ROW1_EQ(1, 1, 0, 0, A); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that skewX() post-multiplies the existing matrix. + // Row 1, column 2, would incorrectly have value "7" if the matrix is pre-multiplied instead of post-multiplied. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.skewX(45); + EXPECT_ROW1_EQ(6, 6, 0, 0, A); + EXPECT_ROW2_EQ(0, 7, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifySkewY) +{ + WebTransformationMatrix A; + A.skewY(45); + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_EQ(1, 1, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); + + // Verify that skewY() post-multiplies the existing matrix. + // Row 2, column 1, would incorrectly have value "6" if the matrix is pre-multiplied instead of post-multiplied. + A.makeIdentity(); + A.scale3d(6, 7, 8); + A.skewY(45); + EXPECT_ROW1_EQ(6, 0, 0, 0, A); + EXPECT_ROW2_EQ(7, 7, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 8, 0, A); + EXPECT_ROW4_EQ(0, 0, 0, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyApplyPerspective) +{ + WebTransformationMatrix A; + A.applyPerspective(1); + EXPECT_ROW1_EQ(1, 0, 0, 0, A); + EXPECT_ROW2_EQ(0, 1, 0, 0, A); + EXPECT_ROW3_EQ(0, 0, 1, 0, A); + EXPECT_ROW4_EQ(0, 0, -1, 1, A); + + // Verify that applyPerspective() post-multiplies the existing matrix. + A.makeIdentity(); + A.translate3d(2, 3, 4); + A.applyPerspective(1); + EXPECT_ROW1_EQ(1, 0, -2, 2, A); + EXPECT_ROW2_EQ(0, 1, -3, 3, A); + EXPECT_ROW3_EQ(0, 0, -3, 4, A); + EXPECT_ROW4_EQ(0, 0, -1, 1, A); +} + +TEST(WebTransformationMatrixTest, verifyHasPerspective) +{ + WebTransformationMatrix A; + A.applyPerspective(1); + EXPECT_TRUE(A.hasPerspective()); + + A.makeIdentity(); + A.applyPerspective(0); + EXPECT_FALSE(A.hasPerspective()); + + A.makeIdentity(); + A.setM34(-0.3); + EXPECT_TRUE(A.hasPerspective()); + + // FIXME: WebCore only checkes m34() for perspective, but that is probably + // wrong. https://bugs.webkit.org/show_bug.cgi?id=83088. For now, this test + // case expects the exact behavior as implemented by WebCore, but this should + // probably be changed so that if the entire bottom row is not exactly + // (0, 0, 0, 1), then hasPerspective should return true. + + A.makeIdentity(); + A.setM14(-1); + EXPECT_FALSE(A.hasPerspective()); + + A.makeIdentity(); + A.setM24(-1); + EXPECT_FALSE(A.hasPerspective()); + + A.makeIdentity(); + A.setM44(0.5); + EXPECT_FALSE(A.hasPerspective()); +} + +TEST(WebTransformationMatrixTest, verifyIsInvertible) +{ + WebTransformationMatrix A; + + // Translations, rotations, scales, skews and arbitrary combinations of them are invertible. + A.makeIdentity(); + EXPECT_TRUE(A.isInvertible()); + + A.makeIdentity(); + A.translate3d(2, 3, 4); + EXPECT_TRUE(A.isInvertible()); + + A.makeIdentity(); + A.scale3d(6, 7, 8); + EXPECT_TRUE(A.isInvertible()); + + A.makeIdentity(); + A.rotate3d(10, 20, 30); + EXPECT_TRUE(A.isInvertible()); + + A.makeIdentity(); + A.skewX(45); + EXPECT_TRUE(A.isInvertible()); + + // A perspective matrix (projection plane at z=0) is invertible. The intuitive + // explanation is that perspective is eqivalent to a skew of the w-axis; skews are + // invertible. + A.makeIdentity(); + A.applyPerspective(1); + EXPECT_TRUE(A.isInvertible()); + + // A "pure" perspective matrix derived by similar triangles, with m44() set to zero + // (i.e. camera positioned at the origin), is not invertible. + A.makeIdentity(); + A.applyPerspective(1); + A.setM44(0); + EXPECT_FALSE(A.isInvertible()); + + // Adding more to a non-invertible matrix will not make it invertible in the general case. + A.makeIdentity(); + A.applyPerspective(1); + A.setM44(0); + A.scale3d(6, 7, 8); + A.rotate3d(10, 20, 30); + A.translate3d(6, 7, 8); + EXPECT_FALSE(A.isInvertible()); + + // A degenerate matrix of all zeros is not invertible. + A.makeIdentity(); + A.setM11(0); + A.setM22(0); + A.setM33(0); + A.setM44(0); + EXPECT_FALSE(A.isInvertible()); +} + +TEST(WebTransformationMatrixTest, verifyIsIdentity) +{ + WebTransformationMatrix A; + + initializeTestMatrix(A); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + EXPECT_TRUE(A.isIdentity()); + + // Modifying any one individual element should cause the matrix to no longer be identity. + A.makeIdentity(); + A.setM11(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM12(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM13(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM14(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM21(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM22(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM23(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM24(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM31(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM32(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM33(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM34(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM41(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM42(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM43(2); + EXPECT_FALSE(A.isIdentity()); + + A.makeIdentity(); + A.setM44(2); + EXPECT_FALSE(A.isIdentity()); +} + +TEST(WebTransformationMatrixTest, verifyIsIdentityOrTranslation) +{ + WebTransformationMatrix A; + + initializeTestMatrix(A); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + EXPECT_TRUE(A.isIdentityOrTranslation()); + + // Modifying any non-translation components should cause isIdentityOrTranslation() to + // return false. NOTE: m41(), m42(), and m43() are the translation components, so + // modifying them should still return true for isIdentityOrTranslation(). + A.makeIdentity(); + A.setM11(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM12(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM13(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM14(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM21(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM22(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM23(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM24(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM31(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM32(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM33(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM34(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); + + // Note carefully - expecting true here. + A.makeIdentity(); + A.setM41(2); + EXPECT_TRUE(A.isIdentityOrTranslation()); + + // Note carefully - expecting true here. + A.makeIdentity(); + A.setM42(2); + EXPECT_TRUE(A.isIdentityOrTranslation()); + + // Note carefully - expecting true here. + A.makeIdentity(); + A.setM43(2); + EXPECT_TRUE(A.isIdentityOrTranslation()); + + A.makeIdentity(); + A.setM44(2); + EXPECT_FALSE(A.isIdentityOrTranslation()); +} + +TEST(WebTransformationMatrixTest, isIntegerTranslation) +{ + WebTransformationMatrix A; + + A.makeIdentity(); + A.translate(2, 3); + EXPECT_TRUE(A.isIntegerTranslation()); + + A.makeIdentity(); + A.translate(2.0, 3.0); + EXPECT_TRUE(A.isIntegerTranslation()); + + A.makeIdentity(); + A.translate(2.00001, 3); + EXPECT_FALSE(A.isIntegerTranslation()); + + A.makeIdentity(); + A.translate(2, 2.99999); + EXPECT_FALSE(A.isIntegerTranslation()); + + // Stacking many integer translations should ideally not accumulate any precision error. + A.makeIdentity(); + for (int i = 0; i < 100000; ++i) + A.translate(2, 3); + EXPECT_TRUE(A.isIntegerTranslation()); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp index 460c62bd2..aef5c94ce 100644 --- a/Source/WebKit/chromium/tests/WebViewTest.cpp +++ b/Source/WebKit/chromium/tests/WebViewTest.cpp @@ -143,6 +143,25 @@ TEST_F(WebViewTest, FocusIsInactive) webView->close(); } +TEST_F(WebViewTest, ActiveState) +{ + FrameTestHelpers::registerMockedURLLoad(m_baseURL, "visible_iframe.html"); + WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visible_iframe.html"); + + ASSERT_TRUE(webView); + + webView->setIsActive(true); + EXPECT_TRUE(webView->isActive()); + + webView->setIsActive(false); + EXPECT_FALSE(webView->isActive()); + + webView->setIsActive(true); + EXPECT_TRUE(webView->isActive()); + + webView->close(); +} + void WebViewTest::testAutoResize(const WebSize& minAutoResize, const WebSize& maxAutoResize, const std::string& pageWidth, const std::string& pageHeight, int expectedWidth, int expectedHeight, |
