diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:09:45 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-11-22 09:10:13 +0100 |
commit | 470286ecfe79d59df14944e5b5d34630fc739391 (patch) | |
tree | 43983212872e06cebefd2ae474418fa2908ca54c /Source/WebKit/chromium | |
parent | 23037105e948c2065da5a937d3a2396b0ff45c1e (diff) | |
download | qtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz |
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebKit/chromium')
109 files changed, 3626 insertions, 1116 deletions
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index b6dc5c975..d4d3171f0 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,1792 @@ +2012-11-21 Tien-Ren Chen <trchen@chromium.org> + + [chromium] Device scale factor should be no-op when applyDeviceScaleFactorInCompositor == 0 + https://bugs.webkit.org/show_bug.cgi?id=100061 + + Reviewed by Adam Barth. + + On Android we're using a different pixel scaling implementation + (WebCore::Settings::applyDefaultDeviceScaleFactorInCompositor() == 0) than other + platforms. In this mode, we don't make use of device-independent pixels. Device + scale factor is provided to WebKit and get merged into page scale factor. Other + than that device scale factor should have no effects on rendering. + + * src/PageWidgetDelegate.cpp: + (WebKit::PageWidgetDelegate::paint): + * src/PageWidgetDelegate.h: + * src/WebPagePopupImpl.cpp: + (WebKit::WebPagePopupImpl::paint): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::paint): + (WebKit::WebViewImpl::shouldApplyDeviceScaleFactorInCompositor): + (WebKit): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-11-21 Tien-Ren Chen <trchen@chromium.org> + + Use m_webView->size() for viewport update + https://bugs.webkit.org/show_bug.cgi?id=102764 + + Reviewed by Adam Barth. + + m_webView->client()->windowRect() returns the outer rect of the browser + window, which includes the decorations such as the title bar. + We should use the size of the WebView for layout and rendering purpose. + + Existing tests are updated to work without windowRect(). + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange): + * tests/WebFrameTest.cpp: + +2012-11-21 Peter Beverloo <peter@chromium.org> + + [Chromium] webkit_unit_tests should depend on forwarder2 for Android + https://bugs.webkit.org/show_bug.cgi?id=102934 + + Reviewed by Tony Chang. + + Running webkit_unit_tests and TestWebKitAPI in the WebKit tree will defer + to the test runner used by Chromium, which in turn relies on forwarder2. + forwarder2 will eventually be required by layout tests as well. + + * WebKitUnitTests.gyp: + +2012-11-21 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135409. + http://trac.webkit.org/changeset/135409 + https://bugs.webkit.org/show_bug.cgi?id=102959 + + This patch causes compiling error to Chromium build (Requested + by jianli_ on #webkit). + + * tests/IDBRequestTest.cpp: + (WebCore::TEST): + +2012-11-21 Kevin Ellis <kevers@chromium.org> + + [chromium] Add flag to enable/disable touch adjustment at runtime. + https://bugs.webkit.org/show_bug.cgi?id=102534 + + Reviewed by Antonio Gomes. + + Add setting for enabling or disabling touch adjustment. + For touch adjustemnt to apply, the compile option must + also be enabled. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setEnableTouchAdjustment): + (WebKit): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + +2012-11-21 Dan Carney <dcarney@google.com> + + IDBRequestTest needs a v8 context + https://bugs.webkit.org/show_bug.cgi?id=102941 + + Reviewed by Jochen Eisinger. + + Added v8 context to IDBRequestTest tests. + + * tests/IDBRequestTest.cpp: + (IDBRequestTest): + (WebKit::IDBRequestTest::IDBRequestTest): + (WebKit::IDBRequestTest::context): + (WebKit::IDBRequestTest::scriptExecutionContext): + (WebKit): + (WebKit::TEST_F): + +2012-11-21 Peter Beverloo <peter@chromium.org> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-21 Allan Sandfeld Jensen <allan.jensen@digia.com> + + Disambiguate innerNodeFramePoint and mainFramePoint + https://bugs.webkit.org/show_bug.cgi?id=98139 + + Reviewed by Julien Chaffraix. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::mouseDidMoveOverElement): + * src/ContextMenuClientImpl.cpp: + (WebKit::selectMisspelledWord): + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::characterIndexForPoint): + +2012-11-21 W. James MacLean <wjmaclean@chromium.org> + + [chromium] Link highlight should display for at least 100ms, and fadeout on GestureTap/Longpress. + https://bugs.webkit.org/show_bug.cgi?id=102823 + + Reviewed by Adrienne Walker. + + Link highlights sometimes disappear so quickly they barely display. Modify + so that the highlight is displayed for minimum 100ms before fading out, and + also fadeout (as opposed to abrupt clear) on GestureTap and GestureLongPress. + + * src/LinkHighlight.cpp: + (WebKit::LinkHighlight::LinkHighlight): + (WebKit::LinkHighlight::startHighlightAnimationIfNeeded): Check if min duration achieved, if not add time to fadeout animation. + * src/LinkHighlight.h: + (LinkHighlight): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleGestureEvent): Fadeout instead of clear on GestureTap and GestureLongPress. + +2012-11-21 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Now that offending patch has been rolled out reenable IDBRequestTest.EventsAfterStopping + https://bugs.webkit.org/show_bug.cgi?id=102929 + + * tests/IDBRequestTest.cpp: + (WebCore::TEST): + +2012-11-21 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Disable failing test. + https://bugs.webkit.org/show_bug.cgi?id=102929 + + * tests/IDBRequestTest.cpp: + (WebCore::TEST): + +2012-11-21 Florin Malita <fmalita@chromium.org> + + [Skia] Encapsulate access to PlatformContextSkia's SkCanvas + https://bugs.webkit.org/show_bug.cgi?id=102694 + + Reviewed by Stephen White. + + Use PlatformContextSkia's wrapper methods instead of accessing the canvas directly. + + * tests/TransparencyWinTest.cpp: + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2012-11-20 Rachel Blum <groby@chromium.org> + + [Chromium] Need spellcheck suggestions even if continuous check is off. + https://bugs.webkit.org/show_bug.cgi?id=102535 + + Reviewed by Hajime Morita. + + Make sure the context menu always has suggestions for misspelled words. + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + +2012-11-20 Robert Kroeger <rjkroege@chromium.org> + + [chromium] Use embedder-supported gesture curves + https://bugs.webkit.org/show_bug.cgi?id=100884 + + Reviewed by James Robinson. + + Use embedder-provided gesture animation curves via WebKit api interfaces. + Tested by existing tests. + + * src/WebCompositorInputHandlerImpl.cpp: + (WebKit::WebCompositorInputHandlerImpl::handleGestureFling): + (WebKit::WebCompositorInputHandlerImpl::scrollBy): + * src/WebCompositorInputHandlerImpl.h: + (WebCompositorInputHandlerImpl): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::scrollBy): + (WebKit::WebViewImpl::handleGestureEvent): + (WebKit::WebViewImpl::transferActiveWheelFlingAnimation): + * src/WebViewImpl.h: + (WebCore): + (WebKit): + (WebViewImpl): + +2012-11-20 Tony Chang <tony@chromium.org> + + When calling DocumentStyleSheetCollection::addUserSheet, pass in a user sheet + https://bugs.webkit.org/show_bug.cgi?id=102835 + + Reviewed by Ojan Vafai. + + After r135082, Chromium browser_tests were triggering the ASSERT in + StyleResolver::collectRulesFromUserStyleSheets. Add an ASSERT that will + trigger earlier and make it clear in the Chromium code that we're always + inserting user level styles. + + * src/WebDocument.cpp: + (WebKit::WebDocument::insertUserStyleSheet): + +2012-11-20 Istiaque Ahmed <lazyboy@chromium.org> + + Provide page/window coordinates to plugin's local coordinates translation in WebPluginContainer. + https://bugs.webkit.org/show_bug.cgi?id=102339 + + Reviewed by Adam Barth. + + This change will allow converting a page's window coordinates to plugins's local coordinates, + taking CSS transformations into account. Embedder page of the plugin can use this information + for targetting elements inside the plugin (e.g. devtools can inspect a specific element at the + local coordinate position inside plugin). + + * WebKit.gyp: + * WebKit.gypi: + * public/WebNode.h: + (WebKit): + * public/WebPluginContainer.h: + (WebKit): + (WebPluginContainer): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeCommand): + (WebKit::WebFrameImpl::printBegin): + (WebKit::WebFrameImpl::isPrintScalingDisabledForPlugin): + * src/WebNode.cpp: + (WebKit::WebNode::pluginContainer): + (WebKit): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::windowToLocalPoint): + (WebKit): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + * tests/FakeWebPlugin.cpp: Added. + (WebKit): + (WebKit::FakeWebPlugin::FakeWebPlugin): + (WebKit::FakeWebPlugin::~FakeWebPlugin): + (WebKit::FakeWebPlugin::initialize): + (WebKit::FakeWebPlugin::destroy): + * tests/FakeWebPlugin.h: Added. + (WebKit): + (FakeWebPlugin): + * tests/WebPluginContainerTest.cpp: Added. + (WebKit): + (WebPluginContainerTest): + (WebKit::WebPluginContainerTest::WebPluginContainerTest): + (WebKit::WebPluginContainerTest::TearDown): + (WebKit::getWebPluginContainer): + (WebKit::TEST_F): + * tests/data/plugin_container.html: Added. + +2012-11-20 Alpha Lam <hclam@chromium.org> + + [chromium] Make lazy image decoding thread-safe + https://bugs.webkit.org/show_bug.cgi?id=102721 + + Reviewed by Stephen White. + + Added a new unit test to verify that lazy image decoding operates + correctly on non-main threads. + + * tests/DeferredImageDecoderTest.cpp: + (Rasterizer): + (WebCore): + (WebCore::rasterizeMain): + (WebCore::TEST_F): + +2012-11-20 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135295. + http://trac.webkit.org/changeset/135295 + https://bugs.webkit.org/show_bug.cgi?id=102834 + + This patch causes assertion to some layout tests on chromium + (Requested by jianli on #webkit). + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::loadRequest): + (WebKit::WebFrameImpl::loadData): + * src/WebSharedWorkerImpl.cpp: + (WebKit::WebSharedWorkerImpl::initializeLoader): + +2012-11-20 Eberhard Graether <egraether@google.com> + + [Chromium] fix FPS counter disappearing when changing page + https://bugs.webkit.org/show_bug.cgi?id=102532 + + Reviewed by Pavel Feldman. + + When changing the page with opened WebInspector and active FPS counter the WebInspector is + reloaded before the WebView switches to accelerated compositing, so the showFPSCounter call + to WebLayerTreeView is not yet possible. This fix saves the showFPSCounter value in the + WebSettings so it can be read when accelerated compositing is activated. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setShowFPSCounter): + +2012-11-20 James Simonsen <simonjam@chromium.org> + + Consolidate FrameLoader::load() into one function taking a FrameLoadRequest + https://bugs.webkit.org/show_bug.cgi?id=102151 + + Reviewed by Adam Barth. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::loadRequest): + (WebKit::WebFrameImpl::loadData): + * src/WebSharedWorkerImpl.cpp: + (WebKit::WebSharedWorkerImpl::initializeLoader): + +2012-11-19 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Fix Chromium Win compilation after r135196. + https://bugs.webkit.org/show_bug.cgi?id=102021 + + * tests/DeferredImageDecoderTest.cpp: changed char to unsigned char in the array + declaration to avoid 'warning C4309' on MSVS when initializing from hex literals. + (WebCore): + +2012-11-19 Miguel Garcia <miguelg@chromium.org> + + [Chromium] Remove the dependency of INPUT_TYPE_COLOR on PAGE_POPUP + https://bugs.webkit.org/show_bug.cgi?id=102525 + + Reviewed by Kent Tamura. + + INPUT_TYPE_COLOR should not depend on PAGE_POPUP, with this change we allow platforms like android to implement the former without depending on the latter. + + Tested by compiling chromium with and without ENABLE_PAGE_POPUP and made sure that forms with input type color would load in both cases. + + * WebKit.gyp: + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::createColorChooser): + * src/ColorChooserUIController.cpp: + (WebKit::ColorChooserUIController::ColorChooserUIController): + (WebKit::ColorChooserUIController::openUI): + (WebKit): + (WebKit::ColorChooserUIController::endChooser): + * src/ColorChooserUIController.h: + (ColorChooserUIController): + +2012-11-19 Alpha Lam <hclam@chromium.org> + + [chromium] Lazy image decoding without cache + https://bugs.webkit.org/show_bug.cgi?id=102021 + + Reviewed by Stephen White. + + Updated two test cases using real image data. + + The tests demonstrates that original image decoder is not used and + image is decoded lazily with correct pixel results. + + * tests/DeferredImageDecoderTest.cpp: + (WebCore): + (WebCore::DeferredImageDecoderTest::SetUp): + (WebCore::DeferredImageDecoderTest::decoderBeingDestroyed): + (DeferredImageDecoderTest): + (WebCore::TEST_F): + * tests/MockImageDecoder.h: + (MockImageDecoderClient): + (WebCore): + (WebCore::MockImageDecoder::MockImageDecoder): + (WebCore::MockImageDecoder::~MockImageDecoder): + (MockImageDecoder): + +2012-11-19 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r135180. + http://trac.webkit.org/changeset/135180 + https://bugs.webkit.org/show_bug.cgi?id=102700 + + breaks ui/compositor build (Requested by danakj on #webkit). + + * tests/GraphicsLayerChromiumTest.cpp: + (WebKit::GraphicsLayerChromiumTest::GraphicsLayerChromiumTest): + +2012-11-19 Yusuke Sato <yusukes@chromium.org> + + [Chromium] Flash cannot receive scroll events when threaded compositing is in use + https://bugs.webkit.org/show_bug.cgi?id=101423 + + Reviewed by James Robinson. + + Add setWantsWheelEvents() to Chromium's WebPluginContainer interface so that a plugin can tell the + container that the plugin always wants to handle wheel events even when a scroll bar is not shown. + + * public/WebPluginContainer.h: + (WebPluginContainer): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::setWantsWheelEvents): + (WebKit): + (WebKit::WebPluginContainerImpl::wantsWheelEvents): + (WebKit::WebPluginContainerImpl::WebPluginContainerImpl): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + +2012-11-19 Alec Flett <alecflett@chromium.org> + + IndexedDB: simplify RecordIdentifier + https://bugs.webkit.org/show_bug.cgi?id=102018 + + Reviewed by Tony Chang. + + Update IDBFakeBackingStore to match its parent class. + + * tests/IDBFakeBackingStore.h: + +2012-11-19 Vincent Scheib <scheib@chromium.org> + + [Chromium] Remove WebKit::WebRuntimeFeatures::enablePointerLock. + https://bugs.webkit.org/show_bug.cgi?id=96946 + + Reviewed by Adam Barth. + + The runtime flag functionality has already been removed. + Now that Chromium no longer has a compile dependency on this + API, it can be removed as well. + + * public/WebRuntimeFeatures.h: + (WebRuntimeFeatures): + * src/WebRuntimeFeatures.cpp: + +2012-11-19 Kihong Kwon <kihong.kwon@samsung.com> + + Add PROXIMITY_EVENTS feature + https://bugs.webkit.org/show_bug.cgi?id=102658 + + Reviewed by Kentaro Hara. + + Add PROXIMITY_EVENTS feature to chromium port. + + * features.gypi: + +2012-11-19 Sami Kyostila <skyostil@chromium.org> + + [chromium] Use devicePixelRatio instead of screen DPI for computing viewport attributes + https://bugs.webkit.org/show_bug.cgi?id=101767 + + Reviewed by Adam Barth. + + Use the newly introduced device scale factor to calculate viewport properties + instead of using the screen DPI. No functional changes, because Chromium + platforms that have VIEWPORT enabled now also initialize the device scale + factor accordingly. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange): + * tests/WebFrameTest.cpp: + +2012-11-18 Kentaro Hara <haraken@chromium.org> + + Unreviewed, rolling out r135047. + http://trac.webkit.org/changeset/135047 + https://bugs.webkit.org/show_bug.cgi?id=102339 + + it broke Chromium Windows/Mac build + + * WebKit.gyp: + * WebKit.gypi: + * public/WebNode.h: + (WebKit): + * public/WebPluginContainer.h: + (WebKit): + (WebPluginContainer): + * src/WebFrameImpl.cpp: + (WebKit::pluginContainerFromNode): + (WebKit): + (WebKit::WebFrameImpl::executeCommand): + (WebKit::WebFrameImpl::printBegin): + (WebKit::WebFrameImpl::isPrintScalingDisabledForPlugin): + * src/WebNode.cpp: + * src/WebPluginContainerImpl.cpp: + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + * tests/FakeWebPlugin.cpp: Removed. + * tests/FakeWebPlugin.h: Removed. + * tests/WebPluginContainerTest.cpp: Removed. + * tests/data/plugin_container.html: Removed. + +2012-11-18 Rick Byers <rbyers@chromium.org> + + [chromium] add WebCursorInfo::imageScaleFactor + https://bugs.webkit.org/show_bug.cgi?id=102612 + + Reviewed by Adam Barth. + + Add cursor image scale factor (currently always 1) to chromium API, in preparation for + high-dpi cursor support in bug 99493. + + * public/WebCursorInfo.h: + (WebKit::WebCursorInfo::WebCursorInfo): + * src/WebCursorInfo.cpp: + (WebKit::WebCursorInfo::WebCursorInfo): + +2012-11-17 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-17 Istiaque Ahmed <lazyboy@chromium.org> + + Provide page/window coordinates to plugin's local coordinates translation in WebPluginContainer. + https://bugs.webkit.org/show_bug.cgi?id=102339 + + Reviewed by Adam Barth. + + This change will allow converting a page's window coordinates to plugins's local coordinates, + taking CSS transformations into account. Embedder page of the plugin can use this information + for targetting elements inside the plugin (e.g. devtools can inspect a specific element at the + local coordinate position inside plugin). + Attempting to re-land after Windows build fix. + + * WebKit.gyp: + * WebKit.gypi: + * public/WebNode.h: + (WebKit): + * public/WebPluginContainer.h: + (WebKit): + (WebPluginContainer): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeCommand): + (WebKit::WebFrameImpl::printBegin): + (WebKit::WebFrameImpl::isPrintScalingDisabledForPlugin): + * src/WebNode.cpp: + (WebKit::WebNode::pluginContainer): + (WebKit): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::windowToLocalPoint): + (WebKit): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + * tests/FakeWebPlugin.cpp: Added. + (WebKit): + (WebKit::FakeWebPlugin::FakeWebPlugin): + (WebKit::FakeWebPlugin::~FakeWebPlugin): + (WebKit::FakeWebPlugin::initialize): + (WebKit::FakeWebPlugin::destroy): + * tests/FakeWebPlugin.h: Added. + (WebKit): + (FakeWebPlugin): + * tests/WebPluginContainerTest.cpp: Added. + (WebKit): + (WebPluginContainerTest): + (WebKit::WebPluginContainerTest::WebPluginContainerTest): + (WebKit::WebPluginContainerTest::TearDown): + (WebKit::getWebPluginContainer): + (WebKit::TEST_F): + * tests/data/plugin_container.html: Added. + +2012-11-16 Raman Kumar <ramankk@chromium.org> + + Add setChecked API in WebInputElement + https://bugs.webkit.org/show_bug.cgi?id=102422 + + Reviewed by Adam Barth. + + * public/WebInputElement.h: + (WebInputElement): Add setChecked(bool, bool) API + * src/WebInputElement.cpp: + (WebKit::WebInputElement::setChecked): Implement setChecked by calling + underlying HTMLInputElement's setChecked. + (WebKit): + +2012-11-16 Tony Chang <tony@chromium.org> + + Remove ENABLE_CSS_HIERARCHIES since it's no longer in use + https://bugs.webkit.org/show_bug.cgi?id=102554 + + Reviewed by Andreas Kling. + + As mentioned in https://bugs.webkit.org/show_bug.cgi?id=79939#c41 , + we're going to revist this feature once additional vendor support is + achieved. + + * features.gypi: + +2012-11-16 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Remove cookie-related functions from PlatformSupport + https://bugs.webkit.org/show_bug.cgi?id=99340 + + Reviewed by Adam Barth. + + Move cookie-related functions out of PlatformSupport and implement + new PlatformCookieJar interface via NetworkContext. + + * WebKit.gyp: + * src/FrameNetworkingContextImpl.cpp: Added. + (WebKit): + (WebKit::FrameNetworkingContextImpl::cookieJar): + * src/FrameNetworkingContextImpl.h: + (FrameNetworkingContextImpl): + * src/PlatformSupport.cpp: + +2012-11-16 Tien-Ren Chen <trchen@chromium.org> + + Rename applyDefaultDeviceScaleFactorInCompositor to setApplyDeviceScaleFactorInCompositor + https://bugs.webkit.org/show_bug.cgi?id=102462 + + Reviewed by James Robinson. + + As we no longer have this "default" device scale factor. + + * public/WebSettings.h: + (WebKit::WebSettings::setApplyDefaultDeviceScaleFactorInCompositor): + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::WebSettingsImpl): + (WebKit::WebSettingsImpl::setApplyDeviceScaleFactorInCompositor): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::applyDeviceScaleFactorInCompositor): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setDeviceScaleFactor): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + +2012-11-16 Jon Lee <jonlee@apple.com> + + Fix build error on Chromium due to r134995. + + * src/WebNode.cpp: + (WebKit::WebNode::simulateClick): Pass in NULL pointer instead. + +2012-11-16 Michael Pruett <michael@68k.org> + + IndexedDB: Propagate DOMRequestState to IndexedDB binding utility functions + https://bugs.webkit.org/show_bug.cgi?id=102430 + + Reviewed by Adam Barth. + + DOMRequestState is currently propagated to some but not all of + the IndexedDB binding utility functions. In order to implement + these functions for JSC, this state must be propagated to all + of the utility functions. + + * tests/IDBBindingUtilitiesTest.cpp: + (WebKit::checkKeyFromValueAndKeyPathInternal): + (WebKit::injectKey): + +2012-11-16 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Update RTCPeerConnection states to match the latest editors draft + https://bugs.webkit.org/show_bug.cgi?id=102382 + + Reviewed by Adam Barth. + + Updating readyState & iceState, and adding iceGatheringState. + + * src/AssertMatchingEnums.cpp: + +2012-11-16 Dimitri Glazkov <dglazkov@chromium.org> + + Unreviewed, rolling out r134973. + http://trac.webkit.org/changeset/134973 + https://bugs.webkit.org/show_bug.cgi?id=99340 + + Broke compile on at least Mac and Linux. + + * WebKit.gyp: + * src/FrameNetworkingContextImpl.h: + * src/PlatformSupport.cpp: + (WebCore::getCookieJar): + (WebCore): + (WebCore::PlatformSupport::setCookies): + (WebCore::PlatformSupport::cookies): + (WebCore::PlatformSupport::cookieRequestHeaderFieldValue): + (WebCore::PlatformSupport::rawCookies): + (WebCore::PlatformSupport::deleteCookie): + (WebCore::PlatformSupport::cookiesEnabled): + +2012-11-16 Mark Pilgrim <pilgrim@chromium.org> + + [Chromium] Remove cookie-related functions from PlatformSupport + https://bugs.webkit.org/show_bug.cgi?id=99340 + + Reviewed by Adam Barth. + + Move cookie-related functions out of PlatformSupport and implement + new PlatformCookieJar interface via NetworkContext. + + * WebKit.gyp: + * src/FrameNetworkingContextImpl.cpp: Added. + (WebKit): + (WebKit::FrameNetworkingContextImpl::cookieJar): + * src/FrameNetworkingContextImpl.h: + (FrameNetworkingContextImpl): + * src/PlatformSupport.cpp: + +2012-11-16 Scott Violet <sky@chromium.org> + + [chromium] Copy linux theme related files to default + https://bugs.webkit.org/show_bug.cgi?id=102403 + + Reviewed by Tony Chang + + Transitional patch that copies linux WebThemeEngine to default directory. + + No new tests, refactoring only. + + * features.gypi: + * public/platform/default: Added. + * public/platform/default/WebThemeEngine.h: Copied from Source/WebKit/chromium/public/platform/linux/WebThemeEngine.h. + * src/PlatformSupport.cpp: Includes correct theme files when DEFAULT_RENDER_THEME is set. + (WebCore): + * src/WebViewImpl.cpp: Includes correct theme files when DEFAULT_RENDER_THEME is set. + (WebKit::WebViewImpl::setScrollbarColors): Calls to default theme as necessary. + (WebKit::WebViewImpl::setSelectionColors): Calls to default theme as necessary. + +2012-11-16 Robert Flack <flackr@chromium.org> + + Handle gesture events on scrollbars. + https://bugs.webkit.org/show_bug.cgi?id=101516 + + Reviewed by Antonio Gomes. + + Adds a gesture event handler to scrollbars and sends gestures beginning + over a scrollbar to this handler to allow touch scrolling scrollbars. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::handleGestureEvent): + +2012-11-16 Peter Beverloo <peter@chromium.org> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-15 Kentaro Hara <haraken@chromium.org> + + Unreviewed, rolling out r134880. + http://trac.webkit.org/changeset/134880 + https://bugs.webkit.org/show_bug.cgi?id=102339 + + it broke Chromium Windows build + + * WebKit.gyp: + * WebKit.gypi: + * public/WebNode.h: + (WebKit): + * public/WebPluginContainer.h: + (WebKit): + (WebPluginContainer): + * src/WebFrameImpl.cpp: + (WebKit::pluginContainerFromNode): + (WebKit): + (WebKit::WebFrameImpl::executeCommand): + (WebKit::WebFrameImpl::printBegin): + (WebKit::WebFrameImpl::isPrintScalingDisabledForPlugin): + * src/WebNode.cpp: + * src/WebPluginContainerImpl.cpp: + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + * tests/FakeWebPlugin.cpp: Removed. + * tests/FakeWebPlugin.h: Removed. + * tests/WebPluginContainerTest.cpp: Removed. + * tests/data/plugin_container.html: Removed. + +2012-11-15 Istiaque Ahmed <lazyboy@chromium.org> + + Provide page/window coordinates to plugin's local coordinates translation in WebPluginContainer. + https://bugs.webkit.org/show_bug.cgi?id=102339 + + Reviewed by Adam Barth. + + This change will allow converting a page's window coordinates to plugins's local coordinates, + taking CSS transformations into account. Embedder page of the plugin can use this information + for targetting elements inside the plugin (e.g. devtools can inspect a specific element at the + local coordinate position inside plugin). + + * WebKit.gyp: + * WebKit.gypi: + * public/WebNode.h: + (WebKit): + * public/WebPluginContainer.h: + (WebKit): + (WebPluginContainer): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::executeCommand): + (WebKit::WebFrameImpl::printBegin): + (WebKit::WebFrameImpl::isPrintScalingDisabledForPlugin): + * src/WebNode.cpp: + (WebKit::WebNode::pluginContainer): + (WebKit): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::windowToLocalPoint): + (WebKit): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + * tests/FakeWebPlugin.cpp: Added. + (WebKit): + (WebKit::FakeWebPlugin::FakeWebPlugin): + (WebKit::FakeWebPlugin::~FakeWebPlugin): + (WebKit::FakeWebPlugin::initialize): + (WebKit::FakeWebPlugin::destroy): + * tests/FakeWebPlugin.h: Added. + (WebKit): + (FakeWebPlugin): + * tests/WebPluginContainerTest.cpp: Added. + (WebKit): + (WebPluginContainerTest): + (WebKit::WebPluginContainerTest::WebPluginContainerTest): + (WebKit::WebPluginContainerTest::TearDown): + (WebKit::getWebPluginContainer): + (WebKit::TEST_F): + * tests/data/plugin_container.html: Added. + +2012-11-15 Tien-Ren Chen <trchen@chromium.org> + + Add Settings to disable custom scrollbars on main frame + https://bugs.webkit.org/show_bug.cgi?id=102323 + + Reviewed by Adam Barth. + + Custom scrollbars on main frame don't really work well on touch devices. + Add a setting to inhibit their creation. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAllowCustomScrollbarInMainFrame): + (WebKit): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + +2012-11-15 Yue Zhang <zysxqn@google.com> + + Ignore autocomplete=off for chrome generated passwords. + https://bugs.webkit.org/show_bug.cgi?id=102426 + + Reviewed by Adam Barth. + + Record the autocomplete attribute in the web password form data, + so that we can handle autocomplete in chromium code. The + motivation/background is: we should ignore autocomplete=off field + for password forms with chrome generated passwords (has passed + security review). By handling autocomplete in chromium code we can + distinguish password forms with chrome generated passwords and + those normal password forms. Note that we haven't turned off + checking autocomplete=off in the Webkit code for now so there is + no behavior change after this CL, and we will turn off after we + make the chromium side change to be safe. + + * public/WebPasswordFormData.h: + (WebPasswordFormData): + * src/WebPasswordFormData.cpp: + +2012-11-15 Scott Violet <sky@chromium.org> + + [chromium] Create default directory so that cq can apply patch + https://bugs.webkit.org/show_bug.cgi?id=102421 + + Reviewed by Tony Chang. + + Done in hopes of patch that copies files to this directory working. + + * public/platform/default: Added. + +2012-11-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r134800 and r134805. + http://trac.webkit.org/changeset/134800 + http://trac.webkit.org/changeset/134805 + https://bugs.webkit.org/show_bug.cgi?id=102417 + + This patch broke chromium port (Requested by jianli on + #webkit). + + * src/AssertMatchingEnums.cpp: + +2012-11-15 Sadrul Habib Chowdhury <sadrul@chromium.org> + + [chromium] Do not mark an event (mouse wheel, scroll update) as handled if nothing was scrolled. + https://bugs.webkit.org/show_bug.cgi?id=102246 + + Reviewed by James Robinson. + + * src/WebCompositorInputHandlerImpl.cpp: + (WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal): + * tests/WebCompositorInputHandlerImplTest.cpp: + (MockWebInputHandlerClient): + (WebKit::TEST_F): + +2012-11-15 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Update RTCPeerConnection states to match the latest editors draft + https://bugs.webkit.org/show_bug.cgi?id=102382 + + Reviewed by Adam Barth. + + Updating readyState & iceState, and adding iceGatheringState. + + * src/AssertMatchingEnums.cpp: + +2012-11-15 Tien-Ren Chen <trchen@chromium.org> + + Use correct unscaled document size when calculating scale limits + https://bugs.webkit.org/show_bug.cgi?id=102028 + + Reviewed by Adam Barth. + + Fixes bug http://crbug.com/160581 + Using contentsSize / pageScaleFactor as unscaled contents size results + in rounding errors. This can cause scale factor to oscillate indefinitely. + + * src/WebViewImpl.cpp: + (WebKit::unscaledContentsSize): + (WebKit): + (WebKit::WebViewImpl::computePageScaleFactorLimits): + * tests/WebFrameTest.cpp: + * tests/data/scale_oscillate.html: Added. + +2012-11-15 Kenneth Russell <kbr@google.com> + + [chromium] Move allowWebGL query to WebFrameClient + https://bugs.webkit.org/show_bug.cgi?id=102319 + + Reviewed by Adam Barth. + + Moved allowWebGL query to WebFrameClient to avoid polluting + content/ API. + + * public/WebFrameClient.h: + (WebFrameClient): + (WebKit::WebFrameClient::allowWebGL): + * public/WebPermissionClient.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::allowWebGL): + +2012-11-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-15 Stephen Chenney <schenney@chromium.org> + + [Chromium] Move SK_DISABLE_FAST_AA_STROKE_RECT to skia_webkit.gyp + + Unreviewed non-funtional, behavior-neutral change + + * skia_webkit.gyp: Add SK_DISABLE_FAST_AA_STROKE_RECT=1 so that it can be removed from Chromium's skia.gyp + +2012-11-15 Stephen Chenney <schenney@chromium.org> + + [Chromium] Disable SK_IGNORE_FAST_BLURRECT + + Unreviewed test update. + + This flag is enabled purely to simplify rebaselining. I am now + removing it and doing the rebaslining. + + * skia_webkit.gyp: Remove the line for SK_IGNORE_FAST_BLURRECT + +2012-11-15 Kent Tamura <tkent@chromium.org> + + Support stand-alone month names in calendar picker + https://bugs.webkit.org/show_bug.cgi?id=102196 + + Reviewed by Kentaro Hara. + + * src/DateTimeChooserImpl.cpp: + (WebKit::DateTimeChooserImpl::writeDocument): + We don't need to pass monthLabels any more. + +2012-11-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-14 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Remove magic numbers in record comparator, handle missing case + https://bugs.webkit.org/show_bug.cgi?id=102255 + + Reviewed by Tony Chang. + + Add test keys for various metadata types. + + * tests/IDBLevelDBCodingTest.cpp: + (IDBLevelDBCoding::TEST): + +2012-11-14 Eric Uhrhane <ericu@chromium.org> + + [chromium] Don't let shift-click turn popup into tab. + https://bugs.webkit.org/show_bug.cgi?id=102254 + + Reviewed by Adam Barth. + + Change http://trac.webkit.org/changeset/132399 broke shift-click on + compose in GMail. We didn't want to change behavior that people were + depending on, and this quick fix seems a good compromise between user + intent and developer intent. + + * src/ChromeClientImpl.cpp: + (WebKit::updatePolicyForEvent): + +2012-11-14 Mike Reed <reed@google.com> + + Dynamically create canvas in Setup() to avoid calling DEPRECATED function setDevice(). + https://bugs.webkit.org/show_bug.cgi?id=102242 + + Reviewed by Stephen White. + + This change should not change any test results, it is an equivalent implementation that avoids + using a (now) DEPRECATED function. + + * tests/DeferredImageDecoderTest.cpp: + (WebCore::createRasterCanvas): + (WebCore): + (WebCore::DeferredImageDecoderTest::SetUp): + (DeferredImageDecoderTest): + (WebCore::TEST_F): + +2012-11-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r134523. + http://trac.webkit.org/changeset/134523 + https://bugs.webkit.org/show_bug.cgi?id=102218 + + brake chrome windows build, as it references a non existing + header js/DOMRequestState.h (Requested by jochen__ on + #webkit). + + * src/WebIDBKey.cpp: + +2012-11-14 Kent Tamura <tkent@chromium.org> + + Support for localization tests of calendar picker + https://bugs.webkit.org/show_bug.cgi?id=102181 + + Reviewed by Kentaro Hara. + + * src/DateTimeChooserImpl.cpp: + Use DateTimeChooserParameters::locale. + (WebKit::DateTimeChooserImpl::DateTimeChooserImpl): + (WebKit::DateTimeChooserImpl::writeDocument): + +2012-11-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r134566. + http://trac.webkit.org/changeset/134566 + https://bugs.webkit.org/show_bug.cgi?id=102197 + + "it broke Chromium Android Release build" (Requested by + haraken on #webkit). + + * src/DateTimeChooserImpl.cpp: + (WebKit::DateTimeChooserImpl::DateTimeChooserImpl): + (WebKit::DateTimeChooserImpl::writeDocument): + +2012-11-14 Kent Tamura <tkent@chromium.org> + + Support for localization tests of calendar picker + https://bugs.webkit.org/show_bug.cgi?id=102181 + + Reviewed by Kentaro Hara. + + * src/DateTimeChooserImpl.cpp: + Use DateTimeChooserParameters::locale. + (WebKit::DateTimeChooserImpl::DateTimeChooserImpl): + (WebKit::DateTimeChooserImpl::writeDocument): + +2012-11-14 Yury Semikhatsky <yurys@chromium.org> + + Remove MemoryInstrumentationTest.ImageObserver + https://bugs.webkit.org/show_bug.cgi?id=102185 + + Reviewed by Pavel Feldman. + + Removed obsolete memory instrumenation unit test. + + * WebKit.gypi: + * tests/MemoryInstrumentationTest.cpp: Removed. + +2012-11-14 Kent Tamura <tkent@chromium.org> + + [Chromium] Add API to expose WebCore::DateTimeChooser + https://bugs.webkit.org/show_bug.cgi?id=101196 + + Reviewed by Hajime Morita. + + Add ability to open date/time choosers to WebViewClient. + + - ExternalDateTimeChooser forwards DateTimeChooser requests from WebCore + to WebViewClient, and waits for WebDateTimeChooerCompletion notifications. + - WebDateTimeChooserParams contains various information to create + chooser UI. + - WebDateTimeChooserCompletion informs value selection by users to + ExternalDateTimeChooser. + + The design is very similar to existing WebFileChooserParams and + WebFileChooserCompletion. + + These interfaces are used only if ENABLE_INPUT_MULTIPLE_FIELDS_UI is not + enabled, that is to say, in Chromium-Android port. Non-Android Chromium + ports use DateTimeChooserImpl and WebKit-internal choosers. + + * WebKit.gyp: Add WebDateTimeChooserCompletion.h, + WebDateTimeChooserParams.h, ExternalDateTimeChooser.cpp, and + ExternalDateTimeChooser.h. + * public/WebDateTimeChooserCompletion.h: Added. + (WebDateTimeChooserCompletion): + (WebKit::WebDateTimeChooserCompletion::~WebDateTimeChooserCompletion): + * public/WebDateTimeChooserParams.h: Added. + (WebDateTimeChooserParams): + (WebKit::WebDateTimeChooserParams::WebDateTimeChooserParams): + * public/WebViewClient.h: + (WebKit): Add some forward declarations. + (WebKit::WebViewClient::openDateTimeChooser): Added. + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::openDateTimeChooser): + Creates ExternalDateTimeChooser if !ENABLE(INPUT_MULTIPLE_FIELDS_UI). + * src/ExternalDateTimeChooser.cpp: Added. + (WebDateTimeChooserCompletionImpl): An implementation of + WebDateTimeChooserCompletion. When didChooseValue or didCancelChooser is + called, it notifies to an ExternalDateTimeChooser and kill itself. + (WebKit::ExternalDateTimeChooser::~ExternalDateTimeChooser): Added. + (WebKit::ExternalDateTimeChooser::ExternalDateTimeChooser): Added. + (WebKit::ExternalDateTimeChooser::create): + Cretes an object, then asks the WebViewClient to open date/time chooser. + If an open request fails, an empty PassRefPtr<> is returned. + We don't ask to open in the constructor because open requests might fail + and it's hard for the constructor to tell the failure. + (WebKit::ExternalDateTimeChooser::openDateTimeChooser): Prepares a + WebDateTimeChooserParams and a WebDateTimeChooserCompletion, calls + WebViewClient::openDateTimeChooser, and kill the + WebDateTimeChooserCompletion if openDateTimeChooser fails. + (WebKit::ExternalDateTimeChooser::didChooseValue): + Called by WebDateTimeChooserCompletion. + We need to check m_client because the requester is already dead. + (WebKit::ExternalDateTimeChooser::didCancelChooser): Ditto. + (WebKit::ExternalDateTimeChooser::endChooser): + Called by the requester when it wants to close the chooser. + We don't close the chooser here, and just disconnect the association of + the client and this object. + * src/ExternalDateTimeChooser.h: Added. + +2012-11-13 Vincent Scheib <scheib@chromium.org> + + Remove RuntimeEnabledFeatures::isPointerLockEnabled. + https://bugs.webkit.org/show_bug.cgi?id=102107 + + Reviewed by Adam Barth. + + The runtime flag is always true now that the feature is enabled by default in Chromium. + + * public/WebRuntimeFeatures.h: + (WebRuntimeFeatures): + * src/WebRuntimeFeatures.cpp: + (WebKit): + (WebKit::WebRuntimeFeatures::enablePointerLock): + +2012-11-13 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-11-13 Dana Jansens <danakj@chromium.org> + + [chromium] Pass showDebugBorders directly to WebLayerTreeSettings, don't use the GraphicsLayer border width setting. + https://bugs.webkit.org/show_bug.cgi?id=102130 + + Reviewed by James Robinson. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit): + +2012-11-13 Keishi Hattori <keishi@webkit.org> + + Enable datalist UI for input types week and month + https://bugs.webkit.org/show_bug.cgi?id=102041 + + Reviewed by Kent Tamura. + + * src/DateTimeChooserImpl.cpp: + (WebKit::DateTimeChooserImpl::writeDocument): If the type supports calendar picker show the "Other..." option. + +2012-11-13 Eberhard Graether <egraether@google.com> + + checkbox to toggle FPS counter in the inspector's settings + https://bugs.webkit.org/show_bug.cgi?id=99660 + + Reviewed by Pavel Feldman. + + Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true. + + * public/WebView.h: + (WebView): + * src/InspectorClientImpl.cpp: + (WebKit::InspectorClientImpl::canShowFPSCounter): + (WebKit): + (WebKit::InspectorClientImpl::setShowFPSCounter): + * src/InspectorClientImpl.h: + (InspectorClientImpl): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setShowFPSCounter): + (WebKit): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::loadFontAtlasIfNecessary): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-11-13 Dana Jansens <danakj@chromium.org> + + [chromium] Plumb WebCompositorSupport settings through WebLayerTreeSettings as well, in preparation for removing the settings from WebCompositorSupport + https://bugs.webkit.org/show_bug.cgi?id=102146 + + Reviewed by James Robinson. + + Add accelerated animation and per-tile painting to the WebSettings structure. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAcceleratedAnimationEnabled): + (WebKit): + (WebKit::WebSettingsImpl::setPerTilePaintingEnabled): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::gestureTapHighlightEnabled): + (WebKit::WebSettingsImpl::doubleTapToZoomEnabled): + (WebKit::WebSettingsImpl::perTilePaintingEnabled): + (WebKit::WebSettingsImpl::acceleratedAnimationEnabled): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit): + +2012-11-13 Kenneth Russell <kbr@google.com> + + Notify embedder of lost contexts and allow overriding of WebGL support + https://bugs.webkit.org/show_bug.cgi?id=101826 + + Reviewed by Adam Barth. + + Expose new FrameLoaderClient hooks through Chromium's + WebPermissionClient and WebFrameClient. Downstream browser tests + will exercise this new functionality. + + * public/WebFrameClient.h: + (WebFrameClient): + (WebKit::WebFrameClient::didLoseWebGLContext): + * public/WebPermissionClient.h: + (WebPermissionClient): + (WebKit::WebPermissionClient::allowWebGL): + * src/FrameLoaderClientImpl.cpp: + (WebKit): + (WebKit::FrameLoaderClientImpl::allowWebGL): + (WebKit::FrameLoaderClientImpl::didLoseWebGLContext): + * src/FrameLoaderClientImpl.h: + (FrameLoaderClientImpl): + +2012-11-13 Chris Fleizach <cfleizach@apple.com> + + AX: MathML types need to be semantically identified in AX tree + https://bugs.webkit.org/show_bug.cgi?id=101263 + + Reviewed by Beth Dakin. + + * public/WebAccessibilityRole.h: + * src/AssertMatchingEnums.cpp: + Add new accessibility role. + +2012-11-13 Silvia Pfeiffer <silviapf@chromium.org> + + Clean up the inheritance tree under the MediaControls Class. + https://bugs.webkit.org/show_bug.cgi?id=88871 + + Reviewed by Eric Carlson. + + This patch removes code duplication between the Chromium and Safari + media controls shadow DOMs. + The derived classes are renamed based on their platform: + - MediaControlRootElement to MediaControlsApple. + - MediaControlRootElementChromium to MediaControlsChromium. + - MediaControlRootElementChromiumAndroid to MediaControlsChromiumAndroid. + + * public/WebContextMenuData.h: + Move MediaControlRootElement to MediaControls. + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + Move MediaControlRootElement to MediaControls. + +2012-11-13 Dimitri Glazkov <dglazkov@chromium.org> + + Unreviewed, rolling out r134446. + http://trac.webkit.org/changeset/134446 + https://bugs.webkit.org/show_bug.cgi?id=101968 + + Need to try a different strategy for landing a two-sided patch + (3/3). + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::gestureTapHighlightEnabled): + (WebKit::WebSettingsImpl::doubleTapToZoomEnabled): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit): + +2012-11-13 Dan Carney <dcarney@google.com> + + [V8] More efficient wrapper dispatch + https://bugs.webkit.org/show_bug.cgi?id=102082 + + Reviewed by Adam Barth. + + * src/WebArrayBuffer.cpp: + (WebKit::WebArrayBuffer::toV8Value): + * src/WebBlob.cpp: + (WebKit::WebBlob::toV8Value): + +2012-11-12 Dana Jansens <danakj@chromium.org> + + [chromium] Remove the WebCompositorSupport methods for changing settings, plumb everything through WebLayerTreeSettings + https://bugs.webkit.org/show_bug.cgi?id=101968 + + Reviewed by James Robinson. + + This adds perTilePainting and acceleratedAniamtions to the WebSettings + classes, so that DRT can turn these on via WebLayerTreeSettings. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAcceleratedAnimationEnabled): + (WebKit): + (WebKit::WebSettingsImpl::setPerTilePaintingEnabled): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + (WebKit::WebSettingsImpl::gestureTapHighlightEnabled): + (WebKit::WebSettingsImpl::doubleTapToZoomEnabled): + (WebKit::WebSettingsImpl::perTilePaintingEnabled): + (WebKit::WebSettingsImpl::acceleratedAnimationEnabled): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit): + +2012-11-13 Alec Flett <alecflett@chromium.org> + + IndexedDB: remove legacy string-based backend methods + https://bugs.webkit.org/show_bug.cgi?id=102004 + + Reviewed by Adam Barth. + + This is the final stage in a refactor, preceded by + https://bugs.webkit.org/show_bug.cgi?id=100426 + + * public/WebIDBDatabase.h: + (WebKit::WebIDBDatabase::createObjectStore): + * public/WebIDBObjectStore.h: + (WebKit::WebIDBObjectStore::createIndex): + (WebKit::WebIDBObjectStore::index): + * public/WebIDBTransaction.h: + * src/IDBDatabaseBackendProxy.cpp: + * src/IDBDatabaseBackendProxy.h: + (IDBDatabaseBackendProxy): + * src/IDBTransactionBackendProxy.cpp: + * src/IDBTransactionBackendProxy.h: + (IDBTransactionBackendProxy): + +2012-11-13 Dimitri Glazkov <dglazkov@chromium.org> + + Unreviewed, rolling out r134391. + http://trac.webkit.org/changeset/134391 + https://bugs.webkit.org/show_bug.cgi?id=99660 + + Speculative rollout, trying to fix browser_tests failure. + + * public/WebView.h: + (WebView): + * src/InspectorClientImpl.cpp: + * src/InspectorClientImpl.h: + (InspectorClientImpl): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-11-13 Ilya Tikhonovsky <loislo@chromium.org> + + Unreviewed: temporary disable failing test. + + * tests/MemoryInstrumentationTest.cpp: + +2012-11-13 Eberhard Graether <egraether@google.com> + + checkbox to toggle FPS counter in the inspector's settings + https://bugs.webkit.org/show_bug.cgi?id=99660 + + Reviewed by Pavel Feldman. + + Added a checkbox to the inspector's settings to toggle a FPS counter. The checkbox appears when InspectorClient::canShowFPSCounter() returns true. + + * public/WebView.h: + (WebView): + * src/InspectorClientImpl.cpp: + (WebKit::InspectorClientImpl::canShowFPSCounter): + (WebKit): + (WebKit::InspectorClientImpl::setShowFPSCounter): + * src/InspectorClientImpl.h: + (InspectorClientImpl): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setShowFPSCounter): + (WebKit): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::loadFontAtlasIfNecessary): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-11-12 Kent Tamura <tkent@chromium.org> + + Unable to set valid time value to input[type=time] with user interaction in some cases + https://bugs.webkit.org/show_bug.cgi?id=102048 + + Reviewed by Kentaro Hara. + + * tests/DecimalTest.cpp: + (TEST_F): Update and add tests. + 2.1 % 3 should be 2.1 + 10 % -3 should be 1 + -10 % -3 should be -1 + 3.6 % 1.3 should be 1 + 500 % 1000 should be 500 + -500 % 1000 should be -500 + +2012-11-12 Min Qin <qinmin@chromium.org> + + Fix windowRect calculation for webplugin due to page scale factors + https://bugs.webkit.org/show_bug.cgi?id=100182 + + Reviewed by Adam Barth. + + The current calculaton of windowRect in WebPluginContainerImpl is wrong. Even after some of our latest changes. + The problem is caused by page scale factor. + For example, windowToContents(IntPoint) will return an unscaled offset for an iframe, but will return a scaled offset for the main frame. So in order to obtain the correct window coordinate, we need to use contentsToWindow(). + Since webview_plugin.cc is expecting window coordinates, we need to use contentsToWindow(IntRect) to calculate the windowRect so that the rect size can get correctly scaled. + It is difficult to write a test for this because it's pixel-based, and plugin placeholder is managed on the Chromium side (webview_plugin.cc). + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::paint): + +2012-11-12 Adam Barth <abarth@webkit.org> + + Unreviewed. Roll Chromium DEPS. + +2012-11-12 Stephen Chenney <schenney@chromium.org> + + [chromium] Supressing a Skia change to prevent layout test breakage. + + Unreviewed expectations management. + + * skia_webkit.gyp: Added supression 'SK_IGNORE_FAST_BLURRECT=1' + +2012-11-12 Alexandre Elias <aelias@chromium.org> + + [chromium] Delete WebCompositor.h + https://bugs.webkit.org/show_bug.cgi?id=101137 + + Reviewed by James Robinson. + + The implementation of this class is getting deleted and all + WebKit-side users are already going via WebCompositorSupport instead. + + * tests/WebCompositorInputHandlerImplTest.cpp: + +2012-11-12 Dirk Pranke <dpranke@chromium.org> + + Fix Chromium DEPS version after accidentally checking in HEAD a couple days ago. + + Unreviewed, build fix. + + * DEPS: + +2012-11-12 Keishi Hattori <keishi@webkit.org> + + Add support for week/month to Locale::formatDateTime() + https://bugs.webkit.org/show_bug.cgi?id=101878 + + Reviewed by Kent Tamura. + + * tests/LocaleMacTest.cpp: + (LocaleMacTest::formatWeek): Takes ISO string and returns localized string. + (LocaleMacTest): + (LocaleMacTest::formatMonth): Ditto. + (TEST_F): + +2012-11-11 Sadrul Habib Chowdhury <sadrul@chromium.org> + + [chromium] Expose CustomEvent through WebDOMCustomEvent. + https://bugs.webkit.org/show_bug.cgi?id=101293 + + Reviewed by Adam Barth. + + * WebKit.gyp: + * public/WebDOMCustomEvent.h: Added. + (WebKit): + (WebDOMCustomEvent): + (WebKit::WebDOMCustomEvent::WebDOMCustomEvent): + * src/WebDOMCustomEvent.cpp: Added. + (WebKit): + (WebKit::WebDOMCustomEvent::initCustomEvent): + +2012-11-09 Rick Byers <rbyers@chromium.org> + + Move chromium to USE(LAZY_NATIVE_CURSOR) + https://bugs.webkit.org/show_bug.cgi?id=101501 + + Reviewed by Adam Barth. + + Update conversion from Cursor to WebCursorInfo to remove the + intermediate (and useless) step of PlatformCursor. + + * src/AssertMatchingEnums.cpp: + * src/WebCursorInfo.cpp: + (WebKit::WebCursorInfo::WebCursorInfo): + +2012-11-09 Alec Flett <alecflett@chromium.org> + + IndexedDB: Combine IDBBackingStore and IDBLevelDBBackingStore + https://bugs.webkit.org/show_bug.cgi?id=101415 + + Reviewed by Tony Chang. + + Remove method that is no longer in the base class. + + * tests/IDBFakeBackingStore.h: + +2012-11-09 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r134101. + http://trac.webkit.org/changeset/134101 + https://bugs.webkit.org/show_bug.cgi?id=101790 + + IDBDatabaseBackendTest.BackingStoreRetention failing + (Requested by jsbell|gardener on #webkit). + + * tests/IDBFakeBackingStore.h: + +2012-11-09 Alec Flett <alecflett@chromium.org> + + IndexedDB: Combine IDBBackingStore and IDBLevelDBBackingStore + https://bugs.webkit.org/show_bug.cgi?id=101415 + + Reviewed by Tony Chang. + + Remove method that is no longer in the base class. + + * tests/IDBFakeBackingStore.h: + +2012-11-09 Alec Flett <alecflett@chromium.org> + + IndexedDB: switch frontend to use int64_t-based references + https://bugs.webkit.org/show_bug.cgi?id=100426 + + Reviewed by Tony Chang. + + Remove implementation stubs from chromium API for + methods obsoleted by https://bugs.webkit.org/show_bug.cgi?id=100425 + + * src/IDBObjectStoreBackendProxy.cpp: + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + (WebIDBDatabaseImpl): + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + +2012-11-09 Tommy Widenflycht <tommyw@google.com> + + MediaStream API: Deleting all files relating to the deprecated PeerConnection00 + https://bugs.webkit.org/show_bug.cgi?id=101730 + + Reviewed by Adam Barth. + + Since RTCPeerConenction has superseeded PeerConnection00 this patch removes all + files relating to the old API. + + * WebKit.gyp: + * public/WebRuntimeFeatures.h: + (WebRuntimeFeatures): + * public/platform/WebICECandidateDescriptor.h: Removed. + * public/platform/WebICEOptions.h: Removed. + * public/platform/WebMediaHints.h: Removed. + * public/platform/WebPeerConnection00Handler.h: Removed. + * public/platform/WebPeerConnection00HandlerClient.h: Removed. + * public/platform/WebPeerConnectionHandler.h: Removed. + * public/platform/WebPeerConnectionHandlerClient.h: Removed. + * public/platform/WebSessionDescriptionDescriptor.h: Removed. + * src/AssertMatchingEnums.cpp: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::isPeerConnectionEnabled): + * src/WebSessionDescriptionDescriptor.cpp: Removed. + +2012-11-08 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r134010. + http://trac.webkit.org/changeset/134010 + https://bugs.webkit.org/show_bug.cgi?id=101716 + + Broke the chromium windows build. (Requested by noel_ on + #webkit). + + * src/IDBCallbacksProxy.cpp: + * src/IDBDatabaseBackendProxy.cpp: + (WebKit::IDBDatabaseBackendProxy::transaction): + (WebKit): + * src/IDBDatabaseBackendProxy.h: + (IDBDatabaseBackendProxy): + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::putWithIndexKeys): + (WebKit): + (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::deleteObjectStore): + (WebKit): + (WebKit::WebIDBDatabaseImpl::transaction): + * src/WebIDBDatabaseImpl.h: + (WebIDBDatabaseImpl): + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::putWithIndexKeys): + (WebKit): + (WebKit::WebIDBObjectStoreImpl::setIndexKeys): + (WebKit::WebIDBObjectStoreImpl::setIndexesReady): + (WebKit::WebIDBObjectStoreImpl::index): + (WebKit::WebIDBObjectStoreImpl::deleteIndex): + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + * src/WebIDBTransactionImpl.cpp: + (WebKit::WebIDBTransactionImpl::objectStore): + (WebKit): + * src/WebIDBTransactionImpl.h: + * tests/IDBRequestTest.cpp: + +2012-11-08 Alec Flett <alecflett@chromium.org> + + IndexedDB: switch frontend to use int64_t-based references + https://bugs.webkit.org/show_bug.cgi?id=100426 + + Reviewed by Tony Chang. + + Remove implementation stubs from chromium API for + methods obsoleted by https://bugs.webkit.org/show_bug.cgi?id=100425 + + * src/IDBObjectStoreBackendProxy.cpp: + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + (WebIDBDatabaseImpl): + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + +2012-11-08 Keishi Hattori <keishi@webkit.org> + + WebPagePopupImpl::handleKeyEvent is called after WebPagePopupImpl::close + https://bugs.webkit.org/show_bug.cgi?id=93800 + + Reviewed by Kent Tamura. + + We need to set m_closing to true in WebPagePopupImpl::close so we won't access m_page in WebPagePopupImpl::handleKeyEvent. + + * src/WebPagePopupImpl.cpp: + (WebKit::WebPagePopupImpl::close): Set m_closing to true. + +2012-11-08 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r133984. + http://trac.webkit.org/changeset/133984 + https://bugs.webkit.org/show_bug.cgi?id=101684 + + windows build error. (Requested by hayato on #webkit). + + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::putWithIndexKeys): + (WebKit): + (WebKit::IDBObjectStoreBackendProxy::setIndexKeys): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::setIndexesReady): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBDatabaseImpl.cpp: + (WebKit::WebIDBDatabaseImpl::deleteObjectStore): + (WebKit): + (WebKit::WebIDBDatabaseImpl::transaction): + * src/WebIDBDatabaseImpl.h: + (WebIDBDatabaseImpl): + * src/WebIDBObjectStoreImpl.cpp: + (WebKit::WebIDBObjectStoreImpl::putWithIndexKeys): + (WebKit): + (WebKit::WebIDBObjectStoreImpl::setIndexKeys): + (WebKit::WebIDBObjectStoreImpl::setIndexesReady): + (WebKit::WebIDBObjectStoreImpl::index): + (WebKit::WebIDBObjectStoreImpl::deleteIndex): + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + * src/WebIDBTransactionImpl.cpp: + (WebKit::WebIDBTransactionImpl::objectStore): + (WebKit): + * src/WebIDBTransactionImpl.h: + +2012-11-08 Alec Flett <alecflett@chromium.org> + + IndexedDB: switch frontend to use int64_t-based references + https://bugs.webkit.org/show_bug.cgi?id=100426 + + Reviewed by Tony Chang. + + Remove implementation stubs from chromium API for + methods obsoleted by https://bugs.webkit.org/show_bug.cgi?id=100425 + + * src/IDBObjectStoreBackendProxy.cpp: + * src/IDBObjectStoreBackendProxy.h: + (IDBObjectStoreBackendProxy): + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + (WebIDBDatabaseImpl): + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + (WebIDBObjectStoreImpl): + +2012-11-07 Kent Tamura <tkent@chromium.org> + + [Chromium] WebElement::hasHTMLTagName returns true for non-HTML elements + https://bugs.webkit.org/show_bug.cgi?id=101537 + + Reviewed by Abhishek Arya. + + We should not do ignore-case comparison for tagName, which is always + upper-case and createElementNS(xhtmlNS, "INPUT") doesn't create an + HTMLInputElement object. We need to check if localName is equal to + "input" in this case. + + * src/WebElement.cpp: + (WebKit::WebElement::hasHTMLTagName): + +2012-11-08 Joshua Bell <jsbell@chromium.org> + + Expose snapshots in platform/leveldb wrapper API + https://bugs.webkit.org/show_bug.cgi?id=100786 + + Reviewed by Tony Chang. + + Add unit tests for transactions/snapshots. + + * tests/LevelDBTest.cpp: + (WebCore::encodeString): Don't append to pre-sized vector. + (WebCore::TEST): + (WebCore): + 2012-11-08 Adam Barth <abarth@webkit.org> Unreviewed. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index ba3dd966e..222eb8b45 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': '166755' + 'chromium_rev': '169021' } deps = { @@ -137,6 +137,8 @@ deps = { From('chromium_deps', 'src/third_party/libjpeg_turbo'), 'third_party/leveldatabase/src': From('chromium_deps', 'src/third_party/leveldatabase/src'), + 'third_party/smhasher/src': + From('chromium_deps', 'src/third_party/smhasher/src'), 'third_party/snappy/src': From('chromium_deps', 'src/third_party/snappy/src'), 'third_party/sfntly/cpp/src': diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index 74ef9bfcf..0dd53bfa3 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -120,6 +120,7 @@ 'public/WebContextMenuData.h', 'public/WebCrossOriginPreflightResultCache.h', 'public/WebCursorInfo.h', + 'public/WebDOMCustomEvent.h', 'public/WebDOMEvent.h', 'public/WebDOMEventListener.h', 'public/WebDOMMessageEvent.h', @@ -129,6 +130,8 @@ 'public/WebDataSource.h', 'public/WebDatabase.h', 'public/WebDatabaseObserver.h', + 'public/WebDateTimeChooserCompletion.h', + 'public/WebDateTimeChooserParams.h', 'public/WebDeliveredIntentClient.h', 'public/WebDevToolsAgent.h', 'public/WebDevToolsAgentClient.h', @@ -359,6 +362,8 @@ 'src/DateTimeChooserImpl.h', 'src/ChromeClientImpl.cpp', 'src/ChromeClientImpl.h', + 'src/ColorChooserPopupUIController.cpp', + 'src/ColorChooserPopupUIController.h', 'src/ColorChooserUIController.cpp', 'src/ColorChooserUIController.h', 'src/CompositionUnderlineBuilder.h', @@ -383,12 +388,15 @@ 'src/EditorClientImpl.h', 'src/EventListenerWrapper.cpp', 'src/EventListenerWrapper.h', + 'src/ExternalDateTimeChooser.cpp', + 'src/ExternalDateTimeChooser.h', 'src/ExternalPopupMenu.cpp', 'src/ExternalPopupMenu.h', 'src/FindInPageCoordinates.cpp', 'src/FindInPageCoordinates.h', 'src/FrameLoaderClientImpl.cpp', 'src/FrameLoaderClientImpl.h', + 'src/FrameNetworkingContextImpl.cpp', 'src/FrameNetworkingContextImpl.h', 'src/GeolocationClientProxy.cpp', 'src/GeolocationClientProxy.h', @@ -487,6 +495,7 @@ 'src/WebCompositorInputHandlerImpl.h', 'src/WebCrossOriginPreflightResultCache.cpp', 'src/WebCursorInfo.cpp', + 'src/WebDOMCustomEvent.cpp', 'src/WebDOMEvent.cpp', 'src/WebDOMEventListener.cpp', 'src/WebDOMEventListenerPrivate.cpp', @@ -612,7 +621,6 @@ 'src/WebSecurityPolicy.cpp', 'src/WebSelectElement.cpp', 'src/WebSerializedScriptValue.cpp', - 'src/WebSessionDescriptionDescriptor.cpp', 'src/WebSettingsImpl.cpp', 'src/WebSettingsImpl.h', 'src/WebSharedWorkerImpl.cpp', @@ -709,6 +717,7 @@ # functions defined only in !WEBKIT_IMPLEMENTATION. 'tests/AssociatedURLLoaderTest.cpp', 'tests/EventListenerTest.cpp', + 'tests/FakeWebPlugin.cpp', 'tests/FrameTestHelpers.cpp', 'tests/IDBBindingUtilitiesTest.cpp', 'tests/LevelDBTest.cpp', @@ -723,6 +732,7 @@ 'tests/WebImageTest.cpp', 'tests/WebPageNewSerializerTest.cpp', 'tests/WebPageSerializerTest.cpp', + 'tests/WebPluginContainerTest.cpp', 'tests/WebViewTest.cpp', ], 'conditions': [ diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi index 18c6a8c35..dd5d6cf1b 100644 --- a/Source/WebKit/chromium/WebKit.gypi +++ b/Source/WebKit/chromium/WebKit.gypi @@ -64,6 +64,8 @@ 'tests/DeferredImageDecoderTest.cpp', 'tests/DragImageTest.cpp', 'tests/EventListenerTest.cpp', + 'tests/FakeWebPlugin.cpp', + 'tests/FakeWebPlugin.h', 'tests/FakeWebCompositorOutputSurface.h', 'tests/FakeWebGraphicsContext3D.h', 'tests/FilterOperationsTest.cpp', @@ -86,7 +88,6 @@ 'tests/LinkHighlightTest.cpp', 'tests/ListenerLeakTest.cpp', 'tests/MemoryInfo.cpp', - 'tests/MemoryInstrumentationTest.cpp', 'tests/OpaqueRectTrackingContentLayerDelegateTest.cpp', 'tests/OpenTypeVerticalDataTest.cpp', 'tests/PODArenaTest.cpp', @@ -114,6 +115,7 @@ 'tests/WebMediaPlayerClientImplTest.cpp', 'tests/WebPageNewSerializerTest.cpp', 'tests/WebPageSerializerTest.cpp', + 'tests/WebPluginContainerTest.cpp', 'tests/WebSocketDeflaterTest.cpp', 'tests/WebSocketExtensionDispatcherTest.cpp', 'tests/WebURLRequestTest.cpp', diff --git a/Source/WebKit/chromium/WebKitUnitTests.gyp b/Source/WebKit/chromium/WebKitUnitTests.gyp index 5dcfcd2b4..691cb5c65 100644 --- a/Source/WebKit/chromium/WebKitUnitTests.gyp +++ b/Source/WebKit/chromium/WebKitUnitTests.gyp @@ -119,6 +119,7 @@ 'type': 'shared_library', 'dependencies': [ '<(chromium_src_dir)/testing/android/native_test.gyp:native_test_native_code', + '<(chromium_src_dir)/tools/android/forwarder2/forwarder.gyp:forwarder2', ], }], ['OS=="mac"', { diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index f386deb77..4f43106d3 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -45,7 +45,6 @@ 'ENABLE_CSS_DEVICE_ADAPTATION=0', 'ENABLE_CSS_EXCLUSIONS=1', 'ENABLE_CSS_FILTERS=1', - 'ENABLE_CSS_HIERARCHIES=0', 'ENABLE_CSS_IMAGE_SET=1', 'ENABLE_CSS_IMAGE_RESOLUTION=0', 'ENABLE_CSS_REGIONS=1', @@ -95,6 +94,7 @@ 'ENABLE_PAGE_VISIBILITY_API=1', 'ENABLE_POINTER_LOCK=1', 'ENABLE_PROGRESS_ELEMENT=1', + 'ENABLE_PROXIMITY_EVENTS=0', 'ENABLE_QUOTA=1', 'ENABLE_RESOLUTION_MEDIA_QUERY=0', 'ENABLE_REQUEST_ANIMATION_FRAME=1', @@ -145,11 +145,13 @@ 'enable_touch_events%': 1, 'enable_touch_icon_loading%' : 0, 'enable_mutation_observers%': 1, + 'use_default_render_theme%': 0, }, 'use_accelerated_compositing%': '<(use_accelerated_compositing)', 'enable_skia_text%': '<(enable_skia_text)', 'enable_svg%': '<(enable_svg)', 'enable_touch_events%': '<(enable_touch_events)', + 'use_default_render_theme%': '<(use_default_render_theme)', 'conditions': [ ['OS=="android"', { 'feature_defines': [ @@ -239,6 +241,11 @@ 'SK_SUPPORT_HINTING_SCALE_FACTOR', ], }], + ['use_default_render_theme==1', { + 'feature_defines': [ + 'ENABLE_DEFAULT_RENDER_THEME=1', + ], + }], ], }, } diff --git a/Source/WebKit/chromium/public/WebAccessibilityRole.h b/Source/WebKit/chromium/public/WebAccessibilityRole.h index 031a69da9..0008724ec 100644 --- a/Source/WebKit/chromium/public/WebAccessibilityRole.h +++ b/Source/WebKit/chromium/public/WebAccessibilityRole.h @@ -96,6 +96,7 @@ enum WebAccessibilityRole { WebAccessibilityRoleListBoxOption, WebAccessibilityRoleListItem, WebAccessibilityRoleListMarker, + WebAccessibilityRoleMathElement, WebAccessibilityRoleMatte, WebAccessibilityRoleMenu, WebAccessibilityRoleMenuBar, diff --git a/Source/WebKit/chromium/public/WebContextMenuData.h b/Source/WebKit/chromium/public/WebContextMenuData.h index a36372192..7aaee9d52 100644 --- a/Source/WebKit/chromium/public/WebContextMenuData.h +++ b/Source/WebKit/chromium/public/WebContextMenuData.h @@ -100,7 +100,9 @@ struct WebContextMenuData { MediaCanSave = 0x10, MediaHasAudio = 0x20, MediaHasVideo = 0x40, + // FIXME: Remove MediaControlRootElement after patch lands for webkit.org/b/88871. MediaControlRootElement = 0x80, + MediaControls = 0x80, MediaCanPrint = 0x100, MediaCanRotate = 0x200, }; diff --git a/Source/WebKit/chromium/public/WebCursorInfo.h b/Source/WebKit/chromium/public/WebCursorInfo.h index cc8bc59bd..2982b6c53 100644 --- a/Source/WebKit/chromium/public/WebCursorInfo.h +++ b/Source/WebKit/chromium/public/WebCursorInfo.h @@ -95,6 +95,7 @@ struct WebCursorInfo { Type type; WebPoint hotSpot; + float imageScaleFactor; WebImage customImage; #ifdef WIN32 @@ -107,6 +108,7 @@ struct WebCursorInfo { explicit WebCursorInfo(Type type = TypePointer) : type(type) + , imageScaleFactor(1) { #ifdef WIN32 externalHandle = 0; diff --git a/Source/WebKit/chromium/public/WebDOMCustomEvent.h b/Source/WebKit/chromium/public/WebDOMCustomEvent.h new file mode 100644 index 000000000..15f1f80d3 --- /dev/null +++ b/Source/WebKit/chromium/public/WebDOMCustomEvent.h @@ -0,0 +1,49 @@ +/* + * 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 WebDOMCustomEvent_h +#define WebDOMCustomEvent_h + +#include "WebDOMEvent.h" +#include "platform/WebSerializedScriptValue.h" + +namespace WebKit { + +class WebFrame; +class WebString; + +class WebDOMCustomEvent : public WebDOMEvent { +public: + WebDOMCustomEvent() { } + WEBKIT_EXPORT void initCustomEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData); +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebDateTimeChooserCompletion.h b/Source/WebKit/chromium/public/WebDateTimeChooserCompletion.h new file mode 100644 index 000000000..5404d7b1f --- /dev/null +++ b/Source/WebKit/chromium/public/WebDateTimeChooserCompletion.h @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#ifndef WebDateTimeChooserCompletion_h +#define WebDateTimeChooserCompletion_h + +#include "platform/WebString.h" + +namespace WebKit { + +// Gets called back when WebViewClient finished choosing a date/time value. +class WebDateTimeChooserCompletion { +public: + + // Called with a date/time value in the HTML format. The callback instance + // is destroyed when this method is called. + virtual void didChooseValue(const WebString&) = 0; + + // Called when a user closed the chooser without choosing a value. The + // callback instance is destroyed when this method is called. + virtual void didCancelChooser() = 0; + +protected: + virtual ~WebDateTimeChooserCompletion() { } +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebDateTimeChooserParams.h b/Source/WebKit/chromium/public/WebDateTimeChooserParams.h new file mode 100644 index 000000000..c36b98b46 --- /dev/null +++ b/Source/WebKit/chromium/public/WebDateTimeChooserParams.h @@ -0,0 +1,86 @@ +/* + * 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. + */ + +#ifndef WebDateTimeChooserParams_h +#define WebDateTimeChooserParams_h + +#include "platform/WebRect.h" +#include "platform/WebString.h" +#include "platform/WebVector.h" + +namespace WebKit { + +// This class conveys various information to make date/time chooser UI. +// See WebViewClient::openDateTimeChooser. +struct WebDateTimeChooserParams { + // Input type string. This is one of "date", "datetime", "datetime-local", + // "month", "time", and "week". + WebString type; + // Bounding rectangle of the requester element. + WebRect anchorRectInScreen; + // The current value of the requester element. + WebString currentValue; + // <datalist> option values associated to the requester element. These + // values should not be shown to users. The vector size might be 0. + WebVector<WebString> suggestionValues; + // Localized values of <datalist> options associated to the requester + // element. These values should be shown to users. The vector size must be + // same as suggestionValues size. + WebVector<WebString> localizedSuggestionValues; + // <datalist> option labels associated to the requester element. These + // values should be shown to users. The vector size must be same as + // suggestionValues size. + WebVector<WebString> suggestionLabels; + // HTMLInputElement::min attribute value parsed in the valusAsNumber rule, + // that is to say, milliseconds from the epoch for non-month types and + // months from the epoch for month type. If the min attribute is missing, + // this field has the hard minimum limit. + double minimum; + // Similar to minimum. + double maximum; + // Step value represented in milliseconds for non-month types, and + // represetnted in months for month type. + double step; + // Step-base value represeted in milliseconds, or months. + double stepBase; + // True if the requester element has required attribute. + bool isRequired; + // True if the requester element is rendered in rtl direction. + bool isAnchorElementRTL; + + WebDateTimeChooserParams() + : minimum(0) + , maximum(0) + , step(0) + , stepBase(0) + , isRequired(false) + , isAnchorElementRTL(false) + { + } +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h index 73980bf7f..bda3c0389 100644 --- a/Source/WebKit/chromium/public/WebFrameClient.h +++ b/Source/WebKit/chromium/public/WebFrameClient.h @@ -420,6 +420,19 @@ public: // Platform::current()->userAgent() will be called to provide one. virtual WebString userAgentOverride(WebFrame*, const WebURL& url) { return WebString(); } + // WebGL ------------------------------------------------------ + + // Asks the embedder whether WebGL is allowed for the given WebFrame. + // This call is placed here instead of WebPermissionClient because this + // class is implemented in content/, and putting it here avoids adding + // more public content/ APIs. + virtual bool allowWebGL(WebFrame*, bool defaultValue) { return defaultValue; } + + // Notifies the client that a WebGL context was lost on this page with the + // given reason (one of the GL_ARB_robustness status codes; see + // Extensions3D.h in WebCore/platform/graphics). + virtual void didLoseWebGLContext(WebFrame*, int) { } + protected: ~WebFrameClient() { } }; diff --git a/Source/WebKit/chromium/public/WebIDBDatabase.h b/Source/WebKit/chromium/public/WebIDBDatabase.h index f02bbf44c..b92799039 100644 --- a/Source/WebKit/chromium/public/WebIDBDatabase.h +++ b/Source/WebKit/chromium/public/WebIDBDatabase.h @@ -55,15 +55,9 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return 0; } - virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void deleteObjectStore(long long objectStoreId, const WebIDBTransaction& transaction, WebExceptionCode& ec) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void setVersion(const WebString& version, WebIDBCallbacks* callbacks, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } // Transfers ownership of the WebIDBTransaction to the caller. - virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, WebExceptionCode& ec) - { - WEBKIT_ASSERT_NOT_REACHED(); - return 0; - } virtual WebIDBTransaction* transaction(const WebVector<long long>&, unsigned short mode) { WEBKIT_ASSERT_NOT_REACHED(); diff --git a/Source/WebKit/chromium/public/WebIDBObjectStore.h b/Source/WebKit/chromium/public/WebIDBObjectStore.h index 7bda1a20d..455417160 100644 --- a/Source/WebKit/chromium/public/WebIDBObjectStore.h +++ b/Source/WebKit/chromium/public/WebIDBObjectStore.h @@ -55,7 +55,6 @@ public: typedef WebVector<WebIDBKey> WebIndexKeys; - virtual void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } @@ -69,22 +68,14 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return 0; } - virtual void setIndexKeys(const WebIDBKey&, const WebVector<WebString>&, const WebVector<WebIndexKeys>&, const WebIDBTransaction&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void setIndexKeys(const WebIDBKey&, const WebVector<long long>&, const WebVector<WebIndexKeys>&, const WebIDBTransaction&) { WEBKIT_ASSERT_NOT_REACHED(); } - virtual void setIndexesReady(const WebVector<WebString>&, const WebIDBTransaction&) { WEBKIT_ASSERT_NOT_REACHED(); }; virtual void setIndexesReady(const WebVector<long long>&, const WebIDBTransaction&) { WEBKIT_ASSERT_NOT_REACHED(); }; // Transfers ownership of the WebIDBIndex to the caller. - virtual WebIDBIndex* index(const WebString& name, WebExceptionCode&) - { - WEBKIT_ASSERT_NOT_REACHED(); - return 0; - } virtual WebIDBIndex* index(long long) { WEBKIT_ASSERT_NOT_REACHED(); return 0; } - virtual void deleteIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void deleteIndex(long long indexId, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void openCursor(const WebIDBKeyRange&, WebIDBCursor::Direction direction, WebIDBCallbacks*, WebIDBTransaction::TaskType, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void count(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit/chromium/public/WebIDBTransaction.h b/Source/WebKit/chromium/public/WebIDBTransaction.h index bac2da88d..221bf6056 100644 --- a/Source/WebKit/chromium/public/WebIDBTransaction.h +++ b/Source/WebKit/chromium/public/WebIDBTransaction.h @@ -46,11 +46,6 @@ public: PreemptiveTask }; - virtual WebIDBObjectStore* objectStore(const WebString& name, WebExceptionCode&) - { - WEBKIT_ASSERT_NOT_REACHED(); - return 0; - } virtual WebIDBObjectStore* objectStore(long long, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); diff --git a/Source/WebKit/chromium/public/WebInputElement.h b/Source/WebKit/chromium/public/WebInputElement.h index fbc350012..29432df81 100644 --- a/Source/WebKit/chromium/public/WebInputElement.h +++ b/Source/WebKit/chromium/public/WebInputElement.h @@ -74,6 +74,7 @@ namespace WebKit { WEBKIT_EXPORT void setActivatedSubmit(bool); WEBKIT_EXPORT int size() const; WEBKIT_EXPORT void setValue(const WebString&, bool sendChangeEvent = false); + WEBKIT_EXPORT void setChecked(bool, bool sendChangeEvent = false); WEBKIT_EXPORT WebString value() const; // This returns the non-sanitized, exact value inside the text field. WEBKIT_EXPORT WebString editingValue() const; diff --git a/Source/WebKit/chromium/public/WebNode.h b/Source/WebKit/chromium/public/WebNode.h index 5869aeec6..e84a7b01b 100644 --- a/Source/WebKit/chromium/public/WebNode.h +++ b/Source/WebKit/chromium/public/WebNode.h @@ -45,6 +45,7 @@ class WebDocument; class WebElement; class WebFrame; class WebNodeList; +class WebPluginContainer; // Provides access to some properties of a DOM node. class WebNode { @@ -119,6 +120,7 @@ public: // This does not 100% guarantee the user can see it, but is pretty close. // Note: This method only works properly after layout has occurred. WEBKIT_EXPORT bool hasNonEmptyBoundingBox() const; + WEBKIT_EXPORT WebPluginContainer* pluginContainer() const; template<typename T> T to() { diff --git a/Source/WebKit/chromium/public/WebPasswordFormData.h b/Source/WebKit/chromium/public/WebPasswordFormData.h index c1a106509..12c2a5979 100644 --- a/Source/WebKit/chromium/public/WebPasswordFormData.h +++ b/Source/WebKit/chromium/public/WebPasswordFormData.h @@ -97,12 +97,20 @@ struct WebPasswordFormData { // When parsing an HTML form, this is typically empty. WebString passwordValue; + // Value of shouldAutocomplete for the password element. + bool passwordShouldAutocomplete; + // If the form was a change password form, the name of the // 'old password' input element. Optional. WebString oldPasswordElement; // The old password. Optional. WebString oldPasswordValue; + + WebPasswordFormData() + : passwordShouldAutocomplete(false) + { + } }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebPluginContainer.h b/Source/WebKit/chromium/public/WebPluginContainer.h index debe26038..1229014da 100644 --- a/Source/WebKit/chromium/public/WebPluginContainer.h +++ b/Source/WebKit/chromium/public/WebPluginContainer.h @@ -31,6 +31,8 @@ #ifndef WebPluginContainer_h #define WebPluginContainer_h +#include "platform/WebCommon.h" + struct NPObject; namespace WebKit { @@ -40,6 +42,7 @@ class WebPlugin; class WebString; class WebURL; class WebURLRequest; +struct WebPoint; struct WebRect; class WebPluginContainer { @@ -111,6 +114,15 @@ public: // Notifies when the plugin starts/stops accepting touch events. virtual void setIsAcceptingTouchEvents(bool) = 0; + // Notifies when the plugin starts/stops accepting wheel events. Without + // calling the function with true, the container might not always able to + // receive wheel events in some cases (such as when threaded compositing + // is in use but a scroll bar is not in use). + virtual void setWantsWheelEvents(bool) = 0; + + // Converts view's window coordinates to plugin's local coordinates. + virtual WebPoint windowToLocalPoint(const WebPoint&) = 0; + virtual WebPlugin* plugin() = 0; virtual void setPlugin(WebPlugin*) = 0; diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h index a8082606c..2f6ef1ce4 100644 --- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h @@ -108,15 +108,10 @@ public: WEBKIT_EXPORT static void enablePeerConnection(bool); WEBKIT_EXPORT static bool isPeerConnectionEnabled(); - WEBKIT_EXPORT static void enableDeprecatedPeerConnection(bool); - WEBKIT_EXPORT static bool isDeprecatedPeerConnectionEnabled(); WEBKIT_EXPORT static void enableFullScreenAPI(bool); WEBKIT_EXPORT static bool isFullScreenAPIEnabled(); - WEBKIT_EXPORT static void enablePointerLock(bool); - WEBKIT_EXPORT static bool isPointerLockEnabled(); - WEBKIT_EXPORT static void enableMediaSource(bool); WEBKIT_EXPORT static bool isMediaSourceEnabled(); diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index ddebd7e61..2d356fa6a 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -56,6 +56,7 @@ public: virtual bool scrollAnimatorEnabled() const = 0; virtual bool viewportEnabled() const = 0; virtual void setAccelerated2dCanvasEnabled(bool) = 0; + virtual void setAcceleratedAnimationEnabled(bool) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool) = 0; virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0; @@ -68,10 +69,11 @@ public: virtual void setAcceleratedPaintingEnabled(bool) = 0; virtual void setAllowDisplayOfInsecureContent(bool) = 0; virtual void setAllowFileAccessFromFileURLs(bool) = 0; + virtual void setAllowCustomScrollbarInMainFrame(bool) = 0; virtual void setAllowRunningOfInsecureContent(bool) = 0; virtual void setAllowScriptsToCloseWindows(bool) = 0; virtual void setAllowUniversalAccessFromFileURLs(bool) = 0; - virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool) = 0; + virtual void setApplyDeviceScaleFactorInCompositor(bool) = 0; virtual void setApplyPageScaleFactorInCompositor(bool) = 0; virtual void setAsynchronousSpellCheckingEnabled(bool) = 0; virtual void setAutoZoomFocusedNodeToLegibleScale(bool) = 0; @@ -95,6 +97,7 @@ public: virtual void setEditableLinkBehaviorNeverLive() = 0; virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setEnableScrollAnimator(bool) = 0; + virtual void setEnableTouchAdjustment(bool) = 0; virtual void setExperimentalCSSCustomFilterEnabled(bool) = 0; virtual void setExperimentalCSSGridLayoutEnabled(bool) = 0; virtual void setCSSStickyPositionEnabled(bool) = 0; @@ -134,6 +137,7 @@ public: virtual void setPageCacheSupportsPlugins(bool) = 0; virtual void setPasswordEchoDurationInSeconds(double) = 0; virtual void setPasswordEchoEnabled(bool) = 0; + virtual void setPerTilePaintingEnabled(bool) = 0; virtual void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON) = 0; virtual void setPluginsEnabled(bool) = 0; virtual void setPrivilegedWebGLExtensionsEnabled(bool) = 0; @@ -166,8 +170,8 @@ public: virtual void setWebSecurityEnabled(bool) = 0; virtual void setXSSAuditorEnabled(bool) = 0; - // DEPRECATED - virtual void setDefaultDeviceScaleFactor(int) { } + // DEPRECATED (renamed. remove this after all call sites changed to the new name) + void setApplyDefaultDeviceScaleFactorInCompositor(bool enabled) { setApplyDeviceScaleFactorInCompositor(enabled); } protected: ~WebSettings() { } diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index 49aaa5138..2ec1b1bad 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -471,6 +471,8 @@ public: virtual bool isSelectionEditable() const = 0; + virtual void setShowFPSCounter(bool) = 0; + // Benchmarking support ------------------------------------------------- virtual WebViewBenchmarkSupport* benchmarkSupport() { return 0; } diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h index da6498d30..5b3cbc0b1 100644 --- a/Source/WebKit/chromium/public/WebViewClient.h +++ b/Source/WebKit/chromium/public/WebViewClient.h @@ -53,6 +53,7 @@ class WebBatteryStatusClient; class WebColorChooser; class WebColorChooserClient; class WebCompositorOutputSurface; +class WebDateTimeChooserCompletion; class WebDeviceOrientationClient; class WebDragData; class WebElement; @@ -83,6 +84,7 @@ class WebView; class WebWidget; struct WebConsoleMessage; struct WebContextMenuData; +struct WebDateTimeChooserParams; struct WebPoint; struct WebPopupMenuInfo; struct WebRect; @@ -222,6 +224,13 @@ public: virtual bool runFileChooser(const WebFileChooserParams&, WebFileChooserCompletion*) { return false; } + // Ask users to choose date/time for the specified parameters. When a user + // chooses a value, an implemenattion of this function should call + // WebDateTimeChooserCompletion::didChooseValue or didCancelChooser. If the + // implementation opened date/time chooser UI successfully, it should return + // true. This function is used only if ExternalDateTimeChooser is used. + virtual bool openDateTimeChooser(const WebDateTimeChooserParams&, WebDateTimeChooserCompletion*) { return false; } + // Displays a modal alert dialog containing the given message. Returns // once the user dismisses the dialog. virtual void runModalAlertDialog( diff --git a/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h b/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h deleted file mode 100644 index 56ea93146..000000000 --- a/Source/WebKit/chromium/public/platform/WebICECandidateDescriptor.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebICECandidateDescriptor.h" diff --git a/Source/WebKit/chromium/public/platform/WebICEOptions.h b/Source/WebKit/chromium/public/platform/WebICEOptions.h deleted file mode 100644 index 0f2e46000..000000000 --- a/Source/WebKit/chromium/public/platform/WebICEOptions.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebICEOptions.h" diff --git a/Source/WebKit/chromium/public/platform/WebMediaHints.h b/Source/WebKit/chromium/public/platform/WebMediaHints.h deleted file mode 100644 index b27836db5..000000000 --- a/Source/WebKit/chromium/public/platform/WebMediaHints.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebMediaHints.h" diff --git a/Source/WebKit/chromium/public/platform/WebPeerConnection00Handler.h b/Source/WebKit/chromium/public/platform/WebPeerConnection00Handler.h deleted file mode 100644 index e87ec99e7..000000000 --- a/Source/WebKit/chromium/public/platform/WebPeerConnection00Handler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebPeerConnection00Handler.h" diff --git a/Source/WebKit/chromium/public/platform/WebPeerConnection00HandlerClient.h b/Source/WebKit/chromium/public/platform/WebPeerConnection00HandlerClient.h deleted file mode 100644 index e6ba56cfc..000000000 --- a/Source/WebKit/chromium/public/platform/WebPeerConnection00HandlerClient.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebPeerConnection00HandlerClient.h" diff --git a/Source/WebKit/chromium/public/platform/WebPeerConnectionHandler.h b/Source/WebKit/chromium/public/platform/WebPeerConnectionHandler.h deleted file mode 100644 index e68710c96..000000000 --- a/Source/WebKit/chromium/public/platform/WebPeerConnectionHandler.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebPeerConnectionHandler.h" diff --git a/Source/WebKit/chromium/public/platform/WebPeerConnectionHandlerClient.h b/Source/WebKit/chromium/public/platform/WebPeerConnectionHandlerClient.h deleted file mode 100644 index defa67c45..000000000 --- a/Source/WebKit/chromium/public/platform/WebPeerConnectionHandlerClient.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebPeerConnectionHandlerClient.h" diff --git a/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h b/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h deleted file mode 100644 index 8b1d2a255..000000000 --- a/Source/WebKit/chromium/public/platform/WebSessionDescriptionDescriptor.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "../../../../Platform/chromium/public/WebSessionDescriptionDescriptor.h" diff --git a/Source/WebKit/chromium/public/platform/default/WebThemeEngine.h b/Source/WebKit/chromium/public/platform/default/WebThemeEngine.h new file mode 100644 index 000000000..3d7d130c2 --- /dev/null +++ b/Source/WebKit/chromium/public/platform/default/WebThemeEngine.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "../../../../../Platform/chromium/public/default/WebThemeEngine.h" diff --git a/Source/WebKit/chromium/skia_webkit.gyp b/Source/WebKit/chromium/skia_webkit.gyp index d56e81d18..14a740d0c 100644 --- a/Source/WebKit/chromium/skia_webkit.gyp +++ b/Source/WebKit/chromium/skia_webkit.gyp @@ -47,9 +47,11 @@ # Temporarily ignore fix to antialias coverage, until we can rebaseline 'SK_USE_LEGACY_AA_COVERAGE', + + # When enabled yields a 10x speedup on some devices. + 'SK_DISABLE_FAST_AA_STROKE_RECT', ], }, }, ], } - diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index f3e7859ee..3ee9fcac5 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -37,6 +37,7 @@ #include "AccessibilityObject.h" #include "ApplicationCacheHost.h" #include "ContentSecurityPolicy.h" +#include "Cursor.h" #include "DocumentMarker.h" #include "EditorInsertAction.h" #include "ExceptionCode.h" @@ -59,14 +60,11 @@ #include "IDBKeyPath.h" #include "IDBMetadata.h" #include "IDBTransactionBackendInterface.h" -#include "IceOptions.h" #include "IconURL.h" #include "MediaPlayer.h" #include "MediaStreamSource.h" #include "NotificationClient.h" #include "PageVisibilityState.h" -#include "PeerConnection00.h" -#include "PlatformCursor.h" #include "RTCDataChannelDescriptor.h" #include "RTCPeerConnectionHandlerClient.h" #include "ReferrerPolicy.h" @@ -119,10 +117,7 @@ #include <public/WebClipboard.h> #include <public/WebFileSystem.h> #include <public/WebFilterOperation.h> -#include <public/WebICEOptions.h> #include <public/WebMediaStreamSource.h> -#include <public/WebPeerConnection00Handler.h> -#include <public/WebPeerConnection00HandlerClient.h> #include <public/WebRTCDataChannel.h> #include <public/WebRTCPeerConnectionHandler.h> #include <public/WebRTCPeerConnectionHandlerClient.h> @@ -216,6 +211,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleWebCoreLink, WebCoreLinkRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleImageMapLink, ImageMapLinkRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleImageMap, ImageMapRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListMarker, ListMarkerRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleMathElement, MathElementRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleWebArea, WebAreaRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleHeading, HeadingRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListBox, ListBoxRole); @@ -285,50 +281,50 @@ COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::UpdateReadyEvent, Applicat COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::CachedEvent, ApplicationCacheHost::CACHED_EVENT); COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::ObsoleteEvent, ApplicationCacheHost::OBSOLETE_EVENT); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypePointer, PlatformCursor::TypePointer); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCross, PlatformCursor::TypeCross); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeHand, PlatformCursor::TypeHand); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeIBeam, PlatformCursor::TypeIBeam); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWait, PlatformCursor::TypeWait); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeHelp, PlatformCursor::TypeHelp); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastResize, PlatformCursor::TypeEastResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthResize, PlatformCursor::TypeNorthResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastResize, PlatformCursor::TypeNorthEastResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestResize, PlatformCursor::TypeNorthWestResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthResize, PlatformCursor::TypeSouthResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthEastResize, PlatformCursor::TypeSouthEastResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthWestResize, PlatformCursor::TypeSouthWestResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWestResize, PlatformCursor::TypeWestResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthSouthResize, PlatformCursor::TypeNorthSouthResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastWestResize, PlatformCursor::TypeEastWestResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastSouthWestResize, PlatformCursor::TypeNorthEastSouthWestResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestSouthEastResize, PlatformCursor::TypeNorthWestSouthEastResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeColumnResize, PlatformCursor::TypeColumnResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeRowResize, PlatformCursor::TypeRowResize); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeMiddlePanning, PlatformCursor::TypeMiddlePanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastPanning, PlatformCursor::TypeEastPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthPanning, PlatformCursor::TypeNorthPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastPanning, PlatformCursor::TypeNorthEastPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestPanning, PlatformCursor::TypeNorthWestPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthPanning, PlatformCursor::TypeSouthPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthEastPanning, PlatformCursor::TypeSouthEastPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthWestPanning, PlatformCursor::TypeSouthWestPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWestPanning, PlatformCursor::TypeWestPanning); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeMove, PlatformCursor::TypeMove); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeVerticalText, PlatformCursor::TypeVerticalText); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCell, PlatformCursor::TypeCell); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeContextMenu, PlatformCursor::TypeContextMenu); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeAlias, PlatformCursor::TypeAlias); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeProgress, PlatformCursor::TypeProgress); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNoDrop, PlatformCursor::TypeNoDrop); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCopy, PlatformCursor::TypeCopy); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNone, PlatformCursor::TypeNone); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNotAllowed, PlatformCursor::TypeNotAllowed); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeZoomIn, PlatformCursor::TypeZoomIn); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeZoomOut, PlatformCursor::TypeZoomOut); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeGrab, PlatformCursor::TypeGrab); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeGrabbing, PlatformCursor::TypeGrabbing); -COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCustom, PlatformCursor::TypeCustom); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypePointer, Cursor::Pointer); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCross, Cursor::Cross); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeHand, Cursor::Hand); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeIBeam, Cursor::IBeam); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWait, Cursor::Wait); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeHelp, Cursor::Help); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastResize, Cursor::EastResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthResize, Cursor::NorthResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastResize, Cursor::NorthEastResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestResize, Cursor::NorthWestResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthResize, Cursor::SouthResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthEastResize, Cursor::SouthEastResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthWestResize, Cursor::SouthWestResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWestResize, Cursor::WestResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthSouthResize, Cursor::NorthSouthResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastWestResize, Cursor::EastWestResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastSouthWestResize, Cursor::NorthEastSouthWestResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestSouthEastResize, Cursor::NorthWestSouthEastResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeColumnResize, Cursor::ColumnResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeRowResize, Cursor::RowResize); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeMiddlePanning, Cursor::MiddlePanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeEastPanning, Cursor::EastPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthPanning, Cursor::NorthPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthEastPanning, Cursor::NorthEastPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNorthWestPanning, Cursor::NorthWestPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthPanning, Cursor::SouthPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthEastPanning, Cursor::SouthEastPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeSouthWestPanning, Cursor::SouthWestPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeWestPanning, Cursor::WestPanning); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeMove, Cursor::Move); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeVerticalText, Cursor::VerticalText); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCell, Cursor::Cell); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeContextMenu, Cursor::ContextMenu); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeAlias, Cursor::Alias); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeProgress, Cursor::Progress); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNoDrop, Cursor::NoDrop); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCopy, Cursor::Copy); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNone, Cursor::None); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeNotAllowed, Cursor::NotAllowed); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeZoomIn, Cursor::ZoomIn); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeZoomOut, Cursor::ZoomOut); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeGrab, Cursor::Grab); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeGrabbing, Cursor::Grabbing); +COMPILE_ASSERT_MATCHING_ENUM(WebCursorInfo::TypeCustom, Cursor::Custom); COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionTyped, EditorInsertActionTyped); COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionPasted, EditorInsertActionPasted); @@ -566,43 +562,31 @@ COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateLive, MediaStreamSo COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateMuted, MediaStreamSource::ReadyStateMuted); COMPILE_ASSERT_MATCHING_ENUM(WebMediaStreamSource::ReadyStateEnded, MediaStreamSource::ReadyStateEnded); -COMPILE_ASSERT_MATCHING_ENUM(WebICEOptions::CandidateTypeAll, IceOptions::ALL); -COMPILE_ASSERT_MATCHING_ENUM(WebICEOptions::CandidateTypeNoRelay, IceOptions::NO_RELAY); -COMPILE_ASSERT_MATCHING_ENUM(WebICEOptions::CandidateTypeOnlyRelay, IceOptions::ONLY_RELAY); - -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00Handler::ActionSDPOffer, PeerConnection00::SDP_OFFER); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00Handler::ActionSDPPRanswer, PeerConnection00::SDP_PRANSWER); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00Handler::ActionSDPAnswer, PeerConnection00::SDP_ANSWER); - -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateNew, PeerConnection00::NEW); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateOpening, PeerConnection00::OPENING); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateNegotiating, PeerConnection00::OPENING); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateActive, PeerConnection00::ACTIVE); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ReadyStateClosed, PeerConnection00::CLOSED); - -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateGathering, PeerConnection00::ICE_GATHERING); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateWaiting, PeerConnection00::ICE_WAITING); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateChecking, PeerConnection00::ICE_CHECKING); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateConnected, PeerConnection00::ICE_CONNECTED); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateCompleted, PeerConnection00::ICE_COMPLETED); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateFailed, PeerConnection00::ICE_FAILED); -COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateClosed, PeerConnection00::ICE_CLOSED); - COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateNew, RTCPeerConnectionHandlerClient::ReadyStateNew); -COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateOpening, RTCPeerConnectionHandlerClient::ReadyStateOpening); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateHaveLocalOffer, RTCPeerConnectionHandlerClient::ReadyStateHaveLocalOffer); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateHaveLocalPrAnswer, RTCPeerConnectionHandlerClient::ReadyStateHaveLocalPrAnswer); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateHaveRemotePrAnswer, RTCPeerConnectionHandlerClient::ReadyStateHaveRemotePrAnswer); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateActive, RTCPeerConnectionHandlerClient::ReadyStateActive); -COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateClosing, RTCPeerConnectionHandlerClient::ReadyStateClosing); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateClosed, RTCPeerConnectionHandlerClient::ReadyStateClosed); -COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateNew, RTCPeerConnectionHandlerClient::IceStateNew); -COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateGathering, RTCPeerConnectionHandlerClient::IceStateGathering); -COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateWaiting, RTCPeerConnectionHandlerClient::IceStateWaiting); +// DEPRECATED +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateOpening, RTCPeerConnectionHandlerClient::ReadyStateOpening); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ReadyStateClosing, RTCPeerConnectionHandlerClient::ReadyStateClosing); + + +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateStarting, RTCPeerConnectionHandlerClient::IceStateStarting); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateChecking, RTCPeerConnectionHandlerClient::IceStateChecking); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateConnected, RTCPeerConnectionHandlerClient::IceStateConnected); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateCompleted, RTCPeerConnectionHandlerClient::IceStateCompleted); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateFailed, RTCPeerConnectionHandlerClient::IceStateFailed); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateDisconnected, RTCPeerConnectionHandlerClient::IceStateDisconnected); COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateClosed, RTCPeerConnectionHandlerClient::IceStateClosed); +// DEPRECATED +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateNew, RTCPeerConnectionHandlerClient::IceStateNew); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateGathering, RTCPeerConnectionHandlerClient::IceStateGathering); +COMPILE_ASSERT_MATCHING_ENUM(WebRTCPeerConnectionHandlerClient::ICEStateWaiting, RTCPeerConnectionHandlerClient::IceStateWaiting); + COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateConnecting, RTCDataChannelDescriptor::ReadyStateConnecting); COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateOpen, RTCDataChannelDescriptor::ReadyStateOpen); COMPILE_ASSERT_MATCHING_ENUM(WebRTCDataChannel::ReadyStateClosing, RTCDataChannelDescriptor::ReadyStateClosing); diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 94959380a..e617e8f5a 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -37,8 +37,12 @@ #if ENABLE(INPUT_TYPE_COLOR) #include "ColorChooser.h" #include "ColorChooserClient.h" +#if ENABLE(PAGE_POPUP) +#include "ColorChooserPopupUIController.h" +#else #include "ColorChooserUIController.h" #endif +#endif #include "Console.h" #include "Cursor.h" #include "DatabaseTracker.h" @@ -46,6 +50,7 @@ #include "DateTimeChooserImpl.h" #include "Document.h" #include "DocumentLoader.h" +#include "ExternalDateTimeChooser.h" #include "ExternalPopupMenu.h" #include "FileChooser.h" #include "FileIconLoader.h" @@ -292,7 +297,12 @@ static inline void updatePolicyForEvent(const WebInputEvent* inputEvent, WebNavi bool alt = mouseEvent->modifiers & WebMouseEvent::AltKey; bool meta = mouseEvent->modifiers & WebMouseEvent::MetaKey; - WebViewImpl::navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, policy); + WebNavigationPolicy userPolicy = *policy; + WebViewImpl::navigationPolicyFromMouseEvent(buttonNumber, ctrl, shift, alt, meta, &userPolicy); + // User and app agree that we want a new window; let the app override the decorations. + if (userPolicy == WebNavigationPolicyNewWindow && *policy == WebNavigationPolicyNewPopup) + return; + *policy = userPolicy; } WebNavigationPolicy ChromeClientImpl::getNavigationPolicy() @@ -590,7 +600,7 @@ void ChromeClientImpl::mouseDidMoveOverElement( Widget* widget = toRenderWidget(object)->widget(); if (widget && widget->isPluginContainer()) { WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget); - url = plugin->plugin()->linkAtPosition(result.roundedPoint()); + url = plugin->plugin()->linkAtPosition(result.roundedPointInInnerNodeFrame()); } } } @@ -615,22 +625,18 @@ void ChromeClientImpl::dispatchViewportPropertiesDidChange(const ViewportArgumen if (!m_webView->settings()->viewportEnabled() || !m_webView->isFixedLayoutModeEnabled() || !m_webView->client() || !m_webView->page()) return; - FrameView* frameView = m_webView->mainFrameImpl()->frameView(); - int dpi = screenHorizontalDPI(frameView); - ASSERT(dpi > 0); - WebViewClient* client = m_webView->client(); - WebRect deviceRect = client->windowRect(); + WebSize deviceSize = m_webView->size(); // If the window size has not been set yet don't attempt to set the viewport - if (!deviceRect.width || !deviceRect.height) + if (!deviceSize.width || !deviceSize.height) return; Settings* settings = m_webView->page()->settings(); - float devicePixelRatio = dpi / ViewportArguments::deprecatedTargetDPI; + float devicePixelRatio = client->screenInfo().deviceScaleFactor; // Call the common viewport computing logic in ViewportArguments.cpp. ViewportAttributes computed = computeViewportAttributes( - arguments, settings->layoutFallbackWidth(), deviceRect.width, deviceRect.height, - devicePixelRatio, IntSize(deviceRect.width, deviceRect.height)); + arguments, settings->layoutFallbackWidth(), deviceSize.width, deviceSize.height, + devicePixelRatio, IntSize(deviceSize.width, deviceSize.height)); restrictScaleFactorToInitialScaleIfNotUserScalable(computed); @@ -675,7 +681,14 @@ void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64 #if ENABLE(INPUT_TYPE_COLOR) PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient* chooserClient, const Color&) { - return adoptPtr(new ColorChooserUIController(this, chooserClient)); + OwnPtr<ColorChooserUIController> controller; +#if ENABLE(PAGE_POPUP) + controller = adoptPtr(new ColorChooserPopupUIController(this, chooserClient)); +#else + controller = adoptPtr(new ColorChooserUIController(this, chooserClient)); +#endif + controller->openUI(); + return controller.release(); } PassOwnPtr<WebColorChooser> ChromeClientImpl::createWebColorChooser(WebColorChooserClient* chooserClient, const WebColor& initialColor) { @@ -692,8 +705,7 @@ PassRefPtr<DateTimeChooser> ChromeClientImpl::openDateTimeChooser(DateTimeChoose #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) return DateTimeChooserImpl::create(this, pickerClient, parameters); #else - notImplemented(); - return PassRefPtr<DateTimeChooser>(); + return ExternalDateTimeChooser::create(this, m_webView->client(), pickerClient, parameters); #endif } #endif diff --git a/Source/WebKit/chromium/src/ColorChooserPopupUIController.cpp b/Source/WebKit/chromium/src/ColorChooserPopupUIController.cpp new file mode 100644 index 000000000..5af98f087 --- /dev/null +++ b/Source/WebKit/chromium/src/ColorChooserPopupUIController.cpp @@ -0,0 +1,157 @@ +/* + * 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 AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "ColorChooserPopupUIController.h" + +#if ENABLE(INPUT_TYPE_COLOR) && ENABLE(PAGE_POPUP) +#include "ChromeClientImpl.h" +#include "ColorChooserClient.h" +#include "ColorSuggestionPicker.h" +#include "FrameView.h" +#include "IntRect.h" +#include "LocalizedStrings.h" +#include "PickerCommon.h" +#include "WebColorChooser.h" +#include "WebViewImpl.h" +#include <public/Platform.h> +#include <public/WebLocalizedString.h> + +using namespace WebCore; + +namespace WebKit { + +// Keep in sync with Actions in colorSuggestionPicker.js. +enum ColorPickerPopupAction { + ColorPickerPopupActionChooseOtherColor = -2, + ColorPickerPopupActionCancel = -1, + ColorPickerPopupActionSetValue = 0 +}; + +ColorChooserPopupUIController::ColorChooserPopupUIController(ChromeClientImpl* chromeClient, ColorChooserClient* client) + : ColorChooserUIController(chromeClient, client) + , m_chromeClient(chromeClient) + , m_client(client) + , m_popup(0) + , m_locale(Locale::createDefault()) +{ +} + +ColorChooserPopupUIController::~ColorChooserPopupUIController() +{ +} + +void ColorChooserPopupUIController::openUI() +{ + if (m_client->shouldShowSuggestions()) + openPopup(); + else + openColorChooser(); +} + +void ColorChooserPopupUIController::endChooser() +{ + if (m_chooser) + m_chooser->endChooser(); + if (m_popup) + closePopup(); +} + +IntSize ColorChooserPopupUIController::contentSize() +{ + return IntSize(0, 0); +} + +void ColorChooserPopupUIController::writeDocument(DocumentWriter& writer) +{ + Vector<Color> suggestions = m_client->suggestions(); + Vector<String> suggestionValues; + for (unsigned i = 0; i < suggestions.size(); i++) + suggestionValues.append(suggestions[i].serialized()); + IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elementRectRelativeToRootView()); + FrameView* view = static_cast<WebViewImpl*>(m_chromeClient->webView())->page()->mainFrame()->view(); + IntRect rootViewVisibleContentRect = view->visibleContentRect(true /* include scrollbars */); + IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect); + + PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer); + writer.addData(pickerCommonCss, sizeof(pickerCommonCss)); + writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss)); + PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n" + "window.dialogArguments = {\n", writer); + PagePopupClient::addProperty("values", suggestionValues, writer); + PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherColorLabel), writer); + addProperty("anchorRectInScreen", anchorRectInScreen, writer); + addProperty("rootViewRectInScreen", rootViewRectInScreen, writer); +#if OS(MAC_OS_X) + addProperty("confineToRootView", true, writer); +#else + addProperty("confineToRootView", false, writer); +#endif + PagePopupClient::addString("};\n", writer); + writer.addData(pickerCommonJs, sizeof(pickerCommonJs)); + writer.addData(colorSuggestionPickerJs, sizeof(colorSuggestionPickerJs)); + PagePopupClient::addString("</script></body>\n", writer); +} + +Locale& ColorChooserPopupUIController::locale() +{ + return *m_locale; +} + +void ColorChooserPopupUIController::setValueAndClosePopup(int numValue, const String& stringValue) +{ + ASSERT(m_popup); + ASSERT(m_client); + if (numValue == ColorPickerPopupActionSetValue) + m_client->didChooseColor(Color(stringValue)); + if (numValue == ColorPickerPopupActionChooseOtherColor) + openColorChooser(); + closePopup(); +} + +void ColorChooserPopupUIController::didClosePopup() +{ + m_popup = 0; + + if (!m_chooser) + didEndChooser(); +} + + +void ColorChooserPopupUIController::openPopup() +{ + ASSERT(!m_popup); + m_popup = m_chromeClient->openPagePopup(this, m_client->elementRectRelativeToRootView()); +} + +void ColorChooserPopupUIController::closePopup() +{ + if (!m_popup) + return; + m_chromeClient->closePagePopup(m_popup); +} + +} +#endif // ENABLE(INPUT_TYPE_COLOR) && ENABLE(PAGE_POPUP) diff --git a/Source/WebKit/chromium/src/ColorChooserPopupUIController.h b/Source/WebKit/chromium/src/ColorChooserPopupUIController.h new file mode 100644 index 000000000..c4d5848c4 --- /dev/null +++ b/Source/WebKit/chromium/src/ColorChooserPopupUIController.h @@ -0,0 +1,72 @@ +/* + * 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: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef ColorChooserPopupUIController_h +#define ColorChooserPopupUIController_h + +#if ENABLE(INPUT_TYPE_COLOR) && ENABLE(PAGE_POPUP) +#include "ColorChooserUIController.h" +#include "PagePopupClient.h" +#include <wtf/OwnPtr.h> + +namespace WebCore { +class ColorChooserClient; +class PagePopup; +} + +namespace WebKit { + +class ColorChooserPopupUIController : public ColorChooserUIController, public WebCore::PagePopupClient { + +public: + ColorChooserPopupUIController(ChromeClientImpl*, WebCore::ColorChooserClient*); + virtual ~ColorChooserPopupUIController(); + + // ColorChooserUIController functions: + virtual void openUI() OVERRIDE; + + // ColorChooser functions + void endChooser() OVERRIDE; + + // PagePopupClient functions: + virtual WebCore::IntSize contentSize() OVERRIDE; + virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE; + virtual WebCore::Locale& locale() OVERRIDE; + virtual void setValueAndClosePopup(int, const String&) OVERRIDE; + virtual void didClosePopup() OVERRIDE; + +private: + void openPopup(); + void closePopup(); + + ChromeClientImpl* m_chromeClient; + WebCore::ColorChooserClient* m_client; + WebCore::PagePopup* m_popup; + OwnPtr<WebCore::Locale> m_locale; +}; +} + +#endif // ENABLE(INPUT_TYPE_COLOR) && ENABLE(PAGE_POPUP) + +#endif // ColorChooserPopupUIController_h diff --git a/Source/WebKit/chromium/src/ColorChooserUIController.cpp b/Source/WebKit/chromium/src/ColorChooserUIController.cpp index 5789691e8..7ab3c34d4 100644 --- a/Source/WebKit/chromium/src/ColorChooserUIController.cpp +++ b/Source/WebKit/chromium/src/ColorChooserUIController.cpp @@ -27,48 +27,32 @@ #include "ColorChooserUIController.h" #if ENABLE(INPUT_TYPE_COLOR) - #include "ChromeClientImpl.h" #include "Color.h" #include "ColorChooserClient.h" -#include "ColorSuggestionPicker.h" -#include "FrameView.h" -#include "IntRect.h" -#include "LocalizedStrings.h" -#include "PickerCommon.h" #include "WebColorChooser.h" -#include "WebViewImpl.h" -#include <public/Platform.h> #include <public/WebColor.h> -#include <public/WebLocalizedString.h> using namespace WebCore; namespace WebKit { -// Keep in sync with Actions in colorSuggestionPicker.js. -enum ColorPickerPopupAction { - ColorPickerPopupActionChooseOtherColor = -2, - ColorPickerPopupActionCancel = -1, - ColorPickerPopupActionSetValue = 0 -}; ColorChooserUIController::ColorChooserUIController(ChromeClientImpl* chromeClient, ColorChooserClient* client) : m_chromeClient(chromeClient) , m_client(client) - , m_popup(0) - , m_locale(Locale::createDefault()) { - if (m_client->shouldShowSuggestions()) - openPopup(); - else - openColorChooser(); } ColorChooserUIController::~ColorChooserUIController() { } +void ColorChooserUIController::openUI() +{ + openColorChooser(); +} + void ColorChooserUIController::setSelectedColor(const Color& color) { ASSERT(m_chooser); @@ -79,8 +63,6 @@ void ColorChooserUIController::endChooser() { if (m_chooser) m_chooser->endChooser(); - if (m_popup) - closePopup(); } void ColorChooserUIController::didChooseColor(const WebColor& color) @@ -96,79 +78,6 @@ void ColorChooserUIController::didEndChooser() m_client->didEndChooser(); } -IntSize ColorChooserUIController::contentSize() -{ - return IntSize(0, 0); -} - -void ColorChooserUIController::writeDocument(DocumentWriter& writer) -{ - Vector<Color> suggestions = m_client->suggestions(); - Vector<String> suggestionValues; - for (unsigned i = 0; i < suggestions.size(); i++) - suggestionValues.append(suggestions[i].serialized()); - IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elementRectRelativeToRootView()); - FrameView* view = static_cast<WebViewImpl*>(m_chromeClient->webView())->page()->mainFrame()->view(); - IntRect rootViewVisibleContentRect = view->visibleContentRect(true /* include scrollbars */); - IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect); - - PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer); - writer.addData(pickerCommonCss, sizeof(pickerCommonCss)); - writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss)); - PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n" - "window.dialogArguments = {\n", writer); - PagePopupClient::addProperty("values", suggestionValues, writer); - PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherColorLabel), writer); - addProperty("anchorRectInScreen", anchorRectInScreen, writer); - addProperty("rootViewRectInScreen", rootViewRectInScreen, writer); -#if OS(MAC_OS_X) - addProperty("confineToRootView", true, writer); -#else - addProperty("confineToRootView", false, writer); -#endif - PagePopupClient::addString("};\n", writer); - writer.addData(pickerCommonJs, sizeof(pickerCommonJs)); - writer.addData(colorSuggestionPickerJs, sizeof(colorSuggestionPickerJs)); - PagePopupClient::addString("</script></body>\n", writer); -} - -Locale& ColorChooserUIController::locale() -{ - return *m_locale; -} - -void ColorChooserUIController::setValueAndClosePopup(int numValue, const String& stringValue) -{ - ASSERT(m_popup); - ASSERT(m_client); - if (numValue == ColorPickerPopupActionSetValue) - m_client->didChooseColor(Color(stringValue)); - if (numValue == ColorPickerPopupActionChooseOtherColor) - openColorChooser(); - closePopup(); -} - -void ColorChooserUIController::didClosePopup() -{ - m_popup = 0; - - if (!m_chooser) - didEndChooser(); -} - -void ColorChooserUIController::openPopup() -{ - ASSERT(!m_popup); - m_popup = m_chromeClient->openPagePopup(this, m_client->elementRectRelativeToRootView()); -} - -void ColorChooserUIController::closePopup() -{ - if (!m_popup) - return; - m_chromeClient->closePagePopup(m_popup); -} - void ColorChooserUIController::openColorChooser() { ASSERT(!m_chooser); diff --git a/Source/WebKit/chromium/src/ColorChooserUIController.h b/Source/WebKit/chromium/src/ColorChooserUIController.h index 60cecfe18..4f32d7e0a 100644 --- a/Source/WebKit/chromium/src/ColorChooserUIController.h +++ b/Source/WebKit/chromium/src/ColorChooserUIController.h @@ -29,15 +29,12 @@ #if ENABLE(INPUT_TYPE_COLOR) #include "ColorChooser.h" -#include "PagePopupClient.h" #include "PlatformLocale.h" #include "WebColorChooserClient.h" #include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> namespace WebCore { class ColorChooserClient; -class PagePopup; } namespace WebKit { @@ -45,11 +42,13 @@ namespace WebKit { class ChromeClientImpl; class WebColorChooser; -class ColorChooserUIController : public WebColorChooserClient, public WebCore::ColorChooser, public WebCore::PagePopupClient { +class ColorChooserUIController : public WebColorChooserClient, public WebCore::ColorChooser { public: ColorChooserUIController(ChromeClientImpl*, WebCore::ColorChooserClient*); virtual ~ColorChooserUIController(); + virtual void openUI(); + // ColorChooser functions: virtual void setSelectedColor(const WebCore::Color&) OVERRIDE; virtual void endChooser() OVERRIDE; @@ -58,23 +57,14 @@ public: virtual void didChooseColor(const WebColor&) OVERRIDE; virtual void didEndChooser() OVERRIDE; - // PagePopupClient functions: - virtual WebCore::IntSize contentSize() OVERRIDE; - virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE; - virtual WebCore::Locale& locale() OVERRIDE; - virtual void setValueAndClosePopup(int, const String&) OVERRIDE; - virtual void didClosePopup() OVERRIDE; +protected: + void openColorChooser(); + OwnPtr<WebColorChooser> m_chooser; private: - void openPopup(); - void closePopup(); - void openColorChooser(); ChromeClientImpl* m_chromeClient; WebCore::ColorChooserClient* m_client; - OwnPtr<WebColorChooser> m_chooser; - WebCore::PagePopup* m_popup; - OwnPtr<WebCore::Locale> m_locale; }; } diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index ad116090c..bda1b2e9a 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -120,7 +120,7 @@ static String selectMisspelledWord(const ContextMenu* defaultMenu, Frame* select // Selection is empty, so change the selection to the word under the cursor. HitTestResult hitTestResult = selectedFrame->eventHandler()-> - hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().point(), true); + hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().pointInInnerNodeFrame(), true); Node* innerNode = hitTestResult.innerNode(); VisiblePosition pos(innerNode->renderer()->positionForPoint( hitTestResult.localPoint())); @@ -155,10 +155,10 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( return 0; HitTestResult r = m_webView->page()->contextMenuController()->hitTestResult(); - Frame* selectedFrame = r.innerNonSharedNode()->document()->frame(); + Frame* selectedFrame = r.innerNodeFrame(); WebContextMenuData data; - data.mousePosition = selectedFrame->view()->contentsToWindow(r.roundedPoint()); + data.mousePosition = selectedFrame->view()->contentsToWindow(r.roundedPointInInnerNodeFrame()); // Compute edit flags. data.editFlags = WebContextMenuData::CanDoNone; @@ -212,7 +212,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (mediaElement->hasVideo()) data.mediaFlags |= WebContextMenuData::MediaHasVideo; if (mediaElement->controls()) - data.mediaFlags |= WebContextMenuData::MediaControlRootElement; + data.mediaFlags |= WebContextMenuData::MediaControls; } else if (r.innerNonSharedNode()->hasTagName(HTMLNames::objectTag) || r.innerNonSharedNode()->hasTagName(HTMLNames::embedTag)) { RenderObject* object = r.innerNonSharedNode()->renderer(); @@ -298,8 +298,9 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( selectedFrame->selection()->setSelection(selection, WordGranularity); } } - } else if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { - data.isSpellCheckingEnabled = true; + } else { + data.isSpellCheckingEnabled = + m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled(); // Spellchecking might be enabled for the field, but could be disabled on the node. if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) { data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); diff --git a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp index f44157a76..d966ba9d6 100644 --- a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp +++ b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp @@ -60,7 +60,7 @@ DateTimeChooserImpl::DateTimeChooserImpl(ChromeClientImpl* chromeClient, WebCore , m_client(client) , m_popup(0) , m_parameters(parameters) - , m_locale(WebCore::Locale::createDefault()) + , m_locale(WebCore::Locale::create(parameters.locale)) { ASSERT(m_chromeClient); ASSERT(m_client); @@ -110,12 +110,17 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect); rootViewRectInScreen.move(-view->scrollX(), -view->scrollY()); String todayLabelString; - if (m_parameters.type == WebCore::InputTypeNames::month()) + String otherDateLabelString; + if (m_parameters.type == WebCore::InputTypeNames::month()) { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisMonthButtonLabel); - else if (m_parameters.type == WebCore::InputTypeNames::week()) + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherMonthLabel); + } else if (m_parameters.type == WebCore::InputTypeNames::week()) { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisWeekButtonLabel); - else + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherWeekLabel); + } else { todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday); + otherDateLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel); + } addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer); writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss)); @@ -139,12 +144,11 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) addProperty("stepBase", stepBaseString, writer); addProperty("required", m_parameters.required, writer); addProperty("currentValue", m_parameters.currentValue, writer); - addProperty("locale", WebCore::defaultLanguage(), writer); + addProperty("locale", m_parameters.locale.string(), writer); addProperty("todayLabel", todayLabelString, writer); addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer); addProperty("weekLabel", Platform::current()->queryLocalizedString(WebLocalizedString::WeekNumberLabel), writer); addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer); - addProperty("monthLabels", m_locale->monthLabels(), writer); addProperty("dayLabels", m_locale->weekDayShortLabels(), writer); addProperty("isCalendarRTL", m_locale->isRTL(), writer); addProperty("isRTL", m_parameters.isAnchorElementRTL, writer); @@ -154,8 +158,8 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer) addProperty("suggestionValues", m_parameters.suggestionValues, writer); addProperty("localizedSuggestionValues", m_parameters.localizedSuggestionValues, writer); addProperty("suggestionLabels", m_parameters.suggestionLabels, writer); - addProperty("showOtherDateEntry", m_parameters.type == WebCore::InputTypeNames::date(), writer); - addProperty("otherDateLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherDateLabel), writer); + addProperty("showOtherDateEntry", WebCore::RenderTheme::defaultTheme()->supportsCalendarPicker(m_parameters.type), writer); + addProperty("otherDateLabel", otherDateLabelString, writer); addProperty("suggestionHighlightColor", WebCore::RenderTheme::defaultTheme()->activeListBoxSelectionBackgroundColor().serialized(), writer); addProperty("suggestionHighlightTextColor", WebCore::RenderTheme::defaultTheme()->activeListBoxSelectionForegroundColor().serialized(), writer); } diff --git a/Source/WebKit/chromium/src/ExternalDateTimeChooser.cpp b/Source/WebKit/chromium/src/ExternalDateTimeChooser.cpp new file mode 100644 index 000000000..5a705e872 --- /dev/null +++ b/Source/WebKit/chromium/src/ExternalDateTimeChooser.cpp @@ -0,0 +1,137 @@ +/* + * 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" +#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !ENABLE(INPUT_MULTIPLE_FIELDS_UI) +#include "ExternalDateTimeChooser.h" + +#include "ChromeClientImpl.h" +#include "DateTimeChooserClient.h" +#include "WebDateTimeChooserCompletion.h" +#include "WebDateTimeChooserParams.h" +#include "WebViewClient.h" + +using namespace WebCore; + +namespace WebKit { + +class WebDateTimeChooserCompletionImpl : public WebDateTimeChooserCompletion { +public: + WebDateTimeChooserCompletionImpl(ExternalDateTimeChooser* chooser) + : m_chooser(chooser) + { + } + +private: + virtual void didChooseValue(const WebString& value) OVERRIDE + { + m_chooser->didChooseValue(value); + delete this; + } + + virtual void didCancelChooser() OVERRIDE + { + m_chooser->didCancelChooser(); + delete this; + } + + RefPtr<ExternalDateTimeChooser> m_chooser; +}; + +ExternalDateTimeChooser::~ExternalDateTimeChooser() +{ +} + +ExternalDateTimeChooser::ExternalDateTimeChooser(WebCore::DateTimeChooserClient* client) + : m_client(client) +{ + ASSERT(client); +} + +PassRefPtr<ExternalDateTimeChooser> ExternalDateTimeChooser::create(ChromeClientImpl* chromeClient, WebViewClient* webViewClient, WebCore::DateTimeChooserClient* client, const WebCore::DateTimeChooserParameters& parameters) +{ + ASSERT(chromeClient); + RefPtr<ExternalDateTimeChooser> chooser = adoptRef(new ExternalDateTimeChooser(client)); + if (!chooser->openDateTimeChooser(chromeClient, webViewClient, parameters)) + chooser.clear(); + return chooser.release(); +} + +bool ExternalDateTimeChooser::openDateTimeChooser(ChromeClientImpl* chromeClient, WebViewClient* webViewClient, const DateTimeChooserParameters& parameters) +{ + if (!webViewClient) + return false; + + WebDateTimeChooserParams webParams; + webParams.type = parameters.type; + webParams.anchorRectInScreen = chromeClient->rootViewToScreen(parameters.anchorRectInRootView); + webParams.currentValue = parameters.currentValue; + webParams.suggestionValues = parameters.suggestionValues; + webParams.localizedSuggestionValues = parameters.localizedSuggestionValues; + webParams.suggestionLabels = parameters.suggestionLabels; + webParams.minimum = parameters.minimum; + webParams.maximum = parameters.maximum; + webParams.step = parameters.step; + webParams.stepBase = parameters.stepBase; + webParams.isRequired = parameters.required; + webParams.isAnchorElementRTL = parameters.isAnchorElementRTL; + + WebDateTimeChooserCompletion* completion = new WebDateTimeChooserCompletionImpl(this); + if (webViewClient->openDateTimeChooser(webParams, completion)) + return true; + // We can't open a chooser. Calling + // WebDateTimeChooserCompletionImpl::didCancelChooser to delete the + // WebDateTimeChooserCompletionImpl object and deref this. + completion->didCancelChooser(); + return false; +} + +void ExternalDateTimeChooser::didChooseValue(const WebString& value) +{ + if (m_client) + m_client->didChooseValue(value); + // didChooseValue might run JavaScript code, and endChooser() might be + // called. However DateTimeChooserCompletionImpl still has one reference to + // this object. + if (m_client) + m_client->didEndChooser(); +} + +void ExternalDateTimeChooser::didCancelChooser() +{ + if (m_client) + m_client->didEndChooser(); +} + +void ExternalDateTimeChooser::endChooser() +{ + DateTimeChooserClient* client = m_client; + m_client = 0; + client->didEndChooser(); +} + +} + +#endif diff --git a/Source/WebKit/chromium/src/ExternalDateTimeChooser.h b/Source/WebKit/chromium/src/ExternalDateTimeChooser.h new file mode 100644 index 000000000..342db211a --- /dev/null +++ b/Source/WebKit/chromium/src/ExternalDateTimeChooser.h @@ -0,0 +1,64 @@ +/* + * 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. + */ + +#ifndef ExternalDateTimeChooser_h +#define ExternalDateTimeChooser_h + +#if ENABLE(DATE_AND_TIME_INPUT_TYPES) && !ENABLE(INPUT_MULTIPLE_FIELDS_UI) +#include "DateTimeChooser.h" + +namespace WebCore { +class DateTimeChooserClient; +} + +namespace WebKit { + +class ChromeClientImpl; +class WebString; +class WebViewClient; + +class ExternalDateTimeChooser : public WebCore::DateTimeChooser { +public: + static PassRefPtr<ExternalDateTimeChooser> create(ChromeClientImpl*, WebViewClient*, WebCore::DateTimeChooserClient*, const WebCore::DateTimeChooserParameters&); + virtual ~ExternalDateTimeChooser(); + + // The following functions are for DateTimeChooserCompletion. + void didChooseValue(const WebString&); + void didCancelChooser(); + +private: + ExternalDateTimeChooser(WebCore::DateTimeChooserClient*); + bool openDateTimeChooser(ChromeClientImpl*, WebViewClient*, const WebCore::DateTimeChooserParameters&); + + // DateTimeChooer function: + virtual void endChooser() OVERRIDE; + + WebCore::DateTimeChooserClient* m_client; +}; + +} +#endif + +#endif diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 7ffe94339..9d0aab495 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1662,4 +1662,20 @@ void FrameLoaderClientImpl::didRequestAutocomplete(PassRefPtr<FormState> formSta } #endif +#if ENABLE(WEBGL) +bool FrameLoaderClientImpl::allowWebGL(bool enabledPerSettings) +{ + if (m_webFrame->client()) + return m_webFrame->client()->allowWebGL(m_webFrame, enabledPerSettings); + + return enabledPerSettings; +} + +void FrameLoaderClientImpl::didLoseWebGLContext(int arbRobustnessContextLostReason) +{ + if (m_webFrame->client()) + m_webFrame->client()->didLoseWebGLContext(m_webFrame, arbRobustnessContextLostReason); +} +#endif + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index 6589c37bb..2aa624bdf 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -229,6 +229,11 @@ public: virtual void didRequestAutocomplete(PassRefPtr<WebCore::FormState>) OVERRIDE; #endif +#if ENABLE(WEBGL) + virtual bool allowWebGL(bool enabledPerSettings) OVERRIDE; + virtual void didLoseWebGLContext(int arbRobustnessContextLostReason) OVERRIDE; +#endif + private: void makeDocumentView(); diff --git a/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp b/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp new file mode 100644 index 000000000..54f005002 --- /dev/null +++ b/Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp @@ -0,0 +1,51 @@ +/* + * 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 "FrameNetworkingContextImpl.h" + +#include "WebFrameClient.h" +#include "WebFrameImpl.h" +#include <public/Platform.h> + +namespace WebKit { + +WebCookieJar* FrameNetworkingContextImpl::cookieJar() const +{ + WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(frame()); + if (!frameImpl || !frameImpl->client()) + return 0; + WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl); + if (!cookieJar) + cookieJar = WebKit::Platform::current()->cookieJar(); + return cookieJar; +} + +} diff --git a/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h b/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h index 86705067b..6eccd0332 100644 --- a/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h +++ b/Source/WebKit/chromium/src/FrameNetworkingContextImpl.h @@ -21,11 +21,14 @@ #define FrameNetworkingContextImpl_h #include "FrameNetworkingContext.h" +#include <public/WebCookieJar.h> namespace WebKit { class FrameNetworkingContextImpl : public WebCore::FrameNetworkingContext { public: + virtual WebCookieJar* cookieJar() const OVERRIDE; + static PassRefPtr<FrameNetworkingContextImpl> create(WebCore::Frame* frame) { return adoptRef(new FrameNetworkingContextImpl(frame)); diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index 42ac76ba5..81cb549e5 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -31,6 +31,7 @@ #if ENABLE(INDEXED_DATABASE) +#include "DOMStringList.h" #include "IDBCursorBackendInterface.h" #include "IDBDatabaseBackendInterface.h" #include "IDBDatabaseBackendProxy.h" diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index f6d964470..0bc95466d 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -77,14 +77,6 @@ PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObject return IDBObjectStoreBackendProxy::create(objectStore.release()); } -void IDBDatabaseBackendProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBDatabase->deleteObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); -} - void IDBDatabaseBackendProxy::deleteObjectStore(int64_t objectStoreId, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, @@ -99,17 +91,6 @@ void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCa m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec); } -PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) -{ - WebDOMStringList names(storeNames); - OwnPtr<WebIDBTransaction> transaction = adoptPtr(m_webIDBDatabase->transaction(names, mode, ec)); - if (!transaction) { - ASSERT(ec); - return 0; - } - return IDBTransactionBackendProxy::create(transaction.release()); -} - PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(const Vector<int64_t>& objectStoreIds, unsigned short mode) { OwnPtr<WebIDBTransaction> transaction = adoptPtr(m_webIDBDatabase->transaction(objectStoreIds, mode)); diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index 916f833ab..aa8fdf0c9 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -45,10 +45,8 @@ public: virtual WebCore::IDBDatabaseMetadata metadata() const; virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); - virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void deleteObjectStore(int64_t, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&); - virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(WebCore::DOMStringList* storeNames, unsigned short mode, WebCore::ExceptionCode&); virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(const Vector<int64_t>&, unsigned short mode); virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>); diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index 6a0d02772..8e89deb03 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -67,16 +67,6 @@ void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKeyRange> keyRange, PassRefPt m_webIDBObjectStore->get(keyRange, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreBackendProxy::putWithIndexKeys(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, ExceptionCode& ec) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebVector<WebString> webIndexNames(indexNames); - WebVector<IndexKeys> webIndexKeys(indexKeys); - m_webIDBObjectStore->putWithIndexKeys(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), webIndexNames, webIndexKeys, ec); -} - void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, @@ -85,16 +75,6 @@ void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, Pa m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), indexIds, indexKeys); } -void IDBObjectStoreBackendProxy::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<String>& indexNames, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebVector<WebString> webIndexNames(indexNames); - WebVector<IndexKeys> webIndexKeys(indexKeys); - m_webIDBObjectStore->setIndexKeys(prpPrimaryKey, webIndexNames, webIndexKeys, *transactionProxy->getWebIDBTransaction()); -} - void IDBObjectStoreBackendProxy::setIndexKeys(PassRefPtr<IDBKey> prpPrimaryKey, const Vector<int64_t>& indexIds, const Vector<IndexKeys>& indexKeys, IDBTransactionBackendInterface* transaction) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, @@ -130,25 +110,6 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(int return IDBIndexBackendProxy::create(index.release()); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - OwnPtr<WebIDBIndex> index = adoptPtr(m_webIDBObjectStore->createIndex(name, keyPath, unique, multiEntry, *transactionProxy->getWebIDBTransaction(), ec)); - if (!index) - return 0; - return IDBIndexBackendProxy::create(index.release()); -} - -void IDBObjectStoreBackendProxy::setIndexesReady(const Vector<String>& indexNames, IDBTransactionBackendInterface* transaction) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->setIndexesReady(WebVector<WebString>(indexNames), *transactionProxy->getWebIDBTransaction()); -} - void IDBObjectStoreBackendProxy::setIndexesReady(const Vector<int64_t>& indexIds, IDBTransactionBackendInterface* transaction) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, @@ -157,14 +118,6 @@ void IDBObjectStoreBackendProxy::setIndexesReady(const Vector<int64_t>& indexIds m_webIDBObjectStore->setIndexesReady(WebVector<long long>(indexIds), *transactionProxy->getWebIDBTransaction()); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(const String& name, ExceptionCode& ec) -{ - OwnPtr<WebIDBIndex> index = adoptPtr(m_webIDBObjectStore->index(name, ec)); - if (!index) - return 0; - return IDBIndexBackendProxy::create(index.release()); -} - PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(int64_t indexId) { OwnPtr<WebIDBIndex> index = adoptPtr(m_webIDBObjectStore->index(indexId)); @@ -173,14 +126,6 @@ PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(int64_t i return IDBIndexBackendProxy::create(index.release()); } -void IDBObjectStoreBackendProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) -{ - // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, - // all implementations of IDB interfaces are proxy objects. - IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->deleteIndex(name, *transactionProxy->getWebIDBTransaction(), ec); -} - void IDBObjectStoreBackendProxy::deleteIndex(const int64_t indexId, 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 79113ae95..da8f6bbdd 100644 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -44,21 +44,15 @@ public: virtual ~IDBObjectStoreBackendProxy(); virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); - virtual void putWithIndexKeys(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, const WTF::Vector<WTF::String>&, const WTF::Vector<IndexKeys>&, WebCore::ExceptionCode&); virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, const WTF::Vector<int64_t>&, const WTF::Vector<IndexKeys>&); virtual void deleteFunction(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(int64_t id, const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); - PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); - virtual void setIndexKeys(PassRefPtr<WebCore::IDBKey> prpPrimaryKey, const WTF::Vector<WTF::String>&, const Vector<IndexKeys>&, WebCore::IDBTransactionBackendInterface*); virtual void setIndexKeys(PassRefPtr<WebCore::IDBKey> prpPrimaryKey, const WTF::Vector<int64_t>&, const Vector<IndexKeys>&, WebCore::IDBTransactionBackendInterface*); - virtual void setIndexesReady(const Vector<String>&, WebCore::IDBTransactionBackendInterface*); virtual void setIndexesReady(const Vector<int64_t>&, WebCore::IDBTransactionBackendInterface*); - PassRefPtr<WebCore::IDBIndexBackendInterface> index(const String& name, WebCore::ExceptionCode&); PassRefPtr<WebCore::IDBIndexBackendInterface> index(int64_t); - void deleteIndex(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); void deleteIndex(int64_t, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, WebCore::IDBCursor::Direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface::TaskType, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index f0837fef6..572963c13 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -54,14 +54,6 @@ IDBTransactionBackendProxy::~IDBTransactionBackendProxy() { } -PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name, ExceptionCode& ec) -{ - OwnPtr<WebIDBObjectStore> objectStore = adoptPtr(m_webIDBTransaction->objectStore(name, ec)); - if (!objectStore) - return 0; - return IDBObjectStoreBackendProxy::create(objectStore.release()); -} - PassRefPtr<WebCore::IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(int64_t indexId, ExceptionCode& ec) { OwnPtr<WebIDBObjectStore> objectStore = adoptPtr(m_webIDBTransaction->objectStore(indexId, ec)); diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h index e8f2c3375..0a6a53b84 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -41,7 +41,6 @@ public: static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebIDBTransaction>); virtual ~IDBTransactionBackendProxy(); - virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(const String& name, WebCore::ExceptionCode&); virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(int64_t, WebCore::ExceptionCode&); virtual void commit(); virtual void abort(); diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.cpp b/Source/WebKit/chromium/src/InspectorClientImpl.cpp index c6e7b2277..220b7db74 100644 --- a/Source/WebKit/chromium/src/InspectorClientImpl.cpp +++ b/Source/WebKit/chromium/src/InspectorClientImpl.cpp @@ -163,6 +163,16 @@ void InspectorClientImpl::autoZoomPageToFitWidth() agent->autoZoomPageToFitWidth(); } +bool InspectorClientImpl::canShowFPSCounter() +{ + return true; +} + +void InspectorClientImpl::setShowFPSCounter(bool show) +{ + m_inspectedWebView->setShowFPSCounter(show); +} + bool InspectorClientImpl::supportsFrameInstrumentation() { return true; diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.h b/Source/WebKit/chromium/src/InspectorClientImpl.h index 75e1e4342..a759257af 100644 --- a/Source/WebKit/chromium/src/InspectorClientImpl.h +++ b/Source/WebKit/chromium/src/InspectorClientImpl.h @@ -77,6 +77,9 @@ public: virtual void overrideDeviceMetrics(int, int, float, bool); virtual void autoZoomPageToFitWidth(); + virtual bool canShowFPSCounter(); + virtual void setShowFPSCounter(bool); + virtual bool supportsFrameInstrumentation(); virtual void getAllocatedObjects(HashSet<const void*>&); diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp index 583358b94..48709dc25 100644 --- a/Source/WebKit/chromium/src/LinkHighlight.cpp +++ b/Source/WebKit/chromium/src/LinkHighlight.cpp @@ -48,6 +48,7 @@ #include <public/WebRect.h> #include <public/WebSize.h> #include <public/WebTransformationMatrix.h> +#include <wtf/CurrentTime.h> using namespace WebCore; @@ -66,6 +67,7 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl) , m_currentGraphicsLayer(0) , m_geometryNeedsUpdate(false) , m_isAnimating(false) + , m_startTime(monotonicallyIncreasingTime()) { ASSERT(m_node); ASSERT(owningWebViewImpl); @@ -246,7 +248,8 @@ void LinkHighlight::startHighlightAnimationIfNeeded() m_isAnimating = true; const float startOpacity = 1; // FIXME: Should duration be configurable? - const float duration = 0.1f; + const float fadeDuration = 0.1f; + const float minPreFadeDuration = 0.1f; m_contentLayer->layer()->setOpacity(startOpacity); @@ -255,9 +258,12 @@ void LinkHighlight::startHighlightAnimationIfNeeded() OwnPtr<WebFloatAnimationCurve> curve = adoptPtr(compositorSupport->createFloatAnimationCurve()); curve->add(WebFloatKeyframe(0, startOpacity)); - curve->add(WebFloatKeyframe(duration / 2, startOpacity)); + // Make sure we have displayed for at least minPreFadeDuration before starting to fade out. + float extraDurationRequired = std::max(0.f, minPreFadeDuration - static_cast<float>(monotonicallyIncreasingTime() - m_startTime)); + if (extraDurationRequired) + curve->add(WebFloatKeyframe(extraDurationRequired, startOpacity)); // For layout tests we don't fade out. - curve->add(WebFloatKeyframe(duration, WebKit::layoutTestMode() ? startOpacity : 0)); + curve->add(WebFloatKeyframe(fadeDuration + extraDurationRequired, WebKit::layoutTestMode() ? startOpacity : 0)); m_animation = adoptPtr(compositorSupport->createAnimation(*curve, WebAnimation::TargetPropertyOpacity)); diff --git a/Source/WebKit/chromium/src/LinkHighlight.h b/Source/WebKit/chromium/src/LinkHighlight.h index 06d8c909f..59582857d 100644 --- a/Source/WebKit/chromium/src/LinkHighlight.h +++ b/Source/WebKit/chromium/src/LinkHighlight.h @@ -91,6 +91,7 @@ private: bool m_geometryNeedsUpdate; bool m_isAnimating; + double m_startTime; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp index 4cc81c14d..18985910b 100644 --- a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp +++ b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp @@ -81,15 +81,17 @@ void PageWidgetDelegate::layout(Page* page) view->updateLayoutAndStyleIfNeededRecursive(); } -void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background) +void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas* canvas, const WebRect& rect, CanvasBackground background, bool applyDeviceScale) { if (rect.isEmpty()) return; GraphicsContextBuilder builder(canvas); GraphicsContext& gc = builder.context(); gc.platformContext()->setDrawingToImageBuffer(background == Opaque ? false : true); - gc.applyDeviceScaleFactor(page->deviceScaleFactor()); - gc.platformContext()->setDeviceScaleFactor(page->deviceScaleFactor()); + if (applyDeviceScale) { + gc.applyDeviceScaleFactor(page->deviceScaleFactor()); + gc.platformContext()->setDeviceScaleFactor(page->deviceScaleFactor()); + } IntRect dirtyRect(rect); gc.save(); FrameView* view = mainFrameView(page); diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.h b/Source/WebKit/chromium/src/PageWidgetDelegate.h index c9f76bb95..9a03a9002 100644 --- a/Source/WebKit/chromium/src/PageWidgetDelegate.h +++ b/Source/WebKit/chromium/src/PageWidgetDelegate.h @@ -79,7 +79,7 @@ public: }; static void animate(WebCore::Page*, double monotonicFrameBeginTime); static void layout(WebCore::Page*); - static void paint(WebCore::Page*, PageOverlayList*, WebCanvas*, const WebRect&, CanvasBackground); + static void paint(WebCore::Page*, PageOverlayList*, WebCanvas*, const WebRect&, CanvasBackground, bool applyDeviceScale); static bool handleInputEvent(WebCore::Page*, PageWidgetEventHandler&, const WebInputEvent&); private: diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp index a39b1e9cb..d7a4fbbfc 100644 --- a/Source/WebKit/chromium/src/PlatformSupport.cpp +++ b/Source/WebKit/chromium/src/PlatformSupport.cpp @@ -58,7 +58,13 @@ #if OS(WINDOWS) #include "platform/WebRect.h" +#if !ENABLE(DEFAULT_RENDER_THEME) #include <public/win/WebThemeEngine.h> +#endif // !ENABLE(DEFAULT_RENDER_THEME) +#endif + +#if ENABLE(DEFAULT_RENDER_THEME) +#include <public/default/WebThemeEngine.h> #endif #if OS(DARWIN) @@ -69,15 +75,15 @@ #include <public/android/WebThemeEngine.h> #else #include "WebFontInfo.h" +#if !ENABLE(DEFAULT_RENDER_THEME) #include <public/linux/WebThemeEngine.h> +#endif // !ENABLE(DEFAULT_RENDER_THEME) #endif // OS(ANDROID) #endif // elif OS(UNIX) #include "NativeImageSkia.h" #include "BitmapImage.h" -#include "Cookie.h" -#include "Document.h" #include "FrameView.h" #include "GraphicsContext.h" #include "IDBFactoryBackendProxy.h" @@ -89,8 +95,6 @@ #include "Worker.h" #include "WorkerContextProxy.h" -#include <public/WebCookie.h> -#include <public/WebCookieJar.h> #include <public/WebMimeRegistry.h> #include <public/WebVector.h> #include <wtf/Assertions.h> @@ -100,86 +104,6 @@ using namespace WebKit; namespace WebCore { -static WebCookieJar* getCookieJar(const Document* document) -{ - WebFrameImpl* frameImpl = WebFrameImpl::fromFrame(document->frame()); - if (!frameImpl || !frameImpl->client()) - return 0; - WebCookieJar* cookieJar = frameImpl->client()->cookieJar(frameImpl); - if (!cookieJar) - cookieJar = WebKit::Platform::current()->cookieJar(); - return cookieJar; -} - -// Cookies -------------------------------------------------------------------- - -void PlatformSupport::setCookies(const Document* document, const KURL& url, - const String& value) -{ - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - cookieJar->setCookie(url, document->firstPartyForCookies(), value); -} - -String PlatformSupport::cookies(const Document* document, const KURL& url) -{ - String result; - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - result = cookieJar->cookies(url, document->firstPartyForCookies()); - return result; -} - -String PlatformSupport::cookieRequestHeaderFieldValue(const Document* document, - const KURL& url) -{ - String result; - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - result = cookieJar->cookieRequestHeaderFieldValue(url, document->firstPartyForCookies()); - return result; -} - -bool PlatformSupport::rawCookies(const Document* document, const KURL& url, Vector<Cookie>& rawCookies) -{ - rawCookies.clear(); - WebVector<WebCookie> webCookies; - - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - cookieJar->rawCookies(url, document->firstPartyForCookies(), webCookies); - - for (unsigned i = 0; i < webCookies.size(); ++i) { - const WebCookie& webCookie = webCookies[i]; - Cookie cookie(webCookie.name, - webCookie.value, - webCookie.domain, - webCookie.path, - webCookie.expires, - webCookie.httpOnly, - webCookie.secure, - webCookie.session); - rawCookies.append(cookie); - } - return true; -} - -void PlatformSupport::deleteCookie(const Document* document, const KURL& url, const String& cookieName) -{ - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - cookieJar->deleteCookie(url, cookieName); -} - -bool PlatformSupport::cookiesEnabled(const Document* document) -{ - bool result = false; - WebCookieJar* cookieJar = getCookieJar(document); - if (cookieJar) - result = cookieJar->cookiesEnabled(document->cookieURL(), document->firstPartyForCookies()); - return result; -} - // Font ----------------------------------------------------------------------- #if OS(WINDOWS) @@ -221,7 +145,7 @@ NPObject* PlatformSupport::pluginScriptableObject(Widget* widget) // Theming -------------------------------------------------------------------- -#if OS(WINDOWS) +#if OS(WINDOWS) && !ENABLE(DEFAULT_RENDER_THEME) void PlatformSupport::paintButton( GraphicsContext* gc, int part, int state, int classicState, diff --git a/Source/WebKit/chromium/src/WebArrayBuffer.cpp b/Source/WebKit/chromium/src/WebArrayBuffer.cpp index d43874b63..2d192bdb7 100644 --- a/Source/WebKit/chromium/src/WebArrayBuffer.cpp +++ b/Source/WebKit/chromium/src/WebArrayBuffer.cpp @@ -72,7 +72,7 @@ unsigned WebArrayBuffer::byteLength() const #if WEBKIT_USING_V8 v8::Handle<v8::Value> WebArrayBuffer::toV8Value() { - return V8ArrayBuffer::wrap(m_private.get()); + return toV8Object(m_private.get()); } WebArrayBuffer* WebArrayBuffer::createFromV8Value(v8::Handle<v8::Value> value) diff --git a/Source/WebKit/chromium/src/WebBlob.cpp b/Source/WebKit/chromium/src/WebBlob.cpp index f8228e9d7..b2f299fdd 100644 --- a/Source/WebKit/chromium/src/WebBlob.cpp +++ b/Source/WebKit/chromium/src/WebBlob.cpp @@ -61,7 +61,7 @@ void WebBlob::assign(const WebBlob& other) #if WEBKIT_USING_V8 v8::Handle<v8::Value> WebBlob::toV8Value() { - return V8Blob::wrap(m_private.get()); + return toV8Object(m_private.get()); } #endif diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp index 87d7b2522..74836d55f 100644 --- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp +++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp @@ -27,12 +27,12 @@ #include "WebCompositorInputHandlerImpl.h" -#include "PlatformGestureCurveFactory.h" -#include "PlatformGestureCurveTarget.h" #include "TraceEvent.h" #include "WebCompositorInputHandlerClient.h" #include "WebInputEvent.h" +#include <public/Platform.h> #include <public/WebInputHandlerClient.h> +#include <wtf/PassOwnPtr.h> #include <wtf/ThreadingPrimitives.h> using namespace WebCore; @@ -119,9 +119,9 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h switch (scrollStatus) { case WebInputHandlerClient::ScrollStatusStarted: { TRACE_EVENT_INSTANT2("cc", "WebCompositorInputHandlerImpl::handleInput wheel scroll", "deltaX", -wheelEvent.deltaX, "deltaY", -wheelEvent.deltaY); - m_inputHandlerClient->scrollBy(WebPoint(wheelEvent.x, wheelEvent.y), IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY)); + bool didScroll = m_inputHandlerClient->scrollByIfPossible(WebPoint(wheelEvent.x, wheelEvent.y), IntSize(-wheelEvent.deltaX, -wheelEvent.deltaY)); m_inputHandlerClient->scrollEnd(); - return DidHandle; + return didScroll ? DidHandle : DropEvent; } case WebInputHandlerClient::ScrollStatusIgnored: // FIXME: This should be DropEvent, but in cases where we fail to properly sync scrollability it's safer to send the @@ -154,9 +154,9 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h return DidNotHandle; const WebGestureEvent& gestureEvent = *static_cast<const WebGestureEvent*>(&event); - m_inputHandlerClient->scrollBy(WebPoint(gestureEvent.x, gestureEvent.y), + bool didScroll = m_inputHandlerClient->scrollByIfPossible(WebPoint(gestureEvent.x, gestureEvent.y), IntSize(-gestureEvent.data.scrollUpdate.deltaX, -gestureEvent.data.scrollUpdate.deltaY)); - return DidHandle; + return didScroll ? DidHandle : DropEvent; } else if (event.type == WebInputEvent::GestureScrollEnd) { ASSERT(m_expectScrollUpdateEnd); #ifndef NDEBUG @@ -206,8 +206,8 @@ WebCompositorInputHandlerImpl::EventDisposition WebCompositorInputHandlerImpl::h switch (scrollStatus) { case WebInputHandlerClient::ScrollStatusStarted: { m_inputHandlerClient->scrollEnd(); - m_wheelFlingCurve = PlatformGestureCurveFactory::get()->createCurve(gestureEvent.data.flingStart.sourceDevice, FloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY)); - TRACE_EVENT_ASYNC_BEGIN1("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started", this, "curve", m_wheelFlingCurve->debugName()); + m_wheelFlingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(gestureEvent.data.flingStart.sourceDevice, WebFloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY), WebSize())); + TRACE_EVENT_ASYNC_BEGIN0("cc", "WebCompositorInputHandlerImpl::handleGestureFling::started", this); m_wheelFlingParameters.delta = WebFloatPoint(gestureEvent.data.flingStart.velocityX, gestureEvent.data.flingStart.velocityY); m_wheelFlingParameters.point = WebPoint(gestureEvent.x, gestureEvent.y); m_wheelFlingParameters.globalPoint = WebPoint(gestureEvent.globalX, gestureEvent.globalY); @@ -273,16 +273,16 @@ bool WebCompositorInputHandlerImpl::cancelCurrentFling() return hadFlingAnimation; } -void WebCompositorInputHandlerImpl::scrollBy(const IntPoint& increment) +void WebCompositorInputHandlerImpl::scrollBy(const WebPoint& increment) { - if (increment == IntPoint::zero()) + if (increment == WebPoint()) return; - TRACE_EVENT2("cc", "WebCompositorInputHandlerImpl::scrollBy", "x", increment.x(), "y", increment.y()); + TRACE_EVENT2("cc", "WebCompositorInputHandlerImpl::scrollBy", "x", increment.x, "y", increment.y); WebMouseWheelEvent syntheticWheel; syntheticWheel.type = WebInputEvent::MouseWheel; - syntheticWheel.deltaX = increment.x(); - syntheticWheel.deltaY = increment.y(); + syntheticWheel.deltaX = increment.x; + syntheticWheel.deltaY = increment.y; syntheticWheel.hasPreciseScrollingDeltas = true; syntheticWheel.x = m_wheelFlingParameters.point.x; syntheticWheel.y = m_wheelFlingParameters.point.y; @@ -293,8 +293,8 @@ void WebCompositorInputHandlerImpl::scrollBy(const IntPoint& increment) WebCompositorInputHandlerImpl::EventDisposition disposition = handleInputEventInternal(syntheticWheel); switch (disposition) { case DidHandle: - m_wheelFlingParameters.cumulativeScroll.width += increment.x(); - m_wheelFlingParameters.cumulativeScroll.height += increment.y(); + m_wheelFlingParameters.cumulativeScroll.width += increment.x; + m_wheelFlingParameters.cumulativeScroll.height += increment.y; case DropEvent: break; case DidNotHandle: diff --git a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h index fa81de945..efe7f53b4 100644 --- a/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h +++ b/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h @@ -26,10 +26,11 @@ #ifndef WebCompositorInputHandlerImpl_h #define WebCompositorInputHandlerImpl_h -#include "PlatformGestureCurveTarget.h" #include "WebActiveWheelFlingParameters.h" #include "WebCompositorInputHandler.h" #include "WebInputEvent.h" +#include <public/WebGestureCurve.h> +#include <public/WebGestureCurveTarget.h> #include <public/WebInputHandler.h> #include <wtf/HashSet.h> #include <wtf/Noncopyable.h> @@ -41,14 +42,13 @@ class Mutex; namespace WebCore { class IntPoint; -class PlatformGestureCurve; } namespace WebKit { class WebCompositorInputHandlerClient; -class WebCompositorInputHandlerImpl : public WebCompositorInputHandler, public WebInputHandler, public WebCore::PlatformGestureCurveTarget { +class WebCompositorInputHandlerImpl : public WebCompositorInputHandler, public WebInputHandler, public WebGestureCurveTarget { WTF_MAKE_NONCOPYABLE(WebCompositorInputHandlerImpl); public: static WebCompositorInputHandler* fromIdentifier(int identifier); @@ -64,8 +64,8 @@ public: virtual void bindToClient(WebInputHandlerClient*); virtual void animate(double monotonicTime); - // WebCore::PlatformGestureCurveTarget implementation. - virtual void scrollBy(const WebCore::IntPoint&); + // WebGestureCurveTarget implementation. + virtual void scrollBy(const WebPoint&); int identifier() const { return m_identifier; } @@ -81,7 +81,7 @@ private: // Returns true if we actually had an active fling to cancel. bool cancelCurrentFling(); - OwnPtr<WebCore::PlatformGestureCurve> m_wheelFlingCurve; + OwnPtr<WebGestureCurve> m_wheelFlingCurve; // Parameters for the active fling animation, stored in case we need to transfer it out later. WebActiveWheelFlingParameters m_wheelFlingParameters; diff --git a/Source/WebKit/chromium/src/WebCursorInfo.cpp b/Source/WebKit/chromium/src/WebCursorInfo.cpp index d4b0f81fa..0981e4665 100644 --- a/Source/WebKit/chromium/src/WebCursorInfo.cpp +++ b/Source/WebKit/chromium/src/WebCursorInfo.cpp @@ -38,13 +38,14 @@ using namespace WebCore; namespace WebKit { WebCursorInfo::WebCursorInfo(const Cursor& cursor) -{ - type = static_cast<Type>(cursor.impl().type()); - hotSpot = cursor.impl().hotSpot(); - customImage = cursor.impl().customImage(); + : type(static_cast<Type>(cursor.type())) + , hotSpot(cursor.hotSpot()) + , imageScaleFactor(1) + , customImage(cursor.image()) #ifdef WIN32 - externalHandle = 0; + , externalHandle(0) #endif +{ } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp b/Source/WebKit/chromium/src/WebDOMCustomEvent.cpp index 05cfce36d..2f7f8f428 100644 --- a/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp +++ b/Source/WebKit/chromium/src/WebDOMCustomEvent.cpp @@ -29,64 +29,23 @@ */ #include "config.h" +#include "WebDOMCustomEvent.h" -#if ENABLE(MEDIA_STREAM) - -#include <public/WebSessionDescriptionDescriptor.h> - -#include "SessionDescriptionDescriptor.h" -#include <public/WebICECandidateDescriptor.h> +#include "CustomEvent.h" +#include "SerializedScriptValue.h" +#include "platform/WebSerializedScriptValue.h" #include <public/WebString.h> -#include <wtf/Vector.h> using namespace WebCore; namespace WebKit { -WebSessionDescriptionDescriptor::WebSessionDescriptionDescriptor(const PassRefPtr<SessionDescriptionDescriptor>& sessionDescription) - : m_private(sessionDescription) +void WebDOMCustomEvent::initCustomEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& webSerializedScriptValue) { -} - -void WebSessionDescriptionDescriptor::assign(const WebSessionDescriptionDescriptor& other) -{ - m_private = other.m_private; -} - -void WebSessionDescriptionDescriptor::reset() -{ - m_private.reset(); -} - -WebSessionDescriptionDescriptor::operator WTF::PassRefPtr<WebCore::SessionDescriptionDescriptor>() -{ - return m_private.get(); -} - -void WebSessionDescriptionDescriptor::initialize(const WebString& sdp) -{ - m_private = SessionDescriptionDescriptor::create(sdp); -} - -size_t WebSessionDescriptionDescriptor::numberOfAddedCandidates() const -{ - ASSERT(!m_private.isNull()); - return m_private.get()->numberOfAddedCandidates(); -} - -WebICECandidateDescriptor WebSessionDescriptionDescriptor::candidate(size_t index) const -{ - ASSERT(!m_private.isNull()); - return m_private.get()->candidate(index); -} - -WebString WebSessionDescriptionDescriptor::initialSDP() const -{ - ASSERT(!m_private.isNull()); - return m_private.get()->initialSDP(); + ASSERT(m_private); + RefPtr<SerializedScriptValue> serializedScriptValue; + serializedScriptValue = webSerializedScriptValue; + unwrap<CustomEvent>()->initCustomEvent(type, canBubble, cancelable, serializedScriptValue.get()); } } // namespace WebKit - -#endif // ENABLE(MEDIA_STREAM) - diff --git a/Source/WebKit/chromium/src/WebDocument.cpp b/Source/WebKit/chromium/src/WebDocument.cpp index c7a3a834a..ddd766636 100644 --- a/Source/WebKit/chromium/src/WebDocument.cpp +++ b/Source/WebKit/chromium/src/WebDocument.cpp @@ -194,12 +194,13 @@ WebDocumentType WebDocument::doctype() const return WebDocumentType(constUnwrap<Document>()->doctype()); } -void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLevel level) +void WebDocument::insertUserStyleSheet(const WebString& sourceCode, UserStyleLevel) { RefPtr<Document> document = unwrap<Document>(); + // FIXME: We currently ignore the passed in UserStyleLevel. http://crbug.com/162096 RefPtr<StyleSheetContents> parsedSheet = StyleSheetContents::create(document.get()); - parsedSheet->setIsUserStyleSheet(level == UserStyleUserLevel); + parsedSheet->setIsUserStyleSheet(true); parsedSheet->parseString(sourceCode); document->styleSheetCollection()->addUserSheet(parsedSheet.release()); } diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index 49fff0a07..96cf9791d 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -66,8 +66,13 @@ bool WebElement::hasTagName(const WebString& tagName) const bool WebElement::hasHTMLTagName(const WebString& tagName) const { + // How to create class nodeName localName + // createElement('input') HTMLInputElement INPUT input + // createElement('INPUT') HTMLInputElement INPUT input + // createElementNS(xhtmlNS, 'input') HTMLInputElement INPUT input + // createElementNS(xhtmlNS, 'INPUT') HTMLUnknownElement INPUT INPUT const Element* element = constUnwrap<Element>(); - return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnoringCase(element->tagName(), String(tagName)); + return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && element->localName() == String(tagName).lower(); } bool WebElement::hasAttribute(const WebString& attrName) const diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 1936476f3..eacf9aba8 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -130,7 +130,6 @@ #include "RenderObject.h" #include "RenderTreeAsText.h" #include "RenderView.h" -#include "RenderWidget.h" #include "ResourceHandle.h" #include "ResourceRequest.h" #include "SchemeRegistry.h" @@ -304,23 +303,6 @@ static long long generateFrameIdentifier() return ++next; } -static WebPluginContainerImpl* pluginContainerFromNode(const WebNode& node) -{ - if (node.isNull()) - return 0; - - const Node* coreNode = node.constUnwrap<Node>(); - if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLNames::embedTag)) { - RenderObject* object = coreNode->renderer(); - if (object && object->isWidget()) { - Widget* widget = toRenderWidget(object)->widget(); - if (widget && widget->isPluginContainer()) - return static_cast<WebPluginContainerImpl*>(widget); - } - } - return 0; -} - WebPluginContainerImpl* WebFrameImpl::pluginContainerFromFrame(Frame* frame) { if (!frame) @@ -1202,7 +1184,7 @@ size_t WebFrameImpl::characterIndexForPoint(const WebPoint& webPoint) const IntPoint point = frame()->view()->windowToContents(webPoint); HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point, false); - RefPtr<Range> range = frame()->rangeForPoint(result.roundedPoint()); + RefPtr<Range> range = frame()->rangeForPoint(result.roundedPointInInnerNodeFrame()); if (!range) return notFound; @@ -1232,7 +1214,7 @@ bool WebFrameImpl::executeCommand(const WebString& name, const WebNode& node) if (command == "Copy") { WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame()); if (!pluginContainer) - pluginContainer = pluginContainerFromNode(node); + pluginContainer = static_cast<WebPluginContainerImpl*>(node.pluginContainer()); if (pluginContainer) { pluginContainer->copy(); return true; @@ -1428,7 +1410,7 @@ int WebFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& c pluginContainer = pluginContainerFromFrame(frame()); } else { // We only support printing plugin nodes for now. - pluginContainer = pluginContainerFromNode(constrainToNode); + pluginContainer = static_cast<WebPluginContainerImpl*>(constrainToNode.pluginContainer()); } if (pluginContainer && pluginContainer->supportsPaginatedPrint()) @@ -1477,7 +1459,7 @@ void WebFrameImpl::printEnd() bool WebFrameImpl::isPrintScalingDisabledForPlugin(const WebNode& node) { - WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFromFrame(frame()) : pluginContainerFromNode(node); + WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFromFrame(frame()) : static_cast<WebPluginContainerImpl*>(node.pluginContainer()); if (!pluginContainer || !pluginContainer->supportsPaginatedPrint()) return false; diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 90c262389..59abd5329 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -70,11 +70,6 @@ WebIDBObjectStore* WebIDBDatabaseImpl::createObjectStore(long long id, const Web return new WebIDBObjectStoreImpl(objectStore); } -void WebIDBDatabaseImpl::deleteObjectStore(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) -{ - m_databaseBackend->deleteObjectStore(name, transaction.getIDBTransactionBackendInterface(), ec); -} - void WebIDBDatabaseImpl::deleteObjectStore(long long objectStoreId, const WebIDBTransaction& transaction, WebExceptionCode& ec) { m_databaseBackend->deleteObjectStore(objectStoreId, transaction.getIDBTransactionBackendInterface(), ec); @@ -85,17 +80,6 @@ void WebIDBDatabaseImpl::setVersion(const WebString& version, WebIDBCallbacks* c m_databaseBackend->setVersion(version, IDBCallbacksProxy::create(adoptPtr(callbacks)), m_databaseCallbacks, ec); } -WebIDBTransaction* WebIDBDatabaseImpl::transaction(const WebDOMStringList& names, unsigned short mode, WebExceptionCode& ec) -{ - RefPtr<DOMStringList> nameList = PassRefPtr<DOMStringList>(names); - RefPtr<IDBTransactionBackendInterface> transaction = m_databaseBackend->transaction(nameList.get(), mode, ec); - if (!transaction) { - ASSERT(ec); - return 0; - } - return new WebIDBTransactionImpl(transaction); -} - WebIDBTransaction* WebIDBDatabaseImpl::transaction(const WebVector<long long>& objectStoreIds, unsigned short mode) { Vector<int64_t> objectStoreIdList(objectStoreIds.size()); diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 65a19668a..e728742c6 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -53,10 +53,8 @@ public: virtual WebIDBMetadata metadata() const; virtual WebIDBObjectStore* createObjectStore(long long, const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&); - virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); virtual void deleteObjectStore(long long objectStoreId, const WebIDBTransaction&, WebExceptionCode&); virtual void setVersion(const WebString& version, WebIDBCallbacks*, WebExceptionCode&); - virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, WebExceptionCode&); virtual WebIDBTransaction* transaction(const WebVector<long long>& names, unsigned short mode); virtual void forceClose(); virtual void close(); diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp index d60b5f5c1..609d3b4a0 100644 --- a/Source/WebKit/chromium/src/WebIDBKey.cpp +++ b/Source/WebKit/chromium/src/WebIDBKey.cpp @@ -30,7 +30,6 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBBindingUtilities.h" #include "IDBKey.h" using namespace WebCore; diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 85bac13b3..102804bc8 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -58,23 +58,6 @@ void WebIDBObjectStoreImpl::get(const WebIDBKeyRange& keyRange, WebIDBCallbacks* m_objectStore->get(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec); } -void WebIDBObjectStoreImpl::putWithIndexKeys(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, const WebVector<WebString>& webIndexNames, const WebVector<WebIndexKeys>& webIndexKeys, WebExceptionCode& ec) -{ - ASSERT(webIndexNames.size() == webIndexKeys.size()); - Vector<String> indexNames(webIndexNames.size()); - Vector<IDBObjectStoreBackendInterface::IndexKeys> indexKeys(webIndexKeys.size()); - - for (size_t i = 0; i < webIndexNames.size(); ++i) { - indexNames[i] = webIndexNames[i]; - Vector<RefPtr<IDBKey> > indexKeyList(webIndexKeys[i].size()); - for (size_t j = 0; j < webIndexKeys[i].size(); ++j) - indexKeyList[j] = webIndexKeys[i][j]; - indexKeys[i] = indexKeyList; - } - - m_objectStore->putWithIndexKeys(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), indexNames, indexKeys, ec); -} - void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, const WebVector<long long>& webIndexIds, const WebVector<WebIndexKeys>& webIndexKeys) { ASSERT(webIndexIds.size() == webIndexKeys.size()); @@ -92,22 +75,6 @@ void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const Web m_objectStore->put(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), indexIds, indexKeys); } -void WebIDBObjectStoreImpl::setIndexKeys(const WebIDBKey& primaryKey, const WebVector<WebString>& webIndexNames, const WebVector<WebIndexKeys>& webIndexKeys, const WebIDBTransaction& transaction) -{ - ASSERT(webIndexNames.size() == webIndexKeys.size()); - Vector<String> indexNames(webIndexNames.size()); - Vector<IDBObjectStoreBackendInterface::IndexKeys> indexKeys(webIndexKeys.size()); - - for (size_t i = 0; i < webIndexNames.size(); ++i) { - indexNames[i] = webIndexNames[i]; - Vector<RefPtr<IDBKey> > indexKeyList(webIndexKeys[i].size()); - for (size_t j = 0; j < webIndexKeys[i].size(); ++j) - indexKeyList[j] = webIndexKeys[i][j]; - indexKeys[i] = indexKeyList; - } - m_objectStore->setIndexKeys(primaryKey, indexNames, indexKeys, transaction.getIDBTransactionBackendInterface()); -} - void WebIDBObjectStoreImpl::setIndexKeys(const WebIDBKey& primaryKey, const WebVector<long long>& webIndexIds, const WebVector<WebIndexKeys>& webIndexKeys, const WebIDBTransaction& transaction) { ASSERT(webIndexIds.size() == webIndexKeys.size()); @@ -124,14 +91,6 @@ void WebIDBObjectStoreImpl::setIndexKeys(const WebIDBKey& primaryKey, const WebV m_objectStore->setIndexKeys(primaryKey, indexIds, indexKeys, transaction.getIDBTransactionBackendInterface()); } -void WebIDBObjectStoreImpl::setIndexesReady(const WebVector<WebString>& webIndexNames, const WebIDBTransaction& transaction) -{ - Vector<String> indexNames(webIndexNames.size()); - for (size_t i = 0; i < webIndexNames.size(); ++i) - indexNames[i] = webIndexNames[i]; - m_objectStore->setIndexesReady(indexNames, transaction.getIDBTransactionBackendInterface()); -} - void WebIDBObjectStoreImpl::setIndexesReady(const WebVector<long long>& webIndexNames, const WebIDBTransaction& transaction) { Vector<int64_t> indexIds(webIndexNames.size()); @@ -158,14 +117,6 @@ WebIDBIndex* WebIDBObjectStoreImpl::createIndex(long long id, const WebString& n return new WebIDBIndexImpl(index); } -WebIDBIndex* WebIDBObjectStoreImpl::index(const WebString& name, WebExceptionCode& ec) -{ - RefPtr<IDBIndexBackendInterface> index = m_objectStore->index(name, ec); - if (!index) - return 0; - return new WebIDBIndexImpl(index); -} - WebIDBIndex* WebIDBObjectStoreImpl::index(long long objectStoreId) { RefPtr<IDBIndexBackendInterface> index = m_objectStore->index(objectStoreId); @@ -174,11 +125,6 @@ WebIDBIndex* WebIDBObjectStoreImpl::index(long long objectStoreId) return new WebIDBIndexImpl(index); } -void WebIDBObjectStoreImpl::deleteIndex(const WebString& name, const WebIDBTransaction& transaction, WebExceptionCode& ec) -{ - m_objectStore->deleteIndex(name, transaction.getIDBTransactionBackendInterface(), ec); -} - void WebIDBObjectStoreImpl::deleteIndex(long long objectStoreId, const WebIDBTransaction& transaction, WebExceptionCode& ec) { m_objectStore->deleteIndex(objectStoreId, transaction.getIDBTransactionBackendInterface(), ec); diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 5de3c9a15..70f19cc8f 100644 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -46,19 +46,14 @@ public: ~WebIDBObjectStoreImpl(); void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); - void putWithIndexKeys(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<WebString>&, const WebVector<WebIndexKeys>&, WebExceptionCode&); void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, const WebVector<long long>&, const WebVector<WebIndexKeys>&); - void setIndexKeys(const WebIDBKey&, const WebVector<WebString>& indexNames, const WebVector<WebIndexKeys>&, const WebIDBTransaction&); void setIndexKeys(const WebIDBKey&, const WebVector<long long>& indexNames, const WebVector<WebIndexKeys>&, const WebIDBTransaction&); - void setIndexesReady(const WebVector<WebString>&, const WebIDBTransaction&); void setIndexesReady(const WebVector<long long>&, const WebIDBTransaction&); void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); WebIDBIndex* createIndex(long long, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry, const WebIDBTransaction&, WebExceptionCode&); - WebIDBIndex* index(const WebString& name, WebExceptionCode&); WebIDBIndex* index(long long); - void deleteIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&); void deleteIndex(long long, const WebIDBTransaction&, WebExceptionCode&); void openCursor(const WebIDBKeyRange&, WebIDBCursor::Direction, WebIDBCallbacks*, WebIDBTransaction::TaskType, const WebIDBTransaction&, WebExceptionCode&); diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp index 6616d671f..40d7d7563 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.cpp @@ -47,14 +47,6 @@ WebIDBTransactionImpl::~WebIDBTransactionImpl() { } -WebIDBObjectStore* WebIDBTransactionImpl::objectStore(const WebString& name, ExceptionCode& ec) -{ - RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(name, ec); - if (!objectStore) - return 0; - return new WebIDBObjectStoreImpl(objectStore); -} - WebIDBObjectStore* WebIDBTransactionImpl::objectStore(long long indexId, ExceptionCode& ec) { RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->objectStore(indexId, ec); diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h index 1ee6ab801..0fb653767 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h +++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h @@ -41,7 +41,6 @@ public: WebIDBTransactionImpl(WTF::PassRefPtr<WebCore::IDBTransactionBackendInterface>); virtual ~WebIDBTransactionImpl(); - virtual WebIDBObjectStore* objectStore(const WebString& name, WebExceptionCode&); virtual WebIDBObjectStore* objectStore(long long indexId, WebExceptionCode&); virtual void commit(); virtual void abort(); diff --git a/Source/WebKit/chromium/src/WebInputElement.cpp b/Source/WebKit/chromium/src/WebInputElement.cpp index bdc9f5db2..bfc0c236b 100644 --- a/Source/WebKit/chromium/src/WebInputElement.cpp +++ b/Source/WebKit/chromium/src/WebInputElement.cpp @@ -163,6 +163,11 @@ bool WebInputElement::isValidValue(const WebString& value) const return constUnwrap<HTMLInputElement>()->isValidValue(value); } +void WebInputElement::setChecked(bool nowChecked, bool sendChangeEvent) +{ + unwrap<HTMLInputElement>()->setChecked(nowChecked, sendChangeEvent ? DispatchChangeEvent : DispatchNoEvent); +} + bool WebInputElement::isChecked() const { return constUnwrap<HTMLInputElement>()->checked(); diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index 27d57cfbc..e3e720b6e 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -38,12 +38,17 @@ #include "Node.h" #include "NodeList.h" #include "EventListenerWrapper.h" +#include "RenderObject.h" +#include "RenderWidget.h" #include "WebDOMEvent.h" #include "WebDOMEventListener.h" #include "WebDocument.h" #include "WebElement.h" #include "WebFrameImpl.h" #include "WebNodeList.h" +#include "WebPluginContainer.h" +#include "WebPluginContainerImpl.h" +#include "Widget.h" #include "markup.h" #include <public/WebString.h> #include <public/WebVector.h> @@ -204,8 +209,7 @@ bool WebNode::dispatchEvent(const WebDOMEvent& event) void WebNode::simulateClick() { - RefPtr<Event> noEvent; - m_private->dispatchSimulatedClick(noEvent); + m_private->dispatchSimulatedClick(0); } WebNodeList WebNode::getElementsByTagName(const WebString& tag) const @@ -236,6 +240,22 @@ bool WebNode::hasNonEmptyBoundingBox() const return m_private->hasNonEmptyBoundingBox(); } +WebPluginContainer* WebNode::pluginContainer() const +{ + if (isNull()) + return 0; + const Node* coreNode = constUnwrap<Node>(); + if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLNames::embedTag)) { + RenderObject* object = coreNode->renderer(); + if (object && object->isWidget()) { + Widget* widget = WebCore::toRenderWidget(object)->widget(); + if (widget && widget->isPluginContainer()) + return static_cast<WebPluginContainerImpl*>(widget); + } + } + return 0; +} + WebNode::WebNode(const PassRefPtr<Node>& node) : m_private(node) { diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp index 01cacda2a..53882f9e7 100644 --- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp +++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp @@ -44,6 +44,7 @@ #include "Settings.h" #include "WebInputEventConversion.h" #include "WebPagePopup.h" +#include "WebSettingsImpl.h" #include "WebViewClient.h" #include "WebViewImpl.h" #include "WebWidgetClient.h" @@ -242,7 +243,7 @@ void WebPagePopupImpl::layout() void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions) { - PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque); + PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque, m_webView->settingsImpl()->applyDeviceScaleFactorInCompositor()); } void WebPagePopupImpl::resize(const WebSize& newSize) @@ -304,6 +305,7 @@ void WebPagePopupImpl::setFocus(bool enable) void WebPagePopupImpl::close() { + m_closing = true; if (m_page && m_page->mainFrame()) m_page->mainFrame()->loader()->frameDetached(); m_page.clear(); diff --git a/Source/WebKit/chromium/src/WebPasswordFormData.cpp b/Source/WebKit/chromium/src/WebPasswordFormData.cpp index efd8de32b..fe438200a 100644 --- a/Source/WebKit/chromium/src/WebPasswordFormData.cpp +++ b/Source/WebKit/chromium/src/WebPasswordFormData.cpp @@ -138,6 +138,7 @@ void assemblePasswordFormResult(const KURL& fullOrigin, if (password) { result->passwordElement = password->name(); result->passwordValue = password->value(); + result->passwordShouldAutocomplete = password->shouldAutocomplete(); } if (oldPassword) { result->oldPasswordElement = oldPassword->name(); diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 87a660156..075fc0548 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -67,6 +67,7 @@ #include "ScrollAnimator.h" #include "ScrollView.h" #include "ScrollbarTheme.h" +#include "ScrollingCoordinator.h" #include "TouchEvent.h" #include "UserGestureIndicator.h" #include "WebPrintParams.h" @@ -133,13 +134,12 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec // The plugin is positioned in window coordinates, so it needs to be painted // in window coordinates. - IntPoint origin = view->windowToContents(IntPoint(0, 0)); - gc->translate(static_cast<float>(origin.x()), static_cast<float>(origin.y())); + IntPoint origin = view->contentsToWindow(IntPoint(0, 0)); + gc->translate(static_cast<float>(-origin.x()), static_cast<float>(-origin.y())); WebCanvas* canvas = gc->platformContext()->canvas(); - IntRect windowRect = - IntRect(view->contentsToWindow(enclosingIntRect(scaledDamageRect).location()), enclosingIntRect(scaledDamageRect).size()); + IntRect windowRect = view->contentsToWindow(enclosingIntRect(scaledDamageRect)); m_webPlugin->paint(canvas, windowRect); gc->restore(); @@ -532,6 +532,28 @@ void WebPluginContainerImpl::setIsAcceptingTouchEvents(bool acceptingTouchEvents m_element->document()->didRemoveTouchEventHandler(); } +void WebPluginContainerImpl::setWantsWheelEvents(bool wantsWheelEvents) +{ + if (m_wantsWheelEvents == wantsWheelEvents) + return; + m_wantsWheelEvents = wantsWheelEvents; + if (Page* page = m_element->document()->page()) { + if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator()) { + if (parent() && parent()->isFrameView()) + scrollingCoordinator->frameViewLayoutUpdated(static_cast<FrameView*>(parent())); + } + } +} + +WebPoint WebPluginContainerImpl::windowToLocalPoint(const WebPoint& point) +{ + ScrollView* view = parent(); + if (!view) + return point; + WebPoint windowPoint = view->windowToContents(point); + return roundedIntPoint(m_element->renderer()->absoluteToLocal(LayoutPoint(windowPoint), UseTransforms | SnapOffsetForTransforms)); +} + void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response) { // Make sure that the plugin receives window geometry before data, or else @@ -582,6 +604,11 @@ bool WebPluginContainerImpl::canProcessDrag() const return m_webPlugin->canProcessDrag(); } +bool WebPluginContainerImpl::wantsWheelEvents() +{ + return m_wantsWheelEvents; +} + void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver* observer) { size_t pos = m_pluginLoadObservers.find(observer); @@ -641,6 +668,7 @@ WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme , m_ioSurfaceId(0) #endif , m_isAcceptingTouchEvents(false) + , m_wantsWheelEvents(false) { } @@ -818,8 +846,7 @@ void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, IntRect& clipRect, Vector<IntRect>& cutOutRects) { - windowRect = IntRect( - parent()->contentsToWindow(frameRect.location()), frameRect.size()); + windowRect = parent()->contentsToWindow(frameRect); // Calculate a clip-rect so that we don't overlap the scrollbars, etc. clipRect = windowClipRect(); diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index 89f2971b7..b4958fe19 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -79,6 +79,7 @@ public: virtual bool getFormValue(String&); virtual bool supportsKeyboardFocus() const; virtual bool canProcessDrag() const; + virtual bool wantsWheelEvents(); // Widget methods virtual void setFrameRect(const WebCore::IntRect&); @@ -113,6 +114,8 @@ public: virtual void setOpaque(bool); virtual bool isRectTopmost(const WebRect&); virtual void setIsAcceptingTouchEvents(bool); + virtual void setWantsWheelEvents(bool); + virtual WebPoint windowToLocalPoint(const WebPoint&); // This cannot be null. WebPlugin* plugin() { return m_webPlugin; } @@ -199,6 +202,7 @@ private: OwnPtr<ScrollbarGroup> m_scrollbarGroup; bool m_isAcceptingTouchEvents; + bool m_wantsWheelEvents; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index 9009ff9fa..a195de292 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -359,24 +359,6 @@ bool WebRuntimeFeatures::isPeerConnectionEnabled() #endif } -void WebRuntimeFeatures::enableDeprecatedPeerConnection(bool enable) -{ -#if ENABLE(MEDIA_STREAM) - RuntimeEnabledFeatures::setDeprecatedPeerConnectionEnabled(enable); -#else - UNUSED_PARAM(enable); -#endif -} - -bool WebRuntimeFeatures::isDeprecatedPeerConnectionEnabled() -{ -#if ENABLE(MEDIA_STREAM) - return RuntimeEnabledFeatures::deprecatedPeerConnectionEnabled(); -#else - return false; -#endif -} - void WebRuntimeFeatures::enableFullScreenAPI(bool enable) { #if ENABLE(FULLSCREEN_API) @@ -395,24 +377,6 @@ bool WebRuntimeFeatures::isFullScreenAPIEnabled() #endif } -void WebRuntimeFeatures::enablePointerLock(bool enable) -{ -#if ENABLE(POINTER_LOCK) - RuntimeEnabledFeatures::setPointerLockEnabled(enable); -#else - UNUSED_PARAM(enable); -#endif -} - -bool WebRuntimeFeatures::isPointerLockEnabled() -{ -#if ENABLE(POINTER_LOCK) - return RuntimeEnabledFeatures::pointerLockEnabled(); -#else - return false; -#endif -} - void WebRuntimeFeatures::enableMediaSource(bool enable) { #if ENABLE(MEDIA_SOURCE) diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index b14cde32f..20fcc1b96 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -53,7 +53,7 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings) , m_showPaintRects(false) , m_renderVSyncEnabled(true) , m_viewportEnabled(false) - , m_applyDefaultDeviceScaleFactorInCompositor(false) + , m_applyDeviceScaleFactorInCompositor(false) , m_gestureTapHighlightEnabled(true) , m_autoZoomFocusedNodeToLegibleScale(false) , m_deferredImageDecodingEnabled(false) @@ -139,9 +139,9 @@ bool WebSettingsImpl::deviceSupportsTouch() return m_settings->deviceSupportsTouch(); } -void WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDefaultDeviceScaleFactorInCompositor) +void WebSettingsImpl::setApplyDeviceScaleFactorInCompositor(bool applyDeviceScaleFactorInCompositor) { - m_applyDefaultDeviceScaleFactorInCompositor = applyDefaultDeviceScaleFactorInCompositor; + m_applyDeviceScaleFactorInCompositor = applyDeviceScaleFactorInCompositor; } void WebSettingsImpl::setApplyPageScaleFactorInCompositor(bool applyPageScaleFactorInCompositor) @@ -431,6 +431,11 @@ void WebSettingsImpl::setEditingBehavior(EditingBehavior behavior) m_settings->setEditingBehaviorType(static_cast<WebCore::EditingBehaviorType>(behavior)); } +void WebSettingsImpl::setAcceleratedAnimationEnabled(bool enabled) +{ + m_acceleratedAnimationEnabled = enabled; +} + void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) { m_settings->setAcceleratedCompositingEnabled(enabled); @@ -586,6 +591,11 @@ void WebSettingsImpl::setPasswordEchoDurationInSeconds(double durationInSeconds) m_settings->setPasswordEchoDurationInSeconds(durationInSeconds); } +void WebSettingsImpl::setPerTilePaintingEnabled(bool enabled) +{ + m_perTilePaintingEnabled = enabled; +} + void WebSettingsImpl::setShouldPrintBackgrounds(bool enabled) { m_settings->setShouldPrintBackgrounds(enabled); @@ -600,6 +610,11 @@ void WebSettingsImpl::setEnableScrollAnimator(bool enabled) #endif } +void WebSettingsImpl::setEnableTouchAdjustment(bool enabled) +{ + m_settings->setTouchAdjustmentEnabled(enabled); +} + bool WebSettingsImpl::scrollAnimatorEnabled() const { #if ENABLE(SMOOTH_SCROLLING) @@ -696,4 +711,9 @@ bool WebSettingsImpl::applyPageScaleFactorInCompositor() const return m_settings->applyPageScaleFactorInCompositor(); } +void WebSettingsImpl::setAllowCustomScrollbarInMainFrame(bool enabled) +{ + m_settings->setAllowCustomScrollbarInMainFrame(enabled); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index ff88bac61..98520eadf 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -48,6 +48,7 @@ public: virtual bool scrollAnimatorEnabled() const; virtual bool viewportEnabled() const { return m_viewportEnabled; } virtual void setAccelerated2dCanvasEnabled(bool); + virtual void setAcceleratedAnimationEnabled(bool); virtual void setAcceleratedCompositingEnabled(bool); virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool); virtual void setAcceleratedCompositingForAnimationEnabled(bool); @@ -60,10 +61,11 @@ public: virtual void setAcceleratedPaintingEnabled(bool); virtual void setAllowDisplayOfInsecureContent(bool); virtual void setAllowFileAccessFromFileURLs(bool); + virtual void setAllowCustomScrollbarInMainFrame(bool); virtual void setAllowRunningOfInsecureContent(bool); virtual void setAllowScriptsToCloseWindows(bool); virtual void setAllowUniversalAccessFromFileURLs(bool); - virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool); + virtual void setApplyDeviceScaleFactorInCompositor(bool); virtual void setApplyPageScaleFactorInCompositor(bool); virtual void setAsynchronousSpellCheckingEnabled(bool); virtual void setAuthorAndUserStylesEnabled(bool); @@ -87,6 +89,7 @@ public: virtual void setEditableLinkBehaviorNeverLive(); virtual void setEditingBehavior(EditingBehavior); virtual void setEnableScrollAnimator(bool); + virtual void setEnableTouchAdjustment(bool); virtual void setExperimentalCSSCustomFilterEnabled(bool); virtual void setExperimentalCSSGridLayoutEnabled(bool); virtual void setCSSStickyPositionEnabled(bool); @@ -126,6 +129,7 @@ public: virtual void setPageCacheSupportsPlugins(bool); virtual void setPasswordEchoDurationInSeconds(double); virtual void setPasswordEchoEnabled(bool); + virtual void setPerTilePaintingEnabled(bool); virtual void setPictographFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON); virtual void setPluginsEnabled(bool); virtual void setPrivilegedWebGLExtensionsEnabled(bool); @@ -165,11 +169,13 @@ public: bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } bool showPaintRects() const { return m_showPaintRects; } bool renderVSyncEnabled() const { return m_renderVSyncEnabled; } - bool applyDefaultDeviceScaleFactorInCompositor() const { return m_applyDefaultDeviceScaleFactorInCompositor; } + bool applyDeviceScaleFactorInCompositor() const { return m_applyDeviceScaleFactorInCompositor; } bool applyPageScaleFactorInCompositor() const; bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNodeToLegibleScale; } - bool gestureTapHighlightEnabled() { return m_gestureTapHighlightEnabled; } - bool doubleTapToZoomEnabled() { return m_doubleTapToZoomEnabled; } + bool gestureTapHighlightEnabled() const { return m_gestureTapHighlightEnabled; } + bool doubleTapToZoomEnabled() const { return m_doubleTapToZoomEnabled; } + bool perTilePaintingEnabled() const { return m_perTilePaintingEnabled; } + bool acceleratedAnimationEnabled() const { return m_acceleratedAnimationEnabled; } WebSize defaultTileSize() const { return m_defaultTileSize; } WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; } @@ -180,11 +186,13 @@ private: bool m_showPaintRects; bool m_renderVSyncEnabled; bool m_viewportEnabled; - bool m_applyDefaultDeviceScaleFactorInCompositor; + bool m_applyDeviceScaleFactorInCompositor; bool m_gestureTapHighlightEnabled; bool m_autoZoomFocusedNodeToLegibleScale; bool m_deferredImageDecodingEnabled; bool m_doubleTapToZoomEnabled; + bool m_perTilePaintingEnabled; + bool m_acceleratedAnimationEnabled; WebSize m_defaultTileSize; WebSize m_maxUntiledLayerSize; }; diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index f6f9fc6fa..7aa12048f 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -32,7 +32,6 @@ #include "WebViewImpl.h" #include "AXObjectCache.h" -#include "ActivePlatformGestureAnimation.h" #include "AutofillPopupMenuClient.h" #include "BackForwardListChromium.h" #include "BatteryClientImpl.h" @@ -95,7 +94,6 @@ #include "PlatformContextSkia.h" #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" -#include "PlatformThemeChromiumLinux.h" #include "PlatformWheelEvent.h" #include "PointerLockController.h" #include "PopupContainer.h" @@ -146,6 +144,7 @@ #include "WebViewClient.h" #include "WheelEvent.h" #include "painting/GraphicsContextBuilder.h" +#include "src/WebActiveGestureAnimation.h" #include <public/Platform.h> #include <public/WebCompositorOutputSurface.h> #include <public/WebCompositorSupport.h> @@ -165,16 +164,23 @@ #include <wtf/TemporaryChange.h> #include <wtf/Uint8ClampedArray.h> +#if ENABLE(DEFAULT_RENDER_THEME) +#include "PlatformThemeChromiumDefault.h" +#include "RenderThemeChromiumDefault.h" +#endif + #if ENABLE(GESTURE_EVENTS) -#include "PlatformGestureCurveFactory.h" #include "PlatformGestureEvent.h" #include "TouchDisambiguation.h" #endif #if OS(WINDOWS) +#if !ENABLE(DEFAULT_RENDER_THEME) #include "RenderThemeChromiumWin.h" +#endif #else -#if OS(UNIX) && !OS(DARWIN) +#if OS(UNIX) && !OS(DARWIN) && !ENABLE(DEFAULT_RENDER_THEME) +#include "PlatformThemeChromiumLinux.h" #include "RenderThemeChromiumLinux.h" #endif #include "RenderTheme.h" @@ -425,6 +431,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_compositorSurfaceReady(false) , m_deviceScaleInCompositor(1) , m_inputHandlerIdentifier(-1) + , m_isFontAtlasLoaded(false) #endif #if ENABLE(INPUT_SPEECH) , m_speechInputClient(SpeechInputClientImpl::create(client)) @@ -641,15 +648,15 @@ void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event) #endif } -void WebViewImpl::scrollBy(const WebCore::IntPoint& delta) +void WebViewImpl::scrollBy(const WebPoint& delta) { WebMouseWheelEvent syntheticWheel; const float tickDivisor = WebCore::WheelEvent::tickMultiplier; - syntheticWheel.deltaX = delta.x(); - syntheticWheel.deltaY = delta.y(); - syntheticWheel.wheelTicksX = delta.x() / tickDivisor; - syntheticWheel.wheelTicksY = delta.y() / tickDivisor; + syntheticWheel.deltaX = delta.x; + syntheticWheel.deltaY = delta.y; + syntheticWheel.wheelTicksX = delta.x / tickDivisor; + syntheticWheel.wheelTicksY = delta.y / tickDivisor; syntheticWheel.hasPreciseScrollingDeltas = true; syntheticWheel.x = m_lastWheelPosition.x; syntheticWheel.y = m_lastWheelPosition.y; @@ -677,13 +684,10 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) #endif break; case WebInputEvent::GestureTapCancel: - if (m_linkHighlight) - m_linkHighlight->startHighlightAnimationIfNeeded(); - break; case WebInputEvent::GestureTap: case WebInputEvent::GestureLongPress: - // If a link highlight is active, kill it. - m_linkHighlight.clear(); + if (m_linkHighlight) + m_linkHighlight->startHighlightAnimationIfNeeded(); break; default: break; @@ -691,13 +695,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event) switch (event.type) { case WebInputEvent::GestureFlingStart: { + if (mainFrameImpl()->frame()->eventHandler()->isScrollbarHandlingGestures()) + break; m_client->cancelScheduledContentIntents(); m_lastWheelPosition = WebPoint(event.x, event.y); m_lastWheelGlobalPosition = WebPoint(event.globalX, event.globalY); m_flingModifier = event.modifiers; - // FIXME: Make the curve parametrizable from the browser. - OwnPtr<PlatformGestureCurve> flingCurve = PlatformGestureCurveFactory::get()->createCurve(event.data.flingStart.sourceDevice, FloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY)); - m_gestureAnimation = ActivePlatformGestureAnimation::create(flingCurve.release(), this); + OwnPtr<WebGestureCurve> flingCurve = adoptPtr(Platform::current()->createFlingAnimationCurve(event.data.flingStart.sourceDevice, WebFloatPoint(event.data.flingStart.velocityX, event.data.flingStart.velocityY), WebSize())); + m_gestureAnimation = WebActiveGestureAnimation::createAtAnimationStart(flingCurve.release(), this); scheduleAnimation(); eventSwallowed = true; break; @@ -799,8 +804,8 @@ void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar m_lastWheelPosition = parameters.point; m_lastWheelGlobalPosition = parameters.globalPoint; m_flingModifier = parameters.modifiers; - OwnPtr<PlatformGestureCurve> curve = PlatformGestureCurveFactory::get()->createCurve(parameters.sourceDevice, parameters.delta, IntPoint(parameters.cumulativeScroll)); - m_gestureAnimation = ActivePlatformGestureAnimation::create(curve.release(), this, parameters.startTime); + OwnPtr<WebGestureCurve> curve = adoptPtr(Platform::current()->createFlingAnimationCurve(parameters.sourceDevice, WebFloatPoint(parameters.delta), parameters.cumulativeScroll)); + m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.release(), this, parameters.startTime); scheduleAnimation(); } @@ -831,6 +836,18 @@ WebViewBenchmarkSupport* WebViewImpl::benchmarkSupport() return &m_benchmarkSupport; } +void WebViewImpl::setShowFPSCounter(bool show) +{ + if (isAcceleratedCompositingActive()) { + TRACE_EVENT0("webkit", "WebViewImpl::setShowFPSCounter"); +#if USE(ACCELERATED_COMPOSITING) + loadFontAtlasIfNecessary(); +#endif + m_layerTreeView->setShowFPSCounter(show); + } + settingsImpl()->setShowFPSCounter(show); +} + bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) { ASSERT((event.type == WebInputEvent::RawKeyDown) @@ -1817,7 +1834,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions opt } double paintStart = currentTime(); - PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque); + PageWidgetDelegate::paint(m_page.get(), pageOverlays(), canvas, rect, isTransparent() ? PageWidgetDelegate::Translucent : PageWidgetDelegate::Opaque, m_webSettings->applyDeviceScaleFactorInCompositor()); double paintEnd = currentTime(); double pixelsPerSec = (rect.width * rect.height) / (paintEnd - paintStart); WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintDurationMS", (paintEnd - paintStart) * 1000, 0, 120, 30); @@ -2913,7 +2930,7 @@ void WebViewImpl::setDeviceScaleFactor(float scaleFactor) page()->setDeviceScaleFactor(scaleFactor); - if (m_layerTreeView && m_webSettings->applyDefaultDeviceScaleFactorInCompositor()) { + if (m_layerTreeView && m_webSettings->applyDeviceScaleFactorInCompositor()) { m_deviceScaleInCompositor = page()->deviceScaleFactor(); m_layerTreeView->setDeviceScaleFactor(m_deviceScaleInCompositor); } @@ -2987,6 +3004,14 @@ void WebViewImpl::setIgnoreViewportTagMaximumScale(bool flag) m_page->chrome()->client()->dispatchViewportPropertiesDidChange(page()->mainFrame()->document()->viewportArguments()); } +static IntSize unscaledContentsSize(Frame* frame) +{ + RenderView* root = frame->contentRenderer(); + if (!root) + return IntSize(); + return root->unscaledDocumentRect().size(); +} + bool WebViewImpl::computePageScaleFactorLimits() { if (m_pageDefinedMinimumPageScaleFactor == -1 || m_pageDefinedMaximumPageScaleFactor == -1) @@ -2999,11 +3024,10 @@ bool WebViewImpl::computePageScaleFactorLimits() m_maximumPageScaleFactor = max(min(m_pageDefinedMaximumPageScaleFactor, maxPageScaleFactor), minPageScaleFactor) * (deviceScaleFactor() / m_deviceScaleInCompositor); int viewWidthNotIncludingScrollbars = page()->mainFrame()->view()->visibleContentRect(false).width(); - int contentsWidth = mainFrame()->contentsSize().width; - if (viewWidthNotIncludingScrollbars && contentsWidth) { + int unscaledContentsWidth = unscaledContentsSize(page()->mainFrame()).width(); + if (viewWidthNotIncludingScrollbars && unscaledContentsWidth) { // Limit page scaling down to the document width. - int unscaledContentWidth = contentsWidth / pageScaleFactor(); - m_minimumPageScaleFactor = max(m_minimumPageScaleFactor, static_cast<float>(viewWidthNotIncludingScrollbars) / unscaledContentWidth); + m_minimumPageScaleFactor = max(m_minimumPageScaleFactor, static_cast<float>(viewWidthNotIncludingScrollbars) / unscaledContentsWidth); m_maximumPageScaleFactor = max(m_minimumPageScaleFactor, m_maximumPageScaleFactor); } ASSERT(m_minimumPageScaleFactor <= m_maximumPageScaleFactor); @@ -3533,7 +3557,9 @@ void WebViewImpl::setDomainRelaxationForbidden(bool forbidden, const WebString& void WebViewImpl::setScrollbarColors(unsigned inactiveColor, unsigned activeColor, unsigned trackColor) { -#if OS(UNIX) && !OS(DARWIN) && !OS(ANDROID) +#if ENABLE(DEFAULT_RENDER_THEME) + PlatformThemeChromiumDefault::setScrollbarColors(inactiveColor, activeColor, trackColor); +#elif OS(UNIX) && !OS(DARWIN) && !OS(ANDROID) PlatformThemeChromiumLinux::setScrollbarColors(inactiveColor, activeColor, trackColor); #endif } @@ -3542,11 +3568,11 @@ void WebViewImpl::setSelectionColors(unsigned activeBackgroundColor, unsigned activeForegroundColor, unsigned inactiveBackgroundColor, unsigned inactiveForegroundColor) { -#if OS(UNIX) && !OS(DARWIN) && !OS(ANDROID) - RenderThemeChromiumLinux::setSelectionColors(activeBackgroundColor, - activeForegroundColor, - inactiveBackgroundColor, - inactiveForegroundColor); +#if ENABLE(DEFAULT_RENDER_THEME) + RenderThemeChromiumDefault::setSelectionColors(activeBackgroundColor, activeForegroundColor, inactiveBackgroundColor, inactiveForegroundColor); + theme()->platformColorsDidChange(); +#elif OS(UNIX) && !OS(DARWIN) && !OS(ANDROID) + RenderThemeChromiumLinux::setSelectionColors(activeBackgroundColor, activeForegroundColor, inactiveBackgroundColor, inactiveForegroundColor); theme()->platformColorsDidChange(); #endif } @@ -3964,10 +3990,14 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) WebLayerTreeView::Settings layerTreeViewSettings; layerTreeViewSettings.acceleratePainting = page()->settings()->acceleratedDrawingEnabled(); + layerTreeViewSettings.showDebugBorders = page()->settings()->showDebugBorders(); layerTreeViewSettings.showFPSCounter = settingsImpl()->showFPSCounter(); layerTreeViewSettings.showPlatformLayerTree = settingsImpl()->showPlatformLayerTree(); layerTreeViewSettings.showPaintRects = settingsImpl()->showPaintRects(); layerTreeViewSettings.renderVSyncEnabled = settingsImpl()->renderVSyncEnabled(); + layerTreeViewSettings.perTilePaintingEnabled = settingsImpl()->perTilePaintingEnabled(); + layerTreeViewSettings.acceleratedAnimationEnabled = settingsImpl()->acceleratedAnimationEnabled(); + layerTreeViewSettings.pageScalePinchZoomEnabled = settingsImpl()->applyPageScaleFactorInCompositor(); layerTreeViewSettings.defaultTileSize = settingsImpl()->defaultTileSize(); layerTreeViewSettings.maxUntiledLayerSize = settingsImpl()->maxUntiledLayerSize(); @@ -3978,7 +4008,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(this, *m_rootLayer, layerTreeViewSettings)); if (m_layerTreeView) { - if (m_webSettings->applyDefaultDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1) { + if (m_webSettings->applyDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1) { ASSERT(page()->deviceScaleFactor()); m_deviceScaleInCompositor = page()->deviceScaleFactor(); @@ -3995,17 +4025,15 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) m_client->didActivateCompositor(m_inputHandlerIdentifier); m_isAcceleratedCompositingActive = true; m_compositorCreationFailed = false; + m_isFontAtlasLoaded = false; if (m_pageOverlays) m_pageOverlays->update(); - // Only allocate the font atlas if we have reason to use the heads-up display. - if (layerTreeViewSettings.showFPSCounter || layerTreeViewSettings.showPlatformLayerTree) { - TRACE_EVENT0("cc", "WebViewImpl::setIsAcceleratedCompositingActive(true) initialize font atlas"); - WebRect asciiToRectTable[128]; - int fontHeight; - SkBitmap bitmap = WebCore::CompositorHUDFontAtlas::generateFontAtlas(asciiToRectTable, fontHeight); - m_layerTreeView->setFontAtlas(asciiToRectTable, bitmap, fontHeight); - } + if (layerTreeViewSettings.showPlatformLayerTree) + loadFontAtlasIfNecessary(); + + if (settingsImpl()->showFPSCounter()) + setShowFPSCounter(true); } else { m_nonCompositedContentHost.clear(); m_isAcceleratedCompositingActive = false; @@ -4017,6 +4045,21 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositingActive); } +void WebViewImpl::loadFontAtlasIfNecessary() +{ + ASSERT(m_layerTreeView); + + if (m_isFontAtlasLoaded) + return; + + TRACE_EVENT0("webkit", "WebViewImpl::loadFontAtlas"); + WebRect asciiToRectTable[128]; + int fontHeight; + SkBitmap bitmap = WebCore::CompositorHUDFontAtlas::generateFontAtlas(asciiToRectTable, fontHeight); + m_layerTreeView->setFontAtlas(asciiToRectTable, bitmap, fontHeight); + m_isFontAtlasLoaded = true; +} + #endif namespace { diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 02a1e5370..da5f69b9e 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -44,13 +44,13 @@ #include "PageOverlayList.h" #include "PagePopupDriver.h" #include "PageWidgetDelegate.h" -#include "PlatformGestureCurveTarget.h" #include "UserMediaClientImpl.h" #include "WebInputEvent.h" #include "WebNavigationPolicy.h" #include "WebView.h" #include "WebViewBenchmarkSupportImpl.h" #include <public/WebFloatQuad.h> +#include <public/WebGestureCurveTarget.h> #include <public/WebLayer.h> #include <public/WebLayerTreeViewClient.h> #include <public/WebPoint.h> @@ -61,7 +61,6 @@ #include <wtf/RefCounted.h> namespace WebCore { -class ActivePlatformGestureAnimation; class ChromiumDataObject; class Color; class DocumentLoader; @@ -74,7 +73,6 @@ class Page; class PageGroup; class PagePopup; class PagePopupClient; -class PlatformGestureCurveTarget; class PlatformKeyboardEvent; class PopupContainer; class PopupMenuClient; @@ -101,6 +99,7 @@ class SpeechRecognitionClientProxy; class UserMediaClientImpl; class ValidationMessageClientImpl; class WebAccessibilityObject; +class WebActiveGestureAnimation; class WebCompositorImpl; class WebDevToolsAgentClient; class WebDevToolsAgentPrivate; @@ -119,13 +118,13 @@ class WebTouchEvent; class WebViewBenchmarkSupport; class WebViewImpl : public WebView - , public WebLayerTreeViewClient - , public RefCounted<WebViewImpl> - , public WebCore::PlatformGestureCurveTarget + , public WebLayerTreeViewClient + , public RefCounted<WebViewImpl> + , public WebGestureCurveTarget #if ENABLE(PAGE_POPUP) - , public WebCore::PagePopupDriver + , public WebCore::PagePopupDriver #endif - , public PageWidgetEventHandler { + , public PageWidgetEventHandler { public: enum AutoZoomType { DoubleTap, @@ -309,6 +308,7 @@ public: #endif virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&); virtual WebViewBenchmarkSupport* benchmarkSupport(); + virtual void setShowFPSCounter(bool); // WebLayerTreeViewClient virtual void willBeginFrame(); @@ -404,8 +404,8 @@ public: void numberOfWheelEventHandlersChanged(unsigned); void hasTouchEventHandlers(bool); - // PlatformGestureCurveTarget implementation for wheel fling. - virtual void scrollBy(const WebCore::IntPoint&); + // WebGestureCurveTarget implementation for fling. + virtual void scrollBy(const WebPoint&); // Handles context menu events orignated via the the keyboard. These // include the VK_APPS virtual key and the Shift+F10 combine. Code is @@ -599,6 +599,7 @@ public: LinkHighlight* linkHighlight() { return m_linkHighlight.get(); } #endif + WebSettingsImpl* settingsImpl(); private: bool computePageScaleFactorLimits(); @@ -650,6 +651,7 @@ private: #if USE(ACCELERATED_COMPOSITING) void setIsAcceleratedCompositingActive(bool); + void loadFontAtlasIfNecessary(); void doComposite(); void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); void reallocateRenderer(); @@ -677,8 +679,6 @@ private: virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; - WebSettingsImpl* settingsImpl(); - WebViewClient* m_client; WebAutofillClient* m_autofillClient; WebPermissionClient* m_permissionClient; @@ -846,6 +846,7 @@ private: bool m_compositorSurfaceReady; float m_deviceScaleInCompositor; int m_inputHandlerIdentifier; + bool m_isFontAtlasLoaded; #endif static const WebInputEvent* m_currentInputEvent; @@ -870,7 +871,7 @@ private: #if ENABLE(NAVIGATOR_CONTENT_UTILS) OwnPtr<NavigatorContentUtilsClientImpl> m_navigatorContentUtilsClient; #endif - OwnPtr<WebCore::ActivePlatformGestureAnimation> m_gestureAnimation; + OwnPtr<WebActiveGestureAnimation> m_gestureAnimation; WebPoint m_lastWheelPosition; WebPoint m_lastWheelGlobalPosition; int m_flingModifier; diff --git a/Source/WebKit/chromium/tests/DecimalTest.cpp b/Source/WebKit/chromium/tests/DecimalTest.cpp index 8d4106260..c10de56c3 100644 --- a/Source/WebKit/chromium/tests/DecimalTest.cpp +++ b/Source/WebKit/chromium/tests/DecimalTest.cpp @@ -897,13 +897,17 @@ TEST_F(DecimalTest, RealWorldExampleRangeStepUpStepDown) TEST_F(DecimalTest, Remainder) { - EXPECT_EQ(encode(9, -1, Negative), encode(21, -1, Positive).remainder(3)); + EXPECT_EQ(encode(21, -1, Positive), encode(21, -1, Positive).remainder(3)); EXPECT_EQ(Decimal(1), Decimal(10).remainder(3)); + EXPECT_EQ(Decimal(1), Decimal(10).remainder(-3)); EXPECT_EQ(encode(1, 0, Negative), Decimal(-10).remainder(3)); + EXPECT_EQ(Decimal(-1), Decimal(-10).remainder(-3)); EXPECT_EQ(encode(2, -1, Positive), encode(102, -1, Positive).remainder(1)); EXPECT_EQ(encode(1, -1, Positive), Decimal(10).remainder(encode(3, -1, Positive))); - EXPECT_EQ(encode(3, -1, Negative), encode(36, -1, Positive).remainder(encode(13, -1, Positive))); + EXPECT_EQ(Decimal(1), encode(36, -1, Positive).remainder(encode(13, -1, Positive))); EXPECT_EQ(encode(1, 87, Positive), (encode(1234, 100, Positive).remainder(Decimal(3)))); + EXPECT_EQ(Decimal(500), (Decimal(500).remainder(1000))); + EXPECT_EQ(Decimal(-500), (Decimal(-500).remainder(1000))); } TEST_F(DecimalTest, RemainderBigExponent) diff --git a/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp b/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp index 482549805..4bcc29882 100644 --- a/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp +++ b/Source/WebKit/chromium/tests/DeferredImageDecoderTest.cpp @@ -30,24 +30,57 @@ #include "ImageDecodingStore.h" #include "MockImageDecoder.h" #include "NativeImageSkia.h" +#include "SharedBuffer.h" #include "SkCanvas.h" #include "SkDevice.h" #include "SkPicture.h" #include <gtest/gtest.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> +#include <wtf/Threading.h> using namespace WebCore; namespace { -class DeferredImageDecoderTest : public ::testing::Test { +// Raw data for a PNG file with 1x1 white pixels. +const unsigned char whitePNG[] = { + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, + 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00, 0x00, 0x90, + 0x77, 0x53, 0xde, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, + 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 0x00, 0x09, + 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, + 0x0b, 0x13, 0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00, + 0x0c, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0xff, + 0xff, 0x3f, 0x00, 0x05, 0xfe, 0x02, 0xfe, 0xdc, 0xcc, 0x59, + 0xe7, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82, +}; + +static SkCanvas* createRasterCanvas(int width, int height) +{ + SkAutoTUnref<SkDevice> device(new SkDevice(SkBitmap::kARGB_8888_Config, width, height)); + return new SkCanvas(device); +} + +struct Rasterizer { + SkCanvas* canvas; + SkPicture* picture; +}; + +class DeferredImageDecoderTest : public ::testing::Test, public MockImageDecoderClient { public: virtual void SetUp() { ImageDecodingStore::initializeOnMainThread(); - m_actualDecoder = new MockImageDecoder(); - m_actualDecoder->setSize(600, 613); + m_data = SharedBuffer::create(whitePNG, sizeof(whitePNG)); + m_actualDecoder = new MockImageDecoder(this); + m_actualDecoder->setSize(1, 1); m_lazyDecoder = DeferredImageDecoder::createForTesting(adoptPtr(m_actualDecoder)); - m_canvas.setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, 100, 100))->unref(); + m_lazyDecoder->setData(m_data.get(), true); + m_canvas.reset(createRasterCanvas(100, 100)); + m_frameBufferRequestCount = 0; } virtual void TearDown() @@ -55,29 +88,43 @@ public: ImageDecodingStore::shutdown(); } + virtual void decoderBeingDestroyed() + { + m_frameBufferRequestCount = m_actualDecoder->frameBufferRequestCount(); + m_actualDecoder = 0; + } + protected: // Don't own this but saves the pointer to query states. MockImageDecoder* m_actualDecoder; OwnPtr<DeferredImageDecoder> m_lazyDecoder; SkPicture m_picture; - SkCanvas m_canvas; + SkAutoTUnref<SkCanvas> m_canvas; + int m_frameBufferRequestCount; + RefPtr<SharedBuffer> m_data; }; TEST_F(DeferredImageDecoderTest, drawIntoSkPicture) { OwnPtr<NativeImageSkia> image(adoptPtr(m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage())); - EXPECT_EQ(m_actualDecoder->size().width(), image->bitmap().width()); - EXPECT_EQ(m_actualDecoder->size().height(), image->bitmap().height()); + EXPECT_EQ(1, image->bitmap().width()); + EXPECT_EQ(1, image->bitmap().height()); EXPECT_FALSE(image->bitmap().isNull()); EXPECT_TRUE(image->bitmap().isImmutable()); SkCanvas* tempCanvas = m_picture.beginRecording(100, 100); tempCanvas->drawBitmap(image->bitmap(), 0, 0); m_picture.endRecording(); - EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount()); + EXPECT_EQ(0, m_frameBufferRequestCount); + + m_canvas->drawPicture(m_picture); + EXPECT_EQ(0, m_frameBufferRequestCount); - m_canvas.drawPicture(m_picture); - EXPECT_EQ(1, m_actualDecoder->frameBufferRequestCount()); + SkBitmap canvasBitmap; + canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); + ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0)); + SkAutoLockPixels autoLock(canvasBitmap); + EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0)); } TEST_F(DeferredImageDecoderTest, drawScaledIntoSkPicture) @@ -88,15 +135,58 @@ TEST_F(DeferredImageDecoderTest, drawScaledIntoSkPicture) EXPECT_TRUE(scaledBitmap.isImmutable()); EXPECT_EQ(50, scaledBitmap.width()); EXPECT_EQ(51, scaledBitmap.height()); - EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount()); + EXPECT_EQ(0, m_frameBufferRequestCount); SkCanvas* tempCanvas = m_picture.beginRecording(100, 100); tempCanvas->drawBitmap(scaledBitmap, 0, 0); m_picture.endRecording(); - EXPECT_EQ(0, m_actualDecoder->frameBufferRequestCount()); + EXPECT_EQ(0, m_frameBufferRequestCount); + + m_canvas->drawPicture(m_picture); + EXPECT_EQ(0, m_frameBufferRequestCount); + + SkBitmap canvasBitmap; + canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); + ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0)); + SkAutoLockPixels autoLock(canvasBitmap); + EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0)); + EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(49, 50)); +} + +static void rasterizeMain(void* arg) +{ + Rasterizer* rasterizer = static_cast<Rasterizer*>(arg); + rasterizer->canvas->drawPicture(*rasterizer->picture); +} + +TEST_F(DeferredImageDecoderTest, decodeOnOtherThread) +{ + WTF::initializeThreading(); + + OwnPtr<NativeImageSkia> image(adoptPtr(m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage())); + EXPECT_EQ(1, image->bitmap().width()); + EXPECT_EQ(1, image->bitmap().height()); + EXPECT_FALSE(image->bitmap().isNull()); + EXPECT_TRUE(image->bitmap().isImmutable()); + + SkCanvas* tempCanvas = m_picture.beginRecording(100, 100); + tempCanvas->drawBitmap(image->bitmap(), 0, 0); + m_picture.endRecording(); + EXPECT_EQ(0, m_frameBufferRequestCount); + + // Create a thread to rasterize SkPicture. + Rasterizer rasterizer; + rasterizer.canvas = m_canvas; + rasterizer.picture = &m_picture; + ThreadIdentifier threadID = createThread(&rasterizeMain, &rasterizer, "RasterThread"); + waitForThreadCompletion(threadID); + EXPECT_EQ(0, m_frameBufferRequestCount); - m_canvas.drawPicture(m_picture); - EXPECT_EQ(1, m_actualDecoder->frameBufferRequestCount()); + SkBitmap canvasBitmap; + canvasBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); + ASSERT_TRUE(m_canvas->readPixels(&canvasBitmap, 0, 0)); + SkAutoLockPixels autoLock(canvasBitmap); + EXPECT_EQ(SkColorSetARGB(255, 255, 255, 255), canvasBitmap.getColor(0, 0)); } } // namespace diff --git a/Source/WebKit/chromium/tests/FakeWebPlugin.cpp b/Source/WebKit/chromium/tests/FakeWebPlugin.cpp new file mode 100644 index 000000000..5e1cb9fa0 --- /dev/null +++ b/Source/WebKit/chromium/tests/FakeWebPlugin.cpp @@ -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. + */ + +#include "config.h" +#include "FakeWebPlugin.h" + +#include "WebPluginParams.h" +#include <wtf/StdLibExtras.h> + +namespace WebKit { + +FakeWebPlugin::FakeWebPlugin(WebFrame* frame, const WebPluginParams& params) + : m_frame(frame) +{ +} + +FakeWebPlugin::~FakeWebPlugin() +{ +} + +bool FakeWebPlugin::initialize(WebPluginContainer* container) +{ + m_container = container; + return true; +} + +void FakeWebPlugin::destroy() +{ + m_container = 0; + m_frame = 0; +} + +} // namespace WebKit diff --git a/Source/WebKit/chromium/tests/FakeWebPlugin.h b/Source/WebKit/chromium/tests/FakeWebPlugin.h new file mode 100644 index 000000000..7ee41c8dc --- /dev/null +++ b/Source/WebKit/chromium/tests/FakeWebPlugin.h @@ -0,0 +1,78 @@ +/* + * 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 FakeWebPlugin_h +#define FakeWebPlugin_h + +#include "WebPlugin.h" + +namespace WebKit { + +class WebDragData; +class WebFrame; +class WebInputEvent; +class WebPluginContainer; +class WebURL; +class WebURLRequest; +class WebURLResponse; + +class FakeWebPlugin : public WebPlugin { +public: + FakeWebPlugin(WebKit::WebFrame*, const WebKit::WebPluginParams&); + virtual ~FakeWebPlugin(); + + // WebPlugin methods: + virtual bool initialize(WebKit::WebPluginContainer*) OVERRIDE; + virtual void destroy() OVERRIDE; + virtual NPObject* scriptableObject() OVERRIDE { return 0; } + virtual bool canProcessDrag() const OVERRIDE { return false; } + virtual void paint(WebKit::WebCanvas*, const WebKit::WebRect&) OVERRIDE { } + virtual void updateGeometry(const WebKit::WebRect& frameRect, const WebKit::WebRect& clipRect, const WebKit::WebVector<WebKit::WebRect>& cutOutsRects, bool isVisible) OVERRIDE { } + virtual void updateFocus(bool) OVERRIDE { } + virtual void updateVisibility(bool) OVERRIDE { } + virtual bool acceptsInputEvents() OVERRIDE { return true; } + virtual bool handleInputEvent(const WebKit::WebInputEvent&, WebKit::WebCursorInfo&) OVERRIDE { return false; } + virtual bool handleDragStatusUpdate(WebKit::WebDragStatus, const WebKit::WebDragData&, WebKit::WebDragOperationsMask, const WebKit::WebPoint& position, const WebKit::WebPoint& screenPosition) OVERRIDE { return false; } + virtual void didReceiveResponse(const WebKit::WebURLResponse&) OVERRIDE { } + virtual void didReceiveData(const char* data, int dataLength) OVERRIDE { } + virtual void didFinishLoading() OVERRIDE { } + virtual void didFailLoading(const WebKit::WebURLError&) OVERRIDE { } + virtual void didFinishLoadingFrameRequest(const WebKit::WebURL&, void* notifyData) OVERRIDE { } + virtual void didFailLoadingFrameRequest(const WebKit::WebURL&, void* notifyData, const WebKit::WebURLError&) OVERRIDE { } + virtual bool isPlaceholder() OVERRIDE { return false; } + +private: + WebFrame* m_frame; + WebPluginContainer* m_container; +}; + +} // namespace WebKit + +#endif // FakeWebPlugin_h diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp index b04b3a945..7d9c2ec8c 100644 --- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp @@ -59,8 +59,6 @@ class GraphicsLayerChromiumTest : public testing::Test { public: GraphicsLayerChromiumTest() { - // For these tests, we will enable threaded animations. - Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(true); Platform::current()->compositorSupport()->initialize(0); m_graphicsLayer = static_pointer_cast<GraphicsLayerChromium>(GraphicsLayer::create(&m_client)); m_platformLayer = m_graphicsLayer->platformLayer(); diff --git a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp index 2be4e567e..ec079f50c 100644 --- a/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp +++ b/Source/WebKit/chromium/tests/IDBAbortOnCorruptTest.cpp @@ -24,6 +24,7 @@ */ #include "config.h" +#include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBCursorBackendInterface.h" #include "IDBDatabaseBackendInterface.h" diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp index d950c1c74..b52967ddf 100644 --- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -53,7 +53,7 @@ PassRefPtr<IDBKey> checkKeyFromValueAndKeyPathInternal(const ScriptValue& value, IDBKeyPath idbKeyPath(keyPath); EXPECT_TRUE(idbKeyPath.isValid()); - return createIDBKeyFromScriptValueAndKeyPath(value, idbKeyPath); + return createIDBKeyFromScriptValueAndKeyPath(0, value, idbKeyPath); } void checkKeyPathNullValue(const ScriptValue& value, const String& keyPath) @@ -66,7 +66,7 @@ bool injectKey(PassRefPtr<IDBKey> key, ScriptValue& value, const String& keyPath { IDBKeyPath idbKeyPath(keyPath); EXPECT_TRUE(idbKeyPath.isValid()); - return injectIDBKeyIntoScriptValue(key, value, idbKeyPath); + return injectIDBKeyIntoScriptValue(0, key, value, idbKeyPath); } void checkInjection(PassRefPtr<IDBKey> prpKey, ScriptValue& value, const String& keyPath) diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h index 4e37d3eaa..346363ac3 100644 --- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h +++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h @@ -43,21 +43,18 @@ public: virtual bool createObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { return false; }; virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { } - virtual PassRefPtr<RecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<RecordIdentifier>(); } - virtual String getRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); } - virtual bool putRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*) OVERRIDE { return false; } + virtual void putRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*) OVERRIDE { } virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { } - virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier*) OVERRIDE { } + virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier&) OVERRIDE { } virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; } - virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; } + virtual void maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { } virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; } virtual Vector<IDBIndexMetadata> getIndexes(int64_t databaseId, int64_t objectStoreId) OVERRIDE { return Vector<IDBIndexMetadata>(); } virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) OVERRIDE { return false; }; virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { } - virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier*) OVERRIDE { return false; } - virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const RecordIdentifier*) OVERRIDE { return false; } + virtual void putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier&) OVERRIDE { } virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); } virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; } @@ -65,8 +62,6 @@ public: virtual PassRefPtr<Cursor> openObjectStoreCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); } virtual PassRefPtr<Cursor> openIndexKeyCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); } virtual PassRefPtr<Cursor> openIndexCursor(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction) OVERRIDE { return PassRefPtr<Cursor>(); } - - virtual PassRefPtr<Transaction> createTransaction() OVERRIDE { return PassRefPtr<Transaction>(); } }; } // namespace WebCore diff --git a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp index 1b2ff6fe1..1d75eba8f 100644 --- a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp +++ b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp @@ -651,12 +651,25 @@ TEST(IDBLevelDBCodingTest, ComparisonTest) keys.append(DatabaseNameKey::encode("", "a")); keys.append(DatabaseNameKey::encode("a", "a")); keys.append(DatabaseMetaDataKey::encode(1, DatabaseMetaDataKey::OriginName)); - keys.append(ObjectStoreMetaDataKey::encode(1, 1, 0)); - keys.append(ObjectStoreMetaDataKey::encode(1, 1, 1)); + keys.append(DatabaseMetaDataKey::encode(1, DatabaseMetaDataKey::DatabaseName)); + keys.append(DatabaseMetaDataKey::encode(1, DatabaseMetaDataKey::UserVersion)); + keys.append(DatabaseMetaDataKey::encode(1, DatabaseMetaDataKey::MaxObjectStoreId)); + keys.append(DatabaseMetaDataKey::encode(1, DatabaseMetaDataKey::UserIntVersion)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::Name)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::KeyPath)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::AutoIncrement)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::Evictable)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::LastVersion)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::MaxIndexId)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::HasKeyPath)); + keys.append(ObjectStoreMetaDataKey::encode(1, 1, ObjectStoreMetaDataKey::KeyGeneratorCurrentNumber)); keys.append(ObjectStoreMetaDataKey::encodeMaxKey(1, 1)); keys.append(ObjectStoreMetaDataKey::encodeMaxKey(1, 2)); keys.append(ObjectStoreMetaDataKey::encodeMaxKey(1)); - keys.append(IndexMetaDataKey::encode(1, 1, 30, 0)); + keys.append(IndexMetaDataKey::encode(1, 1, 30, IndexMetaDataKey::Name)); + keys.append(IndexMetaDataKey::encode(1, 1, 30, IndexMetaDataKey::Unique)); + keys.append(IndexMetaDataKey::encode(1, 1, 30, IndexMetaDataKey::KeyPath)); + keys.append(IndexMetaDataKey::encode(1, 1, 30, IndexMetaDataKey::MultiEntry)); keys.append(IndexMetaDataKey::encode(1, 1, 31, 0)); keys.append(IndexMetaDataKey::encode(1, 1, 31, 1)); keys.append(IndexMetaDataKey::encodeMaxKey(1, 1, 31)); diff --git a/Source/WebKit/chromium/tests/IDBRequestTest.cpp b/Source/WebKit/chromium/tests/IDBRequestTest.cpp index 52a038d5b..27f6c1e6b 100644 --- a/Source/WebKit/chromium/tests/IDBRequestTest.cpp +++ b/Source/WebKit/chromium/tests/IDBRequestTest.cpp @@ -27,6 +27,7 @@ #include "IDBRequest.h" +#include "DOMStringList.h" #include "IDBCursorBackendInterface.h" #include "IDBDatabaseBackendImpl.h" #include "IDBTransactionCoordinator.h" diff --git a/Source/WebKit/chromium/tests/LevelDBTest.cpp b/Source/WebKit/chromium/tests/LevelDBTest.cpp index 2a00ae686..7dc0355df 100644 --- a/Source/WebKit/chromium/tests/LevelDBTest.cpp +++ b/Source/WebKit/chromium/tests/LevelDBTest.cpp @@ -30,7 +30,9 @@ #include "FileSystem.h" #include "LevelDBComparator.h" #include "LevelDBDatabase.h" +#include "LevelDBIterator.h" #include "LevelDBSlice.h" +#include "LevelDBTransaction.h" #include <gtest/gtest.h> #include <webkit/support/webkit_support.h> #include <wtf/Vector.h> @@ -53,7 +55,7 @@ Vector<char> encodeString(const std::string& s) { Vector<char> ret(s.size()); for (size_t i = 0; i < s.size(); ++i) - ret.append(s[i]); + ret[i] = s[i]; return ret; } @@ -100,6 +102,97 @@ TEST(LevelDBDatabaseTest, CorruptionTest) EXPECT_FALSE(success); } +TEST(LevelDBDatabaseTest, Transaction) +{ + OwnPtr<webkit_support::ScopedTempDirectory> tempDirectory = adoptPtr(webkit_support::CreateScopedTempDirectory()); + tempDirectory->CreateUniqueTempDir(); + const String path = String::fromUTF8(tempDirectory->path().c_str()); + + const Vector<char> key = encodeString("key"); + Vector<char> gotValue; + SimpleComparator comparator; + + OwnPtr<LevelDBDatabase> leveldb = LevelDBDatabase::open(path, &comparator); + EXPECT_TRUE(leveldb); + + const Vector<char> oldValue = encodeString("value"); + bool success = leveldb->put(key, oldValue); + EXPECT_TRUE(success); + + RefPtr<LevelDBTransaction> transaction = LevelDBTransaction::create(leveldb.get()); + + const Vector<char> newValue = encodeString("new value"); + success = leveldb->put(key, newValue); + EXPECT_TRUE(success); + + success = transaction->get(key, gotValue); + EXPECT_TRUE(success); + EXPECT_EQ(comparator.compare(gotValue, oldValue), 0); + + success = leveldb->get(key, gotValue); + EXPECT_TRUE(success); + EXPECT_EQ(comparator.compare(gotValue, newValue), 0); + + const Vector<char> addedKey = encodeString("added key"); + const Vector<char> addedValue = encodeString("added value"); + success = leveldb->put(addedKey, addedValue); + EXPECT_TRUE(success); + + success = leveldb->get(addedKey, gotValue); + EXPECT_TRUE(success); + EXPECT_EQ(comparator.compare(gotValue, addedValue), 0); + + success = transaction->get(addedKey, gotValue); + EXPECT_FALSE(success); +} + +TEST(LevelDBDatabaseTest, TransactionIterator) +{ + OwnPtr<webkit_support::ScopedTempDirectory> tempDirectory = adoptPtr(webkit_support::CreateScopedTempDirectory()); + tempDirectory->CreateUniqueTempDir(); + const String path = String::fromUTF8(tempDirectory->path().c_str()); + + const Vector<char> start = encodeString(""); + const Vector<char> key1 = encodeString("key1"); + const Vector<char> value1 = encodeString("value1"); + const Vector<char> key2 = encodeString("key2"); + const Vector<char> value2 = encodeString("value2"); + + SimpleComparator comparator; + bool success; + + OwnPtr<LevelDBDatabase> leveldb = LevelDBDatabase::open(path, &comparator); + EXPECT_TRUE(leveldb); + + success = leveldb->put(key1, value1); + EXPECT_TRUE(success); + success = leveldb->put(key2, value2); + EXPECT_TRUE(success); + + RefPtr<LevelDBTransaction> transaction = LevelDBTransaction::create(leveldb.get()); + + success = leveldb->remove(key2); + EXPECT_TRUE(success); + + OwnPtr<LevelDBIterator> it = transaction->createIterator(); + + it->seek(start); + + EXPECT_TRUE(it->isValid()); + EXPECT_EQ(comparator.compare(it->key(), key1), 0); + EXPECT_EQ(comparator.compare(it->value(), value1), 0); + + it->next(); + + EXPECT_TRUE(it->isValid()); + EXPECT_EQ(comparator.compare(it->key(), key2), 0); + EXPECT_EQ(comparator.compare(it->value(), value2), 0); + + it->next(); + + EXPECT_FALSE(it->isValid()); +} + } // namespace #endif // USE(LEVELDB) diff --git a/Source/WebKit/chromium/tests/LocaleMacTest.cpp b/Source/WebKit/chromium/tests/LocaleMacTest.cpp index 0d2fed154..cb00138b6 100644 --- a/Source/WebKit/chromium/tests/LocaleMacTest.cpp +++ b/Source/WebKit/chromium/tests/LocaleMacTest.cpp @@ -69,6 +69,24 @@ protected: return dateToDaysFrom1970(year, month, day) * msPerDay; } + String formatWeek(const String& localeString, const String& isoString) + { + OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); + DateComponents date; + unsigned end; + date.parseWeek(isoString.characters(), isoString.length(), 0, end); + return locale->formatDateTime(date); + } + + String formatMonth(const String& localeString, const String& isoString) + { + OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); + DateComponents date; + unsigned end; + date.parseMonth(isoString.characters(), isoString.length(), 0, end); + return locale->formatDateTime(date); + } + String formatDate(const String& localeString, int year, int month, int day) { OwnPtr<LocaleMac> locale = LocaleMac::create(localeString); @@ -158,6 +176,19 @@ protected: #endif }; +TEST_F(LocaleMacTest, formatWeek) +{ + EXPECT_STREQ("Week 04, 2005", formatWeek("en_US", "2005-W04").utf8().data()); + EXPECT_STREQ("Week 52, 2005", formatWeek("en_US", "2005-W52").utf8().data()); +} + +TEST_F(LocaleMacTest, formatMonth) +{ + EXPECT_STREQ("April 2005", formatMonth("en_US", "2005-04").utf8().data()); + EXPECT_STREQ("avril 2005", formatMonth("fr_FR", "2005-04").utf8().data()); + EXPECT_STREQ("2005\xE5\xB9\xB4" "04\xE6\x9C\x88", formatMonth("ja_JP", "2005-04").utf8().data()); +} + TEST_F(LocaleMacTest, formatDate) { EXPECT_STREQ("04/27/2005", formatDate("en_US", 2005, April, 27).utf8().data()); diff --git a/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp b/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp deleted file mode 100644 index 72aa15a30..000000000 --- a/Source/WebKit/chromium/tests/MemoryInstrumentationTest.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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 "CachedImage.h" -#include "MemoryInstrumentationImpl.h" -#include <gtest/gtest.h> -#include <wtf/MemoryInstrumentation.h> -#include <wtf/OwnPtr.h> - -using namespace WebCore; - -using WTF::MemoryObjectInfo; -using WTF::MemoryClassInfo; -using WTF::MemoryObjectType; - -namespace { - -MemoryObjectType TestType = "TestType"; - -class ImageObserverTestHelper { -public: - ImageObserverTestHelper() - : m_cachedImage(adoptPtr(new CachedImage(0))) - , m_imageOberver(m_cachedImage.get()) - { - } - void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const - { - MemoryClassInfo info(memoryObjectInfo, this, TestType); - info.addMember(m_cachedImage); - info.addMember(m_imageOberver); - } - - OwnPtr<CachedImage> m_cachedImage; - ImageObserver* m_imageOberver; -}; - -TEST(MemoryInstrumentationTest, ImageObserver) -{ - ImageObserverTestHelper helper; - - class TestClient : public MemoryInstrumentationClientImpl { - public: - TestClient(const void* expectedPointer, const void* unexpectedPointer) - : m_expectedPointer(expectedPointer) - , m_unexpectedPointer(unexpectedPointer) - , m_expectedPointerFound(false) - { - EXPECT_NE(expectedPointer, unexpectedPointer); - } - virtual void countObjectSize(const void* pointer, MemoryObjectType type, size_t size) OVERRIDE - { - EXPECT_NE(m_unexpectedPointer, pointer); - if (m_expectedPointer == pointer) - m_expectedPointerFound = true; - MemoryInstrumentationClientImpl::countObjectSize(pointer, type, size); - } - - bool expectedPointerFound() { return m_expectedPointerFound; } - - private: - const void* m_expectedPointer; - const void* m_unexpectedPointer; - bool m_expectedPointerFound; - } client(helper.m_cachedImage.get(), helper.m_imageOberver); - MemoryInstrumentationImpl instrumentation(&client); - instrumentation.addRootObject(helper); - EXPECT_TRUE(client.expectedPointerFound()); - EXPECT_LE(sizeof(CachedImage), client.reportedSizeForAllTypes()); - EXPECT_LE(1u, client.totalCountedObjects()); -} - - -} // namespace - diff --git a/Source/WebKit/chromium/tests/MockImageDecoder.h b/Source/WebKit/chromium/tests/MockImageDecoder.h index 5cf23744e..c9c0d01d6 100644 --- a/Source/WebKit/chromium/tests/MockImageDecoder.h +++ b/Source/WebKit/chromium/tests/MockImageDecoder.h @@ -29,13 +29,24 @@ namespace WebCore { +class MockImageDecoderClient { +public: + virtual void decoderBeingDestroyed() = 0; +}; + class MockImageDecoder : public ImageDecoder { public: - MockImageDecoder() + MockImageDecoder(MockImageDecoderClient* client) : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied) , m_frameBufferRequestCount(0) + , m_client(client) { } + ~MockImageDecoder() + { + m_client->decoderBeingDestroyed(); + } + virtual String filenameExtension() const { return "mock"; @@ -54,6 +65,7 @@ public: private: int m_frameBufferRequestCount; + MockImageDecoderClient* m_client; }; } // namespace WebCore diff --git a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp index ae3090d8c..6d73caf51 100644 --- a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp +++ b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp @@ -66,7 +66,7 @@ static void drawNativeRect(GraphicsContext* context, static Color getPixelAt(GraphicsContext* context, int x, int y) { - const SkBitmap& bitmap = context->platformContext()->canvas()->getTopDevice()->accessBitmap(false); + const SkBitmap& bitmap = context->platformContext()->layerBitmap(); return Color(*reinterpret_cast<const RGBA32*>(bitmap.getAddr32(x, y))); } @@ -74,7 +74,7 @@ static Color getPixelAt(GraphicsContext* context, int x, int y) // Windows messing it up. static void clearTopLayerAlphaChannel(GraphicsContext* context) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->layerBitmap()); for (int y = 0; y < bitmap.height(); y++) { uint32_t* row = bitmap.getAddr32(0, y); for (int x = 0; x < bitmap.width(); x++) @@ -85,7 +85,7 @@ static void clearTopLayerAlphaChannel(GraphicsContext* context) // Clears the alpha channel on the specified pixel. static void clearTopLayerAlphaPixel(GraphicsContext* context, int x, int y) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->layerBitmap()); *bitmap.getAddr32(x, y) &= 0x00FFFFFF; } @@ -616,7 +616,7 @@ TEST(TransparencyWin, Scale) // the helper goes out of scope. We don't want to call // clearTopLayerAlphaChannel because that will actually clear the whole // canvas (since we have no extra layer!). - SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()->platformContext()->layerBitmap()); *bitmap.getAddr32(2, 2) &= 0x00FFFFFF; helper.composite(); } diff --git a/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp b/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp index 49fdbff7d..395fdcf3d 100644 --- a/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp +++ b/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp @@ -32,7 +32,6 @@ #include "WebInputEvent.h" #include <gmock/gmock.h> #include <gtest/gtest.h> -#include <public/WebCompositor.h> #include <public/WebFloatPoint.h> #include <public/WebInputHandler.h> #include <public/WebInputHandlerClient.h> @@ -60,7 +59,7 @@ public: MOCK_METHOD0(scheduleAnimation, void()); MOCK_METHOD2(scrollBegin, ScrollStatus(WebPoint, WebInputHandlerClient::ScrollInputType)); - MOCK_METHOD2(scrollBy, void(WebPoint, WebSize)); + MOCK_METHOD2(scrollByIfPossible, bool(WebPoint, WebSize)); MOCK_METHOD0(scrollEnd, void()); private: @@ -156,11 +155,24 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureScrollStarted) gesture.type = WebInputEvent::GestureScrollBegin; m_inputHandler->handleInputEvent(gesture); + // The event should not be marked as handled if scrolling is not possible. + m_expectedDisposition = DropEvent; VERIFY_AND_RESET_MOCKS(); gesture.type = WebInputEvent::GestureScrollUpdate; gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction. - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::Field(&WebSize::height, testing::Gt(0)))); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0)))) + .WillOnce(testing::Return(false)); + m_inputHandler->handleInputEvent(gesture); + + // Mark the event as handled if scroll happens. + m_expectedDisposition = DidHandle; + VERIFY_AND_RESET_MOCKS(); + + gesture.type = WebInputEvent::GestureScrollUpdate; + gesture.data.scrollUpdate.deltaY = -40; // -Y means scroll down - i.e. in the +Y direction. + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0)))) + .WillOnce(testing::Return(true)); m_inputHandler->handleInputEvent(gesture); VERIFY_AND_RESET_MOCKS(); @@ -347,7 +359,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimates) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::Field(&WebSize::width, testing::Lt(0)))); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::width, testing::Lt(0)))) + .WillOnce(testing::Return(true)); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); m_inputHandler->animate(10.1); @@ -359,7 +372,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingAnimates) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusOnMainThread)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::_)).Times(0); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()).Times(0); // Expected wheel fling animation parameters: @@ -430,7 +443,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::Field(&WebSize::width, testing::Lt(0)))); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::width, testing::Lt(0)))) + .WillOnce(testing::Return(true)); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); m_inputHandler->animate(10.1); @@ -442,7 +456,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusOnMainThread)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::_)).Times(0); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()).Times(0); // Expected wheel fling animation parameters: @@ -510,7 +524,8 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusStarted)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::Field(&WebSize::height, testing::Gt(0)))); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::Field(&WebSize::height, testing::Gt(0)))) + .WillOnce(testing::Return(true)); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()); m_inputHandler->animate(30.1); @@ -520,7 +535,7 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets) EXPECT_CALL(m_mockInputHandlerClient, scheduleAnimation()); EXPECT_CALL(m_mockInputHandlerClient, scrollBegin(testing::_, testing::_)) .WillOnce(testing::Return(WebInputHandlerClient::ScrollStatusOnMainThread)); - EXPECT_CALL(m_mockInputHandlerClient, scrollBy(testing::_, testing::_)).Times(0); + EXPECT_CALL(m_mockInputHandlerClient, scrollByIfPossible(testing::_, testing::_)).Times(0); EXPECT_CALL(m_mockInputHandlerClient, scrollEnd()).Times(0); // We should get parameters from the second fling, nothing from the first fling should "leak". @@ -536,4 +551,3 @@ TEST_F(WebCompositorInputHandlerImplTest, gestureFlingTransferResets) } } - diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index ffed3c203..f503541f5 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -220,10 +220,8 @@ TEST_F(WebFrameTest, DispatchMessageEventWithOriginCheck) class FixedLayoutTestWebViewClient : public WebViewClient { public: - virtual WebRect windowRect() OVERRIDE { return m_windowRect; } virtual WebScreenInfo screenInfo() OVERRIDE { return m_screenInfo; } - WebRect m_windowRect; WebScreenInfo m_screenInfo; }; @@ -235,8 +233,7 @@ TEST_F(WebFrameTest, DeviceScaleFactorUsesDefaultWithoutViewportTag) int viewportHeight = 480; FixedLayoutTestWebViewClient client; - client.m_screenInfo.horizontalDPI = 320; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); + client.m_screenInfo.deviceScaleFactor = 2; WebView* webView = static_cast<WebView*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_viewport_tag.html", true, 0, &client)); @@ -260,10 +257,9 @@ TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale) registerMockedHttpURLLoad("fixed_layout.html"); FixedLayoutTestWebViewClient client; - client.m_screenInfo.horizontalDPI = 160; + client.m_screenInfo.deviceScaleFactor = 1; int viewportWidth = 640; int viewportHeight = 480; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); // Make sure we initialize to minimum scale, even if the window size // only becomes available after the load begins. @@ -291,6 +287,23 @@ TEST_F(WebFrameTest, FixedLayoutInitializeAtMinimumPageScale) webViewImpl->resize(WebSize(viewportWidth, viewportHeight + 100)); EXPECT_EQ(userPinchPageScaleFactor, webViewImpl->pageScaleFactor()); } + +TEST_F(WebFrameTest, ScaleFactorShouldNotOscillate) +{ + registerMockedHttpURLLoad("scale_oscillate.html"); + + FixedLayoutTestWebViewClient client; + client.m_screenInfo.horizontalDPI = 212; + int viewportWidth = 800; + int viewportHeight = 1057; + + WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "scale_oscillate.html", true, 0, &client)); + webViewImpl->enableFixedLayoutMode(true); + webViewImpl->settings()->setViewportEnabled(true); + webViewImpl->resize(WebSize(viewportWidth, viewportHeight)); + webViewImpl->layout(); +} + #endif TEST_F(WebFrameTest, CanOverrideMaximumScaleFactor) @@ -298,10 +311,9 @@ TEST_F(WebFrameTest, CanOverrideMaximumScaleFactor) registerMockedHttpURLLoad("no_scale_for_you.html"); FixedLayoutTestWebViewClient client; - client.m_screenInfo.horizontalDPI = 160; + client.m_screenInfo.deviceScaleFactor = 1; int viewportWidth = 640; int viewportHeight = 480; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(m_baseURL + "no_scale_for_you.html", true, 0, &client)); webViewImpl->enableFixedLayoutMode(true); @@ -316,13 +328,6 @@ TEST_F(WebFrameTest, CanOverrideMaximumScaleFactor) } #if ENABLE(GESTURE_EVENTS) -class DivAutoZoomTestWebViewClient : public WebViewClient { - public: - virtual WebRect windowRect() OVERRIDE { return m_windowRect; } - - WebRect m_windowRect; -}; - void setScaleAndScrollAndLayout(WebKit::WebView* webView, WebPoint scroll, float scale) { webView->setPageScaleFactor(scale, WebPoint(scroll.x, scroll.y)); @@ -333,11 +338,9 @@ TEST_F(WebFrameTest, DivAutoZoomParamsTest) { registerMockedHttpURLLoad("get_scale_for_auto_zoom_into_div_test.html"); - DivAutoZoomTestWebViewClient client; int viewportWidth = 640; int viewportHeight = 480; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); - WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_auto_zoom_into_div_test.html", true, 0, &client); + WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_auto_zoom_into_div_test.html"); webView->enableFixedLayoutMode(true); webView->setDeviceScaleFactor(2.0f); webView->resize(WebSize(viewportWidth, viewportHeight)); @@ -401,12 +404,10 @@ TEST_F(WebFrameTest, DivAutoZoomMultipleDivsTest) { registerMockedHttpURLLoad("get_multiple_divs_for_auto_zoom_test.html"); - DivAutoZoomTestWebViewClient client; int viewportWidth = 640; int viewportHeight = 480; float doubleTapZoomAlreadyLegibleRatio = 1.2f; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); - WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_multiple_divs_for_auto_zoom_test.html", true, 0, &client); + WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_multiple_divs_for_auto_zoom_test.html"); webView->enableFixedLayoutMode(true); webView->resize(WebSize(viewportWidth, viewportHeight)); webView->setPageScaleFactorLimits(1, 4); @@ -442,12 +443,10 @@ TEST_F(WebFrameTest, DivAutoZoomScaleBoundsTest) { registerMockedHttpURLLoad("get_scale_bounds_check_for_auto_zoom_test.html"); - DivAutoZoomTestWebViewClient client; int viewportWidth = 640; int viewportHeight = 480; float doubleTapZoomAlreadyLegibleRatio = 1.2f; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); - WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bounds_check_for_auto_zoom_test.html", true, 0, &client); + WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_bounds_check_for_auto_zoom_test.html"); webView->enableFixedLayoutMode(true); webView->resize(WebSize(viewportWidth, viewportHeight)); webView->setPageScaleFactorLimits(1, 4); @@ -504,14 +503,12 @@ TEST_F(WebFrameTest, DISABLED_DivScrollIntoEditableTest) { registerMockedHttpURLLoad("get_scale_for_zoom_into_editable_test.html"); - DivAutoZoomTestWebViewClient client; int viewportWidth = 640; int viewportHeight = 480; float leftBoxRatio = 0.3f; int caretPadding = 10; int minReadableCaretHeight = 18; - client.m_windowRect = WebRect(0, 0, viewportWidth, viewportHeight); - WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html", true, 0, &client); + WebKit::WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "get_scale_for_zoom_into_editable_test.html"); webView->enableFixedLayoutMode(true); webView->resize(WebSize(viewportWidth, viewportHeight)); webView->setPageScaleFactorLimits(1, 10); diff --git a/Source/WebKit/chromium/tests/WebPluginContainerTest.cpp b/Source/WebKit/chromium/tests/WebPluginContainerTest.cpp new file mode 100644 index 000000000..50089c9d4 --- /dev/null +++ b/Source/WebKit/chromium/tests/WebPluginContainerTest.cpp @@ -0,0 +1,117 @@ +/* + * 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 "WebPluginContainer.h" + +#include "Element.h" +#include "FakeWebPlugin.h" +#include "FrameTestHelpers.h" +#include "URLTestHelpers.h" +#include "WebDocument.h" +#include "WebElement.h" +#include "WebFrame.h" +#include "WebFrameClient.h" +#include "WebFrameImpl.h" +#include "WebPluginContainerImpl.h" +#include "WebPluginParams.h" +#include "WebSettings.h" +#include "WebView.h" +#include "WebViewImpl.h" +#include <gtest/gtest.h> +#include <webkit/support/webkit_support.h> + +using namespace WebKit; + +namespace { + +class WebPluginContainerTest : public testing::Test { +public: + WebPluginContainerTest() + : m_baseURL("http://www.test.com/") + { + } + + virtual void TearDown() + { + webkit_support::UnregisterAllMockedURLs(); + } + +protected: + std::string m_baseURL; +}; + +class TestPluginWebFrameClient : public WebFrameClient { + virtual WebPlugin* createPlugin(WebFrame* frame, const WebPluginParams& params) OVERRIDE + { + if (params.mimeType == WebString::fromUTF8("application/x-webkit-test-webplugin")) + return new FakeWebPlugin(frame, params); + return WebFrameClient::createPlugin(frame, params); + } +}; + +WebPluginContainer* getWebPluginContainer(WebView* webView, const WebString& id) +{ + WebElement element = webView->mainFrame()->document().getElementById(id); + return element.pluginContainer(); +} + +TEST_F(WebPluginContainerTest, WindowToLocalPointTest) +{ + URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("plugin_container.html")); + WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "plugin_container.html", true, new TestPluginWebFrameClient()); + ASSERT(webView); + webView->settings()->setPluginsEnabled(true); + webView->resize(WebSize(300, 300)); + webView->layout(); + webkit_support::RunAllPendingMessages(); + + WebPluginContainer* pluginContainerOne = getWebPluginContainer(webView, WebString::fromUTF8("translated-plugin")); + ASSERT(pluginContainerOne); + WebPoint point1 = pluginContainerOne->windowToLocalPoint(WebPoint(10, 10)); + ASSERT_EQ(0, point1.x); + ASSERT_EQ(0, point1.y); + WebPoint point2 = pluginContainerOne->windowToLocalPoint(WebPoint(100, 100)); + ASSERT_EQ(90, point2.x); + ASSERT_EQ(90, point2.y); + + WebPluginContainer* pluginContainerTwo = getWebPluginContainer(webView, WebString::fromUTF8("rotated-plugin")); + ASSERT(pluginContainerTwo); + WebPoint point3 = pluginContainerTwo->windowToLocalPoint(WebPoint(0, 10)); + ASSERT_EQ(10, point3.x); + ASSERT_EQ(0, point3.y); + WebPoint point4 = pluginContainerTwo->windowToLocalPoint(WebPoint(-10, 10)); + ASSERT_EQ(10, point4.x); + ASSERT_EQ(10, point4.y); + + webView->close(); +} + +} diff --git a/Source/WebKit/chromium/tests/data/plugin_container.html b/Source/WebKit/chromium/tests/data/plugin_container.html new file mode 100644 index 000000000..713ca804e --- /dev/null +++ b/Source/WebKit/chromium/tests/data/plugin_container.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> + <style type="text/css"> + body { margin: 0; padding: 0; } + </style> +</head> +<body> + <object id="rotated-plugin" + style="-webkit-transform: rotate(90deg); position: absolute; top: 0; left: 0; -webkit-transform-origin: 0 0;" + type="application/x-webkit-test-webplugin" + border=0 + width="40" + height="40"> + </object> + <object id="translated-plugin" + border=0 + style="-webkit-transform: translate(10px, 10px); position: absolute; top: 0; left: 0;" + type="application/x-webkit-test-webplugin" + width="40" + height="40"> + </object> +</body> +</html> diff --git a/Source/WebKit/chromium/tests/data/scale_oscillate.html b/Source/WebKit/chromium/tests/data/scale_oscillate.html new file mode 100644 index 000000000..26ca4613c --- /dev/null +++ b/Source/WebKit/chromium/tests/data/scale_oscillate.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html style="width:100%;height:100%;"> +<head> +<title>Test</title> +<style> +::-webkit-scrollbar { + width: 1px; +} +</style> +<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/> +</head> +<body> +This test passes if it doesn't cause oscillating scale factor due to content size rounding errors and creating/destroying of custom scrollbars. +An example of parameter that reproduce the crash is viewport size (800, 1057) with device scale factor 1.325 +</body> +</html> |