summaryrefslogtreecommitdiff
path: root/Source/WebKit
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-09 09:42:44 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-09 09:42:44 +0100
commita59391482883479a9b28a6f1ace6d1ebd08a7ecd (patch)
treefa539db054a20a67bff2fc891c33b0f4ec632916 /Source/WebKit
parentcfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff)
downloadqtwebkit-a59391482883479a9b28a6f1ace6d1ebd08a7ecd.tar.gz
Imported WebKit commit 7bcdfab9a40db7d16b4b95bb77d78b8a59c9e701 (http://svn.webkit.org/repository/webkit/trunk@134025)
New snapshot with numerious build fixes, including MSVC 2012 and ARM Thumb-2.
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/ChangeLog21
-rw-r--r--Source/WebKit/PlatformEfl.cmake20
-rw-r--r--Source/WebKit/WebKit.xcodeproj/project.pbxproj4
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore.cpp34
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore_p.h6
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller.cpp14
-rw-r--r--Source/WebKit/blackberry/Api/InRegionScroller.h6
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp319
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.h34
-rw-r--r--Source/WebKit/blackberry/Api/WebPageClient.h36
-rw-r--r--Source/WebKit/blackberry/Api/WebPage_p.h14
-rw-r--r--Source/WebKit/blackberry/Api/WebSettings.cpp29
-rw-r--r--Source/WebKit/blackberry/Api/WebSettings.h3
-rw-r--r--Source/WebKit/blackberry/ChangeLog234
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp2
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp12
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.h1
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp4
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp2
-rw-r--r--Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp5
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/FatFingers.h17
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp45
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/InputHandler.h2
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp28
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/TileIndex.h25
-rw-r--r--Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp8
-rw-r--r--Source/WebKit/chromium/ChangeLog323
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/public/WebInputEvent.h2
-rw-r--r--Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/DateTimeChooserImpl.cpp32
-rw-r--r--Source/WebKit/chromium/src/LinkHighlight.cpp1
-rw-r--r--Source/WebKit/chromium/src/PageWidgetDelegate.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp10
-rw-r--r--Source/WebKit/chromium/src/WebElement.cpp7
-rw-r--r--Source/WebKit/chromium/src/WebInputEventConversion.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebPagePopupImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebPopupMenuImpl.cpp1
-rw-r--r--Source/WebKit/chromium/src/WebScriptController.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp3
-rw-r--r--Source/WebKit/chromium/src/js/devTools.css4
-rw-r--r--Source/WebKit/chromium/src/mac/WebScreenInfoFactory.mm1
-rw-r--r--Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp47
-rw-r--r--Source/WebKit/chromium/tests/IDBFakeBackingStore.h16
-rw-r--r--Source/WebKit/chromium/tests/LevelDBTest.cpp95
-rw-r--r--Source/WebKit/efl/ChangeLog6
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp1
-rw-r--r--Source/WebKit/mac/ChangeLog36
-rw-r--r--Source/WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--Source/WebKit/mac/History/WebHistory.mm2
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm17
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp32
-rw-r--r--Source/WebKit/qt/Api/qwebpage.h2
-rw-r--r--Source/WebKit/qt/ChangeLog45
-rw-r--r--Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp63
55 files changed, 1175 insertions, 510 deletions
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 3a5b65973..60f188987 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2012-11-08 Laszlo Gombos <l.gombos@samsung.com>
+
+ [EFL] Remove non-variable options from the build system
+ https://bugs.webkit.org/show_bug.cgi?id=101506
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Remove WTF_USE_FREETYPE and ENABLE_GLIB_SUPPORT cmake variables
+ as these are always set to const 1 and not really configurable.
+
+ * PlatformEfl.cmake:
+
+2012-11-07 Andreas Kling <akling@apple.com>
+
+ Remove build-webkit dependency on Java SDK for Apple Mac WebKit.
+ <http://webkit.org/b/101492>
+
+ Reviewed by Anders Carlsson.
+
+ * WebKit.xcodeproj/project.pbxproj: Remove WebJavaPlugIn.h
+
2012-11-06 Laszlo Gombos <l.gombos@samsung.com>
[EFL] Simplify the build system
diff --git a/Source/WebKit/PlatformEfl.cmake b/Source/WebKit/PlatformEfl.cmake
index 5109ac9c6..e8cb6bb9c 100644
--- a/Source/WebKit/PlatformEfl.cmake
+++ b/Source/WebKit/PlatformEfl.cmake
@@ -49,11 +49,9 @@ IF (ENABLE_VIDEO_TRACK)
)
ENDIF ()
-IF (WTF_USE_FREETYPE)
- LIST(APPEND WebKit_INCLUDE_DIRECTORIES
- "${WEBCORE_DIR}/platform/graphics/freetype"
- )
-ENDIF ()
+LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+ "${WEBCORE_DIR}/platform/graphics/freetype"
+)
IF (ENABLE_NOTIFICATIONS)
LIST(APPEND WebKit_INCLUDE_DIRECTORIES
@@ -233,13 +231,11 @@ SET(EWKUnitTests_INCLUDE_DIRECTORIES
${EDJE_INCLUDE_DIRS}
)
-IF (ENABLE_GLIB_SUPPORT)
- LIST(APPEND EWKUnitTests_INCLUDE_DIRECTORIES "${WTF_DIR}/wtf/gobject")
- LIST(APPEND EWKUnitTests_LIBRARIES
- ${GLIB_LIBRARIES}
- ${GLIB_GTHREAD_LIBRARIES}
- )
-ENDIF ()
+LIST(APPEND EWKUnitTests_INCLUDE_DIRECTORIES "${WTF_DIR}/wtf/gobject")
+LIST(APPEND EWKUnitTests_LIBRARIES
+ ${GLIB_LIBRARIES}
+ ${GLIB_GTHREAD_LIBRARIES}
+)
SET(DEFAULT_TEST_PAGE_DIR ${CMAKE_SOURCE_DIR}/Source/WebKit/efl/tests/resources)
diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
index d73e32fa2..d33b7411e 100644
--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -234,7 +234,6 @@
9398109C0824BF01008DF038 /* WebFrameInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 930D02BD06275F710076701E /* WebFrameInternal.h */; };
9398109D0824BF01008DF038 /* WebDOMOperationsPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 84AE905F062DE6A80075BBF9 /* WebDOMOperationsPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
9398109E0824BF01008DF038 /* WebEditingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = BE4FBECB0653DF47005EDE15 /* WebEditingDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */ = {isa = PBXBuildFile; fileRef = 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */; settings = {ATTRIBUTES = (Public, ); }; };
939810A10824BF01008DF038 /* WebHTMLViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */; };
939810A20824BF01008DF038 /* WebNSObjectExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */; };
939810A40824BF01008DF038 /* WebPDFView.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E94C3406C0321200A9B09E /* WebPDFView.h */; };
@@ -510,7 +509,6 @@
516F296F03A6C45A00CA2D3A /* WebHistoryItemInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
5185F62510712B80007AA393 /* WebNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNavigationData.h; sourceTree = "<group>"; };
5185F62710712B97007AA393 /* WebNavigationData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNavigationData.mm; sourceTree = "<group>"; };
- 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebJavaPlugIn.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B52E04282B5900CA2D3A /* WebFrameView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B52F04282B5900CA2D3A /* WebFrameView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B53204282BD200CA2D3A /* WebFrameViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -1121,7 +1119,6 @@
848DFF430365F71500CA2ACA /* WebKit Plug-ins */ = {
isa = PBXGroup;
children = (
- 51863EFC065419EB00E9E8DD /* WebJavaPlugIn.h */,
848DFF840365FE6A00CA2ACA /* WebPlugin.h */,
848DFF850365FE6A00CA2ACA /* WebPluginContainer.h */,
65E1150307EFFEBF009B8BF7 /* WebPluginContainerCheck.h */,
@@ -1517,7 +1514,6 @@
06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */,
B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */,
7A8FF0D11075024A00A80A08 /* WebInspectorPrivate.h in Headers */,
- 939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */,
939810420824BF01008DF038 /* WebJavaScriptTextInputPanel.h in Headers */,
37D1DCA81065928C0068F7EF /* WebJSPDFDoc.h in Headers */,
939810850824BF01008DF038 /* WebKeyGenerator.h in Headers */,
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp
index 0dac9cb31..0f078f5e3 100644
--- a/Source/WebKit/blackberry/Api/BackingStore.cpp
+++ b/Source/WebKit/blackberry/Api/BackingStore.cpp
@@ -206,6 +206,7 @@ BackingStorePrivate::BackingStorePrivate()
, m_renderQueue(adoptPtr(new RenderQueue(this)))
, m_defersBlit(true)
, m_hasBlitJobs(false)
+ , m_webPageBackgroundColor(WebCore::Color::white)
, m_currentWindowBackBuffer(0)
, m_preferredTileMatrixDimension(Vertical)
#if USE(ACCELERATED_COMPOSITING)
@@ -409,7 +410,7 @@ void BackingStorePrivate::repaint(const Platform::IntRect& windowRect,
if (render(rect)) {
if (!shouldDirectRenderingToWindow() && !m_webPage->d->commitRootLayerIfNeeded())
blitVisibleContents();
- m_webPage->d->m_client->notifyContentRendered(rect);
+ m_webPage->d->m_client->notifyPixelContentRendered(rect);
}
} else
m_renderQueue->addToQueue(RenderQueue::RegularRender, rect);
@@ -2366,9 +2367,38 @@ void BackingStorePrivate::fillWindow(Platform::Graphics::FillPattern pattern,
"Empty window buffer, couldn't fillWindow");
}
+ if (pattern == BlackBerry::Platform::Graphics::CheckerboardPattern && BlackBerry::Platform::Settings::isPublicBuild()) {
+ // For public builds, convey the impression of less checkerboard.
+ // For developer builds, keep the checkerboard to get it fixed better.
+ BlackBerry::Platform::Graphics::clearBuffer(dstBuffer, dstRect,
+ m_webPageBackgroundColor.red(), m_webPageBackgroundColor.green(),
+ m_webPageBackgroundColor.blue(), m_webPageBackgroundColor.alpha());
+ return;
+ }
+
BlackBerry::Platform::Graphics::fillBuffer(dstBuffer, pattern, dstRect, contentsOrigin, contentsScale);
}
+WebCore::Color BackingStorePrivate::webPageBackgroundColorUserInterfaceThread() const
+{
+ ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread());
+ return m_webPageBackgroundColor;
+}
+
+void BackingStorePrivate::setWebPageBackgroundColor(const WebCore::Color& color)
+{
+ if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
+ typedef void (BlackBerry::WebKit::BackingStorePrivate::*FunctionType)(const WebCore::Color&);
+
+ BlackBerry::Platform::userInterfaceThreadMessageClient()->dispatchMessage(
+ BlackBerry::Platform::createMethodCallMessage<FunctionType, BackingStorePrivate, WebCore::Color>(
+ &BackingStorePrivate::setWebPageBackgroundColor, this, color));
+ return;
+ }
+
+ m_webPageBackgroundColor = color;
+}
+
void BackingStorePrivate::invalidateWindow()
{
// Grab a rect appropriate for the current thread.
@@ -2570,7 +2600,7 @@ void BackingStorePrivate::didRenderContent(const Platform::IntRect& renderedRect
} else
invalidateWindow();
- m_webPage->client()->notifyContentRendered(renderedRect);
+ m_webPage->client()->notifyPixelContentRendered(renderedRect);
}
BackingStore::BackingStore(WebPage* webPage, BackingStoreClient* client)
diff --git a/Source/WebKit/blackberry/Api/BackingStore_p.h b/Source/WebKit/blackberry/Api/BackingStore_p.h
index 8e52a12ae..d2fd95cc0 100644
--- a/Source/WebKit/blackberry/Api/BackingStore_p.h
+++ b/Source/WebKit/blackberry/Api/BackingStore_p.h
@@ -20,6 +20,7 @@
#define BackingStore_p_h
#include "BackingStore.h"
+#include "Color.h"
#include "RenderQueue.h"
#include "TileIndex.h"
#include "TileIndexHash.h"
@@ -319,6 +320,9 @@ public:
void blitToWindow(const Platform::IntRect& dstRect, const BlackBerry::Platform::Graphics::Buffer* srcBuffer, const Platform::IntRect& srcRect, bool blend, unsigned char globalAlpha);
void fillWindow(Platform::Graphics::FillPattern, const Platform::IntRect& dstRect, const Platform::IntPoint& contentsOrigin, double contentsScale);
+ WebCore::Color webPageBackgroundColorUserInterfaceThread() const; // use WebSettings::backgroundColor() for the WebKit thread
+ void setWebPageBackgroundColor(const WebCore::Color&);
+
void invalidateWindow();
void invalidateWindow(const Platform::IntRect& dst);
void clearWindow(const Platform::IntRect&, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha = 255);
@@ -363,6 +367,8 @@ public:
bool m_defersBlit;
bool m_hasBlitJobs;
+ WebCore::Color m_webPageBackgroundColor; // for user interface thread operations such as blitting
+
mutable unsigned m_frontState;
mutable unsigned m_backState;
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.cpp b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
index db656a932..89bd5ec4c 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller.cpp
+++ b/Source/WebKit/blackberry/Api/InRegionScroller.cpp
@@ -57,21 +57,19 @@ InRegionScroller::~InRegionScroller()
delete d;
}
-bool InRegionScroller::setScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition)
+bool InRegionScroller::setDocumentScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& documentScrollPosition)
{
ASSERT(Platform::userInterfaceThreadMessageClient()->isCurrentThread());
- // FIXME: Negative values won't work with map{To,From}Transform methods.
- return d->setScrollPositionCompositingThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition));
+ return d->setScrollPositionCompositingThread(camouflagedLayer, documentScrollPosition);
}
-bool InRegionScroller::setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& scrollPosition,
+bool InRegionScroller::setDocumentScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& documentScrollPosition,
bool supportsAcceleratedScrolling, Platform::ScrollViewBase::ScrollTarget scrollTarget)
{
ASSERT(Platform::webKitThreadMessageClient()->isCurrentThread());
- // FIXME: Negative values won't work with map{To,From}Transform methods.
- return d->setScrollPositionWebKitThread(camouflagedLayer, d->m_webPage->mapFromTransformed(scrollPosition), supportsAcceleratedScrolling, scrollTarget);
+ return d->setScrollPositionWebKitThread(camouflagedLayer, documentScrollPosition, supportsAcceleratedScrolling, scrollTarget);
}
InRegionScrollerPrivate::InRegionScrollerPrivate(WebPagePrivate* webPagePrivate)
@@ -196,12 +194,12 @@ void InRegionScrollerPrivate::calculateActiveAndShrinkCachedScrollableAreas(Rend
m_needsActiveScrollableAreaCalculation = false;
}
-void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint& point)
+void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint& documentPoint)
{
ASSERT(m_activeInRegionScrollableAreas.empty());
m_needsActiveScrollableAreaCalculation = false;
- const HitTestResult& result = m_webPage->hitTestResult(m_webPage->mapFromViewportToContents(point));
+ const HitTestResult& result = m_webPage->hitTestResult(documentPoint);
Node* node = result.innerNonSharedNode();
if (!node || !node->renderer())
return;
diff --git a/Source/WebKit/blackberry/Api/InRegionScroller.h b/Source/WebKit/blackberry/Api/InRegionScroller.h
index 5917baaf6..8168c3cfc 100644
--- a/Source/WebKit/blackberry/Api/InRegionScroller.h
+++ b/Source/WebKit/blackberry/Api/InRegionScroller.h
@@ -36,9 +36,9 @@ public:
InRegionScroller(WebPagePrivate*);
~InRegionScroller();
- bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/);
- bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& /*scrollPosition*/,
- bool /*acceleratedScrolling*/, Platform::ScrollViewBase::ScrollTarget);
+ bool setDocumentScrollPositionCompositingThread(unsigned camouflagedLayer, const Platform::IntPoint& documentScrollPosition);
+ bool setDocumentScrollPositionWebKitThread(unsigned camouflagedLayer, const Platform::IntPoint& documentScrollPosition,
+ bool acceleratedScrolling, Platform::ScrollViewBase::ScrollTarget);
private:
friend class WebPagePrivate;
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index c08725fd2..aaf573db5 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -191,7 +191,6 @@
#include "PlatformScreen.h"
#endif
-#define DEBUG_BLOCK_ZOOM 0
#define DEBUG_TOUCH_EVENTS 0
#define DEBUG_WEBPAGE_LOAD 0
#define DEBUG_AC_COMMIT 0
@@ -379,8 +378,6 @@ WebPagePrivate::WebPagePrivate(WebPage* webPage, WebPageClient* client, const In
, m_nestedLayoutFinishedCount(0)
, m_actualVisibleWidth(rect.width())
, m_actualVisibleHeight(rect.height())
- , m_virtualViewportWidth(0)
- , m_virtualViewportHeight(0)
, m_defaultLayoutSize(minimumLayoutSize)
, m_didRestoreFromPageCache(false)
, m_viewMode(WebPagePrivate::Desktop) // Default to Desktop mode for PB.
@@ -1036,6 +1033,11 @@ void WebPagePrivate::setLoadState(LoadState state)
if (state == Finished && m_mainFrame && m_mainFrame->document())
m_mainFrame->document()->updateStyleIfNeeded();
+ // Dispatch the backingstore background color at important state changes.
+ m_backingStore->d->setWebPageBackgroundColor(m_mainFrame && m_mainFrame->view()
+ ? m_mainFrame->view()->documentBackgroundColor()
+ : m_webSettings->backgroundColor());
+
m_loadState = state;
#if DEBUG_WEBPAGE_LOAD
@@ -1078,14 +1080,11 @@ void WebPagePrivate::setLoadState(LoadState state)
m_userPerformedManualZoom = false;
m_userPerformedManualScroll = false;
m_shouldUseFixedDesktopMode = false;
- if (m_resetVirtualViewportOnCommitted) { // For DRT.
- m_virtualViewportWidth = 0;
- m_virtualViewportHeight = 0;
- }
- if (m_webSettings->viewportWidth() > 0) {
- m_virtualViewportWidth = m_webSettings->viewportWidth();
- m_virtualViewportHeight = m_defaultLayoutSize.height();
- }
+ if (m_resetVirtualViewportOnCommitted) // For DRT.
+ m_virtualViewportSize = IntSize();
+ if (m_webSettings->viewportWidth() > 0)
+ m_virtualViewportSize = IntSize(m_webSettings->viewportWidth(), m_defaultLayoutSize.height());
+
// Check if we have already process the meta viewport tag, this only happens on history navigation.
// For back/forward history navigation, we should only keep these previous values if the document
// has the meta viewport tag when the state is Committed in setLoadState.
@@ -1103,8 +1102,8 @@ void WebPagePrivate::setLoadState(LoadState state)
// content it will overwrite the fallback arguments soon.
dispatchViewportPropertiesDidChange(m_userViewportArguments);
} else {
- IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
- m_webPage->setVirtualViewportSize(virtualViewport.width(), virtualViewport.height());
+ Platform::IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
+ m_webPage->setVirtualViewportSize(virtualViewport);
}
#if ENABLE(EVENT_MODE_METATAGS)
@@ -1144,7 +1143,7 @@ void WebPagePrivate::setLoadState(LoadState state)
case Finished:
case Failed:
// Notify client of the initial zoom change.
- m_client->zoomChanged(m_webPage->isMinZoomed(), m_webPage->isMaxZoomed(), !shouldZoomOnEscape(), currentScale());
+ m_client->scaleChanged();
m_backingStore->d->updateTiles(true /* updateVisible */, false /* immediate */);
break;
default:
@@ -1173,7 +1172,7 @@ bool WebPagePrivate::shouldZoomAboutPoint(double scale, const FloatPoint&, bool
*clampedScale = scale;
if (currentScale() == scale) {
- m_client->zoomChanged(m_webPage->isMinZoomed(), m_webPage->isMaxZoomed(), !shouldZoomOnEscape(), currentScale());
+ m_client->scaleChanged();
return false;
}
@@ -1264,7 +1263,7 @@ bool WebPagePrivate::zoomAboutPoint(double unclampedScale, const FloatPoint& anc
m_backingStore->d->clearVisibleZoom();
}
- m_client->zoomChanged(m_webPage->isMinZoomed(), m_webPage->isMaxZoomed(), !shouldZoomOnEscape(), currentScale());
+ m_client->scaleChanged();
if (m_pendingOrientation != -1)
m_client->updateInteractionViews();
@@ -1334,9 +1333,10 @@ void WebPagePrivate::setScrollPosition(const IntPoint& pos)
}
// Setting the scroll position is in transformed coordinates.
-void WebPage::setScrollPosition(const Platform::IntPoint& point)
+void WebPage::setDocumentScrollPosition(const Platform::IntPoint& documentScrollPosition)
{
- if (d->transformedPointEqualsUntransformedPoint(point, d->scrollPosition()))
+ WebCore::IntPoint scrollPosition = documentScrollPosition;
+ if (scrollPosition == d->scrollPosition())
return;
// If the user recently performed an event, this new scroll position
@@ -1352,7 +1352,7 @@ void WebPage::setScrollPosition(const Platform::IntPoint& point)
// WebKit thread to avoid scroll position clamping during scrolling, and restore it to what it was after that.
bool constrainsScrollingToContentEdge = d->m_mainFrame->view()->constrainsScrollingToContentEdge();
d->m_mainFrame->view()->setConstrainsScrollingToContentEdge(false);
- d->setScrollPosition(d->mapFromTransformed(point));
+ d->setScrollPosition(scrollPosition);
d->m_mainFrame->view()->setConstrainsScrollingToContentEdge(constrainsScrollingToContentEdge);
d->m_backingStoreClient->setIsClientGeneratedScroll(false);
@@ -1414,19 +1414,6 @@ void WebPagePrivate::deferredTasksTimerFired(WebCore::Timer<WebPagePrivate>*)
task->perform(this);
}
-void WebPagePrivate::scrollBy(int deltaX, int deltaY)
-{
- IntSize delta(deltaX, deltaY);
- setScrollPosition(scrollPosition() + delta);
-}
-
-void WebPage::scrollBy(const Platform::IntSize& delta)
-{
- d->m_backingStoreClient->setIsClientGeneratedScroll(true);
- d->scrollBy(delta.width(), delta.height());
- d->m_backingStoreClient->setIsClientGeneratedScroll(false);
-}
-
void WebPagePrivate::notifyInRegionScrollStopped()
{
if (m_inRegionScroller->d->isActive()) {
@@ -1460,7 +1447,7 @@ IntSize WebPagePrivate::actualVisibleSize() const
bool WebPagePrivate::hasVirtualViewport() const
{
- return m_virtualViewportWidth && m_virtualViewportHeight;
+ return !m_virtualViewportSize.isEmpty();
}
void WebPagePrivate::updateViewportSize(bool setFixedReportedSize, bool sendResizeEvent)
@@ -1686,11 +1673,6 @@ double WebPagePrivate::zoomToFitScale() const
return std::max(zoomToFitScale, minimumZoomToFitScale);
}
-double WebPage::zoomToFitScale() const
-{
- return d->zoomToFitScale();
-}
-
double WebPagePrivate::initialScale() const
{
if (m_initialScale > 0.0)
@@ -1778,12 +1760,6 @@ IntPoint WebPagePrivate::transformedScrollPosition() const
return m_backingStoreClient->transformedScrollPosition();
}
-// Returned scroll position is in transformed coordinates.
-Platform::IntPoint WebPage::scrollPosition() const
-{
- return d->transformedScrollPosition();
-}
-
IntPoint WebPagePrivate::transformedMaximumScrollPosition() const
{
return m_backingStoreClient->transformedMaximumScrollPosition();
@@ -1967,14 +1943,14 @@ void WebPagePrivate::notifyTransformedContentsSizeChanged()
const IntSize size = transformedContentsSize();
m_backingStore->d->contentsSizeChanged(size);
- m_client->contentsSizeChanged(size);
+ m_client->contentsSizeChanged();
}
void WebPagePrivate::notifyTransformedScrollChanged()
{
const IntPoint pos = transformedScrollPosition();
m_backingStore->d->scrollChanged(pos);
- m_client->scrollChanged(pos);
+ m_client->scrollChanged();
}
bool WebPagePrivate::setViewMode(ViewMode mode)
@@ -2031,7 +2007,7 @@ void WebPagePrivate::setCursor(PlatformCursor handle)
{
if (m_currentCursor.type() != handle.type()) {
m_currentCursor = handle;
- m_client->cursorChanged(handle.type(), handle.url().c_str(), handle.hotspot().x(), handle.hotspot().y());
+ m_client->cursorChanged(handle.type(), handle.url().c_str(), handle.hotspot());
}
}
@@ -2227,12 +2203,12 @@ void WebPagePrivate::syncProxyCredential(const WebCore::Credential& credential)
m_client->syncProxyCredential(credential.user(), credential.password());
}
-void WebPagePrivate::notifyPopupAutofillDialog(const Vector<String>& candidates, const WebCore::IntRect& screenRect)
+void WebPagePrivate::notifyPopupAutofillDialog(const Vector<String>& candidates)
{
vector<BlackBerry::Platform::String> textItems;
for (size_t i = 0; i < candidates.size(); i++)
textItems.push_back(candidates[i]);
- m_client->notifyPopupAutofillDialog(textItems, screenRect);
+ m_client->notifyPopupAutofillDialog(textItems);
}
void WebPagePrivate::notifyDismissAutofillDialog()
@@ -2405,7 +2381,7 @@ void WebPagePrivate::updateCursor()
IntSize WebPagePrivate::fixedLayoutSize(bool snapToIncrement) const
{
if (hasVirtualViewport())
- return IntSize(m_virtualViewportWidth, m_virtualViewportHeight);
+ return m_virtualViewportSize;
const int defaultLayoutWidth = m_defaultLayoutSize.width();
const int defaultLayoutHeight = m_defaultLayoutSize.height();
@@ -2676,11 +2652,10 @@ static inline int distanceBetweenPoints(IntPoint p1, IntPoint p2)
return sqrt((dx * dx) + (dy * dy));
}
-Node* WebPagePrivate::bestNodeForZoomUnderPoint(const IntPoint& point)
+Node* WebPagePrivate::bestNodeForZoomUnderPoint(const IntPoint& documentPoint)
{
- IntPoint pt = mapFromTransformed(point);
- IntRect clickRect(pt.x() - blockClickRadius, pt.y() - blockClickRadius, 2 * blockClickRadius, 2 * blockClickRadius);
- Node* originalNode = nodeForZoomUnderPoint(point);
+ IntRect clickRect(documentPoint.x() - blockClickRadius, documentPoint.y() - blockClickRadius, 2 * blockClickRadius, 2 * blockClickRadius);
+ Node* originalNode = nodeForZoomUnderPoint(documentPoint);
if (!originalNode)
return 0;
Node* node = bestChildNodeForClickRect(originalNode, clickRect);
@@ -2939,28 +2914,6 @@ IntRect WebPagePrivate::blockZoomRectForNode(Node* node)
blockRect = mapToTransformed(blockRect);
clipToTransformedContentsRect(blockRect);
-#if DEBUG_BLOCK_ZOOM
- if (!m_backingStore->d->isSuspended()) {
- // Re-paint the backingstore to screen to erase other annotations.
- if (m_backingStore->d->shouldDirectRenderingToWindow())
- m_backingStore->d->renderVisibleContents();
- else
- m_backingStore->d->blitVisibleContents();
-
- // Render a black square over the calculated block and a gray square over the original block for visual inspection.
- originalRect = mapToTransformed(originalRect);
- clipToTransformedContentsRect(originalRect);
- IntRect renderRect = mapFromTransformedContentsToTransformedViewport(blockRect);
- IntRect originalRenderRect = mapFromTransformedContentsToTransformedViewport(originalRect);
- IntSize viewportSize = transformedViewportSize();
- renderRect.intersect(IntRect(0, 0, viewportSize.width(), viewportSize.height()));
- originalRenderRect.intersect(IntRect(0, 0, viewportSize.width(), viewportSize.height()));
- m_backingStore->d->clearWindow(renderRect, 0, 0, 0);
- m_backingStore->d->clearWindow(originalRenderRect, 120, 120, 120);
- m_backingStore->d->invalidateWindow(renderRect);
- }
-#endif
-
return blockRect;
}
@@ -2971,7 +2924,7 @@ void WebPagePrivate::zoomBlock()
if (!m_mainFrame)
return;
- IntPoint anchor(roundUntransformedPoint(mapFromTransformedFloatPoint(m_finalBlockPoint)));
+ IntPoint anchor(roundUntransformedPoint(m_finalBlockPoint));
bool willUseTextReflow = false;
#if ENABLE(VIEWPORT_REFLOW)
@@ -3040,7 +2993,7 @@ void WebPagePrivate::zoomBlock()
}
notifyTransformChanged();
- m_client->zoomChanged(m_webPage->isMinZoomed(), m_webPage->isMaxZoomed(), !shouldZoomOnEscape(), currentScale());
+ m_client->scaleChanged();
m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
}
@@ -3409,10 +3362,9 @@ void WebPage::setColorInput(const BlackBerry::Platform::String& value)
d->m_inputHandler->setInputValue(value);
}
-void WebPage::setVirtualViewportSize(int width, int height)
+void WebPage::setVirtualViewportSize(const Platform::IntSize& size)
{
- d->m_virtualViewportWidth = width;
- d->m_virtualViewportHeight = height;
+ d->m_virtualViewportSize = WebCore::IntSize(size);
}
void WebPage::resetVirtualViewportOnCommitted(bool reset)
@@ -3420,7 +3372,7 @@ void WebPage::resetVirtualViewportOnCommitted(bool reset)
d->m_resetVirtualViewportOnCommitted = reset;
}
-IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments()
+Platform::IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments()
{
static const ViewportArguments defaultViewportArguments;
if (m_viewportArguments == defaultViewportArguments)
@@ -3441,7 +3393,7 @@ IntSize WebPagePrivate::recomputeVirtualViewportFromViewportArguments()
if (result.maximumScale > 0)
setMaximumScale(result.maximumScale * devicePixelRatio);
- return IntSize(result.layoutSize.width(), result.layoutSize.height());
+ return Platform::IntSize(result.layoutSize.width(), result.layoutSize.height());
}
#if ENABLE(EVENT_MODE_METATAGS)
@@ -3483,8 +3435,8 @@ void WebPagePrivate::dispatchViewportPropertiesDidChange(const ViewportArguments
if (!m_viewportArguments.height)
m_viewportArguments.height = ViewportArguments::ValueDeviceHeight;
- IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
- m_webPage->setVirtualViewportSize(virtualViewport.width(), virtualViewport.height());
+ Platform::IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
+ m_webPage->setVirtualViewportSize(virtualViewport);
if (loadState() == WebKit::WebPagePrivate::Committed)
zoomToInitialScaleOnLoad();
@@ -3543,7 +3495,7 @@ void WebPagePrivate::resumeBackingStore()
if (m_backingStore->d->renderVisibleContents()) {
if (!m_backingStore->d->isSuspended() && !directRendering)
m_backingStore->d->blitVisibleContents();
- m_client->notifyContentRendered(m_backingStore->d->visibleContentsRect());
+ m_client->notifyPixelContentRendered(m_backingStore->d->visibleContentsRect());
}
} else {
if (m_backingStore->d->isOpenGLCompositing())
@@ -3656,9 +3608,9 @@ void WebPagePrivate::setViewportSize(const IntSize& transformedActualVisibleSize
static ViewportArguments defaultViewportArguments;
if (m_viewportArguments != defaultViewportArguments) {
// We may need to infer the width and height for the viewport with respect to the rotation.
- IntSize newVirtualViewport = recomputeVirtualViewportFromViewportArguments();
+ Platform::IntSize newVirtualViewport = recomputeVirtualViewportFromViewportArguments();
ASSERT(!newVirtualViewport.isEmpty());
- m_webPage->setVirtualViewportSize(newVirtualViewport.width(), newVirtualViewport.height());
+ m_webPage->setVirtualViewportSize(newVirtualViewport);
m_mainFrame->view()->setUseFixedLayout(useFixedLayout());
m_mainFrame->view()->setFixedLayoutSize(fixedLayoutSize());
needsLayout = true;
@@ -3671,33 +3623,34 @@ void WebPagePrivate::setViewportSize(const IntSize& transformedActualVisibleSize
IntSize viewportSizeAfter = actualVisibleSize();
- IntPoint offset(roundf((viewportSizeBefore.width() - viewportSizeAfter.width()) / 2.0),
- roundf((viewportSizeBefore.height() - viewportSizeAfter.height()) / 2.0));
+ IntSize offset(
+ roundf((viewportSizeBefore.width() - viewportSizeAfter.width()) / 2.0),
+ roundf((viewportSizeBefore.height() - viewportSizeAfter.height()) / 2.0));
// As a special case, if we were anchored to the top left position at
// the beginning of the rotation then preserve that anchor.
if (atTop)
- offset.setY(0);
+ offset.setHeight(0);
if (atLeft)
- offset.setX(0);
+ offset.setWidth(0);
// If we're about to overscroll, cap the offset to valid content.
IntPoint bottomRight(
scrollPosition().x() + viewportSizeAfter.width(),
scrollPosition().y() + viewportSizeAfter.height());
- if (bottomRight.x() + offset.x() > contentsSize().width())
- offset.setX(contentsSize().width() - bottomRight.x());
- if (bottomRight.y() + offset.y() > contentsSize().height())
- offset.setY(contentsSize().height() - bottomRight.y());
- if (scrollPosition().x() + offset.x() < 0)
- offset.setX(-scrollPosition().x());
- if (scrollPosition().y() + offset.y() < 0)
- offset.setY(-scrollPosition().y());
+ if (bottomRight.x() + offset.width() > contentsSize().width())
+ offset.setWidth(contentsSize().width() - bottomRight.x());
+ if (bottomRight.y() + offset.height() > contentsSize().height())
+ offset.setHeight(contentsSize().height() - bottomRight.y());
+ if (scrollPosition().x() + offset.width() < 0)
+ offset.setWidth(-scrollPosition().x());
+ if (scrollPosition().y() + offset.height() < 0)
+ offset.setHeight(-scrollPosition().y());
// ...before scrolling, because the backing store will align its
// tile matrix with the viewport as reported by the ScrollView.
- scrollBy(offset.x(), offset.y());
+ setScrollPosition(scrollPosition() + offset);
notifyTransformedScrollChanged();
m_backingStore->d->orientationChanged();
@@ -3849,9 +3802,9 @@ void WebPagePrivate::setDefaultLayoutSize(const IntSize& size)
m_defaultLayoutSize = size.expandedTo(minimumLayoutSize).shrunkTo(screenSize);
}
-void WebPage::setDefaultLayoutSize(int width, int height)
+void WebPage::setDefaultLayoutSize(const Platform::IntSize& platformSize)
{
- IntSize size(width, height);
+ WebCore::IntSize size = platformSize;
if (size == d->m_defaultLayoutSize)
return;
@@ -4069,7 +4022,7 @@ bool WebPage::touchEvent(const Platform::TouchEvent& event)
return false;
}
-void WebPagePrivate::setScrollOriginPoint(const Platform::IntPoint& point)
+void WebPagePrivate::setScrollOriginPoint(const Platform::IntPoint& documentScrollOrigin)
{
m_inRegionScroller->d->reset();
@@ -4077,16 +4030,15 @@ void WebPagePrivate::setScrollOriginPoint(const Platform::IntPoint& point)
return;
postponeDocumentStyleRecalc();
- m_inRegionScroller->d->calculateInRegionScrollableAreasForPoint(point);
+ m_inRegionScroller->d->calculateInRegionScrollableAreasForPoint(documentScrollOrigin);
if (!m_inRegionScroller->d->activeInRegionScrollableAreas().empty())
m_client->notifyInRegionScrollableAreasChanged(m_inRegionScroller->d->activeInRegionScrollableAreas());
resumeDocumentStyleRecalc();
}
-void WebPage::setScrollOriginPoint(const Platform::IntPoint& point)
+void WebPage::setDocumentScrollOriginPoint(const Platform::IntPoint& documentScrollOrigin)
{
- Platform::IntPoint untransformedPoint = d->mapFromTransformed(point);
- d->setScrollOriginPoint(untransformedPoint);
+ d->setScrollOriginPoint(documentScrollOrigin);
}
bool WebPagePrivate::dispatchTouchEventToFullScreenPlugin(PluginView* plugin, const Platform::TouchEvent& event)
@@ -4294,7 +4246,7 @@ static void handleScrolling(unsigned short character, WebPagePrivate* scroller)
pos.setY(scroller->contentsSize().height() - scroller->actualVisibleSize().height());
scroller->m_mainFrame->view()->setScrollPosition(pos);
- scroller->m_client->scrollChanged(pos);
+ scroller->m_client->scrollChanged();
}
}
@@ -4409,9 +4361,9 @@ void WebPage::selectionCancelled()
d->m_selectionHandler->cancelSelection();
}
-bool WebPage::selectionContains(const Platform::IntPoint& point)
+bool WebPage::selectionContainsDocumentPoint(const Platform::IntPoint& point)
{
- return d->m_selectionHandler->selectionContains(d->mapFromTransformed(point));
+ return d->m_selectionHandler->selectionContains(point);
}
BlackBerry::Platform::String WebPage::title() const
@@ -4474,43 +4426,29 @@ void WebPage::selectAll()
d->m_inputHandler->selectAll();
}
-void WebPage::setSelection(const Platform::IntPoint& startPoint, const Platform::IntPoint& endPoint)
+void WebPage::setDocumentSelection(const Platform::IntPoint& documentStartPoint, const Platform::IntPoint& documentEndPoint)
{
if (d->m_page->defersLoading())
return;
- // Transform this events coordinates to webkit content coordinates.
- // FIXME: Don't transform the sentinel, because it may be transformed to a floating number
- // which could be rounded to 0 or other numbers. This workaround should be removed after
- // the error of roundUntransformedPoint() is fixed.
- bool invalidPoint = IntPoint(startPoint) == DOMSupport::InvalidPoint;
- IntPoint start = invalidPoint ? DOMSupport::InvalidPoint : d->mapFromTransformed(startPoint);
- invalidPoint = IntPoint(endPoint) == DOMSupport::InvalidPoint;
- IntPoint end = invalidPoint ? DOMSupport::InvalidPoint : d->mapFromTransformed(endPoint);
- d->m_selectionHandler->setSelection(start, end);
+ d->m_selectionHandler->setSelection(documentStartPoint, documentEndPoint);
}
-void WebPage::setCaretPosition(const Platform::IntPoint& position)
+void WebPage::setDocumentCaretPosition(const Platform::IntPoint& documentCaretPosition)
{
if (d->m_page->defersLoading())
return;
+
// Handled by selection handler as it's point based.
- // Transform this events coordinates to webkit content coordinates.
- d->m_selectionHandler->setCaretPosition(d->mapFromTransformed(position));
+ d->m_selectionHandler->setCaretPosition(documentCaretPosition);
}
-void WebPage::selectAtPoint(const Platform::IntPoint& location)
+void WebPage::selectAtDocumentPoint(const Platform::IntPoint& documentPoint)
{
if (d->m_page->defersLoading())
return;
- // Transform this events coordinates to webkit content coordinates if it
- // is not the sentinel value.
- IntPoint selectionLocation =
- IntPoint(location) == DOMSupport::InvalidPoint ?
- DOMSupport::InvalidPoint :
- d->mapFromTransformed(location);
- d->m_selectionHandler->selectAtPoint(selectionLocation);
+ d->m_selectionHandler->selectAtPoint(documentPoint);
}
BackingStore* WebPage::backingStore() const
@@ -4523,46 +4461,35 @@ InRegionScroller* WebPage::inRegionScroller() const
return d->m_inRegionScroller.get();
}
-bool WebPage::zoomToFit()
-{
- if (d->contentsSize().isEmpty() || !d->isUserScalable())
- return false;
-
- d->m_userPerformedManualZoom = true;
-
- // TODO: We may need to use (0,0) as the anchor point when textReflow is enabled.
- // IF the minimum font size is ginormous, we may still want the scroll position to be 0,0.
- return d->zoomAboutPoint(d->zoomToFitScale(), d->centerOfVisibleContentsRect());
-}
-
-void WebPagePrivate::setTextReflowAnchorPoint(const Platform::IntPoint& focalPoint)
+void WebPagePrivate::setTextReflowAnchorPoint(const Platform::IntPoint& documentFocalPoint)
{
// Should only be invoked when text reflow is enabled.
ASSERT(m_webPage->settings()->textReflowMode() == WebSettings::TextReflowEnabled);
- m_currentPinchZoomNode = bestNodeForZoomUnderPoint(focalPoint);
+ m_currentPinchZoomNode = bestNodeForZoomUnderPoint(documentFocalPoint);
if (!m_currentPinchZoomNode)
return;
IntRect nodeRect = rectForNode(m_currentPinchZoomNode.get());
- m_anchorInNodeRectRatio.set(static_cast<float>(mapFromTransformed(focalPoint).x() - nodeRect.x()) / nodeRect.width(),
- static_cast<float>(mapFromTransformed(focalPoint).y() - nodeRect.y()) / nodeRect.height());
+ m_anchorInNodeRectRatio.set(
+ static_cast<float>(documentFocalPoint.x() - nodeRect.x()) / nodeRect.width(),
+ static_cast<float>(documentFocalPoint.y() - nodeRect.y()) / nodeRect.height());
}
-bool WebPage::pinchZoomAboutPoint(double scale, int x, int y)
+bool WebPage::pinchZoomAboutPoint(double scale, const Platform::FloatPoint& documentFocalPoint)
{
- IntPoint anchor(x, y);
d->m_userPerformedManualZoom = true;
d->m_userPerformedManualScroll = true;
if (d->m_webPage->settings()->textReflowMode() == WebSettings::TextReflowEnabled) {
- d->setTextReflowAnchorPoint(anchor);
- // Theoretically, d->nodeForZoomUnderPoint(anchor) can return null.
+ d->setTextReflowAnchorPoint(webkitThreadViewportAccessor()->roundedDocumentContents(documentFocalPoint));
+
+ // Theoretically, d->nodeForZoomUnderPoint(documentFocalPoint) can return null.
if (!d->m_currentPinchZoomNode)
return false;
}
- return d->zoomAboutPoint(scale, d->mapFromTransformed(anchor));
+ return d->zoomAboutPoint(scale, documentFocalPoint);
}
#if ENABLE(VIEWPORT_REFLOW)
@@ -4573,12 +4500,12 @@ void WebPagePrivate::toggleTextReflowIfEnabledForBlockZoomOnly(bool shouldEnable
}
#endif
-bool WebPage::blockZoom(int x, int y)
+bool WebPage::blockZoom(const Platform::IntPoint& documentTargetPoint)
{
if (!d->m_mainFrame->view() || !d->isUserScalable())
return false;
- Node* node = d->bestNodeForZoomUnderPoint(IntPoint(x, y));
+ Node* node = d->bestNodeForZoomUnderPoint(documentTargetPoint);
if (!node)
return false;
@@ -4627,20 +4554,6 @@ bool WebPage::blockZoom(int x, int y)
newScale = std::min(d->newScaleForBlockZoomRect(blockRect, oldScale, margin), d->maxBlockZoomScale());
newScale = std::max(newScale, minimumScale());
-#if DEBUG_BLOCK_ZOOM
- // Render the double tap point for visual reference.
- IntRect renderRect(x, y, 1, 1);
- renderRect = d->mapFromTransformedContentsToTransformedViewport(renderRect);
- IntSize viewportSize = d->transformedViewportSize();
- renderRect.intersect(IntRect(0, 0, viewportSize.width(), viewportSize.height()));
- d->m_backingStore->d->clearWindow(renderRect, 0, 0, 0);
- d->m_backingStore->d->invalidateWindow(renderRect);
-
- // Uncomment this to return in order to see the blocks being selected.
- // d->m_client->zoomChanged(isMinZoomed(), isMaxZoomed(), isAtInitialZoom(), currentZoomLevel());
- // return true;
-#endif
-
#if ENABLE(VIEWPORT_REFLOW)
// If reflowing, adjust the reflow-width of text node to make sure the font is a reasonable size.
if (d->m_currentBlockZoomNode && d->m_shouldReflowBlock && settings()->textReflowMode() != WebSettings::TextReflowDisabled) {
@@ -4716,10 +4629,9 @@ bool WebPage::blockZoom(int x, int y)
// Make sure that the original node rect is visible in the screen after the zoom. This is necessary because the identified block rect might
// not be the same as the original node rect, and it could force the original node rect off the screen.
FloatRect br(anchor, FloatSize(scaledViewportWidth, scaledViewportHeight));
- IntPoint clickPoint = d->mapFromTransformed(IntPoint(x, y));
- if (!br.contains(clickPoint)) {
- d->m_finalBlockPointReflowOffset.move(0, (clickPoint.y() - scaledViewportHeight / 2) - d->m_finalBlockPoint.y());
- d->m_finalBlockPoint = FloatPoint(d->m_finalBlockPoint.x(), clickPoint.y() - scaledViewportHeight / 2);
+ if (!br.contains(IntPoint(documentTargetPoint))) {
+ d->m_finalBlockPointReflowOffset.move(0, (documentTargetPoint.y() - scaledViewportHeight / 2) - d->m_finalBlockPoint.y());
+ d->m_finalBlockPoint = FloatPoint(d->m_finalBlockPoint.x(), documentTargetPoint.y() - scaledViewportHeight / 2);
}
// Clamp the finalBlockPoint to not cause any overflow scrolling.
@@ -4739,20 +4651,18 @@ bool WebPage::blockZoom(int x, int y)
d->m_finalBlockPointReflowOffset.setY(0);
}
- d->m_finalBlockPoint = d->mapToTransformedFloatPoint(d->m_finalBlockPoint);
-
// Don't block zoom if the user is zooming and the new scale is only marginally different from the
// oldScale with only a marginal change in scroll position. Ignore scroll difference in the special case
// that the zoom level is the minimumScale.
if (!endOfBlockZoomMode && abs(newScale - oldScale) / oldScale < minimumExpandingRatio) {
- const double minimumDisplacement = minimumExpandingRatio * d->transformedActualVisibleSize().width();
- if (oldScale == d->minimumScale() || (distanceBetweenPoints(roundTransformedPoint(d->mapToTransformed(d->scrollPosition())), roundTransformedPoint(d->m_finalBlockPoint)) < minimumDisplacement && abs(newScale - oldScale) / oldScale < 0.10)) {
+ const double minimumDisplacement = minimumExpandingRatio * webkitThreadViewportAccessor()->documentViewportSize().width();
+ if (oldScale == d->minimumScale() || (distanceBetweenPoints(d->scrollPosition(), roundUntransformedPoint(d->m_finalBlockPoint)) < minimumDisplacement && abs(newScale - oldScale) / oldScale < 0.10)) {
if (isFirstZoom) {
d->resetBlockZoom();
return false;
}
// Zoom out of block zoom.
- blockZoom(x, y);
+ blockZoom(documentTargetPoint);
return true;
}
}
@@ -4762,7 +4672,7 @@ bool WebPage::blockZoom(int x, int y)
// We set this here to make sure we don't try to re-render the page at a different zoom level during loading.
d->m_userPerformedManualZoom = true;
d->m_userPerformedManualScroll = true;
- d->m_client->animateBlockZoom(d->m_finalBlockPoint, d->m_blockZoomFinalScale);
+ d->m_client->animateBlockZoom(d->m_blockZoomFinalScale, d->m_finalBlockPoint);
return true;
}
@@ -4782,39 +4692,6 @@ bool WebPage::isAtInitialZoom() const
return (d->currentScale() == d->initialScale()) || !d->isUserScalable();
}
-bool WebPagePrivate::shouldZoomOnEscape() const
-{
- if (!isUserScalable())
- return false;
-
- // If the initial scale is not reachable, don't try to zoom.
- if (initialScale() < minimumScale() || initialScale() > maximumScale())
- return false;
-
- // Don't ever zoom in when we press escape.
- if (initialScale() >= currentScale())
- return false;
-
- return currentScale() != initialScale();
-}
-
-void WebPage::zoomToInitialScale()
-{
- if (!d->isUserScalable())
- return;
-
- d->zoomAboutPoint(d->initialScale(), d->centerOfVisibleContentsRect());
-}
-
-bool WebPage::zoomToOneOne()
-{
- if (!d->isUserScalable())
- return false;
-
- double scale = 1;
- return d->zoomAboutPoint(scale, d->centerOfVisibleContentsRect());
-}
-
class DeferredTaskSetFocused: public DeferredTask<&WebPagePrivate::m_wouldSetFocused> {
public:
explicit DeferredTaskSetFocused(WebPagePrivate* webPagePrivate, bool focused)
@@ -5029,9 +4906,9 @@ WebDOMDocument WebPage::document() const
return WebDOMDocument(d->m_mainFrame->document());
}
-WebDOMNode WebPage::nodeAtPoint(int x, int y)
+WebDOMNode WebPage::nodeAtDocumentPoint(const Platform::IntPoint& documentPoint)
{
- HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(d->mapFromTransformed(IntPoint(x, y)), false);
+ HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(WebCore::IntPoint(documentPoint), false);
Node* node = result.innerNonSharedNode();
return WebDOMNode(node);
}
@@ -5752,16 +5629,13 @@ void WebPagePrivate::enterFullscreenForNode(Node* node)
if (!window)
return;
- unsigned x, y, width, height;
- mmrPlayer->getWindowPosition(x, y, width, height);
-
const char* contextName = mmrPlayer->mmrContextName();
if (!contextName)
return;
mmrPlayer->setFullscreenWebPageClient(m_client);
m_fullscreenVideoNode = node;
- m_client->fullscreenStart(contextName, window, x, y, width, height);
+ m_client->fullscreenStart(contextName, window, mmrPlayer->getWindowScreenRect());
#endif
}
@@ -5906,9 +5780,7 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings)
coreSettings->setSpatialNavigationEnabled(m_webSettings->isSpatialNavigationEnabled());
coreSettings->setAsynchronousSpellCheckingEnabled(m_webSettings->isAsynchronousSpellCheckingEnabled());
- BlackBerry::Platform::String stylesheetURL = webSettings->userStyleSheetString();
- if (stylesheetURL.empty())
- stylesheetURL = webSettings->userStyleSheetLocation();
+ BlackBerry::Platform::String stylesheetURL = webSettings->userStyleSheetLocation();
if (!stylesheetURL.empty())
coreSettings->setUserStyleSheetLocation(KURL(KURL(), stylesheetURL));
@@ -5982,6 +5854,11 @@ void WebPagePrivate::didChangeSettings(WebSettings* webSettings)
Platform::userInterfaceThreadMessageClient()->dispatchMessage(
createMethodCallMessage(&WebPagePrivate::setCompositorBackgroundColor, this, backgroundColor));
}
+ if (m_backingStore) {
+ m_backingStore->d->setWebPageBackgroundColor(m_mainFrame && m_mainFrame->view()
+ ? m_mainFrame->view()->documentBackgroundColor()
+ : webSettings->backgroundColor());
+ }
m_page->setDeviceScaleFactor(webSettings->devicePixelRatio());
}
diff --git a/Source/WebKit/blackberry/Api/WebPage.h b/Source/WebKit/blackberry/Api/WebPage.h
index ae59d8f7a..a8999db37 100644
--- a/Source/WebKit/blackberry/Api/WebPage.h
+++ b/Source/WebKit/blackberry/Api/WebPage.h
@@ -50,6 +50,7 @@ template<typename T> class SharedArray;
namespace BlackBerry {
namespace Platform {
+class FloatPoint;
class IntPoint;
class IntRect;
class IntSize;
@@ -139,13 +140,13 @@ public:
Platform::ViewportAccessor* webkitThreadViewportAccessor() const;
Platform::IntSize viewportSize() const;
- void setViewportSize(const Platform::IntSize& viewportSize, bool ensureFocusElementVisible = true);
+ void setViewportSize(const Platform::IntSize&, bool ensureFocusElementVisible = true);
void resetVirtualViewportOnCommitted(bool reset);
- void setVirtualViewportSize(int width, int height);
+ void setVirtualViewportSize(const Platform::IntSize&);
// Used for default layout size unless overridden by web content or by other APIs.
- void setDefaultLayoutSize(int width, int height);
+ void setDefaultLayoutSize(const Platform::IntSize&);
bool mouseEvent(const Platform::MouseEvent&, bool* wheelDeltaAccepted = 0);
@@ -175,28 +176,23 @@ public:
BlackBerry::Platform::String forcedTextEncoding();
void setForcedTextEncoding(const BlackBerry::Platform::String&);
- // Scroll position returned is in transformed coordinates.
- Platform::IntPoint scrollPosition() const;
- // Scroll position provided should be in transformed coordinates.
- void setScrollPosition(const Platform::IntPoint&);
- void scrollBy(const Platform::IntSize&);
+ // Scroll position provided should be in document coordinates.
+ // Use webkitThreadViewportAccessor() to retrieve the scroll position.
+ void setDocumentScrollPosition(const Platform::IntPoint&);
void notifyInRegionScrollStopped();
- void setScrollOriginPoint(const Platform::IntPoint&);
+ void setDocumentScrollOriginPoint(const Platform::IntPoint&);
BackingStore* backingStore() const;
InRegionScroller* inRegionScroller() const;
- bool zoomToFit();
- bool zoomToOneOne();
- void zoomToInitialScale();
- bool blockZoom(int x, int y);
+ bool blockZoom(const Platform::IntPoint& documentTargetPoint);
void blockZoomAnimationFinished();
void resetBlockZoom();
bool isAtInitialZoom() const;
bool isMaxZoomed() const;
bool isMinZoomed() const;
- bool pinchZoomAboutPoint(double scale, int x, int y);
+ bool pinchZoomAboutPoint(double scale, const Platform::FloatPoint& documentFocalPoint);
bool isUserScalable() const;
void setUserScalable(bool);
@@ -254,11 +250,11 @@ public:
void spellCheckingRequestProcessed(int32_t transactionId, spannable_string_t*);
void spellCheckingRequestCancelled(int32_t transactionId);
- void setSelection(const Platform::IntPoint& startPoint, const Platform::IntPoint& endPoint);
- void setCaretPosition(const Platform::IntPoint&);
- void selectAtPoint(const Platform::IntPoint&);
+ void setDocumentSelection(const Platform::IntPoint& documentStartPoint, const Platform::IntPoint& documentEndPoint);
+ void setDocumentCaretPosition(const Platform::IntPoint&);
+ void selectAtDocumentPoint(const Platform::IntPoint&);
void selectionCancelled();
- bool selectionContains(const Platform::IntPoint&);
+ bool selectionContainsDocumentPoint(const Platform::IntPoint&);
void popupListClosed(int size, const bool* selecteds);
void popupListClosed(int index);
@@ -300,7 +296,7 @@ public:
#if defined(ENABLE_WEBDOM) && ENABLE_WEBDOM
WebDOMDocument document() const;
- WebDOMNode nodeAtPoint(int x, int y);
+ WebDOMNode nodeAtDocumentPoint(const Platform::IntPoint&);
bool getNodeRect(const WebDOMNode&, Platform::IntRect& result);
bool setNodeFocus(const WebDOMNode&, bool on);
bool setNodeHovered(const WebDOMNode&, bool on);
diff --git a/Source/WebKit/blackberry/Api/WebPageClient.h b/Source/WebKit/blackberry/Api/WebPageClient.h
index 8da4a4f93..83574c651 100644
--- a/Source/WebKit/blackberry/Api/WebPageClient.h
+++ b/Source/WebKit/blackberry/Api/WebPageClient.h
@@ -128,10 +128,10 @@ public:
virtual void javascriptPaused(const unsigned short* stack, unsigned stackLength) = 0;
virtual void javascriptContinued() = 0;
- // All of these methods use transformed coordinates.
- virtual void contentsSizeChanged(const Platform::IntSize&) const = 0;
- virtual void scrollChanged(const Platform::IntPoint&) const = 0;
- virtual void zoomChanged(bool isMinZoomed, bool isMaxZoomed, bool isAtInitialZoom, double newZoom) const = 0;
+ virtual void contentsSizeChanged() = 0;
+ virtual void scrollChanged() = 0;
+ virtual void scaleChanged() = 0;
+
virtual void updateInteractionViews() = 0;
virtual void requestUpdateViewport(int width, int height) = 0;
@@ -140,7 +140,7 @@ public:
virtual Platform::Graphics::Window* window() const = 0;
- virtual void notifyContentRendered(const Platform::IntRect&) = 0;
+ virtual void notifyPixelContentRendered(const Platform::IntRect&) = 0;
virtual void resizeSurfaceIfNeeded() = 0;
virtual void inputFocusGained(int64_t inputStyle, Platform::VirtualKeyboardType, Platform::VirtualKeyboardEnterKeyType) = 0;
@@ -151,15 +151,15 @@ public:
virtual void showVirtualKeyboard(bool) = 0;
- virtual void requestSpellingCheckingOptions(imf_sp_text_t&) = 0;
+ virtual void requestSpellingCheckingOptions(imf_sp_text_t&, const BlackBerry::Platform::IntRect& documentCaretRect, const BlackBerry::Platform::IntSize& screenOffset) = 0;
virtual int32_t checkSpellingOfStringAsync(wchar_t* text, int length) = 0;
- virtual void notifySelectionDetailsChanged(const Platform::IntRect& start, const Platform::IntRect& end, const Platform::IntRectRegion&, bool overrideTouchHandling = false) = 0;
+ virtual void notifySelectionDetailsChanged(const Platform::IntRect& documentStartRect, const Platform::IntRect& documentEndRect, const Platform::IntRectRegion& documentRegion, bool overrideTouchHandling = false) = 0;
virtual void cancelSelectionVisuals() = 0;
virtual void notifySelectionHandlesReversed() = 0;
- virtual void notifyCaretChanged(const Platform::IntRect& caret, bool userTouchTriggered, bool singleLineInput = false, const Platform::IntRect& singleLineBoundingBox = Platform::IntRect()) = 0;
+ virtual void notifyCaretChanged(const Platform::IntRect& documentCaretRect, bool userTouchTriggered, bool isSingleLineInput = false, const Platform::IntRect& singleLineDocumentBoundingBox = Platform::IntRect()) = 0;
- virtual void cursorChanged(Platform::CursorType, const char* url, int x, int y) = 0;
+ virtual void cursorChanged(Platform::CursorType, const char* url, const Platform::IntPoint& hotSpotInImage) = 0;
virtual void requestGlobalLocalServicePermission(Platform::GeoTrackerListener*, const BlackBerry::Platform::String& origin) = 0;
@@ -175,16 +175,6 @@ public:
virtual void openPopupList(bool multiple, int size, const ScopeArray<BlackBerry::Platform::String>& labels, const bool* enableds, const int* itemType, const bool* selecteds) = 0;
virtual bool chooseFilenames(bool allowMultiple, const SharedArray<BlackBerry::Platform::String>& acceptTypes, const SharedArray<BlackBerry::Platform::String>& initialFiles, const BlackBerry::Platform::String& capture, SharedArray<BlackBerry::Platform::String>& chosenFiles) = 0;
- virtual void loadPluginForMimetype(int, int width, int height, const SharedArray<BlackBerry::Platform::String>& paramNames, const SharedArray<BlackBerry::Platform::String>& paramValues, const char* url) = 0;
- virtual void notifyPluginRectChanged(int, Platform::IntRect rectChanged) = 0;
- virtual void destroyPlugin(int) = 0;
- virtual void playMedia(int) = 0;
- virtual void pauseMedia(int) = 0;
- virtual float getTime(int) = 0;
- virtual void setTime(int, float) = 0;
- virtual void setVolume(int, float) = 0;
- virtual void setMuted(int, bool) = 0;
-
virtual WebPage* createWindow(int x, int y, int width, int height, unsigned flags, const BlackBerry::Platform::String& url, const BlackBerry::Platform::String& windowName) = 0;
virtual void scheduleCloseWindow() = 0;
@@ -213,13 +203,13 @@ public:
virtual BlackBerry::Platform::ViewportAccessor* userInterfaceViewportAccessor() const = 0;
virtual void resetBitmapZoomScale(double scale) = 0;
- virtual void animateBlockZoom(const Platform::FloatPoint& finalPoint, double finalScale) = 0;
+ virtual void animateBlockZoom(double finalScale, const Platform::FloatPoint& finalDocumentScrollPosition) = 0;
virtual void setPreventsScreenIdleDimming(bool noDimming) = 0;
virtual bool authenticationChallenge(const unsigned short* realm, unsigned realmLength, BlackBerry::Platform::String& username, BlackBerry::Platform::String& password) = 0;
virtual SaveCredentialType notifyShouldSaveCredential(bool isNew) = 0;
virtual void syncProxyCredential(const BlackBerry::Platform::String& username, const BlackBerry::Platform::String& password) = 0;
- virtual void notifyPopupAutofillDialog(const std::vector<BlackBerry::Platform::String>&, const Platform::IntRect&) = 0;
+ virtual void notifyPopupAutofillDialog(const std::vector<BlackBerry::Platform::String>&) = 0;
virtual void notifyDismissAutofillDialog() = 0;
virtual bool shouldPluginEnterFullScreen() = 0;
@@ -242,11 +232,11 @@ public:
virtual void downloadRequested(Platform::FilterStream*, const BlackBerry::Platform::String& suggestedFilename) = 0;
virtual int fullscreenStart() = 0;
- virtual int fullscreenStart(const char* contextName, Platform::Graphics::Window*, unsigned x, unsigned y, unsigned width, unsigned height) = 0;
+ virtual int fullscreenStart(const char* contextName, Platform::Graphics::Window*, const BlackBerry::Platform::IntRect& windowScreenRect) = 0;
virtual int fullscreenStop() = 0;
- virtual int fullscreenWindowSet(unsigned x, unsigned y, unsigned width, unsigned height) = 0;
+ virtual int fullscreenSetWindowRect(const BlackBerry::Platform::IntRect& newWindowScreenRect) = 0;
virtual void drawVerticalScrollbar() = 0;
virtual void drawHorizontalScrollbar() = 0;
diff --git a/Source/WebKit/blackberry/Api/WebPage_p.h b/Source/WebKit/blackberry/Api/WebPage_p.h
index de32128f0..4331b3ed9 100644
--- a/Source/WebKit/blackberry/Api/WebPage_p.h
+++ b/Source/WebKit/blackberry/Api/WebPage_p.h
@@ -152,7 +152,6 @@ public:
WebCore::IntPoint scrollPosition() const;
WebCore::IntPoint maximumScrollPosition() const;
void setScrollPosition(const WebCore::IntPoint&);
- void scrollBy(int deltaX, int deltaY);
void notifyInRegionScrollStopped();
void setScrollOriginPoint(const Platform::IntPoint&);
@@ -218,7 +217,7 @@ public:
void overflowExceedsContentsSize() { m_overflowExceedsContentsSize = true; }
void layoutFinished();
void setNeedTouchEvents(bool);
- void notifyPopupAutofillDialog(const Vector<String>&, const WebCore::IntRect&);
+ void notifyPopupAutofillDialog(const Vector<String>&);
void notifyDismissAutofillDialog();
bool shouldZoomToInitialScaleOnLoad() const { return loadState() == Committed || m_shouldZoomToInitialScaleAfterLoadFinished; }
@@ -304,9 +303,6 @@ public:
double newScaleForBlockZoomRect(const WebCore::IntRect&, double oldScale, double margin);
double maxBlockZoomScale() const;
- // Plugin Methods.
- void notifyPluginRectChanged(int id, const WebCore::IntRect& rectChanged);
-
// Context Methods.
Platform::WebContext webContext(TargetDetectionStrategy);
PassRefPtr<WebCore::Node> contextNode(TargetDetectionStrategy);
@@ -347,7 +343,7 @@ public:
#endif
void dispatchViewportPropertiesDidChange(const WebCore::ViewportArguments&);
- WebCore::IntSize recomputeVirtualViewportFromViewportArguments();
+ Platform::IntSize recomputeVirtualViewportFromViewportArguments();
void resetBlockZoom();
@@ -378,9 +374,6 @@ public:
void willDeferLoading();
void didResumeLoading();
- // Returns true if the escape key handler should zoom.
- bool shouldZoomOnEscape() const;
-
WebCore::TransformationMatrix* transformationMatrix() const
{
return m_transformationMatrix;
@@ -501,8 +494,7 @@ public:
WebCore::IntSize m_previousContentsSize;
int m_actualVisibleWidth;
int m_actualVisibleHeight;
- int m_virtualViewportWidth;
- int m_virtualViewportHeight;
+ WebCore::IntSize m_virtualViewportSize;
WebCore::IntSize m_defaultLayoutSize;
WebCore::ViewportArguments m_viewportArguments; // We keep this around since we may need to re-evaluate the arguments on rotation.
WebCore::ViewportArguments m_userViewportArguments; // A fallback set of Viewport Arguments supplied by the WebPageClient
diff --git a/Source/WebKit/blackberry/Api/WebSettings.cpp b/Source/WebKit/blackberry/Api/WebSettings.cpp
index f6391313e..97d3a050e 100644
--- a/Source/WebKit/blackberry/Api/WebSettings.cpp
+++ b/Source/WebKit/blackberry/Api/WebSettings.cpp
@@ -31,8 +31,6 @@
#include <PageCache.h>
#include <ViewportArguments.h>
#include <wtf/HashSet.h>
-#include <wtf/Vector.h>
-#include <wtf/text/Base64.h>
namespace BlackBerry {
namespace WebKit {
@@ -94,7 +92,6 @@ DEFINE_STATIC_LOCAL(String, WebKitDeviceSupportsMouse, (ASCIILiteral("WebKitDevi
DEFINE_STATIC_LOCAL(String, WebKitSansSeriffFontFamily, (ASCIILiteral("WebKitSansSeriffFontFamily")));
DEFINE_STATIC_LOCAL(String, WebKitSeriffFontFamily, (ASCIILiteral("WebKitSeriffFontFamily")));
DEFINE_STATIC_LOCAL(String, WebKitStandardFontFamily, (ASCIILiteral("WebKitStandardFontFamily")));
-DEFINE_STATIC_LOCAL(String, WebKitUserStyleSheet, (ASCIILiteral("WebKitUserStyleSheet")));
DEFINE_STATIC_LOCAL(String, WebKitUserStyleSheetLocation, (ASCIILiteral("WebKitUserStyleSheetLocation")));
DEFINE_STATIC_LOCAL(String, WebKitWebSocketsEnabled, (ASCIILiteral("WebKitWebSocketsEnabled")));
DEFINE_STATIC_LOCAL(String, WebKitXSSAuditorEnabled, (ASCIILiteral("WebKitXSSAuditorEnabled")));
@@ -458,32 +455,6 @@ void WebSettings::setGetFocusNodeContext(bool enabled)
m_private->setBoolean(BlackBerryGetFocusNodeContextEnabled, enabled);
}
-BlackBerry::Platform::String WebSettings::userStyleSheetString() const
-{
- return m_private->getString(WebKitUserStyleSheet);
-}
-
-void WebSettings::setUserStyleSheetString(const BlackBerry::Platform::String& userStyleSheetString)
-{
- // FIXME: This doesn't seem like the appropriate place to do this as WebSettings should ideally be a state store.
- // Either the caller of this function should do this conversion or caller of the getter corresponding to this function
- // should do this conversion.
-
- Vector<char> data;
- data.append(userStyleSheetString.c_str(), userStyleSheetString.length());
-
- Vector<char> encodedData;
- base64Encode(data, encodedData);
-
- const char prefix[] = "data:text/css;charset=utf-8;base64,";
- size_t prefixLength = sizeof(prefix) - 1;
- Vector<char> dataURL;
- dataURL.reserveCapacity(prefixLength + encodedData.size());
- dataURL.append(prefix, prefixLength);
- dataURL.append(encodedData);
- m_private->setString(WebKitUserStyleSheet, String(dataURL.data(), dataURL.size()));
-}
-
BlackBerry::Platform::String WebSettings::userStyleSheetLocation()
{
return m_private->getString(WebKitUserStyleSheetLocation);
diff --git a/Source/WebKit/blackberry/Api/WebSettings.h b/Source/WebKit/blackberry/Api/WebSettings.h
index 792d5d918..ce0074324 100644
--- a/Source/WebKit/blackberry/Api/WebSettings.h
+++ b/Source/WebKit/blackberry/Api/WebSettings.h
@@ -126,9 +126,6 @@ public:
bool doesGetFocusNodeContext() const;
void setGetFocusNodeContext(bool);
- BlackBerry::Platform::String userStyleSheetString() const;
- void setUserStyleSheetString(const BlackBerry::Platform::String&);
-
BlackBerry::Platform::String userStyleSheetLocation();
void setUserStyleSheetLocation(const BlackBerry::Platform::String&);
diff --git a/Source/WebKit/blackberry/ChangeLog b/Source/WebKit/blackberry/ChangeLog
index 268a06a98..b1abefb13 100644
--- a/Source/WebKit/blackberry/ChangeLog
+++ b/Source/WebKit/blackberry/ChangeLog
@@ -1,3 +1,237 @@
+2012-11-08 Chris Guan <chris.guan@torchmobile.com.cn>
+
+ [BlackBerry] need to call closePopup at setValueAndClosePopup
+ https://bugs.webkit.org/show_bug.cgi?id=101568
+
+ Reviewed by George Staikos.
+
+ When early return occurs, we need to call closePopup
+ at setValueAndClosePopup function. See the comments
+ in WebCore/page/PagePopupClient.h. If we have not it,
+ Webkit thread is held and browser will be unresponsive
+ in BlackBerry port.
+
+ RIM PR 232962
+ Internally reviewed by Charles Wei.
+
+ * WebCoreSupport/SelectPopupClient.cpp:
+ (WebCore::SelectPopupClient::setValueAndClosePopup):
+
+2012-11-08 Jakob Petsovits <jpetsovits@rim.com>
+
+ [BlackBerry] Replace checkerboard with page background color.
+ https://bugs.webkit.org/show_bug.cgi?id=101652
+ RIM PR 188235
+
+ Reviewed by George Staikos.
+
+ In order to do this, we introduce a new member variable for
+ BackingStore because when blitting, we can't access the
+ page background color in a threadsafe way.
+
+ Solid background color fill is still only used for public builds.
+ Developers and beta testers should still see checkerboard and
+ do something about it.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
+ (BlackBerry::WebKit::BackingStorePrivate::fillWindow):
+ (BlackBerry::WebKit::BackingStorePrivate::webPageBackgroundColorUserInterfaceThread):
+ (WebKit):
+ (BlackBerry::WebKit::BackingStorePrivate::setWebPageBackgroundColor):
+ * Api/BackingStore_p.h:
+ (BackingStorePrivate):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+ (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+
+2012-11-08 Tiancheng Jiang <tijiang@rim.com>
+
+ [BlackBerry] Update BB10 date input form.
+ https://bugs.webkit.org/show_bug.cgi?id=101075
+
+ Reviewed by Rob Buis.
+
+ RIM PR 234531
+ Internally Reviewed by Mike Fenton.
+ Change date input appearance to button and hide caret when click on them.
+
+ * WebCoreSupport/DatePickerClient.cpp:
+ (WebCore::DatePickerClient::setValueAndClosePopup):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::openDatePopup):
+
+2012-11-08 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Provide pixel coordinates to IMF relative to the screen
+ https://bugs.webkit.org/show_bug.cgi?id=101628
+
+ Reviewed by Rob Buis.
+
+ Reviewed internally by Mike Fenton and Jakob Petsovits.
+
+ We need to provide the correct pixel coordinates to IMF,
+ accounting for webkit based fields in UIB as well as browser.
+ Getting an offset value from the screen point to the document
+ content point allows us to adjust for when the document,
+ such as in UIB, does not start at 0,0.
+
+ * Api/WebPageClient.h:
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::requestSpellingCheckingOptions):
+ * WebKitSupport/InputHandler.h:
+ (InputHandler):
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+
+2012-11-08 Jakob Petsovits <jpetsovits@rim.com>
+
+ [BlackBerry] Janitor: Remove unused m_isValid bool
+ https://bugs.webkit.org/show_bug.cgi?id=101610
+
+ Reviewed by Rob Buis.
+
+ It's not used anywhere, but as we have a constructor
+ that creates an invalid TileIndex, let's add another
+ method to check validity - now a correct check.
+
+ On top of that, make the stylebot happy by reducing
+ "unsigned int" to just "unsigned".
+
+ * WebKitSupport/TileIndex.h:
+ (BlackBerry::WebKit::TileIndex::TileIndex):
+ (BlackBerry::WebKit::TileIndex::i):
+ (BlackBerry::WebKit::TileIndex::j):
+ (BlackBerry::WebKit::TileIndex::setIndex):
+ (BlackBerry::WebKit::TileIndex::isValid):
+ (TileIndex):
+
+2012-11-08 Eli Fidler <efidler@rim.com>
+
+ [BlackBerry] Increase memory cache size
+ https://bugs.webkit.org/show_bug.cgi?id=101622
+
+ Reviewed by Yong Li.
+
+ * WebCoreSupport/CacheClientBlackBerry.cpp:
+ (WebCore::CacheClientBlackBerry::updateCacheCapacity):
+ * WebCoreSupport/CacheClientBlackBerry.h:
+ (CacheClientBlackBerry):
+
+2012-11-08 Jakob Petsovits <jpetsovits@rim.com>
+
+ [BlackBerry] Rework the API to use document coordinates
+ https://bugs.webkit.org/show_bug.cgi?id=101608
+ RIM PR 173292
+
+ Reviewed by Adam Treat.
+
+ Scrolling and zooming APIs used to operate on
+ transformed coordinates, which is a bad idea:
+ The UI thread might long have moved on to a
+ different scale and scroll position so outdated
+ pixel coordinates are of limited value.
+
+ Moreover, more transformation calculations are
+ needed than if we operate purely on document
+ coordinates.
+
+ With webkitThreadViewportAccessor() exposed,
+ the caller has a choice between how to handle
+ coordinates and the means to perform conversions
+ with little effort and overhead if needed.
+ Therefore, we should remove pixel coordinates
+ from the public API. This commit makes this change.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::repaint):
+ (BlackBerry::WebKit::BackingStorePrivate::didRenderContent):
+ * Api/InRegionScroller.cpp:
+ (BlackBerry::WebKit::InRegionScroller::setDocumentScrollPositionCompositingThread):
+ (BlackBerry::WebKit::InRegionScroller::setDocumentScrollPositionWebKitThread):
+ (BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):
+ * Api/InRegionScroller.h:
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+ (BlackBerry::WebKit::WebPagePrivate::setLoadState):
+ (BlackBerry::WebKit::WebPagePrivate::shouldZoomAboutPoint):
+ (BlackBerry::WebKit::WebPagePrivate::zoomAboutPoint):
+ (BlackBerry::WebKit::WebPage::setDocumentScrollPosition):
+ (BlackBerry::WebKit::WebPagePrivate::hasVirtualViewport):
+ (BlackBerry::WebKit::WebPagePrivate::notifyTransformedContentsSizeChanged):
+ (BlackBerry::WebKit::WebPagePrivate::notifyTransformedScrollChanged):
+ (BlackBerry::WebKit::WebPagePrivate::setCursor):
+ (BlackBerry::WebKit::WebPagePrivate::notifyPopupAutofillDialog):
+ (BlackBerry::WebKit::WebPagePrivate::fixedLayoutSize):
+ (BlackBerry::WebKit::WebPagePrivate::bestNodeForZoomUnderPoint):
+ (BlackBerry::WebKit::WebPagePrivate::blockZoomRectForNode):
+ (BlackBerry::WebKit::WebPagePrivate::zoomBlock):
+ (BlackBerry::WebKit::WebPage::setVirtualViewportSize):
+ (BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments):
+ (BlackBerry::WebKit::WebPagePrivate::dispatchViewportPropertiesDidChange):
+ (BlackBerry::WebKit::WebPagePrivate::resumeBackingStore):
+ (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+ (BlackBerry::WebKit::WebPage::setDefaultLayoutSize):
+ (BlackBerry::WebKit::WebPagePrivate::setScrollOriginPoint):
+ (BlackBerry::WebKit::WebPage::setDocumentScrollOriginPoint):
+ (BlackBerry::WebKit::handleScrolling):
+ (BlackBerry::WebKit::WebPage::selectionContainsDocumentPoint):
+ (BlackBerry::WebKit::WebPage::setDocumentSelection):
+ (BlackBerry::WebKit::WebPage::setDocumentCaretPosition):
+ (BlackBerry::WebKit::WebPage::selectAtDocumentPoint):
+ (BlackBerry::WebKit::WebPagePrivate::setTextReflowAnchorPoint):
+ (BlackBerry::WebKit::WebPage::pinchZoomAboutPoint):
+ (BlackBerry::WebKit::WebPage::blockZoom):
+ (BlackBerry::WebKit::WebPage::nodeAtDocumentPoint):
+ (BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
+ * Api/WebPage.h:
+ (Platform):
+ * Api/WebPageClient.h:
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+ * WebCoreSupport/AutofillManager.cpp:
+ (WebCore::AutofillManager::didChangeInTextField):
+ * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+ (WebCore::FrameLoaderClientBlackBerry::dispatchDidLayout):
+ * WebKitSupport/SelectionHandler.cpp:
+ (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
+ (BlackBerry::WebKit::SelectionHandler::caretPositionChanged):
+
+2012-11-08 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Verify touched element using the rootEditableElement
+ https://bugs.webkit.org/show_bug.cgi?id=101510
+
+ Reviewed by Rob Buis.
+
+ Reviewed internally by Mike Fenton.
+
+ Move up the tree until we find the rootEditableElement and use
+ that to compare with the touched element.
+
+ * WebKitSupport/FatFingers.h:
+ (BlackBerry::WebKit::FatFingersResult::node):
+ (BlackBerry::WebKit::FatFingersResult::nodeAsElementIfApplicable):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+
+2012-11-07 Rob Buis <rbuis@rim.com>
+
+ [BlackBerry] Remove setUserStyleSheetString/userStyleSheetString
+ https://bugs.webkit.org/show_bug.cgi?id=101490
+
+ Reviewed by Yong Li.
+
+ We no longer need this API.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::didChangeSettings):
+ * Api/WebSettings.cpp:
+ (WebKit):
+ * Api/WebSettings.h:
+
2012-11-07 Christophe Dumez <christophe.dumez@intel.com>
Add replaceWithLiteral() method to WTF::String
diff --git a/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
index 44a05f2f4..1b79e3eea 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/AutofillManager.cpp
@@ -48,7 +48,7 @@ void AutofillManager::didChangeInTextField(HTMLInputElement* element)
m_element = element;
Vector<String> candidates = autofillBackingStore().get(element->getAttribute(HTMLNames::nameAttr).string(), element->value());
- m_webPagePrivate->notifyPopupAutofillDialog(candidates, element->screenRect());
+ m_webPagePrivate->notifyPopupAutofillDialog(candidates);
}
void AutofillManager::textFieldDidEndEditing(HTMLInputElement*)
diff --git a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
index 1e4b45106..58aed012b 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
@@ -32,7 +32,6 @@ CacheClientBlackBerry* CacheClientBlackBerry::get()
}
CacheClientBlackBerry::CacheClientBlackBerry()
- : m_lastCapacity(0)
{
}
@@ -56,14 +55,11 @@ void CacheClientBlackBerry::updateCacheCapacity()
#if ENABLE(BLACKBERRY_DEBUG_MEMORY)
// We're debugging memory usage. So keep it disabled.
#else
- unsigned cacheCapacity = BlackBerry::Platform::Settings::instance()->getSuggestedCacheCapacity(memoryCache()->totalSize());
- if (m_lastCapacity == cacheCapacity) {
- // Suggested capacity hasn't been changed.
- return;
- }
+ unsigned cacheTotalCapacity = 64 * 1024 * 1024;
+ unsigned cacheMinDeadCapacity = cacheTotalCapacity / 4;
+ unsigned cacheMaxDeadCapacity = cacheTotalCapacity / 2;
- m_lastCapacity = cacheCapacity;
- memoryCache()->setCapacities(0, m_lastCapacity, m_lastCapacity);
+ memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
#endif
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.h b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.h
index e022311ee..248c447a1 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.h
+++ b/Source/WebKit/blackberry/WebCoreSupport/CacheClientBlackBerry.h
@@ -30,7 +30,6 @@ public:
private:
CacheClientBlackBerry();
- unsigned m_lastCapacity;
};
} // WebCore
diff --git a/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp b/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
index 40655d36a..d73d84ee6 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/DatePickerClient.cpp
@@ -23,6 +23,7 @@
#include "ChromeClient.h"
#include "Document.h"
#include "DocumentWriter.h"
+#include "Frame.h"
#include "HTMLInputElement.h"
#include "Page.h"
#include "PagePopup.h"
@@ -128,6 +129,9 @@ void DatePickerClient::setValueAndClosePopup(int, const String& value)
// Return -1 if user cancel the selection.
ASSERT(m_element);
+ // We hide caret when we select date input field, restore it when we close date picker.
+ m_element->document()->frame()->selection()->setCaretVisible(true);
+
if (value != "-1")
m_element->setValue(value);
closePopup();
diff --git a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
index 4b0fd9b4a..9669c938b 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
@@ -883,7 +883,7 @@ void FrameLoaderClientBlackBerry::dispatchDidLayout(LayoutMilestones milestones)
if (backingStorePrivate->renderVisibleContents()) {
if (!backingStorePrivate->shouldDirectRenderingToWindow())
backingStorePrivate->blitVisibleContents();
- m_webPagePrivate->m_client->notifyContentRendered(backingStorePrivate->visibleContentsRect());
+ m_webPagePrivate->m_client->notifyPixelContentRendered(backingStorePrivate->visibleContentsRect());
}
}
diff --git a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
index b37b5e668..b1af6fa63 100644
--- a/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
+++ b/Source/WebKit/blackberry/WebCoreSupport/SelectPopupClient.cpp
@@ -173,8 +173,11 @@ void SelectPopupClient::setValueAndClosePopup(int, const String& stringValue)
const Vector<HTMLElement*>& items = m_element->listItems();
- if (items.size() != static_cast<unsigned int>(m_size))
+ // If element changed after select UI showed, do nothing but closePopup().
+ if (items.size() != static_cast<unsigned>(m_size)) {
+ closePopup();
return;
+ }
HTMLOptionElement* option;
for (unsigned i = 0; i < m_size; i++) {
diff --git a/Source/WebKit/blackberry/WebKitSupport/FatFingers.h b/Source/WebKit/blackberry/WebKitSupport/FatFingers.h
index 3e3c6fc3a..5edd03ed3 100644
--- a/Source/WebKit/blackberry/WebKitSupport/FatFingers.h
+++ b/Source/WebKit/blackberry/WebKitSupport/FatFingers.h
@@ -149,7 +149,7 @@ public:
enum ContentType { ShadowContentAllowed, ShadowContentNotAllowed };
- WebCore::Node* node(ContentType type = ShadowContentAllowed) const
+ WebCore::Node* node(ContentType type = ShadowContentAllowed, bool shouldUseRootEditableElement = false) const
{
if (!m_nodeUnderFatFinger || !m_nodeUnderFatFinger->inDocument())
return 0;
@@ -163,12 +163,23 @@ public:
while (result->isInShadowTree())
result = toElement(result->shadowAncestorNode());
+ if (!shouldUseRootEditableElement || !result->isElementNode())
+ return result;
+
+ // Retrieve the top level editable node
+ while (!result->isRootEditableElement()) {
+ WebCore::Element* parentElement = result->parentElement();
+ if (!parentElement)
+ break;
+ result = parentElement;
+ }
+
return result;
}
- WebCore::Element* nodeAsElementIfApplicable(ContentType type = ShadowContentAllowed) const
+ WebCore::Element* nodeAsElementIfApplicable(ContentType type = ShadowContentAllowed, bool shouldUseRootEditableElement = false) const
{
- WebCore::Node* result = node(type);
+ WebCore::Node* result = node(type, shouldUseRootEditableElement);
if (!result || !result->isElementNode())
return 0;
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
index e39df6e23..a1199ca72 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
@@ -699,13 +699,27 @@ SpellChecker* InputHandler::getSpellChecker()
bool InputHandler::shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint& point, const Element* touchedElement, imf_sp_text_t& spellCheckingOptionRequest)
{
- if (!isActiveTextEdit() || touchedElement != m_currentFocusElement)
+ if (!isActiveTextEdit())
+ return false;
+
+ Element* currentFocusElement = m_currentFocusElement.get();
+ if (!currentFocusElement || !currentFocusElement->isElementNode())
+ return false;
+
+ while (!currentFocusElement->isRootEditableElement()) {
+ Element* parentElement = currentFocusElement->parentElement();
+ if (!parentElement)
+ break;
+ currentFocusElement = parentElement;
+ }
+
+ if (touchedElement != currentFocusElement)
return false;
LayoutPoint contentPos(m_webPage->mapFromViewportToContents(point));
contentPos = DOMSupport::convertPointToFrame(m_webPage->mainFrame(), m_webPage->focusedOrMainFrame(), roundedIntPoint(contentPos));
- Document* document = m_currentFocusElement->document();
+ Document* document = currentFocusElement->document();
ASSERT(document);
RenderedDocumentMarker* marker = document->markers()->renderedMarkerContainingPoint(contentPos, DocumentMarker::Spelling);
@@ -723,29 +737,23 @@ bool InputHandler::shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint&
return true;
}
-void InputHandler::requestSpellingCheckingOptions(imf_sp_text_t& spellCheckingOptionRequest)
+void InputHandler::requestSpellingCheckingOptions(imf_sp_text_t& spellCheckingOptionRequest, const WebCore::IntSize& screenOffset)
{
// If the caret is no longer active, no message should be sent.
if (m_webPage->focusedOrMainFrame()->selection()->selectionType() != VisibleSelection::CaretSelection)
return;
// imf_sp_text_t should be generated in pixel viewport coordinates.
- WebCore::IntRect caretLocation = m_webPage->focusedOrMainFrame()->selection()->selection().visibleStart().absoluteCaretBounds();
- caretLocation = m_webPage->mapToTransformed(m_webPage->focusedOrMainFrame()->view()->contentsToWindow(enclosingIntRect(caretLocation)));
- m_webPage->clipToTransformedContentsRect(caretLocation);
+ WebCore::IntRect caretRect = m_webPage->focusedOrMainFrame()->selection()->selection().visibleStart().absoluteCaretBounds();
+ caretRect = m_webPage->focusedOrMainFrame()->view()->contentsToRootView(caretRect);
+ const WebCore::IntPoint scrollPosition = m_webPage->mainFrame()->view()->scrollPosition();
+ caretRect.move(scrollPosition.x(), scrollPosition.y());
- spellCheckingOptionRequest.caret_rect.caret_top_x = caretLocation.x();
- spellCheckingOptionRequest.caret_rect.caret_top_y = caretLocation.y();
- spellCheckingOptionRequest.caret_rect.caret_bottom_x = caretLocation.x();
- spellCheckingOptionRequest.caret_rect.caret_bottom_y = caretLocation.y() + caretLocation.height();
+ InputLog(LogLevelInfo, "InputHandler::requestSpellingCheckingOptions caretRect topLeft=(%d,%d), bottomRight=(%d,%d), startTextPosition=%d, endTextPosition=%d"
+ , caretRect.minXMinYCorner().x(), caretRect.minXMinYCorner().y(), caretRect.maxXMaxYCorner().x(), caretRect.maxXMaxYCorner().y()
+ , spellCheckingOptionRequest.startTextPosition, spellCheckingOptionRequest.endTextPosition);
- SpellingLog(LogLevelInfo, "InputHandler::requestSpellingCheckingOptions Sending request:\ncaret_rect.caret_top_x = %d\ncaret_rect.caret_top_y = %d" \
- "\ncaret_rect.caret_bottom_x = %d\ncaret_rect.caret_bottom_y = %d\nstartTextPosition = %d\nendTextPosition = %d",
- spellCheckingOptionRequest.caret_rect.caret_top_x, spellCheckingOptionRequest.caret_rect.caret_top_y,
- spellCheckingOptionRequest.caret_rect.caret_bottom_x, spellCheckingOptionRequest.caret_rect.caret_bottom_y,
- spellCheckingOptionRequest.startTextPosition, spellCheckingOptionRequest.endTextPosition);
-
- m_webPage->m_client->requestSpellingCheckingOptions(spellCheckingOptionRequest);
+ m_webPage->m_client->requestSpellingCheckingOptions(spellCheckingOptionRequest, caretRect, screenOffset);
}
void InputHandler::setElementUnfocused(bool refocusOccuring)
@@ -974,6 +982,9 @@ bool InputHandler::openDatePopup(HTMLInputElement* element, BlackBerryInputType
case BlackBerry::Platform::InputTypeDateTime:
case BlackBerry::Platform::InputTypeDateTimeLocal:
case BlackBerry::Platform::InputTypeMonth: {
+ // Date input have button appearance, we hide caret when they get clicked.
+ element->document()->frame()->selection()->setCaretVisible(false);
+
// Check if popup already exists, close it if does.
m_webPage->m_page->chrome()->client()->closePagePopup(0);
WTF::String value = element->value();
diff --git a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
index 122ef9186..9e271ae2f 100644
--- a/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
+++ b/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
@@ -141,7 +141,7 @@ public:
void spellCheckingRequestCancelled(int32_t transactionId);
bool shouldRequestSpellCheckingOptionsForPoint(Platform::IntPoint&, const WebCore::Element*, imf_sp_text_t&);
- void requestSpellingCheckingOptions(imf_sp_text_t&);
+ void requestSpellingCheckingOptions(imf_sp_text_t&, const WebCore::IntSize& screenOffset);
private:
enum PendingKeyboardStateChange { NoChange, Visible, NotVisible };
diff --git a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
index 10e07359e..fcd2e7e10 100644
--- a/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
@@ -937,17 +937,6 @@ void SelectionHandler::selectionPositionChanged(bool forceUpdateWithoutChange)
// Find the top corner and bottom corner.
adjustCaretRects(startCaret, shouldClipStartCaret, endCaret, shouldClipEndCaret, visibleSelectionRegion.rects(), startCaretReferencePoint, endCaretReferencePoint, isRTL);
-
- // Translate the caret values as they must be in transformed coordinates.
- if (!shouldClipStartCaret) {
- startCaret = m_webPage->mapToTransformed(startCaret);
- m_webPage->clipToTransformedContentsRect(startCaret);
- }
-
- if (!shouldClipEndCaret) {
- endCaret = m_webPage->mapToTransformed(endCaret);
- m_webPage->clipToTransformedContentsRect(endCaret);
- }
}
}
@@ -972,7 +961,6 @@ void SelectionHandler::notifyCaretPositionChangedIfNeeded()
}
}
-// NOTE: This function is not in WebKit coordinates.
void SelectionHandler::caretPositionChanged()
{
SelectionLog(LogLevelInfo, "SelectionHandler::caretPositionChanged");
@@ -1009,26 +997,20 @@ void SelectionHandler::caretPositionChanged()
SelectionLog(LogLevelInfo, "SelectionHandler::caretPositionChanged caret Rect %d, %d, %dx%d",
caretLocation.x(), caretLocation.y(), caretLocation.width(), caretLocation.height());
- caretLocation = m_webPage->mapToTransformed(caretLocation);
- m_webPage->clipToTransformedContentsRect(caretLocation);
-
- bool singleLineInput = !m_webPage->m_inputHandler->isMultilineInputMode();
- WebCore::IntRect nodeBoundingBox = singleLineInput ? m_webPage->m_inputHandler->boundingBoxForInputField() : WebCore::IntRect();
+ bool isSingleLineInput = !m_webPage->m_inputHandler->isMultilineInputMode();
+ WebCore::IntRect nodeBoundingBox = isSingleLineInput ? m_webPage->m_inputHandler->boundingBoxForInputField() : WebCore::IntRect();
if (!nodeBoundingBox.isEmpty()) {
nodeBoundingBox.move(frameOffset.x(), frameOffset.y());
// Clip against the containing frame and node boundaries.
nodeBoundingBox.intersect(clippingRectForContent);
-
- nodeBoundingBox = m_webPage->mapToTransformed(nodeBoundingBox);
- m_webPage->clipToTransformedContentsRect(nodeBoundingBox);
}
- SelectionLog(LogLevelInfo, "SelectionHandler::single line %s single line bounding box %d, %d, %dx%d",
- singleLineInput ? "true" : "false", nodeBoundingBox.x(), nodeBoundingBox.y(), nodeBoundingBox.width(), nodeBoundingBox.height());
+ SelectionLog(LogLevelInfo, "SelectionHandler::caretPositionChanged: %s line input, single line bounding box (%d, %d) %dx%d",
+ isSingleLineInput ? "single" : "multi", nodeBoundingBox.x(), nodeBoundingBox.y(), nodeBoundingBox.width(), nodeBoundingBox.height());
- m_webPage->m_client->notifyCaretChanged(caretLocation, m_webPage->m_touchEventHandler->lastFatFingersResult().isTextInput() /* userTouchTriggered */, singleLineInput, nodeBoundingBox);
+ m_webPage->m_client->notifyCaretChanged(caretLocation, m_webPage->m_touchEventHandler->lastFatFingersResult().isTextInput() /* userTouchTriggered */, isSingleLineInput, nodeBoundingBox);
}
bool SelectionHandler::selectionContains(const WebCore::IntPoint& point)
diff --git a/Source/WebKit/blackberry/WebKitSupport/TileIndex.h b/Source/WebKit/blackberry/WebKitSupport/TileIndex.h
index 3149847c9..51d5ef135 100644
--- a/Source/WebKit/blackberry/WebKitSupport/TileIndex.h
+++ b/Source/WebKit/blackberry/WebKitSupport/TileIndex.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009, 2010, 2011 Research In Motion Limited. All rights reserved.
+ * Copyright (C) 2009, 2010, 2011, 2012 Research In Motion Limited. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -27,25 +27,30 @@ namespace WebKit {
class TileIndex {
public:
TileIndex()
- : m_i(std::numeric_limits<unsigned int>::max())
- , m_j(std::numeric_limits<unsigned int>::max()) { }
- TileIndex(unsigned int i, unsigned int j)
+ : m_i(std::numeric_limits<unsigned>::max())
+ , m_j(std::numeric_limits<unsigned>::max()) { }
+ TileIndex(unsigned i, unsigned j)
: m_i(i)
, m_j(j) { }
~TileIndex() { }
- unsigned int i() const { return m_i; }
- unsigned int j() const { return m_j; }
- void setIndex(unsigned int i, unsigned int j)
+ unsigned i() const { return m_i; }
+ unsigned j() const { return m_j; }
+ void setIndex(unsigned i, unsigned j)
{
m_i = i;
m_j = j;
}
+ bool isValid() const
+ {
+ return m_i != std::numeric_limits<unsigned>::max()
+ && m_j != std::numeric_limits<unsigned>::max();
+ }
+
private:
- bool m_isValid;
- unsigned int m_i;
- unsigned int m_j;
+ unsigned m_i;
+ unsigned m_j;
};
inline bool operator==(const BlackBerry::WebKit::TileIndex& a, const BlackBerry::WebKit::TileIndex& b)
diff --git a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
index ace76f12d..3d9e92ff0 100644
--- a/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
+++ b/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp
@@ -239,7 +239,7 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
if (m_lastFatFingersResult.isTextInput())
shouldRequestSpellCheckOptions = m_webPage->m_inputHandler->shouldRequestSpellCheckingOptionsForPoint(point.m_pos
- , m_lastFatFingersResult.nodeAsElementIfApplicable(FatFingersResult::ShadowContentNotAllowed)
+ , m_lastFatFingersResult.nodeAsElementIfApplicable(FatFingersResult::ShadowContentNotAllowed, true /* shouldUseRootEditableElement */)
, spellCheckOptionRequest);
// Apply any suppressed changes. This does not eliminate the need
@@ -273,8 +273,10 @@ bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFa
PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, PlatformEvent::MouseReleased, 1, LeftButton, TouchScreen);
m_webPage->handleMouseEvent(mouseEvent);
m_lastFatFingersResult.reset(); // Reset the fat finger result as its no longer valid when a user's finger is not on the screen.
- if (shouldRequestSpellCheckOptions)
- m_webPage->m_inputHandler->requestSpellingCheckingOptions(spellCheckOptionRequest);
+ if (shouldRequestSpellCheckOptions) {
+ IntPoint pixelPositionRelativeToViewport = m_webPage->mapToTransformed(adjustedPoint);
+ m_webPage->m_inputHandler->requestSpellingCheckingOptions(spellCheckOptionRequest, IntSize(m_lastScreenPoint - pixelPositionRelativeToViewport));
+ }
return true;
}
case Platform::TouchPoint::TouchMoved:
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 0ac7a7002..d586fba43 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,326 @@
+2012-11-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r134010.
+ http://trac.webkit.org/changeset/134010
+ https://bugs.webkit.org/show_bug.cgi?id=101716
+
+ Broke the chromium windows build. (Requested by noel_ on
+ #webkit).
+
+ * src/IDBCallbacksProxy.cpp:
+ * src/IDBDatabaseBackendProxy.cpp:
+ (WebKit::IDBDatabaseBackendProxy::transaction):
+ (WebKit):
+ * src/IDBDatabaseBackendProxy.h:
+ (IDBDatabaseBackendProxy):
+ * src/IDBObjectStoreBackendProxy.cpp:
+ (WebKit::IDBObjectStoreBackendProxy::putWithIndexKeys):
+ (WebKit):
+ (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
+ (WebKit::IDBObjectStoreBackendProxy::createIndex):
+ (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
+ (WebKit::IDBObjectStoreBackendProxy::index):
+ (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
+ * src/IDBObjectStoreBackendProxy.h:
+ (IDBObjectStoreBackendProxy):
+ * src/WebIDBDatabaseImpl.cpp:
+ (WebKit::WebIDBDatabaseImpl::deleteObjectStore):
+ (WebKit):
+ (WebKit::WebIDBDatabaseImpl::transaction):
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::putWithIndexKeys):
+ (WebKit):
+ (WebKit::WebIDBObjectStoreImpl::setIndexKeys):
+ (WebKit::WebIDBObjectStoreImpl::setIndexesReady):
+ (WebKit::WebIDBObjectStoreImpl::index):
+ (WebKit::WebIDBObjectStoreImpl::deleteIndex):
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+ * src/WebIDBTransactionImpl.cpp:
+ (WebKit::WebIDBTransactionImpl::objectStore):
+ (WebKit):
+ * src/WebIDBTransactionImpl.h:
+ * tests/IDBRequestTest.cpp:
+
+2012-11-08 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: switch frontend to use int64_t-based references
+ https://bugs.webkit.org/show_bug.cgi?id=100426
+
+ Reviewed by Tony Chang.
+
+ Remove implementation stubs from chromium API for
+ methods obsoleted by https://bugs.webkit.org/show_bug.cgi?id=100425
+
+ * src/IDBObjectStoreBackendProxy.cpp:
+ * src/IDBObjectStoreBackendProxy.h:
+ (IDBObjectStoreBackendProxy):
+ * src/WebIDBDatabaseImpl.cpp:
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBObjectStoreImpl.cpp:
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+
+2012-11-08 Keishi Hattori <keishi@webkit.org>
+
+ WebPagePopupImpl::handleKeyEvent is called after WebPagePopupImpl::close
+ https://bugs.webkit.org/show_bug.cgi?id=93800
+
+ Reviewed by Kent Tamura.
+
+ We need to set m_closing to true in WebPagePopupImpl::close so we won't access m_page in WebPagePopupImpl::handleKeyEvent.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::close): Set m_closing to true.
+
+2012-11-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r133984.
+ http://trac.webkit.org/changeset/133984
+ https://bugs.webkit.org/show_bug.cgi?id=101684
+
+ windows build error. (Requested by hayato on #webkit).
+
+ * src/IDBObjectStoreBackendProxy.cpp:
+ (WebKit::IDBObjectStoreBackendProxy::putWithIndexKeys):
+ (WebKit):
+ (WebKit::IDBObjectStoreBackendProxy::setIndexKeys):
+ (WebKit::IDBObjectStoreBackendProxy::createIndex):
+ (WebKit::IDBObjectStoreBackendProxy::setIndexesReady):
+ (WebKit::IDBObjectStoreBackendProxy::index):
+ (WebKit::IDBObjectStoreBackendProxy::deleteIndex):
+ * src/IDBObjectStoreBackendProxy.h:
+ (IDBObjectStoreBackendProxy):
+ * src/WebIDBDatabaseImpl.cpp:
+ (WebKit::WebIDBDatabaseImpl::deleteObjectStore):
+ (WebKit):
+ (WebKit::WebIDBDatabaseImpl::transaction):
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::putWithIndexKeys):
+ (WebKit):
+ (WebKit::WebIDBObjectStoreImpl::setIndexKeys):
+ (WebKit::WebIDBObjectStoreImpl::setIndexesReady):
+ (WebKit::WebIDBObjectStoreImpl::index):
+ (WebKit::WebIDBObjectStoreImpl::deleteIndex):
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+ * src/WebIDBTransactionImpl.cpp:
+ (WebKit::WebIDBTransactionImpl::objectStore):
+ (WebKit):
+ * src/WebIDBTransactionImpl.h:
+
+2012-11-08 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: switch frontend to use int64_t-based references
+ https://bugs.webkit.org/show_bug.cgi?id=100426
+
+ Reviewed by Tony Chang.
+
+ Remove implementation stubs from chromium API for
+ methods obsoleted by https://bugs.webkit.org/show_bug.cgi?id=100425
+
+ * src/IDBObjectStoreBackendProxy.cpp:
+ * src/IDBObjectStoreBackendProxy.h:
+ (IDBObjectStoreBackendProxy):
+ * src/WebIDBDatabaseImpl.cpp:
+ * src/WebIDBDatabaseImpl.h:
+ (WebIDBDatabaseImpl):
+ * src/WebIDBObjectStoreImpl.cpp:
+ * src/WebIDBObjectStoreImpl.h:
+ (WebIDBObjectStoreImpl):
+
+2012-11-07 Kent Tamura <tkent@chromium.org>
+
+ [Chromium] WebElement::hasHTMLTagName returns true for non-HTML elements
+ https://bugs.webkit.org/show_bug.cgi?id=101537
+
+ Reviewed by Abhishek Arya.
+
+ We should not do ignore-case comparison for tagName, which is always
+ upper-case and createElementNS(xhtmlNS, "INPUT") doesn't create an
+ HTMLInputElement object. We need to check if localName is equal to
+ "input" in this case.
+
+ * src/WebElement.cpp:
+ (WebKit::WebElement::hasHTMLTagName):
+
+2012-11-08 Joshua Bell <jsbell@chromium.org>
+
+ Expose snapshots in platform/leveldb wrapper API
+ https://bugs.webkit.org/show_bug.cgi?id=100786
+
+ Reviewed by Tony Chang.
+
+ Add unit tests for transactions/snapshots.
+
+ * tests/LevelDBTest.cpp:
+ (WebCore::encodeString): Don't append to pre-sized vector.
+ (WebCore::TEST):
+ (WebCore):
+
+2012-11-08 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Roll Chromium DEPS: 166678 => 166755
+
+ * DEPS:
+
+2012-11-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
+2012-11-08 Sami Kyostila <skyostil@chromium.org>
+
+ Introduce WebScreenInfo.deviceScaleFactor
+ https://bugs.webkit.org/show_bug.cgi?id=101613
+
+ Reviewed by Adam Barth.
+
+ Introduce the WebScreenInfo.deviceScaleFactor property, which specifies the
+ ratio between physical and logical pixels. This is the first step in replacing
+ horizontalDPI/verticalDPI in favor of the deviceScaleFactor.
+
+ For now, this value is only initialized on Mac, because the other ports that
+ use it initialize the value in Chromium, whereas Windows and X11 default to a
+ factor of 1. The value on Mac is truncated to an integer to match the
+ expectation in Chromium's RenderWidget.
+
+ * src/mac/WebScreenInfoFactory.mm:
+ (WebKit::WebScreenInfoFactory::screenInfo):
+
+2012-11-08 Dan Carney <dcarney@google.com>
+
+ Cleanup IDBBindingUtilitiesTest
+ https://bugs.webkit.org/show_bug.cgi?id=100860
+
+ Reviewed by Adam Barth.
+
+ Small cleanup of IDBBindingUtilitiesTest as per
+ https://bugs.webkit.org/show_bug.cgi?id=99975#c38
+
+ * tests/IDBBindingUtilitiesTest.cpp:
+ (IDBKeyFromValueAndKeyPathTest):
+ (WebKit::IDBKeyFromValueAndKeyPathTest::IDBKeyFromValueAndKeyPathTest):
+ (WebKit::IDBKeyFromValueAndKeyPathTest::context):
+ (WebKit):
+ (WebKit::TEST_F):
+
+2012-11-08 Keishi Hattori <keishi@webkit.org>
+
+ Add properties for week/month picker in DateTimeChooserImpl::writeDocument
+ https://bugs.webkit.org/show_bug.cgi?id=101552
+
+ Reviewed by Kent Tamura.
+
+ Changing the arguments for calendar picker to support week/month picker.
+
+ * src/DateTimeChooserImpl.cpp:
+ (WebKit::DateTimeChooserImpl::writeDocument):
+
+2012-11-08 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r133429.
+ http://trac.webkit.org/changeset/133429
+ https://bugs.webkit.org/show_bug.cgi?id=101173
+
+ Speculative roll out, investigating perf regression.
+
+ * src/ContextFeaturesClientImpl.cpp:
+ (WebKit::ContextFeaturesClientImpl::askIfIsEnabled):
+
+2012-11-08 Yury Semikhatsky <yurys@chromium.org>
+
+ Web Inspector: move front-end methods called from native part to InspectorFrontendAPI
+ https://bugs.webkit.org/show_bug.cgi?id=101463
+
+ Reviewed by Vsevolod Vlasov.
+
+ Moved Web Inspector methods called from native code to InspectorFrontendAPI. Updated
+ WebDevToolsFrontendImpl appropriately.
+
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::dispatchOnInspectorFrontend):
+
+2012-11-08 Alec Flett <alecflett@chromium.org>
+
+ IndexedDB: Rename methods and remove dead code from IDBBackingStore
+ https://bugs.webkit.org/show_bug.cgi?id=101488
+
+ Reviewed by Ojan Vafai.
+
+ Update IDBFakeBackingStore to reflect method changes in IDBBackingStore.
+
+ * tests/IDBFakeBackingStore.h:
+
+2012-08-20 Taiju Tsuiki <tzik@chromium.org>
+
+ Web Inspector: Drop dimmed crumb handling
+ https://bugs.webkit.org/show_bug.cgi?id=94457
+
+ Reviewed by Vsevolod Vlasov.
+
+ * src/js/devTools.css:
+
+2012-11-07 Adam Barth <abarth@webkit.org>
+
+ [V8] We should hide the DOMWrapperMaps inside DOMDataStore
+ https://bugs.webkit.org/show_bug.cgi?id=101430
+
+ Reviewed by Kentaro Hara.
+
+ Remove unneeded header includes.
+
+ * src/WebScriptController.cpp:
+
+2012-11-07 Varun Jain <varunjain@chromium.org>
+
+ Add new gesture type, LongTap, which is basically the completion of a GestureLongPress
+ https://bugs.webkit.org/show_bug.cgi?id=101385
+
+ Reviewed by Adam Barth.
+
+ Test: Only creating the new enum. No functionality change, hence no tests required.
+
+ * public/WebInputEvent.h:
+ (WebKit::WebInputEvent::isGestureEventType):
+ * src/PageWidgetDelegate.cpp:
+ (WebKit::PageWidgetDelegate::handleInputEvent):
+ * src/WebInputEventConversion.cpp:
+ (WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::handleInputEvent):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleGestureEvent):
+
+2012-11-05 Emil A Eklund <eae@chromium.org>
+
+ Remove LayoutTypes abstraction
+ https://bugs.webkit.org/show_bug.cgi?id=93050
+
+ Reviewed by Levi Weintraub.
+
+ Remove LayoutTypes abstraction and rename FractionalLayout* to
+ Layout* now that all platforms use the FractionalLayout version
+ (albeit with different fractions).
+
+ No new tests, no change in functionality.
+
+ * src/LinkHighlight.cpp:
+
+2012-11-07 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed. Rolled DEPS.
+
+ * DEPS:
+
2012-11-07 Kenneth Rohde Christiansen <kenneth@webkit.org>
Remove support for "desktop-width" in the viewport meta tag
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index ac5cf1057..a4968c57d 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '166220'
+ 'chromium_rev': 'HEAD'
}
deps = {
diff --git a/Source/WebKit/chromium/public/WebInputEvent.h b/Source/WebKit/chromium/public/WebInputEvent.h
index 328c0337e..3c9f77090 100644
--- a/Source/WebKit/chromium/public/WebInputEvent.h
+++ b/Source/WebKit/chromium/public/WebInputEvent.h
@@ -120,6 +120,7 @@ public:
GestureDoubleTap,
GestureTwoFingerTap,
GestureLongPress,
+ GestureLongTap,
GesturePinchBegin,
GesturePinchEnd,
GesturePinchUpdate,
@@ -211,6 +212,7 @@ public:
|| type == GestureDoubleTap
|| type == GestureTwoFingerTap
|| type == GestureLongPress
+ || type == GestureLongTap
|| type == GesturePinchBegin
|| type == GesturePinchEnd
|| type == GesturePinchUpdate;
diff --git a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
index 335d71d2b..41fd05413 100644
--- a/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp
@@ -140,7 +140,6 @@ bool ContextFeaturesClientImpl::askIfIsEnabled(Document* document, ContextFeatur
return defaultValue;
switch (type) {
- case ContextFeatures::ShadowDOM:
case ContextFeatures::StyleScoped:
return m_client->allowWebComponents(WebDocument(document), defaultValue);
case ContextFeatures::HTMLNotifications:
diff --git a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
index 29d519966..f44157a76 100644
--- a/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
+++ b/Source/WebKit/chromium/src/DateTimeChooserImpl.cpp
@@ -90,11 +90,18 @@ WebCore::IntSize DateTimeChooserImpl::contentSize()
void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
{
- WebCore::DateComponents date;
- date.setMillisecondsSinceEpochForDate(m_parameters.minimum);
- String minString = date.toString();
- date.setMillisecondsSinceEpochForDate(m_parameters.maximum);
- String maxString = date.toString();
+ WebCore::DateComponents minDate;
+ WebCore::DateComponents maxDate;
+ if (m_parameters.type == WebCore::InputTypeNames::month()) {
+ minDate.setMonthsSinceEpoch(m_parameters.minimum);
+ maxDate.setMonthsSinceEpoch(m_parameters.maximum);
+ } else if (m_parameters.type == WebCore::InputTypeNames::week()) {
+ minDate.setMillisecondsSinceEpochForWeek(m_parameters.minimum);
+ maxDate.setMillisecondsSinceEpochForWeek(m_parameters.maximum);
+ } else {
+ minDate.setMillisecondsSinceEpochForDate(m_parameters.minimum);
+ maxDate.setMillisecondsSinceEpochForDate(m_parameters.maximum);
+ }
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);
@@ -102,6 +109,13 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
IntRect rootViewVisibleContentRect = view->visibleContentRect(true /* include scrollbars */);
IntRect rootViewRectInScreen = m_chromeClient->rootViewToScreen(rootViewVisibleContentRect);
rootViewRectInScreen.move(-view->scrollX(), -view->scrollY());
+ String todayLabelString;
+ if (m_parameters.type == WebCore::InputTypeNames::month())
+ todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisMonthButtonLabel);
+ else if (m_parameters.type == WebCore::InputTypeNames::week())
+ todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::ThisWeekButtonLabel);
+ else
+ todayLabelString = Platform::current()->queryLocalizedString(WebLocalizedString::CalendarToday);
addString("<!DOCTYPE html><head><meta charset='UTF-8'><style>\n", writer);
writer.addData(WebCore::pickerCommonCss, sizeof(WebCore::pickerCommonCss));
@@ -119,20 +133,22 @@ void DateTimeChooserImpl::writeDocument(WebCore::DocumentWriter& writer)
#else
addProperty("confineToRootView", false, writer);
#endif
- addProperty("min", minString, writer);
- addProperty("max", maxString, writer);
+ addProperty("min", minDate.toString(), writer);
+ addProperty("max", maxDate.toString(), 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("todayLabel", todayLabelString, writer);
addProperty("clearLabel", Platform::current()->queryLocalizedString(WebLocalizedString::CalendarClear), writer);
+ addProperty("weekLabel", Platform::current()->queryLocalizedString(WebLocalizedString::WeekNumberLabel), writer);
addProperty("weekStartDay", m_locale->firstDayOfWeek(), writer);
addProperty("monthLabels", m_locale->monthLabels(), writer);
addProperty("dayLabels", m_locale->weekDayShortLabels(), writer);
addProperty("isCalendarRTL", m_locale->isRTL(), writer);
addProperty("isRTL", m_parameters.isAnchorElementRTL, writer);
+ addProperty("mode", m_parameters.type.string(), writer);
if (m_parameters.suggestionValues.size()) {
addProperty("inputWidth", static_cast<unsigned>(m_parameters.anchorRectInRootView.width()), writer);
addProperty("suggestionValues", m_parameters.suggestionValues, writer);
diff --git a/Source/WebKit/chromium/src/LinkHighlight.cpp b/Source/WebKit/chromium/src/LinkHighlight.cpp
index 0d4d154f0..583358b94 100644
--- a/Source/WebKit/chromium/src/LinkHighlight.cpp
+++ b/Source/WebKit/chromium/src/LinkHighlight.cpp
@@ -30,7 +30,6 @@
#include "Color.h"
#include "Frame.h"
#include "FrameView.h"
-#include "LayoutTypes.h"
#include "Node.h"
#include "NonCompositedContentHost.h"
#include "PlatformContextSkia.h"
diff --git a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
index 071c22a3d..4cc81c14d 100644
--- a/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
+++ b/Source/WebKit/chromium/src/PageWidgetDelegate.cpp
@@ -158,6 +158,7 @@ bool PageWidgetDelegate::handleInputEvent(Page* page, PageWidgetEventHandler& ha
case WebInputEvent::GestureDoubleTap:
case WebInputEvent::GestureTwoFingerTap:
case WebInputEvent::GestureLongPress:
+ case WebInputEvent::GestureLongTap:
return handler.handleGestureEvent(*static_cast<const WebGestureEvent*>(&event));
#endif
diff --git a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index f723390b5..9e3d05313 100644
--- a/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/Source/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -109,11 +109,11 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa
v8::HandleScope scope;
v8::Handle<v8::Context> frameContext = frame->frame() ? frame->frame()->script()->currentWorldContext() : v8::Local<v8::Context>();
v8::Context::Scope contextScope(frameContext);
- v8::Handle<v8::Value> inspectorBackendValue = frameContext->Global()->Get(v8::String::New("InspectorBackend"));
- if (!inspectorBackendValue->IsObject())
+ v8::Handle<v8::Value> inspectorFrontendApiValue = frameContext->Global()->Get(v8::String::New("InspectorFrontendAPI"));
+ if (!inspectorFrontendApiValue->IsObject())
return;
- v8::Handle<v8::Object> inspectorBackend = v8::Handle<v8::Object>::Cast(inspectorBackendValue);
- v8::Handle<v8::Value> dispatchFunction = inspectorBackend->Get(v8::String::New("dispatch"));
+ v8::Handle<v8::Object> inspectorFrontendApi = v8::Handle<v8::Object>::Cast(inspectorFrontendApiValue);
+ v8::Handle<v8::Value> dispatchFunction = inspectorFrontendApi->Get(v8::String::New("dispatchMessage"));
// The frame might have navigated away from the front-end page (which is still weird).
if (!dispatchFunction->IsFunction())
return;
@@ -122,7 +122,7 @@ void WebDevToolsFrontendImpl::dispatchOnInspectorFrontend(const WebString& messa
args.append(ToV8String(message));
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
- ScriptController::callFunctionWithInstrumentation(frame->frame() ? frame->frame()->document() : 0, function, inspectorBackend, args.size(), args.data());
+ ScriptController::callFunctionWithInstrumentation(frame->frame() ? frame->frame()->document() : 0, function, inspectorFrontendApi, args.size(), args.data());
}
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp
index 49fff0a07..96cf9791d 100644
--- a/Source/WebKit/chromium/src/WebElement.cpp
+++ b/Source/WebKit/chromium/src/WebElement.cpp
@@ -66,8 +66,13 @@ bool WebElement::hasTagName(const WebString& tagName) const
bool WebElement::hasHTMLTagName(const WebString& tagName) const
{
+ // How to create class nodeName localName
+ // createElement('input') HTMLInputElement INPUT input
+ // createElement('INPUT') HTMLInputElement INPUT input
+ // createElementNS(xhtmlNS, 'input') HTMLInputElement INPUT input
+ // createElementNS(xhtmlNS, 'INPUT') HTMLUnknownElement INPUT INPUT
const Element* element = constUnwrap<Element>();
- return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && equalIgnoringCase(element->tagName(), String(tagName));
+ return HTMLNames::xhtmlNamespaceURI == element->namespaceURI() && element->localName() == String(tagName).lower();
}
bool WebElement::hasAttribute(const WebString& attrName) const
diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
index 8ff2e210d..5cf24d0c1 100644
--- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -177,6 +177,10 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W
m_type = PlatformEvent::GestureLongPress;
m_area = IntSize(e.data.longPress.width, e.data.longPress.height);
break;
+ case WebInputEvent::GestureLongTap:
+ m_type = PlatformEvent::GestureLongTap;
+ m_area = IntSize(e.data.longPress.width, e.data.longPress.height);
+ break;
case WebInputEvent::GesturePinchBegin:
m_type = PlatformEvent::GesturePinchBegin;
break;
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
index 01cacda2a..d10022a51 100644
--- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp
@@ -304,6 +304,7 @@ void WebPagePopupImpl::setFocus(bool enable)
void WebPagePopupImpl::close()
{
+ m_closing = true;
if (m_page && m_page->mainFrame())
m_page->mainFrame()->loader()->frameDetached();
m_page.clear();
diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
index 0d2aeac45..656a2d655 100644
--- a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -281,6 +281,7 @@ bool WebPopupMenuImpl::handleInputEvent(const WebInputEvent& inputEvent)
case WebInputEvent::GestureDoubleTap:
case WebInputEvent::GestureTwoFingerTap:
case WebInputEvent::GestureLongPress:
+ case WebInputEvent::GestureLongTap:
case WebInputEvent::GesturePinchBegin:
case WebInputEvent::GesturePinchEnd:
case WebInputEvent::GesturePinchUpdate:
diff --git a/Source/WebKit/chromium/src/WebScriptController.cpp b/Source/WebKit/chromium/src/WebScriptController.cpp
index cdff75ab1..298480456 100644
--- a/Source/WebKit/chromium/src/WebScriptController.cpp
+++ b/Source/WebKit/chromium/src/WebScriptController.cpp
@@ -32,9 +32,6 @@
#include "WebScriptController.h"
#include "ScriptController.h"
-#include "V8Binding.h"
-#include "V8DOMMap.h"
-#include <public/WebString.h>
using namespace WebCore;
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index 3f83e4cbc..f6f9fc6fa 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -746,7 +746,8 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
break;
}
case WebInputEvent::GestureTwoFingerTap:
- case WebInputEvent::GestureLongPress: {
+ case WebInputEvent::GestureLongPress:
+ case WebInputEvent::GestureLongTap: {
if (!mainFrameImpl() || !mainFrameImpl()->frameView())
break;
diff --git a/Source/WebKit/chromium/src/js/devTools.css b/Source/WebKit/chromium/src/js/devTools.css
index d549de03e..f888938f5 100644
--- a/Source/WebKit/chromium/src/js/devTools.css
+++ b/Source/WebKit/chromium/src/js/devTools.css
@@ -88,10 +88,6 @@ body.platform-linux #scripts-files {
-webkit-border-image: url(Images/segmentHoverChromium.png) 0 12 0 2;
}
-.crumbs .crumb.dimmed:hover {
- -webkit-border-image: url(Images/segmentHoverChromium.png) 0 12 0 2;
-}
-
.crumbs .crumb.end:hover {
-webkit-border-image: url(Images/segmentHoverEndChromium.png) 0 2 0 2;
}
diff --git a/Source/WebKit/chromium/src/mac/WebScreenInfoFactory.mm b/Source/WebKit/chromium/src/mac/WebScreenInfoFactory.mm
index f246bcf2c..003c8eb6e 100644
--- a/Source/WebKit/chromium/src/mac/WebScreenInfoFactory.mm
+++ b/Source/WebKit/chromium/src/mac/WebScreenInfoFactory.mm
@@ -98,6 +98,7 @@ WebScreenInfo WebScreenInfoFactory::screenInfo(NSView* view)
float deviceDPI = 160 * deviceScaleFactor(view);
results.horizontalDPI = deviceDPI;
results.verticalDPI = deviceDPI;
+ results.deviceScaleFactor = static_cast<int>(deviceScaleFactor(view));
results.depth = NSBitsPerPixelFromDepth([screen depth]);
results.depthPerComponent = NSBitsPerSampleFromDepth([screen depth]);
diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
index a2a4f442d..d950c1c74 100644
--- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
+++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp
@@ -99,18 +99,34 @@ void checkKeyPathNumberValue(const ScriptValue& value, const String& keyPath, in
ASSERT_TRUE(expected == idbKey->number());
}
-static v8::Handle<v8::Context> context()
-{
- static WebView* webView;
- if (!webView) {
- webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
- webView->setFocus(true);
+class IDBKeyFromValueAndKeyPathTest : public testing::Test {
+public:
+ IDBKeyFromValueAndKeyPathTest()
+ : m_webView(0)
+ {
+ }
+
+ void SetUp() OVERRIDE
+ {
+ m_webView = FrameTestHelpers::createWebViewAndLoad("about:blank");
+ m_webView->setFocus(true);
+ }
+
+ void TearDown() OVERRIDE
+ {
+ m_webView->close();
+ }
+
+ v8::Handle<v8::Context> context()
+ {
+ return static_cast<WebFrameImpl*>(m_webView->mainFrame())->frame()->script()->mainWorldContext();
}
- ScriptExecutionContext* context = static_cast<WebFrameImpl*>(webView->mainFrame())->frame()->document();
- return toV8Context(context, WorldContextHandle(UseCurrentWorld));
-}
-TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
+private:
+ WebView* m_webView;
+};
+
+TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
{
v8::HandleScope handleScope;
v8::Context::Scope scope(context());
@@ -124,7 +140,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyStringValue)
checkKeyPathNullValue(scriptValue, "bar");
}
-TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
+TEST_F(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
{
v8::HandleScope handleScope;
v8::Context::Scope scope(context());
@@ -138,7 +154,7 @@ TEST(IDBKeyFromValueAndKeyPathTest, TopLevelPropertyNumberValue)
checkKeyPathNullValue(scriptValue, "bar");
}
-TEST(IDBKeyFromValueAndKeyPathTest, SubProperty)
+TEST_F(IDBKeyFromValueAndKeyPathTest, SubProperty)
{
v8::HandleScope handleScope;
v8::Context::Scope scope(context());
@@ -154,7 +170,10 @@ TEST(IDBKeyFromValueAndKeyPathTest, SubProperty)
checkKeyPathNullValue(scriptValue, "bar");
}
-TEST(InjectIDBKeyTest, TopLevelPropertyStringValue)
+class InjectIDBKeyTest : public IDBKeyFromValueAndKeyPathTest {
+};
+
+TEST_F(InjectIDBKeyTest, TopLevelPropertyStringValue)
{
v8::HandleScope handleScope;
v8::Context::Scope scope(context());
@@ -169,7 +188,7 @@ TEST(InjectIDBKeyTest, TopLevelPropertyStringValue)
checkInjectionFails(IDBKey::createString("key"), foozoo, "foo.bar");
}
-TEST(InjectIDBKeyTest, SubProperty)
+TEST_F(InjectIDBKeyTest, SubProperty)
{
v8::HandleScope handleScope;
v8::Context::Scope scope(context());
diff --git a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
index 1f1640841..4e37d3eaa 100644
--- a/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
+++ b/Source/WebKit/chromium/tests/IDBFakeBackingStore.h
@@ -43,23 +43,21 @@ public:
virtual bool createObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const String& name, const IDBKeyPath&, bool autoIncrement) OVERRIDE { return false; };
virtual void deleteObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
- virtual PassRefPtr<ObjectStoreRecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<ObjectStoreRecordIdentifier>(); }
+ virtual PassRefPtr<RecordIdentifier> createInvalidRecordIdentifier() OVERRIDE { return PassRefPtr<RecordIdentifier>(); }
- virtual String getObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
- virtual bool putObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
+ virtual String getRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&) OVERRIDE { return String(); }
+ virtual bool putRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, const String& value, RecordIdentifier*) OVERRIDE { return false; }
virtual void clearObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { }
- virtual void deleteObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const ObjectStoreRecordIdentifier*) OVERRIDE { }
+ virtual void deleteRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, const RecordIdentifier*) OVERRIDE { }
virtual int64_t getKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId) OVERRIDE { return 0; }
virtual bool maybeUpdateKeyGeneratorCurrentNumber(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t newNumber, bool checkCurrent) OVERRIDE { return false; }
- virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, ObjectStoreRecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
-
- virtual bool forEachObjectStoreRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, ObjectStoreRecordCallback&) OVERRIDE { return false; }
+ virtual bool keyExistsInObjectStore(Transaction*, int64_t databaseId, int64_t objectStoreId, const IDBKey&, RecordIdentifier* foundRecordIdentifier) OVERRIDE { return false; }
virtual Vector<IDBIndexMetadata> getIndexes(int64_t databaseId, int64_t objectStoreId) OVERRIDE { return Vector<IDBIndexMetadata>(); }
virtual bool createIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const String& name, const IDBKeyPath&, bool isUnique, bool isMultiEntry) OVERRIDE { return false; };
virtual void deleteIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId) OVERRIDE { }
- virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
- virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const ObjectStoreRecordIdentifier*) OVERRIDE { return false; }
+ virtual bool putIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&, const RecordIdentifier*) OVERRIDE { return false; }
+ virtual bool deleteIndexDataForRecord(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const RecordIdentifier*) OVERRIDE { return false; }
virtual PassRefPtr<IDBKey> getPrimaryKeyViaIndex(Transaction*, int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKey&) OVERRIDE { return PassRefPtr<IDBKey>(); }
virtual bool keyExistsInIndex(Transaction*, int64_t databaseid, int64_t objectStoreId, int64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey) OVERRIDE { return false; }
diff --git a/Source/WebKit/chromium/tests/LevelDBTest.cpp b/Source/WebKit/chromium/tests/LevelDBTest.cpp
index 2a00ae686..7dc0355df 100644
--- a/Source/WebKit/chromium/tests/LevelDBTest.cpp
+++ b/Source/WebKit/chromium/tests/LevelDBTest.cpp
@@ -30,7 +30,9 @@
#include "FileSystem.h"
#include "LevelDBComparator.h"
#include "LevelDBDatabase.h"
+#include "LevelDBIterator.h"
#include "LevelDBSlice.h"
+#include "LevelDBTransaction.h"
#include <gtest/gtest.h>
#include <webkit/support/webkit_support.h>
#include <wtf/Vector.h>
@@ -53,7 +55,7 @@ Vector<char> encodeString(const std::string& s)
{
Vector<char> ret(s.size());
for (size_t i = 0; i < s.size(); ++i)
- ret.append(s[i]);
+ ret[i] = s[i];
return ret;
}
@@ -100,6 +102,97 @@ TEST(LevelDBDatabaseTest, CorruptionTest)
EXPECT_FALSE(success);
}
+TEST(LevelDBDatabaseTest, Transaction)
+{
+ OwnPtr<webkit_support::ScopedTempDirectory> tempDirectory = adoptPtr(webkit_support::CreateScopedTempDirectory());
+ tempDirectory->CreateUniqueTempDir();
+ const String path = String::fromUTF8(tempDirectory->path().c_str());
+
+ const Vector<char> key = encodeString("key");
+ Vector<char> gotValue;
+ SimpleComparator comparator;
+
+ OwnPtr<LevelDBDatabase> leveldb = LevelDBDatabase::open(path, &comparator);
+ EXPECT_TRUE(leveldb);
+
+ const Vector<char> oldValue = encodeString("value");
+ bool success = leveldb->put(key, oldValue);
+ EXPECT_TRUE(success);
+
+ RefPtr<LevelDBTransaction> transaction = LevelDBTransaction::create(leveldb.get());
+
+ const Vector<char> newValue = encodeString("new value");
+ success = leveldb->put(key, newValue);
+ EXPECT_TRUE(success);
+
+ success = transaction->get(key, gotValue);
+ EXPECT_TRUE(success);
+ EXPECT_EQ(comparator.compare(gotValue, oldValue), 0);
+
+ success = leveldb->get(key, gotValue);
+ EXPECT_TRUE(success);
+ EXPECT_EQ(comparator.compare(gotValue, newValue), 0);
+
+ const Vector<char> addedKey = encodeString("added key");
+ const Vector<char> addedValue = encodeString("added value");
+ success = leveldb->put(addedKey, addedValue);
+ EXPECT_TRUE(success);
+
+ success = leveldb->get(addedKey, gotValue);
+ EXPECT_TRUE(success);
+ EXPECT_EQ(comparator.compare(gotValue, addedValue), 0);
+
+ success = transaction->get(addedKey, gotValue);
+ EXPECT_FALSE(success);
+}
+
+TEST(LevelDBDatabaseTest, TransactionIterator)
+{
+ OwnPtr<webkit_support::ScopedTempDirectory> tempDirectory = adoptPtr(webkit_support::CreateScopedTempDirectory());
+ tempDirectory->CreateUniqueTempDir();
+ const String path = String::fromUTF8(tempDirectory->path().c_str());
+
+ const Vector<char> start = encodeString("");
+ const Vector<char> key1 = encodeString("key1");
+ const Vector<char> value1 = encodeString("value1");
+ const Vector<char> key2 = encodeString("key2");
+ const Vector<char> value2 = encodeString("value2");
+
+ SimpleComparator comparator;
+ bool success;
+
+ OwnPtr<LevelDBDatabase> leveldb = LevelDBDatabase::open(path, &comparator);
+ EXPECT_TRUE(leveldb);
+
+ success = leveldb->put(key1, value1);
+ EXPECT_TRUE(success);
+ success = leveldb->put(key2, value2);
+ EXPECT_TRUE(success);
+
+ RefPtr<LevelDBTransaction> transaction = LevelDBTransaction::create(leveldb.get());
+
+ success = leveldb->remove(key2);
+ EXPECT_TRUE(success);
+
+ OwnPtr<LevelDBIterator> it = transaction->createIterator();
+
+ it->seek(start);
+
+ EXPECT_TRUE(it->isValid());
+ EXPECT_EQ(comparator.compare(it->key(), key1), 0);
+ EXPECT_EQ(comparator.compare(it->value(), value1), 0);
+
+ it->next();
+
+ EXPECT_TRUE(it->isValid());
+ EXPECT_EQ(comparator.compare(it->key(), key2), 0);
+ EXPECT_EQ(comparator.compare(it->value(), value2), 0);
+
+ it->next();
+
+ EXPECT_FALSE(it->isValid());
+}
+
} // namespace
#endif // USE(LEVELDB)
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index b2e8a8fd7..f6117da03 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-07 Emil A Eklund <eae@chromium.org>
+
+ Unreviewed EFL build fix.
+
+ * ewk/ewk_view.cpp:
+
2012-11-01 Seonae Kim <sunaeluv.kim@samsung.com>
[EFL][DRT] Support Geolocation
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index faa55c202..b7a84b1f9 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -48,7 +48,6 @@
#include "JSDOMBinding.h"
#include "JSDOMWindow.h"
#include "JSLock.h"
-#include "LayoutTypes.h"
#include "PageClientEfl.h"
#include "PageGroup.h"
#include "PlatformMouseEvent.h"
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 6ba1ac715..639d1029f 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,39 @@
+2012-11-08 Timothy Hatcher <timothy@apple.com>
+
+ Always use a textured window for the Web Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=101693
+
+ Reviewed by Joseph Pecoraro.
+
+ * WebCoreSupport/WebInspectorClient.mm:
+ (-[WebInspectorWindowController window]): Removed the conditional for a textured window.
+
+2012-11-08 Roger Fong <roger_fong@apple.com>
+
+ Null check URL key entries into WebHistory hash table.
+ https://bugs.webkit.org/show_bug.cgi?id=101664
+ <rdar://problem/12440852>
+
+ Reviewed by Brady Eidson.
+
+ Sometimes the _entriesByURL hash table used to keep track of web history is erroneously passed in null key entries, which causes an exception to fire.
+ This prevents the desired page navigation from taking effect. This is a workaround for the problem.
+ Ideally we would figure out where the null values for the key are coming from but for now we'll just set it to "" to prevent the exception from being thrown
+ so that navigation can continue as expected.
+
+ * History/WebHistory.mm:
+ (-[WebHistoryPrivate visitedURL:withTitle:increaseVisitCount:]):
+
+2012-11-07 Andreas Kling <akling@apple.com>
+
+ Remove build-webkit dependency on Java SDK for Apple Mac WebKit.
+ <http://webkit.org/b/101492>
+
+ Reviewed by Anders Carlsson.
+
+ * Plugins/WebJavaPlugIn.h: Removed.
+
2012-11-06 Adam Barth <abarth@webkit.org>
Unreviewed attempt to fix the chromium-mac build.
diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig
index 6ab4112ae..2eb267a03 100644
--- a/Source/WebKit/mac/Configurations/Version.xcconfig
+++ b/Source/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 537;
-MINOR_VERSION = 18;
+MINOR_VERSION = 19;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/Source/WebKit/mac/History/WebHistory.mm b/Source/WebKit/mac/History/WebHistory.mm
index e781d32fd..591cc04b0 100644
--- a/Source/WebKit/mac/History/WebHistory.mm
+++ b/Source/WebKit/mac/History/WebHistory.mm
@@ -296,6 +296,8 @@ static inline WebHistoryDateKey dateKey(NSTimeInterval date)
ASSERT(title);
NSString *URLString = [url _web_originalDataAsString];
+ if (!URLString)
+ URLString = @"";
WebHistoryItem *entry = [_entriesByURL objectForKey:URLString];
if (entry) {
diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
index f432cd51f..0b9041d73 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm
@@ -336,22 +336,13 @@ void WebInspectorFrontendClient::updateWindowTitle() const
if (window)
return window;
- bool useTexturedWindow = useWebKitWebInspector();
-
- NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask);
-
- if (useTexturedWindow)
- styleMask |= NSTexturedBackgroundWindowMask;
-
+ NSUInteger styleMask = (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask | NSTexturedBackgroundWindowMask);
window = [[NSWindow alloc] initWithContentRect:NSMakeRect(60.0, 200.0, 750.0, 650.0) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
[window setDelegate:self];
[window setMinSize:NSMakeSize(400.0, 400.0)];
-
- if (useTexturedWindow) {
- [window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
- [window setContentBorderThickness:55. forEdge:NSMaxYEdge];
- WKNSWindowMakeBottomCornersSquare(window);
- }
+ [window setAutorecalculatesContentBorderThickness:NO forEdge:NSMaxYEdge];
+ [window setContentBorderThickness:55. forEdge:NSMaxYEdge];
+ WKNSWindowMakeBottomCornersSquare(window);
[self setWindow:window];
[window release];
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index c2c9823f9..ade496fa4 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -253,6 +253,8 @@ static const char* editorCommandWebActions[] =
0, // CopyImageUrlToClipboard,
+ 0, // OpenLinkInThisWindow,
+
0 // WebActionCount
};
@@ -376,11 +378,6 @@ QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
QWebPagePrivate::~QWebPagePrivate()
{
- if (inspector && inspectorIsInternalOnly) {
- // Since we have to delete an internal inspector,
- // call setInspector(0) directly to prevent potential crashes
- setInspector(0);
- }
#ifndef QT_NO_CONTEXTMENU
delete currentContextMenu.data();
#endif
@@ -390,8 +387,13 @@ QWebPagePrivate::~QWebPagePrivate()
delete settings;
delete page;
- if (inspector)
- inspector->setPage(0);
+ if (inspector) {
+ // If the inspector is ours, delete it, otherwise just detach from it.
+ if (inspectorIsInternalOnly)
+ delete inspector;
+ else
+ inspector->setPage(0);
+ }
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
NotificationPresenterClientQt::notificationPresenter()->removeClient();
@@ -436,6 +438,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
switch (action) {
case WebCore::ContextMenuItemTagOpenLink: return QWebPage::OpenLink;
case WebCore::ContextMenuItemTagOpenLinkInNewWindow: return QWebPage::OpenLinkInNewWindow;
+ case WebCore::ContextMenuItemTagOpenLinkInThisWindow: return QWebPage::OpenLinkInThisWindow;
case WebCore::ContextMenuItemTagDownloadLinkToDisk: return QWebPage::DownloadLinkToDisk;
case WebCore::ContextMenuItemTagCopyLinkToClipboard: return QWebPage::CopyLinkToClipboard;
case WebCore::ContextMenuItemTagOpenImageInNewWindow: return QWebPage::OpenImageInNewWindow;
@@ -1463,13 +1466,6 @@ void QWebPagePrivate::setInspector(QWebInspector* insp)
if (inspector)
inspector->d->setFrontend(0);
- if (inspectorIsInternalOnly) {
- QWebInspector* inspToDelete = inspector;
- inspector = 0;
- inspectorIsInternalOnly = false;
- delete inspToDelete; // Delete after to prevent infinite recursion
- }
-
inspector = insp;
// Give inspector frontend web view if previously created
@@ -1693,6 +1689,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
\value NoWebAction No action is triggered.
\value OpenLink Open the current link.
\value OpenLinkInNewWindow Open the current link in a new window.
+ \value OpenLinkInThisWindow Open the current link without opening a new window. Used on links that would default to opening in another frame or a new window. (Added in Qt 5.0)
\value OpenFrameInNewWindow Replicate the current frame in a new window.
\value DownloadLinkToDisk Download the current link to the disk.
\value CopyLinkToClipboard Copy the current link to the clipboard.
@@ -2367,6 +2364,10 @@ void QWebPage::triggerAction(WebAction action, bool)
case OpenLinkInNewWindow:
openNewWindow(d->hitTestResult.linkUrl(), frame);
break;
+ case OpenLinkInThisWindow:
+ frame->loader()->loadFrameRequest(frameLoadRequest(d->hitTestResult.linkUrl(), frame),
+ /*lockHistory*/ false, /*lockBackForwardList*/ false, /*event*/ 0, /*FormState*/ 0, MaybeSendReferrer);
+ break;
case OpenFrameInNewWindow: {
KURL url = frame->loader()->documentLoader()->unreachableURL();
if (url.isEmpty())
@@ -2788,6 +2789,9 @@ QAction *QWebPage::action(WebAction action) const
case OpenFrameInNewWindow:
text = contextMenuItemTagOpenFrameInNewWindow();
break;
+ case OpenLinkInThisWindow:
+ text = contextMenuItemTagOpenLinkInThisWindow();
+ break;
case DownloadLinkToDisk:
text = contextMenuItemTagDownloadLinkToDisk();
diff --git a/Source/WebKit/qt/Api/qwebpage.h b/Source/WebKit/qt/Api/qwebpage.h
index 66f89609b..b2caa131d 100644
--- a/Source/WebKit/qt/Api/qwebpage.h
+++ b/Source/WebKit/qt/Api/qwebpage.h
@@ -180,6 +180,8 @@ public:
CopyImageUrlToClipboard,
+ OpenLinkInThisWindow,
+
WebActionCount
};
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 43b99b3d3..52fbc7231 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,48 @@
+2012-11-07 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] API test tst_qwebinspector crashes
+ https://bugs.webkit.org/show_bug.cgi?id=101599
+
+ Reviewed by Simon Hausmann.
+
+ Delete the internal inspector from QWebPage destructor, instead of causing recursions
+ between QWebPagePrivate::setInspector and QWebInspector::setPage.
+
+ Also separate the three tests in tst_QWebInspector to better tell which one is failing.
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::~QWebPagePrivate):
+ (QWebPagePrivate::setInspector):
+ * tests/qwebinspector/tst_qwebinspector.cpp:
+ (tst_QWebInspector):
+ (tst_QWebInspector::attachAndDestroyPageFirst):
+ (tst_QWebInspector::attachAndDestroyInspectorFirst):
+ (tst_QWebInspector::attachAndDestroyInternalInspector):
+
+2012-11-08 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Open link in this window action
+ https://bugs.webkit.org/show_bug.cgi?id=101226
+
+ Reviewed by Csaba Osztrogonác.
+
+ * Api/qwebpage.cpp: Fix after r133763, move the initialization of OpenLinkInThisWindow to the proper place.
+
+2012-11-07 Allan Sandfeld Jensen <allan.jensen@digia.com>
+
+ [Qt] Open link in this window action
+ https://bugs.webkit.org/show_bug.cgi?id=101226
+
+ Reviewed by Simon Hausmann.
+
+ Adds the action to QtWebKit.
+
+ * Api/qwebpage.cpp:
+ (webActionForContextMenuAction):
+ (QWebPage::triggerAction):
+ (QWebPage::action):
+ * Api/qwebpage.h:
+
2012-11-01 Stephen White <senorblanco@chromium.org>
Unreviewed, rolling out r133143.
diff --git a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
index 181fdac45..37e62f67b 100644
--- a/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
+++ b/Source/WebKit/qt/tests/qwebinspector/tst_qwebinspector.cpp
@@ -28,39 +28,46 @@ class tst_QWebInspector : public QObject {
Q_OBJECT
private Q_SLOTS:
- void attachAndDestroy();
+ void attachAndDestroyPageFirst();
+ void attachAndDestroyInspectorFirst();
+ void attachAndDestroyInternalInspector();
};
-void tst_QWebInspector::attachAndDestroy()
+void tst_QWebInspector::attachAndDestroyPageFirst()
{
- { // External inspector + manual destruction of page first
- QWebPage* page = new QWebPage();
- page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- QWebInspector* inspector = new QWebInspector();
- inspector->setPage(page);
- page->updatePositionDependentActions(QPoint(0, 0));
- page->triggerAction(QWebPage::InspectElement);
+ // External inspector + manual destruction of page first
+ QWebPage* page = new QWebPage();
+ page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebInspector* inspector = new QWebInspector();
+ inspector->setPage(page);
+ page->updatePositionDependentActions(QPoint(0, 0));
+ page->triggerAction(QWebPage::InspectElement);
- delete page;
- delete inspector;
- }
- { // External inspector + manual destruction of inspector first
- QWebPage* page = new QWebPage();
- page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- QWebInspector* inspector = new QWebInspector();
- inspector->setPage(page);
- page->updatePositionDependentActions(QPoint(0, 0));
- page->triggerAction(QWebPage::InspectElement);
+ delete page;
+ delete inspector;
+}
+
+void tst_QWebInspector::attachAndDestroyInspectorFirst()
+{
+ // External inspector + manual destruction of inspector first
+ QWebPage* page = new QWebPage();
+ page->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebInspector* inspector = new QWebInspector();
+ inspector->setPage(page);
+ page->updatePositionDependentActions(QPoint(0, 0));
+ page->triggerAction(QWebPage::InspectElement);
- delete inspector;
- delete page;
- }
- { // Internal inspector
- QWebPage page;
- page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- page.updatePositionDependentActions(QPoint(0, 0));
- page.triggerAction(QWebPage::InspectElement);
- }
+ delete inspector;
+ delete page;
+}
+
+void tst_QWebInspector::attachAndDestroyInternalInspector()
+{
+ // Internal inspector
+ QWebPage page;
+ page.settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ page.updatePositionDependentActions(QPoint(0, 0));
+ page.triggerAction(QWebPage::InspectElement);
}
QTEST_MAIN(tst_QWebInspector)