diff options
Diffstat (limited to 'Source/WebKit')
119 files changed, 3278 insertions, 473 deletions
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog index c7e0e55b0..cdf2ebc4a 100644 --- a/Source/WebKit/ChangeLog +++ b/Source/WebKit/ChangeLog @@ -1,3 +1,14 @@ +2012-06-22 Joshua Netterfield <jnetterfield@rim.com> + + [BlackBerry] Sanitize GLSL code using ANGLE. + + BlackBerry port does not sanitize GLSL code with ANGLE + https://bugs.webkit.org/show_bug.cgi?id=89583 + + Reviewed by Rob Buis. + + * PlatformBlackBerry.cmake: Add ANGLE sources to BlackBerry builds. + 2012-06-19 Csaba Osztrogonác <ossy@webkit.org> [CMake] Unreviewed speculative buildfix after r120786. diff --git a/Source/WebKit/PlatformBlackBerry.cmake b/Source/WebKit/PlatformBlackBerry.cmake index e3512f65a..be2a948dd 100644 --- a/Source/WebKit/PlatformBlackBerry.cmake +++ b/Source/WebKit/PlatformBlackBerry.cmake @@ -107,6 +107,18 @@ LIST(APPEND WebKit_SOURCES blackberry/WebKitSupport/FatFingers.cpp ) + +IF (ENABLE_WEBGL) + LIST(APPEND WebKit_INCLUDE_DIRECTORIES + ${OPENGL_INCLUDE_DIR} + ${THIRDPARTY_DIR}/ANGLE/src + ${THIRDPARTY_DIR}/ANGLE/include/GLSLANG + ) + LIST(APPEND WebKit_LIBRARIES + ${OPENGL_gl_LIBRARY} + ) +ENDIF (ENABLE_WEBGL) + IF (ENABLE_DRT) # DumpRenderTree sources LIST(APPEND WebKit_SOURCES diff --git a/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp b/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp index 6177d1e34..3a6033a5a 100644 --- a/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp +++ b/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp @@ -75,7 +75,7 @@ void globalInitialize() CacheClientBlackBerry::get()->initialize(); - BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::get(); + BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::instance(); ImageSource::setMaxPixelsPerDecodedImage(settings->maxPixelsPerDecodedImage()); } diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp index d8ad4778f..411fcb3ab 100644 --- a/Source/WebKit/blackberry/Api/WebPage.cpp +++ b/Source/WebKit/blackberry/Api/WebPage.cpp @@ -532,6 +532,7 @@ void WebPagePrivate::init(const WebString& pageGroupName) #if USE(ACCELERATED_COMPOSITING) m_tapHighlight = DefaultTapHighlight::create(this); m_selectionOverlay = SelectionOverlay::create(this); + m_page->settings()->setAcceleratedCompositingForFixedPositionEnabled(true); #endif // FIXME: We explicitly call setDelegate() instead of passing ourself in createFromStandardSettings() @@ -548,7 +549,7 @@ void WebPagePrivate::init(const WebString& pageGroupName) m_mainFrame->init(); #if ENABLE(WEBGL) - Platform::Settings* settings = Platform::Settings::get(); + Platform::Settings* settings = Platform::Settings::instance(); m_page->settings()->setWebGLEnabled(settings && settings->isWebGLSupported()); #endif #if ENABLE(ACCELERATED_2D_CANVAS) @@ -563,6 +564,8 @@ void WebPagePrivate::init(const WebString& pageGroupName) m_page->settings()->setInteractiveFormValidationEnabled(true); m_page->settings()->setAllowUniversalAccessFromFileURLs(false); m_page->settings()->setAllowFileAccessFromFileURLs(false); + m_page->settings()->setShouldUseCrossOriginProtocolCheck(!m_webSettings->allowCrossSiteRequests()); + m_page->settings()->setWebSecurityEnabled(!m_webSettings->allowCrossSiteRequests()); m_backingStoreClient = BackingStoreClient::create(m_mainFrame, /* parent frame */ 0, m_webPage); // The direct access to BackingStore is left here for convenience since it @@ -888,6 +891,29 @@ void WebPage::prepareToDestroy() d->prepareToDestroy(); } +static void enableCrossSiteXHRRecursively(Frame* frame) +{ + frame->document()->securityOrigin()->grantUniversalAccess(); + + Vector<RefPtr<Frame>, 10> childFrames; + for (RefPtr<Frame> childFrame = frame->tree()->firstChild(); childFrame; childFrame = childFrame->tree()->nextSibling()) + childFrames.append(childFrame); + + unsigned size = childFrames.size(); + for (unsigned i = 0; i < size; i++) + enableCrossSiteXHRRecursively(childFrames[i].get()); +} + +void WebPagePrivate::enableCrossSiteXHR() +{ + enableCrossSiteXHRRecursively(m_mainFrame); +} + +void WebPage::enableCrossSiteXHR() +{ + d->enableCrossSiteXHR(); +} + void WebPagePrivate::setLoadState(LoadState state) { if (m_loadState == state) @@ -956,7 +982,7 @@ void WebPagePrivate::setLoadState(LoadState state) static ViewportArguments defaultViewportArguments; bool documentHasViewportArguments = false; FrameLoadType frameLoadType = FrameLoadTypeStandard; - if (m_mainFrame && m_mainFrame->document() && !(m_mainFrame->document()->viewportArguments() == defaultViewportArguments)) + if (m_mainFrame && m_mainFrame->document() && m_mainFrame->document()->viewportArguments() != defaultViewportArguments) documentHasViewportArguments = true; if (m_mainFrame && m_mainFrame->loader()) frameLoadType = m_mainFrame->loader()->loadType(); @@ -997,7 +1023,7 @@ void WebPagePrivate::setLoadState(LoadState state) #endif // Notify InputHandler of state change. - m_inputHandler->enableInputMode(false); + m_inputHandler->setInputModeEnabled(false); // Set the scroll to origin here and notify the client since we'll be // zooming below without any real contents yet thus the contents size @@ -1311,7 +1337,7 @@ bool WebPagePrivate::shouldSendResizeEvent() // NOTE: Care must be exercised in the use of this option, as it bypasses // the sanity provided in 'isLoadingInAPISense()' below. // - static const bool unrestrictedResizeEvents = Platform::Settings::get()->unrestrictedResizeEvents(); + static const bool unrestrictedResizeEvents = Platform::Settings::instance()->unrestrictedResizeEvents(); if (unrestrictedResizeEvents) return true; @@ -2480,7 +2506,7 @@ typedef bool (*PredicateFunction)(RenderLayer*); static bool isPositionedContainer(RenderLayer* layer) { RenderObject* o = layer->renderer(); - return o->isRenderView() || o->isPositioned() || o->isRelPositioned() || layer->hasTransform(); + return o->isRenderView() || o->isOutOfFlowPositioned() || o->isRelPositioned() || layer->hasTransform(); } static bool isNonRenderViewFixedPositionedContainer(RenderLayer* layer) @@ -2489,13 +2515,13 @@ static bool isNonRenderViewFixedPositionedContainer(RenderLayer* layer) if (o->isRenderView()) return false; - return o->isPositioned() && o->style()->position() == FixedPosition; + return o->isOutOfFlowPositioned() && o->style()->position() == FixedPosition; } static bool isFixedPositionedContainer(RenderLayer* layer) { RenderObject* o = layer->renderer(); - return o->isRenderView() || (o->isPositioned() && o->style()->position() == FixedPosition); + return o->isRenderView() || (o->isOutOfFlowPositioned() && o->style()->position() == FixedPosition); } static RenderLayer* findAncestorOrSelfNotMatching(PredicateFunction predicate, RenderLayer* layer) @@ -3644,7 +3670,7 @@ void WebPagePrivate::setViewportSize(const IntSize& transformedActualVisibleSize // Recompute our virtual viewport. static ViewportArguments defaultViewportArguments; - if (!(m_viewportArguments == defaultViewportArguments)) { + if (m_viewportArguments != defaultViewportArguments) { // We may need to infer the width and height for the viewport with respect to the rotation. IntSize newVirtualViewport = recomputeVirtualViewportFromViewportArguments(); ASSERT(!newVirtualViewport.isEmpty()); @@ -3943,7 +3969,7 @@ bool WebPagePrivate::handleMouseEvent(PlatformMouseEvent& mouseEvent) } if (mouseEvent.type() == WebCore::PlatformEvent::MousePressed) { - m_inputHandler->enableInputMode(); + m_inputHandler->setInputModeEnabled(); if (m_inputHandler->willOpenPopupForNode(node)) { // Do not allow any human generated mouse or keyboard events to select <option>s in the list box // because we use a pop up dialog to handle the actual selections. This prevents options from @@ -4141,7 +4167,7 @@ bool WebPagePrivate::dispatchTouchEventToFullScreenPlugin(PluginView* plugin, co return handled; } -bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point) +bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point, bool useFatFingers) { if (d->m_page->defersLoading()) return false; @@ -4156,7 +4182,7 @@ bool WebPage::touchPointAsMouseEvent(const Platform::TouchPoint& point) tPoint.m_pos = d->mapFromTransformed(tPoint.m_pos); tPoint.m_screenPos = d->mapFromTransformed(tPoint.m_screenPos); - return d->m_touchEventHandler->handleTouchPoint(tPoint); + return d->m_touchEventHandler->handleTouchPoint(tPoint, useFatFingers); } bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView* pluginView, const Platform::TouchPoint& point) @@ -4344,7 +4370,7 @@ bool WebPagePrivate::scrollRenderer(RenderObject* renderer, const IntSize& delta if (!layerDelta.isZero()) { m_inRegionScrollStartingNode = enclosingLayerNode(layer); IntPoint newOffset = currentOffset + layerDelta; - layer->scrollToOffset(newOffset.x(), newOffset.y()); + layer->scrollToOffset(toSize(newOffset)); renderer->repaint(true); return true; } @@ -6312,6 +6338,7 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings) coreSettings->setProcessHTTPEquiv(!webSettings->isEmailMode()); coreSettings->setShouldUseCrossOriginProtocolCheck(!webSettings->allowCrossSiteRequests()); + coreSettings->setWebSecurityEnabled(!webSettings->allowCrossSiteRequests()); cookieManager().setPrivateMode(webSettings->isPrivateBrowsingEnabled()); diff --git a/Source/WebKit/blackberry/Api/WebPage.h b/Source/WebKit/blackberry/Api/WebPage.h index 8a037dde1..eb38583c4 100644 --- a/Source/WebKit/blackberry/Api/WebPage.h +++ b/Source/WebKit/blackberry/Api/WebPage.h @@ -110,6 +110,8 @@ public: // This will force any unload handlers to run. void prepareToDestroy(); + void enableCrossSiteXHR(); + void reload(); void reloadFromCache(); @@ -137,7 +139,7 @@ public: // For conversion to mouse events. void touchEventCancel(); - bool touchPointAsMouseEvent(const Platform::TouchPoint&); + bool touchPointAsMouseEvent(const Platform::TouchPoint&, bool useFatFingers = true); // Returns true if the key stroke was handled by WebKit. bool keyEvent(const Platform::KeyboardEvent&); diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h index 0c159e9da..9b2ee701a 100644 --- a/Source/WebKit/blackberry/Api/WebPage_p.h +++ b/Source/WebKit/blackberry/Api/WebPage_p.h @@ -104,6 +104,8 @@ public: void stopCurrentLoad(); void prepareToDestroy(); + void enableCrossSiteXHR(); + LoadState loadState() const { return m_loadState; } bool isLoading() const { return m_loadState == WebPagePrivate::Provisional || m_loadState == WebPagePrivate::Committed; } diff --git a/Source/WebKit/blackberry/Api/WebViewportArguments.cpp b/Source/WebKit/blackberry/Api/WebViewportArguments.cpp index 798c3d5c1..ab570a975 100644 --- a/Source/WebKit/blackberry/Api/WebViewportArguments.cpp +++ b/Source/WebKit/blackberry/Api/WebViewportArguments.cpp @@ -111,7 +111,7 @@ bool WebViewportArguments::operator==(const WebViewportArguments& other) bool WebViewportArguments::operator!=(const WebViewportArguments& other) { - return !(*this == other); + return *d != *(other.d); } } // namespace WebKit diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog index 3dd869ce7..67aa6558f 100644 --- a/Source/WebKit/blackberry/ChangeLog +++ b/Source/WebKit/blackberry/ChangeLog @@ -1,3 +1,262 @@ +2012-06-24 Simon Fraser <simon.fraser@apple.com> + + Rename isPositioned to isOutOfFlowPositioned for clarity + https://bugs.webkit.org/show_bug.cgi?id=89836 + + Reviewed by Antti Koivisto. + + RenderObject and RenderStyle had an isPositioned() method that was + confusing, because it excluded relative positioning. Rename to + isOutOfFlowPositioned(), which makes it clearer that it only applies + to absolute and fixed positioning. + + Simple rename; no behavior change. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::isPositionedContainer): + (BlackBerry::WebKit::isNonRenderViewFixedPositionedContainer): + (BlackBerry::WebKit::isFixedPositionedContainer): + +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * Api/BlackBerryGlobal.cpp: + (BlackBerry::WebKit::clearMemoryCaches): + * WebCoreSupport/ClientExtension.cpp: + * WebCoreSupport/PagePopupBlackBerry.cpp: + (WebCore::PagePopupBlackBerry::installDomFunction): + * WebKitSupport/DumpRenderTreeSupport.cpp: + (DumpRenderTreeSupport::computedStyleIncludingVisitedInfo): + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * Api/BlackBerryGlobal.cpp: + (BlackBerry::WebKit::clearMemoryCaches): + * WebCoreSupport/ClientExtension.cpp: + * WebCoreSupport/PagePopupBlackBerry.cpp: + (WebCore::PagePopupBlackBerry::installDomFunction): + * WebKitSupport/DumpRenderTreeSupport.cpp: + (DumpRenderTreeSupport::computedStyleIncludingVisitedInfo): + +2012-06-22 Andrew Lo <anlo@rim.com> + + [BlackBerry] Tap highlight fade animations are added to overlay continuously during pinch zoom. + https://bugs.webkit.org/show_bug.cgi?id=89772 + + Reviewed by Antonio Gomes. + + When pinch zooming, DefaultTapHighlight::hide is continuously + called from the UI thread. This resulted in fade animations being + created and added to the override overlay continuously. + + This patch moves the m_visible check so that it applies for both + threads. + + Internal PR164183 + + * WebKitSupport/DefaultTapHighlight.cpp: + (BlackBerry::WebKit::DefaultTapHighlight::draw): + (BlackBerry::WebKit::DefaultTapHighlight::hide): + * WebKitSupport/DefaultTapHighlight.h: + (DefaultTapHighlight): + +2012-06-22 Yong Li <yoli@rim.com> + + [BlackBerry] Set WebSecurityEnabled flag accordingly. + https://bugs.webkit.org/show_bug.cgi?id=89602 + + Reviewed by Rob Buis. + + Disable web security checks if needed. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::init): + (BlackBerry::WebKit::WebPagePrivate::didChangeSettings): + +2012-06-22 Parth Patel <parpatel@rim.com> + + [Blackberry] BlackBerry::Platform::Settings::get() rename to BlackBerry::Platform::Settings::instance() to make it consistent with our other singletons + https://bugs.webkit.org/show_bug.cgi?id=89684 + + Reviewed by Yong Li. + + Build Fix-Typo Update setting instance access to use instance() instead of get(). + + * WebKitSupport/InputHandler.cpp: + (BlackBerry::WebKit::InputHandler::isInputModeEnabled): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + + * WebCoreSupport/DeviceOrientationClientBlackBerry.h: + (DeviceOrientationClientBlackBerry): + +2012-06-22 Joseph Pecoraro <pecoraro@apple.com> + + Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsupported + https://bugs.webkit.org/show_bug.cgi?id=89743 + + Reviewed by Yury Semikhatsky. + + * WebCoreSupport/InspectorClientBlackBerry.cpp: + (WebCore::InspectorClientBlackBerry::updateInspectorStateCookie): + +2012-06-21 Parth Patel <parpatel@rim.com> + + [Blackberry] BlackBerry::Platform::Settings::get() rename to BlackBerry::Platform::Settings::instance() to make it consistent with our other singletons + https://bugs.webkit.org/show_bug.cgi?id=89684 + + Reviewed by Yong Li. + + Update setting instance access to use instance() instead of get(). + + * Api/BlackBerryGlobal.cpp: + (BlackBerry::WebKit::globalInitialize): + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::init): + (BlackBerry::WebKit::WebPagePrivate::shouldSendResizeEvent): + * WebCoreSupport/AboutData.cpp: + (WebCore::configPage): + * WebCoreSupport/CacheClientBlackBerry.cpp: + (WebCore::CacheClientBlackBerry::updateCacheCapacity): + * WebKitSupport/FatFingers.cpp: + (BlackBerry::WebKit::FatFingers::getPaddings): + * WebKitSupport/InputHandler.cpp: + (BlackBerry::WebKit::InputHandler::isInputModeEnabled): + (BlackBerry::WebKit::InputHandler::setInputModeEnabled): + (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible): + * WebKitSupport/SurfacePool.cpp: + (BlackBerry::WebKit::SurfacePool::initialize): + +2012-06-21 Genevieve Mak <gmak@rim.com> + + Add a parameter to handletTouchPoint to bypass FatFingers + on touch up. There are some cases where the user may drag + their finger off the element and we want to use the actual + touch point instead of the FatFingers adjusted point. + https://bugs.webkit.org/show_bug.cgi?id=89677 + + Reviewed by Antonio Gomes. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPage::touchPointAsMouseEvent): + * Api/WebPage.h: + * WebKitSupport/TouchEventHandler.cpp: + (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint): + * WebKitSupport/TouchEventHandler.h: + (TouchEventHandler): + +2012-06-21 Mike Fenton <mifenton@rim.com> + + [BlackBerry] Input mode should adapt automatically to settings changes + https://bugs.webkit.org/show_bug.cgi?id=89595 + + Reviewed by Antonio Gomes. + + PR 167540. + + Add helper function to check if input is enabled so that + the override settings can be applied at any time. + + Reviewed Internally by Gen Mak. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::setLoadState): + (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent): + * WebKitSupport/InputHandler.cpp: + (BlackBerry::WebKit::InputHandler::isInputModeEnabled): + (BlackBerry::WebKit::InputHandler::setInputModeEnabled): + (BlackBerry::WebKit::InputHandler::setElementFocused): + (BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible): + (BlackBerry::WebKit::InputHandler::notifyClientOfKeyboardVisibilityChange): + (BlackBerry::WebKit::InputHandler::handleKeyboardInput): + (BlackBerry::WebKit::InputHandler::setComposingText): + * WebKitSupport/InputHandler.h: + * WebKitSupport/TouchEventHandler.cpp: + (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint): + +2012-06-20 Jacky Jiang <zhajiang@rim.com> + + Add a != operator to ViewportArguments + https://bugs.webkit.org/show_bug.cgi?id=87505 + + Reviewed by Antonio Gomes. + Patch by Jacky Jiang <zhajiang@rim.com> + + Use != operator of ViewportArguments. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::setLoadState): + (BlackBerry::WebKit::WebPagePrivate::setViewportSize): + * Api/WebViewportArguments.cpp: + (BlackBerry::WebKit::WebViewportArguments::operator!=): + +2012-06-20 Christopher Hutten-Czapski <chutten@rim.com> + + [BlackBerry] Add an API to immediately enable cross-site XHR + https://bugs.webkit.org/show_bug.cgi?id=89594 + + Internally Reviewed by Yong Li. + Reviewed by Rob Buis. + + There is no API to disable it as clients may rely on legacy behaviour + of not disabling until the next frame load. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::enableCrossSiteXHRRecursively): + (WebKit): + (BlackBerry::WebKit::WebPagePrivate::enableCrossSiteXHR): + (BlackBerry::WebKit::WebPage::enableCrossSiteXHR): + * Api/WebPage.h: + * Api/WebPage_p.h: + (WebPagePrivate): + +2012-06-20 Konrad Piascik <kpiascik@rim.com> + + [BlackBerry] Enable setAcceleratedCompositingForFixedPositionEnabled + https://bugs.webkit.org/show_bug.cgi?id=89575 + + Reviewed by Antonio Gomes. + + Enable the flag so that we get position:fixed elemetns to be rendered + using accelerated compositing. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::init): + +2012-06-20 Julien Chaffraix <jchaffraix@webkit.org> + + Use IntSize in RenderLayer to represent scroll offsets + https://bugs.webkit.org/show_bug.cgi?id=89154 + + Reviewed by Eric Seidel. + + * Api/WebPage.cpp: + (BlackBerry::WebKit::WebPagePrivate::scrollRenderer): + Updated to pass an IntSize to scrollToOffset. + 2012-06-19 Yong Li <yoli@rim.com> [BlackBerry] Should check the return value of fromUTF8() before executing the script. diff --git a/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp b/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp index e217742da..dc950b348 100644 --- a/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp +++ b/Source/WebKit/blackberry/WebCoreSupport/AboutData.cpp @@ -99,7 +99,7 @@ String configPage() #endif + "</td></tr>"; - BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::get(); + BlackBerry::Platform::Settings* settings = BlackBerry::Platform::Settings::instance(); page += String("</table><h2>Platform Settings</h2><table>"); page += numberToHTMLTr("isRSSFilteringEnabled", settings->isRSSFilteringEnabled()); page += numberToHTMLTr("secondaryThreadStackSize", settings->secondaryThreadStackSize()); diff --git a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp index c203a1822..1e4b45106 100644 --- a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp +++ b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp @@ -56,7 +56,7 @@ void CacheClientBlackBerry::updateCacheCapacity() #if ENABLE(BLACKBERRY_DEBUG_MEMORY) // We're debugging memory usage. So keep it disabled. #else - unsigned cacheCapacity = BlackBerry::Platform::Settings::get()->getSuggestedCacheCapacity(memoryCache()->totalSize()); + unsigned cacheCapacity = BlackBerry::Platform::Settings::instance()->getSuggestedCacheCapacity(memoryCache()->totalSize()); if (m_lastCapacity == cacheCapacity) { // Suggested capacity hasn't been changed. return; diff --git a/Source/WebKit/blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.h index 7610fb1d4..ca1dd9d4d 100644 --- a/Source/WebKit/blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.h +++ b/Source/WebKit/blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.h @@ -19,8 +19,8 @@ #ifndef DeviceOrientationClientBlackBerry_h #define DeviceOrientationClientBlackBerry_h -#include "DeviceOrientation.h" #include "DeviceOrientationClient.h" +#include "DeviceOrientationData.h" #include <BlackBerryPlatformDeviceOrientationTrackerListener.h> #include <wtf/RefPtr.h> @@ -47,7 +47,7 @@ public: virtual void setController(DeviceOrientationController*); virtual void startUpdating(); virtual void stopUpdating(); - virtual DeviceOrientation* lastOrientation() const; + virtual DeviceOrientationData* lastOrientation() const; virtual void deviceOrientationControllerDestroyed(); virtual void onOrientation(const BlackBerry::Platform::DeviceOrientationEvent*); @@ -55,7 +55,7 @@ private: BlackBerry::WebKit::WebPagePrivate* m_webPagePrivate; BlackBerry::Platform::DeviceOrientationTracker* m_tracker; DeviceOrientationController* m_controller; - RefPtr<DeviceOrientation> m_currentOrientation; + RefPtr<DeviceOrientationData> m_currentOrientation; }; } diff --git a/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp index dbb5f0807..22e2364b0 100644 --- a/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp +++ b/Source/WebKit/blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp @@ -87,6 +87,7 @@ void InspectorClientBlackBerry::clearBrowserCookies() void InspectorClientBlackBerry::updateInspectorStateCookie(const String& cookie) { + // If this is implemented, we should override and return true in InspectorStateClient::supportsInspectorStateUpdates(). notImplemented(); }; diff --git a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp index 4cc565e63..74c1bfae3 100644 --- a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.cpp @@ -61,7 +61,10 @@ void DefaultTapHighlight::draw(const Platform::IntRectRegion& region, int red, i if (rect.isEmpty()) return; - m_visible = true; + { + MutexLocker lock(m_mutex); + m_visible = true; + } if (!m_overlay) { m_overlay = adoptPtr(new WebOverlay(this)); @@ -82,18 +85,22 @@ void DefaultTapHighlight::hide() if (!m_overlay) return; + { + MutexLocker lock(m_mutex); + if (!m_visible) + return; + m_visible = false; + } + // Since WebAnimation is not thread safe, we create a new one each time instead of reusing the same object on different // threads (that would introduce race conditions). WebAnimation fadeAnimation = WebAnimation::fadeAnimation(fadeAnimationName(), 1.0, 0.0, ActiveTextFadeAnimationDuration); // Normally, this method is called on the WebKit thread, but it can also be // called from the compositing thread. - if (BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread()) { - if (!m_visible) - return; - m_visible = false; + if (BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread()) m_overlay->addAnimation(fadeAnimation); - } else if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) + else if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) m_overlay->override()->addAnimation(fadeAnimation); } diff --git a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h index fdf632a50..72ea40251 100644 --- a/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h +++ b/Source/WebKit/blackberry/WebKitSupport/DefaultTapHighlight.h @@ -31,6 +31,7 @@ #include <BlackBerryPlatformIntRectRegion.h> #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> +#include <wtf/Threading.h> namespace BlackBerry { namespace WebKit { @@ -69,6 +70,7 @@ private: WebCore::Color m_color; bool m_visible; bool m_shouldHideAfterScroll; + Mutex m_mutex; }; } // namespace WebKit diff --git a/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp b/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp index d9fa43b1e..381e7a1ec 100644 --- a/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp @@ -450,10 +450,10 @@ bool FatFingers::checkForText(Node* curNode, Vector<IntersectingRegion>& interse void FatFingers::getPaddings(unsigned& top, unsigned& right, unsigned& bottom, unsigned& left) const { - static unsigned topPadding = Platform::Settings::get()->topFatFingerPadding(); - static unsigned rightPadding = Platform::Settings::get()->rightFatFingerPadding(); - static unsigned bottomPadding = Platform::Settings::get()->bottomFatFingerPadding(); - static unsigned leftPadding = Platform::Settings::get()->leftFatFingerPadding(); + static unsigned topPadding = Platform::Settings::instance()->topFatFingerPadding(); + static unsigned rightPadding = Platform::Settings::instance()->rightFatFingerPadding(); + static unsigned bottomPadding = Platform::Settings::instance()->bottomFatFingerPadding(); + static unsigned leftPadding = Platform::Settings::instance()->leftFatFingerPadding(); double currentScale = m_webPage->currentScale(); top = topPadding / currentScale; diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp index c563ad25f..ea6741d65 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp @@ -432,21 +432,22 @@ void InputHandler::setElementUnfocused(bool refocusOccuring) m_currentFocusElementType = TextEdit; } -void InputHandler::enableInputMode(bool inputModeAllowed) +bool InputHandler::isInputModeEnabled() const { - FocusLog(LogLevelInfo, "InputHandler::enableInputMode '%s', override is '%s'" - , inputModeAllowed ? "true" : "false" - , m_webPage->m_dumpRenderTree || Platform::Settings::get()->alwaysShowKeyboardOnFocus() ? "true" : "false"); + // Input mode is enabled when set, or when dump render tree or always show keyboard setting is enabled. + return m_inputModeEnabled || m_webPage->m_dumpRenderTree || Platform::Settings::instance()->alwaysShowKeyboardOnFocus(); +} - m_inputModeEnabled = inputModeAllowed; +void InputHandler::setInputModeEnabled(bool active) +{ + FocusLog(LogLevelInfo, "InputHandler::setInputModeEnabled '%s', override is '%s'" + , active ? "true" : "false" + , m_webPage->m_dumpRenderTree || Platform::Settings::instance()->alwaysShowKeyboardOnFocus() ? "true" : "false"); - // If DRT is running or always show keyboard setting is active, do not delay - // showing the keyboard. - if (m_webPage->m_dumpRenderTree || Platform::Settings::get()->alwaysShowKeyboardOnFocus()) - m_inputModeEnabled = true; + m_inputModeEnabled = active; // If the frame selection isn't focused, focus it. - if (m_inputModeEnabled && isActiveTextEdit() && !m_currentFocusElement->document()->frame()->selection()->isFocused()) + if (isInputModeEnabled() && isActiveTextEdit() && !m_currentFocusElement->document()->frame()->selection()->isFocused()) m_currentFocusElement->document()->frame()->selection()->setFocused(true); } @@ -455,8 +456,8 @@ void InputHandler::setElementFocused(Element* element) ASSERT(DOMSupport::isTextBasedContentEditableElement(element)); ASSERT(element->document() && element->document()->frame()); - if (element->document()->frame()->selection()->isFocused() != m_inputModeEnabled) - element->document()->frame()->selection()->setFocused(m_inputModeEnabled); + if (element->document()->frame()->selection()->isFocused() != isInputModeEnabled()) + element->document()->frame()->selection()->setFocused(isInputModeEnabled()); // Clear the existing focus node details. setElementUnfocused(true /*refocusOccuring*/); @@ -552,10 +553,10 @@ WebCore::IntRect InputHandler::boundingBoxForInputField() void InputHandler::ensureFocusTextElementVisible(CaretScrollType scrollType) { - if (!m_inputModeEnabled || !m_currentFocusElement || !m_currentFocusElement->document()) + if (!isActiveTextEdit() || !isInputModeEnabled() || !m_currentFocusElement->document()) return; - if (!Platform::Settings::get()->allowCenterScrollAdjustmentForInputFields() && scrollType != EdgeIfNeeded) + if (!Platform::Settings::instance()->allowCenterScrollAdjustmentForInputFields() && scrollType != EdgeIfNeeded) return; Frame* elementFrame = m_currentFocusElement->document()->frame(); @@ -770,7 +771,7 @@ void InputHandler::processPendingKeyboardVisibilityChange() void InputHandler::notifyClientOfKeyboardVisibilityChange(bool visible) { // If we aren't ready for input, keyboard changes should be ignored. - if (!m_inputModeEnabled && visible) + if (!isInputModeEnabled() && visible) return; if (!m_delayKeyboardVisibilityChange) { @@ -929,7 +930,7 @@ bool InputHandler::handleKeyboardInput(const Platform::KeyboardEvent& keyboardEv InputLog(LogLevelInfo, "InputHandler::handleKeyboardInput received character=%lc, type=%d", keyboardEvent.character(), keyboardEvent.type()); // Enable input mode if we are processing a key event. - enableInputMode(); + setInputModeEnabled(); // If we aren't specifically part of a composition, fail, IMF should never send key input // while composing text. If IMF has failed, we should have already finished the @@ -1725,7 +1726,7 @@ int32_t InputHandler::setComposingText(spannable_string_t* spannableString, int3 InputLog(LogLevelInfo, "InputHandler::setComposingText at relativeCursorPosition: %d", relativeCursorPosition); // Enable input mode if we are processing a key event. - enableInputMode(); + setInputModeEnabled(); return setSpannableTextAndRelativeCursor(spannableString, relativeCursorPosition, true /* markTextAsComposing */) ? 0 : -1; } diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h index c63344724..e34126ba2 100644 --- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h +++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h @@ -57,7 +57,8 @@ public: enum FocusElementType { TextEdit, TextPopup /* Date/Time & Color */, SelectPopup, Plugin }; enum CaretScrollType { CenterAlways, CenterIfNeeded, EdgeIfNeeded }; - void enableInputMode(bool inputModeAllowed = true); + bool isInputModeEnabled() const; + void setInputModeEnabled(bool active = true); void focusedNodeChanged(); void nodeTextChanged(const WebCore::Node*); diff --git a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp index bf2a58da1..de4fe5caa 100644 --- a/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/SurfacePool.cpp @@ -69,8 +69,8 @@ void SurfacePool::initialize(const BlackBerry::Platform::IntSize& tileSize) return; m_initialized = true; - const unsigned numberOfTiles = BlackBerry::Platform::Settings::get()->numberOfBackingStoreTiles(); - const unsigned maxNumberOfTiles = BlackBerry::Platform::Settings::get()->maximumNumberOfBackingStoreTilesAcrossProcesses(); + const unsigned numberOfTiles = BlackBerry::Platform::Settings::instance()->numberOfBackingStoreTiles(); + const unsigned maxNumberOfTiles = BlackBerry::Platform::Settings::instance()->maximumNumberOfBackingStoreTilesAcrossProcesses(); if (numberOfTiles) { // Only allocate if we actually use a backingstore. unsigned byteLimit = (maxNumberOfTiles /*pool*/ + 2 /*visible tile buffer, backbuffer*/) * tileSize.width() * tileSize.height() * 4; diff --git a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp index a74af4b97..c8668be85 100644 --- a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp @@ -168,15 +168,16 @@ void TouchEventHandler::touchHoldEvent() m_webPage->clearFocusNode(); } -bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point) +bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFatFingers) { // Enable input mode on any touch event. - m_webPage->m_inputHandler->enableInputMode(); + m_webPage->m_inputHandler->setInputModeEnabled(); bool pureWithMouseConversion = m_webPage->m_touchEventMode == PureTouchEventsWithMouseConversion; switch (point.m_state) { case Platform::TouchPoint::TouchPressed: { + // FIXME: bypass FatFingers if useFatFingers is false m_lastFatFingersResult.reset(); // Theoretically this shouldn't be required. Keep it just in case states get mangled. m_didCancelTouch = false; m_lastScreenPoint = point.m_screenPos; @@ -229,7 +230,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point) m_webPage->m_inputHandler->notifyClientOfKeyboardVisibilityChange(true); IntPoint adjustedPoint; - if (m_convertTouchToMouse) { + if (m_convertTouchToMouse || !useFatFingers) { adjustedPoint = point.m_pos; m_convertTouchToMouse = pureWithMouseConversion; } else // Fat finger point in viewport coordinates. diff --git a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h index 3bcdd87d4..91c7f160e 100644 --- a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h +++ b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h @@ -35,7 +35,7 @@ public: TouchEventHandler(WebPagePrivate* webpage); ~TouchEventHandler(); - bool handleTouchPoint(Platform::TouchPoint&); + bool handleTouchPoint(Platform::TouchPoint&, bool useFatFingers); void touchEventCancel(); void touchHoldEvent(); diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 49bb91c43..3cbb2e803 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,736 @@ +2012-06-24 Luke Macpherson <macpherson@chromium.org> + + Add runtime flag to enable/disable CSS variables (in addition to existing compile-time flag). + https://bugs.webkit.org/show_bug.cgi?id=89542 + + Reviewed by Dimitri Glazkov. + + * features.gypi: + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setExperimentalCSSVariablesEnabled): + (WebKit): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + +2012-06-23 Kwang Yul Seo <skyul@company100.net> + + [chromium] Return has value, in function returning void + https://bugs.webkit.org/show_bug.cgi?id=89822 + + Reviewed by Adam Barth. + + A followup for r121091. + + * src/WebHistoryItem.cpp: + (WebKit::WebHistoryItem::setPageScaleFactor): + * src/WebImageLayer.cpp: + (WebKit::WebImageLayer::setBitmap): + * src/WebLayer.cpp: + (WebKit::WebLayer::setMaskLayer): + * src/WebOptionElement.cpp: + (WebKit::WebOptionElement::setValue): + (WebKit::WebOptionElement::setDefaultSelected): + +2012-06-23 Kwang Yul Seo <skyul@company100.net> + + [chromium] Return has value, in function returning void + https://bugs.webkit.org/show_bug.cgi?id=89805 + + Reviewed by Adam Barth. + + Make WebFrameImpl::replaceSelection not return a value because it is a function returning void. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::replaceSelection): + +2012-06-22 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed. Rolled DEPS. + + * DEPS: + +2012-06-22 David Grogan <dgrogan@chromium.org> + + IndexedDB: Avoid infinite loop if we try to encode -1 for leveldb + https://bugs.webkit.org/show_bug.cgi?id=89625 + + Reviewed by Tony Chang. + + * tests/IDBLevelDBCodingTest.cpp: + (IDBLevelDBCoding::TEST): + +2012-06-22 Michael Nordman <michaeln@google.com> + + [chromium] WebKit API plumbing for applicationCache.abort() + https://bugs.webkit.org/show_bug.cgi?id=89792 + + Reviewed by Darin Fisher. + + * public/WebApplicationCacheHost.h: + (WebKit::WebApplicationCacheHost::abort): + * src/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::abort): + +2012-06-22 James Robinson <jamesr@chromium.org> + + [chromium] LayerRendererChromium is not getting visibility messages in single threaded compositing mode. + https://bugs.webkit.org/show_bug.cgi?id=89045 + + Reviewed by Adrienne Walker. + + Based on patch by Michal Mocny <mmocny@google.com>. + + Update various test fixtures and tests to cover scheduling, visibility, and resource allocation changes. + + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + (CCLayerTreeHostTestAbortFrameWhenInvisible): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::CCLayerTreeHostTestAbortFrameWhenInvisible): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::beginTest): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::afterTest): + (WTF): + (WTF::TEST_F): + (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): + (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): + (WTF::CCLayerTreeHostTestManySurfaces::beginTest): + * tests/CCSchedulerStateMachineTest.cpp: + (WebCore::TEST): + * tests/CCTiledLayerTestCommon.h: + * tests/FakeWebGraphicsContext3D.h: + (WebKit::FakeWebGraphicsContext3D::FakeWebGraphicsContext3D): + (FakeWebGraphicsContext3D): + (WebKit::FakeWebGraphicsContext3D::createTexture): + * tests/LayerRendererChromiumTest.cpp: + (TEST_F): + * tests/TiledLayerChromiumTest.cpp: + + +2012-06-22 Sadrul Habib Chowdhury <sadrul@chromium.org> + + [chromium] Notify the document if a plugin accepts touch input events + https://bugs.webkit.org/show_bug.cgi?id=89769 + + Reviewed by Adam Barth. + + The browser sends touch events to webkit only if webkit has any touch-event handlers. So it is + necessary to notify the document when a plugin starts accepting touch-events so that it can in + turn tell the browser to send it touch events. + + * public/WebPluginContainer.h: + (WebPluginContainer): + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::setIsAcceptingTouchEvents): + (WebKit): + (WebKit::WebPluginContainerImpl::WebPluginContainerImpl): + (WebKit::WebPluginContainerImpl::~WebPluginContainerImpl): + * src/WebPluginContainerImpl.h: + (WebPluginContainerImpl): + +2012-06-22 Kenneth Russell <kbr@google.com> + + Unreviewed, rolling out r121064. + http://trac.webkit.org/changeset/121064 + https://bugs.webkit.org/show_bug.cgi?id=88268 + + Broke Chromium Mac build. + + * public/WebView.h: + (WebKit): + (WebView): + * src/WebLayerTreeView.cpp: + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + (WebViewImpl): + * tests/CCLayerTreeHostTest.cpp: + (WTF::CCLayerTreeHostTestScrollSimple::layout): + (WTF::CCLayerTreeHostTestScrollMultipleRedraw::drawLayersOnCCThread): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::didCommitAndDrawFrame): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::didCommit): + +2012-06-22 Dave Tu <dtu@chromium.org> + + [chromium] Expose rendering statistics to WebWidget. + https://bugs.webkit.org/show_bug.cgi?id=88268 + + Reviewed by James Robinson. + + The WebKit side of a basic framework for exposing rendering statistics + to Chromium's --enable-benchmarking extension. + + * src/WebLayerTreeView.cpp: + (WebKit::WebLayerTreeView::renderingStatistics): + (WebKit): + +2012-06-22 Shawn Singh <shawnsingh@chromium.org> + + [chromium] Do not accumulate occlusion from 3d layers on the main thread + https://bugs.webkit.org/show_bug.cgi?id=89704 + + Reviewed by James Robinson. + + * tests/CCOcclusionTrackerTest.cpp: + (WebKitTests::CCOcclusionTrackerTest::calcDrawEtc): + (WebKitTests): + (CCOcclusionTrackerTestUnsorted3dLayers): + (WebKitTests::CCOcclusionTrackerTestUnsorted3dLayers::runMyTest): + (WebKitTests::CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect::runMyTest): + +2012-06-22 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Snapshot metadata in front end to avoid IPC round-trips + https://bugs.webkit.org/show_bug.cgi?id=88467 + + Reviewed by Tony Chang. + + Add conversions to/from WebCore IDB metadata type and plumbing for routing the + IDBDatabaseBackendInterface::metadata() call through the public API.. + + * WebKit.gyp: New file added. + * public/WebIDBMetadata.h: Conversion functions. + (WebCore): + (WebIDBMetadata): + * src/IDBDatabaseBackendProxy.cpp: Plumbing. + (WebKit::IDBDatabaseBackendProxy::metadata): + (WebKit): + * src/IDBDatabaseBackendProxy.h: Plumbing. + (IDBDatabaseBackendProxy): + * src/WebIDBDatabaseImpl.cpp: Plumbing. + (WebKit::WebIDBDatabaseImpl::metadata): + (WebKit): + * src/WebIDBDatabaseImpl.h: Plumbing. + (WebKit): + (WebIDBDatabaseImpl): + * src/WebIDBMetadata.cpp: Added - conversion functions. + (WebKit): + (WebKit::WebIDBMetadata::WebIDBMetadata): + (WebKit::WebIDBMetadata::operator IDBDatabaseMetadata): + +2012-06-22 Fady Samuel <fsamuel@chromium.org> + + [Chromium] Browser Plugin: Expose advanceFocus to WebKit API so that guests can advance focus of theirs embedders + https://bugs.webkit.org/show_bug.cgi?id=88827 + + Reviewed by Darin Fisher. + + A browser plugin needs to be able to tells its embedder when the guest + is done tabbing through controls and wants its embedder to advance its + tab position. + + * public/WebView.h: + (WebView): + (WebKit::WebView::advanceFocus): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::advanceFocus): + (WebKit): + * src/WebViewImpl.h: + (WebViewImpl): + +2012-06-22 Jeff Timanus <twiz@chromium.org> + + [Chromium] Change implementing a fast-path for copying GPU-accelerated Canvas2D instances to WebGL textures. + https://bugs.webkit.org/show_bug.cgi?id=86275 + + This change adds the necessary plumbing to the various rendering contexts to copy the backing store texture of + a Canvas2D instance to be copied to a WebGL texture. The GL_CHROMIUM_copy_texture extension is necessary + because the backing-store for a GPU-accelerated skia Canvas2D is normally in BGRA format, which is not supported + by glCopyTexImage. + + Reviewed by Kenneth Russell. + + * DEPS: Rolled chromium to 143630 to fix chromium-linux ews failures. + +2012-06-22 Kenneth Russell <kbr@google.com> + + Unreviewed, rolling out r121025. + http://trac.webkit.org/changeset/121025 + https://bugs.webkit.org/show_bug.cgi?id=89580 + + Caused crash in + EventHandler.shouldTurnVerticalTicksIntoHorizontal webkit unit + test on 10.7 + + * WebKit.gypi: + * tests/EventHandlerTest.cpp: Removed. + +2012-06-22 Peter Beverloo <peter@chromium.org> + + [Chromium] Disable c++0x compatibility warnings in JavaScriptCore.gyp when building for Android + https://bugs.webkit.org/show_bug.cgi?id=88853 + + Reviewed by Steve Block. + + The Android exclusions were necessary to fix a gyp generation error, as + the gcc_version variable wasn't being defined for Android. Remove these + exceptions when Chromium is able to define the gcc_version variable. + + * WebKit.gyp: + * WebKitUnitTests.gyp: + +2012-06-22 Robert Kroeger <rjkroege@chromium.org> + + Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true + https://bugs.webkit.org/show_bug.cgi?id=89580 + + WebKit GTK and Chromium Linux force vertical wheel events to + scroll horizontally when over horizontal scroll bars. This is + undesirable for touchpad scrolling with hasPreciseScrollingDeltas() == true. + + Added unit tests to show that + EventHandler::shouldTurnVerticalTicksIntoHorizontal() is true + only for PlatformWheelEvents when !hasPreciseScrollingDeltas(). + + Reviewed by Adam Barth. + + * WebKit.gypi: + * tests/EventHandlerTest.cpp: Added. + (MockScrollbar): + (MockScrollbar::MockScrollbar): + (MockScrollbar::~MockScrollbar): + (MockHitTestResult): + (MockHitTestResult::MockHitTestResult): + (MockHitTestResult::scrollbar): + (MockPlatformWheelEvent): + (MockPlatformWheelEvent::MockPlatformWheelEvent): + (EventHandlerTest): + (EventHandlerTest::EventHandlerTest): + (EventHandlerTest::externalShouldTurnVerticalTicksIntoHorizontal): + (TEST): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + + * public/WebDeviceOrientation.h: + (WebDeviceOrientation): + * src/DeviceOrientationClientProxy.cpp: + (WebKit::DeviceOrientationClientProxy::lastOrientation): + * src/DeviceOrientationClientProxy.h: + (DeviceOrientationClientProxy): + * src/WebDeviceOrientation.cpp: + (WebKit::WebDeviceOrientation::WebDeviceOrientation): + (WebKit::WebDeviceOrientation::operator=): + (WebKit::WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientationData>): + * src/WebDeviceOrientationController.cpp: + (WebKit::WebDeviceOrientationController::didChangeDeviceOrientation): + +2012-06-22 Joseph Pecoraro <pecoraro@apple.com> + + Web Inspector: InspectorState::updateCookie should not do JSON serialization if unsupported + https://bugs.webkit.org/show_bug.cgi?id=89743 + + The Chromium port does want InspectorState updates. + + Reviewed by Yury Semikhatsky. + + * src/InspectorClientImpl.h: + (WebKit::InspectorClientImpl::supportsInspectorStateUpdates): + * src/WebDevToolsAgentImpl.h: + (WebKit::WebDevToolsAgentImpl::supportsInspectorStateUpdates): + +2012-06-21 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r120982. + http://trac.webkit.org/changeset/120982 + https://bugs.webkit.org/show_bug.cgi?id=89740 + + [chromium] ASSERTION FAILED: + m_allocatedTextureIds.contains(textureId) (Requested by ukai + on #webkit). + + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + (CCLayerTreeHostTestVisibilityAndAllocationControlDrawing): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::beginTest): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::didCommitAndDrawFrame): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::didCommit): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::commitCompleteOnCCThread): + (WTF::CCLayerTreeHostTestVisibilityAndAllocationControlDrawing::afterTest): + (WTF): + (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): + (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): + (WTF::CCLayerTreeHostTestManySurfaces::beginTest): + * tests/CCSchedulerStateMachineTest.cpp: + (WebCore::TEST): + * tests/CCTiledLayerTestCommon.h: + (WebKitTests::FakeTextureAllocator::createTexture): + (WebKitTests::FakeTextureAllocator::deleteTexture): + * tests/FakeWebGraphicsContext3D.h: + (WebKit::FakeWebGraphicsContext3D::createTexture): + (FakeWebGraphicsContext3D): + * tests/LayerRendererChromiumTest.cpp: + (TEST_F): + * tests/TiledLayerChromiumTest.cpp: + +2012-06-21 James Robinson <jamesr@chromium.org> + + [chromium] Initialize compositor's visibility state upon initialization + https://bugs.webkit.org/show_bug.cgi?id=89712 + + Reviewed by Adrienne Walker. + + A given WebViewImpl's visibility state might change any number of times before compositing is enabled. If the + visibility state is not the default (visible) when the compositor is initialized, we need to let it know the + correct visibility state or it will start ticking uselessly in threaded mode. + + Tested manually, there's no way to create a new WebViewImpl in a non-visible state in a WebKit test that I know + of. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + +2012-06-21 Sadrul Habib Chowdhury <sadrul@chromium.org> + + [chromium] Add touch-event support for WebPluginContainerImpl + https://bugs.webkit.org/show_bug.cgi?id=89089 + + Reviewed by Adam Barth. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleEvent): + * src/WebPluginContainerImpl.h: + (WebCore): + (WebPluginContainerImpl): + +2012-06-21 Oli Lan <olilan@chromium.org> + + Add methods to select between offsets in an editable field. + https://bugs.webkit.org/show_bug.cgi?id=89098 + + Reviewed by Ryosuke Niwa. + + Reviewed by Ryosuke Niwa. + + This adds a new method WebViewImpl::setEditableSelectionOffsets, which + can be used to select between two character positions in the node + currently beign edited. + + The offsets are assumed to be relative to the rootEditableElement. + + This can be used for IME features that require the ability to manipulate + the selection, for example on Android where the method InputConnection#setSelection + is used. + + This method calls a new method Editor::setSelectionOffsets. + + The method works for inputs/textareas (i.e. text form controls) and + contenteditable nodes, and the new test in WebViewTest tests both these cases. + + * public/WebView.h: + (WebView): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setEditableSelectionOffsets): + (WebKit): + * src/WebViewImpl.h: + (WebViewImpl): + * tests/WebViewTest.cpp: + (WebKit::TEST_F): + (WebKit): + * tests/data/content_editable_populated.html: Added. + * tests/data/input_field_populated.html: Added. + +2012-06-19 James Robinson <jamesr@chromium.org> + + [chromium] LayerRendererChromium is not getting visibility messages in single threaded compositing mode. + https://bugs.webkit.org/show_bug.cgi?id=89045 + + Reviewed by Adrienne Walker. + + Based on patch by Michal Mocny <mmocny@google.com>. + + Update various test fixtures and tests to cover scheduling, visibility, and resource allocation changes. + + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + (CCLayerTreeHostTestAbortFrameWhenInvisible): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::CCLayerTreeHostTestAbortFrameWhenInvisible): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::beginTest): + (WTF::CCLayerTreeHostTestAbortFrameWhenInvisible::afterTest): + (WTF): + (WTF::TEST_F): + (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): + (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): + (WTF::CCLayerTreeHostTestManySurfaces::beginTest): + * tests/CCSchedulerStateMachineTest.cpp: + (WebCore::TEST): + * tests/CCTiledLayerTestCommon.h: + * tests/FakeWebGraphicsContext3D.h: + (WebKit::FakeWebGraphicsContext3D::FakeWebGraphicsContext3D): + (FakeWebGraphicsContext3D): + (WebKit::FakeWebGraphicsContext3D::createTexture): + * tests/LayerRendererChromiumTest.cpp: + (TEST_F): + * tests/TiledLayerChromiumTest.cpp: + + +2012-06-21 Mike West <mkwst@chromium.org> + + [Chromium] Enable CSP_NEXT on the Chromium port. + https://bugs.webkit.org/show_bug.cgi?id=89683 + + Reviewed by Adam Barth. + + Enable CSP 1.1 on the Chromium port. This has zero practical effect, + as no CSP 1.1 patches have landed yet. But it will. Oh it will. + + * features.gypi: ENABLE_CSP_NEXT=1 + +2012-06-21 Alec Flett <alecflett@chromium.org> + + IndexedDB: Implement spec behavior for multiEntry indexes with invalid/duplicate subkeys + https://bugs.webkit.org/show_bug.cgi?id=86123 + + Reviewed by Darin Fisher. + + Add matching isValid() to WebIDBKey to match the one in IDBKey. + + * public/WebIDBKey.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::isValid): + (WebKit): + * src/WebIDBKeyRange.cpp: + (WebKit::WebIDBKeyRange::assign): + +2012-06-21 Ian Vollick <vollick@chromium.org> + + [chromium] Overlays when using the web inspector are blurry with device scale factor > 1 + https://bugs.webkit.org/show_bug.cgi?id=89676 + + Reviewed by James Robinson. + + Whenever we construct a GraphicsLayerChromium, make initialize the + device and page scale factors, if possible. + + * tests/GraphicsLayerChromiumTest.cpp: + (WebKitTests::TEST_F): + (WebKitTests): + +2012-06-21 Min Qin <qinmin@chromium.org> + + remove ENABLE_FULLSCREEN_MEDIA_CONTROL flag + https://bugs.webkit.org/show_bug.cgi?id=89614 + + Reviewed by Eric Carlson. + + Since desktop chrome now has fullscreen button, we don't need this flag anymore + + * features.gypi: + +2012-06-20 Zeev Lieber <zlieber@chromium.org> + + [Chromium] Damage tracker is not used without partial swap, causing valid render passes to be removed + https://bugs.webkit.org/show_bug.cgi?id=89589 + + Reviewed by Adrienne Walker. + + Added unit tests to check surface texture caching when partial + swap is not used. + + * tests/CCLayerTreeHostImplTest.cpp: + +2012-06-20 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r120889. + http://trac.webkit.org/changeset/120889 + https://bugs.webkit.org/show_bug.cgi?id=89630 + + [Chromium] webkit_unit_tests didDrawNotCalledOnHiddenLayer + start failing (Requested by ukai on #webkit). + + * tests/CCLayerTreeHostImplTest.cpp: + +2012-06-20 Zeev Lieber <zlieber@chromium.org> + + [Chromium] Damage tracker is not used without partial swap, causing valid render passes to be removed + https://bugs.webkit.org/show_bug.cgi?id=89589 + + Reviewed by Adrienne Walker. + + Added unit tests to check surface texture caching when partial + swap is not used. + + * tests/CCLayerTreeHostImplTest.cpp: + +2012-06-20 Joshua Bell <jsbell@chromium.org> + + IndexedDB: Remove redundant IDBObjectStore.delete() overloads + https://bugs.webkit.org/show_bug.cgi?id=89587 + + Reviewed by Darin Fisher. + + * public/WebIDBObjectStore.h: Add note to remove overload when Chromium is updated. + (WebIDBObjectStore): + * src/IDBObjectStoreBackendProxy.cpp: Delete IDBKey overload. + * src/IDBObjectStoreBackendProxy.h: Delete IDBKey overload. + (IDBObjectStoreBackendProxy): + * src/WebIDBObjectStoreImpl.cpp: Delete IDBKey overload. + * src/WebIDBObjectStoreImpl.h: Delete IDBKey overload. + (WebIDBObjectStoreImpl): + +2012-06-20 Garret Kelly <gdk@chromium.org> + + Moving cookieEnabled/setCookieEnabled from Page to Settings, and + exposing through WebSettings. + https://bugs.webkit.org/show_bug.cgi?id=89545 + + Reviewed by Adam Barth. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setCookieEnabled): + * src/WebSettingsImpl.h: + (WebSettingsImpl): + +2012-06-20 Raymes Khoury <raymes@chromium.org> + + Perform hit-test from correct frame in isRectTopmost() + https://bugs.webkit.org/show_bug.cgi?id=89492 + + Reviewed by Levi Weintraub. + + Hit-testing was being performed from the main frame, which gave the + incorrect result if the plugin was in a different frame. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::isRectTopmost): + +2012-06-20 Alexandre Elias <aelias@google.com> + + [chromium] Support mobile device rotation resizing + https://bugs.webkit.org/show_bug.cgi?id=86819 + + Reviewed by Adam Barth. + + Resizes on a mobile device are caused either by rotation or + on-screen-keyboard bringup, and need different treatment to remain + naturally laid out, scaled and scrolled without disorienting the user. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + +2012-06-19 James Robinson <jamesr@chromium.org> + + [chromium] Separate LayerRenderer initialization from updateLayers + https://bugs.webkit.org/show_bug.cgi?id=89525 + + Reviewed by Adrienne Walker. + + Update tests to call initializeLayerRendererIfNeeded() before calling updateLayers() to reflect what the proxies + do. + + * tests/CCLayerTreeHostTest.cpp: + (WTF::CCLayerTreeHostTestLayerOcclusion::beginTest): + (WTF::CCLayerTreeHostTestLayerOcclusionWithFilters::beginTest): + (WTF::CCLayerTreeHostTestManySurfaces::beginTest): + * tests/TiledLayerChromiumTest.cpp: + +2012-06-20 Christopher Cameron <ccameron@chromium.org> + + [chromium] webkit-backface-visibility doesn't work with video + https://bugs.webkit.org/show_bug.cgi?id=88908 + + When determining a contents layer's backface culling, use the parent + layer's transform and backface-visibility properties. Track which + layers need this special treatment with useParentBackfaceVisibility + and setUseParentBackfaceVisibility functions in WebCore::LayerChromium, + WebKit::WebLayer, and WebCore::CCLayerImpl. + + Reviewed by Adrienne Walker. + + * src/WebLayer.cpp: + (WebKit::WebLayer::setUseParentBackfaceVisibility): + Add an accessor to specify that a layer should use its parent's + backface culling behavior. + +2012-06-20 Ian Vollick <vollick@chromium.org> + + [chromium] Make sure that render surfaces are not pixel doubled with a device scale factor of 2 + https://bugs.webkit.org/show_bug.cgi?id=86882 + + Reviewed by Adrienne Walker. + + To ensure that render surfaces are not pixel doubled when device scale factor is + two, the render surface's owning layer's draw transform is scaled by the + contents scale (in the same way that the parent matrix is scaled by the device + scale factor). The transformedLayerRect's dimensions also need to be in pixel + space. The surface origin transform should not scale, but needs to offset the + correct number of pixels, and the replica transforms need to be modified to + account for the scaling. + + * tests/CCLayerTreeHostCommonTest.cpp: + +2012-06-20 Joshua Bell <jsbell@chromium.org> + + Unreviewed build fix. + + * tests/IDBDatabaseBackendTest.cpp: + (WebCore::MockIDBCallbacks::~MockIDBCallbacks): + (WebCore::FakeIDBDatabaseCallbacks::~FakeIDBDatabaseCallbacks): + +2012-06-20 Joshua Bell <jsbell@chromium.org> + + [Chromium] IndexedDB: Don't close database if pending connections are in flight + https://bugs.webkit.org/show_bug.cgi?id=89512 + + Reviewed by Tony Chang. + + * tests/IDBDatabaseBackendTest.cpp: + (MockIDBCallbacks): + (WebCore::MockIDBCallbacks::create): + (WebCore::MockIDBCallbacks::MockIDBCallbacks): + (WebCore): + (FakeIDBDatabaseCallbacks): + (WebCore::FakeIDBDatabaseCallbacks::create): + (WebCore::FakeIDBDatabaseCallbacks::FakeIDBDatabaseCallbacks): + (WebCore::TEST): + +2012-06-20 Zeev Lieber <zlieber@chromium.org> + + [Chromium] Remove redundant #includes in compositor + https://bugs.webkit.org/show_bug.cgi?id=89503 + + Reviewed by Adrienne Walker. + + Minor adjustments to #include statements to remove + dependencies. No new tests. + + * src/WebCompositorImpl.cpp: + * src/WebLayerTreeView.cpp: + * tests/CCLayerTestCommon.cpp: + * tests/CCLayerTreeHostImplTest.cpp: + * tests/CCLayerTreeHostTest.cpp: + * tests/CCOcclusionTrackerTest.cpp: + * tests/CCQuadCullerTest.cpp: + * tests/CCTiledLayerImplTest.cpp: + * tests/ImageLayerChromiumTest.cpp: + * tests/LayerRendererChromiumTest.cpp: + * tests/TiledLayerChromiumTest.cpp: + +2012-06-20 Hans Wennborg <hans@chromium.org> + + Speech JavaScript API: add SpeechRecognition.maxAlternatives attribute + https://bugs.webkit.org/show_bug.cgi?id=89459 + + Reviewed by Eric Seidel. + + Plumbing for the maxAlternatives attribute. + + * public/WebSpeechRecognitionParams.h: + (WebKit::WebSpeechRecognitionParams::WebSpeechRecognitionParams): + (WebKit::WebSpeechRecognitionParams::maxAlternatives): + (WebSpeechRecognitionParams): + * src/SpeechRecognitionClientProxy.cpp: + (WebKit::SpeechRecognitionClientProxy::start): + * src/SpeechRecognitionClientProxy.h: + (SpeechRecognitionClientProxy): + 2012-06-20 Hironori Bono <hbono@chromium.org> [chromium] Select the marker range when right-clicking on a marker. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 78bca67d0..307c63cc0 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': '142842' + 'chromium_rev': '143776' } deps = { diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index 74db258be..bcbb91386 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -561,6 +561,7 @@ 'src/WebIDBKey.cpp', 'src/WebIDBKeyPath.cpp', 'src/WebIDBKeyRange.cpp', + 'src/WebIDBMetadata.cpp', 'src/WebIDBObjectStoreImpl.cpp', 'src/WebIDBObjectStoreImpl.h', 'src/WebIDBTransactionImpl.cpp', @@ -1036,7 +1037,7 @@ }, ], # targets 'conditions': [ - ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', { + ['os_posix==1 and OS!="mac" and gcc_version==46', { 'target_defaults': { # Disable warnings about c++0x compatibility, as some names (such # as nullptr) conflict with upcoming c++0x types. diff --git a/Source/WebKit/chromium/WebKitUnitTests.gyp b/Source/WebKit/chromium/WebKitUnitTests.gyp index 6f1ed11c7..58af83985 100644 --- a/Source/WebKit/chromium/WebKitUnitTests.gyp +++ b/Source/WebKit/chromium/WebKitUnitTests.gyp @@ -117,7 +117,7 @@ } ], # targets 'conditions': [ - ['os_posix==1 and OS!="mac" and OS!="android" and gcc_version==46', { + ['os_posix==1 and OS!="mac" and gcc_version==46', { 'target_defaults': { # Disable warnings about c++0x compatibility, as some names (such # as nullptr) conflict with upcoming c++0x types. diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index a4290a8b3..2ae79ba92 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -37,7 +37,7 @@ 'ENABLE_BLOB=1', 'ENABLE_BLOB_SLICE=1', 'ENABLE_CHANNEL_MESSAGING=1', - 'ENABLE_CSP_NEXT=0', + 'ENABLE_CSP_NEXT=1', 'ENABLE_CSS3_FLEXBOX=1', 'ENABLE_CSS_BOX_DECORATION_BREAK=1', 'ENABLE_CSS_EXCLUSIONS=1', @@ -46,7 +46,7 @@ 'ENABLE_CSS_IMAGE_RESOLUTION=0', 'ENABLE_CSS_REGIONS=1', 'ENABLE_CSS_SHADERS=1', - 'ENABLE_CSS_VARIABLES=0', + 'ENABLE_CSS_VARIABLES=1', 'ENABLE_CUSTOM_SCHEME_HANDLER=0', 'ENABLE_DATALIST=1', 'ENABLE_DASHBOARD_SUPPORT=0', @@ -136,7 +136,6 @@ 'feature_defines': [ 'ENABLE_CALENDAR_PICKER=0', 'ENABLE_FONT_BOOSTING=1', - 'ENABLE_FULLSCREEN_MEDIA_CONTROLS=1', 'ENABLE_INPUT_SPEECH=0', 'ENABLE_INPUT_TYPE_DATETIME=1', 'ENABLE_INPUT_TYPE_DATETIMELOCAL=1', @@ -162,7 +161,6 @@ 'feature_defines': [ 'ENABLE_CALENDAR_PICKER=1', 'ENABLE_FONT_BOOSTING=0', - 'ENABLE_FULLSCREEN_MEDIA_CONTROLS=1', 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_I18N_API=1', 'ENABLE_LEGACY_NOTIFICATIONS=1', diff --git a/Source/WebKit/chromium/public/WebApplicationCacheHost.h b/Source/WebKit/chromium/public/WebApplicationCacheHost.h index bd5221807..fb68126a7 100644 --- a/Source/WebKit/chromium/public/WebApplicationCacheHost.h +++ b/Source/WebKit/chromium/public/WebApplicationCacheHost.h @@ -92,6 +92,7 @@ public: virtual Status status() { return Uncached; } virtual bool startUpdate() { return false; } virtual bool swapCache() { return false; } + virtual void abort() { } // Structures and methods to support inspecting Application Caches. struct CacheInfo { diff --git a/Source/WebKit/chromium/public/WebDeviceOrientation.h b/Source/WebKit/chromium/public/WebDeviceOrientation.h index b26649e1c..66540bd8a 100644 --- a/Source/WebKit/chromium/public/WebDeviceOrientation.h +++ b/Source/WebKit/chromium/public/WebDeviceOrientation.h @@ -28,7 +28,7 @@ #if WEBKIT_IMPLEMENTATION namespace WTF { template <typename T> class PassRefPtr; } -namespace WebCore { class DeviceOrientation; } +namespace WebCore { class DeviceOrientationData; } #endif namespace WebKit { @@ -86,9 +86,9 @@ public: bool absolute() const { return m_absolute; } #if WEBKIT_IMPLEMENTATION - WebDeviceOrientation(const WebCore::DeviceOrientation*); - WebDeviceOrientation& operator=(const WebCore::DeviceOrientation*); - operator WTF::PassRefPtr<WebCore::DeviceOrientation>() const; + WebDeviceOrientation(const WebCore::DeviceOrientationData*); + WebDeviceOrientation& operator=(const WebCore::DeviceOrientationData*); + operator WTF::PassRefPtr<WebCore::DeviceOrientationData>() const; #endif private: diff --git a/Source/WebKit/chromium/public/WebIDBKey.h b/Source/WebKit/chromium/public/WebIDBKey.h index a78142345..0b704cac2 100644 --- a/Source/WebKit/chromium/public/WebIDBKey.h +++ b/Source/WebKit/chromium/public/WebIDBKey.h @@ -79,6 +79,7 @@ public: }; WEBKIT_EXPORT Type type() const; + WEBKIT_EXPORT bool isValid() const; WEBKIT_EXPORT WebVector<WebIDBKey> array() const; // Only valid for ArrayType. WEBKIT_EXPORT WebString string() const; // Only valid for StringType. WEBKIT_EXPORT double date() const; // Only valid for DateType. diff --git a/Source/WebKit/chromium/public/WebIDBMetadata.h b/Source/WebKit/chromium/public/WebIDBMetadata.h index 410d9facf..1c33d1b08 100644 --- a/Source/WebKit/chromium/public/WebIDBMetadata.h +++ b/Source/WebKit/chromium/public/WebIDBMetadata.h @@ -31,6 +31,10 @@ #include "platform/WebString.h" #include "platform/WebVector.h" +namespace WebCore { +struct IDBDatabaseMetadata; +} + namespace WebKit { struct WebIDBMetadata { @@ -62,6 +66,11 @@ struct WebIDBMetadata { , unique(false) , multiEntry(false) { } }; + +#if WEBKIT_IMPLEMENTATION + WebIDBMetadata(const WebCore::IDBDatabaseMetadata&); + operator WebCore::IDBDatabaseMetadata() const; +#endif }; diff --git a/Source/WebKit/chromium/public/WebIDBObjectStore.h b/Source/WebKit/chromium/public/WebIDBObjectStore.h index 0af426e50..d9b3232a0 100644 --- a/Source/WebKit/chromium/public/WebIDBObjectStore.h +++ b/Source/WebKit/chromium/public/WebIDBObjectStore.h @@ -73,6 +73,7 @@ public: }; virtual void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); } + // FIXME: Remove the following overload when all callers are updated. virtual void deleteFunction(const WebIDBKey&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { 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(); } diff --git a/Source/WebKit/chromium/public/WebPluginContainer.h b/Source/WebKit/chromium/public/WebPluginContainer.h index 777431fb0..99f078fd6 100644 --- a/Source/WebKit/chromium/public/WebPluginContainer.h +++ b/Source/WebKit/chromium/public/WebPluginContainer.h @@ -107,6 +107,9 @@ public: // content. The rectangle is in the plugin's coordinate system. virtual bool isRectTopmost(const WebRect&) = 0; + // Notifies when the plugin starts/stops accepting touch events. + virtual void setIsAcceptingTouchEvents(bool) = 0; + virtual WebPlugin* plugin() = 0; virtual void setPlugin(WebPlugin*) = 0; diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index 0528d8ef4..5ec5c50da 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -105,6 +105,7 @@ public: virtual void setExperimentalCSSRegionsEnabled(bool) = 0; virtual void setExperimentalCSSGridLayoutEnabled(bool) = 0; virtual void setExperimentalCSSCustomFilterEnabled(bool) = 0; + virtual void setExperimentalCSSVariablesEnabled(bool) = 0; virtual void setOpenGLMultisamplingEnabled(bool) = 0; virtual void setPrivilegedWebGLExtensionsEnabled(bool) = 0; virtual void setWebGLErrorsToConsoleEnabled(bool) = 0; @@ -154,6 +155,7 @@ public: virtual void setMaxUntiledLayerSize(WebSize) = 0; virtual void setFixedPositionCreatesStackingContext(bool) = 0; virtual void setSyncXHRInDocumentsEnabled(bool) = 0; + virtual void setCookieEnabled(bool) = 0; virtual bool forceSoftwareCompositing() const = 0; diff --git a/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h b/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h index 562bfa0c4..96eecd994 100644 --- a/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h +++ b/Source/WebKit/chromium/public/WebSpeechRecognitionParams.h @@ -37,10 +37,11 @@ class WebSpeechGrammar; class WebSpeechRecognitionParams { public: - WebSpeechRecognitionParams(const WebVector<WebSpeechGrammar>& grammars, const WebString& language, bool continuous, const WebSecurityOrigin& origin) + WebSpeechRecognitionParams(const WebVector<WebSpeechGrammar>& grammars, const WebString& language, bool continuous, unsigned long maxAlternatives, const WebSecurityOrigin& origin) : m_grammars(grammars) , m_language(language) , m_continuous(continuous) + , m_maxAlternatives(maxAlternatives) , m_origin(origin) { } @@ -48,12 +49,14 @@ public: const WebVector<WebSpeechGrammar>& grammars() const { return m_grammars; } const WebString& language() const { return m_language; } bool continuous() const { return m_continuous; } + unsigned long maxAlternatives() const { return m_maxAlternatives; } const WebSecurityOrigin& origin() const { return m_origin; } private: WebVector<WebSpeechGrammar> m_grammars; WebString m_language; bool m_continuous; + unsigned long m_maxAlternatives; WebSecurityOrigin m_origin; }; diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index 542b1021a..c15298204 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -191,6 +191,10 @@ public: // window space. virtual void scrollFocusedNodeIntoRect(const WebRect&) { } + // Advance the focus of the WebView forward to the next element or to the + // previous element in the tab sequence (if reverse is true). + virtual void advanceFocus(bool reverse) { } + // Zoom ---------------------------------------------------------------- @@ -453,6 +457,8 @@ public: // by the compositor) but must be completed by the WebView. virtual void transferActiveWheelFlingAnimation(const WebActiveWheelFlingParameters&) = 0; + virtual bool setEditableSelectionOffsets(int start, int end) = 0; + // Visibility ----------------------------------------------------------- // Sets the visibility of the WebView. diff --git a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp index bbf740dfd..2b6a47707 100644 --- a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -299,7 +299,8 @@ bool ApplicationCacheHost::swapCache() void ApplicationCacheHost::abort() { - // FIXME: See https://bugs.webkit.org/show_bug.cgi?id=76270 + if (m_internal) + m_internal->m_outerHost->abort(); } bool ApplicationCacheHost::isApplicationCacheEnabled() diff --git a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp index 29b43ba56..f1f0b33f9 100644 --- a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp +++ b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.cpp @@ -26,7 +26,7 @@ #include "config.h" #include "DeviceOrientationClientProxy.h" -#include "DeviceOrientation.h" +#include "DeviceOrientationData.h" #include "WebDeviceOrientation.h" #include "WebDeviceOrientationController.h" #include <wtf/OwnPtr.h> @@ -60,12 +60,12 @@ void DeviceOrientationClientProxy::stopUpdating() m_client->stopUpdating(); } -WebCore::DeviceOrientation* DeviceOrientationClientProxy::lastOrientation() const +WebCore::DeviceOrientationData* DeviceOrientationClientProxy::lastOrientation() const { if (!m_client) return 0; - // Cache the DeviceOrientation pointer so its reference count does not drop to zero upon return. + // Cache the DeviceOrientationData pointer so its reference count does not drop to zero upon return. m_lastOrientation = m_client->lastOrientation(); return m_lastOrientation.get(); diff --git a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h index 73fd3e2a0..eddb3d29d 100644 --- a/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h +++ b/Source/WebKit/chromium/src/DeviceOrientationClientProxy.h @@ -26,8 +26,8 @@ #ifndef DeviceOrientationClientProxy_h #define DeviceOrientationClientProxy_h -#include "DeviceOrientation.h" #include "DeviceOrientationClient.h" +#include "DeviceOrientationData.h" #include "WebDeviceOrientationClient.h" #include <wtf/RefPtr.h> @@ -47,12 +47,12 @@ public: virtual void setController(WebCore::DeviceOrientationController*) OVERRIDE; virtual void startUpdating() OVERRIDE; virtual void stopUpdating() OVERRIDE; - virtual WebCore::DeviceOrientation* lastOrientation() const OVERRIDE; + virtual WebCore::DeviceOrientationData* lastOrientation() const OVERRIDE; virtual void deviceOrientationControllerDestroyed() OVERRIDE; private: WebDeviceOrientationClient* m_client; - mutable RefPtr<WebCore::DeviceOrientation> m_lastOrientation; + mutable RefPtr<WebCore::DeviceOrientationData> m_lastOrientation; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index 58661ebab..107ec63b3 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -31,6 +31,7 @@ #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBDatabaseCallbacks.h" +#include "IDBMetadata.h" #include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionBackendProxy.h" #include "WebDOMStringList.h" @@ -60,6 +61,11 @@ IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy() { } +IDBDatabaseMetadata IDBDatabaseBackendProxy::metadata() const +{ + return m_webIDBDatabase->metadata(); +} + String IDBDatabaseBackendProxy::name() const { return m_webIDBDatabase->name(); diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index e817edf19..b05552ccb 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -42,6 +42,7 @@ public: static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>); virtual ~IDBDatabaseBackendProxy(); + virtual WebCore::IDBDatabaseMetadata metadata() const; virtual String name() const; virtual String version() const; virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const; diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index c03b2f13b..9ca777bc9 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -95,14 +95,6 @@ void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, Pa m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, 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->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); -} - void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKeyRange> keyRange, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h index 5d6796c64..c6da74cf1 100644 --- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -50,7 +50,6 @@ public: virtual void get(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); - virtual void deleteFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void deleteFunction(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.h b/Source/WebKit/chromium/src/InspectorClientImpl.h index 6cb5c5544..5ea6baeb3 100644 --- a/Source/WebKit/chromium/src/InspectorClientImpl.h +++ b/Source/WebKit/chromium/src/InspectorClientImpl.h @@ -59,6 +59,7 @@ public: virtual bool sendMessageToFrontend(const WTF::String&); + virtual bool supportsInspectorStateUpdates() const { return true; } virtual void updateInspectorStateCookie(const WTF::String&); virtual bool canClearBrowserCache(); diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp index cd35b2620..0888e3033 100644 --- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp +++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp @@ -55,13 +55,13 @@ PassOwnPtr<SpeechRecognitionClientProxy> SpeechRecognitionClientProxy::create(We return adoptPtr(new SpeechRecognitionClientProxy(recognizer)); } -void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous) +void SpeechRecognitionClientProxy::start(SpeechRecognition* recognition, const SpeechGrammarList* grammarList, const String& lang, bool continuous, unsigned long maxAlternatives) { WebVector<WebSpeechGrammar> webSpeechGrammars(static_cast<size_t>(grammarList->length())); for (unsigned long i = 0; i < grammarList->length(); ++i) webSpeechGrammars[i] = grammarList->item(i); - WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin())); + WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, maxAlternatives, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin())); m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this); } diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h index 0c3ecebaa..8063e71ed 100644 --- a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h +++ b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h @@ -46,7 +46,7 @@ public: static PassOwnPtr<SpeechRecognitionClientProxy> create(WebSpeechRecognizer*); // WebCore::SpeechRecognitionClient: - virtual void start(WebCore::SpeechRecognition*, const WebCore::SpeechGrammarList*, const String& lang, bool continuous) OVERRIDE; + virtual void start(WebCore::SpeechRecognition*, const WebCore::SpeechGrammarList*, const String& lang, bool continuous, unsigned long maxAlternatives) OVERRIDE; virtual void stop(WebCore::SpeechRecognition*) OVERRIDE; virtual void abort(WebCore::SpeechRecognition*) OVERRIDE; diff --git a/Source/WebKit/chromium/src/WebCompositorImpl.cpp b/Source/WebKit/chromium/src/WebCompositorImpl.cpp index f4e96e0be..369ae555a 100644 --- a/Source/WebKit/chromium/src/WebCompositorImpl.cpp +++ b/Source/WebKit/chromium/src/WebCompositorImpl.cpp @@ -28,6 +28,7 @@ #include "WebCompositorImpl.h" #include "CCThreadImpl.h" +#include "GraphicsContext3D.h" #include "WebKit.h" #include "platform/WebKitPlatformSupport.h" #include "WebCompositorClient.h" diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h index edbee1471..6b5247617 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -94,6 +94,7 @@ public: virtual void bringFrontendToFront(); virtual void highlight(); virtual void hideHighlight(); + virtual bool supportsInspectorStateUpdates() const { return true; } virtual void updateInspectorStateCookie(const WTF::String&); virtual bool sendMessageToFrontend(const WTF::String&); diff --git a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp index d7a282f35..24f7bc801 100644 --- a/Source/WebKit/chromium/src/WebDeviceOrientation.cpp +++ b/Source/WebKit/chromium/src/WebDeviceOrientation.cpp @@ -26,12 +26,12 @@ #include "config.h" #include "WebDeviceOrientation.h" -#include "DeviceOrientation.h" +#include "DeviceOrientationData.h" #include <wtf/PassRefPtr.h> namespace WebKit { -WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientation* orientation) +WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientationData* orientation) { if (!orientation) { m_isNull = true; @@ -57,7 +57,7 @@ WebDeviceOrientation::WebDeviceOrientation(const WebCore::DeviceOrientation* ori m_absolute = orientation->absolute(); } -WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrientation* orientation) +WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrientationData* orientation) { if (!orientation) { m_isNull = true; @@ -84,11 +84,11 @@ WebDeviceOrientation& WebDeviceOrientation::operator=(const WebCore::DeviceOrien return *this; } -WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientation>() const +WebDeviceOrientation::operator PassRefPtr<WebCore::DeviceOrientationData>() const { if (m_isNull) return 0; - return WebCore::DeviceOrientation::create(m_canProvideAlpha, m_alpha, m_canProvideBeta, m_beta, m_canProvideGamma, m_gamma, m_canProvideAbsolute, m_absolute); + return WebCore::DeviceOrientationData::create(m_canProvideAlpha, m_alpha, m_canProvideBeta, m_beta, m_canProvideGamma, m_gamma, m_canProvideAbsolute, m_absolute); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp b/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp index 7d09a6e7d..0b9ee88e9 100644 --- a/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp +++ b/Source/WebKit/chromium/src/WebDeviceOrientationController.cpp @@ -26,8 +26,8 @@ #include "config.h" #include "WebDeviceOrientationController.h" -#include "DeviceOrientation.h" #include "DeviceOrientationController.h" +#include "DeviceOrientationData.h" #include "WebDeviceOrientation.h" #include <wtf/PassRefPtr.h> @@ -35,7 +35,7 @@ namespace WebKit { void WebDeviceOrientationController::didChangeDeviceOrientation(const WebDeviceOrientation& orientation) { - RefPtr<WebCore::DeviceOrientation> deviceOrientation = PassRefPtr<WebCore::DeviceOrientation>(orientation); + RefPtr<WebCore::DeviceOrientationData> deviceOrientation = PassRefPtr<WebCore::DeviceOrientationData>(orientation); m_controller->didChangeDeviceOrientation(deviceOrientation.get()); } diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 88fd9f61d..8ccec72b1 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -1162,7 +1162,7 @@ void WebFrameImpl::replaceSelection(const WebString& text) { bool selectReplacement = false; bool smartReplace = true; - return frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace); + frame()->editor()->replaceSelectionWithText(text, selectReplacement, smartReplace); } void WebFrameImpl::insertText(const WebString& text) diff --git a/Source/WebKit/chromium/src/WebHistoryItem.cpp b/Source/WebKit/chromium/src/WebHistoryItem.cpp index 27dbc44c2..db35317ad 100644 --- a/Source/WebKit/chromium/src/WebHistoryItem.cpp +++ b/Source/WebKit/chromium/src/WebHistoryItem.cpp @@ -173,7 +173,7 @@ float WebHistoryItem::pageScaleFactor() const void WebHistoryItem::setPageScaleFactor(float scale) { ensureMutable(); - return m_private->setPageScaleFactor(scale); + m_private->setPageScaleFactor(scale); } bool WebHistoryItem::isTargetItem() const diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 2662f801f..39803e145 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -32,9 +32,11 @@ #include "IDBCallbacksProxy.h" #include "IDBDatabaseBackendInterface.h" #include "IDBDatabaseCallbacksProxy.h" +#include "IDBMetadata.h" #include "IDBTransactionBackendInterface.h" #include "WebIDBCallbacks.h" #include "WebIDBDatabaseCallbacks.h" +#include "WebIDBMetadata.h" #include "WebIDBObjectStoreImpl.h" #include "WebIDBTransactionImpl.h" @@ -51,6 +53,11 @@ WebIDBDatabaseImpl::~WebIDBDatabaseImpl() { } +WebIDBMetadata WebIDBDatabaseImpl::metadata() const +{ + return m_databaseBackend->metadata(); +} + WebString WebIDBDatabaseImpl::name() const { return m_databaseBackend->name(); diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 190d7e2dc..5e989e00e 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -40,6 +40,7 @@ namespace WebKit { class IDBDatabaseCallbacksProxy; class WebIDBDatabaseCallbacks; +class WebIDBDatabaseMetadata; class WebIDBObjectStore; class WebIDBTransaction; @@ -49,6 +50,7 @@ public: WebIDBDatabaseImpl(WTF::PassRefPtr<WebCore::IDBDatabaseBackendInterface>); virtual ~WebIDBDatabaseImpl(); + virtual WebIDBMetadata metadata() const; virtual WebString name() const; virtual WebString version() const; virtual WebDOMStringList objectStoreNames() const; diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp index 25be6c52f..cfadafbac 100644 --- a/Source/WebKit/chromium/src/WebIDBKey.cpp +++ b/Source/WebKit/chromium/src/WebIDBKey.cpp @@ -120,6 +120,8 @@ static PassRefPtr<IDBKey> convertFromWebIDBKeyArray(const WebVector<WebIDBKey>& keys.append(IDBKey::createNumber(array[i].number())); break; case WebIDBKey::InvalidType: + keys.append(IDBKey::createInvalid()); + break; case WebIDBKey::NullType: ASSERT_NOT_REACHED(); break; @@ -149,6 +151,8 @@ static void convertToWebIDBKeyArray(const IDBKey::KeyArray& array, WebVector<Web keys[i] = WebIDBKey::createNumber(key->number()); break; case IDBKey::InvalidType: + keys[i] = WebIDBKey::createInvalid(); + break; case IDBKey::MinType: ASSERT_NOT_REACHED(); break; @@ -199,6 +203,13 @@ WebIDBKey::Type WebIDBKey::type() const return Type(m_private->type()); } +bool WebIDBKey::isValid() const +{ + if (!m_private.get()) + return false; + return m_private->isValid(); +} + WebVector<WebIDBKey> WebIDBKey::array() const { WebVector<WebIDBKey> keys; diff --git a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp index fef0d3c3d..419261c22 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -43,7 +43,7 @@ void WebIDBKeyRange::assign(const WebIDBKeyRange& other) void WebIDBKeyRange::assign(const WebIDBKey& lower, const WebIDBKey& upper, bool lowerOpen, bool upperOpen) { - if (lower.type() == WebIDBKey::InvalidType && upper.type() == WebIDBKey::InvalidType) + if (!lower.isValid() && !upper.isValid()) m_private = 0; else m_private = IDBKeyRange::create(lower, upper, lowerOpen ? IDBKeyRange::LowerBoundOpen : IDBKeyRange::LowerBoundClosed, upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed); diff --git a/Source/WebKit/chromium/src/WebIDBMetadata.cpp b/Source/WebKit/chromium/src/WebIDBMetadata.cpp new file mode 100644 index 000000000..735063ef0 --- /dev/null +++ b/Source/WebKit/chromium/src/WebIDBMetadata.cpp @@ -0,0 +1,88 @@ +/* + * 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 "WebIDBMetadata.h" + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBMetadata.h" +#include "WebIDBKeyPath.h" +#include "platform/WebString.h" +#include "platform/WebVector.h" + +using namespace WebCore; + +namespace WebKit { + +WebIDBMetadata::WebIDBMetadata(const WebCore::IDBDatabaseMetadata& metadata) +{ + name = metadata.name; + version = metadata.version; + objectStores = WebVector<ObjectStore>(static_cast<size_t>(metadata.objectStores.size())); + + size_t i = 0; + for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator storeIterator = metadata.objectStores.begin(); storeIterator != metadata.objectStores.end(); ++storeIterator) { + const IDBObjectStoreMetadata& objectStore = storeIterator->second; + ObjectStore webObjectStore; + webObjectStore.name = objectStore.name; + webObjectStore.keyPath = objectStore.keyPath; + webObjectStore.autoIncrement = objectStore.autoIncrement; + webObjectStore.indexes = WebVector<Index>(static_cast<size_t>(objectStore.indexes.size())); + + size_t j = 0; + for (IDBObjectStoreMetadata::IndexMap::const_iterator indexIterator = objectStore.indexes.begin(); indexIterator != objectStore.indexes.end(); ++indexIterator) { + const IDBIndexMetadata& index = indexIterator->second; + Index webIndex; + webIndex.name = index.name; + webIndex.keyPath = index.keyPath; + webIndex.unique = index.unique; + webIndex.multiEntry = index.multiEntry; + webObjectStore.indexes[j++] = webIndex; + } + objectStores[i++] = webObjectStore; + } +} + +WebIDBMetadata::operator IDBDatabaseMetadata() const +{ + IDBDatabaseMetadata db(name, version); + for (size_t i = 0; i < objectStores.size(); ++i) { + const ObjectStore webObjectStore = objectStores[i]; + IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.keyPath, webObjectStore.autoIncrement); + + for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) { + const Index webIndex = webObjectStore.indexes[j]; + IDBIndexMetadata index(webIndex.name, webIndex.keyPath, webIndex.unique, webIndex.multiEntry); + objectStore.indexes.set(index.name, index); + } + db.objectStores.set(objectStore.name, objectStore); + } + return db; +} + +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index ebd7ae945..4c45be2f9 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -83,11 +83,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(), ec); } -void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) -{ - m_objectStore->deleteFunction(key, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec); -} - void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKeyRange& keyRange, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) { m_objectStore->deleteFunction(keyRange, IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec); diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 91aee7833..1bffd562b 100644 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -52,7 +52,6 @@ public: void get(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); - void deleteFunction(const WebIDBKey&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&); diff --git a/Source/WebKit/chromium/src/WebImageLayer.cpp b/Source/WebKit/chromium/src/WebImageLayer.cpp index 93dbf3930..f76151530 100644 --- a/Source/WebKit/chromium/src/WebImageLayer.cpp +++ b/Source/WebKit/chromium/src/WebImageLayer.cpp @@ -42,7 +42,7 @@ WebImageLayer::WebImageLayer(PassRefPtr<WebCore::ImageLayerChromium> layer) void WebImageLayer::setBitmap(SkBitmap bitmap) { - return unwrap<WebCore::ImageLayerChromium>()->setBitmap(bitmap); + unwrap<WebCore::ImageLayerChromium>()->setBitmap(bitmap); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebLayer.cpp b/Source/WebKit/chromium/src/WebLayer.cpp index 6b1029814..25cb5868c 100644 --- a/Source/WebKit/chromium/src/WebLayer.cpp +++ b/Source/WebKit/chromium/src/WebLayer.cpp @@ -187,7 +187,7 @@ bool WebLayer::masksToBounds() const void WebLayer::setMaskLayer(const WebLayer& maskLayer) { WebLayer ref = maskLayer; - return m_private->setMaskLayer(ref.unwrap<LayerChromium>()); + m_private->setMaskLayer(ref.unwrap<LayerChromium>()); } WebLayer WebLayer::maskLayer() const @@ -270,6 +270,11 @@ void WebLayer::setPreserves3D(bool preserve3D) m_private->setPreserves3D(preserve3D); } +void WebLayer::setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) +{ + m_private->setUseParentBackfaceVisibility(useParentBackfaceVisibility); +} + void WebLayer::setBackgroundColor(WebColor color) { m_private->setBackgroundColor(color); diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp index 47cc88310..356af1de2 100644 --- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp +++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp @@ -27,7 +27,9 @@ #include "platform/WebLayerTreeView.h" #include "GraphicsContext3DPrivate.h" +#include "LayerChromium.h" #include "WebLayerTreeViewImpl.h" +#include "cc/CCGraphicsContext.h" #include "cc/CCLayerTreeHost.h" #include "platform/WebLayer.h" #include "platform/WebPoint.h" diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index 95186dd86..3ca9f5d0f 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -803,11 +803,13 @@ void WebMediaPlayerClientImpl::getSupportedTypes(HashSet<String>& supportedTypes #if ENABLE(ENCRYPTED_MEDIA) MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type, const String& codecs, - const String& keySystem) + const String& keySystem, + const KURL&) { #else MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& type, - const String& codecs) + const String& codecs, + const KURL&) { String keySystem; #endif diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 53a24d666..b3c94fe58 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -186,10 +186,10 @@ private: static void getSupportedTypes(WTF::HashSet<WTF::String>&); #if ENABLE(ENCRYPTED_MEDIA) static WebCore::MediaPlayer::SupportsType supportsType( - const WTF::String& type, const WTF::String& codecs, const String& keySystem); + const WTF::String& type, const WTF::String& codecs, const String& keySystem, const WebCore::KURL&); #else static WebCore::MediaPlayer::SupportsType supportsType( - const WTF::String& type, const WTF::String& codecs); + const WTF::String& type, const WTF::String& codecs, const WebCore::KURL&); #endif #if USE(ACCELERATED_COMPOSITING) bool acceleratedRenderingInUse(); diff --git a/Source/WebKit/chromium/src/WebOptionElement.cpp b/Source/WebKit/chromium/src/WebOptionElement.cpp index c71f7b565..1d50a053e 100644 --- a/Source/WebKit/chromium/src/WebOptionElement.cpp +++ b/Source/WebKit/chromium/src/WebOptionElement.cpp @@ -44,7 +44,7 @@ namespace WebKit { void WebOptionElement::setValue(const WebString& newValue) { - return unwrap<HTMLOptionElement>()->setValue(newValue); + unwrap<HTMLOptionElement>()->setValue(newValue); } WebString WebOptionElement::value() const @@ -69,7 +69,7 @@ bool WebOptionElement::defaultSelected() const void WebOptionElement::setDefaultSelected(bool newSelected) { - return unwrap<HTMLOptionElement>()->setAttribute(selectedAttr, newSelected ? "" : 0); + unwrap<HTMLOptionElement>()->setAttribute(selectedAttr, newSelected ? "" : 0); } WebString WebOptionElement::label() const diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index e10e0ae81..040eb6384 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -71,6 +71,7 @@ #include "ScrollAnimator.h" #include "ScrollView.h" #include "ScrollbarTheme.h" +#include "TouchEvent.h" #include "UserGestureIndicator.h" #include "WebPrintParams.h" #include "WheelEvent.h" @@ -185,6 +186,8 @@ void WebPluginContainerImpl::handleEvent(Event* event) handleWheelEvent(static_cast<WheelEvent*>(event)); else if (event->isKeyboardEvent()) handleKeyboardEvent(static_cast<KeyboardEvent*>(event)); + else if (eventNames().isTouchEventType(event->type())) + handleTouchEvent(static_cast<TouchEvent*>(event)); // FIXME: it would be cleaner if Widget::handleEvent returned true/false and // HTMLPluginElement called setDefaultHandled or defaultEventHandler. @@ -461,8 +464,8 @@ void WebPluginContainerImpl::setOpaque(bool opaque) bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) { - Page* page = m_element->document()->page(); - if (!page) + Frame* frame = m_element->document()->frame(); + if (!frame) return false; // hitTestResultAtPoint() takes a padding rectangle. @@ -471,14 +474,25 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect) LayoutPoint center = documentRect.center(); // Make the rect we're checking (the point surrounded by padding rects) contained inside the requested rect. (Note that -1/2 is 0.) LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2); - HitTestResult result = - page->mainFrame()->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding); + HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding); const HitTestResult::NodeSet& nodes = result.rectBasedTestResult(); if (nodes.size() != 1) return false; return (nodes.first().get() == m_element); } +void WebPluginContainerImpl::setIsAcceptingTouchEvents(bool acceptingTouchEvents) +{ + if (m_isAcceptingTouchEvents == acceptingTouchEvents) + return; + m_isAcceptingTouchEvents = acceptingTouchEvents; + if (m_isAcceptingTouchEvents) { + m_element->document()->didAddTouchEventHandler(); + m_element->document()->addListenerType(Document::TOUCH_LISTENER); + } else + m_element->document()->didRemoveTouchEventHandler(); +} + void WebPluginContainerImpl::didReceiveResponse(const ResourceResponse& response) { // Make sure that the plugin receives window geometry before data, or else @@ -577,11 +591,15 @@ WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* eleme , m_textureId(0) , m_ioSurfaceId(0) #endif + , m_isAcceptingTouchEvents(false) { } WebPluginContainerImpl::~WebPluginContainerImpl() { + if (m_isAcceptingTouchEvents) + m_element->document()->didRemoveTouchEventHandler(); + for (size_t i = 0; i < m_pluginLoadObservers.size(); ++i) m_pluginLoadObservers[i]->clearPluginContainer(); m_webPlugin->destroy(); @@ -683,6 +701,17 @@ void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event) event->setDefaultHandled(); } +void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) +{ + WebTouchEventBuilder webEvent(this, *event); + if (webEvent.type == WebInputEvent::Undefined) + return; + WebCursorInfo cursorInfo; + if (m_webPlugin->handleInputEvent(webEvent, cursorInfo)) + event->setDefaultHandled(); + // FIXME: Can a plugin change the cursor from a touch-event callback? +} + void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect, IntRect& windowRect, IntRect& clipRect, diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index 415cc544b..a151f7090 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -52,6 +52,7 @@ class LayerChromium; class MouseEvent; class ResourceError; class ResourceResponse; +class TouchEvent; class WheelEvent; #if ENABLE(GESTURE_EVENTS) @@ -109,6 +110,7 @@ public: virtual void zoomLevelChanged(double zoomLevel); virtual void setOpaque(bool); virtual bool isRectTopmost(const WebRect&); + virtual void setIsAcceptingTouchEvents(bool); // This cannot be null. WebPlugin* plugin() { return m_webPlugin; } @@ -160,6 +162,7 @@ private: void handleMouseEvent(WebCore::MouseEvent*); void handleWheelEvent(WebCore::WheelEvent*); void handleKeyboardEvent(WebCore::KeyboardEvent*); + void handleTouchEvent(WebCore::TouchEvent*); void calculateGeometry(const WebCore::IntRect& frameRect, WebCore::IntRect& windowRect, @@ -186,6 +189,8 @@ private: // The associated scrollbar group object, created lazily. Used for Pepper // scrollbars. OwnPtr<ScrollbarGroup> m_scrollbarGroup; + + bool m_isAcceptingTouchEvents; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 5f8776b58..e4d3ad835 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -338,6 +338,11 @@ void WebSettingsImpl::setExperimentalCSSCustomFilterEnabled(bool enabled) m_settings->setCSSCustomFilterEnabled(enabled); } +void WebSettingsImpl::setExperimentalCSSVariablesEnabled(bool enabled) +{ + m_settings->setCSSVariablesEnabled(enabled); +} + void WebSettingsImpl::setOpenGLMultisamplingEnabled(bool enabled) { m_settings->setOpenGLMultisamplingEnabled(enabled); @@ -622,5 +627,9 @@ void WebSettingsImpl::setSyncXHRInDocumentsEnabled(bool enabled) m_settings->setSyncXHRInDocumentsEnabled(enabled); } +void WebSettingsImpl::setCookieEnabled(bool enabled) +{ + m_settings->setCookieEnabled(enabled); +} } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 2b58c0443..ddd89114f 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -97,6 +97,7 @@ public: virtual void setExperimentalCSSRegionsEnabled(bool); virtual void setExperimentalCSSGridLayoutEnabled(bool); virtual void setExperimentalCSSCustomFilterEnabled(bool); + virtual void setExperimentalCSSVariablesEnabled(bool); virtual void setOpenGLMultisamplingEnabled(bool); virtual void setPrivilegedWebGLExtensionsEnabled(bool); virtual void setWebGLErrorsToConsoleEnabled(bool); @@ -149,6 +150,7 @@ public: virtual void setMediaPlaybackRequiresUserGesture(bool); virtual bool viewportEnabled() const { return m_viewportEnabled; } virtual void setSyncXHRInDocumentsEnabled(bool); + virtual void setCookieEnabled(bool); bool showFPSCounter() const { return m_showFPSCounter; } bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 67b7c041e..d2393c31c 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -1351,10 +1351,28 @@ void WebViewImpl::resize(const WebSize& newSize) { if (m_shouldAutoResize || m_size == newSize) return; + + FrameView* view = mainFrameImpl()->frameView(); + if (!view) + return; + + WebSize oldSize = m_size; + float oldPageScaleFactor = pageScaleFactor(); + IntSize oldScrollOffset = view->scrollOffset(); + int oldFixedLayoutWidth = fixedLayoutSize().width; + m_size = newSize; #if ENABLE(VIEWPORT) if (settings()->viewportEnabled()) { + // Fallback width is used to layout sites designed for desktop. The + // conventional size used by all mobile browsers is 980. When a mobile + // device has a particularly wide screen (such as a 10" tablet held in + // landscape), it can be larger. + const int standardFallbackWidth = 980; + int dpiIndependentViewportWidth = newSize.width / page()->deviceScaleFactor(); + settings()->setLayoutFallbackWidth(std::max(standardFallbackWidth, dpiIndependentViewportWidth)); + ViewportArguments viewportArguments = mainFrameImpl()->frame()->document()->viewportArguments(); m_page->chrome()->client()->dispatchViewportPropertiesDidChange(viewportArguments); } @@ -1369,6 +1387,33 @@ void WebViewImpl::resize(const WebSize& newSize) webFrame->frameView()->resize(newSize.width, newSize.height); } +#if ENABLE(VIEWPORT) + if (settings()->viewportEnabled()) { + // Relayout immediately to obtain the new content width, which is needed + // to calculate the minimum scale limit. + view->layout(); + computePageScaleFactorLimits(); + // When the device rotates: + // - If the page width is unchanged, then zoom by new width/old width + // such as to keep the same content horizontally onscreen. + // - If the page width stretches proportionally to the change in + // screen width, then don't zoom at all (assuming the content has + // scaled uniformly, then the same content will be horizontally + // onscreen). + // - If the page width partially stretches, then zoom partially to + // make up the difference. + // In all cases try to keep the same content at the top of the screen. + float viewportWidthRatio = !oldSize.width ? 1 : newSize.width / (float) oldSize.width; + float fixedLayoutWidthRatio = !oldFixedLayoutWidth ? 1 : fixedLayoutSize().width / (float) oldFixedLayoutWidth; + float scaleMultiplier = viewportWidthRatio / fixedLayoutWidthRatio; + if (scaleMultiplier != 1) { + IntSize scrollOffsetAtNewScale = oldScrollOffset; + scrollOffsetAtNewScale.scale(scaleMultiplier); + setPageScaleFactor(oldPageScaleFactor * scaleMultiplier, IntPoint(scrollOffsetAtNewScale)); + } + } +#endif + sendResizeEventAndRepaint(); } @@ -2086,6 +2131,19 @@ bool WebViewImpl::selectionTextDirection(WebTextDirection& start, WebTextDirecti return true; } +bool WebViewImpl::setEditableSelectionOffsets(int start, int end) +{ + const Frame* focused = focusedWebCoreFrame(); + if (!focused) + return false; + + Editor* editor = focused->editor(); + if (!editor || !editor->canEdit()) + return false; + + return editor->setSelectionOffsets(start, end); +} + bool WebViewImpl::caretOrSelectionRange(size_t* location, size_t* length) { const Frame* focused = focusedWebCoreFrame(); @@ -2341,6 +2399,11 @@ void WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rect) frame->view()->scrollElementToRect(elementNode, IntRect(rect.x, rect.y, rect.width, rect.height)); } +void WebViewImpl::advanceFocus(bool reverse) +{ + page()->focusController()->advanceFocus(reverse ? FocusDirectionBackward : FocusDirectionForward, 0); +} + double WebViewImpl::zoomLevel() { return m_zoomLevel; @@ -3479,6 +3542,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) setDeviceScaleFactor(m_deviceScaleInCompositor); } + bool visible = page()->visibilityState() == PageVisibilityStateVisible; + m_layerTreeView.setVisible(visible); m_layerTreeView.setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor); if (m_compositorSurfaceReady) m_layerTreeView.setSurfaceReady(); diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 4f5c048d9..d4527da0d 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -150,6 +150,7 @@ public: virtual bool compositionRange(size_t* location, size_t* length); virtual WebTextInputInfo textInputInfo(); virtual WebTextInputType textInputType(); + virtual bool setEditableSelectionOffsets(int start, int end); virtual bool selectionBounds(WebRect& start, WebRect& end) const; virtual bool selectionTextDirection(WebTextDirection& start, WebTextDirection& end) const; virtual bool caretOrSelectionRange(size_t* location, size_t* length); @@ -194,6 +195,7 @@ public: virtual void clearFocusedNode(); virtual void scrollFocusedNodeIntoView(); virtual void scrollFocusedNodeIntoRect(const WebRect&); + virtual void advanceFocus(bool reverse); virtual double zoomLevel(); virtual double setZoomLevel(bool textOnly, double zoomLevel); virtual void zoomLimitsChanged(double minimumZoomLevel, diff --git a/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp b/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp index 423c668d9..b35819759 100644 --- a/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTestCommon.cpp @@ -25,6 +25,7 @@ #include "config.h" #include "CCLayerTestCommon.h" +#include "cc/CCDrawQuad.h" #include <gtest/gtest.h> #include <wtf/Vector.h> diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp index 89d211e81..78448a517 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostCommonTest.cpp @@ -28,6 +28,7 @@ #include "CCAnimationTestCommon.h" #include "CCLayerTreeTestCommon.h" +#include "ContentLayerChromium.h" #include "LayerChromium.h" #include "TranslateTransformOperation.h" #include "cc/CCLayerAnimationController.h" @@ -3662,6 +3663,98 @@ TEST(CCLayerTreeHostCommonTest, verifyHitTestingForMultipleLayerLists) EXPECT_EQ(4, resultLayer->id()); } +class MockContentLayerDelegate : public ContentLayerDelegate { +public: + MockContentLayerDelegate() { } + virtual ~MockContentLayerDelegate() { } + virtual void paintContents(SkCanvas*, const IntRect& clip, IntRect& opaque) { } +}; + +PassRefPtr<ContentLayerChromium> createDrawableContentLayerChromium(ContentLayerDelegate* delegate) +{ + RefPtr<ContentLayerChromium> toReturn = ContentLayerChromium::create(delegate); + toReturn->setIsDrawable(true); + return toReturn.release(); +} + +TEST(CCLayerTreeHostCommonTest, verifyRenderSurfaceTranformsInHighDPI) +{ + MockContentLayerDelegate delegate; + WebTransformationMatrix identityMatrix; + WebTransformationMatrix parentMatrix; + + RefPtr<ContentLayerChromium> parent = createDrawableContentLayerChromium(&delegate); + setLayerPropertiesForTesting(parent.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(0, 0), IntSize(30, 30), true); + + RefPtr<ContentLayerChromium> child = createDrawableContentLayerChromium(&delegate); + setLayerPropertiesForTesting(child.get(), identityMatrix, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true); + + WebTransformationMatrix replicaTransform; + replicaTransform.scaleNonUniform(1, -1); + RefPtr<ContentLayerChromium> replica = createDrawableContentLayerChromium(&delegate); + setLayerPropertiesForTesting(replica.get(), replicaTransform, identityMatrix, FloatPoint(0, 0), FloatPoint(2, 2), IntSize(10, 10), true); + + parent->addChild(child); + child->setReplicaLayer(replica.get()); + + Vector<RefPtr<LayerChromium> > renderSurfaceLayerList; + Vector<RefPtr<LayerChromium> > dummyLayerList; + int dummyMaxTextureSize = 512; + + parent->createRenderSurface(); + parent->renderSurface()->setContentRect(IntRect(IntPoint(), parent->bounds())); + parent->setClipRect(IntRect(IntPoint::zero(), parent->bounds())); + renderSurfaceLayerList.append(parent.get()); + + const double deviceScaleFactor = 1.5; + parentMatrix.scale(deviceScaleFactor); + parent->setContentsScale(deviceScaleFactor); + child->setContentsScale(deviceScaleFactor); + replica->setContentsScale(deviceScaleFactor); + + CCLayerTreeHostCommon::calculateDrawTransforms(parent.get(), parent.get(), parentMatrix, identityMatrix, renderSurfaceLayerList, dummyLayerList, dummyMaxTextureSize); + + // We should have two render surfaces. The root's render surface and child's + // render surface (it needs one because it has a replica layer). + EXPECT_EQ(2u, renderSurfaceLayerList.size()); + + WebTransformationMatrix expectedDrawTransform; + expectedDrawTransform.setM11(deviceScaleFactor); + expectedDrawTransform.setM22(deviceScaleFactor); + expectedDrawTransform.setM41(0.5 * deviceScaleFactor * child->bounds().width()); + expectedDrawTransform.setM42(0.5 * deviceScaleFactor * child->bounds().height()); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedDrawTransform, child->drawTransform()); + + WebTransformationMatrix expectedRenderSurfaceDrawTransform; + expectedRenderSurfaceDrawTransform.translate(deviceScaleFactor * (child->position().x() + 0.5 * child->bounds().width()), deviceScaleFactor * (child->position().y() + 0.5 * child->bounds().height())); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedRenderSurfaceDrawTransform, child->renderSurface()->drawTransform()); + + WebTransformationMatrix expectedOriginTransform; + expectedOriginTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedOriginTransform, child->renderSurface()->originTransform()); + + WebTransformationMatrix expectedScreenSpaceTransform; + expectedScreenSpaceTransform.translate(deviceScaleFactor * 2, deviceScaleFactor * 2); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedScreenSpaceTransform, child->renderSurface()->screenSpaceTransform()); + + WebTransformationMatrix expectedReplicaDrawTransform; + expectedReplicaDrawTransform.setM22(-1); + expectedReplicaDrawTransform.setM41(13.5); + expectedReplicaDrawTransform.setM42(-1.5); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedReplicaDrawTransform, child->renderSurface()->replicaDrawTransform()); + + WebTransformationMatrix expectedReplicaOriginTransform = expectedReplicaDrawTransform; + expectedReplicaOriginTransform.setM41(6); + expectedReplicaOriginTransform.setM42(6); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedReplicaOriginTransform, child->renderSurface()->replicaOriginTransform()); + + WebTransformationMatrix expectedReplicaScreenSpaceTransform; + expectedReplicaScreenSpaceTransform.setM22(-1); + expectedReplicaScreenSpaceTransform.setM41(6); + expectedReplicaScreenSpaceTransform.setM42(6); + EXPECT_TRANSFORMATION_MATRIX_EQ(expectedReplicaScreenSpaceTransform, child->renderSurface()->replicaScreenSpaceTransform()); +} + TEST(CCLayerTreeHostCommonTest, verifySubtreeSearch) { RefPtr<LayerChromium> root = LayerChromium::create(); diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp index 738c88190..d19b036bb 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp @@ -32,6 +32,7 @@ #include "FakeWebGraphicsContext3D.h" #include "GraphicsContext3DPrivate.h" #include "LayerRendererChromium.h" +#include "ManagedTexture.h" #include "cc/CCIOSurfaceLayerImpl.h" #include "cc/CCLayerImpl.h" #include "cc/CCLayerTilingData.h" @@ -80,7 +81,6 @@ public: virtual void setNeedsRedrawOnImplThread() OVERRIDE { m_didRequestRedraw = true; } virtual void setNeedsCommitOnImplThread() OVERRIDE { m_didRequestCommit = true; } virtual void postAnimationEventsToMainThreadOnImplThread(PassOwnPtr<CCAnimationEventsVector>, double wallClockTime) OVERRIDE { } - virtual void postSetContentsMemoryAllocationLimitBytesToMainThreadOnImplThread(size_t) OVERRIDE { } PassOwnPtr<CCLayerTreeHostImpl> createLayerTreeHost(bool partialSwap, PassRefPtr<CCGraphicsContext> graphicsContext, PassOwnPtr<CCLayerImpl> rootPtr) { @@ -1791,7 +1791,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapNoUpdate) Mock::VerifyAndClearExpectations(&mockContext); } -class PartialSwapContext: public FakeWebGraphicsContext3D { +class PartialSwapContext : public FakeWebGraphicsContext3D { public: WebString getString(WGC3Denum name) { @@ -2040,12 +2040,17 @@ private: // FakeWebGraphicsContext3D have an id of 1). class StrictWebGraphicsContext3D : public FakeWebGraphicsContext3D { public: + StrictWebGraphicsContext3D() + : FakeWebGraphicsContext3D() + { + m_nextTextureId = 7; // Start allocating texture ids larger than any other resource IDs so we can tell if someone's mixing up their resource types. + } + virtual WebGLId createBuffer() { return 2; } virtual WebGLId createFramebuffer() { return 3; } virtual WebGLId createProgram() { return 4; } virtual WebGLId createRenderbuffer() { return 5; } virtual WebGLId createShader(WGC3Denum) { return 6; } - virtual WebGLId createTexture() { return 7; } virtual void deleteBuffer(WebGLId id) { @@ -2077,10 +2082,17 @@ public: ADD_FAILURE() << "Trying to delete shader id " << id; } + virtual WebGLId createTexture() + { + unsigned textureId = FakeWebGraphicsContext3D::createTexture(); + m_allocatedTextureIds.add(textureId); + return textureId; + } virtual void deleteTexture(WebGLId id) { - if (id != 7) + if (!m_allocatedTextureIds.contains(id)) ADD_FAILURE() << "Trying to delete texture id " << id; + m_allocatedTextureIds.remove(id); } virtual void bindBuffer(WGC3Denum, WebGLId id) @@ -2115,7 +2127,7 @@ public: virtual void bindTexture(WGC3Denum, WebGLId id) { - if (id != 7 && id) + if (id && !m_allocatedTextureIds.contains(id)) ADD_FAILURE() << "Trying to bind texture id " << id; } @@ -2123,6 +2135,9 @@ public: { return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new StrictWebGraphicsContext3D()), GraphicsContext3D::RenderDirectlyToHostWindow); } + +private: + HashSet<unsigned> m_allocatedTextureIds; }; // Fake video frame that represents a 4x4 YUV video frame. @@ -2262,14 +2277,13 @@ TEST_F(CCLayerTreeHostImplTest, dontUseOldResourcesAfterLostContext) class TrackingWebGraphicsContext3D : public FakeWebGraphicsContext3D { public: TrackingWebGraphicsContext3D() - : m_nextTextureId(1) + : FakeWebGraphicsContext3D() , m_numTextures(0) { } virtual WebGLId createTexture() OVERRIDE { - WebGLId id = m_nextTextureId; - ++m_nextTextureId; + WebGLId id = FakeWebGraphicsContext3D::createTexture(); m_textures.set(id, true); ++m_numTextures; @@ -2301,7 +2315,6 @@ public: unsigned numTextures() const { return m_numTextures; } private: - WebGLId m_nextTextureId; HashMap<WebGLId, bool> m_textures; unsigned m_numTextures; }; @@ -2409,20 +2422,15 @@ TEST_F(CCLayerTreeHostImplTest, hasTransparentBackground) Mock::VerifyAndClearExpectations(&mockContext); } -TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) +static void setupLayersForTextureCaching(CCLayerTreeHostImpl* layerTreeHostImpl, CCLayerImpl*& rootPtr, CCLayerImpl*& intermediateLayerPtr, CCLayerImpl*& surfaceLayerPtr, CCLayerImpl*& childPtr) { - CCSettings::setPartialSwapEnabled(true); - - CCLayerTreeSettings settings; - OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this); - RefPtr<CCGraphicsContext> context = CCGraphicsContext::create3D(GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new PartialSwapContext()), GraphicsContext3D::RenderDirectlyToHostWindow)); - myHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); - myHostImpl->setViewportSize(IntSize(100, 100)); + layerTreeHostImpl->initializeLayerRenderer(context.release(), UnthrottledUploader); + layerTreeHostImpl->setViewportSize(IntSize(100, 100)); OwnPtr<CCLayerImpl> root = CCLayerImpl::create(1); - CCLayerImpl* rootPtr = root.get(); + rootPtr = root.get(); root->setAnchorPoint(FloatPoint(0, 0)); root->setPosition(FloatPoint(0, 0)); @@ -2430,11 +2438,11 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) root->setContentBounds(IntSize(100, 100)); root->setVisibleLayerRect(IntRect(0, 0, 100, 100)); root->setDrawsContent(true); - myHostImpl->setRootLayer(root.release()); + layerTreeHostImpl->setRootLayer(root.release()); // Intermediate layer does not own a surface, and does not draw content. OwnPtr<CCLayerImpl> intermediateLayer = CCLayerImpl::create(2); - CCLayerImpl* intermediateLayerPtr = intermediateLayer.get(); + intermediateLayerPtr = intermediateLayer.get(); intermediateLayerPtr->setAnchorPoint(FloatPoint(0, 0)); intermediateLayerPtr->setPosition(FloatPoint(10, 10)); @@ -2445,7 +2453,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) rootPtr->addChild(intermediateLayer.release()); OwnPtr<CCLayerImpl> surfaceLayer = CCLayerImpl::create(3); - CCLayerImpl* surfaceLayerPtr = surfaceLayer.get(); + surfaceLayerPtr = surfaceLayer.get(); // Surface layer is the layer that changes its opacity // It will contain other layers that draw content. @@ -2460,7 +2468,7 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) // Child of the surface layer will produce some quads OwnPtr<FakeLayerWithQuads> child = FakeLayerWithQuads::create(4); - FakeLayerWithQuads* childPtr = child.get(); + childPtr = child.get(); childPtr->setAnchorPoint(FloatPoint(0, 0)); childPtr->setPosition(FloatPoint(5, 5)); @@ -2470,6 +2478,21 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) childPtr->setDrawsContent(true); surfaceLayerPtr->addChild(child.release()); +} + +TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) +{ + CCSettings::setPartialSwapEnabled(true); + + CCLayerTreeSettings settings; + OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this); + + CCLayerImpl* rootPtr; + CCLayerImpl* intermediateLayerPtr; + CCLayerImpl* surfaceLayerPtr; + CCLayerImpl* childPtr; + + setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr); { CCLayerTreeHostImpl::FrameData frame; @@ -2614,6 +2637,165 @@ TEST_F(CCLayerTreeHostImplTest, surfaceTextureCaching) } } +TEST_F(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) +{ + CCSettings::setPartialSwapEnabled(false); + + CCLayerTreeSettings settings; + OwnPtr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this); + + CCLayerImpl* rootPtr; + CCLayerImpl* intermediateLayerPtr; + CCLayerImpl* surfaceLayerPtr; + CCLayerImpl* childPtr; + + setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr, surfaceLayerPtr, childPtr); + + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Must receive two render passes, each with one quad + ASSERT_EQ(2U, frame.renderPasses.size()); + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + EXPECT_EQ(1U, frame.renderPasses[1]->quadList().size()); + + EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[1]->quadList()[0]->material()); + CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[1]->quadList()[0].get()); + EXPECT_TRUE(quad->renderPass()->targetSurface()->contentsChanged()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Draw without any change + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Even though there was no change, we set the damage to entire viewport. + // One of the passes should be culled as a result, since contents didn't change + // and we have cached texture. + ASSERT_EQ(1U, frame.renderPasses.size()); + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Change opacity and draw + surfaceLayerPtr->setOpacity(0.6f); + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Must receive one render pass, as the other one should be culled + ASSERT_EQ(1U, frame.renderPasses.size()); + + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[0]->quadList()[0]->material()); + CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[0]->quadList()[0].get()); + EXPECT_FALSE(quad->renderPass()->targetSurface()->contentsChanged()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Change less benign property and draw - should have contents changed flag + surfaceLayerPtr->setStackingOrderChanged(true); + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Must receive two render passes, each with one quad + ASSERT_EQ(2U, frame.renderPasses.size()); + + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + EXPECT_EQ(CCDrawQuad::SolidColor, frame.renderPasses[0]->quadList()[0]->material()); + + EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[1]->quadList()[0]->material()); + CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[1]->quadList()[0].get()); + EXPECT_TRUE(quad->renderPass()->targetSurface()->contentsChanged()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Change opacity again, but evict the cached surface texture + surfaceLayerPtr->setOpacity(0.5f); + ManagedTexture* contentsTexture = surfaceLayerPtr->renderSurface()->contentsTexture(); + ASSERT_TRUE(contentsTexture->isValid(contentsTexture->size(), contentsTexture->format())); + CCRenderer* renderer = myHostImpl->layerRenderer(); + TextureManager* textureManager = renderer->implTextureManager(); + size_t maxMemoryLimit = textureManager->maxMemoryLimitBytes(); + + // This should evice all cached surfaces + textureManager->setMaxMemoryLimitBytes(0); + + // Restore original limit + textureManager->setMaxMemoryLimitBytes(maxMemoryLimit); + + // Was our surface evicted? + ASSERT_FALSE(contentsTexture->isValid(contentsTexture->size(), contentsTexture->format())); + + // Change opacity and draw + surfaceLayerPtr->setOpacity(0.6f); + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Must receive two render passes + ASSERT_EQ(2U, frame.renderPasses.size()); + + // Even though not enough properties changed, the entire thing must be + // redrawn as we don't have cached textures + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + EXPECT_EQ(1U, frame.renderPasses[1]->quadList().size()); + + EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[1]->quadList()[0]->material()); + CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[1]->quadList()[0].get()); + EXPECT_FALSE(quad->renderPass()->targetSurface()->contentsChanged()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Draw without any change, to make sure the state is clear + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Even though there was no change, we set the damage to entire viewport. + // One of the passes should be culled as a result, since contents didn't change + // and we have cached texture. + ASSERT_EQ(1U, frame.renderPasses.size()); + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } + + // Change opacity on the intermediate layer + WebTransformationMatrix transform = intermediateLayerPtr->transform(); + transform.setM11(1.0001); + intermediateLayerPtr->setTransform(transform); + { + CCLayerTreeHostImpl::FrameData frame; + EXPECT_TRUE(myHostImpl->prepareToDraw(frame)); + + // Must receive one render pass, as the other one should be culled. + ASSERT_EQ(1U, frame.renderPasses.size()); + EXPECT_EQ(1U, frame.renderPasses[0]->quadList().size()); + + EXPECT_EQ(CCDrawQuad::RenderPass, frame.renderPasses[0]->quadList()[0]->material()); + CCRenderPassDrawQuad* quad = static_cast<CCRenderPassDrawQuad*>(frame.renderPasses[0]->quadList()[0].get()); + EXPECT_FALSE(quad->renderPass()->targetSurface()->contentsChanged()); + + myHostImpl->drawLayers(frame); + myHostImpl->didDrawAllLayers(frame); + } +} + struct RenderPassCacheEntry { mutable OwnPtr<CCRenderPass> renderPassPtr; CCRenderPass* renderPass; diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp index 544eca88b..d2773790e 100644 --- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp +++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp @@ -31,6 +31,7 @@ #include "CCThreadedTest.h" #include "ContentLayerChromium.h" #include "GraphicsContext3DPrivate.h" +#include "cc/CCGraphicsContext.h" #include "cc/CCLayerTreeHostImpl.h" #include "cc/CCSettings.h" #include "cc/CCTextureUpdater.h" @@ -485,6 +486,40 @@ TEST_F(CCLayerTreeHostTestCompositeAndReadbackWhileInvisible, runMultiThread) runTestThreaded(); } +class CCLayerTreeHostTestAbortFrameWhenInvisible : public CCLayerTreeHostTestThreadOnly { +public: + CCLayerTreeHostTestAbortFrameWhenInvisible() + { + } + + virtual void beginTest() + { + // Request a commit (from the main thread), which will trigger the commit flow from the impl side. + m_layerTreeHost->setNeedsCommit(); + // Then mark ourselves as not visible before processing any more messages on the main thread. + m_layerTreeHost->setVisible(false); + // If we make it without kicking a frame, we pass! + endTestAfterDelay(1); + } + + virtual void layout() OVERRIDE + { + ASSERT_FALSE(true); + endTest(); + } + + virtual void afterTest() + { + } + +private: +}; + +TEST_F(CCLayerTreeHostTestAbortFrameWhenInvisible, runMultiThread) +{ + runTestThreaded(); +} + // Trigger a frame with setNeedsCommit. Then, inside the resulting animate // callback, requet another frame using setNeedsAnimate. End the test when @@ -996,113 +1031,6 @@ TEST_F(CCLayerTreeHostTestCommit, runTest) runTest(true); } -class CCLayerTreeHostTestVisibilityAndAllocationControlDrawing : public CCLayerTreeHostTest { -public: - - CCLayerTreeHostTestVisibilityAndAllocationControlDrawing() { } - - virtual void beginTest() - { - postSetNeedsCommitToMainThread(); - } - - virtual void didCommitAndDrawFrame() - { - int lastFrame = m_layerTreeHost->frameNumber() - 1; - - // These frames should draw. - switch (lastFrame) { - case 0: - // Set the tree invisible, this should not draw. - m_layerTreeHost->setVisible(false); - break; - case 2: - // Set the tree invisible and give a non-visible allocation, this - // should not draw. - m_layerTreeHost->setVisible(false); - m_layerTreeHost->setContentsMemoryAllocationLimitBytes(0); - break; - case 5: - // Give a memory allocation not for display, but while we are - // visible. This should not be used and we should remain - // ready for display and it should draw. - m_layerTreeHost->setContentsMemoryAllocationLimitBytes(0); - break; - case 6: - endTest(); - break; - - default: - ASSERT_NOT_REACHED(); - } - } - - virtual void didCommit() - { - int lastFrame = m_layerTreeHost->frameNumber() - 1; - - // These frames should not draw. - switch (lastFrame) { - case 1: - // Set the tree visible, this should draw. - m_layerTreeHost->setVisible(true); - break; - case 3: - // Set visible without giving a visible memory allocation, this - // shouldn't make the impl side ready for display, so it should - // not draw. - m_layerTreeHost->setVisible(true); - break; - case 4: - // Now give a memory allocation for display, this should draw. - m_layerTreeHost->setContentsMemoryAllocationLimitBytes(1); - break; - } - } - - virtual void commitCompleteOnCCThread(CCLayerTreeHostImpl* impl) - { - switch (impl->sourceFrameNumber()) { - case 0: - // The host starts out visible and able to display before we do any commit. - EXPECT_TRUE(impl->visible()); - EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); - break; - case 1: - // We still have a memory allocation for display. - EXPECT_FALSE(impl->visible()); - EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); - break; - case 2: - EXPECT_TRUE(impl->visible()); - EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); - break; - case 3: - EXPECT_FALSE(impl->visible()); - EXPECT_FALSE(impl->sourceFrameCanBeDrawn()); - break; - case 4: - EXPECT_TRUE(impl->visible()); - EXPECT_FALSE(impl->sourceFrameCanBeDrawn()); - break; - case 5: - EXPECT_TRUE(impl->visible()); - EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); - break; - case 6: - EXPECT_TRUE(impl->visible()); - EXPECT_TRUE(impl->sourceFrameCanBeDrawn()); - break; - } - } - - virtual void afterTest() - { - } -}; - -SINGLE_AND_MULTI_THREAD_TEST_F(CCLayerTreeHostTestVisibilityAndAllocationControlDrawing) - // Verifies that startPageScaleAnimation events propagate correctly from CCLayerTreeHost to // CCLayerTreeHostImpl in the MT compositor. class CCLayerTreeHostTestStartPageScaleAnimation : public CCLayerTreeHostTest { @@ -1731,8 +1659,9 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); + ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); CCTextureUpdater updater; - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1749,7 +1678,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1767,7 +1696,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1787,7 +1716,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1809,7 +1738,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1831,7 +1760,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); @@ -1854,7 +1783,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), grandChild->occludedScreenSpace().bounds()); @@ -1877,7 +1806,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); @@ -1938,8 +1867,9 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); + ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); CCTextureUpdater updater; - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); @@ -1966,7 +1896,7 @@ public: m_layerTreeHost->setRootLayer(rootLayer); m_layerTreeHost->setViewportSize(rootLayer->bounds()); - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); EXPECT_EQ_RECT(IntRect(), child2->occludedScreenSpace().bounds()); @@ -2026,8 +1956,9 @@ public: m_layerTreeHost->setRootLayer(layers[0].get()); m_layerTreeHost->setViewportSize(layers[0]->bounds()); + ASSERT_TRUE(m_layerTreeHost->initializeLayerRendererIfNeeded()); CCTextureUpdater updater; - m_layerTreeHost->updateLayers(updater); + m_layerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); m_layerTreeHost->commitComplete(); for (int i = 0; i < numSurfaces-1; ++i) { diff --git a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp index 8631b1942..ee5e2907d 100644 --- a/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp +++ b/Source/WebKit/chromium/tests/CCOcclusionTrackerTest.cpp @@ -36,6 +36,7 @@ #include "cc/CCLayerImpl.h" #include "cc/CCLayerTreeHostCommon.h" #include "cc/CCMathUtil.h" +#include "cc/CCOverdrawMetrics.h" #include "cc/CCSingleThreadProxy.h" #include <gmock/gmock.h> #include <gtest/gtest.h> @@ -257,6 +258,7 @@ protected: ASSERT(root == m_root.get()); Vector<CCLayerImpl*> dummyLayerList; int dummyMaxTextureSize = 512; + CCLayerSorter layerSorter; ASSERT(!root->renderSurface()); root->createRenderSurface(); @@ -264,7 +266,7 @@ protected: root->setClipRect(IntRect(IntPoint::zero(), root->bounds())); m_renderSurfaceLayerListImpl.append(m_root.get()); - CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListImpl, dummyLayerList, 0, dummyMaxTextureSize); + CCLayerTreeHostCommon::calculateDrawTransforms(root, root, identityMatrix, identityMatrix, m_renderSurfaceLayerListImpl, dummyLayerList, &layerSorter, dummyMaxTextureSize); CCLayerTreeHostCommon::calculateVisibleAndScissorRects(m_renderSurfaceLayerListImpl, root->renderSurface()->contentRect()); @@ -435,6 +437,9 @@ private: #define MAIN_THREAD_TEST(ClassName) \ RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) +#define IMPL_THREAD_TEST(ClassName) \ + RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) + #define MAIN_AND_IMPL_THREAD_TEST(ClassName) \ RUN_TEST_MAIN_THREAD_OPAQUE_LAYERS(ClassName) \ RUN_TEST_IMPL_THREAD_OPAQUE_LAYERS(ClassName) @@ -1872,6 +1877,44 @@ protected: MAIN_AND_IMPL_THREAD_TEST(CCOcclusionTrackerTest3dTransform); template<class Types, bool opaqueLayers> +class CCOcclusionTrackerTestUnsorted3dLayers : public CCOcclusionTrackerTest<Types, opaqueLayers> { +protected: + void runMyTest() + { + // Currently, the main thread layer iterator does not iterate over 3d items in + // sorted order, because layer sorting is not performed on the main thread. + // Because of this, the occlusion tracker cannot assume that a 3d layer occludes + // other layers that have not yet been iterated over. For now, the expected + // behavior is that a 3d layer simply does not add any occlusion to the occlusion + // tracker. + + WebTransformationMatrix translationToFront; + translationToFront.translate3d(0, 0, -10); + WebTransformationMatrix translationToBack; + translationToFront.translate3d(0, 0, -100); + + typename Types::ContentLayerType* parent = this->createRoot(this->identityMatrix, FloatPoint(0, 0), IntSize(300, 300)); + typename Types::ContentLayerType* child1 = this->createDrawingLayer(parent, translationToBack, FloatPoint(0, 0), IntSize(100, 100), true); + typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, translationToFront, FloatPoint(50, 50), IntSize(100, 100), true); + parent->setPreserves3D(true); + + this->calcDrawEtc(parent); + + TestCCOcclusionTrackerWithScissor<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000)); + this->visitLayer(child2, occlusion); + EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty()); + EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty()); + + this->visitLayer(child1, occlusion); + EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty()); + EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty()); + } +}; + +// This test will have different layer ordering on the impl thread; the test will only work on the main thread. +MAIN_THREAD_TEST(CCOcclusionTrackerTestUnsorted3dLayers); + +template<class Types, bool opaqueLayers> class CCOcclusionTrackerTestPerspectiveTransform : public CCOcclusionTrackerTest<Types, opaqueLayers> { protected: void runMyTest() @@ -1896,7 +1939,8 @@ protected: } }; -MAIN_THREAD_TEST(CCOcclusionTrackerTestPerspectiveTransform); +// This test requires accumulating occlusion of 3d layers, which are skipped by the occlusion tracker on the main thread. So this test should run on the impl thread. +IMPL_THREAD_TEST(CCOcclusionTrackerTestPerspectiveTransform); template<class Types, bool opaqueLayers> class CCOcclusionTrackerTestPerspectiveTransformBehindCamera : public CCOcclusionTrackerTest<Types, opaqueLayers> { @@ -1928,7 +1972,8 @@ protected: } }; -MAIN_THREAD_TEST(CCOcclusionTrackerTestPerspectiveTransformBehindCamera); +// This test requires accumulating occlusion of 3d layers, which are skipped by the occlusion tracker on the main thread. So this test should run on the impl thread. +IMPL_THREAD_TEST(CCOcclusionTrackerTestPerspectiveTransformBehindCamera); template<class Types, bool opaqueLayers> class CCOcclusionTrackerTestLayerBehindCameraDoesNotOcclude : public CCOcclusionTrackerTest<Types, opaqueLayers> { @@ -1957,7 +2002,8 @@ protected: } }; -MAIN_THREAD_TEST(CCOcclusionTrackerTestLayerBehindCameraDoesNotOcclude); +// This test requires accumulating occlusion of 3d layers, which are skipped by the occlusion tracker on the main thread. So this test should run on the impl thread. +IMPL_THREAD_TEST(CCOcclusionTrackerTestLayerBehindCameraDoesNotOcclude); template<class Types, bool opaqueLayers> class CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect : public CCOcclusionTrackerTest<Types, opaqueLayers> { @@ -1982,14 +2028,15 @@ protected: // Ensure that those pixels don't occlude things outside the clipRect. this->visitLayer(layer, occlusion); this->enterLayer(parent, occlusion); - EXPECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds()); + EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds()); EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size()); - EXPECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInScreenSpace().bounds()); + EXPECT_INT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInScreenSpace().bounds()); EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size()); } }; -MAIN_THREAD_TEST(CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect); +// This test requires accumulating occlusion of 3d layers, which are skipped by the occlusion tracker on the main thread. So this test should run on the impl thread. +IMPL_THREAD_TEST(CCOcclusionTrackerTestLargePixelsOccludeInsideClipRect); template<class Types, bool opaqueLayers> class CCOcclusionTrackerTestAnimationOpacity1OnMainThread : public CCOcclusionTrackerTest<Types, opaqueLayers> { diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp index 1a119d708..10eeb0f74 100644 --- a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp +++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp @@ -26,6 +26,7 @@ #include "cc/CCQuadCuller.h" +#include "cc/CCLayerTilingData.h" #include "cc/CCOcclusionTracker.h" #include "cc/CCOverdrawMetrics.h" #include "cc/CCSingleThreadProxy.h" diff --git a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp index a99149ba9..2e31d44d0 100644 --- a/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp +++ b/Source/WebKit/chromium/tests/CCSchedulerStateMachineTest.cpp @@ -807,7 +807,7 @@ TEST(CCSchedulerStateMachineTest, TestRequestCommitInvisible) EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction()); } -TEST(CCSchedulerStateMachineTest, TestGoesInvisibleMidCommit) +TEST(CCSchedulerStateMachineTest, TestGoesInvisibleBeforeBeginFrameCompletes) { StateMachine state; state.setCanBeginFrame(true); @@ -823,33 +823,12 @@ TEST(CCSchedulerStateMachineTest, TestGoesInvisibleMidCommit) EXPECT_FALSE(state.needsCommit()); EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction()); - // Become invisible + // Become invisible and abort the beginFrame. state.setVisible(false); + state.beginFrameAborted(); - // Tell the scheduler the frame finished - state.beginFrameComplete(); - EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_UPDATING_RESOURCES, state.commitState()); - EXPECT_EQ(CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES, state.nextAction()); - - // Tell the scheduler the update began and finished - state.updateState(CCSchedulerStateMachine::ACTION_BEGIN_UPDATE_MORE_RESOURCES); - state.beginUpdateMoreResourcesComplete(false); - EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_READY_TO_COMMIT, state.commitState()); - EXPECT_EQ(CCSchedulerStateMachine::ACTION_COMMIT, state.nextAction()); - - // Commit in invisible state should leave us: - // - COMMIT_STATE_WAITING_FOR_FIRST_DRAW - // - Waiting for redraw. - // - No commit needed - state.updateState(CCSchedulerStateMachine::ACTION_COMMIT); - EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_WAITING_FOR_FIRST_DRAW, state.commitState()); - EXPECT_TRUE(state.needsRedraw()); - EXPECT_FALSE(state.needsCommit()); - - // Expect to do nothing, both in and out of vsync. - state.didLeaveVSync(); - EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction()); - state.didEnterVSync(); + // We should now be back in the idle state as if we didn't start a frame at all. + EXPECT_EQ(CCSchedulerStateMachine::COMMIT_STATE_IDLE, state.commitState()); EXPECT_EQ(CCSchedulerStateMachine::ACTION_NONE, state.nextAction()); } diff --git a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp index 48a46dae1..85daea86b 100644 --- a/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp +++ b/Source/WebKit/chromium/tests/CCTiledLayerImplTest.cpp @@ -28,6 +28,7 @@ #include "CCLayerTestCommon.h" #include "MockCCQuadCuller.h" +#include "cc/CCLayerTilingData.h" #include "cc/CCSingleThreadProxy.h" #include "cc/CCTileDrawQuad.h" #include <gmock/gmock.h> diff --git a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h index 68fef6420..614e1eeb2 100644 --- a/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h +++ b/Source/WebKit/chromium/tests/CCTiledLayerTestCommon.h @@ -150,8 +150,9 @@ protected: class FakeTextureAllocator : public WebCore::TextureAllocator { public: - virtual unsigned createTexture(const WebCore::IntSize&, GC3Denum) { return 1; } - virtual void deleteTexture(unsigned, const WebCore::IntSize&, GC3Denum) { } + virtual unsigned createTexture(const WebCore::IntSize&, GC3Denum) OVERRIDE { return 1; } + virtual void deleteTexture(unsigned, const WebCore::IntSize&, GC3Denum) OVERRIDE { } + virtual void deleteAllTextures() OVERRIDE { } }; class FakeTextureCopier : public WebCore::TextureCopier { diff --git a/Source/WebKit/chromium/tests/FakeWebGraphicsContext3D.h b/Source/WebKit/chromium/tests/FakeWebGraphicsContext3D.h index 191d05f5f..b864c35fd 100644 --- a/Source/WebKit/chromium/tests/FakeWebGraphicsContext3D.h +++ b/Source/WebKit/chromium/tests/FakeWebGraphicsContext3D.h @@ -35,6 +35,11 @@ namespace WebKit { // All operations are no-ops (returning 0 if necessary). class FakeWebGraphicsContext3D : public WebGraphicsContext3D { public: + FakeWebGraphicsContext3D() + : m_nextTextureId(1) + { + } + virtual bool makeContextCurrent() { return true; } virtual int width() { return 0; } @@ -246,7 +251,7 @@ public: virtual WebGLId createProgram() { return 1; } virtual WebGLId createRenderbuffer() { return 1; } virtual WebGLId createShader(WGC3Denum) { return 1; } - virtual WebGLId createTexture() { return 1; } + virtual WebGLId createTexture() { return m_nextTextureId++; } virtual void deleteBuffer(WebGLId) { } virtual void deleteFramebuffer(WebGLId) { } @@ -267,6 +272,7 @@ public: virtual void getQueryObjectuivEXT(WebGLId, GC3Denum, GC3Duint*) { } protected: + unsigned m_nextTextureId; Attributes m_attrs; }; diff --git a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp index 4fdcf4f41..410c45d78 100644 --- a/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/GraphicsLayerChromiumTest.cpp @@ -57,6 +57,7 @@ class MockGraphicsLayerClient : public GraphicsLayerClient { virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) OVERRIDE { } virtual bool showDebugBorders(const GraphicsLayer*) const OVERRIDE { return false; } virtual bool showRepaintCounter(const GraphicsLayer*) const OVERRIDE { return false; } + virtual float deviceScaleFactor() const OVERRIDE { return 2; } }; class MockLayerTreeHostClient : public CCLayerTreeHostClient { @@ -395,4 +396,9 @@ TEST_F(GraphicsLayerChromiumTest, createReversedAlternatingAnimation) expectTranslateX(2, curve->getValue(duration)); } +TEST_F(GraphicsLayerChromiumTest, shouldStartWithCorrectContentsScale) +{ + EXPECT_EQ(2, m_platformLayer->contentsScale()); +} + } // namespace diff --git a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp index 098a7327f..17dd24bc6 100644 --- a/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp +++ b/Source/WebKit/chromium/tests/IDBDatabaseBackendTest.cpp @@ -67,6 +67,70 @@ TEST(IDBDatabaseBackendTest, BackingStoreRetention) EXPECT_TRUE(backingStore->hasOneRef()); } +class MockIDBCallbacks : public IDBCallbacks { +public: + static PassRefPtr<MockIDBCallbacks> create() { return adoptRef(new MockIDBCallbacks()); } + virtual ~MockIDBCallbacks() + { + EXPECT_TRUE(m_wasSuccessDBCalled); + } + virtual void onError(PassRefPtr<IDBDatabaseError>) OVERRIDE { } + virtual void onSuccess(PassRefPtr<DOMStringList>) OVERRIDE { } + virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>) OVERRIDE { } + virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>) OVERRIDE + { + m_wasSuccessDBCalled = true; + } + virtual void onSuccess(PassRefPtr<IDBKey>) OVERRIDE { } + virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>) OVERRIDE { } + virtual void onSuccess(PassRefPtr<SerializedScriptValue>) OVERRIDE { } + virtual void onSuccessWithContinuation() OVERRIDE { } + virtual void onSuccessWithPrefetch(const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<IDBKey> >&, const Vector<RefPtr<SerializedScriptValue> >&) OVERRIDE { } + virtual void onBlocked() OVERRIDE { } +private: + MockIDBCallbacks() + : m_wasSuccessDBCalled(false) { } + bool m_wasSuccessDBCalled; +}; + +class FakeIDBDatabaseCallbacks : public IDBDatabaseCallbacks { +public: + static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new FakeIDBDatabaseCallbacks()); } + virtual ~FakeIDBDatabaseCallbacks() { } + virtual void onVersionChange(const String& version) OVERRIDE { } +private: + FakeIDBDatabaseCallbacks() { } +}; + +TEST(IDBDatabaseBackendTest, ConnectionLifecycle) +{ + RefPtr<IDBFakeBackingStore> backingStore = adoptRef(new IDBFakeBackingStore()); + EXPECT_TRUE(backingStore->hasOneRef()); + + IDBTransactionCoordinator* coordinator = 0; + IDBFactoryBackendImpl* factory = 0; + RefPtr<IDBDatabaseBackendImpl> db = IDBDatabaseBackendImpl::create("db", backingStore.get(), coordinator, factory, "uniqueid"); + EXPECT_GT(backingStore->refCount(), 1); + + RefPtr<MockIDBCallbacks> request1 = MockIDBCallbacks::create(); + db->openConnection(request1); + + RefPtr<FakeIDBDatabaseCallbacks> connection1 = FakeIDBDatabaseCallbacks::create(); + db->registerFrontendCallbacks(connection1); + + RefPtr<MockIDBCallbacks> request2 = MockIDBCallbacks::create(); + db->openConnection(request2); + + db->close(connection1); + EXPECT_GT(backingStore->refCount(), 1); + + RefPtr<FakeIDBDatabaseCallbacks> connection2 = FakeIDBDatabaseCallbacks::create(); + db->registerFrontendCallbacks(connection2); + + db->close(connection2); + EXPECT_TRUE(backingStore->hasOneRef()); +} + } // namespace #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp index 9934e5c79..a34b436bd 100644 --- a/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp +++ b/Source/WebKit/chromium/tests/IDBLevelDBCodingTest.cpp @@ -139,6 +139,9 @@ TEST(IDBLevelDBCodingTest, EncodeInt) EXPECT_EQ(static_cast<size_t>(1), encodeInt(255).size()); EXPECT_EQ(static_cast<size_t>(2), encodeInt(256).size()); EXPECT_EQ(static_cast<size_t>(4), encodeInt(0xffffffff).size()); +#ifdef NDEBUG + EXPECT_EQ(static_cast<size_t>(8), encodeInt(-1).size()); +#endif } TEST(IDBLevelDBCodingTest, DecodeBool) @@ -166,6 +169,9 @@ TEST(IDBLevelDBCodingTest, DecodeInt) testCases.append(655536); testCases.append(7711192431755665792ll); testCases.append(0x7fffffffffffffffll); +#ifdef NDEBUG + testCases.append(-3); +#endif for (size_t i = 0; i < testCases.size(); ++i) { int64_t n = testCases[i]; @@ -181,6 +187,9 @@ TEST(IDBLevelDBCodingTest, EncodeVarInt) EXPECT_EQ(static_cast<size_t>(2), encodeVarInt(255).size()); EXPECT_EQ(static_cast<size_t>(2), encodeVarInt(256).size()); EXPECT_EQ(static_cast<size_t>(5), encodeVarInt(0xffffffff).size()); +#ifdef NDEBUG + EXPECT_EQ(static_cast<size_t>(8), encodeInt(-100).size()); +#endif } TEST(IDBLevelDBCodingTest, DecodeVarInt) @@ -194,6 +203,9 @@ TEST(IDBLevelDBCodingTest, DecodeVarInt) testCases.append(655536); testCases.append(7711192431755665792ll); testCases.append(0x7fffffffffffffffll); +#ifdef NDEBUG + testCases.append(-3); +#endif for (size_t i = 0; i < testCases.size(); ++i) { int64_t n = testCases[i]; diff --git a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp index ca17786bc..a5ca55124 100644 --- a/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/ImageLayerChromiumTest.cpp @@ -28,6 +28,7 @@ #include "GraphicsLayer.h" #include "GraphicsLayerChromium.h" +#include "Image.h" #include "NativeImageSkia.h" #include <gtest/gtest.h> #include <wtf/PassOwnPtr.h> diff --git a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp index 9269217c3..e4650961b 100644 --- a/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/LayerRendererChromiumTest.cpp @@ -30,6 +30,7 @@ #include "GraphicsContext3D.h" #include "GraphicsContext3DPrivate.h" #include "WebCompositor.h" +#include "cc/CCDrawQuad.h" #include "cc/CCSettings.h" #include "cc/CCSingleThreadProxy.h" @@ -83,12 +84,13 @@ public: } // CCRendererClient methods. - virtual const IntSize& deviceViewportSize() const OVERRIDE { static IntSize fakeSize; return fakeSize; } + virtual const IntSize& deviceViewportSize() const OVERRIDE { static IntSize fakeSize(1, 1); return fakeSize; } virtual const CCLayerTreeSettings& settings() const OVERRIDE { static CCLayerTreeSettings fakeSettings; return fakeSettings; } virtual void didLoseContext() OVERRIDE { } virtual void onSwapBuffersComplete() OVERRIDE { } virtual void setFullRootLayerDamage() OVERRIDE { m_setFullRootLayerDamageCount++; } - virtual void setContentsMemoryAllocationLimitBytes(size_t bytes) OVERRIDE { m_memoryAllocationLimitBytes = bytes; } + virtual void releaseContentsTextures() OVERRIDE { } + virtual void setMemoryAllocationLimitBytes(size_t bytes) OVERRIDE { m_memoryAllocationLimitBytes = bytes; } // Methods added for test. int setFullRootLayerDamageCount() const { return m_setFullRootLayerDamageCount; } @@ -167,20 +169,34 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferYesWhenItAlreadyExistsShouldD } // Test LayerRendererChromium discardFramebuffer functionality: -// Suggest discarding framebuffer when one exists. +// Suggest discarding framebuffer when one exists and the renderer is not visible. // Expected: it is discarded and damage tracker is reset. -TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayer) +TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoShouldDiscardBackbufferAndDamageRootLayerWhileNotVisible) { + m_layerRendererChromium.setVisible(false); m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); } // Test LayerRendererChromium discardFramebuffer functionality: +// Suggest discarding framebuffer when one exists and the renderer is visible. +// Expected: the allocation is ignored. +TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoDoNothingWhenVisible) +{ + m_layerRendererChromium.setVisible(true); + m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo); + EXPECT_EQ(0, m_mockClient.setFullRootLayerDamageCount()); + EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); +} + + +// Test LayerRendererChromium discardFramebuffer functionality: // Suggest discarding framebuffer when one does not exist. // Expected: it does nothing. TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNothing) { + m_layerRendererChromium.setVisible(false); m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); @@ -191,37 +207,37 @@ TEST_F(LayerRendererChromiumTest, SuggestBackbufferNoWhenItDoesntExistShouldDoNo } // Test LayerRendererChromium discardFramebuffer functionality: -// Suggest discarding framebuffer, then try to swapBuffers. -// Expected: framebuffer is discarded, swaps are ignored, and damage is reset after discard and after each swap. -TEST_F(LayerRendererChromiumTest, SwapBuffersWhileBackbufferDiscardedShouldIgnoreSwapAndDamageRootLayer) +// Begin drawing a frame while a framebuffer is discarded. +// Expected: will recreate framebuffer. +TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatedForScopeDuration) { + m_layerRendererChromium.setVisible(false); m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); - swapBuffers(); - EXPECT_EQ(0, m_mockContext.frameCount()); - EXPECT_EQ(2, m_mockClient.setFullRootLayerDamageCount()); + m_layerRendererChromium.setVisible(true); + m_layerRendererChromium.beginDrawingFrame(m_mockClient.rootRenderPass()); + EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); swapBuffers(); - EXPECT_EQ(0, m_mockContext.frameCount()); - EXPECT_EQ(3, m_mockClient.setFullRootLayerDamageCount()); + EXPECT_EQ(1, m_mockContext.frameCount()); } -// Test LayerRendererChromium discardFramebuffer functionality: -// Begin drawing a frame while a framebuffer is discarded. -// Expected: will recreate framebuffer. -TEST_F(LayerRendererChromiumTest, DiscardedBackbufferIsRecreatredForScopeDuration) +TEST_F(LayerRendererChromiumTest, FramebufferDiscardedAfterReadbackWhenNotVisible) { + m_layerRendererChromium.setVisible(false); m_mockContext.setMemoryAllocation(m_suggestHaveBackbufferNo); EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); EXPECT_EQ(1, m_mockClient.setFullRootLayerDamageCount()); + char pixels[4]; m_layerRendererChromium.beginDrawingFrame(m_mockClient.rootRenderPass()); EXPECT_FALSE(m_layerRendererChromium.isFramebufferDiscarded()); - swapBuffers(); - EXPECT_EQ(1, m_mockContext.frameCount()); + m_layerRendererChromium.getFramebufferPixels(pixels, IntRect(0, 0, 1, 1)); + EXPECT_TRUE(m_layerRendererChromium.isFramebufferDiscarded()); + EXPECT_EQ(2, m_mockClient.setFullRootLayerDamageCount()); } class ForbidSynchronousCallContext : public FakeWebGraphicsContext3D { diff --git a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp index 5e301d8eb..9495e706a 100644 --- a/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp +++ b/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp @@ -31,6 +31,7 @@ #include "CCTiledLayerTestCommon.h" #include "FakeCCLayerTreeHostClient.h" #include "WebCompositor.h" +#include "cc/CCOverdrawMetrics.h" #include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread #include <gtest/gtest.h> #include <public/WebTransformationMatrix.h> @@ -798,6 +799,7 @@ TEST(TiledLayerChromiumTest, skipsDrawGetsReset) WebKit::WebCompositor::initialize(0); FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCLayerTreeSettings()); + ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); // Create two 300 x 300 tiled layers. IntSize contentBounds(300, 300); @@ -822,8 +824,7 @@ TEST(TiledLayerChromiumTest, skipsDrawGetsReset) ccLayerTreeHost->setRootLayer(rootLayer); ccLayerTreeHost->setViewportSize(IntSize(300, 300)); - textureManager->setMaxMemoryLimitBytes(memoryLimit); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, memoryLimit); // We'll skip the root layer. EXPECT_TRUE(rootLayer->skipsDraw()); @@ -835,7 +836,7 @@ TEST(TiledLayerChromiumTest, skipsDrawGetsReset) // Remove the child layer. rootLayer->removeAllChildren(); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, memoryLimit); EXPECT_FALSE(rootLayer->skipsDraw()); ccLayerTreeHost->setRootLayer(0); @@ -881,6 +882,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient; OwnPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, settings); + ASSERT_TRUE(ccLayerTreeHost->initializeLayerRendererIfNeeded()); // Create one 500 x 300 tiled layer. IntSize contentBounds(300, 200); @@ -901,7 +903,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) ccLayerTreeHost->setViewportSize(IntSize(300, 200)); // Full update of all 6 tiles. - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0))); @@ -919,7 +921,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) // Full update of 3 tiles and partial update of 3 tiles. layer->invalidateRect(IntRect(0, 0, 300, 150)); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0))); @@ -940,7 +942,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0))); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); updater.update(0, &allocator, &copier, &uploader, 4); EXPECT_EQ(2, layer->fakeLayerTextureUpdater()->updateCount()); EXPECT_TRUE(updater.hasMoreUpdates()); @@ -967,7 +969,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0))); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); updater.update(0, &allocator, &copier, &uploader, 4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); EXPECT_TRUE(updater.hasMoreUpdates()); @@ -985,7 +987,7 @@ TEST(TiledLayerChromiumTest, partialUpdates) { DebugScopedSetImplThread implThread; OwnPtr<FakeCCTiledLayerImpl> layerImpl(adoptPtr(new FakeCCTiledLayerImpl(0))); - ccLayerTreeHost->updateLayers(updater); + ccLayerTreeHost->updateLayers(updater, std::numeric_limits<size_t>::max()); updater.update(0, &allocator, &copier, &uploader, 4); EXPECT_EQ(4, layer->fakeLayerTextureUpdater()->updateCount()); EXPECT_FALSE(updater.hasMoreUpdates()); diff --git a/Source/WebKit/chromium/tests/WebViewTest.cpp b/Source/WebKit/chromium/tests/WebViewTest.cpp index aef5c94ce..f858fe7b5 100644 --- a/Source/WebKit/chromium/tests/WebViewTest.cpp +++ b/Source/WebKit/chromium/tests/WebViewTest.cpp @@ -306,4 +306,23 @@ TEST_F(WebViewTest, DISABLED_TextInputType) } +TEST_F(WebViewTest, SetEditableSelectionOffsets) +{ + FrameTestHelpers::registerMockedURLLoad(m_baseURL, "input_field_populated.html"); + WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "input_field_populated.html"); + webView->setInitialFocus(false); + webView->setEditableSelectionOffsets(5, 13); + WebFrameImpl* frame = static_cast<WebFrameImpl*>(webView->mainFrame()); + EXPECT_EQ("56789abc", frame->selectionAsText()); + webView->close(); + + FrameTestHelpers::registerMockedURLLoad(m_baseURL, "content_editable_populated.html"); + webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "content_editable_populated.html"); + webView->setInitialFocus(false); + webView->setEditableSelectionOffsets(8, 19); + frame = static_cast<WebFrameImpl*>(webView->mainFrame()); + EXPECT_EQ("89abcdefghi", frame->selectionAsText()); + webView->close(); +} + } diff --git a/Source/WebKit/chromium/tests/data/content_editable_populated.html b/Source/WebKit/chromium/tests/data/content_editable_populated.html new file mode 100644 index 000000000..f0d2a59a7 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/content_editable_populated.html @@ -0,0 +1 @@ +<span contenteditable="true">0123456789abcdefghijklmnopqrstuvwxyz</span> diff --git a/Source/WebKit/chromium/tests/data/input_field_populated.html b/Source/WebKit/chromium/tests/data/input_field_populated.html new file mode 100644 index 000000000..4889ad491 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/input_field_populated.html @@ -0,0 +1 @@ +<input value='0123456789abcdefghijklmnopqrstuvwxyz'/> diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index 63120b94a..2273bb34c 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,58 @@ +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * ewk/ewk_frame.cpp: + (ewk_frame_script_execute): + * ewk/ewk_view.cpp: + (ewk_view_js_object_add): + +2012-06-22 Ryuan Choi <ryuan.choi@samsung.com> + + [EFL][WK2] Support keyboard event + https://bugs.webkit.org/show_bug.cgi?id=89268 + + Reviewed by Chang Shu. + + Extract keyDownCommandsMap and keyPressCommandsMap to share WebKit1/Efl and WebKit2/Efl. + + * WebCoreSupport/EditorClientEfl.cpp: + (WebCore::EditorClientEfl::interpretKeyEvent): + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * ewk/ewk_frame.cpp: + (ewk_frame_script_execute): + * ewk/ewk_view.cpp: + (ewk_view_js_object_add): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + + * WebCoreSupport/DeviceOrientationClientEfl.h: + (DeviceOrientationClientEfl): + 2012-06-19 Sergio Villar Senin <svillar@igalia.com> Calling nativeImageForCurrentFrame() causes assertion failure: m_verifier.isSafeToUse() diff --git a/Source/WebKit/efl/WebCoreSupport/DeviceOrientationClientEfl.h b/Source/WebKit/efl/WebCoreSupport/DeviceOrientationClientEfl.h index b80077ca5..0bb197cb7 100644 --- a/Source/WebKit/efl/WebCoreSupport/DeviceOrientationClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/DeviceOrientationClientEfl.h @@ -20,8 +20,8 @@ #ifndef DeviceOrientationClientEfl_h #define DeviceOrientationClientEfl_h -#include "DeviceOrientation.h" #include "DeviceOrientationClient.h" +#include "DeviceOrientationData.h" namespace WebCore { @@ -33,7 +33,7 @@ public: virtual void setController(DeviceOrientationController*); virtual void startUpdating(); virtual void stopUpdating(); - virtual DeviceOrientation* lastOrientation() const; + virtual DeviceOrientationData* lastOrientation() const; virtual void deviceOrientationControllerDestroyed(); private: diff --git a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp index 82ec8456c..1846cc50c 100644 --- a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.cpp @@ -25,6 +25,7 @@ #include "DumpRenderTreeSupportEfl.h" #include "Editor.h" +#include "EflKeyboardUtilities.h" #include "EventNames.h" #include "FocusController.h" #include "Frame.h" @@ -279,110 +280,14 @@ void EditorClientEfl::toggleGrammarChecking() notImplemented(); } -static const unsigned CtrlKey = 1 << 0; -static const unsigned AltKey = 1 << 1; -static const unsigned ShiftKey = 1 << 2; - -struct KeyDownEntry { - unsigned virtualKey; - unsigned modifiers; - const char* name; -}; - -struct KeyPressEntry { - unsigned charCode; - unsigned modifiers; - const char* name; -}; - -static const KeyDownEntry keyDownEntries[] = { - { VK_LEFT, 0, "MoveLeft" }, - { VK_LEFT, ShiftKey, "MoveLeftAndModifySelection" }, - { VK_LEFT, CtrlKey, "MoveWordLeft" }, - { VK_LEFT, CtrlKey | ShiftKey, "MoveWordLeftAndModifySelection" }, - { VK_RIGHT, 0, "MoveRight" }, - { VK_RIGHT, ShiftKey, "MoveRightAndModifySelection" }, - { VK_RIGHT, CtrlKey, "MoveWordRight" }, - { VK_RIGHT, CtrlKey | ShiftKey, "MoveWordRightAndModifySelection" }, - { VK_UP, 0, "MoveUp" }, - { VK_UP, ShiftKey, "MoveUpAndModifySelection" }, - { VK_PRIOR, ShiftKey, "MovePageUpAndModifySelection" }, - { VK_DOWN, 0, "MoveDown" }, - { VK_DOWN, ShiftKey, "MoveDownAndModifySelection" }, - { VK_NEXT, ShiftKey, "MovePageDownAndModifySelection" }, - { VK_PRIOR, 0, "MovePageUp" }, - { VK_NEXT, 0, "MovePageDown" }, - { VK_HOME, 0, "MoveToBeginningOfLine" }, - { VK_HOME, ShiftKey, "MoveToBeginningOfLineAndModifySelection" }, - { VK_HOME, CtrlKey, "MoveToBeginningOfDocument" }, - { VK_HOME, CtrlKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" }, - - { VK_END, 0, "MoveToEndOfLine" }, - { VK_END, ShiftKey, "MoveToEndOfLineAndModifySelection" }, - { VK_END, CtrlKey, "MoveToEndOfDocument" }, - { VK_END, CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" }, - - { VK_BACK, 0, "DeleteBackward" }, - { VK_BACK, ShiftKey, "DeleteBackward" }, - { VK_DELETE, 0, "DeleteForward" }, - { VK_BACK, CtrlKey, "DeleteWordBackward" }, - { VK_DELETE, CtrlKey, "DeleteWordForward" }, - - { 'B', CtrlKey, "ToggleBold" }, - { 'I', CtrlKey, "ToggleItalic" }, - - { VK_ESCAPE, 0, "Cancel" }, - { VK_OEM_PERIOD, CtrlKey, "Cancel" }, - { VK_TAB, 0, "InsertTab" }, - { VK_TAB, ShiftKey, "InsertBacktab" }, - { VK_RETURN, 0, "InsertNewline" }, - { VK_RETURN, CtrlKey, "InsertNewline" }, - { VK_RETURN, AltKey, "InsertNewline" }, - { VK_RETURN, AltKey | ShiftKey, "InsertNewline" }, -}; - -static const KeyPressEntry keyPressEntries[] = { - { '\t', 0, "InsertTab" }, - { '\t', ShiftKey, "InsertBacktab" }, - { '\r', 0, "InsertNewline" }, - { '\r', CtrlKey, "InsertNewline" }, - { '\r', AltKey, "InsertNewline" }, - { '\r', AltKey | ShiftKey, "InsertNewline" }, -}; - const char* EditorClientEfl::interpretKeyEvent(const KeyboardEvent* event) { ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent); - static HashMap<int, const char*>* keyDownCommandsMap = 0; - static HashMap<int, const char*>* keyPressCommandsMap = 0; - - if (!keyDownCommandsMap) { - keyDownCommandsMap = new HashMap<int, const char*>; - keyPressCommandsMap = new HashMap<int, const char*>; - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) - keyDownCommandsMap->set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); - - for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) - keyPressCommandsMap->set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); - } - - unsigned modifiers = 0; - if (event->shiftKey()) - modifiers |= ShiftKey; - if (event->altKey()) - modifiers |= AltKey; - if (event->ctrlKey()) - modifiers |= CtrlKey; - - if (event->type() == eventNames().keydownEvent) { - int mapKey = modifiers << 16 | event->keyCode(); - return mapKey ? keyDownCommandsMap->get(mapKey) : 0; - } + if (event->type() == eventNames().keydownEvent) + return getKeyDownCommandName(event); - int mapKey = modifiers << 16 | event->charCode(); - return mapKey ? keyPressCommandsMap->get(mapKey) : 0; + return getKeyPressCommandName(event); } bool EditorClientEfl::handleEditingKeyboardEvent(KeyboardEvent* event) diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index 661716e51..0d08434c9 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,3 +1,121 @@ +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::gcCountJavascriptObjects): + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::gcCountJavascriptObjects): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + + * WebCoreSupport/DeviceOrientationClientGtk.h: + (DeviceOrientationClientGtk): + +2012-06-21 Daniel Drake <dsd@laptop.org> + + [GTK] Backport run-file-chooser to WebKit1 + https://bugs.webkit.org/show_bug.cgi?id=87283 + + Reviewed by Gustavo Noronha Silva. + + This is a relatively straightforward backport of Mario Sanchez + Prada's WebKit2 run-file-chooser signal work, intended for use by + OLPC and others who are not quite ready to move to WebKit2. + + Add a new public class to the API, WebKitFileChooserRequest, to be + emitted along with a new WebKitWebView::run-file-chooser signal to + let client applications to provide their own file chooser dialog + when the use interacts with HTML Input elements of type 'file'. + + * GNUmakefile.am: Added new source files and headers. + * webkit/webkitfilechooserrequest.cpp: Added. + (_WebKitFileChooserRequestPrivate): + (webkit_file_chooser_request_init): + (webkit_file_chooser_request_finalize): + (webkit_file_chooser_request_get_property): + (webkit_file_chooser_request_class_init): + (webkit_file_chooser_request_create): + (webkit_file_chooser_request_get_mime_types): + (webkit_file_chooser_request_get_mime_types_filter): + (webkit_file_chooser_request_get_select_multiple): + (webkit_file_chooser_request_select_files): + (webkit_file_chooser_request_get_selected_files): + * webkit/webkitfilechooserrequest.h: Added. + (_WebKitFileChooserRequest): + (_WebKitFileChooserRequestClass): + * webkit/webkitfilechooserrequestprivate.h: Added, + containing the prototype of webkit_file_chooser_request_create. + + Provide private API to make a file chooser request from the + WebView, and provide a default handler for it. + + * webkit/webkitwebview.cpp: + (fileChooserDialogResponseCallback): Handler for the 'response' + signal for the GtkFileChooserDialog used in the default + handler. It will call to webkit_file_chooser_request_select_files + or webkit_file_chooser_request_cancel as needed. + (webkitWebViewRealRunFileChooser): Default handler for the new + 'run-file-chooser' signal. It will create a GtkFileChooserDialog, + connect to the 'response' signal and show it. + (webkit_web_view_class_init): Connect the 'run-file-chooser' + signal to the default handler, webkitWebViewRunFileChooser. + (webkit_web_view_new): + (webkitWebViewRunFileChooserRequest): + * webkit/webkitwebview.h: + (_WebKitWebViewClass): Added prototype for the handler of the new + 'run-file-chooser' signal. + * webkit/webkitwebviewprivate.h: Added prototype for + private new function webkitWebViewRunFileChooserRequest. + + Update runOpenPanel to use the new API, including a default handler + with similar behaviour to before. + + * WebCoreSupport/ChromeClientGtk.cpp: + (WebKit::ChromeClient::runOpenPanel): Now creates an instance of + WebKitFileChooserRequest and asks the WebView to emit the + new 'run-file-chooser' signal with it. + + Added the new public header to the main header. + + * webkit/webkit.h: Added webkitfilechooserrequest.h + + New unit tests for the new WebKitFileChooserRequest API. + + * tests/testwebview.c: Various WebKitFileChooserRequest tests, + including MIME type filtering and selection handling. + + Updated documentation related files with the new API. + + * docs/webkitgtk-docs.sgml: Added new section. + * docs/webkitgtk-sections.txt: Added new API. + * docs/webkitgtk.types: Added get_type function. + 2012-06-19 Chang Wan Hong <jourmoon@company100.net> Refine syncLayersTimeoutCallback for Accelerated Compositing. diff --git a/Source/WebKit/gtk/GNUmakefile.am b/Source/WebKit/gtk/GNUmakefile.am index f24c7a967..12ee765a3 100644 --- a/Source/WebKit/gtk/GNUmakefile.am +++ b/Source/WebKit/gtk/GNUmakefile.am @@ -114,6 +114,7 @@ webkitgtk_static_h_api += \ $(srcdir)/Source/WebKit/gtk/webkit/webkitdownload.h \ $(srcdir)/Source/WebKit/gtk/webkit/webkiterror.h \ $(srcdir)/Source/WebKit/gtk/webkit/webkitfavicondatabase.h \ + $(srcdir)/Source/WebKit/gtk/webkit/webkitfilechooserrequest.h \ $(srcdir)/Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \ $(srcdir)/Source/WebKit/gtk/webkit/webkitglobals.h \ $(srcdir)/Source/WebKit/gtk/webkit/webkithittestresult.h \ @@ -221,6 +222,9 @@ webkitgtk_sources += \ Source/WebKit/gtk/webkit/webkiterror.cpp \ Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp \ Source/WebKit/gtk/webkit/webkitfavicondatabaseprivate.h \ + Source/WebKit/gtk/webkit/webkitfilechooserrequest.cpp \ + Source/WebKit/gtk/webkit/webkitfilechooserrequest.h \ + Source/WebKit/gtk/webkit/webkitfilechooserrequestprivate.h \ Source/WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \ Source/WebKit/gtk/webkit/webkitgeolocationpolicydecisionprivate.h \ Source/WebKit/gtk/webkit/webkitglobals.cpp \ diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 1a991b936..3b309f8b8 100644 --- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -55,6 +55,7 @@ #include "WebKitDOMBinding.h" #include "WebKitDOMHTMLElementPrivate.h" #include "WindowFeatures.h" +#include "webkitfilechooserrequestprivate.h" #include "webkitgeolocationpolicydecision.h" #include "webkitgeolocationpolicydecisionprivate.h" #include "webkitnetworkrequest.h" @@ -815,40 +816,8 @@ void ChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t) void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser) { - RefPtr<FileChooser> chooser = prpFileChooser; - - GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(m_webView)); - if (!widgetIsOnscreenToplevelWindow(toplevel)) - toplevel = 0; - - GtkWidget* dialog = gtk_file_chooser_dialog_new(_("Upload File"), - toplevel ? GTK_WINDOW(toplevel) : 0, - GTK_FILE_CHOOSER_ACTION_OPEN, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, - NULL); - - gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), chooser->settings().allowsMultipleFiles); - - if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { - if (gtk_file_chooser_get_select_multiple(GTK_FILE_CHOOSER(dialog))) { - GOwnPtr<GSList> filenames(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog))); - Vector<String> names; - for (GSList* item = filenames.get() ; item ; item = item->next) { - if (!item->data) - continue; - names.append(filenameToString(static_cast<char*>(item->data))); - g_free(item->data); - } - chooser->chooseFiles(names); - } else { - gchar* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); - if (filename) - chooser->chooseFile(filenameToString(filename)); - g_free(filename); - } - } - gtk_widget_destroy(dialog); + GRefPtr<WebKitFileChooserRequest> request = adoptGRef(webkit_file_chooser_request_create(prpFileChooser)); + webkitWebViewRunFileChooserRequest(m_webView, request.get()); } void ChromeClient::loadIconForFiles(const Vector<WTF::String>& filenames, WebCore::FileIconLoader* loader) diff --git a/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h index 2c529495f..fcaa2d2e8 100644 --- a/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h +++ b/Source/WebKit/gtk/WebCoreSupport/DeviceOrientationClientGtk.h @@ -21,8 +21,8 @@ #ifndef DeviceOrientationClientGtk_h #define DeviceOrientationClientGtk_h -#include "DeviceOrientation.h" #include "DeviceOrientationClient.h" +#include "DeviceOrientationData.h" namespace WebKit { @@ -34,7 +34,7 @@ public: virtual void setController(WebCore::DeviceOrientationController*); virtual void startUpdating(); virtual void stopUpdating(); - virtual WebCore::DeviceOrientation* lastOrientation() const; + virtual WebCore::DeviceOrientationData* lastOrientation() const; virtual void deviceOrientationControllerDestroyed(); private: diff --git a/Source/WebKit/gtk/docs/webkitgtk-docs.sgml b/Source/WebKit/gtk/docs/webkitgtk-docs.sgml index b4eb26d65..72106522f 100644 --- a/Source/WebKit/gtk/docs/webkitgtk-docs.sgml +++ b/Source/WebKit/gtk/docs/webkitgtk-docs.sgml @@ -41,6 +41,7 @@ <xi:include href="xml/webkiticondatabase.xml"/> <xi:include href="xml/webkitspellchecker.xml"/> <xi:include href="xml/webkitfavicondatabase.xml"/> + <xi:include href="xml/webkitfilechooserrequest.xml"/> </chapter> <chapter> diff --git a/Source/WebKit/gtk/docs/webkitgtk-sections.txt b/Source/WebKit/gtk/docs/webkitgtk-sections.txt index c97489b6c..f6589a22f 100644 --- a/Source/WebKit/gtk/docs/webkitgtk-sections.txt +++ b/Source/WebKit/gtk/docs/webkitgtk-sections.txt @@ -703,6 +703,30 @@ WebKitFaviconDatabasePrivate </SECTION> <SECTION> +<FILE>webkitfilechooserrequest</FILE> +<TITLE>WebKitFileChooserRequest</TITLE> +WebKitFileChooserRequest +webkit_file_chooser_request_get_select_multiple +webkit_file_chooser_request_get_mime_types +webkit_file_chooser_request_get_mime_types_filter +webkit_file_chooser_request_get_selected_files +webkit_file_chooser_request_select_files + +<SUBSECTION Standard> +WEBKIT_TYPE_FILE_CHOOSER_REQUEST +WEBKIT_FILE_CHOOSER_REQUEST +WEBKIT_IS_FILE_CHOOSER_REQUEST +WEBKIT_FILE_CHOOSER_REQUEST_CLASS +WEBKIT_IS_FILE_CHOOSER_REQUEST_CLASS +WEBKIT_FILE_CHOOSER_REQUEST_GET_CLASS + +<SUBSECTION Private> +WebKitFileChooserRequestClass +WebKitFileChooserRequestPrivate +webkit_file_chooser_request_get_type +</SECTION> + +<SECTION> <FILE>webkitdefines</FILE> WEBKIT_API WEBKITGTK_API_VERSION diff --git a/Source/WebKit/gtk/docs/webkitgtk.types b/Source/WebKit/gtk/docs/webkitgtk.types index 2be1a8c74..8049b5c04 100644 --- a/Source/WebKit/gtk/docs/webkitgtk.types +++ b/Source/WebKit/gtk/docs/webkitgtk.types @@ -1,6 +1,7 @@ #include <webkit/webkit.h> webkit_download_get_type webkit_favicon_database_get_type +webkit_file_chooser_request_get_type webkit_geolocation_policy_decision_get_type webkit_hit_test_result_get_type webkit_icon_database_get_type diff --git a/Source/WebKit/gtk/tests/testwebview.c b/Source/WebKit/gtk/tests/testwebview.c index 22dff131c..f71aa42b4 100644 --- a/Source/WebKit/gtk/tests/testwebview.c +++ b/Source/WebKit/gtk/tests/testwebview.c @@ -506,6 +506,186 @@ static void test_webkit_web_view_fullscreen(gconstpointer blocked) gtk_widget_destroy(window); } +static gboolean checkMimeTypeForFilter(GtkFileFilter* filter, const gchar* mimeType) +{ + GtkFileFilterInfo filter_info; + filter_info.contains = GTK_FILE_FILTER_MIME_TYPE; + filter_info.mime_type = mimeType; + return gtk_file_filter_filter(filter, &filter_info); +} + +static gboolean runFileChooserCbNoMultiselNoMime(WebKitWebView* webview, WebKitFileChooserRequest* request, gpointer data) +{ + g_assert(!webkit_file_chooser_request_get_select_multiple(request)); + + const gchar* const* mimeTypes = webkit_file_chooser_request_get_mime_types(request); + g_assert(!mimeTypes); + GtkFileFilter* filter = webkit_file_chooser_request_get_mime_types_filter(request); + g_assert(!filter); + + const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(request); + g_assert(!selectedFiles); + + g_main_loop_quit(loop); + return TRUE; +} + +static gboolean runFileChooserCbMultiselNoMime(WebKitWebView* webview, WebKitFileChooserRequest* request, gpointer data) +{ + g_assert(webkit_file_chooser_request_get_select_multiple(request)); + + const gchar* const* mimeTypes = webkit_file_chooser_request_get_mime_types(request); + g_assert(!mimeTypes); + GtkFileFilter* filter = webkit_file_chooser_request_get_mime_types_filter(request); + g_assert(!filter); + const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(request); + g_assert(!selectedFiles); + + // Select some files. + const gchar* filesToSelect[4] = { "/foo", "/foo/bar", "/foo/bar/baz", 0 }; + webkit_file_chooser_request_select_files(request, filesToSelect); + + // Check the files that have been just selected. + selectedFiles = webkit_file_chooser_request_get_selected_files(request); + g_assert(selectedFiles); + g_assert_cmpstr(selectedFiles[0], ==, "/foo"); + g_assert_cmpstr(selectedFiles[1], ==, "/foo/bar"); + g_assert_cmpstr(selectedFiles[2], ==, "/foo/bar/baz"); + g_assert(!selectedFiles[3]); + + g_main_loop_quit(loop); + return TRUE; +} + +static gboolean runFileChooserCbSelectionRetained(WebKitWebView* webview, WebKitFileChooserRequest* request, gpointer data) +{ + const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(request); + g_assert(selectedFiles); + g_assert_cmpstr(selectedFiles[0], ==, "/foo"); + g_assert_cmpstr(selectedFiles[1], ==, "/foo/bar"); + g_assert_cmpstr(selectedFiles[2], ==, "/foo/bar/baz"); + g_assert(!selectedFiles[3]); + + g_main_loop_quit(loop); + return TRUE; +} + +static gboolean runFileChooserCbNoMultiselAcceptTypes(WebKitWebView* webview, WebKitFileChooserRequest* request, gpointer data) +{ + g_assert(!webkit_file_chooser_request_get_select_multiple(request)); + + const gchar* const* mimeTypes = webkit_file_chooser_request_get_mime_types(request); + g_assert(mimeTypes); + g_assert_cmpstr(mimeTypes[0], ==, "audio/*"); + g_assert_cmpstr(mimeTypes[1], ==, "video/*"); + g_assert_cmpstr(mimeTypes[2], ==, "image/*"); + g_assert(!mimeTypes[3]); + + GtkFileFilter* filter = webkit_file_chooser_request_get_mime_types_filter(request); + g_assert(GTK_IS_FILE_FILTER(filter)); + g_assert(checkMimeTypeForFilter(filter, "audio/*")); + g_assert(checkMimeTypeForFilter(filter, "video/*")); + g_assert(checkMimeTypeForFilter(filter, "image/*")); + + const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(request); + g_assert(!selectedFiles); + + g_main_loop_quit(loop); + return TRUE; +} + +void doMouseButtonEvent(GtkWidget* widget, GdkEventType eventType, int x, int y, unsigned int button, unsigned int modifiers) +{ + g_assert(gtk_widget_get_realized(widget)); + + GdkEvent* event = gdk_event_new(eventType); + event->button.window = gtk_widget_get_window(widget); + g_object_ref(event->button.window); + + event->button.time = GDK_CURRENT_TIME; + event->button.x = x; + event->button.y = y; + event->button.axes = 0; + event->button.state = modifiers; + event->button.button = button; + + event->button.device = gdk_device_manager_get_client_pointer(gdk_display_get_device_manager(gtk_widget_get_display(widget))); + + int xRoot, yRoot; + gdk_window_get_root_coords(gtk_widget_get_window(widget), x, y, &xRoot, &yRoot); + event->button.x_root = xRoot; + event->button.y_root = yRoot; + gtk_main_do_event(event); +} + +static void clickMouseButton(GtkWidget* widget, int x, int y, unsigned int button, unsigned int modifiers) +{ + doMouseButtonEvent(widget, GDK_BUTTON_PRESS, x, y, button, modifiers); + doMouseButtonEvent(widget, GDK_BUTTON_RELEASE, x, y, button, modifiers); +} + +static gboolean clickMouseButtonAndWaitForFileChooserRequest(WebKitWebView* webView) +{ + clickMouseButton(GTK_WIDGET(webView), 5, 5, 1, 0); + return TRUE; +} + +static void test_webkit_web_view_file_chooser() +{ + const gchar* htmlFormatBase = "<html><body>" + "<input style='position:absolute;left:0;top:0;margin:0;padding:0' type='file' %s/>" + "</body></html>"; + + GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + GtkWidget* webView = webkit_web_view_new(); + gtk_container_add(GTK_CONTAINER(window), webView); + gtk_widget_show_all(window); + + loop = g_main_loop_new(NULL, TRUE); + + // Multiple selections not allowed, no MIME filtering. + gulong handler = g_signal_connect(webView, "run-file-chooser", G_CALLBACK(runFileChooserCbNoMultiselNoMime), NULL); + gchar* htmlFormat = g_strdup_printf(htmlFormatBase, ""); + webkit_web_view_load_string(WEBKIT_WEB_VIEW(webView), htmlFormat, NULL, NULL, NULL); + g_free(htmlFormat); + + g_timeout_add(100, (GSourceFunc) clickMouseButtonAndWaitForFileChooserRequest, WEBKIT_WEB_VIEW(webView)); + g_main_loop_run(loop); + + g_signal_handler_disconnect(webView, handler); + + // Multiple selections allowed, no MIME filtering, some pre-selected files. + handler = g_signal_connect(webView, "run-file-chooser", G_CALLBACK(runFileChooserCbMultiselNoMime), NULL); + htmlFormat = g_strdup_printf(htmlFormatBase, "multiple"); + webkit_web_view_load_string(WEBKIT_WEB_VIEW(webView), htmlFormat, NULL, NULL, NULL); + g_free(htmlFormat); + + g_timeout_add(100, (GSourceFunc) clickMouseButtonAndWaitForFileChooserRequest, WEBKIT_WEB_VIEW(webView)); + g_main_loop_run(loop); + + g_signal_handler_disconnect(webView, handler); + + // Perform another request to check if the list of files selected + // in the previous step appears now as part of the new request. + handler = g_signal_connect(webView, "run-file-chooser", G_CALLBACK(runFileChooserCbSelectionRetained), NULL); + g_timeout_add(100, (GSourceFunc) clickMouseButtonAndWaitForFileChooserRequest, WEBKIT_WEB_VIEW(webView)); + g_main_loop_run(loop); + + g_signal_handler_disconnect(webView, handler); + + // Multiple selections not allowed, only accept images, audio and video files. + handler = g_signal_connect(webView, "run-file-chooser", G_CALLBACK(runFileChooserCbNoMultiselAcceptTypes), NULL); + htmlFormat = g_strdup_printf(htmlFormatBase, "accept='audio/*,video/*,image/*'"); + webkit_web_view_load_string(WEBKIT_WEB_VIEW(webView), htmlFormat, NULL, NULL, NULL); + g_free(htmlFormat); + + g_timeout_add(100, (GSourceFunc) clickMouseButtonAndWaitForFileChooserRequest, WEBKIT_WEB_VIEW(webView)); + g_main_loop_run(loop); + + g_signal_handler_disconnect(webView, handler); + gtk_widget_destroy(window); +} + int main(int argc, char** argv) { SoupServer* server; @@ -537,6 +717,7 @@ int main(int argc, char** argv) g_test_add_func("/webkit/webview/webview-does-not-steal-focus", test_webkit_web_view_does_not_steal_focus); g_test_add_data_func("/webkit/webview/fullscreen", GINT_TO_POINTER(FALSE), test_webkit_web_view_fullscreen); g_test_add_data_func("/webkit/webview/fullscreen-blocked", GINT_TO_POINTER(TRUE), test_webkit_web_view_fullscreen); + g_test_add_func("/webkit/webview/file-chooser", test_webkit_web_view_file_chooser); return g_test_run (); } diff --git a/Source/WebKit/gtk/webkit/webkit.h b/Source/WebKit/gtk/webkit/webkit.h index c7e95e8ed..aa7b93dbd 100644 --- a/Source/WebKit/gtk/webkit/webkit.h +++ b/Source/WebKit/gtk/webkit/webkit.h @@ -28,6 +28,7 @@ #include <webkit/webkitdownload.h> #include <webkit/webkitenumtypes.h> #include <webkit/webkitfavicondatabase.h> +#include <webkit/webkitfilechooserrequest.h> #include <webkit/webkitgeolocationpolicydecision.h> #include <webkit/webkitglobals.h> #include <webkit/webkithittestresult.h> diff --git a/Source/WebKit/gtk/webkit/webkitfilechooserrequest.cpp b/Source/WebKit/gtk/webkit/webkitfilechooserrequest.cpp new file mode 100644 index 000000000..c1373ed49 --- /dev/null +++ b/Source/WebKit/gtk/webkit/webkitfilechooserrequest.cpp @@ -0,0 +1,367 @@ +/* + * Copyright (C) 2012 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "webkitfilechooserrequest.h" + +#include "FileChooser.h" +#include "FileSystem.h" +#include "webkitfilechooserrequestprivate.h" +#include "webkitglobalsprivate.h" +#include <glib/gi18n-lib.h> +#include <wtf/gobject/GOwnPtr.h> +#include <wtf/gobject/GRefPtr.h> +#include <wtf/text/CString.h> + +using namespace WebCore; + +/** + * SECTION:webkitfilechooserrequest + * @Short_description: A request to open a file chooser + * @Title: WebKitFileChooserRequest + * @See_also: #WebKitWebView + * + * Whenever the user interacts with an <input type='file' /> + * HTML element, WebKit will need to show a dialog to choose one or + * more files to be uploaded to the server along with the rest of the + * form data. For that to happen in a general way, instead of just + * opening a #GtkFileChooserDialog (which might be not desirable in + * some cases, such as when an embedding applications prefers to use + * its own file chooser dialog), WebKit will fire the + * #WebKitWebView::run-file-chooser signal with a + * #WebKitFileChooserRequest object, which will allow the client + * application to specify the files to be selected, to inspect the + * details of the request (e.g. if multiple selection should be + * allowed) and to cancel the request, in case nothing was selected. + * + * In case the client application does not wish to handle this signal, + * WebKit will provide a default handler which will asynchronously run + * a regular #GtkFileChooserDialog for the user to interact with. + */ +G_DEFINE_TYPE(WebKitFileChooserRequest, webkit_file_chooser_request, G_TYPE_OBJECT) + +struct _WebKitFileChooserRequestPrivate { + RefPtr<FileChooser> chooser; + GRefPtr<GtkFileFilter> filter; + GRefPtr<GPtrArray> mimeTypes; + GRefPtr<GPtrArray> selectedFiles; +}; + +enum { + PROP_0, + PROP_FILTER, + PROP_MIME_TYPES, + PROP_SELECT_MULTIPLE, + PROP_SELECTED_FILES, +}; + +static void webkit_file_chooser_request_init(WebKitFileChooserRequest* request) +{ + request->priv = G_TYPE_INSTANCE_GET_PRIVATE(request, WEBKIT_TYPE_FILE_CHOOSER_REQUEST, WebKitFileChooserRequestPrivate); + new (request->priv) WebKitFileChooserRequestPrivate(); +} + +static void webkit_file_chooser_request_finalize(GObject* object) +{ + WebKitFileChooserRequest* request = WEBKIT_FILE_CHOOSER_REQUEST(object); + + request->priv->~WebKitFileChooserRequestPrivate(); + G_OBJECT_CLASS(webkit_file_chooser_request_parent_class)->finalize(object); +} + +static void webkit_file_chooser_request_get_property(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec) +{ + WebKitFileChooserRequest* request = WEBKIT_FILE_CHOOSER_REQUEST(object); + switch (propId) { + case PROP_FILTER: + g_value_set_object(value, webkit_file_chooser_request_get_mime_types_filter(request)); + break; + case PROP_MIME_TYPES: + g_value_set_boxed(value, webkit_file_chooser_request_get_mime_types(request)); + break; + case PROP_SELECT_MULTIPLE: + g_value_set_boolean(value, webkit_file_chooser_request_get_select_multiple(request)); + break; + case PROP_SELECTED_FILES: + g_value_set_boxed(value, webkit_file_chooser_request_get_selected_files(request)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec); + break; + } +} + +static void webkit_file_chooser_request_class_init(WebKitFileChooserRequestClass* requestClass) +{ + GObjectClass* objectClass = G_OBJECT_CLASS(requestClass); + objectClass->finalize = webkit_file_chooser_request_finalize; + objectClass->get_property = webkit_file_chooser_request_get_property; + g_type_class_add_private(requestClass, sizeof(WebKitFileChooserRequestPrivate)); + + /** + * WebKitFileChooserRequest:filter: + * + * The filter currently associated with the request. See + * webkit_file_chooser_request_get_mime_types_filter() for more + * details. + * + * Since: 1.10 + */ + g_object_class_install_property(objectClass, + PROP_FILTER, + g_param_spec_object("filter", + _("MIME types filter"), + _("The filter currently associated with the request"), + GTK_TYPE_FILE_FILTER, + WEBKIT_PARAM_READABLE)); + /** + * WebKitFileChooserRequest:mime-types: + * + * A %NULL-terminated array of strings containing the list of MIME + * types the file chooser dialog should handle. See + * webkit_file_chooser_request_get_mime_types() for more details. + * + * Since: 1.10 + */ + g_object_class_install_property(objectClass, + PROP_MIME_TYPES, + g_param_spec_boxed("mime-types", + _("MIME types"), + _("The list of MIME types associated with the request"), + G_TYPE_STRV, + WEBKIT_PARAM_READABLE)); /** + * WebKitFileChooserRequest:select-multiple: + * + * Whether the file chooser should allow selecting multiple + * files. See + * webkit_file_chooser_request_get_select_multiple() for + * more details. + * + * Since: 1.10 + */ + g_object_class_install_property(objectClass, + PROP_SELECT_MULTIPLE, + g_param_spec_boolean("select-multiple", + _("Select multiple files"), + _("Whether the file chooser should allow selecting multiple files"), + FALSE, + WEBKIT_PARAM_READABLE)); + /** + * WebKitFileChooserRequest:selected-files: + * + * A %NULL-terminated array of strings containing the list of + * selected files associated to the current request. See + * webkit_file_chooser_request_get_selected_files() for more details. + * + * Since: 1.10 + */ + g_object_class_install_property(objectClass, + PROP_SELECTED_FILES, + g_param_spec_boxed("selected-files", + _("Selected files"), + _("The list of selected files associated with the request"), + G_TYPE_STRV, + WEBKIT_PARAM_READABLE)); +} + +WebKitFileChooserRequest* webkit_file_chooser_request_create(PassRefPtr<FileChooser> chooser) +{ + WebKitFileChooserRequest* request = WEBKIT_FILE_CHOOSER_REQUEST(g_object_new(WEBKIT_TYPE_FILE_CHOOSER_REQUEST, NULL)); + request->priv->chooser = chooser; + return request; +} + +/** + * webkit_file_chooser_request_get_mime_types: + * @request: a #WebKitFileChooserRequest + * + * Get the list of MIME types the file chooser dialog should handle, + * in the format specified in RFC 2046 for "media types". Its contents + * depend on the value of the 'accept' attribute for HTML input + * elements. This function should normally be called before presenting + * the file chooser dialog to the user, to decide whether to allow the + * user to select multiple files at once or only one. + * + * Returns: (array zero-terminated=1) (transfer none): a + * %NULL-terminated array of strings if a list of accepted MIME types + * is defined or %NULL otherwise, meaning that any MIME type should be + * accepted. This array and its contents are owned by WebKitGTK+ and + * should not be modified or freed. + * + * Since: 1.10 + */ +const gchar* const* webkit_file_chooser_request_get_mime_types(WebKitFileChooserRequest* request) +{ + g_return_val_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request), 0); + if (request->priv->mimeTypes) + return reinterpret_cast<gchar**>(request->priv->mimeTypes->pdata); + + FileChooserSettings settings = request->priv->chooser->settings(); + size_t numOfMimeTypes = settings.acceptMIMETypes.size(); + if (!numOfMimeTypes) + return 0; + + request->priv->mimeTypes = adoptGRef(g_ptr_array_new_with_free_func(g_free)); + for (size_t i = 0; i < numOfMimeTypes; ++i) { + String mimeTypeString = settings.acceptMIMETypes[i]; + if (mimeTypeString.isEmpty()) + continue; + g_ptr_array_add(request->priv->mimeTypes.get(), g_strdup(mimeTypeString.utf8().data())); + } + g_ptr_array_add(request->priv->mimeTypes.get(), 0); + + return reinterpret_cast<gchar**>(request->priv->mimeTypes->pdata); +} + +/** + * webkit_file_chooser_request_get_mime_types_filter: + * @request: a #WebKitFileChooserRequest + * + * Get the filter currently associated with the request, ready to be + * used by #GtkFileChooser. This function should normally be called + * before presenting the file chooser dialog to the user, to decide + * whether to apply a filter so the user would not be allowed to + * select files with other MIME types. + * + * See webkit_file_chooser_request_get_mime_types() if you are + * interested in getting the list of accepted MIME types. + * + * Returns: (transfer none): a #GtkFileFilter if a list of accepted + * MIME types is defined or %NULL otherwise. The returned object is + * owned by WebKitGTK+ should not be modified or freed. + * + * Since: 1.10 + */ +GtkFileFilter* webkit_file_chooser_request_get_mime_types_filter(WebKitFileChooserRequest* request) +{ + g_return_val_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request), 0); + if (request->priv->filter) + return request->priv->filter.get(); + + FileChooserSettings settings = request->priv->chooser->settings(); + size_t numOfMimeTypes = settings.acceptMIMETypes.size(); + if (!numOfMimeTypes) + return 0; + + // Do not use adoptGRef here, since we want to sink the floating + // reference for the new instance of GtkFileFilter, so we make + // sure we keep the ownership during the lifetime of the request. + request->priv->filter = gtk_file_filter_new(); + for (size_t i = 0; i < numOfMimeTypes; ++i) { + String mimeTypeString = settings.acceptMIMETypes[i]; + if (mimeTypeString.isEmpty()) + continue; + gtk_file_filter_add_mime_type(request->priv->filter.get(), mimeTypeString.utf8().data()); + } + + return request->priv->filter.get(); +} + +/** + * webkit_file_chooser_request_get_select_multiple: + * @request: a #WebKitFileChooserRequest + * + * Determine whether the file chooser associated to this + * #WebKitFileChooserRequest should allow selecting multiple files, + * which depends on the HTML input element having a 'multiple' + * attribute defined. + * + * Returns: %TRUE if the file chooser should allow selecting multiple files or %FALSE otherwise. + * + * Since: 1.10 + */ +gboolean webkit_file_chooser_request_get_select_multiple(WebKitFileChooserRequest* request) +{ + g_return_val_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request), FALSE); + return request->priv->chooser->settings().allowsMultipleFiles; +} + +/** + * webkit_file_chooser_request_select_files: + * @request: a #WebKitFileChooserRequest + * @files: (array zero-terminated=1) (transfer none): a + * %NULL-terminated array of strings, containing paths to local files. + * + * Ask WebKit to select local files for upload and complete the + * request. + * + * Since: 1.10 + */ +void webkit_file_chooser_request_select_files(WebKitFileChooserRequest* request, const gchar* const* files) +{ + g_return_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request)); + g_return_if_fail(files); + + Vector<String> names; + GRefPtr<GPtrArray> selectedFiles = adoptGRef(g_ptr_array_new_with_free_func(g_free)); + + for (int i = 0; files[i]; i++) { + names.append(filenameToString(files[i])); + g_ptr_array_add(selectedFiles.get(), g_strdup(files[i])); + } + + g_ptr_array_add(selectedFiles.get(), 0); + request->priv->chooser->chooseFiles(names); + request->priv->selectedFiles = selectedFiles; +} + +/** + * webkit_file_chooser_request_get_selected_files: + * @request: a #WebKitFileChooserRequest + * + * Get the list of selected files currently associated to the + * request. Initially, the return value of this method contains any + * files selected in previous file chooser requests for this HTML + * input element. Once webkit_file_chooser_request_select_files, the + * value will reflect whatever files are given. + * + * This function should normally be called only before presenting the + * file chooser dialog to the user, to decide whether to perform some + * extra action, like pre-selecting the files from a previous request. + * + * Returns: (array zero-terminated=1) (transfer none): a + * %NULL-terminated array of strings if there are selected files + * associated with the request or %NULL otherwise. This array and its + * contents are owned by WebKitGTK+ and should not be modified or + * freed. + * + * Since: 1.10 + */ +const gchar* const* webkit_file_chooser_request_get_selected_files(WebKitFileChooserRequest* request) +{ + g_return_val_if_fail(WEBKIT_IS_FILE_CHOOSER_REQUEST(request), 0); + if (request->priv->selectedFiles) + return reinterpret_cast<gchar**>(request->priv->selectedFiles->pdata); + + FileChooserSettings settings = request->priv->chooser->settings(); + size_t numOfFiles = settings.selectedFiles.size(); + if (!numOfFiles) + return 0; + + request->priv->selectedFiles = adoptGRef(g_ptr_array_new_with_free_func(g_free)); + for (size_t i = 0; i < numOfFiles; ++i) { + if (settings.selectedFiles[i].isEmpty()) + continue; + CString filename = fileSystemRepresentation(settings.selectedFiles[i]); + g_ptr_array_add(request->priv->selectedFiles.get(), g_strdup(filename.data())); + } + g_ptr_array_add(request->priv->selectedFiles.get(), 0); + + return reinterpret_cast<gchar**>(request->priv->selectedFiles->pdata); +} diff --git a/Source/WebKit/gtk/webkit/webkitfilechooserrequest.h b/Source/WebKit/gtk/webkit/webkitfilechooserrequest.h new file mode 100644 index 000000000..dea94c860 --- /dev/null +++ b/Source/WebKit/gtk/webkit/webkitfilechooserrequest.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2012 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef webkitfilechooserrequest_h +#define webkitfilechooserrequest_h + +#include <gtk/gtk.h> +#include <webkit/webkitdefines.h> + +G_BEGIN_DECLS + +#define WEBKIT_TYPE_FILE_CHOOSER_REQUEST (webkit_file_chooser_request_get_type()) +#define WEBKIT_FILE_CHOOSER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_FILE_CHOOSER_REQUEST, WebKitFileChooserRequest)) +#define WEBKIT_FILE_CHOOSER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_FILE_CHOOSER_REQUEST, WebKitFileChooserRequestClass)) +#define WEBKIT_IS_FILE_CHOOSER_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_FILE_CHOOSER_REQUEST)) +#define WEBKIT_IS_FILE_CHOOSER_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_FILE_CHOOSER_REQUEST)) +#define WEBKIT_FILE_CHOOSER_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_FILE_CHOOSER_REQUEST, WebKitFileChooserRequestClass)) + +typedef struct _WebKitFileChooserRequest WebKitFileChooserRequest; +typedef struct _WebKitFileChooserRequestClass WebKitFileChooserRequestClass; +typedef struct _WebKitFileChooserRequestPrivate WebKitFileChooserRequestPrivate; + +struct _WebKitFileChooserRequest { + GObject parent; + + /*< private >*/ + WebKitFileChooserRequestPrivate *priv; +}; + +struct _WebKitFileChooserRequestClass { + GObjectClass parent_class; +}; + +WEBKIT_API GType +webkit_file_chooser_request_get_type (void); + +WEBKIT_API const gchar * const * +webkit_file_chooser_request_get_mime_types (WebKitFileChooserRequest *request); + +WEBKIT_API GtkFileFilter * +webkit_file_chooser_request_get_mime_types_filter (WebKitFileChooserRequest *request); + +WEBKIT_API gboolean +webkit_file_chooser_request_get_select_multiple (WebKitFileChooserRequest *request); + +WEBKIT_API void +webkit_file_chooser_request_select_files (WebKitFileChooserRequest *request, + const gchar * const *files); + +WEBKIT_API const gchar * const * +webkit_file_chooser_request_get_selected_files (WebKitFileChooserRequest *request); + +G_END_DECLS + +#endif diff --git a/Source/WebKit/gtk/webkit/webkitfilechooserrequestprivate.h b/Source/WebKit/gtk/webkit/webkitfilechooserrequestprivate.h new file mode 100644 index 000000000..a41cc79f6 --- /dev/null +++ b/Source/WebKit/gtk/webkit/webkitfilechooserrequestprivate.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2012 Igalia S.L. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef webkitfilechooserrequestprivate_h +#define webkitfilechooserrequestprivate_h + +#include "FileChooser.h" +#include "webkitfilechooserrequest.h" + +using namespace WebCore; + +WebKitFileChooserRequest* webkit_file_chooser_request_create(PassRefPtr<FileChooser> chooser); + +#endif diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index 00625cdef..aac487f23 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -216,6 +216,7 @@ enum { ENTERING_FULLSCREEN, LEAVING_FULLSCREEN, CONTEXT_MENU, + RUN_FILE_CHOOSER, LAST_SIGNAL }; @@ -1294,6 +1295,48 @@ static gboolean webkit_web_view_real_leaving_fullscreen(WebKitWebView* webView) return FALSE; } +static void fileChooserDialogResponseCallback(GtkDialog* dialog, gint responseID, WebKitFileChooserRequest* request) +{ + GRefPtr<WebKitFileChooserRequest> adoptedRequest = adoptGRef(request); + if (responseID == GTK_RESPONSE_ACCEPT) { + GOwnPtr<GSList> filesList(gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(dialog))); + GRefPtr<GPtrArray> filesArray = adoptGRef(g_ptr_array_new()); + for (GSList* file = filesList.get(); file; file = g_slist_next(file)) + g_ptr_array_add(filesArray.get(), file->data); + g_ptr_array_add(filesArray.get(), 0); + webkit_file_chooser_request_select_files(adoptedRequest.get(), reinterpret_cast<const gchar* const*>(filesArray->pdata)); + } + + gtk_widget_destroy(GTK_WIDGET(dialog)); +} + +static gboolean webkitWebViewRealRunFileChooser(WebKitWebView* webView, WebKitFileChooserRequest* request) +{ + GtkWidget* toplevel = gtk_widget_get_toplevel(GTK_WIDGET(webView)); + if (!widgetIsOnscreenToplevelWindow(toplevel)) + toplevel = 0; + + gboolean allowsMultipleSelection = webkit_file_chooser_request_get_select_multiple(request); + GtkWidget* dialog = gtk_file_chooser_dialog_new(allowsMultipleSelection ? _("Select Files") : _("Select File"), + toplevel ? GTK_WINDOW(toplevel) : 0, + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + if (GtkFileFilter* filter = webkit_file_chooser_request_get_mime_types_filter(request)) + gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter); + gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), allowsMultipleSelection); + + if (const gchar* const* selectedFiles = webkit_file_chooser_request_get_selected_files(request)) + gtk_file_chooser_select_filename(GTK_FILE_CHOOSER(dialog), selectedFiles[0]); + + g_signal_connect(dialog, "response", G_CALLBACK(fileChooserDialogResponseCallback), g_object_ref(request)); + gtk_widget_show(dialog); + + return TRUE; +} + static void webkit_web_view_dispose(GObject* object) { WebKitWebView* webView = WEBKIT_WEB_VIEW(object); @@ -2547,6 +2590,42 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) G_TYPE_NONE, 1, WEBKIT_TYPE_WEB_FRAME); + /** + * WebKitWebView::run-file-chooser: + * @web_view: the #WebKitWebView on which the signal is emitted + * @request: a #WebKitFileChooserRequest + * + * This signal is emitted when the user interacts with a <input + * type='file' /> HTML element, requesting from WebKit to show + * a dialog to select one or more files to be uploaded. To let the + * application know the details of the file chooser, as well as to + * allow the client application to either cancel the request or + * perform an actual selection of files, the signal will pass an + * instance of the #WebKitFileChooserRequest in the @request + * argument. + * + * The default signal handler will asynchronously run a regular + * #GtkFileChooserDialog for the user to interact with. + * + * If this signal is to be handled asynchronously, you must + * call g_object_ref() on the @request, and return %TRUE to indicate + * that the request is being handled. When you are ready to complete the + * request, call webkit_file_chooser_request_select_files(). + * + * Returns: %TRUE to stop other handlers from being invoked for the event. + * %FALSE to propagate the event further. + * + */ + webkit_web_view_signals[RUN_FILE_CHOOSER] = + g_signal_new("run-file-chooser", + G_TYPE_FROM_CLASS(webViewClass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(WebKitWebViewClass, run_file_chooser), + g_signal_accumulator_true_handled, 0 /* accumulator data */, + webkit_marshal_BOOLEAN__OBJECT, + G_TYPE_BOOLEAN, 1, /* number of parameters */ + WEBKIT_TYPE_FILE_CHOOSER_REQUEST); + webkit_web_view_signals[SHOULD_BEGIN_EDITING] = g_signal_new("should-begin-editing", G_TYPE_FROM_CLASS(webViewClass), static_cast<GSignalFlags>(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), G_STRUCT_OFFSET(WebKitWebViewClass, should_allow_editing_action), g_signal_accumulator_first_wins, 0, @@ -2856,6 +2935,7 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass) webViewClass->should_allow_editing_action = webkit_web_view_real_should_allow_editing_action; webViewClass->entering_fullscreen = webkit_web_view_real_entering_fullscreen; webViewClass->leaving_fullscreen = webkit_web_view_real_leaving_fullscreen; + webViewClass->run_file_chooser = webkitWebViewRealRunFileChooser; GObjectClass* objectClass = G_OBJECT_CLASS(webViewClass); objectClass->dispose = webkit_web_view_dispose; @@ -3610,6 +3690,12 @@ GtkWidget* webkit_web_view_new(void) return GTK_WIDGET(webView); } +void webkitWebViewRunFileChooserRequest(WebKitWebView* webView, WebKitFileChooserRequest* request) +{ + gboolean returnValue; + g_signal_emit(webView, webkit_web_view_signals[RUN_FILE_CHOOSER], 0, request, &returnValue); +} + // for internal use only void webkit_web_view_notify_ready(WebKitWebView* webView) { diff --git a/Source/WebKit/gtk/webkit/webkitwebview.h b/Source/WebKit/gtk/webkit/webkitwebview.h index dc578d5fa..87c197acf 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.h +++ b/Source/WebKit/gtk/webkit/webkitwebview.h @@ -28,6 +28,7 @@ #include <webkit/webkitdefines.h> #include <webkit/webkitdom.h> +#include <webkit/webkitfilechooserrequest.h> #include <webkit/webkitwebbackforwardlist.h> #include <webkit/webkitwebframe.h> #include <webkit/webkitwebhistoryitem.h> @@ -178,9 +179,8 @@ struct _WebKitWebViewClass { gboolean (* should_allow_editing_action) (WebKitWebView *web_view); gboolean (* entering_fullscreen) (WebKitWebView *web_view); gboolean (* leaving_fullscreen) (WebKitWebView *web_view); - - /* Padding for future expansion */ - void (*_webkit_reserved0) (void); + gboolean (* run_file_chooser) (WebKitWebView *web_view, + WebKitFileChooserRequest *request); }; WEBKIT_API GType diff --git a/Source/WebKit/gtk/webkit/webkitwebviewprivate.h b/Source/WebKit/gtk/webkit/webkitwebviewprivate.h index a0f7fa677..72a8dbc05 100644 --- a/Source/WebKit/gtk/webkit/webkitwebviewprivate.h +++ b/Source/WebKit/gtk/webkit/webkitwebviewprivate.h @@ -137,6 +137,8 @@ GtkMenu* webkit_web_view_get_context_menu(WebKitWebView*); void webViewEnterFullscreen(WebKitWebView* webView, WebCore::Node*); void webViewExitFullscreen(WebKitWebView* webView); +void webkitWebViewRunFileChooserRequest(WebKitWebView*, WebKitFileChooserRequest*); + #if ENABLE(ICONDATABASE) void webkitWebViewRegisterForIconNotification(WebKitWebView*, bool shouldRegister); void webkitWebViewIconLoaded(WebKitFaviconDatabase*, const char* frameURI, WebKitWebView*); diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog index 2122e5c04..606bceb83 100644 --- a/Source/WebKit/mac/ChangeLog +++ b/Source/WebKit/mac/ChangeLog @@ -1,3 +1,169 @@ +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * DOM/WebDOMOperations.mm: + (JSC): + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics javaScriptObjectsCount]): + (+[WebCoreStatistics javaScriptGlobalObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): + (+[WebCoreStatistics javaScriptObjectTypeCounts]): + (+[WebCoreStatistics shouldPrintExceptions]): + (+[WebCoreStatistics setShouldPrintExceptions:]): + (+[WebCoreStatistics memoryStatistics]): + (+[WebCoreStatistics javaScriptReferencedObjectsCount]): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::evaluate): + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::invokeDefault): + (WebKit::NetscapePluginInstanceProxy::construct): + (WebKit::NetscapePluginInstanceProxy::getProperty): + (WebKit::NetscapePluginInstanceProxy::setProperty): + (WebKit::NetscapePluginInstanceProxy::removeProperty): + (WebKit::NetscapePluginInstanceProxy::hasMethod): + (WebKit::NetscapePluginInstanceProxy::enumerate): + (WebKit::NetscapePluginInstanceProxy::addValueToArray): + (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState): + * Plugins/WebNetscapePluginStream.mm: + (WebNetscapePluginStream::wantsAllStreams): + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView sendEvent:isDrawRect:]): + (-[WebNetscapePluginView privateBrowsingModeDidChange]): + (-[WebNetscapePluginView setWindowIfNecessary]): + (-[WebNetscapePluginView createPluginScriptableObject]): + (-[WebNetscapePluginView getFormValue:]): + (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): + (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): + (-[WebNetscapePluginView loadPluginRequest:]): + (-[WebNetscapePluginView _printedPluginBitmap]): + * Plugins/WebPluginController.mm: + (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): + (-[WebPluginController stopOnePlugin:]): + (-[WebPluginController destroyOnePlugin:]): + (-[WebPluginController startAllPlugins]): + (-[WebPluginController addPlugin:]): + * WebView/WebFrame.mm: + (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): + (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + (-[WebScriptCallFrame evaluateWebScript:]): + * WebView/WebView.mm: + (+[WebView _reportException:inContext:]): + (-[WebView aeDescByEvaluatingJavaScriptFromString:]): + (-[WebView _computedStyleIncludingVisitedInfo:forElement:]): + +2012-06-22 Alexandru Chiculita <achicu@adobe.com> + + [CSS Shaders] Re-enable the CSS Shaders compile time flag on Safari Mac + https://bugs.webkit.org/show_bug.cgi?id=89781 + + Reviewed by Dean Jackson. + + Added ENABLE_CSS_SHADERS flag as enabled by default on Safari for Mac. + + * Configurations/FeatureDefines.xcconfig: + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * DOM/WebDOMOperations.mm: + (JSC): + * Misc/WebCoreStatistics.mm: + (+[WebCoreStatistics javaScriptObjectsCount]): + (+[WebCoreStatistics javaScriptGlobalObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedGlobalObjectsCount]): + (+[WebCoreStatistics javaScriptProtectedObjectTypeCounts]): + (+[WebCoreStatistics javaScriptObjectTypeCounts]): + (+[WebCoreStatistics shouldPrintExceptions]): + (+[WebCoreStatistics setShouldPrintExceptions:]): + (+[WebCoreStatistics memoryStatistics]): + (+[WebCoreStatistics javaScriptReferencedObjectsCount]): + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::evaluate): + (WebKit::NetscapePluginInstanceProxy::invoke): + (WebKit::NetscapePluginInstanceProxy::invokeDefault): + (WebKit::NetscapePluginInstanceProxy::construct): + (WebKit::NetscapePluginInstanceProxy::getProperty): + (WebKit::NetscapePluginInstanceProxy::setProperty): + (WebKit::NetscapePluginInstanceProxy::removeProperty): + (WebKit::NetscapePluginInstanceProxy::hasMethod): + (WebKit::NetscapePluginInstanceProxy::enumerate): + (WebKit::NetscapePluginInstanceProxy::addValueToArray): + (WebKit::NetscapePluginInstanceProxy::moveGlobalExceptionToExecState): + * Plugins/WebNetscapePluginStream.mm: + (WebNetscapePluginStream::wantsAllStreams): + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView sendEvent:isDrawRect:]): + (-[WebNetscapePluginView privateBrowsingModeDidChange]): + (-[WebNetscapePluginView setWindowIfNecessary]): + (-[WebNetscapePluginView createPluginScriptableObject]): + (-[WebNetscapePluginView getFormValue:]): + (-[WebNetscapePluginView evaluateJavaScriptPluginRequest:]): + (-[WebNetscapePluginView webFrame:didFinishLoadWithReason:]): + (-[WebNetscapePluginView loadPluginRequest:]): + (-[WebNetscapePluginView _printedPluginBitmap]): + * Plugins/WebPluginController.mm: + (+[WebPluginController plugInViewWithArguments:fromPluginPackage:]): + (-[WebPluginController stopOnePlugin:]): + (-[WebPluginController destroyOnePlugin:]): + (-[WebPluginController startAllPlugins]): + (-[WebPluginController addPlugin:]): + * WebView/WebFrame.mm: + (-[WebFrame _stringByEvaluatingJavaScriptFromString:forceUserGesture:]): + (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]): + * WebView/WebScriptDebugDelegate.mm: + (-[WebScriptCallFrame scopeChain]): + (-[WebScriptCallFrame evaluateWebScript:]): + * WebView/WebView.mm: + (+[WebView _reportException:inContext:]): + (-[WebView aeDescByEvaluatingJavaScriptFromString:]): + (-[WebView _computedStyleIncludingVisitedInfo:forElement:]): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + * WebCoreSupport/WebDeviceOrientationClient.h: + (WebDeviceOrientationClient): + * WebCoreSupport/WebDeviceOrientationClient.mm: + (WebDeviceOrientationClient::lastOrientation): + * WebView/WebDeviceOrientation.mm: + * WebView/WebDeviceOrientationInternal.h: + +2012-06-20 Garret Kelly <gdk@chromium.org> + + Moving cookieEnabled/setCookieEnabled from Page to Settings. + https://bugs.webkit.org/show_bug.cgi?id=89545 + + Reviewed by Adam Barth. + + * WebView/WebView.mm: + (-[WebView _cookieEnabled]): + (-[WebView _setCookieEnabled:]): + 2012-06-19 Dan Bernstein <mitz@apple.com> WebKit/mac part of: Paginated display API doesn’t allow setting the page progression direction diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig index 0ca351439..b1b84966d 100644 --- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -41,6 +41,7 @@ ENABLE_CSS3_FLEXBOX = ENABLE_CSS3_FLEXBOX; ENABLE_CSS_BOX_DECORATION_BREAK = ENABLE_CSS_BOX_DECORATION_BREAK; ENABLE_CSS_EXCLUSIONS = ENABLE_CSS_EXCLUSIONS; ENABLE_CSS_FILTERS = ENABLE_CSS_FILTERS; +ENABLE_CSS_SHADERS = ENABLE_CSS_SHADERS; ENABLE_CSS_IMAGE_RESOLUTION = ; ENABLE_CSS_REGIONS = ENABLE_CSS_REGIONS; ENABLE_CSS_VARIABLES = ; diff --git a/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h b/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h index ed407eb80..7e49871c0 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.h @@ -46,7 +46,7 @@ public: virtual void setController(WebCore::DeviceOrientationController*) OVERRIDE; virtual void startUpdating() OVERRIDE; virtual void stopUpdating() OVERRIDE; - virtual WebCore::DeviceOrientation* lastOrientation() const OVERRIDE; + virtual WebCore::DeviceOrientationData* lastOrientation() const OVERRIDE; virtual void deviceOrientationControllerDestroyed() OVERRIDE; private: diff --git a/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm b/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm index 3a4d5d7dd..aaa031a4b 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebDeviceOrientationClient.mm @@ -55,7 +55,7 @@ void WebDeviceOrientationClient::stopUpdating() [getProvider() stopUpdating]; } -DeviceOrientation* WebDeviceOrientationClient::lastOrientation() const +DeviceOrientationData* WebDeviceOrientationClient::lastOrientation() const { return core([getProvider() lastOrientation]); } diff --git a/Source/WebKit/mac/WebView/WebDeviceOrientation.mm b/Source/WebKit/mac/WebView/WebDeviceOrientation.mm index 7be5d0ca3..db7894f9c 100644 --- a/Source/WebKit/mac/WebView/WebDeviceOrientation.mm +++ b/Source/WebKit/mac/WebView/WebDeviceOrientation.mm @@ -29,7 +29,7 @@ using namespace WebCore; @implementation WebDeviceOrientationInternal -- (id)initWithCoreDeviceOrientation:(PassRefPtr<DeviceOrientation>)coreDeviceOrientation +- (id)initWithCoreDeviceOrientation:(PassRefPtr<DeviceOrientationData>)coreDeviceOrientation { self = [super init]; if (!self) @@ -42,7 +42,7 @@ using namespace WebCore; @implementation WebDeviceOrientation (Internal) -- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation +- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientationData>)coreDeviceOrientation { self = [super init]; if (!self) @@ -55,7 +55,7 @@ using namespace WebCore; @implementation WebDeviceOrientation -DeviceOrientation* core(WebDeviceOrientation* orientation) +DeviceOrientationData* core(WebDeviceOrientation* orientation) { return orientation ? orientation->m_internal->m_orientation.get() : 0; } @@ -65,7 +65,7 @@ DeviceOrientation* core(WebDeviceOrientation* orientation) self = [super init]; if (!self) return nil; - m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientation::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)]; + m_internal = [[WebDeviceOrientationInternal alloc] initWithCoreDeviceOrientation:DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)]; return self; } diff --git a/Source/WebKit/mac/WebView/WebDeviceOrientationInternal.h b/Source/WebKit/mac/WebView/WebDeviceOrientationInternal.h index b7c6aa53b..5dedd080c 100644 --- a/Source/WebKit/mac/WebView/WebDeviceOrientationInternal.h +++ b/Source/WebKit/mac/WebView/WebDeviceOrientationInternal.h @@ -25,21 +25,21 @@ #import "WebDeviceOrientation.h" -#import <WebCore/DeviceOrientation.h> +#import <WebCore/DeviceOrientationData.h> #import <wtf/RefPtr.h> @interface WebDeviceOrientationInternal : NSObject { @public - RefPtr<WebCore::DeviceOrientation> m_orientation; + RefPtr<WebCore::DeviceOrientationData> m_orientation; } -- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation; +- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientationData>)coreDeviceOrientation; @end @interface WebDeviceOrientation (Internal) -- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientation>)coreDeviceOrientation; +- (id)initWithCoreDeviceOrientation:(PassRefPtr<WebCore::DeviceOrientationData>)coreDeviceOrientation; @end -WebCore::DeviceOrientation* core(WebDeviceOrientation*); +WebCore::DeviceOrientationData* core(WebDeviceOrientation*); diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm index 0fc8ccaa0..f7a681bc7 100644 --- a/Source/WebKit/mac/WebView/WebView.mm +++ b/Source/WebKit/mac/WebView/WebView.mm @@ -2243,14 +2243,14 @@ static inline IMP getMethod(id o, SEL s) - (BOOL)_cookieEnabled { if (_private->page) - return _private->page->cookieEnabled(); + return _private->page->settings()->cookieEnabled(); return YES; } - (void)_setCookieEnabled:(BOOL)enable { if (_private->page) - _private->page->setCookieEnabled(enable); + _private->page->settings()->setCookieEnabled(enable); } - (void)_setAdditionalWebPlugInPaths:(NSArray *)newPaths diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog index fba92dded..d8a1e5c11 100644 --- a/Source/WebKit/qt/ChangeLog +++ b/Source/WebKit/qt/ChangeLog @@ -1,3 +1,67 @@ +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * Api/qwebframe.cpp: + (QWebFramePrivate::addQtSenderToGlobalObject): + (QWebFrame::addToJavaScriptWindowObject): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::injectInternalsObject): + (DumpRenderTreeSupportQt::resetInternalsObject): + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * Api/qwebframe.cpp: + (QWebFramePrivate::addQtSenderToGlobalObject): + (QWebFrame::addToJavaScriptWindowObject): + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::injectInternalsObject): + (DumpRenderTreeSupportQt::resetInternalsObject): + +2012-06-22 Amy Ousterhout <aousterh@chromium.org> + + Renamed DeviceOrientation to DeviceOrientationData + https://bugs.webkit.org/show_bug.cgi?id=88663 + + Reviewed by Steve Block. + + Updated files to use the renamed DeviceOrientationData instead of DeviceOrientation. + This change makes DeviceOrientationData consistent with DeviceMotionData. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::setMockDeviceOrientation): + +2012-06-21 Thiago Marcos P. Santos <thiago.santos@intel.com> + + [WK2][Qt] Color chooser API missing + https://bugs.webkit.org/show_bug.cgi?id=87749 + + Reviewed by Kenneth Rohde Christiansen. + + Added ColorChooser API stub to WebKit. Otherwise + it will break the build for Qt WebKit2 (that now has + complete support for color chooser) when INPUT_TYPE_COLOR is set. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore): + (WebCore::ChromeClientQt::createColorChooser): + * WebCoreSupport/ChromeClientQt.h: + (ChromeClientQt): + 2012-06-20 Simon Hausmann <simon.hausmann@nokia.com> [Qt] Unreviewed build fix diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index c1b816c2a..b21ce9e98 100644 --- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -31,6 +31,7 @@ #include "ChromeClientQt.h" #include "ApplicationCacheStorage.h" +#include "ColorChooser.h" #include "DatabaseTracker.h" #include "Document.h" #include "FileChooser.h" @@ -557,6 +558,14 @@ void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin, emit m_webPage->applicationCacheQuotaExceeded(securityOrigin, defaultOriginQuota, static_cast<quint64>(totalSpaceNeeded)); } +#if ENABLE(INPUT_TYPE_COLOR) +PassOwnPtr<ColorChooser> ChromeClientQt::createColorChooser(ColorChooserClient*, const Color&) +{ + notImplemented(); + return nullptr; +} +#endif + void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser) { RefPtr<FileChooser> fileChooser = prpFileChooser; diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h index 6c26018bc..a7d7dc23e 100644 --- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -163,6 +163,11 @@ public: virtual bool requiresFullscreenForVideoPlayback(); FullScreenVideoQt* fullScreenVideo(); #endif + +#if ENABLE(INPUT_TYPE_COLOR) + virtual PassOwnPtr<ColorChooser> createColorChooser(ColorChooserClient*, const Color&); +#endif + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void loadIconForFiles(const Vector<String>&, FileIconLoader*); diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index a094a25b8..3814d3569 100644 --- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -33,9 +33,9 @@ #include "ContextMenu.h" #include "ContextMenuClientQt.h" #include "ContextMenuController.h" -#include "DeviceOrientation.h" #include "DeviceOrientationClientMock.h" #include "DeviceOrientationController.h" +#include "DeviceOrientationData.h" #include "DocumentLoader.h" #include "Editor.h" #include "EditorClientQt.h" @@ -769,7 +769,7 @@ void DumpRenderTreeSupportQt::setMockDeviceOrientation(QWebPage* page, bool canP #if ENABLE(DEVICE_ORIENTATION) Page* corePage = QWebPagePrivate::core(page); DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(corePage)->client()); - mockClient->setOrientation(DeviceOrientation::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); + mockClient->setOrientation(DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); #endif } diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog index bbbdb75b5..39d4d0796 100644 --- a/Source/WebKit/win/ChangeLog +++ b/Source/WebKit/win/ChangeLog @@ -1,3 +1,75 @@ +2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r121058. + http://trac.webkit.org/changeset/121058 + https://bugs.webkit.org/show_bug.cgi?id=89809 + + Patch causes plugins tests to crash in GTK debug builds + (Requested by zdobersek on #webkit). + + * WebCoreStatistics.cpp: + (WebCoreStatistics::javaScriptObjectsCount): + (WebCoreStatistics::javaScriptGlobalObjectsCount): + (WebCoreStatistics::javaScriptProtectedObjectsCount): + (WebCoreStatistics::javaScriptProtectedGlobalObjectsCount): + (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): + * WebFrame.cpp: + (WebFrame::stringByEvaluatingJavaScriptInScriptWorld): + * WebJavaScriptCollector.cpp: + (WebJavaScriptCollector::objectCount): + * WebView.cpp: + (WebView::stringByEvaluatingJavaScriptFromString): + (WebView::reportException): + (WebView::elementFromJS): + +2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com> + + JSLock should be per-JSGlobalData + https://bugs.webkit.org/show_bug.cgi?id=89123 + + Reviewed by Gavin Barraclough. + + Changed all sites that used JSLock to instead use the new JSLockHolder + and pass in the correct JS context that the code is about to interact with that + needs protection. + + * WebCoreStatistics.cpp: + (WebCoreStatistics::javaScriptObjectsCount): + (WebCoreStatistics::javaScriptGlobalObjectsCount): + (WebCoreStatistics::javaScriptProtectedObjectsCount): + (WebCoreStatistics::javaScriptProtectedGlobalObjectsCount): + (WebCoreStatistics::javaScriptProtectedObjectTypeCounts): + * WebFrame.cpp: + (WebFrame::stringByEvaluatingJavaScriptInScriptWorld): + * WebJavaScriptCollector.cpp: + (WebJavaScriptCollector::objectCount): + * WebView.cpp: + (WebView::stringByEvaluatingJavaScriptFromString): + (WebView::reportException): + (WebView::elementFromJS): + +2012-06-20 Garret Kelly <gdk@chromium.org> + + Moving cookieEnabled/setCookieEnabled from Page to Settings. + https://bugs.webkit.org/show_bug.cgi?id=89545 + + Reviewed by Adam Barth. + + * WebView.cpp: + (WebView::setCookieEnabled): + (WebView::cookieEnabled): + +2012-06-20 Julien Chaffraix <jchaffraix@webkit.org> + + Use IntSize in RenderLayer to represent scroll offsets + https://bugs.webkit.org/show_bug.cgi?id=89154 + + Reviewed by Eric Seidel. + + * WebView.cpp: + (WebView::gesture): + Updated to pass an IntSize to scrollByRecursively. + 2012-06-11 Kaustubh Atrawalkar <kaustubh@motorola.com> [DRT] LTC:: counterValueForElementById() could be moved to Internals. diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp index cc2df329b..880bc1bd0 100644 --- a/Source/WebKit/win/WebView.cpp +++ b/Source/WebKit/win/WebView.cpp @@ -1652,7 +1652,7 @@ bool WebView::gesture(WPARAM wParam, LPARAM lParam) return false; // We negate here since panning up moves the content up, but moves the scrollbar down. - m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(-deltaX, -deltaY); + m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(IntSize(-deltaX, -deltaY)); if (!(UpdatePanningFeedbackPtr() && BeginPanningFeedbackPtr() && EndPanningFeedbackPtr())) { CloseGestureInfoHandlePtr()(gestureHandle); @@ -6020,7 +6020,7 @@ HRESULT STDMETHODCALLTYPE WebView::setCookieEnabled(BOOL enable) if (!m_page) return E_FAIL; - m_page->setCookieEnabled(enable); + m_page->settings()->setCookieEnabled(enable); return S_OK; } @@ -6032,7 +6032,7 @@ HRESULT STDMETHODCALLTYPE WebView::cookieEnabled(BOOL* enabled) if (!m_page) return E_FAIL; - *enabled = m_page->cookieEnabled(); + *enabled = m_page->settings()->cookieEnabled(); return S_OK; } |
