Commit 5206a368 authored by darin@apple.com's avatar darin@apple.com

Reviewed by Sam.

        - <rdar://4516170> Back/Forward Cache on Windows

        * WebFrame.cpp:
        (WebFrame::forceLayout): Implemented this. Just calling through to
        Frame::forceLayout matches the Mac pretty well and should be enough
        for now. Without this we won't repaint the new page when we go back
        and forward.
        (WebFrame::dispatchWillSubmitForm): Use COMPtr's AdoptCOM constructor
        instead of the adoptRef function.
        (WebFrame::restoreViewState): Removed unneeded notImplemented() call.
        This is implemented as much as it needs to be.
        (WebFrame::shouldGoToHistoryItem): Ditto.
        (WebFrame::saveViewStateToItem): Ditto.
        (WebFrame::canCachePage): Ditto, also changed it to return true. This
        is what was preventing the back/forward cache from running, and there's
        no need for any additional checks in the Windows version.

        * WebView.cpp:
        (PreferencesChangedOrRemovedObserver::onNotify): Fix backwards null check
        that was preventing this notification from ever being sent, which in turn
        meant that page cache had a capacity of 0.
        (WebView::initWithFrame): Removed unneeded setUsesPageCache(false) code.
        This actually was ineffective and ended up doing no harm, but we don't
        need it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bf0db22f
2007-12-17 Darin Adler <darin@apple.com>
Reviewed by Sam.
- <rdar://4516170> Back/Forward Cache on Windows
* WebFrame.cpp:
(WebFrame::forceLayout): Implemented this. Just calling through to
Frame::forceLayout matches the Mac pretty well and should be enough
for now. Without this we won't repaint the new page when we go back
and forward.
(WebFrame::dispatchWillSubmitForm): Use COMPtr's AdoptCOM constructor
instead of the adoptRef function.
(WebFrame::restoreViewState): Removed unneeded notImplemented() call.
This is implemented as much as it needs to be.
(WebFrame::shouldGoToHistoryItem): Ditto.
(WebFrame::saveViewStateToItem): Ditto.
(WebFrame::canCachePage): Ditto, also changed it to return true. This
is what was preventing the back/forward cache from running, and there's
no need for any additional checks in the Windows version.
* WebView.cpp:
(PreferencesChangedOrRemovedObserver::onNotify): Fix backwards null check
that was preventing this notification from ever being sent, which in turn
meant that page cache had a capacity of 0.
(WebView::initWithFrame): Removed unneeded setUsesPageCache(false) code.
This actually was ineffective and ended up doing no harm, but we don't
need it.
2007-12-16 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin.
......
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -1501,7 +1501,7 @@ void WebFrame::makeRepresentation(DocumentLoader*)
void WebFrame::forceLayout()
{
notImplemented();
core(this)->forceLayout(true);
}
void WebFrame::forceLayoutForNonHTML()
......@@ -1646,8 +1646,7 @@ void WebFrame::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<F
return;
}
COMPtr<IDOMElement> formElement;
formElement.adoptRef(DOMElement::createInstance(formState->form()));
COMPtr<IDOMElement> formElement(AdoptCOM, DOMElement::createInstance(formState->form()));
// FIXME: The FormValuesPropertyBag constructor should take a const pointer
FormValuesPropertyBag formValuesPropBag(const_cast<HashMap<String, String>*>(&formState->values()));
......@@ -1771,8 +1770,6 @@ void WebFrame::frameLoadCompleted()
void WebFrame::restoreViewState()
{
// FIXME: Need to restore view state for page caching
notImplemented();
}
void WebFrame::provisionalLoadStarted()
......@@ -1891,20 +1888,16 @@ void WebFrame::updateGlobalHistoryForReload(const KURL& url)
bool WebFrame::shouldGoToHistoryItem(HistoryItem*) const
{
notImplemented();
return true;
}
void WebFrame::saveViewStateToItem(HistoryItem*)
{
// FIXME: Need to save view state for page caching
notImplemented();
}
bool WebFrame::canCachePage() const
{
notImplemented();
return false;
return true;
}
PassRefPtr<DocumentLoader> WebFrame::createDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
......
......@@ -150,7 +150,7 @@ HRESULT PreferencesChangedOrRemovedObserver::onNotify(IWebNotification* notifica
return hr;
COMPtr<IWebPreferences> preferences(Query, unkPrefs);
if (preferences)
if (!preferences)
return E_NOINTERFACE;
WebCacheModel cacheModel;
......@@ -2033,9 +2033,6 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame(
WebKitSetWebDatabasesPathIfNecessary();
m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this));
// FIXME: 4931464 - When we do cache pages on Windows this needs to be removed so the "should I cache this page?" check
// in FrameLoader::provisionalLoadStarted() doesn't always fail
m_page->settings()->setUsesPageCache(false);
if (m_uiDelegate) {
COMPtr<IWebUIDelegate2> uiDelegate2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment