summaryrefslogtreecommitdiff
path: root/Source/WebKit/blackberry/Api/WebPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/blackberry/Api/WebPage.cpp')
-rw-r--r--Source/WebKit/blackberry/Api/WebPage.cpp70
1 files changed, 14 insertions, 56 deletions
diff --git a/Source/WebKit/blackberry/Api/WebPage.cpp b/Source/WebKit/blackberry/Api/WebPage.cpp
index e318003b4..97b56a7b2 100644
--- a/Source/WebKit/blackberry/Api/WebPage.cpp
+++ b/Source/WebKit/blackberry/Api/WebPage.cpp
@@ -337,6 +337,7 @@ WebPagePrivate::WebPagePrivate(WebPage* webPage, WebPageClient* client, const In
, m_visible(false)
, m_activationState(ActivationActive)
, m_shouldResetTilesWhenShown(false)
+ , m_shouldZoomToInitialScaleAfterLoadFinished(false)
, m_userScalable(true)
, m_userPerformedManualZoom(false)
, m_userPerformedManualScroll(false)
@@ -881,9 +882,8 @@ bool WebPage::executeJavaScriptFunction(const std::vector<std::string> &function
JSObjectRef functionObject = obj;
JSValueRef result = 0;
- JSValueRef exception;
if (functionObject && thisObject)
- result = JSObjectCallAsFunction(ctx, functionObject, thisObject, args.size(), argListRef.data(), &exception);
+ result = JSObjectCallAsFunction(ctx, functionObject, thisObject, args.size(), argListRef.data(), 0);
for (unsigned i = 0; i < args.size(); ++i)
JSStringRelease(argList[i]);
@@ -892,11 +892,6 @@ bool WebPage::executeJavaScriptFunction(const std::vector<std::string> &function
if (!value) {
returnType = JSException;
- JSStringRef stringRef = JSValueToStringCopy(ctx, exception, 0);
- size_t bufferSize = JSStringGetMaximumUTF8CStringSize(stringRef);
- WTF::Vector<char> buffer(bufferSize);
- JSStringGetUTF8CString(stringRef, buffer.data(), bufferSize);
- returnValue = WebString::fromUtf8(buffer.data());
return false;
}
@@ -1060,6 +1055,7 @@ void WebPagePrivate::setLoadState(LoadState state)
m_backingStore->d->resetRenderQueue();
m_backingStore->d->resetTiles(true /* resetBackground */);
m_backingStore->d->setScrollingOrZooming(false, false /* shouldBlit */);
+ m_shouldZoomToInitialScaleAfterLoadFinished = false;
m_userPerformedManualZoom = false;
m_userPerformedManualScroll = false;
m_shouldUseFixedDesktopMode = false;
@@ -1084,14 +1080,13 @@ void WebPagePrivate::setLoadState(LoadState state)
frameLoadType = m_mainFrame->loader()->loadType();
if (!((m_didRestoreFromPageCache && documentHasViewportArguments) || (frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin))) {
m_viewportArguments = ViewportArguments();
+ m_userScalable = m_webSettings->isUserScalable();
+ resetScales();
// At the moment we commit a new load, set the viewport arguments
// to any fallback values. If there is a meta viewport in the
// content it will overwrite the fallback arguments soon.
dispatchViewportPropertiesDidChange(m_userViewportArguments);
-
- m_userScalable = m_webSettings->isUserScalable();
- resetScales();
} else {
IntSize virtualViewport = recomputeVirtualViewportFromViewportArguments();
m_webPage->setVirtualViewportSize(virtualViewport.width(), virtualViewport.height());
@@ -1706,9 +1701,10 @@ void WebPagePrivate::layoutFinished()
m_nestedLayoutFinishedCount++;
- if (shouldZoomToInitialScaleOnLoad())
+ if (shouldZoomToInitialScaleOnLoad()) {
zoomToInitialScaleOnLoad();
- else if (loadState() != None)
+ m_shouldZoomToInitialScaleAfterLoadFinished = false;
+ } else if (loadState() != None)
notifyTransformedContentsSizeChanged();
m_nestedLayoutFinishedCount--;
@@ -1743,19 +1739,6 @@ void WebPagePrivate::layoutFinished()
}
}
-bool WebPagePrivate::shouldZoomToInitialScaleOnLoad() const
-{
- // For FrameLoadTypeSame or FrameLoadTypeStandard load, the layout timer can be fired which can call dispatchDidFirstVisuallyNonEmptyLayout()
- // after the load Finished state, in which case the web page will have no chance to zoom to initial scale. So we should give it a chance,
- // otherwise the scale of the web page can be incorrect.
- FrameLoadType frameLoadType = FrameLoadTypeStandard;
- if (m_mainFrame && m_mainFrame->loader())
- frameLoadType = m_mainFrame->loader()->loadType();
- if (m_loadState == Committed || (m_loadState == Finished && (frameLoadType == FrameLoadTypeSame || frameLoadType == FrameLoadTypeStandard)))
- return true;
- return false;
-}
-
void WebPagePrivate::zoomToInitialScaleOnLoad()
{
#if DEBUG_WEBPAGE_LOAD
@@ -2344,6 +2327,11 @@ PageClientBlackBerry::SaveCredentialType WebPagePrivate::notifyShouldSaveCredent
return static_cast<PageClientBlackBerry::SaveCredentialType>(m_client->notifyShouldSaveCredential(isNew));
}
+void WebPagePrivate::syncProxyCredential(const WebCore::Credential& credential)
+{
+ m_client->syncProxyCredential(credential.user().utf8().data(), credential.password().utf8().data());
+}
+
void WebPagePrivate::notifyPopupAutofillDialog(const Vector<String>& candidates, const WebCore::IntRect& screenRect)
{
vector<string> textItems;
@@ -4125,37 +4113,7 @@ bool WebPagePrivate::handleWheelEvent(PlatformWheelEvent& wheelEvent)
bool WebPage::touchEvent(const Platform::TouchEvent& event)
{
#if DEBUG_TOUCH_EVENTS
- switch (event.m_type) {
- case Platform::TouchEvent::TouchEnd:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent Touch End");
- break;
- case Platform::TouchEvent::TouchStart:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent Touch Start");
- break;
- case Platform::TouchEvent::TouchMove:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent Touch Move");
- break;
- case Platform::TouchEvent::TouchCancel:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchCancel Touch Cancel");
- break;
- }
-
- for (unsigned i = 0; i < event.m_points.size(); i++) {
- switch (event.m_points[i].m_state) {
- case Platform::TouchPoint::TouchPressed:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent %d Touch Pressed (%d, %d)", event.m_points[i].m_id, event.m_points[i].m_pos.x(), event.m_points[i].m_pos.y());
- break;
- case Platform::TouchPoint::TouchReleased:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent %d Touch Released (%d, %d)", event.m_points[i].m_id, event.m_points[i].m_pos.x(), event.m_points[i].m_pos.y());
- break;
- case Platform::TouchPoint::TouchMoved:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent %d Touch Moved (%d, %d)", event.m_points[i].m_id, event.m_points[i].m_pos.x(), event.m_points[i].m_pos.y());
- break;
- case Platform::TouchPoint::TouchStationary:
- Platform::log(Platform::LogLevelCritical, "WebPage::touchEvent %d Touch Stationary (%d, %d)", event.m_points[i].m_id, event.m_points[i].m_pos.x(), event.m_points[i].m_pos.y());
- break;
- }
- }
+ BBLOG(LogLevelCritical, "%s", event.toString().c_str());
#endif
#if ENABLE(TOUCH_EVENTS)