diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebKit2/WebProcess/WebPage | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage')
11 files changed, 110 insertions, 23 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp index 141d2e603..4f176dd86 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp @@ -512,7 +512,7 @@ void CoordinatedGraphicsLayer::syncAnimatedProperties() if (!m_shouldSyncAnimatedProperties) return; - m_shouldSyncAnimatedProperties = true; + m_shouldSyncAnimatedProperties = false; if (m_effectiveOpacity != opacity()) m_CoordinatedGraphicsLayerClient->setLayerAnimatedOpacity(id(), m_effectiveOpacity); if (m_effectiveTransform != transform()) diff --git a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp index a3a572907..d02c9abb0 100644 --- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp +++ b/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp @@ -367,7 +367,7 @@ void LayerTreeCoordinator::syncFixedLayers() if (!m_webPage->corePage()->settings() || !m_webPage->corePage()->settings()->acceleratedCompositingForFixedPositionEnabled()) return; - if (!m_webPage->mainFrame()->view()->hasFixedObjects()) + if (!m_webPage->mainFrame()->view()->hasViewportConstrainedObjects()) return; RenderLayer* rootRenderLayer = m_webPage->mainFrame()->contentRenderer()->compositor()->rootRenderLayer(); diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.h b/Source/WebKit2/WebProcess/WebPage/WebFrame.h index eea09b74a..bd536372f 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebFrame.h +++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.h @@ -40,12 +40,13 @@ #include <wtf/RetainPtr.h> namespace WebCore { - class Frame; - class HTMLFrameOwnerElement; +class Frame; +class HTMLFrameOwnerElement; +class IntRect; #if ENABLE(WEB_INTENTS) - class Intent; +class Intent; #endif - class KURL; +class KURL; } namespace WebKit { diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index ecac12cf6..8e151818a 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -515,7 +515,7 @@ EditorState WebPage::editorState() const } if (selectionRoot) - result.editorRect = frame->view()->contentsToWindow(selectionRoot->getPixelSnappedRect()); + result.editorRect = frame->view()->contentsToWindow(selectionRoot->pixelSnappedBoundingBox()); RefPtr<Range> range; if (result.hasComposition && (range = frame->editor()->compositionRange())) { @@ -1310,7 +1310,7 @@ static bool isContextClick(const PlatformMouseEvent& event) static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, WebPage* page) { IntPoint point = page->corePage()->mainFrame()->view()->windowToContents(platformMouseEvent.position()); - HitTestResult result = page->corePage()->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false); + HitTestResult result = page->corePage()->mainFrame()->eventHandler()->hitTestResultAtPoint(point); Frame* frame = page->corePage()->mainFrame(); if (result.innerNonSharedNode()) @@ -1351,8 +1351,14 @@ static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, boo return handled; } - case PlatformEvent::MouseReleased: - return frame->eventHandler()->handleMouseReleaseEvent(platformMouseEvent); + case PlatformEvent::MouseReleased: { + bool handled = frame->eventHandler()->handleMouseReleaseEvent(platformMouseEvent); +#if PLATFORM(QT) + if (!handled) + handled = page->handleMouseReleaseEvent(platformMouseEvent); +#endif + return handled; + } case PlatformEvent::MouseMoved: if (onlyUpdateScrollbars) return frame->eventHandler()->passMouseMovedEventToScrollbars(platformMouseEvent); @@ -1555,14 +1561,16 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize& return; #else - HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true); + HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent); adjustedNode = result.innerNode(); #endif // Find the node to highlight. This is not the same as the node responding the tap gesture, because many // pages has a global click handler and we do not want to highlight the body. // Instead find the enclosing link or focusable element, or the last enclosing inline element. for (Node* node = adjustedNode; node; node = node->parentOrHostNode()) { - if (node->isMouseFocusable() || node->isLink()) { + if (node->isDocumentNode() || node->isFrameOwnerElement()) + break; + if (node->isMouseFocusable() || node->willRespondToMouseClickEvents()) { activationNode = node; break; } @@ -2066,6 +2074,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) #if ENABLE(SMOOTH_SCROLLING) settings->setEnableScrollAnimator(store.getBoolValueForKey(WebPreferencesKey::scrollAnimatorEnabledKey())); #endif + settings->setInteractiveFormValidationEnabled(store.getBoolValueForKey(WebPreferencesKey::interactiveFormValidationEnabledKey())); // <rdar://problem/10697417>: It is necessary to force compositing when accelerate drawing // is enabled on Mac so that scrollbars are always in their own layers. @@ -2111,7 +2120,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store) #endif settings->setShouldRespectImageOrientation(store.getBoolValueForKey(WebPreferencesKey::shouldRespectImageOrientationKey())); - settings->setThirdPartyStorageBlockingEnabled(store.getBoolValueForKey(WebPreferencesKey::thirdPartyStorageBlockingEnabledKey())); + settings->setStorageBlockingPolicy(static_cast<SecurityOrigin::StorageBlockingPolicy>(store.getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey()))); settings->setDiagnosticLoggingEnabled(store.getBoolValueForKey(WebPreferencesKey::diagnosticLoggingEnabledKey())); @@ -2722,7 +2731,7 @@ void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const Web { UNUSED_PARAM(area); Frame* mainframe = m_mainFrame->coreFrame(); - HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true); + HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping); Node* node = result.innerNode(); diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 789727ad3..a81e4003a 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -460,6 +460,10 @@ public: #endif #endif +#if PLATFORM(QT) + bool handleMouseReleaseEvent(const WebCore::PlatformMouseEvent&); +#endif + void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length); bool hasCompositionForTesting(); void confirmCompositionForTesting(const String& compositionString); @@ -577,6 +581,8 @@ public: void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; } bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; } void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; } + void setTabToLinksEnabled(bool enabled) { m_tabToLinks = enabled; } + bool tabToLinksEnabled() const { return m_tabToLinks; } bool scrollingPerformanceLoggingEnabled() const { return m_scrollingPerformanceLoggingEnabled; } void setScrollingPerformanceLoggingEnabled(bool); diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index fa570358a..0057e86ac 100644 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -62,8 +62,48 @@ static inline void scroll(Page* page, ScrollDirection direction, ScrollGranulari bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent) { - notImplemented(); - return false; + if (keyboardEvent.type() != WebEvent::KeyDown && keyboardEvent.type() != WebEvent::RawKeyDown) + return false; + + switch (keyboardEvent.windowsVirtualKeyCode()) { + case VK_BACK: + if (keyboardEvent.shiftKey()) + m_page->goForward(); + else + m_page->goBack(); + break; + case VK_SPACE: + scroll(m_page.get(), keyboardEvent.shiftKey() ? ScrollUp : ScrollDown, ScrollByPage); + break; + case VK_LEFT: + scroll(m_page.get(), ScrollLeft, ScrollByLine); + break; + case VK_RIGHT: + scroll(m_page.get(), ScrollRight, ScrollByLine); + break; + case VK_UP: + scroll(m_page.get(), ScrollUp, ScrollByLine); + break; + case VK_DOWN: + scroll(m_page.get(), ScrollDown, ScrollByLine); + break; + case VK_HOME: + scroll(m_page.get(), ScrollUp, ScrollByDocument); + break; + case VK_END: + scroll(m_page.get(), ScrollDown, ScrollByDocument); + break; + case VK_PRIOR: + scroll(m_page.get(), ScrollUp, ScrollByPage); + break; + case VK_NEXT: + scroll(m_page.get(), ScrollDown, ScrollByPage); + break; + default: + return false; + } + + return true; } bool WebPage::platformHasLocalDataForURL(const KURL&) diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp index 1b91de84f..ee483aed3 100644 --- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp +++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp @@ -114,7 +114,9 @@ void LayerTreeHostGtk::initialize() // The creation of the TextureMapper needs an active OpenGL context. context->makeContextCurrent(); + m_textureMapper = TextureMapperGL::create(); + static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true); toTextureMapperLayer(m_rootLayer.get())->setTextureMapper(m_textureMapper.get()); if (m_webPage->hasPageOverlay()) diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp index 095f77312..29f89324e 100644 --- a/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp +++ b/Source/WebKit2/WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp @@ -34,6 +34,7 @@ #include <WebCore/NotImplemented.h> #include <WebCore/PlatformContextCairo.h> #include <WebCore/PrintContext.h> +#include <WebCore/ResourceError.h> #include <gtk/gtk.h> #include <wtf/Vector.h> #include <wtf/gobject/GOwnPtr.h> diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm index 2433d770f..6c0033493 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm @@ -49,6 +49,7 @@ #import <WebCore/ScrollingThread.h> #import <WebCore/ScrollingTree.h> #import <WebCore/Settings.h> +#import <WebCore/TiledBacking.h> #import <wtf/MainThread.h> @interface CATransaction (Details) @@ -134,6 +135,14 @@ void TiledCoreAnimationDrawingArea::forceRepaint() if (m_layerTreeStateIsFrozen) return; + for (Frame* frame = m_webPage->corePage()->mainFrame(); frame; frame = frame->tree()->traverseNext()) { + FrameView* frameView = frame->view(); + if (!frameView || !frameView->tiledBacking()) + continue; + + frameView->tiledBacking()->forceRepaint(); + } + flushLayers(); [CATransaction flush]; [CATransaction synchronize]; @@ -199,6 +208,9 @@ void TiledCoreAnimationDrawingArea::setPageOverlayNeedsDisplay(const IntRect& re void TiledCoreAnimationDrawingArea::updatePreferences() { + bool scrollingPerformanceLoggingEnabled = m_webPage->scrollingPerformanceLoggingEnabled(); + ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), scrollingPerformanceLoggingEnabled)); + bool showDebugBorders = m_webPage->corePage()->settings()->showDebugBorders(); if (showDebugBorders == !!m_debugInfoLayer) @@ -212,10 +224,7 @@ void TiledCoreAnimationDrawingArea::updatePreferences() m_debugInfoLayer = nullptr; } - bool scrollingPerformanceLoggingEnabled = m_webPage->scrollingPerformanceLoggingEnabled(); - ScrollingThread::dispatch(bind(&ScrollingTree::setDebugRootLayer, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), m_debugInfoLayer)); - ScrollingThread::dispatch(bind(&ScrollingTree::setScrollingPerformanceLoggingEnabled, m_webPage->corePage()->scrollingCoordinator()->scrollingTree(), scrollingPerformanceLoggingEnabled)); } void TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition(const Function<void ()>& functionRef) diff --git a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm index c2f016537..359f35a5f 100644 --- a/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm +++ b/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm @@ -375,7 +375,7 @@ void WebPage::characterIndexForPoint(IntPoint point, uint64_t& index) if (!frame) return; - HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point, false); + HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point); frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame(); RefPtr<Range> range = frame->rangeForPoint(result.roundedPoint()); @@ -464,7 +464,7 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint) // Find the frame the point is over. IntPoint point = roundedIntPoint(floatPoint); - HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point), false); + HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point)); frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame(); IntPoint translatedPoint = frame->view()->windowToContents(point); @@ -727,7 +727,7 @@ void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event, return; #if ENABLE(DRAG_SUPPORT) - HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true); + HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent); if (hitResult.isSelected()) result = frame->eventHandler()->eventMayStartDrag(platform(event)); #endif @@ -740,7 +740,7 @@ void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& ev if (!frame) return; - HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true); + HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent); frame->eventHandler()->setActivationEventNumber(eventNumber); #if ENABLE(DRAG_SUPPORT) if (hitResult.isSelected()) diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp index 18e4f948a..e3f6034df 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp @@ -34,6 +34,8 @@ #include "WebPageProxyMessages.h" #include "WebPopupMenu.h" #include "WebProcess.h" +#include <QClipboard> +#include <QGuiApplication> #include <WebCore/DOMWrapperWorld.h> #include <WebCore/FocusController.h> #include <WebCore/Frame.h> @@ -438,4 +440,21 @@ void WebPage::hidePopupMenu() m_activePopupMenu = 0; } +bool WebPage::handleMouseReleaseEvent(const PlatformMouseEvent& platformMouseEvent) +{ +#ifndef QT_NO_CLIPBOARD + if (platformMouseEvent.button() != WebCore::MiddleButton) + return false; + + if (qApp->clipboard()->supportsSelection()) { + WebCore::Frame* focusFrame = m_page->focusController()->focusedOrMainFrame(); + if (focusFrame) { + focusFrame->editor()->command(AtomicString("PasteGlobalSelection")).execute(); + return true; + } + } +#endif + return false; +} + } // namespace WebKit |