diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-25 13:35:59 +0200 |
| commit | 79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch) | |
| tree | 0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebKit2/WebProcess/WebPage | |
| parent | 682ab87480e7757346802ce7f54cfdbdfeb2339e (diff) | |
| download | qtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz | |
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage')
13 files changed, 120 insertions, 27 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/FindController.cpp b/Source/WebKit2/WebProcess/WebPage/FindController.cpp index 7f00bc7dc..8955709ce 100644 --- a/Source/WebKit2/WebProcess/WebPage/FindController.cpp +++ b/Source/WebKit2/WebProcess/WebPage/FindController.cpp @@ -164,6 +164,7 @@ void FindController::hideFindUI() if (m_findPageOverlay) m_webPage->uninstallPageOverlay(m_findPageOverlay, false); + m_webPage->corePage()->unmarkAllTextMatches(); hideFindIndicator(); } diff --git a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp index 2f754822e..0acd3486c 100644 --- a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp +++ b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.cpp @@ -99,7 +99,7 @@ void UpdateAtlas::didSwapBuffers() m_bufferStates[i] = Available; } -PassOwnPtr<GraphicsContext> UpdateAtlas::beginPaintingOnAvailableBuffer(const WebCore::IntSize& size, IntPoint& offset) +PassOwnPtr<GraphicsContext> UpdateAtlas::beginPaintingOnAvailableBuffer(ShareableSurface::Handle& handle, const WebCore::IntSize& size, IntPoint& offset) { buildLayoutIfNeeded(); int index = findAvailableIndex(size); @@ -108,6 +108,9 @@ PassOwnPtr<GraphicsContext> UpdateAtlas::beginPaintingOnAvailableBuffer(const We if (index < 0) return PassOwnPtr<GraphicsContext>(); + if (!m_surface->createHandle(handle)) + return PassOwnPtr<WebCore::GraphicsContext>(); + // FIXME: Use tri-state buffers, to allow faster updates. m_bufferStates[index] = Taken; offset = offsetForIndex(index); diff --git a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h index 9d10962a3..74760a5b4 100644 --- a/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h +++ b/Source/WebKit2/WebProcess/WebPage/UpdateAtlas.h @@ -34,11 +34,10 @@ class UpdateAtlas { public: UpdateAtlas(int dimension, ShareableBitmap::Flags); - PassRefPtr<ShareableSurface> surface() { return m_surface; } inline WebCore::IntSize size() const { return m_surface->size(); } // Returns a null pointer of there is no available buffer. - PassOwnPtr<WebCore::GraphicsContext> beginPaintingOnAvailableBuffer(const WebCore::IntSize&, WebCore::IntPoint& offset); + PassOwnPtr<WebCore::GraphicsContext> beginPaintingOnAvailableBuffer(ShareableSurface::Handle&, const WebCore::IntSize&, WebCore::IntPoint& offset); void didSwapBuffers(); ShareableBitmap::Flags flags() const { return m_flags; } diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp index ac869fbea..db2ed4128 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp @@ -59,6 +59,12 @@ #include <WebCore/TextResourceDecoder.h> #include <wtf/text/StringBuilder.h> +#if ENABLE(WEB_INTENTS) +#include "IntentData.h" +#include <WebCore/DOMWindowIntents.h> +#include <WebCore/DeliveredIntent.h> +#endif + #if PLATFORM(MAC) || PLATFORM(WIN) #include <WebCore/LegacyWebArchive.h> #endif @@ -236,6 +242,19 @@ void WebFrame::convertHandleToDownload(ResourceHandle* handle, const ResourceReq m_policyDownloadID = 0; } +#if ENABLE(WEB_INTENTS) +void WebFrame::deliverIntent(const IntentData& intentData) +{ + OwnPtr<DeliveredIntentClient> dummyClient; + OwnPtr<MessagePortArray> dummyPorts; + Vector<uint8_t> dataCopy = intentData.data; + RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_coreFrame, dummyClient.release(), intentData.action, intentData.type, + SerializedScriptValue::adopt(dataCopy), dummyPorts.release(), + intentData.extras); + WebCore::DOMWindowIntents::from(m_coreFrame->domWindow())->deliver(deliveredIntent.release()); +} +#endif + String WebFrame::source() const { if (!m_coreFrame) diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.h b/Source/WebKit2/WebProcess/WebPage/WebFrame.h index 839b57926..bd6c038ee 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebFrame.h +++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.h @@ -52,6 +52,10 @@ class InjectedBundleRangeHandle; class InjectedBundleScriptWorld; class WebPage; +#if ENABLE(WEB_INTENTS) +struct IntentData; +#endif + class WebFrame : public APIObject { public: static const Type APIType = TypeBundleFrame; @@ -75,6 +79,10 @@ public: void startDownload(const WebCore::ResourceRequest&); void convertHandleToDownload(WebCore::ResourceHandle*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); +#if ENABLE(WEB_INTENTS) + void deliverIntent(const IntentData&); +#endif + String source() const; String contentsAsString() const; String selectionAsString() const; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index ff94102c6..953e9b046 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. + * Copyright (C) 2012 Intel Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -47,6 +48,7 @@ #include "WebBackForwardListItem.h" #include "WebBackForwardListProxy.h" #include "WebChromeClient.h" +#include "WebColorChooser.h" #include "WebContextMenu.h" #include "WebContextMenuClient.h" #include "WebContextMessages.h" @@ -124,6 +126,10 @@ #endif #endif +#if ENABLE(WEB_INTENTS) +#include "IntentData.h" +#endif + #if PLATFORM(MAC) #include "BuiltInPDFView.h" #endif @@ -206,6 +212,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) , m_tapHighlightController(this) #endif #endif +#if ENABLE(INPUT_TYPE_COLOR) + , m_activeColorChooser(0) +#endif #if ENABLE(GEOLOCATION) , m_geolocationPermissionRequestManager(this) #endif @@ -631,6 +640,13 @@ void WebPage::close() m_activeOpenPanelResultListener = 0; } +#if ENABLE(INPUT_TYPE_COLOR) + if (m_activeColorChooser) { + m_activeColorChooser->disconnectFromPage(); + m_activeColorChooser = 0; + } +#endif + m_sandboxExtensionTracker.invalidate(); m_underlayPage = nullptr; @@ -1423,9 +1439,7 @@ void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent) if (!handled) handled = performDefaultBehaviorForKeyEvent(keyboardEvent); - // The receiving end relies on DidReceiveEvent and InterpretQueuedKeyEvent arriving in the same order they are sent - // (for keyboard events.) We set the DispatchMessageEvenWhenWaitingForSyncReply flag to ensure consistent ordering. - connection()->send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled), m_pageID, CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply); + sendSync(Messages::WebPageProxy::DidReceiveKeyEvent(static_cast<uint32_t>(keyboardEvent.type()), handled), Messages::WebPageProxy::DidReceiveKeyEvent::Reply()); } void WebPage::keyEventSyncForTesting(const WebKeyboardEvent& keyboardEvent, bool& handled) @@ -1914,6 +1928,17 @@ void WebPage::forceRepaint(uint64_t callbackID) send(Messages::WebPageProxy::VoidCallback(callbackID)); } +#if ENABLE(WEB_INTENTS) +void WebPage::deliverIntentToFrame(uint64_t frameID, const IntentData& intentData) +{ + WebFrame* frame = WebProcess::shared().webFrame(frameID); + if (!frame) + return; + + frame->deliverIntent(intentData); +} +#endif + void WebPage::preferencesDidChange(const WebPreferencesStore& store) { WebPreferencesStore::removeTestRunnerOverrides(); @@ -2315,6 +2340,23 @@ void WebPage::setActivePopupMenu(WebPopupMenu* menu) m_activePopupMenu = menu; } +#if ENABLE(INPUT_TYPE_COLOR) +void WebPage::setActiveColorChooser(WebColorChooser* colorChooser) +{ + m_activeColorChooser = colorChooser; +} + +void WebPage::didEndColorChooser() +{ + m_activeColorChooser->didEndChooser(); +} + +void WebPage::didChooseColor(const WebCore::Color& color) +{ + m_activeColorChooser->didChooseColor(color); +} +#endif + void WebPage::setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener> openPanelResultListener) { m_activeOpenPanelResultListener = openPanelResultListener; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h index 32d433212..1a13b6ce7 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.h +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h @@ -123,6 +123,7 @@ class NotificationPermissionRequestManager; class PageOverlay; class PluginView; class SessionState; +class WebColorChooser; class WebContextMenu; class WebContextMenuItemData; class WebEvent; @@ -143,6 +144,10 @@ struct PrintInfo; struct WebPageCreationParameters; struct WebPreferencesStore; +#if ENABLE(WEB_INTENTS) +struct IntentData; +#endif + #if ENABLE(GESTURE_EVENTS) class WebGestureEvent; #endif @@ -214,7 +219,14 @@ public: bool isInRedo() const { return m_isInRedo; } void setActivePopupMenu(WebPopupMenu*); - + +#if ENABLE(INPUT_TYPE_COLOR) + WebColorChooser* activeColorChooser() const { return m_activeColorChooser; } + void setActiveColorChooser(WebColorChooser*); + void didChooseColor(const WebCore::Color&); + void didEndColorChooser(); +#endif + WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); } void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>); @@ -635,6 +647,10 @@ private: void runJavaScriptInMainFrame(const String&, uint64_t callbackID); void forceRepaint(uint64_t callbackID); +#if ENABLE(WEB_INTENTS) + void deliverIntentToFrame(uint64_t frameID, const IntentData&); +#endif + void preferencesDidChange(const WebPreferencesStore&); void platformPreferencesDidChange(const WebPreferencesStore&); void updatePreferences(const WebPreferencesStore&); @@ -808,6 +824,9 @@ private: #if ENABLE(CONTEXT_MENUS) RefPtr<WebContextMenu> m_contextMenu; #endif +#if ENABLE(INPUT_TYPE_COLOR) + WebColorChooser* m_activeColorChooser; +#endif RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener; RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager; diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in index 7a7f4ebf5..38f36c2bf 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in @@ -45,6 +45,11 @@ messages -> WebPage { HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area) #endif +#if ENABLE(INPUT_TYPE_COLOR) + DidEndColorChooser(); + DidChooseColor(WebCore::Color color); +#endif + #if ENABLE(CONTEXT_MENUS) ContextMenuHidden() #endif @@ -220,6 +225,11 @@ messages -> WebPage { SetCanRunBeforeUnloadConfirmPanel(bool canRunBeforeUnloadConfirmPanel) SetCanRunModal(bool canRunModal) + # Web Intents +#if ENABLE(WEB_INTENTS) + DeliverIntentToFrame(uint64_t frameID, WebKit::IntentData intentData); +#endif + #if PLATFORM(QT) SetComposition(WTF::String text, WTF::Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd) ConfirmComposition(WTF::String text, int64_t selectionStart, int64_t selectionLength) diff --git a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp index 669442014..df0f17f87 100644 --- a/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp +++ b/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp @@ -31,6 +31,7 @@ #include "NotImplemented.h" #include "WebEvent.h" #include "WindowsKeyboardCodes.h" +#include <WebCore/EflKeyboardUtilities.h> #include <WebCore/FocusController.h> #include <WebCore/Frame.h> #include <WebCore/KeyboardEvent.h> @@ -93,10 +94,14 @@ PassRefPtr<SharedBuffer> WebPage::cachedResponseDataForURL(const KURL&) return 0; } -const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt) +const char* WebPage::interpretKeyEvent(const KeyboardEvent* event) { - notImplemented(); - return 0; + ASSERT(event->type() == eventNames().keydownEvent || event->type() == eventNames().keypressEvent); + + if (event->type() == eventNames().keydownEvent) + return getKeyDownCommandName(event); + + return getKeyPressCommandName(event); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp index 5b8eb3ed5..c42866feb 100644 --- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp +++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp @@ -262,11 +262,6 @@ bool LayerTreeHostGtk::showRepaintCounter(const GraphicsLayer*) const return m_webPage->corePage()->settings()->showRepaintCounter(); } -float LayerTreeHostGtk::deviceScaleFactor() const -{ - return m_webPage->corePage()->deviceScaleFactor(); -} - gboolean LayerTreeHostGtk::layerFlushTimerFiredCallback(LayerTreeHostGtk* layerTreeHost) { layerTreeHost->layerFlushTimerFired(); diff --git a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h index fd9ae0d3e..b454925cb 100644 --- a/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h +++ b/Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.h @@ -77,7 +77,6 @@ private: virtual void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, WebCore::GraphicsLayerPaintingPhase, const WebCore::IntRect& clipRect); virtual bool showDebugBorders(const WebCore::GraphicsLayer*) const; virtual bool showRepaintCounter(const WebCore::GraphicsLayer*) const; - virtual float deviceScaleFactor() const; virtual void didCommitChangesForLayer(const WebCore::GraphicsLayer*) const { } void createPageOverlayLayer(); diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp index 0114cf416..1fa91ac3f 100644 --- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp +++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp @@ -297,7 +297,7 @@ static void updateOffsetFromViewportForSelf(RenderLayer* renderLayer) if (!style) return; - if (!renderLayer->renderer()->isPositioned() || renderLayer->renderer()->style()->position() != FixedPosition) + if (!renderLayer->renderer()->isOutOfFlowPositioned() || renderLayer->renderer()->style()->position() != FixedPosition) return; if (!renderLayer->renderer()->container()->isRenderView()) @@ -552,13 +552,6 @@ void LayerTreeHostQt::purgeBackingStores() m_updateAtlases.clear(); } -static PassOwnPtr<WebCore::GraphicsContext> beginContentUpdateInAtlas(UpdateAtlas& atlas, const WebCore::IntSize& size, ShareableSurface::Handle& handle, WebCore::IntPoint& offset) -{ - if (!atlas.surface()->createHandle(handle)) - return PassOwnPtr<WebCore::GraphicsContext>(); - return atlas.beginPaintingOnAvailableBuffer(size, offset); -} - PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const WebCore::IntSize& size, ShareableBitmap::Flags flags, ShareableSurface::Handle& handle, WebCore::IntPoint& offset) { OwnPtr<WebCore::GraphicsContext> graphicsContext; @@ -566,7 +559,7 @@ PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const W UpdateAtlas& atlas = m_updateAtlases[i]; if (atlas.flags() == flags) { // This will return null if there is no available buffer space. - graphicsContext = beginContentUpdateInAtlas(atlas, size, handle, offset); + graphicsContext = atlas.beginPaintingOnAvailableBuffer(handle, size, offset); if (graphicsContext) return graphicsContext.release(); } @@ -574,7 +567,7 @@ PassOwnPtr<WebCore::GraphicsContext> LayerTreeHostQt::beginContentUpdate(const W static const int ScratchBufferDimension = 2000; m_updateAtlases.append(UpdateAtlas(ScratchBufferDimension, flags)); - return beginContentUpdateInAtlas(m_updateAtlases.last(), size, handle, offset); + return m_updateAtlases.last().beginPaintingOnAvailableBuffer(handle, size, offset); } } // namespace WebKit diff --git a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp index 19f760f6a..6294f00d8 100644 --- a/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp +++ b/Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp @@ -447,7 +447,7 @@ void WebPage::gestureDidScroll(const IntSize& size) verticalScrollbar = view->verticalScrollbar(); } - m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(size.width(), size.height()); + m_gestureTargetNode->renderer()->enclosingLayer()->scrollByRecursively(size); bool gestureReachedScrollingLimit = verticalScrollbar && scrollbarAtTopOrBottomOfDocument(verticalScrollbar); // FIXME: We really only want to update this state if the state was updated via scrolling the main frame, |
