summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:56:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:57:30 +0200
commitb297e0fa5c217c9467033b7c8b46891a52870120 (patch)
tree43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/WebKit/chromium/src
parent69d517dbfa69903d8593cc1737f0474b21e3251e (diff)
downloadqtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/WebKit/chromium/src')
-rw-r--r--Source/WebKit/chromium/src/ApplicationCacheHost.cpp8
-rw-r--r--Source/WebKit/chromium/src/AssertMatchingEnums.cpp21
-rw-r--r--Source/WebKit/chromium/src/AssociatedURLLoader.h2
-rw-r--r--Source/WebKit/chromium/src/AsyncFileWriterChromium.cpp2
-rw-r--r--Source/WebKit/chromium/src/AudioDestinationChromium.cpp5
-rw-r--r--Source/WebKit/chromium/src/AudioDestinationChromium.h4
-rw-r--r--Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp4
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp9
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.h4
-rw-r--r--Source/WebKit/chromium/src/ColorChooserUIController.cpp61
-rw-r--r--Source/WebKit/chromium/src/ColorChooserUIController.h3
-rw-r--r--Source/WebKit/chromium/src/CompositionUnderlineBuilder.h4
-rw-r--r--Source/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h4
-rw-r--r--Source/WebKit/chromium/src/ContextMenuClientImpl.cpp12
-rw-r--r--Source/WebKit/chromium/src/DateTimeChooserImpl.cpp37
-rw-r--r--Source/WebKit/chromium/src/DateTimeChooserImpl.h2
-rw-r--r--Source/WebKit/chromium/src/DeliveredIntentClientImpl.h2
-rw-r--r--Source/WebKit/chromium/src/DragClientImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/DragScrollTimer.h2
-rw-r--r--Source/WebKit/chromium/src/ExternalPopupMenu.cpp2
-rw-r--r--Source/WebKit/chromium/src/FindInPageCoordinates.cpp2
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp22
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.h5
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h2
-rwxr-xr-xSource/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp11
-rw-r--r--Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h1
-rw-r--r--Source/WebKit/chromium/src/InspectorClientImpl.cpp12
-rw-r--r--Source/WebKit/chromium/src/InspectorClientImpl.h4
-rw-r--r--Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/LinkHighlight.cpp110
-rw-r--r--Source/WebKit/chromium/src/LinkHighlight.h3
-rw-r--r--Source/WebKit/chromium/src/LocalizedStrings.cpp28
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp7
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.h2
-rw-r--r--Source/WebKit/chromium/src/NotificationPresenterImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/PageOverlay.cpp2
-rw-r--r--Source/WebKit/chromium/src/PageWidgetDelegate.cpp4
-rw-r--r--Source/WebKit/chromium/src/PageWidgetDelegate.h2
-rw-r--r--Source/WebKit/chromium/src/PlatformSupport.cpp133
-rw-r--r--Source/WebKit/chromium/src/SocketStreamHandle.cpp15
-rw-r--r--Source/WebKit/chromium/src/SocketStreamHandleInternal.h4
-rw-r--r--Source/WebKit/chromium/src/SpeechInputClientImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp15
-rw-r--r--Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h3
-rw-r--r--Source/WebKit/chromium/src/StorageAreaProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/StorageNamespaceProxy.cpp4
-rw-r--r--Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp16
-rw-r--r--Source/WebKit/chromium/src/TextFieldDecoratorImpl.h2
-rw-r--r--Source/WebKit/chromium/src/UserMediaClientImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebAccessibilityObject.cpp8
-rw-r--r--Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebCommon.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h3
-rw-r--r--Source/WebKit/chromium/src/WebDOMMessageEvent.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebDOMStringList.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebDataSourceImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebDatabase.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp121
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentImpl.h7
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsAgentPrivate.h2
-rw-r--r--Source/WebKit/chromium/src/WebDocument.cpp17
-rw-r--r--Source/WebKit/chromium/src/WebDocumentType.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebDragData.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebElement.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebEntities.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h7
-rw-r--r--Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebFontImpl.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebFormElement.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp833
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.h41
-rw-r--r--Source/WebKit/chromium/src/WebGeolocationClientMock.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebGeolocationError.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebGeolocationPermissionRequestManager.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebHistoryItem.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebHitTestResult.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebIDBKeyPath.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebIDBMetadata.cpp14
-rwxr-xr-xSource/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebIDBTransactionImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebImageDecoder.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebImageSkia.cpp8
-rw-r--r--Source/WebKit/chromium/src/WebInputElement.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebInputEventConversion.cpp91
-rw-r--r--Source/WebKit/chromium/src/WebInputEventConversion.h14
-rw-r--r--Source/WebKit/chromium/src/WebIntent.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebKit.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebLabelElement.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebMediaStreamRegistry.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebNode.cpp13
-rw-r--r--Source/WebKit/chromium/src/WebNotification.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebOptionElement.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.cpp21
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebPageSerializer.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebPageSerializerImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebPageSerializerImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.cpp52
-rw-r--r--Source/WebKit/chromium/src/WebPluginContainerImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebPluginListBuilderImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPluginLoadObserver.h2
-rw-r--r--Source/WebKit/chromium/src/WebPopupMenuImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebPopupMenuImpl.h4
-rw-r--r--Source/WebKit/chromium/src/WebRange.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebRegularExpression.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebScriptController.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebSecurityOrigin.cpp9
-rw-r--r--Source/WebKit/chromium/src/WebSecurityPolicy.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebSelectElement.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebSerializedScriptValue.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp6
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.cpp20
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.h5
-rw-r--r--Source/WebKit/chromium/src/WebSocketImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebSocketImpl.h2
-rw-r--r--Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebSurroundingText.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebURLLoadTiming.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebUserMediaRequest.cpp22
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp400
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h12
-rw-r--r--Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp2
-rw-r--r--Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp4
-rw-r--r--Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h2
-rw-r--r--Source/WebKit/chromium/src/js/DevTools.js1
-rw-r--r--Source/WebKit/chromium/src/js/Tests.js84
-rw-r--r--Source/WebKit/chromium/src/mac/WebInputEventFactory.mm3
-rw-r--r--Source/WebKit/chromium/src/painting/PaintAggregator.cpp5
136 files changed, 1204 insertions, 1434 deletions
diff --git a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
index a8f398eb5..2b6a47707 100644
--- a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
+++ b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp
@@ -44,10 +44,10 @@
#include "WebFrameImpl.h"
#include "WrappedResourceRequest.h"
#include "WrappedResourceResponse.h"
-#include <public/WebURL.h>
-#include <public/WebURLError.h>
-#include <public/WebURLResponse.h>
-#include <public/WebVector.h>
+#include "platform/WebURL.h"
+#include "platform/WebURLError.h"
+#include "platform/WebURLResponse.h"
+#include "platform/WebVector.h"
using namespace WebKit;
diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
index d2461a9b4..c6bf971f1 100644
--- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -124,6 +124,11 @@
#include <wtf/Assertions.h>
#include <wtf/text/StringImpl.h>
+#if OS(DARWIN)
+#include "PlatformSupport.h"
+#include <public/mac/WebThemeEngine.h>
+#endif
+
#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
COMPILE_ASSERT(int(WebKit::webkit_name) == int(WebCore::webcore_name), mismatching_enums)
@@ -543,6 +548,22 @@ COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR
COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR);
#endif
+#if OS(DARWIN)
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateDisabled, PlatformSupport::StateDisabled);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateInactive, PlatformSupport::StateInactive);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateActive, PlatformSupport::StateActive);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StatePressed, PlatformSupport::StatePressed);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::SizeRegular, PlatformSupport::SizeRegular);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::SizeSmall, PlatformSupport::SizeSmall);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::ScrollbarOrientationHorizontal, PlatformSupport::ScrollbarOrientationHorizontal);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::ScrollbarOrientationVertical, PlatformSupport::ScrollbarOrientationVertical);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::ScrollbarParentScrollView, PlatformSupport::ScrollbarParentScrollView);
+COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::ScrollbarParentRenderLayer, PlatformSupport::ScrollbarParentRenderLayer);
+#endif
+
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateVisible, PageVisibilityStateVisible);
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateHidden, PageVisibilityStateHidden);
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStatePrerender, PageVisibilityStatePrerender);
diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h
index d202b1861..2851f3f82 100644
--- a/Source/WebKit/chromium/src/AssociatedURLLoader.h
+++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h
@@ -32,7 +32,7 @@
#define AssociatedURLLoader_h
#include "WebURLLoaderOptions.h"
-#include <public/WebURLLoader.h>
+#include "platform/WebURLLoader.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/Source/WebKit/chromium/src/AsyncFileWriterChromium.cpp
index f9e492b9a..6071a0ae6 100644
--- a/Source/WebKit/chromium/src/AsyncFileWriterChromium.cpp
+++ b/Source/WebKit/chromium/src/AsyncFileWriterChromium.cpp
@@ -36,7 +36,7 @@
#include "AsyncFileWriterClient.h"
#include "Blob.h"
#include "WebFileWriter.h"
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
namespace WebCore {
diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
index 12dbba742..380c74b85 100644
--- a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
+++ b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp
@@ -29,9 +29,14 @@
#include "config.h"
#if ENABLE(WEB_AUDIO)
+
#include "AudioDestinationChromium.h"
+
#include "AudioFIFO.h"
#include "AudioPullFIFO.h"
+#include "WebKit.h"
+#include "platform/WebKitPlatformSupport.h"
+
#include <public/Platform.h>
using namespace WebKit;
diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.h b/Source/WebKit/chromium/src/AudioDestinationChromium.h
index 7b148c464..7d261a7fa 100644
--- a/Source/WebKit/chromium/src/AudioDestinationChromium.h
+++ b/Source/WebKit/chromium/src/AudioDestinationChromium.h
@@ -33,8 +33,8 @@
#include "AudioDestination.h"
#include "AudioIOCallback.h"
#include "AudioSourceProvider.h"
-#include <public/WebAudioDevice.h>
-#include <public/WebVector.h>
+#include "platform/WebAudioDevice.h"
+#include "platform/WebVector.h"
namespace WebKit { class WebAudioDevice; }
diff --git a/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp b/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp
index 66cb82bd5..4e643029a 100644
--- a/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp
+++ b/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp
@@ -44,8 +44,8 @@
#include "WebNode.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/WebString.h>
-#include <public/WebVector.h>
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index 65810b90c..985757783 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -63,6 +63,7 @@
#include "Page.h"
#include "PagePopupDriver.h"
#include "PlatformScreen.h"
+#include "PlatformSupport.h"
#include "PopupContainer.h"
#include "PopupMenuChromium.h"
#include "RenderWidget.h"
@@ -89,16 +90,16 @@
#include "WebPopupMenuImpl.h"
#include "WebPopupMenuInfo.h"
#include "WebPopupType.h"
+#include "platform/WebRect.h"
#include "WebSettings.h"
#include "WebTextDirection.h"
+#include "platform/WebURLRequest.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
#include "WebWindowFeatures.h"
#include "WindowFeatures.h"
#include "WrappedResourceRequest.h"
#include <public/Platform.h>
-#include <public/WebRect.h>
-#include <public/WebURLRequest.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenate.h>
@@ -917,7 +918,7 @@ void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* grap
m_webView->setRootGraphicsLayer(graphicsLayer);
}
-void ChromeClientImpl::scheduleCompositingLayerFlush()
+void ChromeClientImpl::scheduleCompositingLayerSync()
{
m_webView->scheduleCompositingLayerSync();
}
@@ -1120,7 +1121,7 @@ bool ChromeClientImpl::isPointerLocked()
#endif
#if ENABLE(WIDGET_REGION)
-void ChromeClientImpl::annotatedRegionsChanged()
+void ChromeClientImpl::dashboardRegionsChanged()
{
WebViewClient* client = m_webView->client();
if (client)
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h
index f996831f6..7d456fbf5 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.h
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.h
@@ -139,7 +139,7 @@ public:
virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
#if ENABLE(WIDGET_REGION)
- virtual void annotatedRegionsChanged();
+ virtual void dashboardRegionsChanged();
#endif
virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
#if ENABLE(INPUT_TYPE_COLOR)
@@ -171,7 +171,7 @@ public:
// Sets a flag to specify that the view needs to be updated, so we need
// to do an eager layout before the drawing.
- virtual void scheduleCompositingLayerFlush();
+ virtual void scheduleCompositingLayerSync();
virtual CompositingTriggerFlags allowedCompositingTriggers() const;
#endif
diff --git a/Source/WebKit/chromium/src/ColorChooserUIController.cpp b/Source/WebKit/chromium/src/ColorChooserUIController.cpp
index 330f59ce2..c77634cff 100644
--- a/Source/WebKit/chromium/src/ColorChooserUIController.cpp
+++ b/Source/WebKit/chromium/src/ColorChooserUIController.cpp
@@ -32,18 +32,14 @@
#include "Color.h"
#include "ColorChooserClient.h"
#include "ColorSuggestionPicker.h"
-#include "FrameView.h"
#include "IntRect.h"
#include "LocalizedStrings.h"
#include "PickerCommon.h"
#include "WebColorChooser.h"
-#include "WebViewImpl.h"
-#include <public/Platform.h>
-#include <public/WebColor.h>
+#include "platform/WebColor.h"
+#include "platform/WebKitPlatformSupport.h"
#include <public/WebLocalizedString.h>
-using namespace WebCore;
-
namespace WebKit {
// Keep in sync with Actions in colorSuggestionPicker.js.
@@ -53,11 +49,10 @@ enum ColorPickerPopupAction {
ColorPickerPopupActionSetValue = 0
};
-ColorChooserUIController::ColorChooserUIController(ChromeClientImpl* chromeClient, ColorChooserClient* client)
+ColorChooserUIController::ColorChooserUIController(ChromeClientImpl* chromeClient, WebCore::ColorChooserClient* client)
: m_chromeClient(chromeClient)
, m_client(client)
, m_popup(0)
- , m_localizer(Localizer::createDefault())
{
if (m_client->shouldShowSuggestions())
openPopup();
@@ -69,7 +64,7 @@ ColorChooserUIController::~ColorChooserUIController()
{
}
-void ColorChooserUIController::setSelectedColor(const Color& color)
+void ColorChooserUIController::setSelectedColor(const WebCore::Color& color)
{
ASSERT(m_chooser);
m_chooser->setSelectedColor(static_cast<WebColor>(color.rgb()));
@@ -86,7 +81,7 @@ void ColorChooserUIController::endChooser()
void ColorChooserUIController::didChooseColor(const WebColor& color)
{
ASSERT(m_client);
- m_client->didChooseColor(Color(static_cast<RGBA32>(color)));
+ m_client->didChooseColor(WebCore::Color(static_cast<WebCore::RGBA32>(color)));
}
void ColorChooserUIController::didEndChooser()
@@ -96,45 +91,29 @@ void ColorChooserUIController::didEndChooser()
m_client->didEndChooser();
}
-IntSize ColorChooserUIController::contentSize()
+WebCore::IntSize ColorChooserUIController::contentSize()
{
- return IntSize(0, 0);
+ return WebCore::IntSize(0, 0);
}
-void ColorChooserUIController::writeDocument(DocumentWriter& writer)
+void ColorChooserUIController::writeDocument(WebCore::DocumentWriter& writer)
{
- Vector<Color> suggestions = m_client->suggestions();
+ Vector<WebCore::Color> suggestions = m_client->suggestions();
Vector<String> suggestionValues;
for (unsigned i = 0; i < suggestions.size(); i++)
suggestionValues.append(suggestions[i].serialized());
- IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_client->elementRectRelativeToRootView());
- FrameView* view = static_cast<WebViewImpl*>(m_chromeClient->webView())->page()->mainFrame()->view();
- IntRect rootViewVisibleContentRect = view->visibleContentRect(true /* include scrollbars */);
- IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect);
- PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
- writer.addData(pickerCommonCss, sizeof(pickerCommonCss));
- writer.addData(colorSuggestionPickerCss, sizeof(colorSuggestionPickerCss));
- PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n"
+ WebCore::PagePopupClient::addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
+ writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
+ writer.addData(WebCore::colorSuggestionPickerCss, sizeof(WebCore::colorSuggestionPickerCss));
+ WebCore::PagePopupClient::addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", writer);
- PagePopupClient::addProperty("values", suggestionValues, writer);
- PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherColorLabel), writer);
- addProperty("anchorRectInScreen", anchorRectInScreen, writer);
- addProperty("rootViewRectInScreen", rootViewRectInScreen, writer);
-#if OS(MAC_OS_X)
- addProperty("confineToRootView", true, writer);
-#else
- addProperty("confineToRootView", false, writer);
-#endif
- PagePopupClient::addString("};\n", writer);
- writer.addData(pickerCommonJs, sizeof(pickerCommonJs));
- writer.addData(colorSuggestionPickerJs, sizeof(colorSuggestionPickerJs));
- PagePopupClient::addString("</script></body>\n", writer);
-}
-
-Localizer& ColorChooserUIController::localizer()
-{
- return *m_localizer;
+ WebCore::PagePopupClient::addProperty("values", suggestionValues, writer);
+ WebCore::PagePopupClient::addProperty("otherColorLabel", Platform::current()->queryLocalizedString(WebLocalizedString::OtherColorLabel), writer);
+ WebCore::PagePopupClient::addString("};\n", writer);
+ writer.addData(WebCore::pickerCommonJs, sizeof(WebCore::pickerCommonJs));
+ writer.addData(WebCore::colorSuggestionPickerJs, sizeof(WebCore::colorSuggestionPickerJs));
+ WebCore::PagePopupClient::addString("</script></body>\n", writer);
}
void ColorChooserUIController::setValueAndClosePopup(int numValue, const String& stringValue)
@@ -142,7 +121,7 @@ void ColorChooserUIController::setValueAndClosePopup(int numValue, const String&
ASSERT(m_popup);
ASSERT(m_client);
if (numValue == ColorPickerPopupActionSetValue)
- m_client->didChooseColor(Color(stringValue));
+ m_client->didChooseColor(WebCore::Color(stringValue));
if (numValue == ColorPickerPopupActionChooseOtherColor)
openColorChooser();
closePopup();
diff --git a/Source/WebKit/chromium/src/ColorChooserUIController.h b/Source/WebKit/chromium/src/ColorChooserUIController.h
index 40c878b8e..98adb6714 100644
--- a/Source/WebKit/chromium/src/ColorChooserUIController.h
+++ b/Source/WebKit/chromium/src/ColorChooserUIController.h
@@ -29,7 +29,6 @@
#if ENABLE(INPUT_TYPE_COLOR)
#include "ColorChooser.h"
-#include "Localizer.h"
#include "PagePopupClient.h"
#include "WebColorChooserClient.h"
#include <wtf/OwnPtr.h>
@@ -61,7 +60,6 @@ public:
// PagePopupClient functions:
virtual WebCore::IntSize contentSize() OVERRIDE;
virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE;
- virtual WebCore::Localizer& localizer() OVERRIDE;
virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
virtual void didClosePopup() OVERRIDE;
@@ -74,7 +72,6 @@ private:
WebCore::ColorChooserClient* m_client;
OwnPtr<WebColorChooser> m_chooser;
WebCore::PagePopup* m_popup;
- OwnPtr<WebCore::Localizer> m_localizer;
};
}
diff --git a/Source/WebKit/chromium/src/CompositionUnderlineBuilder.h b/Source/WebKit/chromium/src/CompositionUnderlineBuilder.h
index 636e81076..73e07cb55 100644
--- a/Source/WebKit/chromium/src/CompositionUnderlineBuilder.h
+++ b/Source/WebKit/chromium/src/CompositionUnderlineBuilder.h
@@ -32,9 +32,9 @@
#define CompositionUnderlineBuilder_h
#include "Editor.h"
-#include "WebCompositionUnderline.h"
-#include <public/WebVector.h>
#include <wtf/Vector.h>
+#include "WebCompositionUnderline.h"
+#include "platform/WebVector.h"
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h b/Source/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h
index 5d4f08289..b12b92cc6 100644
--- a/Source/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h
+++ b/Source/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h
@@ -32,9 +32,9 @@
#define CompositionUnderlineVectorBuilder_h
#include "Editor.h"
-#include "WebCompositionUnderline.h"
-#include <public/WebVector.h>
#include <wtf/Vector.h>
+#include "WebCompositionUnderline.h"
+#include "platform/WebVector.h"
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index ad116090c..641a585a0 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -47,6 +47,7 @@
#include "HTMLMediaElement.h"
#include "HTMLNames.h"
#include "HTMLPlugInImageElement.h"
+
#include "HistoryItem.h"
#include "HitTestResult.h"
#include "KURL.h"
@@ -56,6 +57,7 @@
#include "Settings.h"
#include "TextBreakIterator.h"
#include "Widget.h"
+
#include "WebContextMenuData.h"
#include "WebDataSourceImpl.h"
#include "WebFormElement.h"
@@ -63,15 +65,15 @@
#include "WebMenuItemInfo.h"
#include "WebPlugin.h"
#include "WebPluginContainerImpl.h"
+#include "platform/WebPoint.h"
#include "WebSearchableFormData.h"
#include "WebSpellCheckClient.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
+#include "platform/WebURLResponse.h"
+#include "platform/WebVector.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/WebPoint.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
-#include <public/WebURLResponse.h>
-#include <public/WebVector.h>
#include <wtf/text/WTFString.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
index 20044add8..4e2c69e9f 100644
--- a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
+++ b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
@@ -37,18 +37,16 @@
#include "ChromeClientImpl.h"
#include "DateComponents.h"
#include "DateTimeChooserClient.h"
-#include "FrameView.h"
#include "InputTypeNames.h"
#include "Language.h"
-#include "Localizer.h"
+#include "LocalizedDate.h"
#include "NotImplemented.h"
#include "PickerCommon.h"
#include "RenderTheme.h"
-#include "WebViewImpl.h"
-#include <public/Platform.h>
+#include "platform/WebKitPlatformSupport.h"
#include <public/WebLocalizedString.h>
-using namespace WebCore;
+using namespace WTF::Unicode;
namespace WebKit {
@@ -57,7 +55,6 @@ DateTimeChooserImpl::DateTimeChooserImpl(ChromeClientImpl* chromeClient, WebCore
, m_client(client)
, m_popup(0)
, m_parameters(parameters)
- , m_localizer(WebCore::Localizer::createDefault())
{
ASSERT(m_chromeClient);
ASSERT(m_client);
@@ -88,11 +85,6 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
date.setMillisecondsSinceEpochForDate(m_parameters.maximum);
String maxString = date.toString();
String stepString = String::number(m_parameters.step);
- String stepBaseString = String::number(m_parameters.stepBase, 11, WTF::TruncateTrailingZeros);
- IntRect anchorRectInScreen = m_chromeClient->rootViewToScreen(m_parameters.anchorRectInRootView);
- FrameView* view = static_cast<WebViewImpl*>(m_chromeClient->webView())->page()->mainFrame()->view();
- IntRect rootViewVisibleContentRect = view->visibleContentRect(true /* include scrollbars */);
- IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect);
addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
@@ -103,27 +95,19 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
writer.addData(extraStyle.data(), extraStyle.length());
addString("</style></head><body><div id=main>Loading...</div><script>\n"
"window.dialogArguments = {\n", writer);
- addProperty("anchorRectInScreen", anchorRectInScreen, writer);
- addProperty("rootViewRectInScreen", rootViewRectInScreen, writer);
-#if OS(MAC_OS_X)
- addProperty("confineToRootView", true, writer);
-#else
- addProperty("confineToRootView", false, writer);
-#endif
addProperty("min", minString, writer);
addProperty("max", maxString, writer);
addProperty("step", stepString, writer);
- addProperty("stepBase", stepBaseString, writer);
addProperty("required", m_parameters.required, writer);
addProperty("currentValue", m_parameters.currentValue, writer);
addProperty("locale", WebCore::defaultLanguage(), writer);
addProperty("todayLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday), writer);
addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer);
- addProperty("weekStartDay", m_localizer->firstDayOfWeek(), writer);
- addProperty("monthLabels", m_localizer->monthLabels(), writer);
- addProperty("dayLabels", m_localizer->weekDayShortLabels(), writer);
- addProperty("isCalendarRTL", m_localizer->isRTL(), writer);
- addProperty("isRTL", m_parameters.isAnchorElementRTL, writer);
+ addProperty("weekStartDay", WebCore::firstDayOfWeek(), writer);
+ addProperty("monthLabels", WebCore::monthLabels(), writer);
+ addProperty("dayLabels", WebCore::weekDayShortLabels(), writer);
+ Direction dir = direction(WebCore::monthLabels()[0][0]);
+ addProperty("isRTL", dir == RightToLeft || dir == RightToLeftArabic, writer);
if (m_parameters.suggestionValues.size()) {
addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
addProperty("suggestionValues", m_parameters.suggestionValues, writer);
@@ -142,11 +126,6 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
addString("</script></body>\n", writer);
}
-WebCore::Localizer& DateTimeChooserImpl::localizer()
-{
- return *m_localizer;
-}
-
void DateTimeChooserImpl::setValueAndClosePopup(int numValue, const String& stringValue)
{
if (numValue >= 0)
diff --git a/Source/WebKit/chromium/src/DateTimeChooserImpl.h b/Source/WebKit/chromium/src/DateTimeChooserImpl.h
index 40195ce53..e504592bc 100644
--- a/Source/WebKit/chromium/src/DateTimeChooserImpl.h
+++ b/Source/WebKit/chromium/src/DateTimeChooserImpl.h
@@ -57,7 +57,6 @@ private:
// PagePopupClient functions:
virtual WebCore::IntSize contentSize() OVERRIDE;
virtual void writeDocument(WebCore::DocumentWriter&) OVERRIDE;
- virtual WebCore::Localizer& localizer() OVERRIDE;
virtual void setValueAndClosePopup(int, const String&) OVERRIDE;
virtual void didClosePopup() OVERRIDE;
@@ -65,7 +64,6 @@ private:
WebCore::DateTimeChooserClient* m_client;
WebCore::PagePopup* m_popup;
WebCore::DateTimeChooserParameters m_parameters;
- OwnPtr<WebCore::Localizer> m_localizer;
};
}
diff --git a/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h
index 5ece4eed1..a94d39b7c 100644
--- a/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h
+++ b/Source/WebKit/chromium/src/DeliveredIntentClientImpl.h
@@ -33,7 +33,7 @@
#include "DeliveredIntent.h"
#include "SerializedScriptValue.h"
-#include <public/WebCommon.h>
+#include "platform/WebCommon.h"
#include <wtf/PassRefPtr.h>
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/DragClientImpl.cpp b/Source/WebKit/chromium/src/DragClientImpl.cpp
index 39f48c6b5..3974e7ad3 100644
--- a/Source/WebKit/chromium/src/DragClientImpl.cpp
+++ b/Source/WebKit/chromium/src/DragClientImpl.cpp
@@ -35,11 +35,12 @@
#include "ClipboardChromium.h"
#include "Frame.h"
#include "NativeImageSkia.h"
+#include "platform/WebCommon.h"
+#include "platform/WebImage.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/WebCommon.h>
+
#include <public/WebDragData.h>
-#include <public/WebImage.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/DragScrollTimer.h b/Source/WebKit/chromium/src/DragScrollTimer.h
index e6aacd7ae..fe19013e2 100644
--- a/Source/WebKit/chromium/src/DragScrollTimer.h
+++ b/Source/WebKit/chromium/src/DragScrollTimer.h
@@ -33,7 +33,7 @@
#include "IntSize.h"
#include "Timer.h"
-#include <public/WebPoint.h>
+#include "platform/WebPoint.h"
namespace WebCore { class FrameView; }
diff --git a/Source/WebKit/chromium/src/ExternalPopupMenu.cpp b/Source/WebKit/chromium/src/ExternalPopupMenu.cpp
index 3166384c0..1855401c4 100644
--- a/Source/WebKit/chromium/src/ExternalPopupMenu.cpp
+++ b/Source/WebKit/chromium/src/ExternalPopupMenu.cpp
@@ -38,8 +38,8 @@
#include "WebExternalPopupMenu.h"
#include "WebMenuItemInfo.h"
#include "WebPopupMenuInfo.h"
+#include "platform/WebVector.h"
#include "WebViewClient.h"
-#include <public/WebVector.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/FindInPageCoordinates.cpp b/Source/WebKit/chromium/src/FindInPageCoordinates.cpp
index 5dbfacc23..643848868 100644
--- a/Source/WebKit/chromium/src/FindInPageCoordinates.cpp
+++ b/Source/WebKit/chromium/src/FindInPageCoordinates.cpp
@@ -67,7 +67,7 @@ static FloatRect toNormalizedRect(const FloatRect& absoluteRect, const RenderObj
scrolledOrigin = -IntPoint(container->scrolledContentOffset());
FloatRect overflowRect(scrolledOrigin, container->maxLayoutOverflow());
- FloatRect containerRect = container->localToAbsoluteQuad(FloatQuad(overflowRect), SnapOffsetForTransforms).enclosingBoundingBox();
+ FloatRect containerRect = container->localToAbsoluteQuad(FloatQuad(overflowRect), false).enclosingBoundingBox();
if (containerRect.isEmpty())
return FloatRect();
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 49e780baf..0ac5d932c 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -57,9 +57,6 @@
#include "ProgressTracker.h"
#include "ResourceHandleInternal.h"
#include "ResourceLoader.h"
-#if ENABLE(MEDIA_STREAM)
-#include "RTCPeerConnectionHandlerChromium.h"
-#endif
#include "Settings.h"
#include "SocketStreamHandleInternal.h"
#include "WebDOMEvent.h"
@@ -78,17 +75,18 @@
#include "WebPluginLoadObserver.h"
#include "WebPluginParams.h"
#include "WebSecurityOrigin.h"
+#include "platform/WebSocketStreamHandle.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
#include "WindowFeatures.h"
#include "WrappedResourceRequest.h"
#include "WrappedResourceResponse.h"
+#include "platform/WebURL.h"
+#include "platform/WebURLError.h"
+#include "platform/WebVector.h"
#include <public/Platform.h>
#include <public/WebMimeRegistry.h>
-#include <public/WebSocketStreamHandle.h>
-#include <public/WebURL.h>
-#include <public/WebURLError.h>
-#include <public/WebVector.h>
+
#include <wtf/StringExtras.h>
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>
@@ -128,7 +126,7 @@ void FrameLoaderClientImpl::frameLoaderDestroyed()
// serves to keep us alive until the FrameLoader is done with us. The
// FrameLoader calls this method when it's going away. Therefore, we balance
// out that extra reference, which may cause 'this' to be deleted.
- ASSERT(!m_webFrame->frame());
+ m_webFrame->closing();
m_webFrame->deref();
}
@@ -1641,12 +1639,4 @@ void FrameLoaderClientImpl::dispatchWillOpenSocketStream(SocketStreamHandle* han
m_webFrame->client()->willOpenSocketStream(SocketStreamHandleInternal::toWebSocketStreamHandle(handle));
}
-#if ENABLE(MEDIA_STREAM)
-void FrameLoaderClientImpl::dispatchWillStartUsingPeerConnectionHandler(RTCPeerConnectionHandler* handler)
-{
- m_webFrame->client()->willStartUsingPeerConnectionHandler(webFrame(), RTCPeerConnectionHandlerChromium::toWebRTCPeerConnectionHandler(handler));
-}
-#endif
-
-
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
index 12a76feee..4d33267ce 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h
@@ -182,7 +182,6 @@ public:
const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&,
const Vector<WTF::String>&, const Vector<WTF::String>&,
const WTF::String&, bool loadManually);
- virtual void recreatePlugin(WebCore::Widget*) { }
virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget);
virtual PassRefPtr<WebCore::Widget> createJavaAppletWidget(
const WebCore::IntSize&,
@@ -221,10 +220,6 @@ public:
virtual void dispatchWillOpenSocketStream(WebCore::SocketStreamHandle*) OVERRIDE;
-#if ENABLE(MEDIA_STREAM)
- virtual void dispatchWillStartUsingPeerConnectionHandler(WebCore::RTCPeerConnectionHandler*) OVERRIDE;
-#endif
-
private:
void makeDocumentView();
diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
index 29b8c4bf4..501ce61fb 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp
@@ -66,12 +66,12 @@ IDBDatabaseMetadata IDBDatabaseBackendProxy::metadata() const
return m_webIDBDatabase->metadata();
}
-PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(int64_t id, const String& name, const IDBKeyPath& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(const String& name, const IDBKeyPath& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
// all implementations of IDB interfaces are proxy objects.
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- OwnPtr<WebIDBObjectStore> objectStore = adoptPtr(m_webIDBDatabase->createObjectStore(id, name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec));
+ OwnPtr<WebIDBObjectStore> objectStore = adoptPtr(m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec));
if (!objectStore)
return 0;
return IDBObjectStoreBackendProxy::create(objectStore.release());
diff --git a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
index fc831e8de..795610aa6 100644
--- a/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h
@@ -44,7 +44,7 @@ public:
virtual WebCore::IDBDatabaseMetadata metadata() const;
- virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(int64_t, const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
+ virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(const String& name, const WebCore::IDBKeyPath&, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&);
virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(WebCore::DOMStringList* storeNames, unsigned short mode, WebCore::ExceptionCode&);
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
index 2b9b44a7a..b53eb2c3a 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp
@@ -103,17 +103,6 @@ void IDBObjectStoreBackendProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTr
m_webIDBObjectStore->clear(new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
-PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(int64_t id, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
-{
- // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
- // all implementations of IDB interfaces are proxy objects.
- IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- OwnPtr<WebIDBIndex> index = adoptPtr(m_webIDBObjectStore->createIndex(id, name, keyPath, unique, multiEntry, *transactionProxy->getWebIDBTransaction(), ec));
- if (!index)
- return 0;
- return IDBIndexBackendProxy::create(index.release());
-}
-
PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
index 8470c1ad9..74cb0bd57 100644
--- a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
+++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h
@@ -48,7 +48,6 @@ public:
virtual void deleteFunction(PassRefPtr<WebCore::IDBKeyRange>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
- PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(int64_t id, const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const WebCore::IDBKeyPath&, bool unique, bool multiEntry, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&);
virtual void setIndexKeys(PassRefPtr<WebCore::IDBKey> prpPrimaryKey, const WTF::Vector<WTF::String>&, const WTF::Vector<IndexKeys>&, WebCore::IDBTransactionBackendInterface*);
virtual void setIndexesReady(const Vector<String>&, WebCore::IDBTransactionBackendInterface*);
diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.cpp b/Source/WebKit/chromium/src/InspectorClientImpl.cpp
index 402b8695c..6948982c8 100644
--- a/Source/WebKit/chromium/src/InspectorClientImpl.cpp
+++ b/Source/WebKit/chromium/src/InspectorClientImpl.cpp
@@ -37,12 +37,12 @@
#include "NotImplemented.h"
#include "Page.h"
#include "WebDevToolsAgentImpl.h"
+#include "platform/WebRect.h"
+#include "platform/WebURL.h"
+#include "platform/WebURLRequest.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
#include <public/Platform.h>
-#include <public/WebRect.h>
-#include <public/WebURL.h>
-#include <public/WebURLRequest.h>
#include <wtf/Vector.h>
using namespace WebCore;
@@ -163,12 +163,6 @@ bool InspectorClientImpl::supportsFrameInstrumentation()
return true;
}
-void InspectorClientImpl::getAllocatedObjects(HashSet<const void*>& set)
-{
- if (WebDevToolsAgentImpl* agent = devToolsAgent())
- agent->getAllocatedObjects(set);
-}
-
void InspectorClientImpl::willProcessTask()
{
InspectorInstrumentation::willProcessTask(m_inspectedWebView->page());
diff --git a/Source/WebKit/chromium/src/InspectorClientImpl.h b/Source/WebKit/chromium/src/InspectorClientImpl.h
index 9e1ea370e..7abbd3bf5 100644
--- a/Source/WebKit/chromium/src/InspectorClientImpl.h
+++ b/Source/WebKit/chromium/src/InspectorClientImpl.h
@@ -34,7 +34,7 @@
#include "InspectorClient.h"
#include "InspectorController.h"
#include "InspectorFrontendChannel.h"
-#include <public/WebThread.h>
+#include "platform/WebThread.h"
#include <wtf/OwnPtr.h>
namespace WebKit {
@@ -78,8 +78,6 @@ public:
virtual bool supportsFrameInstrumentation();
- virtual void getAllocatedObjects(HashSet<const void*>&);
-
private:
// WebThread::TaskObserver
virtual void willProcessTask();
diff --git a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
index 763c85da8..f2657a7bd 100644
--- a/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
+++ b/Source/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -39,8 +39,8 @@
#include "V8InspectorFrontendHost.h"
#include "WebDevToolsFrontendClient.h"
#include "WebDevToolsFrontendImpl.h"
-#include <public/WebFloatPoint.h>
-#include <public/WebString.h>
+#include "platform/WebFloatPoint.h"
+#include "platform/WebString.h"
#include <wtf/text/WTFString.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp
index 815a0c300..1e72900c4 100644
--- a/Source/WebKit/chromium/src/LinkHighlight.cpp
+++ b/Source/WebKit/chromium/src/LinkHighlight.cpp
@@ -65,7 +65,6 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
, m_owningWebViewImpl(owningWebViewImpl)
, m_currentGraphicsLayer(0)
, m_geometryNeedsUpdate(false)
- , m_isAnimating(false)
{
ASSERT(m_node);
ASSERT(owningWebViewImpl);
@@ -74,11 +73,12 @@ LinkHighlight::LinkHighlight(Node* node, WebViewImpl* owningWebViewImpl)
m_clipLayer = adoptPtr(compositorSupport->createLayer());
m_clipLayer->setAnchorPoint(WebFloatPoint());
m_clipLayer->addChild(m_contentLayer->layer());
+ m_contentLayer->layer()->setDrawsContent(false);
+
+ // We don't want to show the highlight until startAnimation is called, even though the highlight
+ // layer may be added to the tree immediately.
+ m_contentLayer->layer()->setOpacity(0);
m_contentLayer->layer()->setAnimationDelegate(this);
- m_contentLayer->layer()->setDrawsContent(true);
- m_contentLayer->layer()->setOpacity(1);
- m_geometryNeedsUpdate = true;
- updateGeometry();
}
LinkHighlight::~LinkHighlight()
@@ -143,84 +143,40 @@ RenderLayer* LinkHighlight::computeEnclosingCompositingLayer()
return renderLayer;
}
-static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, RenderObject* targetRenderer, RenderObject* compositedRenderer, FloatQuad& compositedSpaceQuad)
-{
- ASSERT(targetRenderer);
- ASSERT(compositedRenderer);
-
- for (unsigned i = 0; i < 4; ++i) {
- IntPoint point;
- switch (i) {
- case 0: point = roundedIntPoint(targetSpaceQuad.p1()); break;
- case 1: point = roundedIntPoint(targetSpaceQuad.p2()); break;
- case 2: point = roundedIntPoint(targetSpaceQuad.p3()); break;
- case 3: point = roundedIntPoint(targetSpaceQuad.p4()); break;
- }
-
- point = targetRenderer->frame()->view()->contentsToWindow(point);
- point = compositedRenderer->frame()->view()->windowToContents(point);
- FloatPoint floatPoint = compositedRenderer->absoluteToLocal(point, UseTransforms | SnapOffsetForTransforms);
-
- switch (i) {
- case 0: compositedSpaceQuad.setP1(floatPoint); break;
- case 1: compositedSpaceQuad.setP2(floatPoint); break;
- case 2: compositedSpaceQuad.setP3(floatPoint); break;
- case 3: compositedSpaceQuad.setP4(floatPoint); break;
- }
- }
-}
-
-static void addQuadToPath(const FloatQuad& quad, Path& path)
-{
- // FIXME: Make this create rounded quad-paths, just like the axis-aligned case.
- path.moveTo(quad.p1());
- path.addLineTo(quad.p2());
- path.addLineTo(quad.p3());
- path.addLineTo(quad.p4());
- path.closeSubpath();
-}
-
bool LinkHighlight::computeHighlightLayerPathAndPosition(RenderLayer* compositingLayer)
{
if (!m_node || !m_node->renderer())
return false;
- ASSERT(compositingLayer);
-
- // Get quads for node in absolute coordinates.
- Vector<FloatQuad> quads;
- m_node->renderer()->absoluteQuads(quads);
- ASSERT(quads.size());
-
- Path newPath;
- for (unsigned quadIndex = 0; quadIndex < quads.size(); ++quadIndex) {
-
- FloatQuad transformedQuad;
-
- // Transform node quads in target absolute coords to local coordinates in the compositor layer.
- convertTargetSpaceQuadToCompositedLayer(quads[quadIndex], m_node->renderer(), compositingLayer->renderer(), transformedQuad);
-
- // FIXME: for now, we'll only use rounded paths if we have a single node quad. The reason for this is that
- // we may sometimes get a chain of adjacent boxes (e.g. for text nodes) which end up looking like sausage
- // links: these should ideally be merged into a single rect before creating the path, but that's
- // another CL.
- if (quads.size() == 1 && transformedQuad.isRectilinear()) {
- FloatSize rectRoundingRadii(3, 3);
- newPath.addRoundedRect(transformedQuad.boundingBox(), rectRoundingRadii);
- } else
- addQuadToPath(transformedQuad, newPath);
+ bool pathHasChanged = false;
+ FloatRect boundingRect = m_node->pixelSnappedBoundingBox();
+
+ // FIXME: If we ever use a more sophisticated highlight path, we'll need
+ // to devise a way of detecting when it changes.
+ if (boundingRect.size() != m_path.boundingRect().size()) {
+ FloatSize rectRoundingRadii(3, 3);
+ m_path.clear();
+ m_path.addRoundedRect(boundingRect, rectRoundingRadii);
+ // Always treat the path as being at the origin of this layer.
+ m_path.translate(FloatPoint() - boundingRect.location());
+ pathHasChanged = true;
}
- FloatRect boundingRect = newPath.boundingRect();
- newPath.translate(FloatPoint() - boundingRect.location());
+ FloatRect nodeBounds = boundingRect;
- bool pathHasChanged = !m_path.platformPath() || !(*newPath.platformPath() == *m_path.platformPath());
- if (pathHasChanged) {
- m_path = newPath;
- m_contentLayer->layer()->setBounds(enclosingIntRect(boundingRect).size());
- }
+ // This is a simplified, but basically correct, transformation of the target location, converted
+ // from its containing frame view to window coordinates and then back to the containing frame view
+ // of the composited layer.
+ // FIXME: We also need to transform the target's size in case of scaling. This can be done by also transforming
+ // the full rects in the xToY calls, and transforming both the upper-left and lower right corners
+ // to local coordinates at the end..
+ ASSERT(compositingLayer);
+ IntPoint targetWindow = m_node->renderer()->frame()->view()->contentsToWindow(enclosingIntRect(nodeBounds).location());
+ IntPoint targetCompositorAbsolute = compositingLayer->renderer()->frame()->view()->windowToContents(targetWindow);
+ FloatPoint targetCompositorLocal = compositingLayer->renderer()->absoluteToLocal(targetCompositorAbsolute, false, true);
- m_contentLayer->layer()->setPosition(boundingRect.location());
+ m_contentLayer->layer()->setBounds(WebSize(enclosingIntRect(nodeBounds).size()));
+ m_contentLayer->layer()->setPosition(WebFloatPoint(targetCompositorLocal));
return pathHasChanged;
}
@@ -238,12 +194,8 @@ void LinkHighlight::paintContents(WebCanvas* canvas, const WebRect& webClipRect,
gc.fillPath(m_path);
}
-void LinkHighlight::startHighlightAnimationIfNeeded()
+void LinkHighlight::startHighlightAnimation()
{
- if (m_isAnimating)
- return;
-
- m_isAnimating = true;
const float startOpacity = 1;
// FIXME: Should duration be configurable?
const float duration = 0.1f;
diff --git a/Source/WebKit/chromium/src/LinkHighlight.h b/Source/WebKit/chromium/src/LinkHighlight.h
index 3bac3c729..4eb6f5967 100644
--- a/Source/WebKit/chromium/src/LinkHighlight.h
+++ b/Source/WebKit/chromium/src/LinkHighlight.h
@@ -54,7 +54,7 @@ public:
WebContentLayer* contentLayer();
WebLayer* clipLayer();
- void startHighlightAnimationIfNeeded();
+ void startHighlightAnimation();
void updateGeometry();
// WebContentLayerClient implementation.
@@ -90,7 +90,6 @@ private:
WebCore::GraphicsLayerChromium* m_currentGraphicsLayer;
bool m_geometryNeedsUpdate;
- bool m_isAnimating;
WebCore::FloatPoint m_graphicsLayerOffset;
};
diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp
index 0cc8e00eb..40a009369 100644
--- a/Source/WebKit/chromium/src/LocalizedStrings.cpp
+++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp
@@ -202,7 +202,7 @@ String AXMenuListActionVerb()
return String();
}
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#if ENABLE(INPUT_TYPE_TIME_MULTIPLE_FIELDS)
String AXAMPMFieldText()
{
return query(WebLocalizedString::AXAMPMFieldText);
@@ -252,32 +252,6 @@ String AXYearFieldText()
{
return query(WebLocalizedString::AXYearFieldText);
}
-
-String placeholderForDayOfMonthField()
-{
- return query(WebLocalizedString::PlaceholderForDayOfMonthField);
-}
-
-String placeholderForMonthField()
-{
- return query(WebLocalizedString::PlaceholderForMonthField);
-}
-
-String placeholderForYearField()
-{
- return query(WebLocalizedString::PlaceholderForYearField);
-}
-
-String monthFormatInLDML()
-{
- return query(WebLocalizedString::MonthFormatInLDML);
-}
-
-String weekFormatInLDML()
-{
- return query(WebLocalizedString::WeekFormatInLDML);
-}
-
#endif
String missingPluginText()
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index 21b9725b0..9729d05ec 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -32,7 +32,6 @@
#include "GraphicsLayer.h"
#include "GraphicsLayerChromium.h"
#include "PlatformContextSkia.h"
-#include "Settings.h"
#include "WebViewImpl.h"
#include <public/WebContentLayer.h>
#include <public/WebFloatPoint.h>
@@ -44,12 +43,12 @@ NonCompositedContentHost::NonCompositedContentHost(WebViewImpl* webView)
, m_opaque(true)
, m_showDebugBorders(false)
{
- m_graphicsLayer = WebCore::GraphicsLayer::create(0, this);
+ m_graphicsLayer = WebCore::GraphicsLayer::create(this);
#ifndef NDEBUG
m_graphicsLayer->setName("non-composited content");
#endif
m_graphicsLayer->setDrawsContent(true);
- m_graphicsLayer->setAppliesPageScale(!m_webView->page()->settings()->applyPageScaleFactorInCompositor());
+ m_graphicsLayer->setAppliesPageScale(true);
WebContentLayer* layer = static_cast<WebCore::GraphicsLayerChromium*>(m_graphicsLayer.get())->contentLayer();
layer->setUseLCDText(true);
layer->layer()->setOpaque(true);
@@ -166,7 +165,7 @@ void NonCompositedContentHost::notifyAnimationStarted(const WebCore::GraphicsLay
// Intentionally left empty since we don't support animations on the non-composited content.
}
-void NonCompositedContentHost::notifyFlushRequired(const WebCore::GraphicsLayer*)
+void NonCompositedContentHost::notifySyncRequired(const WebCore::GraphicsLayer*)
{
m_webView->scheduleCompositingLayerSync();
}
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h
index 08e9c69b2..69776d90f 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.h
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h
@@ -69,7 +69,7 @@ protected:
private:
// GraphicsLayerClient
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time);
- virtual void notifyFlushRequired(const WebCore::GraphicsLayer*);
+ virtual void notifySyncRequired(const WebCore::GraphicsLayer*);
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;
diff --git a/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp b/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
index d6df72efb..683e66faa 100644
--- a/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
+++ b/Source/WebKit/chromium/src/NotificationPresenterImpl.cpp
@@ -41,7 +41,7 @@
#include "WebNotification.h"
#include "WebNotificationPermissionCallback.h"
#include "WebNotificationPresenter.h"
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebKit/chromium/src/PageOverlay.cpp b/Source/WebKit/chromium/src/PageOverlay.cpp
index a16a01077..b5d157a4b 100644
--- a/Source/WebKit/chromium/src/PageOverlay.cpp
+++ b/Source/WebKit/chromium/src/PageOverlay.cpp
@@ -75,7 +75,7 @@ public:
virtual void notifyAnimationStarted(const GraphicsLayer*, double time) { }
- virtual void notifyFlushRequired(const GraphicsLayer*) { }
+ virtual void notifySyncRequired(const GraphicsLayer*) { }
virtual void paintContents(const GraphicsLayer*, GraphicsContext& gc, GraphicsLayerPaintingPhase, const IntRect& inClip)
{
diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
index 071c22a3d..6ad25d953 100644
--- a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
+++ b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
@@ -59,7 +59,8 @@ void PageWidgetDelegate::animate(Page* page, double monotonicFrameBeginTime)
FrameView* view = mainFrameView(page);
if (!view)
return;
- view->serviceScriptedAnimations(monotonicFrameBeginTime);
+ double timeShift = currentTime() - monotonicallyIncreasingTime();
+ view->serviceScriptedAnimations(convertSecondsToDOMTimeStamp(monotonicFrameBeginTime + timeShift));
#endif
}
@@ -89,7 +90,6 @@ void PageWidgetDelegate::paint(Page* page, PageOverlayList* overlays, WebCanvas*
GraphicsContext& gc = builder.context();
gc.platformContext()->setDrawingToImageBuffer(background == Opaque ? false : true);
gc.applyDeviceScaleFactor(page->deviceScaleFactor());
- gc.platformContext()->setDeviceScaleFactor(page->deviceScaleFactor());
IntRect dirtyRect(rect);
gc.save();
FrameView* view = mainFrameView(page);
diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.h b/Source/WebKit/chromium/src/PageWidgetDelegate.h
index c9f76bb95..807e1987b 100644
--- a/Source/WebKit/chromium/src/PageWidgetDelegate.h
+++ b/Source/WebKit/chromium/src/PageWidgetDelegate.h
@@ -33,7 +33,7 @@
#include "Page.h"
#include "WebWidget.h"
-#include <public/WebCanvas.h>
+#include "platform/WebCanvas.h"
#include <wtf/OwnPtr.h>
namespace WebCore {
diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp
index 9eb8b68e1..7cd6453f6 100644
--- a/Source/WebKit/chromium/src/PlatformSupport.cpp
+++ b/Source/WebKit/chromium/src/PlatformSupport.cpp
@@ -55,6 +55,7 @@
#include "platform/WebSerializedScriptValue.h"
#include "platform/WebString.h"
#include "platform/WebURL.h"
+#include "platform/WebVector.h"
#if OS(WINDOWS)
#include "platform/WebRect.h"
@@ -92,7 +93,6 @@
#include <public/WebCookie.h>
#include <public/WebCookieJar.h>
#include <public/WebMimeRegistry.h>
-#include <public/WebVector.h>
#include <wtf/Assertions.h>
// We are part of the WebKit implementation.
@@ -324,6 +324,137 @@ void PlatformSupport::paintProgressBar(
gc->platformContext()->canvas(), barRect, valueRect, determinate, animatedSeconds);
}
+#elif OS(DARWIN)
+
+void PlatformSupport::paintScrollbarThumb(
+ GraphicsContext* gc, ThemePaintState state, ThemePaintSize size, const IntRect& rect, const ThemePaintScrollbarInfo& scrollbarInfo)
+{
+ WebThemeEngine::ScrollbarInfo webThemeScrollbarInfo;
+
+ webThemeScrollbarInfo.orientation = static_cast<WebThemeEngine::ScrollbarOrientation>(scrollbarInfo.orientation);
+ webThemeScrollbarInfo.parent = static_cast<WebThemeEngine::ScrollbarParent>(scrollbarInfo.parent);
+ webThemeScrollbarInfo.maxValue = scrollbarInfo.maxValue;
+ webThemeScrollbarInfo.currentValue = scrollbarInfo.currentValue;
+ webThemeScrollbarInfo.visibleSize = scrollbarInfo.visibleSize;
+ webThemeScrollbarInfo.totalSize = scrollbarInfo.totalSize;
+
+ WebKit::WebCanvas* webCanvas = gc->platformContext()->canvas();
+ WebKit::Platform::current()->themeEngine()->paintScrollbarThumb(
+ webCanvas,
+ static_cast<WebThemeEngine::State>(state),
+ static_cast<WebThemeEngine::Size>(size),
+ rect,
+ webThemeScrollbarInfo);
+}
+
+#elif OS(UNIX)
+
+static WebThemeEngine::Part WebThemePart(PlatformSupport::ThemePart part)
+{
+ switch (part) {
+ case PlatformSupport::PartScrollbarDownArrow: return WebThemeEngine::PartScrollbarDownArrow;
+ case PlatformSupport::PartScrollbarLeftArrow: return WebThemeEngine::PartScrollbarLeftArrow;
+ case PlatformSupport::PartScrollbarRightArrow: return WebThemeEngine::PartScrollbarRightArrow;
+ case PlatformSupport::PartScrollbarUpArrow: return WebThemeEngine::PartScrollbarUpArrow;
+ case PlatformSupport::PartScrollbarHorizontalThumb: return WebThemeEngine::PartScrollbarHorizontalThumb;
+ case PlatformSupport::PartScrollbarVerticalThumb: return WebThemeEngine::PartScrollbarVerticalThumb;
+ case PlatformSupport::PartScrollbarHorizontalTrack: return WebThemeEngine::PartScrollbarHorizontalTrack;
+ case PlatformSupport::PartScrollbarVerticalTrack: return WebThemeEngine::PartScrollbarVerticalTrack;
+ case PlatformSupport::PartCheckbox: return WebThemeEngine::PartCheckbox;
+ case PlatformSupport::PartRadio: return WebThemeEngine::PartRadio;
+ case PlatformSupport::PartButton: return WebThemeEngine::PartButton;
+ case PlatformSupport::PartTextField: return WebThemeEngine::PartTextField;
+ case PlatformSupport::PartMenuList: return WebThemeEngine::PartMenuList;
+ case PlatformSupport::PartSliderTrack: return WebThemeEngine::PartSliderTrack;
+ case PlatformSupport::PartSliderThumb: return WebThemeEngine::PartSliderThumb;
+ case PlatformSupport::PartInnerSpinButton: return WebThemeEngine::PartInnerSpinButton;
+ case PlatformSupport::PartProgressBar: return WebThemeEngine::PartProgressBar;
+ }
+ ASSERT_NOT_REACHED();
+ return WebThemeEngine::PartScrollbarDownArrow;
+}
+
+static WebThemeEngine::State WebThemeState(PlatformSupport::ThemePaintState state)
+{
+ switch (state) {
+ case PlatformSupport::StateDisabled: return WebThemeEngine::StateDisabled;
+ case PlatformSupport::StateHover: return WebThemeEngine::StateHover;
+ case PlatformSupport::StateNormal: return WebThemeEngine::StateNormal;
+ case PlatformSupport::StatePressed: return WebThemeEngine::StatePressed;
+ }
+ ASSERT_NOT_REACHED();
+ return WebThemeEngine::StateDisabled;
+}
+
+static void GetWebThemeExtraParams(PlatformSupport::ThemePart part, PlatformSupport::ThemePaintState state, const PlatformSupport::ThemePaintExtraParams* extraParams, WebThemeEngine::ExtraParams* webThemeExtraParams)
+{
+ switch (part) {
+ case PlatformSupport::PartScrollbarHorizontalTrack:
+ case PlatformSupport::PartScrollbarVerticalTrack:
+ webThemeExtraParams->scrollbarTrack.trackX = extraParams->scrollbarTrack.trackX;
+ webThemeExtraParams->scrollbarTrack.trackY = extraParams->scrollbarTrack.trackY;
+ webThemeExtraParams->scrollbarTrack.trackWidth = extraParams->scrollbarTrack.trackWidth;
+ webThemeExtraParams->scrollbarTrack.trackHeight = extraParams->scrollbarTrack.trackHeight;
+ break;
+ case PlatformSupport::PartCheckbox:
+ webThemeExtraParams->button.checked = extraParams->button.checked;
+ webThemeExtraParams->button.indeterminate = extraParams->button.indeterminate;
+ break;
+ case PlatformSupport::PartRadio:
+ webThemeExtraParams->button.checked = extraParams->button.checked;
+ break;
+ case PlatformSupport::PartButton:
+ webThemeExtraParams->button.isDefault = extraParams->button.isDefault;
+ webThemeExtraParams->button.hasBorder = extraParams->button.hasBorder;
+ webThemeExtraParams->button.backgroundColor = extraParams->button.backgroundColor;
+ break;
+ case PlatformSupport::PartTextField:
+ webThemeExtraParams->textField.isTextArea = extraParams->textField.isTextArea;
+ webThemeExtraParams->textField.isListbox = extraParams->textField.isListbox;
+ webThemeExtraParams->textField.backgroundColor = extraParams->textField.backgroundColor;
+ break;
+ case PlatformSupport::PartMenuList:
+ webThemeExtraParams->menuList.hasBorder = extraParams->menuList.hasBorder;
+ webThemeExtraParams->menuList.hasBorderRadius = extraParams->menuList.hasBorderRadius;
+ webThemeExtraParams->menuList.arrowX = extraParams->menuList.arrowX;
+ webThemeExtraParams->menuList.arrowY = extraParams->menuList.arrowY;
+ webThemeExtraParams->menuList.backgroundColor = extraParams->menuList.backgroundColor;
+ break;
+ case PlatformSupport::PartSliderTrack:
+ case PlatformSupport::PartSliderThumb:
+ webThemeExtraParams->slider.vertical = extraParams->slider.vertical;
+ webThemeExtraParams->slider.inDrag = extraParams->slider.inDrag;
+ break;
+ case PlatformSupport::PartInnerSpinButton:
+ webThemeExtraParams->innerSpin.spinUp = extraParams->innerSpin.spinUp;
+ webThemeExtraParams->innerSpin.readOnly = extraParams->innerSpin.readOnly;
+ break;
+ case PlatformSupport::PartProgressBar:
+ webThemeExtraParams->progressBar.determinate = extraParams->progressBar.determinate;
+ webThemeExtraParams->progressBar.valueRectX = extraParams->progressBar.valueRectX;
+ webThemeExtraParams->progressBar.valueRectY = extraParams->progressBar.valueRectY;
+ webThemeExtraParams->progressBar.valueRectWidth = extraParams->progressBar.valueRectWidth;
+ webThemeExtraParams->progressBar.valueRectHeight = extraParams->progressBar.valueRectHeight;
+ break;
+ default:
+ break; // Parts that have no extra params get here.
+ }
+}
+
+IntSize PlatformSupport::getThemePartSize(ThemePart part)
+{
+ return WebKit::Platform::current()->themeEngine()->getSize(WebThemePart(part));
+}
+
+void PlatformSupport::paintThemePart(
+ GraphicsContext* gc, ThemePart part, ThemePaintState state, const IntRect& rect, const ThemePaintExtraParams* extraParams)
+{
+ WebThemeEngine::ExtraParams webThemeExtraParams;
+ GetWebThemeExtraParams(part, state, extraParams, &webThemeExtraParams);
+ WebKit::Platform::current()->themeEngine()->paint(
+ gc->platformContext()->canvas(), WebThemePart(part), WebThemeState(state), rect, &webThemeExtraParams);
+}
+
#endif
// These are temporary methods that the WebKit layer can use to call to the
diff --git a/Source/WebKit/chromium/src/SocketStreamHandle.cpp b/Source/WebKit/chromium/src/SocketStreamHandle.cpp
index 3f98a77db..5eed90011 100644
--- a/Source/WebKit/chromium/src/SocketStreamHandle.cpp
+++ b/Source/WebKit/chromium/src/SocketStreamHandle.cpp
@@ -37,9 +37,10 @@
#include "Logging.h"
#include "NotImplemented.h"
#include "SocketStreamHandleClient.h"
-#include <public/Platform.h>
-#include <public/WebData.h>
-#include <public/WebSocketStreamHandle.h>
+#include "platform/WebData.h"
+#include "WebKit.h"
+#include "platform/WebKitPlatformSupport.h"
+#include "platform/WebSocketStreamHandle.h"
#include <wtf/PassOwnPtr.h>
using namespace WebKit;
@@ -72,13 +73,7 @@ void SocketStreamHandleInternal::connect(const KURL& url)
int SocketStreamHandleInternal::send(const char* data, int len)
{
LOG(Network, "send len=%d", len);
- // FIXME: |m_socket| should not be null here, but it seems that there is the
- // case. We should figure out such a path and fix it rather than checking
- // null here.
- if (!m_socket) {
- LOG(Network, "m_socket is null when sending. It should not be.");
- return 0;
- }
+ ASSERT(m_socket);
if (m_pendingAmountSent + len >= m_maxPendingSendAllowed)
len = m_maxPendingSendAllowed - m_pendingAmountSent - 1;
diff --git a/Source/WebKit/chromium/src/SocketStreamHandleInternal.h b/Source/WebKit/chromium/src/SocketStreamHandleInternal.h
index 04122d8f1..857b279e7 100644
--- a/Source/WebKit/chromium/src/SocketStreamHandleInternal.h
+++ b/Source/WebKit/chromium/src/SocketStreamHandleInternal.h
@@ -34,8 +34,8 @@
#if ENABLE(WEB_SOCKETS)
#include "SocketStreamHandle.h"
-#include <public/WebSocketStreamHandleClient.h>
-#include <public/WebURL.h>
+#include "platform/WebSocketStreamHandleClient.h"
+#include "platform/WebURL.h"
#include <wtf/PassOwnPtr.h>
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/SpeechInputClientImpl.cpp b/Source/WebKit/chromium/src/SpeechInputClientImpl.cpp
index 4f09f5f3b..09176ee98 100644
--- a/Source/WebKit/chromium/src/SpeechInputClientImpl.cpp
+++ b/Source/WebKit/chromium/src/SpeechInputClientImpl.cpp
@@ -35,8 +35,8 @@
#include "SpeechInputListener.h"
#include "WebSecurityOrigin.h"
#include "WebSpeechInputController.h"
+#include "platform/WebString.h"
#include "WebViewClient.h"
-#include <public/WebString.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/text/WTFString.h>
diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.cpp
index 082747cdb..aa9b189a7 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, bool interimResults, unsigned long maxAlternatives)
+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, interimResults, maxAlternatives, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin()));
+ WebSpeechRecognitionParams params(webSpeechGrammars, lang, continuous, maxAlternatives, WebSecurityOrigin(recognition->scriptExecutionContext()->securityOrigin()));
m_recognizer->start(WebSpeechRecognitionHandle(recognition), params, this);
}
@@ -119,6 +119,17 @@ void SpeechRecognitionClientProxy::didReceiveNoMatch(const WebSpeechRecognitionH
recognition->didReceiveNoMatch(result);
}
+void SpeechRecognitionClientProxy::didDeleteResult(const WebSpeechRecognitionHandle& handle, unsigned resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory)
+{
+ RefPtr<SpeechRecognition> recognition = PassRefPtr<SpeechRecognition>(handle);
+
+ Vector<RefPtr<SpeechRecognitionResult> > resultHistoryVector(resultHistory.size());
+ for (size_t i = 0; i < resultHistory.size(); ++i)
+ resultHistoryVector[i] = static_cast<PassRefPtr<SpeechRecognitionResult> >(resultHistory[i]);
+
+ recognition->didDeleteResult(resultIndex, SpeechRecognitionResultList::create(resultHistoryVector));
+}
+
void SpeechRecognitionClientProxy::didReceiveError(const WebSpeechRecognitionHandle& handle, const WebString& message, WebSpeechRecognizerClient::ErrorCode code)
{
RefPtr<SpeechRecognition> recognition = PassRefPtr<SpeechRecognition>(handle);
diff --git a/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h b/Source/WebKit/chromium/src/SpeechRecognitionClientProxy.h
index 6194f6600..312e88b13 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, bool interimResults, unsigned long maxAlternatives) 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;
@@ -57,6 +57,7 @@ public:
virtual void didEndAudio(const WebSpeechRecognitionHandle&) OVERRIDE;
virtual void didReceiveResult(const WebSpeechRecognitionHandle&, const WebSpeechRecognitionResult&, unsigned long resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory) OVERRIDE;
virtual void didReceiveNoMatch(const WebSpeechRecognitionHandle&, const WebSpeechRecognitionResult&) OVERRIDE;
+ virtual void didDeleteResult(const WebSpeechRecognitionHandle&, unsigned resultIndex, const WebVector<WebSpeechRecognitionResult>& resultHistory) OVERRIDE;
virtual void didReceiveError(const WebSpeechRecognitionHandle&, const WebString& message, WebSpeechRecognizerClient::ErrorCode) OVERRIDE;
virtual void didStart(const WebSpeechRecognitionHandle&) OVERRIDE;
virtual void didEnd(const WebSpeechRecognitionHandle&) OVERRIDE;
diff --git a/Source/WebKit/chromium/src/StorageAreaProxy.cpp b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
index 2e33d08fb..efa0c9098 100644
--- a/Source/WebKit/chromium/src/StorageAreaProxy.cpp
+++ b/Source/WebKit/chromium/src/StorageAreaProxy.cpp
@@ -43,9 +43,9 @@
#include "WebFrameImpl.h"
#include "WebPermissionClient.h"
#include "WebStorageArea.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include "WebViewImpl.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
namespace WebCore {
diff --git a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp
index 9594eb230..6c6845497 100644
--- a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp
+++ b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp
@@ -32,11 +32,11 @@
#include "SecurityOrigin.h"
#include "StorageAreaProxy.h"
#include "WebKit.h"
+#include "platform/WebKitPlatformSupport.h"
#include "WebStorageNamespace.h"
+#include "platform/WebString.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include "platform/WebKitPlatformSupport.h"
-#include <public/WebString.h>
namespace WebCore {
diff --git a/Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp b/Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp
index 44bac4038..a74aa825a 100644
--- a/Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp
+++ b/Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp
@@ -103,7 +103,7 @@ CachedImage* TextFieldDecoratorImpl::imageForReadonlyState()
if (!m_cachedImageForReadonlyState) {
WebCString imageName = m_client->imageNameForReadOnlyState();
if (imageName.isEmpty())
- m_cachedImageForReadonlyState = imageForDisabledState();
+ m_cachedImageForDisabledState = imageForDisabledState();
else {
RefPtr<Image> image = Image::loadPlatformResource(imageName.data());
m_cachedImageForReadonlyState = new CachedImage(image.get());
@@ -112,20 +112,6 @@ CachedImage* TextFieldDecoratorImpl::imageForReadonlyState()
return m_cachedImageForReadonlyState.get();
}
-CachedImage* TextFieldDecoratorImpl::imageForHoverState()
-{
- if (!m_cachedImageForHoverState) {
- WebCString imageName = m_client->imageNameForHoverState();
- if (imageName.isEmpty())
- m_cachedImageForHoverState = imageForNormalState();
- else {
- RefPtr<Image> image = Image::loadPlatformResource(imageName.data());
- m_cachedImageForHoverState = new CachedImage(image.get());
- }
- }
- return m_cachedImageForHoverState.get();
-}
-
void TextFieldDecoratorImpl::handleClick(HTMLInputElement* input)
{
ASSERT(input);
diff --git a/Source/WebKit/chromium/src/TextFieldDecoratorImpl.h b/Source/WebKit/chromium/src/TextFieldDecoratorImpl.h
index 92ab0dfb3..8f52069ba 100644
--- a/Source/WebKit/chromium/src/TextFieldDecoratorImpl.h
+++ b/Source/WebKit/chromium/src/TextFieldDecoratorImpl.h
@@ -51,7 +51,6 @@ private:
virtual WebCore::CachedImage* imageForNormalState() OVERRIDE;
virtual WebCore::CachedImage* imageForDisabledState() OVERRIDE;
virtual WebCore::CachedImage* imageForReadonlyState() OVERRIDE;
- virtual WebCore::CachedImage* imageForHoverState() OVERRIDE;
virtual void handleClick(WebCore::HTMLInputElement*) OVERRIDE;
virtual void willDetach(WebCore::HTMLInputElement*) OVERRIDE;
@@ -61,7 +60,6 @@ private:
WebCore::CachedResourceHandle<WebCore::CachedImage> m_cachedImageForNormalState;
WebCore::CachedResourceHandle<WebCore::CachedImage> m_cachedImageForDisabledState;
WebCore::CachedResourceHandle<WebCore::CachedImage> m_cachedImageForReadonlyState;
- WebCore::CachedResourceHandle<WebCore::CachedImage> m_cachedImageForHoverState;
};
}
diff --git a/Source/WebKit/chromium/src/UserMediaClientImpl.cpp b/Source/WebKit/chromium/src/UserMediaClientImpl.cpp
index cf4704cb8..ca8a98dcb 100644
--- a/Source/WebKit/chromium/src/UserMediaClientImpl.cpp
+++ b/Source/WebKit/chromium/src/UserMediaClientImpl.cpp
@@ -37,7 +37,7 @@
#include "WebUserMediaRequest.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/WebMediaStreamSource.h>
+#include "platform/WebMediaStreamSource.h"
#include <wtf/RefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp
index ebc1dbbbe..a3dd824cc 100644
--- a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp
+++ b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp
@@ -46,10 +46,10 @@
#include "UserGestureIndicator.h"
#include "WebDocument.h"
#include "WebNode.h"
-#include <public/WebPoint.h>
-#include <public/WebRect.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebPoint.h"
+#include "platform/WebRect.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include <wtf/text/StringBuilder.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp b/Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp
index 830d3beda..8af40102e 100644
--- a/Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebAnimationControllerImpl.cpp
@@ -36,7 +36,7 @@
#include "WebElement.h"
#include "WebFrameImpl.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebCommon.cpp b/Source/WebKit/chromium/src/WebCommon.cpp
index 5e039594e..cd9795ae3 100644
--- a/Source/WebKit/chromium/src/WebCommon.cpp
+++ b/Source/WebKit/chromium/src/WebCommon.cpp
@@ -29,7 +29,7 @@
*/
#include "config.h"
-#include <public/WebCommon.h>
+#include "platform/WebCommon.h"
#include <wtf/Assertions.h>
diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h
index 5cba416d2..8632ec4f2 100644
--- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h
+++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h
@@ -31,7 +31,8 @@
#ifndef WebDOMEventListenerPrivate_h
#define WebDOMEventListenerPrivate_h
-#include <public/WebString.h>
+#include "platform/WebString.h"
+
#include <wtf/Vector.h>
namespace WebCore {
diff --git a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
index ad47a0ed1..383c7de21 100644
--- a/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
+++ b/Source/WebKit/chromium/src/WebDOMMessageEvent.cpp
@@ -40,7 +40,7 @@
#include "WebFrame.h"
#include "WebFrameImpl.h"
#include "platform/WebSerializedScriptValue.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebDOMStringList.cpp b/Source/WebKit/chromium/src/WebDOMStringList.cpp
index 5f5a81556..dd106461e 100644
--- a/Source/WebKit/chromium/src/WebDOMStringList.cpp
+++ b/Source/WebKit/chromium/src/WebDOMStringList.cpp
@@ -32,7 +32,7 @@
#include "WebDOMStringList.h"
#include "DOMStringList.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp
index cc94b62ec..501fd447c 100644
--- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp
@@ -32,9 +32,9 @@
#include "WebDataSourceImpl.h"
#include "ApplicationCacheHostInternal.h"
-#include <public/WebURL.h>
-#include <public/WebURLError.h>
-#include <public/WebVector.h>
+#include "platform/WebURL.h"
+#include "platform/WebURLError.h"
+#include "platform/WebVector.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebDatabase.cpp b/Source/WebKit/chromium/src/WebDatabase.cpp
index 04d4a4079..d8eb64da4 100644
--- a/Source/WebKit/chromium/src/WebDatabase.cpp
+++ b/Source/WebKit/chromium/src/WebDatabase.cpp
@@ -36,7 +36,7 @@
#include "QuotaTracker.h"
#include "SecurityOrigin.h"
#include "WebDatabaseObserver.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index 7f362036b..a0a75b48c 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -54,14 +54,14 @@
#include "WebDataSource.h"
#include "WebDevToolsAgentClient.h"
#include "WebFrameImpl.h"
+#include "platform/WebRect.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
+#include "platform/WebURLError.h"
+#include "platform/WebURLRequest.h"
+#include "platform/WebURLResponse.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
-#include <public/WebRect.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
-#include <public/WebURLError.h>
-#include <public/WebURLRequest.h>
-#include <public/WebURLResponse.h>
#include <wtf/CurrentTime.h>
#include <wtf/MathExtras.h>
#include <wtf/Noncopyable.h>
@@ -72,6 +72,8 @@ using namespace WebCore;
using namespace std;
namespace OverlayZOrders {
+static const int viewportGutter = 97;
+
// Use 99 as a big z-order number so that highlight is above other overlays.
static const int highlight = 99;
}
@@ -181,18 +183,20 @@ private:
OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor;
};
-class DeviceMetricsSupport {
+class DeviceMetricsSupport : public WebPageOverlay {
public:
DeviceMetricsSupport(WebViewImpl* webView)
: m_webView(webView)
, m_fitWindow(false)
, m_originalZoomFactor(0)
{
+ m_webView->addPageOverlay(this, OverlayZOrders::viewportGutter);
}
~DeviceMetricsSupport()
{
restore();
+ m_webView->removePageOverlay(this);
}
void setDeviceMetrics(int width, int height, float textZoomFactor, bool fitWindow)
@@ -281,7 +285,7 @@ private:
view->setHorizontalScrollbarLock(false);
view->setVerticalScrollbarLock(false);
view->setScrollbarModes(ScrollbarAuto, ScrollbarAuto, false, false);
- view->setFrameRect(IntRect(IntPoint(), IntSize(m_webView->size())));
+ view->resize(IntSize(m_webView->size()));
m_webView->sendResizeEventAndRepaint();
}
@@ -337,6 +341,19 @@ private:
doc->updateLayout();
}
+ virtual void paintPageOverlay(WebCanvas* canvas)
+ {
+ FrameView* frameView = this->frameView();
+ if (!frameView)
+ return;
+
+ GraphicsContextBuilder builder(canvas);
+ GraphicsContext& gc = builder.context();
+ gc.clipOut(IntRect(IntPoint(), frameView->size()));
+ gc.setFillColor(Color::darkGray, ColorSpaceDeviceRGB);
+ gc.drawRect(IntRect(IntPoint(), m_webView->size()));
+ }
+
WebCore::FrameView* frameView()
{
return m_webView->mainFrameImpl() ? m_webView->mainFrameImpl()->frameView() : 0;
@@ -372,7 +389,6 @@ void WebDevToolsAgentImpl::attach()
ClientMessageLoopAdapter::ensureClientMessageLoopCreated(m_client);
inspectorController()->connectFrontend(this);
- inspectorController()->webViewResized(m_webViewImpl->size());
m_attached = true;
}
@@ -421,12 +437,10 @@ bool WebDevToolsAgentImpl::metricsOverridden()
return !!m_metricsSupport;
}
-void WebDevToolsAgentImpl::webViewResized(const WebSize& size)
+void WebDevToolsAgentImpl::webViewResized()
{
if (m_metricsSupport)
m_metricsSupport->webViewResized();
- if (InspectorController* ic = inspectorController())
- ic->webViewResized(m_metricsSupport ? IntSize(size.width, size.height) : IntSize());
}
void WebDevToolsAgentImpl::overrideDeviceMetrics(int width, int height, float fontScaleFactor, bool fitWindow)
@@ -434,19 +448,12 @@ void WebDevToolsAgentImpl::overrideDeviceMetrics(int width, int height, float fo
if (!width && !height) {
if (m_metricsSupport)
m_metricsSupport.clear();
- if (InspectorController* ic = inspectorController())
- ic->webViewResized(IntSize());
return;
}
if (!m_metricsSupport)
m_metricsSupport = adoptPtr(new DeviceMetricsSupport(m_webViewImpl));
-
m_metricsSupport->setDeviceMetrics(width, height, fontScaleFactor, fitWindow);
- if (InspectorController* ic = inspectorController()) {
- WebSize size = m_webViewImpl->size();
- ic->webViewResized(IntSize(size.width, size.height));
- }
}
void WebDevToolsAgentImpl::autoZoomPageToFitWidth()
@@ -455,82 +462,6 @@ void WebDevToolsAgentImpl::autoZoomPageToFitWidth()
m_metricsSupport->autoZoomPageToFitWidthOnNavigation(m_webViewImpl->mainFrameImpl()->frame());
}
-void WebDevToolsAgentImpl::getAllocatedObjects(HashSet<const void*>& set)
-{
- class CountingVisitor : public WebDevToolsAgentClient::AllocatedObjectVisitor {
- public:
- CountingVisitor() : m_totalObjectsCount(0)
- {
- }
- virtual bool visitObject(const void* ptr)
- {
- ++m_totalObjectsCount;
- return true;
- }
- size_t totalObjectsCount()
- {
- return m_totalObjectsCount;
- }
-
- private:
- size_t m_totalObjectsCount;
- };
-
- CountingVisitor counter;
- m_client->visitAllocatedObjects(&counter);
-
- class PointerCollector : public WebDevToolsAgentClient::AllocatedObjectVisitor {
- public:
- explicit PointerCollector(size_t maxObjectsCount)
- : m_maxObjectsCount(maxObjectsCount)
- , m_index(0)
- , m_success(true)
- , m_pointers(new const void*[maxObjectsCount])
- {
- }
- ~PointerCollector()
- {
- delete[] m_pointers;
- }
- virtual bool visitObject(const void* ptr)
- {
- if (m_index == m_maxObjectsCount) {
- m_success = false;
- return false;
- }
- m_pointers[m_index++] = ptr;
- return true;
- }
-
- bool success() const { return m_success; }
-
- void copyTo(HashSet<const void*>& set)
- {
- for (size_t i = 0; i < m_index; i++)
- set.add(m_pointers[i]);
- }
-
- private:
- const size_t m_maxObjectsCount;
- size_t m_index;
- bool m_success;
- const void** m_pointers;
- };
-
- // Double size to allow room for all objects that may have been allocated
- // since we counted them.
- size_t estimatedMaxObjectsCount = counter.totalObjectsCount() * 2;
- while (true) {
- PointerCollector collector(estimatedMaxObjectsCount);
- m_client->visitAllocatedObjects(&collector);
- if (collector.success()) {
- collector.copyTo(set);
- break;
- }
- estimatedMaxObjectsCount *= 2;
- }
-}
-
void WebDevToolsAgentImpl::dispatchOnInspectorBackend(const WebString& message)
{
inspectorController()->dispatchMessageFromFrontend(message);
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 6a9663127..f1af576cb 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -36,7 +36,8 @@
#include "WebDevToolsAgentPrivate.h"
#include "WebPageOverlay.h"
-#include <public/WebSize.h>
+#include "platform/WebSize.h"
+
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
@@ -75,7 +76,7 @@ public:
virtual void didCreateScriptContext(WebFrameImpl*, int worldId);
virtual void mainFrameViewCreated(WebFrameImpl*);
virtual bool metricsOverridden();
- virtual void webViewResized(const WebSize&);
+ virtual void webViewResized();
// WebDevToolsAgent implementation.
virtual void attach();
@@ -105,8 +106,6 @@ public:
virtual void overrideDeviceMetrics(int width, int height, float fontScaleFactor, bool fitWindow);
virtual void autoZoomPageToFitWidth();
- virtual void getAllocatedObjects(HashSet<const void*>&);
-
int hostId() { return m_hostId; }
// WebPageOverlay
diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentPrivate.h b/Source/WebKit/chromium/src/WebDevToolsAgentPrivate.h
index c1a1d93ae..06f5f1815 100644
--- a/Source/WebKit/chromium/src/WebDevToolsAgentPrivate.h
+++ b/Source/WebKit/chromium/src/WebDevToolsAgentPrivate.h
@@ -54,7 +54,7 @@ public:
virtual bool metricsOverridden() = 0;
// WebViewImpl has been resized.
- virtual void webViewResized(const WebSize&) = 0;
+ virtual void webViewResized() = 0;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebDocument.cpp b/Source/WebKit/chromium/src/WebDocument.cpp
index 0593d1d20..3486613be 100644
--- a/Source/WebKit/chromium/src/WebDocument.cpp
+++ b/Source/WebKit/chromium/src/WebDocument.cpp
@@ -56,7 +56,8 @@
#include "WebFrameImpl.h"
#include "WebNodeCollection.h"
#include "WebNodeList.h"
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
+
#include <wtf/PassRefPtr.h>
using namespace WebCore;
@@ -80,11 +81,6 @@ WebString WebDocument::encoding() const
return constUnwrap<Document>()->encoding();
}
-WebString WebDocument::contentLanguage() const
-{
- return constUnwrap<Document>()->contentLanguage();
-}
-
WebURL WebDocument::openSearchDescriptionURL() const
{
return const_cast<Document*>(constUnwrap<Document>())->openSearchDescriptionURL();
@@ -262,13 +258,14 @@ WebVector<WebDraggableRegion> WebDocument::draggableRegions() const
WebVector<WebDraggableRegion> draggableRegions;
#if ENABLE(WIDGET_REGION)
const Document* document = constUnwrap<Document>();
- if (document->hasAnnotatedRegions()) {
- const Vector<AnnotatedRegionValue>& regions = document->annotatedRegions();
+ if (document->hasDashboardRegions()) {
+ const Vector<DashboardRegionValue>& regions = document->dashboardRegions();
draggableRegions = WebVector<WebDraggableRegion>(regions.size());
for (size_t i = 0; i < regions.size(); i++) {
- const AnnotatedRegionValue& value = regions[i];
- draggableRegions[i].draggable = value.draggable;
+ const DashboardRegionValue& value = regions[i];
+ draggableRegions[i].label = value.label;
draggableRegions[i].bounds = WebCore::IntRect(value.bounds);
+ draggableRegions[i].clip = WebCore::IntRect(value.clip);
}
}
#endif
diff --git a/Source/WebKit/chromium/src/WebDocumentType.cpp b/Source/WebKit/chromium/src/WebDocumentType.cpp
index 4a4ed3642..32570233f 100644
--- a/Source/WebKit/chromium/src/WebDocumentType.cpp
+++ b/Source/WebKit/chromium/src/WebDocumentType.cpp
@@ -32,7 +32,8 @@
#include "WebDocumentType.h"
#include "DocumentType.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
+
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebDragData.cpp b/Source/WebKit/chromium/src/WebDragData.cpp
index 33dd72e92..bcb0ad38a 100644
--- a/Source/WebKit/chromium/src/WebDragData.cpp
+++ b/Source/WebKit/chromium/src/WebDragData.cpp
@@ -34,11 +34,12 @@
#include "ClipboardMimeTypes.h"
#include "DataTransferItem.h"
#include "DraggedIsolatedFileSystem.h"
-#include <public/WebData.h>
+#include "platform/WebData.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
+#include "platform/WebVector.h"
+
#include <public/WebDragData.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
-#include <public/WebVector.h>
#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp
index 49fff0a07..1cef30d60 100644
--- a/Source/WebKit/chromium/src/WebElement.cpp
+++ b/Source/WebKit/chromium/src/WebElement.cpp
@@ -29,13 +29,14 @@
*/
#include "config.h"
+#include "platform/WebRect.h"
#include "WebElement.h"
#include "WebDocument.h"
+
#include "Element.h"
#include "NamedNodeMap.h"
#include "RenderBoxModelObject.h"
#include "RenderObject.h"
-#include <public/WebRect.h>
#include <wtf/PassRefPtr.h>
@@ -64,12 +65,6 @@ bool WebElement::hasTagName(const WebString& tagName) const
tagName.operator String());
}
-bool WebElement::hasHTMLTagName(const WebString& tagName) const
-{
- const Element* element = constUnwrap<Element>();
- return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnoringCase(element->tagName(), String(tagName));
-}
-
bool WebElement::hasAttribute(const WebString& attrName) const
{
return constUnwrap<Element>()->hasAttribute(attrName);
diff --git a/Source/WebKit/chromium/src/WebEntities.cpp b/Source/WebKit/chromium/src/WebEntities.cpp
index 9208e5c6b..1175f1bb1 100644
--- a/Source/WebKit/chromium/src/WebEntities.cpp
+++ b/Source/WebKit/chromium/src/WebEntities.cpp
@@ -31,7 +31,8 @@
#include "config.h"
#include "WebEntities.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
+
#include <string.h>
#include <wtf/HashMap.h>
#include <wtf/text/StringBuilder.h>
diff --git a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h
index 2360c97f8..3ac63a5e8 100644
--- a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h
+++ b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.h
@@ -31,10 +31,11 @@
#ifndef WebFileChooserCompletionImpl_h
#define WebFileChooserCompletionImpl_h
-#include "FileChooser.h"
#include "WebFileChooserCompletion.h"
-#include <public/WebString.h>
-#include <public/WebVector.h>
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
+
+#include "FileChooser.h"
#include <wtf/PassRefPtr.h>
using WebKit::WebFileChooserCompletion;
diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
index 25fc9b282..06809e54b 100644
--- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
@@ -38,9 +38,9 @@
#include "ScriptExecutionContext.h"
#include "WebFileInfo.h"
#include "WebFileSystemEntry.h"
+#include "platform/WebString.h"
#include "WorkerAsyncFileSystemChromium.h"
#include <public/WebFileSystem.h>
-#include <public/WebString.h>
#include <wtf/Vector.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
index 7ce8b2805..e5f04081f 100644
--- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
+++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.h
@@ -33,8 +33,8 @@
#include "FileSystemType.h"
#include "WebFileSystemCallbacks.h"
+#include "platform/WebVector.h"
#include <public/WebFileSystem.h>
-#include <public/WebVector.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
diff --git a/Source/WebKit/chromium/src/WebFontImpl.cpp b/Source/WebKit/chromium/src/WebFontImpl.cpp
index c4f5ac1ab..cdb83c214 100644
--- a/Source/WebKit/chromium/src/WebFontImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFontImpl.cpp
@@ -37,11 +37,12 @@
#include "GraphicsContext.h"
#include "painting/GraphicsContextBuilder.h"
#include "TextRun.h"
+#include "platform/WebFloatPoint.h"
+#include "platform/WebFloatRect.h"
#include "WebFontDescription.h"
+#include "platform/WebRect.h"
#include "WebTextRun.h"
-#include <public/WebFloatPoint.h>
-#include <public/WebFloatRect.h>
-#include <public/WebRect.h>
+
#include <skia/ext/platform_canvas.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebFormElement.cpp b/Source/WebKit/chromium/src/WebFormElement.cpp
index cdae6620e..6400f4d96 100644
--- a/Source/WebKit/chromium/src/WebFormElement.cpp
+++ b/Source/WebKit/chromium/src/WebFormElement.cpp
@@ -38,8 +38,8 @@
#include "HTMLNames.h"
#include "WebFormControlElement.h"
#include "WebInputElement.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index ec687147b..6d68a6f23 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -72,19 +72,15 @@
#include "WebFrameImpl.h"
#include "AssociatedURLLoader.h"
-#include "AsyncFileSystem.h"
-#include "AsyncFileSystemChromium.h"
#include "BackForwardController.h"
#include "Chrome.h"
#include "ClipboardUtilitiesChromium.h"
#include "Console.h"
-#include "DOMFileSystem.h"
#include "DOMUtilitiesPrivate.h"
#include "DOMWindow.h"
#include "DOMWindowIntents.h"
#include "DeliveredIntent.h"
#include "DeliveredIntentClientImpl.h"
-#include "DirectoryEntry.h"
#include "Document.h"
#include "DocumentLoader.h"
#include "DocumentMarker.h"
@@ -92,7 +88,6 @@
#include "Editor.h"
#include "EventHandler.h"
#include "EventListenerWrapper.h"
-#include "FileEntry.h"
#include "FileSystemType.h"
#include "FindInPageCoordinates.h"
#include "FocusController.h"
@@ -121,6 +116,7 @@
#include "PageOverlay.h"
#include "Performance.h"
#include "PlatformMessagePortChannel.h"
+#include "PlatformSupport.h"
#include "PluginDocument.h"
#include "PrintContext.h"
#include "RenderBox.h"
@@ -149,10 +145,6 @@
#include "TextAffinity.h"
#include "TextIterator.h"
#include "UserGestureIndicator.h"
-#include "V8DOMFileSystem.h"
-#include "V8DirectoryEntry.h"
-#include "V8FileEntry.h"
-#include "V8GCController.h"
#include "WebAnimationControllerImpl.h"
#include "WebConsoleMessage.h"
#include "WebDOMEvent.h"
@@ -181,20 +173,33 @@
#include "htmlediting.h"
#include "markup.h"
#include "painting/GraphicsContextBuilder.h"
+#include "platform/WebFloatPoint.h"
+#include "platform/WebFloatRect.h"
+#include "platform/WebPoint.h"
+#include "platform/WebRect.h"
#include "platform/WebSerializedScriptValue.h"
+#include "platform/WebSize.h"
+#include "platform/WebURLError.h"
+#include "platform/WebVector.h"
+
#include <algorithm>
#include <public/Platform.h>
-#include <public/WebFileSystem.h>
-#include <public/WebFloatPoint.h>
-#include <public/WebFloatRect.h>
-#include <public/WebPoint.h>
-#include <public/WebRect.h>
-#include <public/WebSize.h>
-#include <public/WebURLError.h>
-#include <public/WebVector.h>
#include <wtf/CurrentTime.h>
#include <wtf/HashMap.h>
+#if USE(V8)
+#include "AsyncFileSystem.h"
+#include "AsyncFileSystemChromium.h"
+#include "DirectoryEntry.h"
+#include "DOMFileSystem.h"
+#include "FileEntry.h"
+#include "V8DirectoryEntry.h"
+#include "V8DOMFileSystem.h"
+#include "V8FileEntry.h"
+#include "V8GCController.h"
+#include <public/WebFileSystem.h>
+#endif
+
using namespace WebCore;
namespace WebKit {
@@ -209,12 +214,11 @@ static const char* const webFrameActiveCount = "WebFrameActiveCount";
// the text of each frame in turn to the |output| up to |maxChars| length.
//
// The |frame| must be non-null.
-//
-// FIXME: We should use StringBuilder rather than Vector<UChar>.
-static void frameContentAsPlainText(size_t maxChars, Frame* frame, Vector<UChar>* output)
+static void frameContentAsPlainText(size_t maxChars, Frame* frame,
+ Vector<UChar>* output)
{
- Document* document = frame->document();
- if (!document)
+ Document* doc = frame->document();
+ if (!doc)
return;
if (!frame->view())
@@ -226,9 +230,9 @@ static void frameContentAsPlainText(size_t maxChars, Frame* frame, Vector<UChar>
frame->view()->layout();
// Select the document body.
- RefPtr<Range> range(document->createRange());
+ RefPtr<Range> range(doc->createRange());
ExceptionCode exception = 0;
- range->selectNodeContents(document->body(), exception);
+ range->selectNodeContents(doc->body(), exception);
if (!exception) {
// The text iterator will walk nodes giving us text. This is similar to
@@ -360,33 +364,34 @@ public:
return m_printedPageWidth / pageRect.width();
}
- // Spools the printed page, a subrect of frame(). Skip the scale step.
+ // Spools the printed page, a subrect of m_frame. Skip the scale step.
// NativeTheme doesn't play well with scaling. Scaling is done browser side
// instead. Returns the scale to be applied.
// On Linux, we don't have the problem with NativeTheme, hence we let WebKit
// do the scaling and ignore the return value.
- virtual float spoolPage(GraphicsContext& context, int pageNumber)
+ virtual float spoolPage(GraphicsContext& ctx, int pageNumber)
{
IntRect pageRect = m_pageRects[pageNumber];
float scale = m_printedPageWidth / pageRect.width();
- context.save();
+ ctx.save();
#if OS(UNIX) && !OS(DARWIN)
- context.scale(WebCore::FloatSize(scale, scale));
+ ctx.scale(WebCore::FloatSize(scale, scale));
#endif
- context.translate(static_cast<float>(-pageRect.x()), static_cast<float>(-pageRect.y()));
- context.clip(pageRect);
- frame()->view()->paintContents(&context, pageRect);
- context.restore();
+ ctx.translate(static_cast<float>(-pageRect.x()),
+ static_cast<float>(-pageRect.y()));
+ ctx.clip(pageRect);
+ m_frame->view()->paintContents(&ctx, pageRect);
+ ctx.restore();
return scale;
}
void spoolAllPagesWithBoundaries(GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels)
{
- if (!frame()->document() || !frame()->view() || !frame()->document()->renderer())
+ if (!m_frame->document() || !m_frame->view() || !m_frame->document()->renderer())
return;
- frame()->document()->updateLayout();
+ m_frame->document()->updateLayout();
float pageHeight;
computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
@@ -408,7 +413,8 @@ public:
graphicsContext.save();
graphicsContext.setStrokeColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
graphicsContext.setFillColor(Color(0, 0, 255), ColorSpaceDeviceRGB);
- graphicsContext.drawLine(IntPoint(0, currentHeight), IntPoint(pageWidth, currentHeight));
+ graphicsContext.drawLine(IntPoint(0, currentHeight),
+ IntPoint(pageWidth, currentHeight));
graphicsContext.restore();
}
@@ -488,12 +494,12 @@ public:
return m_pageCount;
}
- // Spools the printed page, a subrect of frame(). Skip the scale step.
+ // Spools the printed page, a subrect of m_frame. Skip the scale step.
// NativeTheme doesn't play well with scaling. Scaling is done browser side
- // instead. Returns the scale to be applied.
- virtual float spoolPage(GraphicsContext& context, int pageNumber)
+ // instead. Returns the scale to be applied.
+ virtual float spoolPage(GraphicsContext& ctx, int pageNumber)
{
- m_plugin->printPage(pageNumber, &context);
+ m_plugin->printPage(pageNumber, &ctx);
return 1.0;
}
@@ -521,9 +527,15 @@ WebFrameImpl::FindMatch::FindMatch(PassRefPtr<Range> range, int ordinal)
{
}
+// WebFrame -------------------------------------------------------------------
+
class WebFrameImpl::DeferredScopeStringMatches {
public:
- DeferredScopeStringMatches(WebFrameImpl* webFrame, int identifier, const WebString& searchText, const WebFindOptions& options, bool reset)
+ DeferredScopeStringMatches(WebFrameImpl* webFrame,
+ int identifier,
+ const WebString& searchText,
+ const WebFindOptions& options,
+ bool reset)
: m_timer(this, &DeferredScopeStringMatches::doTimeout)
, m_webFrame(webFrame)
, m_identifier(identifier)
@@ -537,7 +549,8 @@ public:
private:
void doTimeout(Timer<DeferredScopeStringMatches>*)
{
- m_webFrame->callScopeStringMatches(this, m_identifier, m_searchText, m_options, m_reset);
+ m_webFrame->callScopeStringMatches(
+ this, m_identifier, m_searchText, m_options, m_reset);
}
Timer<DeferredScopeStringMatches> m_timer;
@@ -548,6 +561,7 @@ private:
bool m_reset;
};
+
// WebFrame -------------------------------------------------------------------
int WebFrame::instanceCount()
@@ -555,6 +569,14 @@ int WebFrame::instanceCount()
return frameCount;
}
+WebFrame* WebFrame::frameForEnteredContext()
+{
+ v8::Handle<v8::Context> context = v8::Context::GetEntered();
+ if (context.IsEmpty())
+ return 0;
+ return frameForContext(context);
+}
+
WebFrame* WebFrame::frameForCurrentContext()
{
v8::Handle<v8::Context> context = v8::Context::GetCurrent();
@@ -572,22 +594,28 @@ WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context)
WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element)
{
- return WebFrameImpl::fromFrameOwnerElement(PassRefPtr<Element>(element).get());
+ return WebFrameImpl::fromFrameOwnerElement(
+ PassRefPtr<Element>(element).get());
+}
+
+WebString WebFrameImpl::name() const
+{
+ return m_frame->tree()->uniqueName();
}
WebString WebFrameImpl::uniqueName() const
{
- return frame()->tree()->uniqueName();
+ return m_frame->tree()->uniqueName();
}
WebString WebFrameImpl::assignedName() const
{
- return frame()->tree()->name();
+ return m_frame->tree()->name();
}
void WebFrameImpl::setName(const WebString& name)
{
- frame()->tree()->setName(name);
+ m_frame->tree()->setName(name);
}
long long WebFrameImpl::identifier() const
@@ -597,35 +625,39 @@ long long WebFrameImpl::identifier() const
WebVector<WebIconURL> WebFrameImpl::iconURLs(int iconTypes) const
{
+ FrameLoader* frameLoader = m_frame->loader();
// The URL to the icon may be in the header. As such, only
// ask the loader for the icon if it's finished loading.
- if (frame()->loader()->state() == FrameStateComplete)
- return frame()->loader()->icon()->urlsForTypes(iconTypes);
+ if (frameLoader->state() == FrameStateComplete)
+ return frameLoader->icon()->urlsForTypes(iconTypes);
return WebVector<WebIconURL>();
}
WebSize WebFrameImpl::scrollOffset() const
{
FrameView* view = frameView();
- if (!view)
- return WebSize();
- return view->scrollOffset();
+ if (view)
+ return view->scrollOffset();
+
+ return WebSize();
}
WebSize WebFrameImpl::minimumScrollOffset() const
{
FrameView* view = frameView();
- if (!view)
- return WebSize();
- return view->minimumScrollPosition() - IntPoint();
+ if (view)
+ return view->minimumScrollPosition() - IntPoint();
+
+ return WebSize();
}
WebSize WebFrameImpl::maximumScrollOffset() const
{
FrameView* view = frameView();
- if (!view)
- return WebSize();
- return view->maximumScrollPosition() - IntPoint();
+ if (view)
+ return view->maximumScrollPosition() - IntPoint();
+
+ return WebSize();
}
void WebFrameImpl::setScrollOffset(const WebSize& offset)
@@ -641,17 +673,18 @@ WebSize WebFrameImpl::contentsSize() const
int WebFrameImpl::contentsPreferredWidth() const
{
- if (frame()->document() && frame()->document()->renderView()) {
+ if (m_frame->document() && m_frame->document()->renderView()) {
FontCachePurgePreventer fontCachePurgePreventer;
- return frame()->document()->renderView()->minPreferredLogicalWidth();
+
+ return m_frame->document()->renderView()->minPreferredLogicalWidth();
}
return 0;
}
int WebFrameImpl::documentElementScrollHeight() const
{
- if (frame()->document() && frame()->document()->documentElement())
- return frame()->document()->documentElement()->scrollHeight();
+ if (m_frame->document() && m_frame->document()->documentElement())
+ return m_frame->document()->documentElement()->scrollHeight();
return 0;
}
@@ -662,12 +695,12 @@ bool WebFrameImpl::hasVisibleContent() const
bool WebFrameImpl::hasHorizontalScrollbar() const
{
- return frame() && frame()->view() && frame()->view()->horizontalScrollbar();
+ return m_frame && m_frame->view() && m_frame->view()->horizontalScrollbar();
}
bool WebFrameImpl::hasVerticalScrollbar() const
{
- return frame() && frame()->view() && frame()->view()->verticalScrollbar();
+ return m_frame && m_frame->view() && m_frame->view()->verticalScrollbar();
}
WebView* WebFrameImpl::view() const
@@ -677,76 +710,66 @@ WebView* WebFrameImpl::view() const
WebFrame* WebFrameImpl::opener() const
{
- if (!frame())
- return 0;
- return fromFrame(frame()->loader()->opener());
+ Frame* opener = 0;
+ if (m_frame)
+ opener = m_frame->loader()->opener();
+ return fromFrame(opener);
}
-void WebFrameImpl::setOpener(const WebFrame* webFrame)
+void WebFrameImpl::setOpener(const WebFrame* frame)
{
- frame()->loader()->setOpener(webFrame ? static_cast<const WebFrameImpl*>(webFrame)->frame() : 0);
+ m_frame->loader()->setOpener(frame ?
+ static_cast<const WebFrameImpl*>(frame)->m_frame : 0);
}
WebFrame* WebFrameImpl::parent() const
{
- if (!frame())
- return 0;
- return fromFrame(frame()->tree()->parent());
+ Frame* parent = 0;
+ if (m_frame)
+ parent = m_frame->tree()->parent();
+ return fromFrame(parent);
}
WebFrame* WebFrameImpl::top() const
{
- if (!frame())
- return 0;
- return fromFrame(frame()->tree()->top());
+ if (m_frame)
+ return fromFrame(m_frame->tree()->top());
+
+ return 0;
}
WebFrame* WebFrameImpl::firstChild() const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->firstChild());
}
WebFrame* WebFrameImpl::lastChild() const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->lastChild());
}
WebFrame* WebFrameImpl::nextSibling() const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->nextSibling());
}
WebFrame* WebFrameImpl::previousSibling() const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->previousSibling());
}
WebFrame* WebFrameImpl::traverseNext(bool wrap) const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->traverseNextWithWrap(wrap));
}
WebFrame* WebFrameImpl::traversePrevious(bool wrap) const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->traversePreviousWithWrap(wrap));
}
WebFrame* WebFrameImpl::findChildByName(const WebString& name) const
{
- if (!frame())
- return 0;
return fromFrame(frame()->tree()->child(name));
}
@@ -755,25 +778,33 @@ WebFrame* WebFrameImpl::findChildByExpression(const WebString& xpath) const
if (xpath.isEmpty())
return 0;
- Document* document = frame()->document();
+ Document* document = m_frame->document();
ExceptionCode ec = 0;
- RefPtr<XPathResult> xpathResult = document->evaluate(xpath, document, 0, XPathResult::ORDERED_NODE_ITERATOR_TYPE, 0, ec);
+ PassRefPtr<XPathResult> xpathResult =
+ document->evaluate(xpath,
+ document,
+ 0, // namespace
+ XPathResult::ORDERED_NODE_ITERATOR_TYPE,
+ 0, // XPathResult object
+ ec);
if (!xpathResult)
return 0;
Node* node = xpathResult->iterateNext(ec);
+
if (!node || !node->isFrameOwnerElement())
return 0;
- HTMLFrameOwnerElement* frameElement = static_cast<HTMLFrameOwnerElement*>(node);
+ HTMLFrameOwnerElement* frameElement =
+ static_cast<HTMLFrameOwnerElement*>(node);
return fromFrame(frameElement->contentFrame());
}
WebDocument WebFrameImpl::document() const
{
- if (!frame() || !frame()->document())
+ if (!m_frame || !m_frame->document())
return WebDocument();
- return WebDocument(frame()->document());
+ return WebDocument(m_frame->document());
}
WebAnimationController* WebFrameImpl::animationController()
@@ -783,49 +814,59 @@ WebAnimationController* WebFrameImpl::animationController()
WebPerformance WebFrameImpl::performance() const
{
- if (!frame())
+ if (!m_frame)
return WebPerformance();
- return WebPerformance(frame()->document()->domWindow()->performance());
+
+ return WebPerformance(m_frame->document()->domWindow()->performance());
}
NPObject* WebFrameImpl::windowObject() const
{
- if (!frame())
+ if (!m_frame)
return 0;
- return frame()->script()->windowScriptNPObject();
+
+ return m_frame->script()->windowScriptNPObject();
}
void WebFrameImpl::bindToWindowObject(const WebString& name, NPObject* object)
{
- if (!frame() || !frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
+ ASSERT(m_frame);
+ if (!m_frame || !m_frame->script()->canExecuteScripts(NotAboutToExecuteScript))
return;
- frame()->script()->bindToWindowObject(frame(), String(name), object);
+
+ String key = name;
+#if USE(V8)
+ m_frame->script()->bindToWindowObject(m_frame, key, object);
+#else
+ notImplemented();
+#endif
}
void WebFrameImpl::executeScript(const WebScriptSource& source)
{
- ASSERT(frame());
TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
- frame()->script()->executeScript(ScriptSourceCode(source.code, source.url, position));
+ m_frame->script()->executeScript(
+ ScriptSourceCode(source.code, source.url, position));
}
-void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup)
+void WebFrameImpl::executeScriptInIsolatedWorld(
+ int worldID, const WebScriptSource* sourcesIn, unsigned numSources,
+ int extensionGroup)
{
- ASSERT(frame());
-
Vector<ScriptSourceCode> sources;
+
for (unsigned i = 0; i < numSources; ++i) {
TextPosition position(OrdinalNumber::fromOneBasedInt(sourcesIn[i].startLine), OrdinalNumber::first());
- sources.append(ScriptSourceCode(sourcesIn[i].code, sourcesIn[i].url, position));
+ sources.append(ScriptSourceCode(
+ sourcesIn[i].code, sourcesIn[i].url, position));
}
- frame()->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0);
+ m_frame->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0);
}
void WebFrameImpl::setIsolatedWorldSecurityOrigin(int worldID, const WebSecurityOrigin& securityOrigin)
{
- ASSERT(frame());
- frame()->script()->setIsolatedWorldSecurityOrigin(worldID, securityOrigin.get());
+ m_frame->script()->setIsolatedWorldSecurityOrigin(worldID, securityOrigin.get());
}
void WebFrameImpl::addMessageToConsole(const WebConsoleMessage& message)
@@ -856,23 +897,27 @@ void WebFrameImpl::addMessageToConsole(const WebConsoleMessage& message)
void WebFrameImpl::collectGarbage()
{
- if (!frame())
+ if (!m_frame)
return;
- if (!frame()->settings()->isScriptEnabled())
+ if (!m_frame->settings()->isScriptEnabled())
return;
+ // FIXME: Move this to the ScriptController and make it JS neutral.
+#if USE(V8)
V8GCController::collectGarbage();
+#else
+ notImplemented();
+#endif
}
bool WebFrameImpl::checkIfRunInsecureContent(const WebURL& url) const
{
- ASSERT(frame());
- return frame()->loader()->checkIfRunInsecureContent(frame()->document()->securityOrigin(), url);
+ FrameLoader* frameLoader = m_frame->loader();
+ return frameLoader->checkIfRunInsecureContent(m_frame->document()->securityOrigin(), url);
}
+#if USE(V8)
v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(const WebScriptSource& source)
{
- ASSERT(frame());
-
// FIXME: This fake user gesture is required to make a bunch of pyauto
// tests pass. If this isn't needed in non-test situations, we should
// consider removing this code and changing the tests.
@@ -880,13 +925,13 @@ v8::Handle<v8::Value> WebFrameImpl::executeScriptAndReturnValue(const WebScriptS
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
- return frame()->script()->executeScript(ScriptSourceCode(source.code, source.url, position)).v8Value();
+ return m_frame->script()->executeScript(ScriptSourceCode(source.code, source.url, position)).v8Value();
}
-void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8::Value> >* results)
+void WebFrameImpl::executeScriptInIsolatedWorld(
+ int worldID, const WebScriptSource* sourcesIn, unsigned numSources,
+ int extensionGroup, WebVector<v8::Local<v8::Value> >* results)
{
- ASSERT(frame());
-
Vector<ScriptSourceCode> sources;
for (unsigned i = 0; i < numSources; ++i) {
@@ -896,69 +941,76 @@ void WebFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSour
if (results) {
Vector<ScriptValue> scriptResults;
- frame()->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, &scriptResults);
+ m_frame->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, &scriptResults);
WebVector<v8::Local<v8::Value> > v8Results(scriptResults.size());
for (unsigned i = 0; i < scriptResults.size(); i++)
v8Results[i] = v8::Local<v8::Value>::New(scriptResults[i].v8Value());
results->swap(v8Results);
} else
- frame()->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0);
+ m_frame->script()->evaluateInIsolatedWorld(worldID, sources, extensionGroup, 0);
}
-v8::Handle<v8::Value> WebFrameImpl::callFunctionEvenIfScriptDisabled(v8::Handle<v8::Function> function, v8::Handle<v8::Object> receiver, int argc, v8::Handle<v8::Value> argv[])
+// Call the function with the given receiver and arguments, bypassing canExecuteScripts.
+v8::Handle<v8::Value> WebFrameImpl::callFunctionEvenIfScriptDisabled(v8::Handle<v8::Function> function,
+ v8::Handle<v8::Object> receiver,
+ int argc,
+ v8::Handle<v8::Value> argv[])
{
- ASSERT(frame());
- return frame()->script()->callFunctionEvenIfScriptDisabled(function, receiver, argc, argv).v8Value();
+ return m_frame->script()->callFunctionEvenIfScriptDisabled(function, receiver, argc, argv).v8Value();
}
+// Returns the V8 context for this frame, or an empty handle if there is none.
v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const
{
- if (!frame())
+ if (!m_frame)
return v8::Local<v8::Context>();
- return ScriptController::mainWorldContext(frame());
+
+ return ScriptController::mainWorldContext(m_frame);
}
-v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type, const WebString& name, const WebString& path)
+v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type,
+ const WebString& name,
+ const WebString& path)
{
- ASSERT(frame());
return toV8(DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create()));
}
-v8::Handle<v8::Value> WebFrameImpl::createSerializableFileSystem(WebFileSystem::Type type, const WebString& name, const WebString& path)
+v8::Handle<v8::Value> WebFrameImpl::createSerializableFileSystem(WebFileSystem::Type type,
+ const WebString& name,
+ const WebString& path)
{
- ASSERT(frame());
- RefPtr<DOMFileSystem> fileSystem = DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create());
- fileSystem->makeClonable();
- return toV8(fileSystem.release());
+ RefPtr<DOMFileSystem> fs = DOMFileSystem::create(frame()->document(), name, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, path.utf8().data()), AsyncFileSystemChromium::create());
+ fs->makeClonable();
+ return toV8(fs.release());
}
-v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, const WebString& fileSystemName, const WebString& fileSystemPath, const WebString& filePath, bool isDirectory)
+v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type,
+ const WebString& fileSystemName,
+ const WebString& fileSystemPath,
+ const WebString& filePath,
+ bool isDirectory)
{
- ASSERT(frame());
-
RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, static_cast<WebCore::FileSystemType>(type), KURL(ParsedURLString, fileSystemPath.utf8().data()), AsyncFileSystemChromium::create());
if (isDirectory)
return toV8(DirectoryEntry::create(fileSystem, filePath));
return toV8(FileEntry::create(fileSystem, filePath));
}
+#endif
void WebFrameImpl::reload(bool ignoreCache)
{
- ASSERT(frame());
- frame()->loader()->history()->saveDocumentAndScrollState();
- frame()->loader()->reload(ignoreCache);
+ m_frame->loader()->history()->saveDocumentAndScrollState();
+ m_frame->loader()->reload(ignoreCache);
}
void WebFrameImpl::reloadWithOverrideURL(const WebURL& overrideUrl, bool ignoreCache)
{
- ASSERT(frame());
- frame()->loader()->history()->saveDocumentAndScrollState();
- frame()->loader()->reloadWithOverrideURL(overrideUrl, ignoreCache);
+ m_frame->loader()->history()->saveDocumentAndScrollState();
+ m_frame->loader()->reloadWithOverrideURL(overrideUrl, ignoreCache);
}
void WebFrameImpl::loadRequest(const WebURLRequest& request)
{
- ASSERT(frame());
ASSERT(!request.isNull());
const ResourceRequest& resourceRequest = request.toResourceRequest();
@@ -967,25 +1019,29 @@ void WebFrameImpl::loadRequest(const WebURLRequest& request)
return;
}
- frame()->loader()->load(resourceRequest, false);
+ m_frame->loader()->load(resourceRequest, false);
}
void WebFrameImpl::loadHistoryItem(const WebHistoryItem& item)
{
- ASSERT(frame());
RefPtr<HistoryItem> historyItem = PassRefPtr<HistoryItem>(item);
ASSERT(historyItem);
- frame()->loader()->prepareForHistoryNavigation();
- RefPtr<HistoryItem> currentItem = frame()->loader()->history()->currentItem();
+ m_frame->loader()->prepareForHistoryNavigation();
+ RefPtr<HistoryItem> currentItem = m_frame->loader()->history()->currentItem();
m_inSameDocumentHistoryLoad = currentItem && currentItem->shouldDoSameDocumentNavigationTo(historyItem.get());
- frame()->page()->goToItem(historyItem.get(), FrameLoadTypeIndexedBackForward);
+ m_frame->page()->goToItem(historyItem.get(),
+ FrameLoadTypeIndexedBackForward);
m_inSameDocumentHistoryLoad = false;
}
-void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, const WebString& textEncoding, const WebURL& baseURL, const WebURL& unreachableURL, bool replace)
+void WebFrameImpl::loadData(const WebData& data,
+ const WebString& mimeType,
+ const WebString& textEncoding,
+ const WebURL& baseURL,
+ const WebURL& unreachableURL,
+ bool replace)
{
- ASSERT(frame());
SubstituteData substData(data, mimeType, textEncoding, unreachableURL);
ASSERT(substData.isValid());
@@ -997,74 +1053,78 @@ void WebFrameImpl::loadData(const WebData& data, const WebString& mimeType, cons
// instead of the currently loaded URL.
ResourceRequest request;
if (replace && !unreachableURL.isEmpty())
- request = frame()->loader()->originalRequest();
+ request = m_frame->loader()->originalRequest();
request.setURL(baseURL);
- frame()->loader()->load(request, substData, false);
+ m_frame->loader()->load(request, substData, false);
if (replace) {
// Do this to force WebKit to treat the load as replacing the currently
// loaded page.
- frame()->loader()->setReplacing();
+ m_frame->loader()->setReplacing();
}
}
-void WebFrameImpl::loadHTMLString(const WebData& data, const WebURL& baseURL, const WebURL& unreachableURL, bool replace)
+void WebFrameImpl::loadHTMLString(const WebData& data,
+ const WebURL& baseURL,
+ const WebURL& unreachableURL,
+ bool replace)
{
- ASSERT(frame());
- loadData(data, WebString::fromUTF8("text/html"), WebString::fromUTF8("UTF-8"), baseURL, unreachableURL, replace);
+ loadData(data,
+ WebString::fromUTF8("text/html"),
+ WebString::fromUTF8("UTF-8"),
+ baseURL,
+ unreachableURL,
+ replace);
}
bool WebFrameImpl::isLoading() const
{
- if (!frame())
+ if (!m_frame)
return false;
- return frame()->loader()->isLoading();
+ return m_frame->loader()->isLoading();
}
void WebFrameImpl::stopLoading()
{
- if (!frame())
- return;
+ if (!m_frame)
+ return;
+
// FIXME: Figure out what we should really do here. It seems like a bug
// that FrameLoader::stopLoading doesn't call stopAllLoaders.
- frame()->loader()->stopAllLoaders();
- frame()->loader()->stopLoading(UnloadEventPolicyNone);
+ m_frame->loader()->stopAllLoaders();
+ m_frame->loader()->stopLoading(UnloadEventPolicyNone);
}
WebDataSource* WebFrameImpl::provisionalDataSource() const
{
- ASSERT(frame());
+ FrameLoader* frameLoader = m_frame->loader();
// We regard the policy document loader as still provisional.
- DocumentLoader* documentLoader = frame()->loader()->provisionalDocumentLoader();
- if (!documentLoader)
- documentLoader = frame()->loader()->policyDocumentLoader();
+ DocumentLoader* docLoader = frameLoader->provisionalDocumentLoader();
+ if (!docLoader)
+ docLoader = frameLoader->policyDocumentLoader();
- return DataSourceForDocLoader(documentLoader);
+ return DataSourceForDocLoader(docLoader);
}
WebDataSource* WebFrameImpl::dataSource() const
{
- ASSERT(frame());
- return DataSourceForDocLoader(frame()->loader()->documentLoader());
+ return DataSourceForDocLoader(m_frame->loader()->documentLoader());
}
WebHistoryItem WebFrameImpl::previousHistoryItem() const
{
- ASSERT(frame());
// We use the previous item here because documentState (filled-out forms)
// only get saved to history when it becomes the previous item. The caller
// is expected to query the history item after a navigation occurs, after
// the desired history item has become the previous entry.
- return WebHistoryItem(frame()->loader()->history()->previousItem());
+ return WebHistoryItem(m_frame->loader()->history()->previousItem());
}
WebHistoryItem WebFrameImpl::currentHistoryItem() const
{
- ASSERT(frame());
-
// We're shutting down.
- if (!frame()->loader()->activeDocumentLoader())
+ if (!m_frame->loader()->activeDocumentLoader())
return WebHistoryItem();
// If we are still loading, then we don't want to clobber the current
@@ -1072,30 +1132,35 @@ WebHistoryItem WebFrameImpl::currentHistoryItem() const
// document state. However, it is OK for new navigations.
// FIXME: Can we make this a plain old getter, instead of worrying about
// clobbering here?
- if (!m_inSameDocumentHistoryLoad && (frame()->loader()->loadType() == FrameLoadTypeStandard
- || !frame()->loader()->activeDocumentLoader()->isLoadingInAPISense()))
- frame()->loader()->history()->saveDocumentAndScrollState();
+ if (!m_inSameDocumentHistoryLoad && (m_frame->loader()->loadType() == FrameLoadTypeStandard
+ || !m_frame->loader()->activeDocumentLoader()->isLoadingInAPISense()))
+ m_frame->loader()->history()->saveDocumentAndScrollState();
- return WebHistoryItem(frame()->page()->backForward()->currentItem());
+ return WebHistoryItem(m_frame->page()->backForward()->currentItem());
}
void WebFrameImpl::enableViewSourceMode(bool enable)
{
- if (frame())
- frame()->setInViewSourceMode(enable);
+ if (m_frame)
+ m_frame->setInViewSourceMode(enable);
}
bool WebFrameImpl::isViewSourceModeEnabled() const
{
- if (!frame())
- return false;
- return frame()->inViewSourceMode();
+ if (m_frame)
+ return m_frame->inViewSourceMode();
+
+ return false;
}
void WebFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebURL& referrerURL)
{
- String referrer = referrerURL.isEmpty() ? frame()->loader()->outgoingReferrer() : String(referrerURL.spec().utf16());
- referrer = SecurityPolicy::generateReferrerHeader(frame()->document()->referrerPolicy(), request.url(), referrer);
+ String referrer;
+ if (referrerURL.isEmpty())
+ referrer = m_frame->loader()->outgoingReferrer();
+ else
+ referrer = referrerURL.spec().utf16();
+ referrer = SecurityPolicy::generateReferrerHeader(m_frame->document()->referrerPolicy(), request.url(), referrer);
if (referrer.isEmpty())
return;
request.setHTTPHeaderField(WebString::fromUTF8("Referer"), referrer);
@@ -1104,7 +1169,8 @@ void WebFrameImpl::setReferrerForRequest(WebURLRequest& request, const WebURL& r
void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request)
{
ResourceResponse response;
- frame()->loader()->client()->dispatchWillSendRequest(0, 0, request.toMutableResourceRequest(), response);
+ m_frame->loader()->client()->dispatchWillSendRequest(
+ 0, 0, request.toMutableResourceRequest(), response);
}
WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions& options)
@@ -1114,7 +1180,7 @@ WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions&
void WebFrameImpl::commitDocumentData(const char* data, size_t length)
{
- frame()->loader()->documentLoader()->commitData(data, length);
+ m_frame->loader()->documentLoader()->commitData(data, length);
}
unsigned WebFrameImpl::unloadListenerCount() const
@@ -1146,16 +1212,21 @@ void WebFrameImpl::replaceSelection(const WebString& text)
void WebFrameImpl::insertText(const WebString& text)
{
- if (frame()->editor()->hasComposition())
- frame()->editor()->confirmComposition(text);
+ Editor* editor = frame()->editor();
+
+ if (editor->hasComposition())
+ editor->confirmComposition(text);
else
- frame()->editor()->insertText(text, 0);
+ editor->insertText(text, 0);
}
-void WebFrameImpl::setMarkedText(const WebString& text, unsigned location, unsigned length)
+void WebFrameImpl::setMarkedText(
+ const WebString& text, unsigned location, unsigned length)
{
+ Editor* editor = frame()->editor();
+
Vector<CompositionUnderline> decorations;
- frame()->editor()->setComposition(text, decorations, location, length);
+ editor->setComposition(text, decorations, location, length);
}
void WebFrameImpl::unmarkText()
@@ -1184,6 +1255,7 @@ bool WebFrameImpl::firstRectForCharacterRange(unsigned location, unsigned length
IntRect intRect = frame()->editor()->firstRectForRange(range.get());
rect = WebRect(intRect);
rect = frame()->view()->contentsToWindow(rect);
+
return true;
}
@@ -1231,29 +1303,38 @@ bool WebFrameImpl::executeCommand(const WebString& name, const WebNode& node)
}
}
- bool result = true;
+ bool rv = true;
// Specially handling commands that Editor::execCommand does not directly
// support.
if (command == "DeleteToEndOfParagraph") {
- if (!frame()->editor()->deleteWithDirection(DirectionForward, ParagraphBoundary, true, false))
- frame()->editor()->deleteWithDirection(DirectionForward, CharacterGranularity, true, false);
+ Editor* editor = frame()->editor();
+ if (!editor->deleteWithDirection(DirectionForward,
+ ParagraphBoundary,
+ true,
+ false)) {
+ editor->deleteWithDirection(DirectionForward,
+ CharacterGranularity,
+ true,
+ false);
+ }
} else if (command == "Indent")
frame()->editor()->indent();
else if (command == "Outdent")
frame()->editor()->outdent();
else if (command == "DeleteBackward")
- result = frame()->editor()->command(AtomicString("BackwardDelete")).execute();
+ rv = frame()->editor()->command(AtomicString("BackwardDelete")).execute();
else if (command == "DeleteForward")
- result = frame()->editor()->command(AtomicString("ForwardDelete")).execute();
+ rv = frame()->editor()->command(AtomicString("ForwardDelete")).execute();
else if (command == "AdvanceToNextMisspelling") {
- // Wee need to pass false here or else the currently selected word will never be skipped.
+ // False must be passed here, or the currently selected word will never be
+ // skipped.
frame()->editor()->advanceToNextMisspelling(false);
} else if (command == "ToggleSpellPanel")
frame()->editor()->showSpellingGuessPanel();
else
- result = frame()->editor()->command(command).execute();
- return result;
+ rv = frame()->editor()->command(command).execute();
+ return rv;
}
bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value)
@@ -1261,7 +1342,8 @@ bool WebFrameImpl::executeCommand(const WebString& name, const WebString& value)
ASSERT(frame());
String webName = name;
- // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit for editable nodes.
+ // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit
+ // for editable nodes.
if (!frame()->editor()->canEdit() && webName == "moveToBeginningOfDocument")
return viewImpl()->propagateScroll(ScrollUp, ScrollByDocument);
@@ -1289,11 +1371,13 @@ bool WebFrameImpl::isContinuousSpellCheckingEnabled() const
return frame()->editor()->isContinuousSpellCheckingEnabled();
}
-void WebFrameImpl::requestTextChecking(const WebElement& webElement)
+void WebFrameImpl::requestTextChecking(const WebElement& webElem)
{
- if (webElement.isNull())
+ if (webElem.isNull())
return;
- RefPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*>(webElement.constUnwrap<Element>()));
+
+ RefPtr<Range> rangeToCheck = rangeOfContents(const_cast<Element*>(webElem.constUnwrap<Element>()));
+
frame()->editor()->spellChecker()->requestCheckingFor(SpellCheckRequest::create(TextCheckingTypeSpelling | TextCheckingTypeGrammar, TextCheckingProcessBatch, rangeToCheck, rangeToCheck));
}
@@ -1361,9 +1445,9 @@ WebString WebFrameImpl::selectionAsMarkup() const
return createMarkup(range.get(), 0, AnnotateForInterchange, false, ResolveNonLocalURLs);
}
-void WebFrameImpl::selectWordAroundPosition(Frame* frame, VisiblePosition position)
+void WebFrameImpl::selectWordAroundPosition(Frame* frame, VisiblePosition pos)
{
- VisibleSelection selection(position);
+ VisibleSelection selection(pos);
selection.expandUsingGranularity(WordGranularity);
if (frame->selection()->shouldChangeSelection(selection)) {
@@ -1384,33 +1468,42 @@ bool WebFrameImpl::selectWordAroundCaret()
void WebFrameImpl::selectRange(const WebPoint& base, const WebPoint& extent)
{
- VisiblePosition basePosition = visiblePositionForWindowPoint(base);
- VisiblePosition extentPosition = visiblePositionForWindowPoint(extent);
- VisibleSelection newSelection = VisibleSelection(basePosition, extentPosition);
+ VisiblePosition basePos = visiblePositionForWindowPoint(base);
+ VisiblePosition extentPos = visiblePositionForWindowPoint(extent);
+ VisibleSelection newSelection = VisibleSelection(basePos, extentPos);
if (frame()->selection()->shouldChangeSelection(newSelection))
frame()->selection()->setSelection(newSelection, CharacterGranularity);
}
void WebFrameImpl::selectRange(const WebRange& webRange)
{
- if (RefPtr<Range> range = static_cast<PassRefPtr<Range> >(webRange))
+ RefPtr<Range> range = static_cast<PassRefPtr<Range> >(webRange);
+ if (range)
frame()->selection()->setSelectedRange(range.get(), WebCore::VP_DEFAULT_AFFINITY, false);
}
VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point)
{
- HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
- HitTestResult result(frame()->view()->windowToContents(IntPoint(point)));
+ HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move;
+ hitType |= HitTestRequest::ReadOnly;
+ hitType |= HitTestRequest::Active;
+ hitType |= HitTestRequest::IgnoreClipping;
+ HitTestRequest request(hitType);
+ FrameView* view = frame()->view();
+ HitTestResult result(view->windowToContents(IntPoint(point.x, point.y)));
frame()->document()->renderView()->layer()->hitTest(request, result);
Node* node = result.targetNode();
if (!node)
return VisiblePosition();
+
return node->renderer()->positionForPoint(result.localPoint());
}
-int WebFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& constrainToNode, bool* useBrowserOverlays)
+int WebFrameImpl::printBegin(const WebPrintParams& printParams,
+ const WebNode& constrainToNode,
+ bool* useBrowserOverlays)
{
ASSERT(!frame()->document()->isFrameSet());
WebPluginContainerImpl* pluginContainer = 0;
@@ -1428,7 +1521,8 @@ int WebFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& c
else
m_printContext = adoptPtr(new ChromePrintContext(frame()));
- FloatRect rect(0, 0, static_cast<float>(printParams.printContentArea.width), static_cast<float>(printParams.printContentArea.height));
+ FloatRect rect(0, 0, static_cast<float>(printParams.printContentArea.width),
+ static_cast<float>(printParams.printContentArea.height));
m_printContext->begin(rect.width(), rect.height());
float pageHeight;
// We ignore the overlays calculation for now since they are generated in the
@@ -1442,19 +1536,29 @@ int WebFrameImpl::printBegin(const WebPrintParams& printParams, const WebNode& c
float WebFrameImpl::getPrintPageShrink(int page)
{
- ASSERT(m_printContext && page >= 0);
+ // Ensure correct state.
+ if (!m_printContext || page < 0) {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+
return m_printContext->getPageShrink(page);
}
float WebFrameImpl::printPage(int page, WebCanvas* canvas)
{
#if ENABLE(PRINTING)
- ASSERT(m_printContext && page >= 0 && frame() && frame()->document());
+ // Ensure correct state.
+ if (!m_printContext || page < 0 || !frame() || !frame()->document()) {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
GraphicsContextBuilder builder(canvas);
- GraphicsContext& graphicsContext = builder.context();
- graphicsContext.platformContext()->setPrinting(true);
- return m_printContext->spoolPage(graphicsContext, page);
+ GraphicsContext& gc = builder.context();
+ gc.platformContext()->setPrinting(true);
+
+ return m_printContext->spoolPage(gc, page);
#else
return 0;
#endif
@@ -1463,13 +1567,18 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas)
void WebFrameImpl::printEnd()
{
ASSERT(m_printContext);
- m_printContext->end();
+ if (m_printContext)
+ m_printContext->end();
m_printContext.clear();
}
bool WebFrameImpl::isPrintScalingDisabledForPlugin(const WebNode& node)
{
- WebPluginContainerImpl* pluginContainer = node.isNull() ? pluginContainerFromFrame(frame()) : pluginContainerFromNode(node);
+ WebPluginContainerImpl* pluginContainer = 0;
+ if (node.isNull())
+ pluginContainer = pluginContainerFromFrame(frame());
+ else
+ pluginContainer = pluginContainerFromNode(node);
if (!pluginContainer || !pluginContainer->supportsPaginatedPrint())
return false;
@@ -1487,24 +1596,35 @@ bool WebFrameImpl::isPageBoxVisible(int pageIndex)
return frame()->document()->isPageBoxVisible(pageIndex);
}
-void WebFrameImpl::pageSizeAndMarginsInPixels(int pageIndex, WebSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
-{
- IntSize size = pageSize;
- frame()->document()->pageSizeAndMarginsInPixels(pageIndex, size, marginTop, marginRight, marginBottom, marginLeft);
+void WebFrameImpl::pageSizeAndMarginsInPixels(int pageIndex,
+ WebSize& pageSize,
+ int& marginTop,
+ int& marginRight,
+ int& marginBottom,
+ int& marginLeft)
+{
+ IntSize size(pageSize.width, pageSize.height);
+ frame()->document()->pageSizeAndMarginsInPixels(pageIndex,
+ size,
+ marginTop,
+ marginRight,
+ marginBottom,
+ marginLeft);
pageSize = size;
}
WebString WebFrameImpl::pageProperty(const WebString& propertyName, int pageIndex)
{
ASSERT(m_printContext);
- return m_printContext->pageProperty(frame(), propertyName.utf8().data(), pageIndex);
+ return m_printContext->pageProperty(m_frame, propertyName.utf8().data(), pageIndex);
}
-bool WebFrameImpl::find(int identifier, const WebString& searchText, const WebFindOptions& options, bool wrapWithinFrame, WebRect* selectionRect)
+bool WebFrameImpl::find(int identifier,
+ const WebString& searchText,
+ const WebFindOptions& options,
+ bool wrapWithinFrame,
+ WebRect* selectionRect)
{
- if (!frame() || !frame()->page())
- return false;
-
WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
if (!options.findNext)
@@ -1598,19 +1718,20 @@ void WebFrameImpl::stopFinding(bool clearSelection)
invalidateArea(InvalidateAll);
}
-void WebFrameImpl::scopeStringMatches(int identifier, const WebString& searchText, const WebFindOptions& options, bool reset)
+void WebFrameImpl::scopeStringMatches(int identifier,
+ const WebString& searchText,
+ const WebFindOptions& options,
+ bool reset)
{
+ WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
+
if (reset) {
// This is a brand new search, so we need to reset everything.
// Scoping is just about to begin.
- m_scopingInProgress = true;
-
- // Need to keep the current identifier locally in order to finish the
- // request in case the frame is detached during the process.
- m_findRequestIdentifier = identifier;
+ m_scopingComplete = false;
// Clear highlighting for this frame.
- if (frame() && frame()->page() && frame()->editor()->markedTextMatchesAreHighlighted())
+ if (frame() && frame()->editor()->markedTextMatchesAreHighlighted())
frame()->page()->unmarkAllTextMatches();
// Clear the tickmarks and results cache.
@@ -1622,12 +1743,14 @@ void WebFrameImpl::scopeStringMatches(int identifier, const WebString& searchTex
m_resumeScopingFromRange = 0;
- // The view might be null on detached frames.
- if (frame() && frame()->page())
- viewImpl()->mainFrameImpl()->m_framesScopingCount++;
+ mainFrameImpl->m_framesScopingCount++;
// Now, defer scoping until later to allow find operation to finish quickly.
- scopeStringMatchesSoon(identifier, searchText, options, false); // false means just reset, so don't do it again.
+ scopeStringMatchesSoon(
+ identifier,
+ searchText,
+ options,
+ false); // false=we just reset, so don't do it again.
return;
}
@@ -1639,7 +1762,6 @@ void WebFrameImpl::scopeStringMatches(int identifier, const WebString& searchTex
return;
}
- WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
RefPtr<Range> searchRange(rangeOfContents(frame()->document()));
Node* originalEndContainer = searchRange->endContainer();
@@ -1769,29 +1891,20 @@ void WebFrameImpl::scopeStringMatches(int identifier, const WebString& searchTex
finishCurrentScopingEffort(identifier);
}
-void WebFrameImpl::flushCurrentScopingEffort(int identifier)
+void WebFrameImpl::finishCurrentScopingEffort(int identifier)
{
- if (!frame() || !frame()->page())
- return;
-
WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
// This frame has no further scoping left, so it is done. Other frames might,
// of course, continue to scope matches.
+ m_scopingComplete = true;
mainFrameImpl->m_framesScopingCount--;
+ m_lastFindRequestCompletedWithNoMatches = !m_lastMatchCount;
// If this is the last frame to finish scoping we need to trigger the final
// update to be sent.
if (!mainFrameImpl->m_framesScopingCount)
mainFrameImpl->increaseMatchCount(0, identifier);
-}
-
-void WebFrameImpl::finishCurrentScopingEffort(int identifier)
-{
- flushCurrentScopingEffort(identifier);
-
- m_scopingInProgress = false;
- m_lastFindRequestCompletedWithNoMatches = !m_lastMatchCount;
// This frame is done, so show any scrollbar tickmarks we haven't drawn yet.
invalidateArea(InvalidateScrollbar);
@@ -1804,11 +1917,8 @@ void WebFrameImpl::cancelPendingScopingEffort()
m_activeMatchIndexInCurrentFrame = -1;
- // Last request didn't complete.
- if (m_scopingInProgress)
+ if (!m_scopingComplete)
m_lastFindRequestCompletedWithNoMatches = false;
-
- m_scopingInProgress = false;
}
void WebFrameImpl::increaseMatchCount(int count, int identifier)
@@ -1826,7 +1936,9 @@ void WebFrameImpl::increaseMatchCount(int count, int identifier)
client()->reportFindInPageMatchCount(identifier, m_totalMatchCount, !m_framesScopingCount);
}
-void WebFrameImpl::reportFindInPageSelection(const WebRect& selectionRect, int activeMatchOrdinal, int identifier)
+void WebFrameImpl::reportFindInPageSelection(const WebRect& selectionRect,
+ int activeMatchOrdinal,
+ int identifier)
{
// Update the UI with the latest selection rect.
if (client())
@@ -1845,21 +1957,21 @@ void WebFrameImpl::resetMatchCount()
void WebFrameImpl::sendOrientationChangeEvent(int orientation)
{
#if ENABLE(ORIENTATION_EVENTS)
- if (frame())
- frame()->sendOrientationChangeEvent(orientation);
+ if (m_frame)
+ m_frame->sendOrientationChangeEvent(orientation);
#endif
}
void WebFrameImpl::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
- DOMWindow* window = frame()->document()->domWindow();
+ DOMWindow* window = m_frame->document()->domWindow();
EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, window);
window->addEventListener(eventType, adoptRef(listenerWrapper), useCapture);
}
void WebFrameImpl::removeEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
{
- DOMWindow* window = frame()->document()->domWindow();
+ DOMWindow* window = m_frame->document()->domWindow();
EventListenerWrapper* listenerWrapper = listener->getEventListenerWrapper(eventType, useCapture, window);
window->removeEventListener(eventType, listenerWrapper, useCapture);
}
@@ -1867,13 +1979,14 @@ void WebFrameImpl::removeEventListener(const WebString& eventType, WebDOMEventLi
bool WebFrameImpl::dispatchEvent(const WebDOMEvent& event)
{
ASSERT(!event.isNull());
- return frame()->document()->domWindow()->dispatchEvent(event);
+ return m_frame->document()->domWindow()->dispatchEvent(event);
}
void WebFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOrigin& intendedTargetOrigin, const WebDOMEvent& event)
{
ASSERT(!event.isNull());
- frame()->document()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0);
+ // Pass an empty call stack, since we don't have the one from the other process.
+ m_frame->document()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrigin.get(), event, 0);
}
int WebFrameImpl::findMatchMarkersVersion() const
@@ -1895,7 +2008,8 @@ bool WebFrameImpl::isActiveMatchFrameValid() const
{
WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
WebFrameImpl* activeMatchFrame = mainFrameImpl->activeMatchFrame();
- return activeMatchFrame && activeMatchFrame->m_activeMatch && activeMatchFrame->frame()->tree()->isDescendantOf(mainFrameImpl->frame());
+ return activeMatchFrame && activeMatchFrame->m_activeMatch
+ && activeMatchFrame->frame()->tree()->isDescendantOf(mainFrameImpl->frame());
}
void WebFrameImpl::updateFindMatchRects()
@@ -2079,41 +2193,44 @@ void WebFrameImpl::deliverIntent(const WebIntent& intent, WebMessagePortChannelA
(*channels)[i] = MessagePortChannel::create(platformChannel);
}
}
- OwnPtr<MessagePortArray> portArray = WebCore::MessagePort::entanglePorts(*(frame()->document()), channels.release());
+ OwnPtr<MessagePortArray> portArray = WebCore::MessagePort::entanglePorts(*(m_frame->document()), channels.release());
- RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(frame(), client.release(), intent.action(), intent.type(), intentData, portArray.release(), webcoreIntent->extras());
+ RefPtr<DeliveredIntent> deliveredIntent = DeliveredIntent::create(m_frame, client.release(), intent.action(), intent.type(), intentData, portArray.release(), webcoreIntent->extras());
- DOMWindowIntents::from(frame()->document()->domWindow())->deliver(deliveredIntent.release());
+ DOMWindowIntents::from(m_frame->document()->domWindow())->deliver(deliveredIntent.release());
#endif
}
WebString WebFrameImpl::contentAsText(size_t maxChars) const
{
- if (!frame())
+ if (!m_frame)
return WebString();
+
Vector<UChar> text;
- frameContentAsPlainText(maxChars, frame(), &text);
+ frameContentAsPlainText(maxChars, m_frame, &text);
return String::adopt(text);
}
WebString WebFrameImpl::contentAsMarkup() const
{
- if (!frame())
- return WebString();
- return createFullMarkup(frame()->document());
+ return createFullMarkup(m_frame->document());
}
WebString WebFrameImpl::renderTreeAsText(RenderAsTextControls toShow) const
{
RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal;
- if (toShow & RenderAsTextDebug)
- behavior |= RenderAsTextShowCompositedLayers | RenderAsTextShowAddresses | RenderAsTextShowIDAndClass | RenderAsTextShowLayerNesting;
+ if (toShow & RenderAsTextDebug) {
+ behavior |= RenderAsTextShowCompositedLayers
+ | RenderAsTextShowAddresses
+ | RenderAsTextShowIDAndClass
+ | RenderAsTextShowLayerNesting;
+ }
if (toShow & RenderAsTextPrinting)
behavior |= RenderAsTextPrintingMode;
- return externalRepresentation(frame(), behavior);
+ return externalRepresentation(m_frame, behavior);
}
WebString WebFrameImpl::markerTextForListItem(const WebElement& webElement) const
@@ -2123,34 +2240,36 @@ WebString WebFrameImpl::markerTextForListItem(const WebElement& webElement) cons
void WebFrameImpl::printPagesWithBoundaries(WebCanvas* canvas, const WebSize& pageSizeInPixels)
{
- ASSERT(m_printContext);
+ ASSERT(m_printContext.get());
GraphicsContextBuilder builder(canvas);
GraphicsContext& graphicsContext = builder.context();
graphicsContext.platformContext()->setPrinting(true);
- m_printContext->spoolAllPagesWithBoundaries(graphicsContext, FloatSize(pageSizeInPixels.width, pageSizeInPixels.height));
+ m_printContext->spoolAllPagesWithBoundaries(graphicsContext,
+ FloatSize(pageSizeInPixels.width, pageSizeInPixels.height));
}
WebRect WebFrameImpl::selectionBoundsRect() const
{
- return hasSelection() ? WebRect(IntRect(frame()->selection()->bounds(false))) : WebRect();
+ if (hasSelection())
+ return IntRect(frame()->selection()->bounds(false));
+
+ return WebRect();
}
bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) const
{
- if (!frame())
+ if (!m_frame)
return false;
- return frame()->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
+ return m_frame->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length);
}
WebString WebFrameImpl::layerTreeAsText(bool showDebugInfo) const
{
- if (!frame())
+ if (!m_frame)
return WebString();
-
- LayerTreeFlags flags = showDebugInfo ? LayerTreeFlagsIncludeDebugInfo : 0;
- return WebString(frame()->layerTreeAsText(flags));
+ return WebString(m_frame->layerTreeAsText(showDebugInfo));
}
// WebFrameImpl public ---------------------------------------------------------
@@ -2161,9 +2280,9 @@ PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client)
}
WebFrameImpl::WebFrameImpl(WebFrameClient* client)
- : FrameDestructionObserver(0)
- , m_frameLoaderClient(this)
+ : m_frameLoaderClient(this)
, m_client(client)
+ , m_frame(0)
, m_currentActiveMatchFrame(0)
, m_activeMatchIndexInCurrentFrame(-1)
, m_locatingActiveRect(false)
@@ -2171,8 +2290,7 @@ WebFrameImpl::WebFrameImpl(WebFrameClient* client)
, m_lastMatchCount(-1)
, m_totalMatchCount(-1)
, m_framesScopingCount(-1)
- , m_findRequestIdentifier(-1)
- , m_scopingInProgress(false)
+ , m_scopingComplete(false)
, m_lastFindRequestCompletedWithNoMatches(false)
, m_nextInvalidateAfter(0)
, m_findMatchMarkersVersion(0)
@@ -2193,16 +2311,10 @@ WebFrameImpl::~WebFrameImpl()
cancelPendingScopingEffort();
}
-void WebFrameImpl::setWebCoreFrame(WebCore::Frame* frame)
-{
- ASSERT(frame);
- observeFrame(frame);
-}
-
void WebFrameImpl::initializeAsMainFrame(WebCore::Page* page)
{
- RefPtr<Frame> mainFrame = Frame::create(page, 0, &m_frameLoaderClient);
- setWebCoreFrame(mainFrame.get());
+ RefPtr<Frame> frame = Frame::create(page, 0, &m_frameLoaderClient);
+ m_frame = frame.get();
// Add reference on behalf of FrameLoader. See comments in
// WebFrameLoaderClient::frameLoaderDestroyed for more info.
@@ -2210,10 +2322,11 @@ void WebFrameImpl::initializeAsMainFrame(WebCore::Page* page)
// We must call init() after m_frame is assigned because it is referenced
// during init().
- frame()->init();
+ m_frame->init();
}
-PassRefPtr<Frame> WebFrameImpl::createChildFrame(const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
+PassRefPtr<Frame> WebFrameImpl::createChildFrame(
+ const FrameLoadRequest& request, HTMLFrameOwnerElement* ownerElement)
{
RefPtr<WebFrameImpl> webframe(adoptRef(new WebFrameImpl(m_client)));
@@ -2222,12 +2335,13 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame(const FrameLoadRequest& request
// of this file for more info.
webframe->ref();
- RefPtr<Frame> childFrame = Frame::create(frame()->page(), ownerElement, &webframe->m_frameLoaderClient);
- webframe->setWebCoreFrame(childFrame.get());
+ RefPtr<Frame> childFrame = Frame::create(
+ m_frame->page(), ownerElement, &webframe->m_frameLoaderClient);
+ webframe->m_frame = childFrame.get();
childFrame->tree()->setName(request.frameName());
- frame()->tree()->appendChild(childFrame);
+ m_frame->tree()->appendChild(childFrame);
// Frame::init() can trigger onload event in the parent frame,
// which may detach this frame and trigger a null-pointer access
@@ -2242,7 +2356,10 @@ PassRefPtr<Frame> WebFrameImpl::createChildFrame(const FrameLoadRequest& request
if (!childFrame->tree()->parent())
return 0;
- frame()->loader()->loadURLIntoChildFrame(request.resourceRequest().url(), request.resourceRequest().httpReferrer(), childFrame.get());
+ m_frame->loader()->loadURLIntoChildFrame(
+ request.resourceRequest().url(),
+ request.resourceRequest().httpReferrer(),
+ childFrame.get());
// A synchronous navigation (about:blank) would have already processed
// onload, so it is possible for the frame to have already been destroyed by
@@ -2267,13 +2384,13 @@ void WebFrameImpl::didChangeContentsSize(const IntSize& size)
void WebFrameImpl::createFrameView()
{
- ASSERT(frame()); // If frame() doesn't exist, we probably didn't init properly.
+ ASSERT(m_frame); // If m_frame doesn't exist, we probably didn't init properly.
WebViewImpl* webView = viewImpl();
- bool isMainFrame = webView->mainFrameImpl()->frame() == frame();
- frame()->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
+ bool isMainFrame = webView->mainFrameImpl()->frame() == m_frame;
+ m_frame->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
if (webView->shouldAutoResize() && isMainFrame)
- frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
+ m_frame->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
if (isMainFrame && webView->devToolsAgentPrivate())
webView->devToolsAgentPrivate()->mainFrameViewCreated(this);
@@ -2283,23 +2400,29 @@ WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame)
{
if (!frame)
return 0;
+
return static_cast<FrameLoaderClientImpl*>(frame->loader()->client())->webFrame();
}
WebFrameImpl* WebFrameImpl::fromFrameOwnerElement(Element* element)
{
- // FIXME: Why do we check specifically for <iframe> and <frame> here? Why can't we get the WebFrameImpl from an <object> element, for example.
- if (!element || !element->isFrameOwnerElement() || (!element->hasTagName(HTMLNames::iframeTag) && !element->hasTagName(HTMLNames::frameTag)))
+ if (!element
+ || !element->isFrameOwnerElement()
+ || (!element->hasTagName(HTMLNames::iframeTag)
+ && !element->hasTagName(HTMLNames::frameTag)))
return 0;
- HTMLFrameOwnerElement* frameElement = static_cast<HTMLFrameOwnerElement*>(element);
+
+ HTMLFrameOwnerElement* frameElement =
+ static_cast<HTMLFrameOwnerElement*>(element);
return fromFrame(frameElement->contentFrame());
}
WebViewImpl* WebFrameImpl::viewImpl() const
{
- if (!frame())
+ if (!m_frame)
return 0;
- return WebViewImpl::fromPage(frame()->page());
+
+ return WebViewImpl::fromPage(m_frame->page());
}
WebDataSourceImpl* WebFrameImpl::dataSourceImpl() const
@@ -2385,7 +2508,14 @@ void WebFrameImpl::didFail(const ResourceError& error, bool wasProvisional)
void WebFrameImpl::setCanHaveScrollbars(bool canHaveScrollbars)
{
- frame()->view()->setCanHaveScrollbars(canHaveScrollbars);
+ m_frame->view()->setCanHaveScrollbars(canHaveScrollbars);
+}
+
+// WebFrameImpl private --------------------------------------------------------
+
+void WebFrameImpl::closing()
+{
+ m_frame = 0;
}
void WebFrameImpl::invalidateArea(AreaToInvalidate area)
@@ -2423,6 +2553,7 @@ void WebFrameImpl::setMarkerActive(Range* range, bool active)
WebCore::ExceptionCode ec;
if (!range || range->collapsed(ec))
return;
+
frame()->document()->markers()->setMarkersActive(range, active);
}
@@ -2432,7 +2563,9 @@ int WebFrameImpl::ordinalOfFirstMatchForFrame(WebFrameImpl* frame) const
WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
// Iterate from the main frame up to (but not including) |frame| and
// add up the number of matches found so far.
- for (WebFrameImpl* it = mainFrameImpl; it != frame; it = static_cast<WebFrameImpl*>(it->traverseNext(true))) {
+ for (WebFrameImpl* it = mainFrameImpl;
+ it != frame;
+ it = static_cast<WebFrameImpl*>(it->traverseNext(true))) {
if (it->m_lastMatchCount > 0)
ordinal += it->m_lastMatchCount;
}
@@ -2443,8 +2576,7 @@ bool WebFrameImpl::shouldScopeMatches(const String& searchText)
{
// Don't scope if we can't find a frame or a view.
// The user may have closed the tab/application, so abort.
- // Also ignore detached frames, as many find operations report to the main frame.
- if (!frame() || !frame()->view() || !frame()->page())
+ if (!frame() || !frame()->view())
return false;
ASSERT(frame()->document() && frame()->view());
@@ -2464,14 +2596,19 @@ bool WebFrameImpl::shouldScopeMatches(const String& searchText)
return true;
}
-void WebFrameImpl::scopeStringMatchesSoon(int identifier, const WebString& searchText, const WebFindOptions& options, bool reset)
+void WebFrameImpl::scopeStringMatchesSoon(int identifier, const WebString& searchText,
+ const WebFindOptions& options, bool reset)
{
- m_deferredScopingWork.append(new DeferredScopeStringMatches(this, identifier, searchText, options, reset));
+ m_deferredScopingWork.append(new DeferredScopeStringMatches(
+ this, identifier, searchText, options, reset));
}
-void WebFrameImpl::callScopeStringMatches(DeferredScopeStringMatches* caller, int identifier, const WebString& searchText, const WebFindOptions& options, bool reset)
+void WebFrameImpl::callScopeStringMatches(DeferredScopeStringMatches* caller,
+ int identifier, const WebString& searchText,
+ const WebFindOptions& options, bool reset)
{
m_deferredScopingWork.remove(m_deferredScopingWork.find(caller));
+
scopeStringMatches(identifier, searchText, options, reset);
// This needs to happen last since searchText is passed by reference.
@@ -2480,22 +2617,21 @@ void WebFrameImpl::callScopeStringMatches(DeferredScopeStringMatches* caller, in
void WebFrameImpl::invalidateIfNecessary()
{
- if (m_lastMatchCount <= m_nextInvalidateAfter)
- return;
-
- // FIXME: (http://b/1088165) Optimize the drawing of the tickmarks and
- // remove this. This calculation sets a milestone for when next to
- // invalidate the scrollbar and the content area. We do this so that we
- // don't spend too much time drawing the scrollbar over and over again.
- // Basically, up until the first 500 matches there is no throttle.
- // After the first 500 matches, we set set the milestone further and
- // further out (750, 1125, 1688, 2K, 3K).
- static const int startSlowingDownAfter = 500;
- static const int slowdown = 750;
-
- int i = m_lastMatchCount / startSlowingDownAfter;
- m_nextInvalidateAfter += i * slowdown;
- invalidateArea(InvalidateScrollbar);
+ if (m_lastMatchCount > m_nextInvalidateAfter) {
+ // FIXME: (http://b/1088165) Optimize the drawing of the tickmarks and
+ // remove this. This calculation sets a milestone for when next to
+ // invalidate the scrollbar and the content area. We do this so that we
+ // don't spend too much time drawing the scrollbar over and over again.
+ // Basically, up until the first 500 matches there is no throttle.
+ // After the first 500 matches, we set set the milestone further and
+ // further out (750, 1125, 1688, 2K, 3K).
+ static const int startSlowingDownAfter = 500;
+ static const int slowdown = 750;
+ int i = (m_lastMatchCount / startSlowingDownAfter);
+ m_nextInvalidateAfter += i * slowdown;
+
+ invalidateArea(InvalidateScrollbar);
+ }
}
void WebFrameImpl::loadJavaScriptURL(const KURL& url)
@@ -2508,41 +2644,24 @@ void WebFrameImpl::loadJavaScriptURL(const KURL& url)
// location change. We also allow a JS URL to be loaded even if scripts on
// the page are otherwise disabled.
- if (!frame()->document() || !frame()->page())
+ if (!m_frame->document() || !m_frame->page())
return;
- RefPtr<Document> ownerDocument(frame()->document());
+ RefPtr<Document> ownerDocument(m_frame->document());
// Protect privileged pages against bookmarklets and other javascript manipulations.
- if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs(frame()->document()->url().protocol()))
+ if (SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs(m_frame->document()->url().protocol()))
return;
String script = decodeURLEscapeSequences(url.string().substring(strlen("javascript:")));
- ScriptValue result = frame()->script()->executeScript(script, true);
+ ScriptValue result = m_frame->script()->executeScript(script, true);
String scriptResult;
if (!result.getString(scriptResult))
return;
- if (!frame()->navigationScheduler()->locationChangePending())
- frame()->document()->loader()->writer()->replaceDocument(scriptResult, ownerDocument.get());
-}
-
-void WebFrameImpl::willDetachPage()
-{
- if (!frame() || !frame()->page())
- return;
-
- // Do not expect string scoping results from any frames that got detached
- // in the middle of the operation.
- if (m_scopingInProgress) {
-
- // There is a possibility that the frame being detached was the only
- // pending one. We need to make sure final replies can be sent.
- flushCurrentScopingEffort(m_findRequestIdentifier);
-
- cancelPendingScopingEffort();
- }
+ if (!m_frame->navigationScheduler()->locationChangePending())
+ m_frame->document()->loader()->writer()->replaceDocument(scriptResult, ownerDocument.get());
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h
index 2686aad1d..a2fe797e3 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.h
+++ b/Source/WebKit/chromium/src/WebFrameImpl.h
@@ -35,7 +35,6 @@
#include "WebFrame.h"
#include "Frame.h"
-#include "FrameDestructionObserver.h"
#include "FrameLoaderClientImpl.h"
#include <wtf/Compiler.h>
#include <wtf/OwnPtr.h>
@@ -70,12 +69,10 @@ struct WebPrintParams;
template <typename T> class WebVector;
// Implementation of WebFrame, note that this is a reference counted object.
-class WebFrameImpl
- : public WebFrame
- , public RefCounted<WebFrameImpl>
- , public WebCore::FrameDestructionObserver {
+class WebFrameImpl : public WebFrame, public RefCounted<WebFrameImpl> {
public:
// WebFrame methods:
+ virtual WebString name() const;
virtual WebString uniqueName() const;
virtual WebString assignedName() const;
virtual void setName(const WebString&);
@@ -243,9 +240,6 @@ public:
virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const;
virtual WebString layerTreeAsText(bool showDebugInfo = false) const;
- // WebCore::FrameDestructionObserver methods.
- virtual void willDetachPage();
-
static PassRefPtr<WebFrameImpl> create(WebFrameClient* client);
virtual ~WebFrameImpl();
@@ -268,7 +262,8 @@ public:
WebViewImpl* viewImpl() const;
- WebCore::FrameView* frameView() const { return frame() ? frame()->view() : 0; }
+ WebCore::Frame* frame() const { return m_frame; }
+ WebCore::FrameView* frameView() const { return m_frame ? m_frame->view() : 0; }
// Getters for the impls corresponding to Get(Provisional)DataSource. They
// may return 0 if there is no corresponding data source.
@@ -330,10 +325,11 @@ private:
InvalidateAll // Both content area and the scrollbar.
};
- explicit WebFrameImpl(WebFrameClient*);
+ WebFrameImpl(WebFrameClient*);
- // Sets the local WebCore frame and registers destruction observers.
- void setWebCoreFrame(WebCore::Frame*);
+ // Informs the WebFrame that the Frame is being closed, called by the
+ // WebFrameLoaderClient
+ void closing();
// Notifies the delegate about a new selection rect.
void reportFindInPageSelection(
@@ -386,11 +382,6 @@ private:
// was searched.
bool shouldScopeMatches(const WTF::String& searchText);
- // Removes the current frame from the global scoping effort and triggers any
- // updates if appropriate. This method does not mark the scoping operation
- // as finished.
- void flushCurrentScopingEffort(int identifier);
-
// Finishes the current scoping effort and triggers any updates if appropriate.
void finishCurrentScopingEffort(int identifier);
@@ -416,6 +407,10 @@ private:
WebFrameClient* m_client;
+ // This is a weak pointer to our corresponding WebCore frame. A reference to
+ // ourselves is held while frame_ is valid. See our Closing method.
+ WebCore::Frame* m_frame;
+
// A way for the main frame to keep track of which frame has an active
// match. Should be 0 for all other frames.
WebFrameImpl* m_currentActiveMatchFrame;
@@ -443,7 +438,8 @@ private:
// Keeps track of how many matches this frame has found so far, so that we
// don't loose count between scoping efforts, and is also used (in conjunction
- // with m_lastSearchString) to figure out if we need to search the frame again.
+ // with m_lastSearchString and m_scopingComplete) to figure out if we need to
+ // search the frame again.
int m_lastMatchCount;
// This variable keeps a cumulative total of matches found so far for ALL the
@@ -456,12 +452,9 @@ private:
// It should be -1 for all other frames.
int m_framesScopingCount;
- // Identifier of the latest find-in-page request. Required to be stored in
- // the frame in order to reply if required in case the frame is detached.
- int m_findRequestIdentifier;
-
- // Keeps track of whether there is an scoping effort ongoing in the frame.
- bool m_scopingInProgress;
+ // Keeps track of whether the scoping effort was completed (the user may
+ // interrupt it before it completes by submitting a new search).
+ bool m_scopingComplete;
// Keeps track of whether the last find request completed its scoping effort
// without finding any matches in this frame.
diff --git a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp
index 21021ed37..a7948a78e 100644
--- a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp
+++ b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp
@@ -41,7 +41,7 @@
#include "WebGeolocationError.h"
#include "WebGeolocationPermissionRequest.h"
#include "WebGeolocationPosition.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebGeolocationError.cpp b/Source/WebKit/chromium/src/WebGeolocationError.cpp
index aa6e0d7fc..3869468c8 100644
--- a/Source/WebKit/chromium/src/WebGeolocationError.cpp
+++ b/Source/WebKit/chromium/src/WebGeolocationError.cpp
@@ -27,7 +27,7 @@
#include "WebGeolocationError.h"
#include "GeolocationError.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp b/Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp
index 533f6bc11..6d7ec631a 100644
--- a/Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp
+++ b/Source/WebKit/chromium/src/WebGeolocationPermissionRequest.cpp
@@ -31,7 +31,7 @@
#include "Geolocation.h"
#include "SecurityOrigin.h"
#include "WebSecurityOrigin.h"
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebGeolocationPermissionRequestManager.cpp b/Source/WebKit/chromium/src/WebGeolocationPermissionRequestManager.cpp
index 1eeac667b..4c0ed9cd7 100644
--- a/Source/WebKit/chromium/src/WebGeolocationPermissionRequestManager.cpp
+++ b/Source/WebKit/chromium/src/WebGeolocationPermissionRequestManager.cpp
@@ -64,7 +64,7 @@ bool WebGeolocationPermissionRequestManager::remove(const WebKit::WebGeolocation
GeolocationIdMap::iterator it = m_private->m_geolocationIdMap.find(geolocation);
if (it == m_private->m_geolocationIdMap.end())
return false;
- id = it->value;
+ id = it->second;
m_private->m_geolocationIdMap.remove(it);
m_private->m_idGeolocationMap.remove(id);
return true;
@@ -75,7 +75,7 @@ bool WebGeolocationPermissionRequestManager::remove(int id, WebKit::WebGeolocati
IdGeolocationMap::iterator it = m_private->m_idGeolocationMap.find(id);
if (it == m_private->m_idGeolocationMap.end())
return false;
- Geolocation* geolocation = it->value;
+ Geolocation* geolocation = it->second;
permissionRequest = WebGeolocationPermissionRequest(geolocation);
m_private->m_idGeolocationMap.remove(it);
m_private->m_geolocationIdMap.remove(geolocation);
diff --git a/Source/WebKit/chromium/src/WebHistoryItem.cpp b/Source/WebKit/chromium/src/WebHistoryItem.cpp
index 976594c9c..31d2bd564 100644
--- a/Source/WebKit/chromium/src/WebHistoryItem.cpp
+++ b/Source/WebKit/chromium/src/WebHistoryItem.cpp
@@ -36,11 +36,12 @@
#include "HistoryItem.h"
#include "KURL.h"
#include "SerializedScriptValue.h"
+
+#include "platform/WebHTTPBody.h"
+#include "platform/WebPoint.h"
#include "platform/WebSerializedScriptValue.h"
-#include <public/WebHTTPBody.h>
-#include <public/WebPoint.h>
-#include <public/WebString.h>
-#include <public/WebVector.h>
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebHitTestResult.cpp b/Source/WebKit/chromium/src/WebHitTestResult.cpp
index a839fb63e..5f806b80c 100644
--- a/Source/WebKit/chromium/src/WebHitTestResult.cpp
+++ b/Source/WebKit/chromium/src/WebHitTestResult.cpp
@@ -33,7 +33,8 @@
#include "RenderObject.h"
#include "VisiblePosition.h"
#include "WebNode.h"
-#include <public/WebPoint.h>
+
+#include "platform/WebPoint.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index e71029deb..b58cd5111 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -60,9 +60,9 @@ WebIDBMetadata WebIDBDatabaseImpl::metadata() const
return m_databaseBackend->metadata();
}
-WebIDBObjectStore* WebIDBDatabaseImpl::createObjectStore(long long id, const WebString& name, const WebIDBKeyPath& keyPath, bool autoIncrement, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+WebIDBObjectStore* WebIDBDatabaseImpl::createObjectStore(const WebString& name, const WebIDBKeyPath& keyPath, bool autoIncrement, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
- RefPtr<IDBObjectStoreBackendInterface> objectStore = m_databaseBackend->createObjectStore(id, name, keyPath, autoIncrement, transaction.getIDBTransactionBackendInterface(), ec);
+ RefPtr<IDBObjectStoreBackendInterface> objectStore = m_databaseBackend->createObjectStore(name, keyPath, autoIncrement, transaction.getIDBTransactionBackendInterface(), ec);
if (!objectStore) {
ASSERT(ec);
return 0;
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
index 769bdf5d0..518ffcdb9 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h
@@ -52,7 +52,7 @@ public:
virtual WebIDBMetadata metadata() const;
- virtual WebIDBObjectStore* createObjectStore(long long, const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&);
+ virtual WebIDBObjectStore* createObjectStore(const WebString& name, const WebIDBKeyPath&, bool autoIncrement, const WebIDBTransaction&, WebExceptionCode&);
virtual void deleteObjectStore(const WebString& name, const WebIDBTransaction&, WebExceptionCode&);
virtual void setVersion(const WebString& version, WebIDBCallbacks*, WebExceptionCode&);
virtual WebIDBTransaction* transaction(const WebDOMStringList& names, unsigned short mode, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp
index c78b3d98e..b094e77bd 100644
--- a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp
+++ b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp
@@ -30,7 +30,7 @@
#include "IDBKeyPath.h"
#include "platform/WebString.h"
-#include <public/WebVector.h>
+#include "platform/WebVector.h"
#include <wtf/Vector.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebIDBMetadata.cpp b/Source/WebKit/chromium/src/WebIDBMetadata.cpp
index dd1c2c8e5..01d878a0a 100644
--- a/Source/WebKit/chromium/src/WebIDBMetadata.cpp
+++ b/Source/WebKit/chromium/src/WebIDBMetadata.cpp
@@ -31,7 +31,7 @@
#include "IDBMetadata.h"
#include "WebIDBKeyPath.h"
#include "platform/WebString.h"
-#include <public/WebVector.h>
+#include "platform/WebVector.h"
using namespace WebCore;
@@ -43,21 +43,19 @@ WebIDBMetadata::WebIDBMetadata(const WebCore::IDBDatabaseMetadata& metadata)
version = metadata.version;
intVersion = metadata.intVersion;
objectStores = WebVector<ObjectStore>(static_cast<size_t>(metadata.objectStores.size()));
- maxObjectStoreId = metadata.maxObjectStoreId;
size_t i = 0;
for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator storeIterator = metadata.objectStores.begin(); storeIterator != metadata.objectStores.end(); ++storeIterator) {
- const IDBObjectStoreMetadata& objectStore = storeIterator->value;
+ 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()));
- webObjectStore.maxIndexId = objectStore.maxIndexId;
size_t j = 0;
for (IDBObjectStoreMetadata::IndexMap::const_iterator indexIterator = objectStore.indexes.begin(); indexIterator != objectStore.indexes.end(); ++indexIterator) {
- const IDBIndexMetadata& index = indexIterator->value;
+ const IDBIndexMetadata& index = indexIterator->second;
Index webIndex;
webIndex.name = index.name;
webIndex.keyPath = index.keyPath;
@@ -71,14 +69,14 @@ WebIDBMetadata::WebIDBMetadata(const WebCore::IDBDatabaseMetadata& metadata)
WebIDBMetadata::operator IDBDatabaseMetadata() const
{
- IDBDatabaseMetadata db(name, id, version, intVersion, maxObjectStoreId);
+ IDBDatabaseMetadata db(name, version, intVersion);
for (size_t i = 0; i < objectStores.size(); ++i) {
const ObjectStore webObjectStore = objectStores[i];
- IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.id, webObjectStore.keyPath, webObjectStore.autoIncrement, webObjectStore.maxIndexId);
+ 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.id, webIndex.keyPath, webIndex.unique, webIndex.multiEntry);
+ IDBIndexMetadata index(webIndex.name, webIndex.keyPath, webIndex.unique, webIndex.multiEntry);
objectStore.indexes.set(index.name, index);
}
db.objectStores.set(objectStore.name, objectStore);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index d814093f0..f5dd913c9 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -109,9 +109,9 @@ void WebIDBObjectStoreImpl::clear(WebIDBCallbacks* callbacks, const WebIDBTransa
m_objectStore->clear(IDBCallbacksProxy::create(adoptPtr(callbacks)), transaction.getIDBTransactionBackendInterface(), ec);
}
-WebIDBIndex* WebIDBObjectStoreImpl::createIndex(long long id, const WebString& name, const WebIDBKeyPath& keyPath, bool unique, bool multiEntry, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+WebIDBIndex* WebIDBObjectStoreImpl::createIndex(const WebString& name, const WebIDBKeyPath& keyPath, bool unique, bool multiEntry, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
- RefPtr<IDBIndexBackendInterface> index = m_objectStore->createIndex(id, name, keyPath, unique, multiEntry, transaction.getIDBTransactionBackendInterface(), ec);
+ RefPtr<IDBIndexBackendInterface> index = m_objectStore->createIndex(name, keyPath, unique, multiEntry, transaction.getIDBTransactionBackendInterface(), ec);
if (!index)
return 0;
return new WebIDBIndexImpl(index);
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index 7e9ed2573..04020e558 100644
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -52,7 +52,7 @@ public:
void deleteFunction(const WebIDBKeyRange&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void clear(WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
- WebIDBIndex* createIndex(long long, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry, const WebIDBTransaction&, WebExceptionCode&);
+ WebIDBIndex* createIndex(const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry, const WebIDBTransaction&, WebExceptionCode&);
WebIDBIndex* index(const WebString& name, WebExceptionCode&);
void deleteIndex(const WebString& name, const WebIDBTransaction&, WebExceptionCode&);
diff --git a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h
index 66e315300..323e2be59 100644
--- a/Source/WebKit/chromium/src/WebIDBTransactionImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBTransactionImpl.h
@@ -28,8 +28,8 @@
#if ENABLE(INDEXED_DATABASE)
+#include "platform/WebCommon.h"
#include "WebIDBTransaction.h"
-#include <public/WebCommon.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h b/Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h
index 305db8f3c..d6d66db56 100644
--- a/Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h
+++ b/Source/WebKit/chromium/src/WebIconLoadingCompletionImpl.h
@@ -32,8 +32,8 @@
#define WebIconLoadingCompletionImpl_h
#include "FileIconLoader.h"
+#include "platform/WebData.h"
#include "WebIconLoadingCompletion.h"
-#include <public/WebData.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebImageDecoder.cpp b/Source/WebKit/chromium/src/WebImageDecoder.cpp
index 104ab13fb..ad0a67e51 100644
--- a/Source/WebKit/chromium/src/WebImageDecoder.cpp
+++ b/Source/WebKit/chromium/src/WebImageDecoder.cpp
@@ -34,11 +34,14 @@
#include "BMPImageDecoder.h"
#include "ICOImageDecoder.h"
#include "SharedBuffer.h"
-#include <public/WebData.h>
+#include "platform/WebData.h"
+#include "platform/WebSize.h"
+
#include <public/WebImage.h>
-#include <public/WebSize.h>
+
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
+
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebImageSkia.cpp b/Source/WebKit/chromium/src/WebImageSkia.cpp
index 9e92f3189..0198a6806 100644
--- a/Source/WebKit/chromium/src/WebImageSkia.cpp
+++ b/Source/WebKit/chromium/src/WebImageSkia.cpp
@@ -34,10 +34,12 @@
#include "ImageDecoder.h"
#include "NativeImageSkia.h"
#include "SharedBuffer.h"
+
+#include "platform/WebData.h"
+#include "platform/WebSize.h"
+
#include <algorithm>
-#include <public/WebData.h>
#include <public/WebImage.h>
-#include <public/WebSize.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -123,7 +125,7 @@ WebVector<WebImage> WebImage::framesFromData(const WebData& data)
continue;
OwnPtr<NativeImageSkia> image = adoptPtr(frame->asNewNativeImage());
- if (image.get() && image->isDataComplete())
+ if (image.get())
frames.append(WebImage(image->bitmap()));
}
diff --git a/Source/WebKit/chromium/src/WebInputElement.cpp b/Source/WebKit/chromium/src/WebInputElement.cpp
index bdc9f5db2..791b2ebff 100644
--- a/Source/WebKit/chromium/src/WebInputElement.cpp
+++ b/Source/WebKit/chromium/src/WebInputElement.cpp
@@ -41,7 +41,7 @@
#include "TextFieldDecoratorImpl.h"
#include "WebNodeCollection.h"
#include "WebTextFieldDecoratorClient.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
index 0f4f6d5a8..0cc1e0c24 100644
--- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -39,7 +39,6 @@
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
#include "PlatformWheelEvent.h"
-#include "RenderObject.h"
#include "ScrollView.h"
#include "Touch.h"
#include "TouchEvent.h"
@@ -208,7 +207,7 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W
// MakePlatformKeyboardEvent --------------------------------------------------
-inline PlatformEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type)
+static inline PlatformEvent::Type toPlatformKeyboardEventType(WebInputEvent::Type type)
{
switch (type) {
case WebInputEvent::KeyUp:
@@ -301,7 +300,7 @@ bool PlatformKeyboardEventBuilder::isCharacterKey() const
}
#if ENABLE(TOUCH_EVENTS)
-inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type type)
+static inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type type)
{
switch (type) {
case WebInputEvent::TouchStart:
@@ -318,7 +317,7 @@ inline PlatformEvent::Type toPlatformTouchEventType(const WebInputEvent::Type ty
return PlatformEvent::TouchStart;
}
-inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::State state)
+static inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::State state)
{
switch (state) {
case WebTouchPoint::StateReleased:
@@ -337,19 +336,6 @@ inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::
return PlatformTouchPoint::TouchReleased;
}
-inline WebTouchPoint::State toWebTouchPointState(const AtomicString& type)
-{
- if (type == eventNames().touchendEvent)
- return WebTouchPoint::StateReleased;
- if (type == eventNames().touchcancelEvent)
- return WebTouchPoint::StateCancelled;
- if (type == eventNames().touchstartEvent)
- return WebTouchPoint::StatePressed;
- if (type == eventNames().touchmoveEvent)
- return WebTouchPoint::StateMoved;
- return WebTouchPoint::StateUndefined;
-}
-
PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTouchPoint& point)
{
m_id = point.id;
@@ -397,28 +383,7 @@ static int getWebInputModifiers(const UIEventWithKeyState& event)
return modifiers;
}
-static IntPoint convertLocationForRenderObject(const LayoutPoint& location, const WebCore::RenderObject& renderObject)
-{
- return roundedIntPoint(renderObject.absoluteToLocal(location, UseTransforms | SnapOffsetForTransforms));
-}
-
-static void updateWebMouseEventFromWebCoreMouseEvent(const MouseEvent& event, const Widget& widget, const WebCore::RenderObject& renderObject, WebMouseEvent& webEvent)
-{
- webEvent.timeStampSeconds = event.timeStamp() / millisPerSecond;
- webEvent.modifiers = getWebInputModifiers(event);
-
- ScrollView* view = widget.parent();
- IntPoint windowPoint = view->contentsToWindow(IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
- webEvent.globalX = event.screenX();
- webEvent.globalY = event.screenY();
- webEvent.windowX = windowPoint.x();
- webEvent.windowY = windowPoint.y();
- IntPoint localPoint = convertLocationForRenderObject(event.absoluteLocation(), renderObject);
- webEvent.x = localPoint.x();
- webEvent.y = localPoint.y();
-}
-
-WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const MouseEvent& event)
+WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const MouseEvent& event)
{
if (event.type() == eventNames().mousemoveEvent)
type = WebInputEvent::MouseMove;
@@ -434,9 +399,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const WebCore::
type = WebInputEvent::ContextMenu;
else
return; // Skip all other mouse events.
-
- updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *this);
-
+ timeStampSeconds = event.timeStamp() / millisPerSecond;
switch (event.button()) {
case LeftButton:
button = WebMouseEvent::ButtonLeft;
@@ -448,6 +411,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const WebCore::
button = WebMouseEvent::ButtonRight;
break;
}
+ modifiers = getWebInputModifiers(event);
if (event.buttonDown()) {
switch (event.button()) {
case LeftButton:
@@ -461,6 +425,15 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const WebCore::
break;
}
}
+ ScrollView* view = widget->parent();
+ IntPoint p = view->contentsToWindow(
+ IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
+ globalX = event.screenX();
+ globalY = event.screenY();
+ windowX = p.x();
+ windowY = p.y();
+ x = event.absoluteLocation().x() - widget->location().x();
+ y = event.absoluteLocation().y() - widget->location().y();
#if ENABLE(POINTER_LOCK)
movementX = event.webkitMovementX();
movementY = event.webkitMovementY();
@@ -468,12 +441,22 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const WebCore::
clickCount = event.detail();
}
-WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const WheelEvent& event)
+WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WheelEvent& event)
{
if (event.type() != eventNames().mousewheelEvent)
return;
type = WebInputEvent::MouseWheel;
- updateWebMouseEventFromWebCoreMouseEvent(event, *widget, *renderObject, *this);
+ timeStampSeconds = event.timeStamp() / millisPerSecond;
+ modifiers = getWebInputModifiers(event);
+ ScrollView* view = widget->parent();
+ IntPoint p = view->contentsToWindow(
+ IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y()));
+ globalX = event.screenX();
+ globalY = event.screenY();
+ windowX = p.x();
+ windowY = p.y();
+ x = event.absoluteLocation().x() - widget->location().x();
+ y = event.absoluteLocation().y() - widget->location().y();
deltaX = static_cast<float>(event.rawDeltaX());
deltaY = static_cast<float>(event.rawDeltaY());
// The 120 is from WheelEvent::initWheelEvent().
@@ -519,7 +502,7 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
#if ENABLE(TOUCH_EVENTS)
-static void addTouchPoints(const AtomicString& touchType, TouchList* touches, WebTouchPoint* touchPoints, unsigned* touchPointsLength, const WebCore::RenderObject* renderObject)
+static void addTouchPoints(TouchList* touches, const IntPoint& offset, WebTouchPoint* touchPoints, unsigned* touchPointsLength)
{
unsigned numberOfTouches = std::min(touches->length(), static_cast<unsigned>(WebTouchEvent::touchesLengthCap));
for (unsigned i = 0; i < numberOfTouches; ++i) {
@@ -528,19 +511,18 @@ static void addTouchPoints(const AtomicString& touchType, TouchList* touches, We
WebTouchPoint point;
point.id = touch->identifier();
point.screenPosition = WebPoint(touch->screenX(), touch->screenY());
- point.position = convertLocationForRenderObject(LayoutPoint(IntPoint(touch->pageX(), touch->pageY())), *renderObject);
+ point.position = WebPoint(touch->pageX() - offset.x(), touch->pageY() - offset.y());
point.radiusX = touch->webkitRadiusX();
point.radiusY = touch->webkitRadiusY();
point.rotationAngle = touch->webkitRotationAngle();
point.force = touch->webkitForce();
- point.state = toWebTouchPointState(touchType);
touchPoints[i] = point;
}
*touchPointsLength = numberOfTouches;
}
-WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const TouchEvent& event)
+WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const TouchEvent& event)
{
if (event.type() == eventNames().touchstartEvent)
type = TouchStart;
@@ -559,15 +541,15 @@ WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const WebCore::
modifiers = getWebInputModifiers(event);
timeStampSeconds = event.timeStamp() / millisPerSecond;
- addTouchPoints(event.type(), event.touches(), touches, &touchesLength, renderObject);
- addTouchPoints(event.type(), event.changedTouches(), changedTouches, &changedTouchesLength, renderObject);
- addTouchPoints(event.type(), event.targetTouches(), targetTouches, &targetTouchesLength, renderObject);
+ addTouchPoints(event.touches(), widget->location(), touches, &touchesLength);
+ addTouchPoints(event.changedTouches(), widget->location(), changedTouches, &changedTouchesLength);
+ addTouchPoints(event.targetTouches(), widget->location(), targetTouches, &targetTouchesLength);
}
#endif // ENABLE(TOUCH_EVENTS)
#if ENABLE(GESTURE_EVENTS)
-WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const GestureEvent& event)
+WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const GestureEvent& event)
{
if (event.type() == eventNames().gesturetapEvent)
type = GestureTap;
@@ -588,9 +570,8 @@ WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const WebCo
globalX = event.screenX();
globalY = event.screenY();
- IntPoint localPoint = convertLocationForRenderObject(event.absoluteLocation(), *renderObject);
- x = localPoint.x();
- y = localPoint.y();
+ x = event.absoluteLocation().x() - widget->location().x();
+ y = event.absoluteLocation().y() - widget->location().y();
}
#endif // ENABLE(GESTURE_EVENTS)
diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.h b/Source/WebKit/chromium/src/WebInputEventConversion.h
index 3512646eb..48975a404 100644
--- a/Source/WebKit/chromium/src/WebInputEventConversion.h
+++ b/Source/WebKit/chromium/src/WebInputEventConversion.h
@@ -42,10 +42,9 @@ namespace WebCore {
class GestureEvent;
class KeyboardEvent;
class MouseEvent;
-class RenderObject;
class ScrollView;
-class TouchEvent;
class WheelEvent;
+class TouchEvent;
class Widget;
}
@@ -98,20 +97,21 @@ public:
};
#endif
-// Converts a WebCore::MouseEvent to a corresponding WebMouseEvent.
+// Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. view is
+// the ScrollView corresponding to the event.
// NOTE: This is only implemented for mousemove, mouseover, mouseout,
// mousedown and mouseup. If the event mapping fails, the event type will
// be set to Undefined.
class WebMouseEventBuilder : public WebMouseEvent {
public:
- WebMouseEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, const WebCore::MouseEvent&);
+ WebMouseEventBuilder(const WebCore::Widget*, const WebCore::MouseEvent&);
};
// Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent.
// If the event mapping fails, the event type will be set to Undefined.
class WebMouseWheelEventBuilder : public WebMouseWheelEvent {
public:
- WebMouseWheelEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, const WebCore::WheelEvent&);
+ WebMouseWheelEventBuilder(const WebCore::Widget*, const WebCore::WheelEvent&);
};
// Converts a WebCore::KeyboardEvent to a corresponding WebKeyboardEvent.
@@ -128,7 +128,7 @@ public:
// exceeding that cap will be dropped.
class WebTouchEventBuilder : public WebTouchEvent {
public:
- WebTouchEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, const WebCore::TouchEvent&);
+ WebTouchEventBuilder(const WebCore::Widget*, const WebCore::TouchEvent&);
};
#endif // ENABLE(TOUCH_EVENTS)
@@ -137,7 +137,7 @@ public:
// NOTE: If event mapping fails, the type will be set to Undefined.
class WebGestureEventBuilder : public WebGestureEvent {
public:
- WebGestureEventBuilder(const WebCore::Widget*, const WebCore::RenderObject*, const WebCore::GestureEvent&);
+ WebGestureEventBuilder(const WebCore::Widget*, const WebCore::GestureEvent&);
};
#endif // ENABLE(GESTURE_EVENTS)
diff --git a/Source/WebKit/chromium/src/WebIntent.cpp b/Source/WebKit/chromium/src/WebIntent.cpp
index 041c7f2e9..55775ecfc 100644
--- a/Source/WebKit/chromium/src/WebIntent.cpp
+++ b/Source/WebKit/chromium/src/WebIntent.cpp
@@ -188,7 +188,7 @@ WebString WebIntent::extrasValue(const WebString& name) const
WTF::HashMap<String, String>::const_iterator val = m_private->extras().find(name);
if (val == m_private->extras().end())
return WebString();
- return val->value;
+ return val->second;
#else
return WebString();
#endif
diff --git a/Source/WebKit/chromium/src/WebKit.cpp b/Source/WebKit/chromium/src/WebKit.cpp
index e357f28e4..9331d053a 100644
--- a/Source/WebKit/chromium/src/WebKit.cpp
+++ b/Source/WebKit/chromium/src/WebKit.cpp
@@ -44,10 +44,10 @@
#include "WebSocket.h"
#include "WorkerContextExecutionProxy.h"
#include "platform/WebKitPlatformSupport.h"
+#include "platform/WebThread.h"
#include "v8.h"
#include <public/Platform.h>
#include <public/WebPrerenderingSupport.h>
-#include <public/WebThread.h>
#include <wtf/Assertions.h>
#include <wtf/MainThread.h>
#include <wtf/Threading.h>
diff --git a/Source/WebKit/chromium/src/WebLabelElement.cpp b/Source/WebKit/chromium/src/WebLabelElement.cpp
index 4480ae89d..15ef3bbe3 100644
--- a/Source/WebKit/chromium/src/WebLabelElement.cpp
+++ b/Source/WebKit/chromium/src/WebLabelElement.cpp
@@ -33,7 +33,7 @@
#include "HTMLLabelElement.h"
#include "HTMLNames.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebMediaStreamRegistry.cpp b/Source/WebKit/chromium/src/WebMediaStreamRegistry.cpp
index d1ad60620..7ec559d24 100644
--- a/Source/WebKit/chromium/src/WebMediaStreamRegistry.cpp
+++ b/Source/WebKit/chromium/src/WebMediaStreamRegistry.cpp
@@ -37,9 +37,9 @@
#include "KURL.h"
#include "MediaStreamDescriptor.h"
#include "MediaStreamRegistry.h"
-#include <public/WebMediaStreamDescriptor.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebMediaStreamDescriptor.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp
index 27d57cfbc..c5e836d4a 100644
--- a/Source/WebKit/chromium/src/WebNode.cpp
+++ b/Source/WebKit/chromium/src/WebNode.cpp
@@ -37,6 +37,7 @@
#include "FrameLoaderClientImpl.h"
#include "Node.h"
#include "NodeList.h"
+
#include "EventListenerWrapper.h"
#include "WebDOMEvent.h"
#include "WebDOMEventListener.h"
@@ -44,9 +45,10 @@
#include "WebElement.h"
#include "WebFrameImpl.h"
#include "WebNodeList.h"
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
+
#include "markup.h"
-#include <public/WebString.h>
-#include <public/WebVector.h>
using namespace WebCore;
@@ -223,13 +225,6 @@ bool WebNode::focused() const
return m_private->focused();
}
-bool WebNode::remove()
-{
- ExceptionCode exceptionCode = 0;
- m_private->remove(exceptionCode);
- return !exceptionCode;
-}
-
bool WebNode::hasNonEmptyBoundingBox() const
{
m_private->document()->updateLayoutIgnorePendingStylesheets();
diff --git a/Source/WebKit/chromium/src/WebNotification.cpp b/Source/WebKit/chromium/src/WebNotification.cpp
index c8fe815c4..54209fd97 100644
--- a/Source/WebKit/chromium/src/WebNotification.cpp
+++ b/Source/WebKit/chromium/src/WebNotification.cpp
@@ -37,9 +37,11 @@
#include "Notification.h"
#include "UserGestureIndicator.h"
#include "WindowFocusAllowedIndicator.h"
+
+#include "platform/WebString.h"
#include "WebTextDirection.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
+
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebOptionElement.cpp b/Source/WebKit/chromium/src/WebOptionElement.cpp
index b511697b4..1d50a053e 100644
--- a/Source/WebKit/chromium/src/WebOptionElement.cpp
+++ b/Source/WebKit/chromium/src/WebOptionElement.cpp
@@ -34,7 +34,7 @@
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
#include "HTMLSelectElement.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
index e4808fd70..1e0fcebb5 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
@@ -151,14 +151,15 @@ WebPagePopupImpl::~WebPagePopupImpl()
ASSERT(!m_page);
}
-bool WebPagePopupImpl::init(WebViewImpl* webView, PagePopupClient* popupClient, const IntRect&)
+bool WebPagePopupImpl::init(WebViewImpl* webView, PagePopupClient* popupClient, const IntRect& originBoundsInRootView)
{
ASSERT(webView);
ASSERT(popupClient);
m_webView = webView;
m_popupClient = popupClient;
+ m_originBoundsInRootView = originBoundsInRootView;
- resize(m_popupClient->contentSize());
+ reposition(m_popupClient->contentSize());
if (!initPage())
return false;
@@ -232,10 +233,22 @@ void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOption
PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque);
}
+void WebPagePopupImpl::reposition(const WebSize& popupSize)
+{
+ WebSize rootViewSize = m_webView->size();
+ IntRect popupBoundsInRootView(IntPoint(max(0, m_originBoundsInRootView.x()), max(0, m_originBoundsInRootView.maxY())), popupSize);
+ if (popupBoundsInRootView.maxY() > rootViewSize.height)
+ popupBoundsInRootView.setY(max(0, m_originBoundsInRootView.y() - popupSize.height));
+ if (popupBoundsInRootView.maxX() > rootViewSize.width)
+ popupBoundsInRootView.setX(max(0, rootViewSize.width - popupSize.width));
+ IntRect boundsInScreen = m_webView->page()->chrome()->rootViewToScreen(popupBoundsInRootView);
+ m_widgetClient->setWindowRect(boundsInScreen);
+ m_windowRectInScreen = boundsInScreen;
+}
+
void WebPagePopupImpl::resize(const WebSize& newSize)
{
- m_windowRectInScreen = WebRect(m_windowRectInScreen.x, m_windowRectInScreen.y, newSize.width, newSize.height);
- m_widgetClient->setWindowRect(m_windowRectInScreen);
+ reposition(newSize);
if (m_page)
m_page->mainFrame()->view()->resize(newSize);
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.h b/Source/WebKit/chromium/src/WebPagePopupImpl.h
index cf2bbba78..e6844bfd0 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.h
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.h
@@ -87,9 +87,11 @@ private:
explicit WebPagePopupImpl(WebWidgetClient*);
bool initPage();
+ void reposition(const WebSize&);
WebWidgetClient* m_widgetClient;
WebRect m_windowRectInScreen;
+ WebCore::IntRect m_originBoundsInRootView;
WebViewImpl* m_webView;
OwnPtr<WebCore::Page> m_page;
OwnPtr<PagePopupChromeClient> m_chromeClient;
diff --git a/Source/WebKit/chromium/src/WebPageSerializer.cpp b/Source/WebKit/chromium/src/WebPageSerializer.cpp
index 6b4a4cbd3..1d771fb00 100644
--- a/Source/WebKit/chromium/src/WebPageSerializer.cpp
+++ b/Source/WebKit/chromium/src/WebPageSerializer.cpp
@@ -41,16 +41,17 @@
#include "KURL.h"
#include "MHTMLArchive.h"
#include "PageSerializer.h"
+#include "platform/WebCString.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
+#include "platform/WebVector.h"
#include "WebFrame.h"
#include "WebFrameImpl.h"
#include "WebPageSerializerClient.h"
#include "WebPageSerializerImpl.h"
#include "WebView.h"
#include "WebViewImpl.h"
-#include <public/WebCString.h>
-#include <public/WebString.h>
-#include <public/WebURL.h>
-#include <public/WebVector.h>
+
#include <wtf/Vector.h>
#include <wtf/text/StringConcatenate.h>
diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
index b03fbfc67..02a665a11 100644
--- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp
@@ -91,10 +91,11 @@
#include "KURL.h"
#include "TextEncoding.h"
#include "markup.h"
+
#include "DOMUtilitiesPrivate.h"
#include "WebFrameImpl.h"
-#include <public/WebURL.h>
-#include <public/WebVector.h>
+#include "platform/WebURL.h"
+#include "platform/WebVector.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.h b/Source/WebKit/chromium/src/WebPageSerializerImpl.h
index e6cb9d735..acc5b8102 100644
--- a/Source/WebKit/chromium/src/WebPageSerializerImpl.h
+++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.h
@@ -41,8 +41,8 @@
#include "WebEntities.h"
#include "WebPageSerializer.h"
#include "WebPageSerializerClient.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
namespace WebCore {
class Document;
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
index 689154058..5c164319e 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
@@ -33,7 +33,6 @@
#include "Chrome.h"
#include "ChromeClientImpl.h"
-#include "ClipboardChromium.h"
#include "ScrollbarGroup.h"
#include "WebCursorInfo.h"
#include "WebDataSourceImpl.h"
@@ -74,7 +73,6 @@
#include <public/Platform.h>
#include <public/WebClipboard.h>
#include <public/WebCompositorSupport.h>
-#include <public/WebDragData.h>
#include <public/WebExternalTextureLayer.h>
#include <public/WebRect.h>
#include <public/WebString.h>
@@ -117,13 +115,8 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec
if (!parent())
return;
- FloatRect scaledDamageRect = damageRect;
- float frameScaleFactor = m_element->document()->page()->mainFrame()->frameScaleFactor();
- scaledDamageRect.scale(frameScaleFactor);
- scaledDamageRect.move(-frameRect().x() * (frameScaleFactor - 1), -frameRect().y() * (frameScaleFactor - 1));
-
// Don't paint anything if the plugin doesn't intersect the damage rect.
- if (!frameRect().intersects(enclosingIntRect(scaledDamageRect)))
+ if (!frameRect().intersects(damageRect))
return;
gc->save();
@@ -139,7 +132,7 @@ void WebPluginContainerImpl::paint(GraphicsContext* gc, const IntRect& damageRec
WebCanvas* canvas = gc->platformContext()->canvas();
IntRect windowRect =
- IntRect(view->contentsToWindow(enclosingIntRect(scaledDamageRect)));
+ IntRect(view->contentsToWindow(damageRect.location()), damageRect.size());
m_webPlugin->paint(canvas, windowRect);
gc->restore();
@@ -660,16 +653,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
{
ASSERT(parent()->isFrameView());
- if (event->isDragEvent()) {
- handleDragEvent(event);
- return;
- }
-
// We cache the parent FrameView here as the plugin widget could be deleted
// in the call to HandleEvent. See http://b/issue?id=1362948
FrameView* parentView = static_cast<FrameView*>(parent());
- WebMouseEventBuilder webEvent(this, m_element->renderer(), *event);
+ WebMouseEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
@@ -708,35 +696,9 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event)
chromeClient->setCursorForPlugin(cursorInfo);
}
-void WebPluginContainerImpl::handleDragEvent(MouseEvent* event)
-{
- ASSERT(event->isDragEvent());
-
- WebDragStatus dragStatus = WebDragStatusUnknown;
- if (event->type() == eventNames().dragenterEvent)
- dragStatus = WebDragStatusEnter;
- else if (event->type() == eventNames().dragleaveEvent)
- dragStatus = WebDragStatusLeave;
- else if (event->type() == eventNames().dragoverEvent)
- dragStatus = WebDragStatusOver;
- else if (event->type() == eventNames().dropEvent)
- dragStatus = WebDragStatusDrop;
-
- if (dragStatus == WebDragStatusUnknown)
- return;
-
- ClipboardChromium* clipboard = static_cast<ClipboardChromium*>(event->dataTransfer());
- WebDragData dragData = clipboard->dataObject();
- WebDragOperationsMask dragOperationMask = static_cast<WebDragOperationsMask>(clipboard->sourceOperation());
- WebPoint dragScreenLocation(event->screenX(), event->screenY());
- WebPoint dragLocation(event->absoluteLocation().x() - location().x(), event->absoluteLocation().y() - location().y());
-
- m_webPlugin->handleDragStatusUpdate(dragStatus, dragData, dragOperationMask, dragLocation, dragScreenLocation);
-}
-
void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event)
{
- WebMouseWheelEventBuilder webEvent(this, m_element->renderer(), *event);
+ WebMouseWheelEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
@@ -785,9 +747,7 @@ void WebPluginContainerImpl::handleKeyboardEvent(KeyboardEvent* event)
void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
{
- if (!m_isAcceptingTouchEvents)
- return;
- WebTouchEventBuilder webEvent(this, m_element->renderer(), *event);
+ WebTouchEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
WebCursorInfo cursorInfo;
@@ -798,7 +758,7 @@ void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event)
{
- WebGestureEventBuilder webEvent(this, m_element->renderer(), *event);
+ WebGestureEventBuilder webEvent(this, *event);
if (webEvent.type == WebInputEvent::Undefined)
return;
WebCursorInfo cursorInfo;
diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
index e89af0987..e203a7370 100644
--- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h
+++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h
@@ -165,7 +165,6 @@ private:
~WebPluginContainerImpl();
void handleMouseEvent(WebCore::MouseEvent*);
- void handleDragEvent(WebCore::MouseEvent*);
void handleWheelEvent(WebCore::WheelEvent*);
void handleKeyboardEvent(WebCore::KeyboardEvent*);
void handleTouchEvent(WebCore::TouchEvent*);
diff --git a/Source/WebKit/chromium/src/WebPluginListBuilderImpl.cpp b/Source/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
index acfb882a4..5c6b6fced 100644
--- a/Source/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
@@ -32,7 +32,7 @@
#include "WebPluginListBuilderImpl.h"
#include "PluginData.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/Vector.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebPluginLoadObserver.h b/Source/WebKit/chromium/src/WebPluginLoadObserver.h
index 364f40260..d7648e136 100644
--- a/Source/WebKit/chromium/src/WebPluginLoadObserver.h
+++ b/Source/WebKit/chromium/src/WebPluginLoadObserver.h
@@ -31,7 +31,7 @@
#ifndef WebPluginLoadObserver_h
#define WebPluginLoadObserver_h
-#include <public/WebURL.h>
+#include "platform/WebURL.h"
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
index 0d2aeac45..51114020b 100644
--- a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -48,7 +48,7 @@
#include "WebViewClient.h"
#include "WebWidgetClient.h"
#include "painting/GraphicsContextBuilder.h"
-#include <public/WebRect.h>
+#include "platform/WebRect.h"
#include <skia/ext/platform_canvas.h>
#if ENABLE(GESTURE_EVENTS)
diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h
index 3c038acad..7f13e4385 100644
--- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -33,8 +33,8 @@
#include "FramelessScrollViewClient.h"
#include "WebPopupMenu.h"
-#include <public/WebPoint.h>
-#include <public/WebSize.h>
+#include "platform/WebPoint.h"
+#include "platform/WebSize.h"
#include <wtf/OwnPtr.h>
#include <wtf/RefCounted.h>
diff --git a/Source/WebKit/chromium/src/WebRange.cpp b/Source/WebKit/chromium/src/WebRange.cpp
index bc2930572..85df0a3ba 100644
--- a/Source/WebKit/chromium/src/WebRange.cpp
+++ b/Source/WebKit/chromium/src/WebRange.cpp
@@ -40,8 +40,8 @@
#include "TextIterator.h"
#include "WebFrameImpl.h"
#include "WebNode.h"
-#include <public/WebFloatQuad.h>
-#include <public/WebString.h>
+#include "platform/WebFloatQuad.h"
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebRegularExpression.cpp b/Source/WebKit/chromium/src/WebRegularExpression.cpp
index 0f9074f67..4d0bd53be 100644
--- a/Source/WebKit/chromium/src/WebRegularExpression.cpp
+++ b/Source/WebKit/chromium/src/WebRegularExpression.cpp
@@ -32,7 +32,7 @@
#include "WebRegularExpression.h"
#include "RegularExpression.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebScriptController.cpp b/Source/WebKit/chromium/src/WebScriptController.cpp
index cdff75ab1..fbf73f689 100644
--- a/Source/WebKit/chromium/src/WebScriptController.cpp
+++ b/Source/WebKit/chromium/src/WebScriptController.cpp
@@ -34,7 +34,8 @@
#include "ScriptController.h"
#include "V8Binding.h"
#include "V8DOMMap.h"
-#include <public/WebString.h>
+
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSecurityOrigin.cpp b/Source/WebKit/chromium/src/WebSecurityOrigin.cpp
index eee5b6186..afe204d55 100644
--- a/Source/WebKit/chromium/src/WebSecurityOrigin.cpp
+++ b/Source/WebKit/chromium/src/WebSecurityOrigin.cpp
@@ -33,8 +33,8 @@
#include "KURL.h"
#include "SecurityOrigin.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
@@ -156,9 +156,4 @@ void WebSecurityOrigin::assign(WebSecurityOriginPrivate* p)
m_private = p;
}
-void WebSecurityOrigin::grantLoadLocalResources() const
-{
- get()->grantLoadLocalResources();
-}
-
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebSecurityPolicy.cpp b/Source/WebKit/chromium/src/WebSecurityPolicy.cpp
index c1d0d8866..e80061889 100644
--- a/Source/WebKit/chromium/src/WebSecurityPolicy.cpp
+++ b/Source/WebKit/chromium/src/WebSecurityPolicy.cpp
@@ -35,8 +35,9 @@
#include "SchemeRegistry.h"
#include "SecurityOrigin.h"
#include "SecurityPolicy.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSelectElement.cpp b/Source/WebKit/chromium/src/WebSelectElement.cpp
index 28d56e146..3a8238640 100644
--- a/Source/WebKit/chromium/src/WebSelectElement.cpp
+++ b/Source/WebKit/chromium/src/WebSelectElement.cpp
@@ -34,7 +34,7 @@
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
#include "HTMLSelectElement.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
#include <wtf/PassRefPtr.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSerializedScriptValue.cpp b/Source/WebKit/chromium/src/WebSerializedScriptValue.cpp
index 34fa4bb25..fc7af6f3f 100644
--- a/Source/WebKit/chromium/src/WebSerializedScriptValue.cpp
+++ b/Source/WebKit/chromium/src/WebSerializedScriptValue.cpp
@@ -32,7 +32,7 @@
#include "platform/WebSerializedScriptValue.h"
#include "SerializedScriptValue.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp b/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp
index 05cfce36d..e8f96e568 100644
--- a/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp
+++ b/Source/WebKit/chromium/src/WebSessionDescriptionDescriptor.cpp
@@ -32,11 +32,11 @@
#if ENABLE(MEDIA_STREAM)
-#include <public/WebSessionDescriptionDescriptor.h>
+#include "platform/WebSessionDescriptionDescriptor.h"
#include "SessionDescriptionDescriptor.h"
-#include <public/WebICECandidateDescriptor.h>
-#include <public/WebString.h>
+#include "platform/WebICECandidateDescriptor.h"
+#include "platform/WebString.h"
#include <wtf/Vector.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
index 988c5e66b..4cc3ef727 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -33,8 +33,8 @@
#include "FontRenderingMode.h"
#include "Settings.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include <wtf/UnusedParam.h>
#if defined(OS_WIN)
@@ -54,7 +54,6 @@ WebSettingsImpl::WebSettingsImpl(Settings* settings)
, m_viewportEnabled(false)
, m_applyDefaultDeviceScaleFactorInCompositor(false)
, m_gestureTapHighlightEnabled(true)
- , m_autoZoomFocusedNodeToLegibleScale(false)
, m_defaultTileSize(WebSize(256, 256))
, m_maxUntiledLayerSize(WebSize(512, 512))
{
@@ -141,16 +140,6 @@ void WebSettingsImpl::setApplyDefaultDeviceScaleFactorInCompositor(bool applyDef
m_applyDefaultDeviceScaleFactorInCompositor = applyDefaultDeviceScaleFactorInCompositor;
}
-void WebSettingsImpl::setApplyPageScaleFactorInCompositor(bool applyPageScaleFactorInCompositor)
-{
- m_settings->setApplyPageScaleFactorInCompositor(applyPageScaleFactorInCompositor);
-}
-
-void WebSettingsImpl::setAutoZoomFocusedNodeToLegibleScale(bool autoZoomFocusedNodeToLegibleScale)
-{
- m_autoZoomFocusedNodeToLegibleScale = autoZoomFocusedNodeToLegibleScale;
-}
-
void WebSettingsImpl::setTextAutosizingEnabled(bool enabled)
{
#if ENABLE(TEXT_AUTOSIZING)
@@ -664,9 +653,4 @@ void WebSettingsImpl::setGestureTapHighlightEnabled(bool enableHighlight)
m_gestureTapHighlightEnabled = enableHighlight;
}
-bool WebSettingsImpl::applyPageScaleFactorInCompositor() const
-{
- return m_settings->applyPageScaleFactorInCompositor();
-}
-
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h
index 1169c31cf..e9e01bfcd 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.h
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.h
@@ -64,10 +64,8 @@ public:
virtual void setAllowScriptsToCloseWindows(bool);
virtual void setAllowUniversalAccessFromFileURLs(bool);
virtual void setApplyDefaultDeviceScaleFactorInCompositor(bool);
- virtual void setApplyPageScaleFactorInCompositor(bool);
virtual void setAsynchronousSpellCheckingEnabled(bool);
virtual void setAuthorAndUserStylesEnabled(bool);
- virtual void setAutoZoomFocusedNodeToLegibleScale(bool);
virtual void setCaretBrowsingEnabled(bool);
virtual void setCookieEnabled(bool);
virtual void setCursiveFontFamily(const WebString&, UScriptCode = USCRIPT_COMMON);
@@ -162,8 +160,6 @@ public:
bool showPaintRects() const { return m_showPaintRects; }
bool renderVSyncEnabled() const { return m_renderVSyncEnabled; }
bool applyDefaultDeviceScaleFactorInCompositor() const { return m_applyDefaultDeviceScaleFactorInCompositor; }
- bool applyPageScaleFactorInCompositor() const;
- bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNodeToLegibleScale; }
bool gestureTapHighlightEnabled() { return m_gestureTapHighlightEnabled; }
WebSize defaultTileSize() const { return m_defaultTileSize; }
WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; }
@@ -177,7 +173,6 @@ private:
bool m_viewportEnabled;
bool m_applyDefaultDeviceScaleFactorInCompositor;
bool m_gestureTapHighlightEnabled;
- bool m_autoZoomFocusedNodeToLegibleScale;
WebSize m_defaultTileSize;
WebSize m_maxUntiledLayerSize;
};
diff --git a/Source/WebKit/chromium/src/WebSocketImpl.cpp b/Source/WebKit/chromium/src/WebSocketImpl.cpp
index a0849efca..7548c6315 100644
--- a/Source/WebKit/chromium/src/WebSocketImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSocketImpl.cpp
@@ -47,8 +47,8 @@ class WebSocketChannel {
#include "WebArrayBuffer.h"
#include "WebDocument.h"
#include "WebSocketClient.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebSocketImpl.h b/Source/WebKit/chromium/src/WebSocketImpl.h
index ebf4e775a..ef14b18c7 100644
--- a/Source/WebKit/chromium/src/WebSocketImpl.h
+++ b/Source/WebKit/chromium/src/WebSocketImpl.h
@@ -31,10 +31,10 @@
#ifndef WebSocketImpl_h
#define WebSocketImpl_h
+#include "platform/WebCommon.h"
#include "WebSocket.h"
#include "WebSocketChannelClient.h"
#include "WebSocketClient.h"
-#include <public/WebCommon.h>
#include <wtf/OwnPtr.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
index 9f31debc8..95d3bcf88 100644
--- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
+++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
@@ -35,7 +35,8 @@
#include "SecurityOrigin.h"
#include "StorageAreaProxy.h"
#include "WebViewImpl.h"
-#include <public/WebURL.h>
+
+#include "platform/WebURL.h"
#include <wtf/PassOwnPtr.h>
namespace WebKit {
diff --git a/Source/WebKit/chromium/src/WebSurroundingText.cpp b/Source/WebKit/chromium/src/WebSurroundingText.cpp
index 3caadca2e..45db3d1bd 100644
--- a/Source/WebKit/chromium/src/WebSurroundingText.cpp
+++ b/Source/WebKit/chromium/src/WebSurroundingText.cpp
@@ -33,7 +33,8 @@
#include "Text.h"
#include "VisiblePosition.h"
#include "WebHitTestResult.h"
-#include <public/WebPoint.h>
+
+#include "platform/WebPoint.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp
index 46fbf2371..b81ea578b 100644
--- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp
+++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp
@@ -35,7 +35,7 @@
#include "SpellChecker.h"
#include "TextCheckerClient.h"
#include "WebTextCheckingResult.h"
-#include <public/WebVector.h>
+#include "platform/WebVector.h"
#include <wtf/Assertions.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebURLLoadTiming.cpp b/Source/WebKit/chromium/src/WebURLLoadTiming.cpp
index 2a2777157..0949c9b2e 100644
--- a/Source/WebKit/chromium/src/WebURLLoadTiming.cpp
+++ b/Source/WebKit/chromium/src/WebURLLoadTiming.cpp
@@ -29,10 +29,10 @@
*/
#include "config.h"
-#include <public/WebURLLoadTiming.h>
+#include "platform/WebURLLoadTiming.h"
#include "ResourceLoadTiming.h"
-#include <public/WebString.h>
+#include "platform/WebString.h"
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
index ffecb0aed..26f17c35b 100644
--- a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
+++ b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
@@ -35,18 +35,16 @@
#include "WebUserMediaRequest.h"
#include "Document.h"
-#include "MediaConstraints.h"
#include "MediaStreamDescriptor.h"
#include "MediaStreamSource.h"
#include "SecurityOrigin.h"
#include "UserMediaRequest.h"
#include "WebDocument.h"
#include "WebSecurityOrigin.h"
-#include <public/WebMediaConstraints.h>
-#include <public/WebMediaStreamDescriptor.h>
-#include <public/WebMediaStreamSource.h>
-#include <public/WebString.h>
-#include <public/WebVector.h>
+#include "platform/WebMediaStreamDescriptor.h"
+#include "platform/WebMediaStreamSource.h"
+#include "platform/WebString.h"
+#include "platform/WebVector.h"
#include <wtf/Vector.h>
using namespace WebCore;
@@ -75,18 +73,6 @@ bool WebUserMediaRequest::video() const
return m_private->video();
}
-WebMediaConstraints WebUserMediaRequest::audioConstraints() const
-{
- ASSERT(!isNull());
- return m_private->audioConstraints();
-}
-
-WebMediaConstraints WebUserMediaRequest::videoConstraints() const
-{
- ASSERT(!isNull());
- return m_private->videoConstraints();
-}
-
WebSecurityOrigin WebUserMediaRequest::securityOrigin() const
{
ASSERT(!isNull() && m_private->scriptExecutionContext());
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index d6bf94b96..261f7c357 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -92,6 +92,7 @@
#include "PageGroupLoadDeferrer.h"
#include "PagePopupClient.h"
#include "PageWidgetDelegate.h"
+#include "Pasteboard.h"
#include "PlatformContextSkia.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformMouseEvent.h"
@@ -191,19 +192,13 @@ using namespace std;
// (such as due to a double tap gesture or find in page etc.). These are
// experimentally determined.
static const int touchPointPadding = 32;
-static const int nonUserInitiatedPointPadding = 11;
static const float minScaleDifference = 0.01f;
static const float doubleTapZoomContentDefaultMargin = 5;
static const float doubleTapZoomContentMinimumMargin = 2;
static const double doubleTapZoomAnimationDurationInSeconds = 0.25;
-static const float doubleTapZoomAlreadyLegibleRatio = 1.2f;
// Constants for zooming in on a focused text field.
static const double scrollAndScaleAnimationDurationInSeconds = 0.2;
-static const int minReadableCaretHeight = 18;
-static const float minScaleChangeToTriggerZoom = 1.05f;
-static const float leftBoxRatio = 0.3f;
-static const int caretPadding = 10;
namespace WebKit {
@@ -214,8 +209,8 @@ namespace WebKit {
const double WebView::textSizeMultiplierRatio = 1.2;
const double WebView::minTextSizeMultiplier = 0.5;
const double WebView::maxTextSizeMultiplier = 3.0;
-const float WebView::minPageScaleFactor = 0.25f;
-const float WebView::maxPageScaleFactor = 4.0f;
+const float WebView::minPageScaleFactor = 0.25;
+const float WebView::maxPageScaleFactor = 4.0;
// The group name identifies a namespace of pages. Page group is used on PLATFORM(MAC)
@@ -397,8 +392,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_ignoreViewportTagMaximumScale(false)
, m_pageScaleFactorIsSet(false)
, m_savedPageScaleFactor(0)
- , m_doubleTapZoomInEffect(false)
- , m_shouldUseDoubleTapTimeZero(false)
, m_contextMenuAllowed(false)
, m_doingDragAndDrop(false)
, m_ignoreInputEvents(false)
@@ -629,6 +622,39 @@ void WebViewImpl::mouseContextMenu(const WebMouseEvent& event)
void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event)
{
+#if OS(UNIX) && !OS(DARWIN)
+ // If the event was a middle click, attempt to copy text into the focused
+ // frame. We execute this before we let the page have a go at the event
+ // because the page may change what is focused during in its event handler.
+ //
+ // This code is in the mouse up handler. There is some debate about putting
+ // this here, as opposed to the mouse down handler.
+ // xterm: pastes on up.
+ // GTK: pastes on down.
+ // Firefox: pastes on up.
+ // Midori: couldn't paste at all with 0.1.2
+ //
+ // There is something of a webcompat angle to this well, as highlighted by
+ // crbug.com/14608. Pages can clear text boxes 'onclick' and, if we paste on
+ // down then the text is pasted just before the onclick handler runs and
+ // clears the text box. So it's important this happens after the
+ // handleMouseReleaseEvent() earlier in this function
+ if (event.button == WebMouseEvent::ButtonMiddle) {
+ Frame* focused = focusedWebCoreFrame();
+ FrameView* view = m_page->mainFrame()->view();
+ IntPoint clickPoint(m_lastMouseDownPoint.x, m_lastMouseDownPoint.y);
+ IntPoint contentPoint = view->windowToContents(clickPoint);
+ HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, false, false, ShouldHitTestScrollbars);
+ // We don't want to send a paste when middle clicking a scroll bar or a
+ // link (which will navigate later in the code). The main scrollbars
+ // have to be handled separately.
+ if (!hitTestResult.scrollbar() && !hitTestResult.isLiveLink() && focused && !view->scrollbarAtPoint(clickPoint)) {
+ Editor* editor = focused->editor();
+ editor->command(AtomicString("PasteGlobalSelection")).execute();
+ }
+ }
+#endif
+
PageWidgetEventHandler::handleMouseUp(mainFrame, event);
#if OS(WINDOWS)
@@ -663,29 +689,6 @@ void WebViewImpl::scrollBy(const WebCore::IntPoint& delta)
bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
{
bool eventSwallowed = false;
-
- // Handle link highlighting outside the main switch to avoid getting lost in the
- // complicated set of cases handled below.
- switch (event.type) {
- case WebInputEvent::GestureTapDown:
- // Queue a highlight animation, then hand off to regular handler.
-#if OS(LINUX)
- if (settingsImpl()->gestureTapHighlightEnabled())
- enableTouchHighlight(IntPoint(event.x, event.y));
-#endif
- break;
- case WebInputEvent::GestureTapCancel:
- if (m_linkHighlight)
- m_linkHighlight->startHighlightAnimationIfNeeded();
- break;
- case WebInputEvent::GestureTap:
- // If a link highlight is active, kill it.
- m_linkHighlight.clear();
- break;
- default:
- break;
- }
-
switch (event.type) {
case WebInputEvent::GestureFlingStart: {
m_client->cancelScheduledContentIntents();
@@ -707,7 +710,7 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
break;
case WebInputEvent::GestureTap: {
m_client->cancelScheduledContentIntents();
- if (detectContentOnTouch(WebPoint(event.x, event.y))) {
+ if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) {
eventSwallowed = true;
break;
}
@@ -742,42 +745,37 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
break;
}
- case WebInputEvent::GestureTwoFingerTap: {
- if (!mainFrameImpl() || !mainFrameImpl()->frameView())
- break;
-
- m_page->contextMenuController()->clearContextMenu();
- m_contextMenuAllowed = true;
- PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- eventSwallowed = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent);
- m_contextMenuAllowed = false;
-
- break;
- }
+ case WebInputEvent::GestureTwoFingerTap:
case WebInputEvent::GestureLongPress: {
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
break;
m_client->cancelScheduledContentIntents();
+ if (detectContentOnTouch(WebPoint(event.x, event.y), event.type)) {
+ eventSwallowed = true;
+ break;
+ }
+
m_page->contextMenuController()->clearContextMenu();
m_contextMenuAllowed = true;
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
- eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+ eventSwallowed = mainFrameImpl()->frame()->eventHandler()->sendContextMenuEventForGesture(platformEvent);
m_contextMenuAllowed = false;
break;
}
case WebInputEvent::GestureTapDown: {
m_client->cancelScheduledContentIntents();
+ // Queue a highlight animation, then hand off to regular handler.
+#if OS(LINUX)
+ if (settingsImpl()->gestureTapHighlightEnabled())
+ enableTouchHighlight(IntPoint(event.x, event.y));
+#endif
PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
eventSwallowed = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
break;
}
case WebInputEvent::GestureDoubleTap:
- m_client->cancelScheduledContentIntents();
- animateZoomAroundPoint(WebPoint(event.x, event.y), DoubleTap);
- eventSwallowed = true;
- break;
case WebInputEvent::GestureScrollBegin:
case WebInputEvent::GesturePinchBegin:
m_client->cancelScheduledContentIntents();
@@ -817,15 +815,17 @@ void WebViewImpl::renderingStats(WebRenderingStats& stats) const
void WebViewImpl::startPageScaleAnimation(const IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds)
{
- WebPoint clampedPoint = targetPosition;
+ if (!m_layerTreeView)
+ return;
+
+ IntPoint clampedPoint = targetPosition;
if (!useAnchor)
clampedPoint = clampOffsetAtScale(targetPosition, newScale);
- if ((!durationInSeconds && !useAnchor) || m_shouldUseDoubleTapTimeZero) {
+
+ if (!durationInSeconds && !useAnchor) {
setPageScaleFactor(newScale, clampedPoint);
return;
}
- if (!m_layerTreeView)
- return;
m_layerTreeView->startPageScaleAnimation(targetPosition, useAnchor, newScale, durationInSeconds);
}
@@ -1075,37 +1075,24 @@ WebRect WebViewImpl::widenRectWithinPageBounds(const WebRect& source, int target
return WebRect(newX, source.y, newWidth, source.height);
}
-void WebViewImpl::shouldUseAnimateDoubleTapTimeZeroForTesting(bool setToZero)
-{
- m_shouldUseDoubleTapTimeZero = setToZero;
-}
-
-void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType zoomType, float& scale, WebPoint& scroll, bool& isAnchor)
+void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType zoomType, float& scale, WebPoint& scroll)
{
scale = pageScaleFactor();
scroll.x = scroll.y = 0;
WebRect targetRect = hitRect;
- // Padding only depends on page scale when triggered by manually tapping
- int padding = (zoomType == DoubleTap) ? touchPointPadding : nonUserInitiatedPointPadding;
if (targetRect.isEmpty())
- targetRect.width = targetRect.height = padding;
+ targetRect.width = targetRect.height = touchPointPadding;
+
WebRect rect = computeBlockBounds(targetRect, zoomType);
- if (zoomType == FindInPage && rect.isEmpty()) {
- // Keep current scale (no need to scroll as x,y will normally already
- // be visible). FIXME: Revisit this if it isn't always true.
- return;
- }
+ const float overviewScale = m_minimumPageScaleFactor;
bool scaleUnchanged = true;
if (!rect.isEmpty()) {
// Pages should be as legible as on desktop when at dpi scale, so no
// need to zoom in further when automatically determining zoom level
// (after double tap, find in page, etc), though the user should still
// be allowed to manually pinch zoom in further if they desire.
- const float defaultScaleWhenAlreadyLegible = m_minimumPageScaleFactor * doubleTapZoomAlreadyLegibleRatio;
- float legibleScale = deviceScaleFactor();
- if (legibleScale < defaultScaleWhenAlreadyLegible)
- legibleScale = (scale == m_minimumPageScaleFactor) ? defaultScaleWhenAlreadyLegible : m_minimumPageScaleFactor;
+ const float maxScale = deviceScaleFactor();
const float defaultMargin = doubleTapZoomContentDefaultMargin * deviceScaleFactor();
const float minimumMargin = doubleTapZoomContentMinimumMargin * deviceScaleFactor();
@@ -1118,61 +1105,55 @@ void WebViewImpl::computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZo
rect = widenRectWithinPageBounds(rect,
static_cast<int>(defaultMargin * rect.width / m_size.width),
static_cast<int>(minimumMargin * rect.width / m_size.width));
+
// Fit block to screen, respecting limits.
scale *= static_cast<float>(m_size.width) / rect.width;
- scale = min(scale, legibleScale);
+ scale = min(scale, maxScale);
scale = clampPageScaleFactorToLimits(scale);
scaleUnchanged = fabs(pageScaleFactor() - scale) < minScaleDifference;
}
- if (zoomType == DoubleTap && (rect.isEmpty() || scaleUnchanged || m_doubleTapZoomInEffect)) {
- // Zoom out to minimum scale.
- scale = m_minimumPageScaleFactor;
- scroll = WebPoint(hitRect.x, hitRect.y);
- isAnchor = true;
- m_doubleTapZoomInEffect = false;
- } else {
- if (zoomType == DoubleTap && scale != m_minimumPageScaleFactor)
- m_doubleTapZoomInEffect = true;
- else
- m_doubleTapZoomInEffect = false;
- // FIXME: If this is being called for auto zoom during find in page,
- // then if the user manually zooms in it'd be nice to preserve the
- // relative increase in zoom they caused (if they zoom out then it's ok
- // to zoom them back in again). This isn't compatible with our current
- // double-tap zoom strategy (fitting the containing block to the screen)
- // though.
-
- float screenHeight = m_size.height / scale * pageScaleFactor();
- float screenWidth = m_size.width / scale * pageScaleFactor();
-
- // Scroll to vertically align the block.
- if (rect.height < screenHeight) {
- // Vertically center short blocks.
- rect.y -= 0.5 * (screenHeight - rect.height);
- } else {
- // Ensure position we're zooming to (+ padding) isn't off the bottom of
- // the screen.
- rect.y = max<float>(rect.y, hitRect.y + padding - screenHeight);
- } // Otherwise top align the block.
-
- // Do the same thing for horizontal alignment.
- if (rect.width < screenWidth)
- rect.x -= 0.5 * (screenWidth - rect.width);
- else
- rect.x = max<float>(rect.x, hitRect.x + padding - screenWidth);
- scroll.x = rect.x;
- scroll.y = rect.y;
- isAnchor = false;
+ if (zoomType == DoubleTap) {
+ if (rect.isEmpty() || scaleUnchanged) {
+ // Zoom out to overview mode.
+ if (overviewScale)
+ scale = overviewScale;
+ return;
+ }
+ } else if (rect.isEmpty()) {
+ // Keep current scale (no need to scroll as x,y will normally already
+ // be visible). FIXME: Revisit this if it isn't always true.
+ return;
}
- scale = clampPageScaleFactorToLimits(scale);
- scroll = mainFrameImpl()->frameView()->windowToContents(scroll);
- float scaleDelta = scale / pageScaleFactor();
- scroll = WebPoint(scroll.x * scaleDelta, scroll.y * scaleDelta);
- if (!isAnchor)
- scroll = clampOffsetAtScale(scroll, scale);
+ // FIXME: If this is being called for auto zoom during find in page,
+ // then if the user manually zooms in it'd be nice to preserve the relative
+ // increase in zoom they caused (if they zoom out then it's ok to zoom
+ // them back in again). This isn't compatible with our current double-tap
+ // zoom strategy (fitting the containing block to the screen) though.
+
+ float screenHeight = m_size.height / scale * pageScaleFactor();
+ float screenWidth = m_size.width / scale * pageScaleFactor();
+
+ // Scroll to vertically align the block.
+ if (rect.height < screenHeight) {
+ // Vertically center short blocks.
+ rect.y -= 0.5 * (screenHeight - rect.height);
+ } else {
+ // Ensure position we're zooming to (+ padding) isn't off the bottom of
+ // the screen.
+ rect.y = max<float>(rect.y, hitRect.y + touchPointPadding - screenHeight);
+ } // Otherwise top align the block.
+
+ // Do the same thing for horizontal alignment.
+ if (rect.width < screenWidth)
+ rect.x -= 0.5 * (screenWidth - rect.width);
+ else
+ rect.x = max<float>(rect.x, hitRect.x + touchPointPadding - screenWidth);
+
+ scroll.x = rect.x;
+ scroll.y = rect.y;
}
static bool highlightConditions(Node* node)
@@ -1198,10 +1179,10 @@ Node* WebViewImpl::bestTouchLinkNode(IntPoint touchEventLocation)
while (bestTouchNode && !highlightConditions(bestTouchNode))
bestTouchNode = bestTouchNode->parentNode();
- // If the document/body have click handlers installed, we don't want to default to applying the highlight to the entire RenderView, or the
- // entire body.
+ // If the document has click handlers installed, we don't want to default to applying the highlight to the entire RenderView, or the
+ // entire body. Also, if the node has non-auto Z-index, we cannot be sure of it's ordering with respect to other possible target nodes.
RenderObject* touchNodeRenderer = bestTouchNode ? bestTouchNode->renderer() : 0;
- if (bestTouchNode && (!touchNodeRenderer || touchNodeRenderer->isRenderView() || touchNodeRenderer->isBody()))
+ if (bestTouchNode && (!touchNodeRenderer || touchNodeRenderer->isRenderView() || touchNodeRenderer->isBody() || !touchNodeRenderer->style()->hasAutoZIndex()))
return 0;
return bestTouchNode;
@@ -1225,6 +1206,7 @@ void WebViewImpl::enableTouchHighlight(IntPoint touchEventLocation)
return;
m_linkHighlight = LinkHighlight::create(touchNode, this);
+ m_linkHighlight->startHighlightAnimation();
}
#endif
@@ -1237,13 +1219,11 @@ void WebViewImpl::animateZoomAroundPoint(const IntPoint& point, AutoZoomType zoo
float scale;
WebPoint scroll;
- bool isAnchor;
- WebPoint webPoint = point;
- computeScaleAndScrollForHitRect(WebRect(webPoint.x, webPoint.y, 0, 0), zoomType, scale, scroll, isAnchor);
+ computeScaleAndScrollForHitRect(WebRect(point.x(), point.y(), 0, 0), zoomType, scale, scroll);
bool isDoubleTap = (zoomType == DoubleTap);
- double durationInSeconds = (isDoubleTap && !m_shouldUseDoubleTapTimeZero) ? doubleTapZoomAnimationDurationInSeconds : 0;
- startPageScaleAnimation(scroll, isAnchor, scale, durationInSeconds);
+ double durationInSeconds = isDoubleTap ? doubleTapZoomAnimationDurationInSeconds : 0;
+ startPageScaleAnimation(scroll, isDoubleTap, scale, durationInSeconds);
#endif
}
@@ -1575,9 +1555,9 @@ void WebViewImpl::resize(const WebSize& newSize)
#endif
WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate();
- if (agentPrivate)
- agentPrivate->webViewResized(newSize);
- if (!agentPrivate || !agentPrivate->metricsOverridden()) {
+ if (agentPrivate && agentPrivate->metricsOverridden())
+ agentPrivate->webViewResized();
+ else {
WebFrameImpl* webFrame = mainFrameImpl();
if (webFrame->frameView())
webFrame->frameView()->resize(newSize.width, newSize.height);
@@ -1743,6 +1723,13 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
#if ENABLE(REQUEST_ANIMATION_FRAME)
TRACE_EVENT0("webkit", "WebViewImpl::updateAnimations");
+ WebFrameImpl* webframe = mainFrameImpl();
+ if (!webframe)
+ return;
+ FrameView* view = webframe->frameView();
+ if (!view)
+ return;
+
// Create synthetic wheel events as necessary for fling.
if (m_gestureAnimation) {
if (m_gestureAnimation->animate(monotonicFrameBeginTime))
@@ -1751,9 +1738,6 @@ void WebViewImpl::updateAnimations(double monotonicFrameBeginTime)
m_gestureAnimation.clear();
}
- if (!m_page)
- return;
-
PageWidgetDelegate::animate(m_page.get(), monotonicFrameBeginTime);
#endif
}
@@ -2644,78 +2628,8 @@ void WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rect)
Node* focusedNode = focusedWebCoreNode();
if (!frame || !frame->view() || !focusedNode || !focusedNode->isElementNode())
return;
-
- if (!m_webSettings->autoZoomFocusedNodeToLegibleScale()) {
- Element* elementNode = static_cast<Element*>(focusedNode);
- frame->view()->scrollElementToRect(elementNode, IntRect(rect.x, rect.y, rect.width, rect.height));
- return;
- }
-
-#if ENABLE(GESTURE_EVENTS)
- focusedNode->document()->updateLayoutIgnorePendingStylesheets();
-
- // 'caret' is rect encompassing the blinking cursor.
- IntRect textboxRect = focusedNode->document()->view()->contentsToWindow(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
- WebRect caret, end;
- selectionBounds(caret, end);
-
- // Pick a scale which is reasonably readable. This is the scale at which
- // the caret height will become minReadableCaretHeight (adjusted for dpi
- // and font scale factor).
- float targetScale = deviceScaleFactor();
-#if ENABLE(TEXT_AUTOSIZING)
- if (page() && page()->settings())
- targetScale *= page()->settings()->textAutosizingFontScaleFactor();
-#endif
- const float newScale = clampPageScaleFactorToLimits(pageScaleFactor() * minReadableCaretHeight * targetScale / caret.height);
- const float deltaScale = newScale / pageScaleFactor();
-
- // Convert the rects to absolute space in the new scale.
- IntRect textboxRectInDocumentCoordinates = textboxRect;
- textboxRectInDocumentCoordinates.move(mainFrame()->scrollOffset());
- textboxRectInDocumentCoordinates.scale(deltaScale);
- IntRect caretInDocumentCoordinates = caret;
- caretInDocumentCoordinates.move(mainFrame()->scrollOffset());
- caretInDocumentCoordinates.scale(deltaScale);
-
- IntPoint newOffset;
- if (textboxRectInDocumentCoordinates.width() <= m_size.width) {
- // Field is narrower than screen. Try to leave padding on left so field's
- // label is visible, but it's more important to ensure entire field is
- // onscreen.
- int idealLeftPadding = m_size.width * leftBoxRatio;
- int maxLeftPaddingKeepingBoxOnscreen = m_size.width - textboxRectInDocumentCoordinates.width();
- newOffset.setX(textboxRectInDocumentCoordinates.x() - min<int>(idealLeftPadding, maxLeftPaddingKeepingBoxOnscreen));
- } else {
- // Field is wider than screen. Try to left-align field, unless caret would
- // be offscreen, in which case right-align the caret.
- newOffset.setX(max<int>(textboxRectInDocumentCoordinates.x(), caretInDocumentCoordinates.x() + caretInDocumentCoordinates.width() + caretPadding - m_size.width));
- }
- if (textboxRectInDocumentCoordinates.height() <= m_size.height) {
- // Field is shorter than screen. Vertically center it.
- newOffset.setY(textboxRectInDocumentCoordinates.y() - (m_size.height - textboxRectInDocumentCoordinates.height()) / 2);
- } else {
- // Field is taller than screen. Try to top align field, unless caret would
- // be offscreen, in which case bottom-align the caret.
- newOffset.setY(max<int>(textboxRectInDocumentCoordinates.y(), caretInDocumentCoordinates.y() + caretInDocumentCoordinates.height() + caretPadding - m_size.height));
- }
-
- bool needAnimation = false;
- // If we are at less than the target zoom level, zoom in.
- if (deltaScale > minScaleChangeToTriggerZoom)
- needAnimation = true;
- // If the caret is offscreen, then animate.
- IntRect sizeRect(0, 0, m_size.width, m_size.height);
- if (!sizeRect.contains(caret))
- needAnimation = true;
- // If the box is partially offscreen and it's possible to bring it fully
- // onscreen, then animate.
- if (sizeRect.contains(textboxRectInDocumentCoordinates.width(), textboxRectInDocumentCoordinates.height()) && !sizeRect.contains(textboxRect))
- needAnimation = true;
-
- if (needAnimation)
- startPageScaleAnimation(newOffset, false, newScale, scrollAndScaleAnimationDurationInSeconds);
-#endif
+ Element* elementNode = static_cast<Element*>(focusedNode);
+ frame->view()->scrollElementToRect(elementNode, IntRect(rect.x, rect.y, rect.width, rect.height));
}
void WebViewImpl::advanceFocus(bool reverse)
@@ -2842,20 +2756,8 @@ void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin)
}
scaleFactor = clampPageScaleFactorToLimits(scaleFactor);
- WebPoint scrollOffset;
- if (!m_page->settings()->applyPageScaleFactorInCompositor()) {
- // If page scale is not applied in the compositor, then the scroll offsets should
- // be modified by the scale factor.
- scrollOffset = clampOffsetAtScale(origin, scaleFactor);
- } else {
- IntPoint offset = origin;
- WebSize contentSize = mainFrame()->contentsSize();
- offset.shrunkTo(IntPoint(contentSize.width - m_size.width, contentSize.height - m_size.height));
- offset.clampNegativeToZero();
- scrollOffset = offset;
- }
-
- page()->setPageScaleFactor(scaleFactor, scrollOffset);
+ WebPoint clampedOrigin = clampOffsetAtScale(origin, scaleFactor);
+ page()->setPageScaleFactor(scaleFactor, clampedOrigin);
m_pageScaleFactorIsSet = true;
}
@@ -3293,8 +3195,6 @@ void WebViewImpl::sendResizeEventAndRepaint()
m_client->didInvalidateRect(damagedRect);
}
}
- if (m_pageOverlays)
- m_pageOverlays->update();
}
void WebViewImpl::configureAutoResizeMode()
@@ -3512,13 +3412,13 @@ void WebView::addUserScript(const WebString& sourceCode,
WebView::UserScriptInjectAt injectAt,
WebView::UserContentInjectIn injectIn)
{
- Vector<String> patterns;
+ OwnPtr<Vector<String> > patterns = adoptPtr(new Vector<String>);
for (size_t i = 0; i < patternsIn.size(); ++i)
- patterns.append(patternsIn[i]);
+ patterns->append(patternsIn[i]);
PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::createUninitializedWorld());
- pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), patterns, Vector<String>(),
+ pageGroup->addUserScriptToWorld(world.get(), sourceCode, WebURL(), patterns.release(), nullptr,
static_cast<UserScriptInjectionTime>(injectAt),
static_cast<UserContentInjectedFrames>(injectIn));
}
@@ -3528,9 +3428,9 @@ void WebView::addUserStyleSheet(const WebString& sourceCode,
WebView::UserContentInjectIn injectIn,
WebView::UserStyleInjectionTime injectionTime)
{
- Vector<String> patterns;
+ OwnPtr<Vector<String> > patterns = adoptPtr(new Vector<String>);
for (size_t i = 0; i < patternsIn.size(); ++i)
- patterns.append(patternsIn[i]);
+ patterns->append(patternsIn[i]);
PageGroup* pageGroup = PageGroup::pageGroup(pageGroupName);
RefPtr<DOMWrapperWorld> world(DOMWrapperWorld::createUninitializedWorld());
@@ -3539,7 +3439,7 @@ void WebView::addUserStyleSheet(const WebString& sourceCode,
// callers specify this though, since in other cases the caller will probably want "user" level.
//
// FIXME: It would be nice to populate the URL correctly, instead of passing an empty URL.
- pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns, Vector<String>(),
+ pageGroup->addUserStyleSheetToWorld(world.get(), sourceCode, WebURL(), patterns.release(), nullptr,
static_cast<UserContentInjectedFrames>(injectIn),
UserStyleAuthorLevel,
static_cast<WebCore::UserStyleInjectionTime>(injectionTime));
@@ -3562,10 +3462,8 @@ void WebViewImpl::didCommitLoad(bool* isNewNavigation, bool isNavigationWithinPa
m_newNavigationLoader = 0;
#endif
m_observedNewNavigation = false;
- if (*isNewNavigation && !isNavigationWithinPage) {
+ if (*isNewNavigation && !isNavigationWithinPage)
m_pageScaleFactorIsSet = false;
- m_doubleTapZoomInEffect = false;
- }
// Make sure link highlight from previous page is cleared.
m_linkHighlight.clear();
@@ -3859,8 +3757,6 @@ void WebViewImpl::paintRootLayer(GraphicsContext& context, const IntRect& conten
if (!page())
return;
FrameView* view = page()->mainFrame()->view();
- if (context.platformContext())
- context.platformContext()->setDeviceScaleFactor(page()->deviceScaleFactor());
view->paintContents(&context, contentRect);
double paintEnd = currentTime();
double pixelsPerSec = (contentRect.width() * contentRect.height()) / (paintEnd - paintStart);
@@ -3880,9 +3776,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
if (!active) {
m_isAcceleratedCompositingActive = false;
// We need to finish all GL rendering before sending didDeactivateCompositor() to prevent
- // flickering when compositing turns off. This is only necessary if we're not in
- // force-compositing-mode.
- if (m_layerTreeView && !page()->settings()->forceCompositingMode())
+ // flickering when compositing turns off.
+ if (m_layerTreeView)
m_layerTreeView->finishAllRendering();
m_client->didDeactivateCompositor();
} else if (m_layerTreeView) {
@@ -4026,22 +3921,15 @@ void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal
mainFrameImpl()->frameView()->scrollBy(scrollDelta);
} else {
// The page scale changed, so apply a scale and scroll in a single
- // operation.
+ // operation. The old scroll offset (and passed-in delta) are
+ // in the old coordinate space, so we first need to multiply them
+ // by the page scale delta.
WebSize scrollOffset = mainFrame()->scrollOffset();
scrollOffset.width += scrollDelta.width;
scrollOffset.height += scrollDelta.height;
-
- WebPoint scrollPoint(scrollOffset.width, scrollOffset.height);
- if (!m_page->settings()->applyPageScaleFactorInCompositor()) {
- // The old scroll offset (and passed-in delta) are in the old
- // coordinate space, so we first need to multiply them by the page
- // scale delta.
- scrollPoint.x = scrollPoint.x * pageScaleDelta;
- scrollPoint.y = scrollPoint.y * pageScaleDelta;
- }
-
- setPageScaleFactor(pageScaleFactor() * pageScaleDelta, scrollPoint);
- m_doubleTapZoomInEffect = false;
+ WebPoint scaledScrollOffset(scrollOffset.width * pageScaleDelta,
+ scrollOffset.height * pageScaleDelta);
+ setPageScaleFactor(pageScaleFactor() * pageScaleDelta, scaledScrollOffset);
}
}
@@ -4132,8 +4020,12 @@ void WebViewImpl::selectAutofillSuggestionAtIndex(unsigned listIndex)
m_autofillPopupClient->valueChanged(listIndex);
}
-bool WebViewImpl::detectContentOnTouch(const WebPoint& position)
+bool WebViewImpl::detectContentOnTouch(const WebPoint& position, WebInputEvent::Type touchType)
{
+ ASSERT(touchType == WebInputEvent::GestureTap
+ || touchType == WebInputEvent::GestureTwoFingerTap
+ || touchType == WebInputEvent::GestureLongPress);
+
HitTestResult touchHit = hitTestResultForWindowPos(position);
if (touchHit.isContentEditable())
@@ -4146,14 +4038,22 @@ bool WebViewImpl::detectContentOnTouch(const WebPoint& position)
// Ignore when tapping on links or nodes listening to click events, unless the click event is on the
// body element, in which case it's unlikely that the original node itself was intended to be clickable.
for (; node && !node->hasTagName(HTMLNames::bodyTag); node = node->parentNode()) {
- if (node->isLink() || node->willRespondToTouchEvents() || node->willRespondToMouseClickEvents())
+ if (node->isLink() || (touchType == WebInputEvent::GestureTap
+ && (node->willRespondToTouchEvents() || node->willRespondToMouseClickEvents()))) {
return false;
+ }
}
WebContentDetectionResult content = m_client->detectContentAround(touchHit);
if (!content.isValid())
return false;
+ if (touchType != WebInputEvent::GestureTap) {
+ // Select the detected content as a block.
+ focusedFrame()->selectRange(content.range());
+ return true;
+ }
+
m_client->scheduleContentIntent(content.intent());
return true;
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index 47907f124..4c1a974a0 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -392,7 +392,7 @@ public:
void mouseContextMenu(const WebMouseEvent&);
void mouseDoubleClick(const WebMouseEvent&);
- bool detectContentOnTouch(const WebPoint&);
+ bool detectContentOnTouch(const WebPoint&, WebInputEvent::Type);
void startPageScaleAnimation(const WebCore::IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds);
void numberOfWheelEventHandlersChanged(unsigned);
@@ -561,14 +561,12 @@ public:
void fullFramePluginZoomLevelChanged(double zoomLevel);
#if ENABLE(GESTURE_EVENTS)
- void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, float& scale, WebPoint& scroll, bool& isAnchor);
+ void computeScaleAndScrollForHitRect(const WebRect& hitRect, AutoZoomType, float& scale, WebPoint& scroll);
WebCore::Node* bestTouchLinkNode(WebCore::IntPoint touchEventLocation);
void enableTouchHighlight(WebCore::IntPoint touchEventLocation);
#endif
void animateZoomAroundPoint(const WebCore::IntPoint&, AutoZoomType);
- void shouldUseAnimateDoubleTapTimeZeroForTesting(bool);
-
void loseCompositorContext(int numTimes);
void enterFullScreenForElement(WebCore::Element*);
@@ -742,12 +740,6 @@ private:
float m_savedPageScaleFactor; // 0 means that no page scale factor is saved.
WebCore::IntSize m_savedScrollOffset;
- // Whether the current scale was achieved by zooming in with double tap.
- bool m_doubleTapZoomInEffect;
-
- // Used for testing purposes.
- bool m_shouldUseDoubleTapTimeZero;
-
bool m_contextMenuAllowed;
bool m_doingDragAndDrop;
diff --git a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
index d287b0905..e127cfc6d 100644
--- a/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
+++ b/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.cpp
@@ -37,13 +37,13 @@
#include "Blob.h"
#include "ScriptExecutionContext.h"
#include "WebFileWriter.h"
+#include "platform/WebURL.h"
#include "WebWorkerBase.h"
#include "WorkerContext.h"
#include "WorkerFileWriterCallbacksBridge.h"
#include "WorkerLoaderProxy.h"
#include "WorkerThread.h"
#include <public/WebFileSystem.h>
-#include <public/WebURL.h>
#include <wtf/Assertions.h>
using namespace WebKit;
diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
index 755802380..bd9b1761a 100644
--- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
+++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp
@@ -39,13 +39,13 @@
#include "WebFileInfo.h"
#include "WebFileSystemCallbacks.h"
#include "WebFileSystemEntry.h"
+#include "platform/WebString.h"
+#include "platform/WebURL.h"
#include "WebWorkerBase.h"
#include "WorkerContext.h"
#include "WorkerLoaderProxy.h"
#include "WorkerScriptController.h"
#include "WorkerThread.h"
-#include <public/WebString.h>
-#include <public/WebURL.h>
#include <wtf/MainThread.h>
#include <wtf/Threading.h>
#include <wtf/UnusedParam.h>
diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
index 10168f53a..5c0a59084 100644
--- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
+++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h
@@ -35,8 +35,8 @@
#include "ScriptExecutionContext.h"
#include "WebFileError.h"
+#include "platform/WebVector.h"
#include <public/WebFileSystem.h>
-#include <public/WebVector.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
#include <wtf/Threading.h>
diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js
index bbdbd9805..f555419e9 100644
--- a/Source/WebKit/chromium/src/js/DevTools.js
+++ b/Source/WebKit/chromium/src/js/DevTools.js
@@ -41,7 +41,6 @@
Preferences.exposeDisableCache = true;
Preferences.showDockToRight = true;
Preferences.exposeFileSystemInspection = true;
- Preferences.experimentsEnabled = false;
})();}
function buildPlatformExtensionAPI(extensionInfo)
diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js
index 424e41a26..68c6742cc 100644
--- a/Source/WebKit/chromium/src/js/Tests.js
+++ b/Source/WebKit/chromium/src/js/Tests.js
@@ -555,90 +555,6 @@ TestSuite.prototype.testPauseInSharedWorkerInitialization = function()
};
-// Regression test for http://webk.it/97466
-TestSuite.prototype.testPageOverlayUpdate = function()
-{
- var test = this;
- var records = [];
- var dispatchOnRecordType = {}
-
- function addRecord(event)
- {
- innerAddRecord(event.data);
- }
-
- function innerAddRecord(record)
- {
- records.push(record);
- if (typeof dispatchOnRecordType[record.type] === "function")
- dispatchOnRecordType[record.type](record);
-
- if (record.children)
- record.children.forEach(innerAddRecord);
- }
-
- function populatePage()
- {
- var div1 = document.createElement("div");
- div1.id = "div1";
- // Force accelerated compositing.
- div1.style.webkitTransform = "translateZ(0)";
- document.body.appendChild(div1);
- var div2 = document.createElement("div");
- div2.id = "div2";
- document.body.appendChild(div2);
- }
-
- function step1()
- {
- WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addRecord);
- WebInspector.timelineManager.start();
-
- test.evaluateInConsole_(populatePage.toString() + "; populatePage();" +
- "inspect(document.getElementById('div1'))", function() {});
- WebInspector.notifications.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step2);
- }
-
- function step2()
- {
- WebInspector.notifications.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step2);
- setTimeout(step3, 500);
- }
-
- function step3()
- {
- test.evaluateInConsole_("inspect(document.getElementById('div2'))", function() {});
- WebInspector.notifications.addEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step4);
- }
-
- function step4()
- {
- WebInspector.notifications.removeEventListener(WebInspector.ElementsTreeOutline.Events.SelectedNodeChanged, step4);
- dispatchOnRecordType.TimeStamp = step5;
- test.evaluateInConsole_("console.timeStamp('ready')", function() {});
- }
-
- function step5()
- {
- var types = {};
- WebInspector.timelineManager.stop();
- WebInspector.timelineManager.removeEventListener(WebInspector.TimelineManager.EventTypes.TimelineEventRecorded, addRecord);
- for (var i = 0; i < records.length; ++i)
- types[records[i].type] = (types[records[i].type] || 0) + 1;
-
- var frameCount = types["BeginFrame"];
- // There should be at least two updates caused by selection of nodes.
- test.assertTrue(frameCount >= 2, "Not enough DevTools overlay updates");
- // We normally expect up to 3 frames, but allow for a bit more in case
- // of some unexpected invalidations.
- test.assertTrue(frameCount < 6, "Too many updates caused by DevTools overlay");
- test.releaseControl();
- }
-
- step1();
- this.takeControl();
-}
-
TestSuite.prototype.waitForTestResultsInConsole = function()
{
var messages = WebInspector.console.messages;
diff --git a/Source/WebKit/chromium/src/mac/WebInputEventFactory.mm b/Source/WebKit/chromium/src/mac/WebInputEventFactory.mm
index 4854ae218..b3a22fee1 100644
--- a/Source/WebKit/chromium/src/mac/WebInputEventFactory.mm
+++ b/Source/WebKit/chromium/src/mac/WebInputEventFactory.mm
@@ -135,6 +135,9 @@ static bool isKeypadEvent(NSEvent* event)
return false;
}
+ if ([event modifierFlags] & NSNumericPadKeyMask)
+ return true;
+
switch ([event keyCode]) {
case 71: // Clear
case 81: // =
diff --git a/Source/WebKit/chromium/src/painting/PaintAggregator.cpp b/Source/WebKit/chromium/src/painting/PaintAggregator.cpp
index 89f28d33d..a373342ca 100644
--- a/Source/WebKit/chromium/src/painting/PaintAggregator.cpp
+++ b/Source/WebKit/chromium/src/painting/PaintAggregator.cpp
@@ -30,7 +30,10 @@
#include "config.h"
#include "PaintAggregator.h"
-#include <public/Platform.h>
+
+#include "WebKit.h"
+#include "platform/WebKitPlatformSupport.h"
+
using namespace WebCore;
namespace WebKit {