Reviewed by Dan Bernstein.
Reset the page scale factor on standard frame loads
https://bugs.webkit.org/show_bug.cgi?id=53058
<rdar://problem/
8908844>
Add a symbol needed by WebKit2.
* WebCore.exp.in:
2011-01-24 Anders Carlsson <andersca@apple.com>
Reviewed by Dan Bernstein.
Reset the page scale factor on standard frame loads
https://bugs.webkit.org/show_bug.cgi?id=53058
<rdar://problem/
8908844>
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::scaleWebView):
Don't set m_viewScaleFactor here. It will be set in viewScaleFactorDidChange.
(WebKit::WebPageProxy::viewScaleFactorDidChange):
Update m_viewScaleFactor.
* UIProcess/WebPageProxy.h:
Add viewScaleFactorDidChange.
* UIProcess/WebPageProxy.messages.in:
Add ViewScaleFactorDidChange message.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
Set the scale factor.
(WebKit::WebFrameLoaderClient::restoreViewState):
Inform the UI process about the new view scale factor.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scaleWebView):
Send a ViewScaleFactorDidChange message.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76561
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-01-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Reset the page scale factor on standard frame loads
+ https://bugs.webkit.org/show_bug.cgi?id=53058
+ <rdar://problem/8908844>
+
+ Add a symbol needed by WebKit2.
+
+ * WebCore.exp.in:
+
2011-01-24 Ryosuke Niwa <rniwa@webkit.org>
Reviewed by Eric Seidel.
__ZNK7WebCore11HistoryItem12redirectURLsEv
__ZNK7WebCore11HistoryItem14alternateTitleEv
__ZNK7WebCore11HistoryItem15lastVisitedTimeEv
+__ZNK7WebCore11HistoryItem15pageScaleFactorEv
__ZNK7WebCore11HistoryItem17originalURLStringEv
__ZNK7WebCore11HistoryItem20getTransientPropertyERKN3WTF6StringE
__ZNK7WebCore11HistoryItem21encodeBackForwardTreeERN3WTF7EncoderE
}
}
+- (BOOL)mouseDownCanMoveWindow
+{
+ BOOL result = [super mouseDownCanMoveWindow];
+
+ NSLog(@"%@, %@ %d", self, NSStringFromSelector(_cmd), result);
+ return result;
+}
+
- (void)_handleAutoscrollForMouseDragged:(NSEvent *)event
{
[self autoscroll:event];
+2011-01-24 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Reset the page scale factor on standard frame loads
+ https://bugs.webkit.org/show_bug.cgi?id=53058
+ <rdar://problem/8908844>
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::scaleWebView):
+ Don't set m_viewScaleFactor here. It will be set in viewScaleFactorDidChange.
+
+ (WebKit::WebPageProxy::viewScaleFactorDidChange):
+ Update m_viewScaleFactor.
+
+ * UIProcess/WebPageProxy.h:
+ Add viewScaleFactorDidChange.
+
+ * UIProcess/WebPageProxy.messages.in:
+ Add ViewScaleFactorDidChange message.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
+ Set the scale factor.
+
+ (WebKit::WebFrameLoaderClient::restoreViewState):
+ Inform the UI process about the new view scale factor.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::scaleWebView):
+ Send a ViewScaleFactorDidChange message.
+
2011-01-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Anders Carlsson.
if (!isValid())
return;
- m_viewScaleFactor = scale;
process()->send(Messages::WebPage::ScaleWebView(scale, origin), m_pageID);
}
process()->send(Messages::WebPage::SetFixedLayoutSize(size), m_pageID);
}
+void WebPageProxy::viewScaleFactorDidChange(double scaleFactor)
+{
+ m_viewScaleFactor = scaleFactor;
+}
+
void WebPageProxy::findString(const String& string, FindOptions options, unsigned maxMatchCount)
{
process()->send(Messages::WebPage::FindString(string, options, maxMatchCount), m_pageID);
void sendAccessibilityPresenterToken(const CoreIPC::DataReference&);
#endif
+ void viewScaleFactorDidChange(double);
+
// Find.
void findString(const String&, FindOptions, unsigned maxMatchCount);
void hideFindUI();
DidReceiveAccessibilityPageToken(CoreIPC::DataReference data)
+ ViewScaleFactorDidChange(double scaleFactor)
+
#if PLATFORM(MAC)
# Keyboard support messages
InterpretKeyEvent(uint32_t type) -> (Vector<WebCore::KeypressCommand> commandName, uint32_t selectionStart, uint32_t selectionEnd, Vector<WebCore::CompositionUnderline> underlines)
GetGuessesForWord(WTF::String word, WTF::String context) -> (Vector<WTF::String> guesses)
LearnWord(WTF::String word);
IgnoreWord(WTF::String word);
-
+
# Drag and drop messages
DidPerformDragControllerAction(uint64_t resultOperation)
#if PLATFORM(MAC)
#include <WebCore/FrameView.h>
#include <WebCore/HTMLAppletElement.h>
#include <WebCore/HTMLFormElement.h>
+#include <WebCore/HistoryItem.h>
#include <WebCore/MIMETypeRegistry.h>
#include <WebCore/MouseEvent.h>
#include <WebCore/Page.h>
webPage->sandboxExtensionTracker().didCommitProvisionalLoad(m_frame);
// Notify the UIProcess.
+
webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), response.mimeType(), m_frameHasCustomRepresentation, PlatformCertificateInfo(response), InjectedBundleUserMessageEncoder(userData.get())));
+
+ // Restore the page scale factor.
+ double newPageScaleFactor = m_frame->coreFrame()->pageScaleFactor();
+
+ // Only restore the scale factor for standard frame loads (of the main frame).
+ if (m_frame->isMainFrame() && m_frame->coreFrame()->loader()->loadType() == FrameLoadTypeStandard)
+ newPageScaleFactor = 1.0;
+
+ webPage->scaleWebView(newPageScaleFactor, IntPoint());
}
void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError& error)
void WebFrameLoaderClient::restoreViewState()
{
- notImplemented();
+ // Inform the UI process of the scale factor.
+ double scaleFactor = m_frame->coreFrame()->loader()->history()->currentItem()->pageScaleFactor();
+ m_frame->page()->send(Messages::WebPageProxy::ViewScaleFactorDidChange(scaleFactor));
}
void WebFrameLoaderClient::provisionalLoadStarted()
if (!frame)
return;
frame->scalePage(scale, origin);
+
+ send(Messages::WebPageProxy::ViewScaleFactorDidChange(scale));
}
double WebPage::viewScaleFactor() const