[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:08:12 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b0eb2ac51e9f4da8c40c4f33fb2122c20de6d9bc
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 25 22:02:03 2002 +0000
Changes for back/forward. Currently disabled.
* History.subproj/WebHistoryItem.h:
* History.subproj/WebHistoryItem.m:
(-[WebHistoryItem dealloc]):
(-[WebHistoryItem setPageCacheEnabled:]):
(-[WebHistoryItem pageCache]):
* Misc.subproj/WebKitLogging.h:
* Misc.subproj/WebKitLogging.m:
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge saveDocumentToPageCache:]):
* WebView.subproj/WebDataSource.m:
(-[WebDataSource startLoading]):
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _startLoading:]):
(-[WebDataSource _startLoading]):
(-[WebDataSource _commitIfReady:]):
(-[WebDataSource _commitIfReady]):
(-[WebDataSource _setStoredInPageCache:]):
(-[WebDataSource _storedInPageCache]):
* WebView.subproj/WebFramePrivate.h:
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _transitionToCommitted:]):
(-[WebFrame _canCachePage]):
(-[WebFrame _purgePageCache]):
(-[WebFrame _setState:]):
(-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]):
(-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
Changes for back/forward. Currently disabled.
* ForwardingHeaders/kjs/property_map.h: Added.
* khtml/ecma/kjs_window.cpp:
(Window::hasTimeouts):
(WindowQObject::hasTimeouts):
* khtml/ecma/kjs_window.h:
* khtml/khtmlpart_p.h:
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::detach):
(DocumentImpl::inPageCache):
(DocumentImpl::setInPageCache):
* khtml/xml/dom_docimpl.h:
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::setView):
(KWQKHTMLPart::userAgent):
(KWQKHTMLPart::nextKeyViewForWidget):
(KWQKHTMLPart::canCachePage):
(KWQKHTMLPart::saveWindowProperties):
(KWQKHTMLPart::saveLocationProperties):
(KWQKHTMLPart::restoreWindowProperties):
(KWQKHTMLPart::restoreLocationProperties):
(KWQKHTMLPart::openURLFromPageCache):
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
(-[WebCoreBridge saveDocumentToPageCache]):
(-[WebCoreBridge canCachePage]):
(attributedString):
(-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
(-[KWQPageState dealloc]):
(-[KWQPageState DOM::]):
(-[KWQPageState URL]):
(-[KWQPageState KJS::]):
Changes for back/forward. Currently disabled.
* kjs/property_map.cpp:
* kjs/property_map.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index b7d972a..db75b63 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,10 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward. Currently disabled.
+
+ * kjs/property_map.cpp:
+ * kjs/property_map.h:
+
2002-11-25 Darin Adler <darin at apple.com>
* kjs/property_map.cpp: Rearrange code a little bit and tweak indentation.
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index b7d972a..db75b63 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,3 +1,10 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward. Currently disabled.
+
+ * kjs/property_map.cpp:
+ * kjs/property_map.h:
+
2002-11-25 Darin Adler <darin at apple.com>
* kjs/property_map.cpp: Rearrange code a little bit and tweak indentation.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index b7d972a..db75b63 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,10 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward. Currently disabled.
+
+ * kjs/property_map.cpp:
+ * kjs/property_map.h:
+
2002-11-25 Darin Adler <darin at apple.com>
* kjs/property_map.cpp: Rearrange code a little bit and tweak indentation.
diff --git a/JavaScriptCore/kjs/property_map.cpp b/JavaScriptCore/kjs/property_map.cpp
index 288e36d..bed7711 100644
--- a/JavaScriptCore/kjs/property_map.cpp
+++ b/JavaScriptCore/kjs/property_map.cpp
@@ -68,6 +68,14 @@ public:
Value value;
};
+SavedProperties::SavedProperties() : _count(0), _properties(0) { }
+
+SavedProperties::~SavedProperties()
+{
+ if (_properties)
+ delete _properties;
+}
+
// Algorithm concepts from Algorithms in C++, Sedgewick.
PropertyMap::PropertyMap() : _table(0)
diff --git a/JavaScriptCore/kjs/property_map.h b/JavaScriptCore/kjs/property_map.h
index 7ed3cf0..9b1eaca 100644
--- a/JavaScriptCore/kjs/property_map.h
+++ b/JavaScriptCore/kjs/property_map.h
@@ -38,7 +38,7 @@ namespace KJS {
class SavedProperties {
friend class PropertyMap;
public:
- SavedProperties() : _count(0), _properties(0) { }
+ SavedProperties();
~SavedProperties();
private:
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 01f61ff..097f675 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,42 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward.
+
+ * ForwardingHeaders/kjs/property_map.h: Added.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::hasTimeouts):
+ (WindowQObject::hasTimeouts):
+ * khtml/ecma/kjs_window.h:
+ * khtml/khtmlpart_p.h:
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::detach):
+ (DocumentImpl::inPageCache):
+ (DocumentImpl::setInPageCache):
+ * khtml/xml/dom_docimpl.h:
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::setView):
+ (KWQKHTMLPart::userAgent):
+ (KWQKHTMLPart::nextKeyViewForWidget):
+ (KWQKHTMLPart::canCachePage):
+ (KWQKHTMLPart::saveWindowProperties):
+ (KWQKHTMLPart::saveLocationProperties):
+ (KWQKHTMLPart::restoreWindowProperties):
+ (KWQKHTMLPart::restoreLocationProperties):
+ (KWQKHTMLPart::openURLFromPageCache):
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
+ (-[WebCoreBridge saveDocumentToPageCache]):
+ (-[WebCoreBridge canCachePage]):
+ (attributedString):
+ (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+ (-[KWQPageState dealloc]):
+ (-[KWQPageState DOM::]):
+ (-[KWQPageState URL]):
+ (-[KWQPageState KJS::]):
+
2002-11-25 David Hyatt <hyatt at apple.com>
Fix for 3025963. Ensure that KJS looks for the form on the
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 01f61ff..097f675 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,42 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward.
+
+ * ForwardingHeaders/kjs/property_map.h: Added.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::hasTimeouts):
+ (WindowQObject::hasTimeouts):
+ * khtml/ecma/kjs_window.h:
+ * khtml/khtmlpart_p.h:
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::detach):
+ (DocumentImpl::inPageCache):
+ (DocumentImpl::setInPageCache):
+ * khtml/xml/dom_docimpl.h:
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::setView):
+ (KWQKHTMLPart::userAgent):
+ (KWQKHTMLPart::nextKeyViewForWidget):
+ (KWQKHTMLPart::canCachePage):
+ (KWQKHTMLPart::saveWindowProperties):
+ (KWQKHTMLPart::saveLocationProperties):
+ (KWQKHTMLPart::restoreWindowProperties):
+ (KWQKHTMLPart::restoreLocationProperties):
+ (KWQKHTMLPart::openURLFromPageCache):
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
+ (-[WebCoreBridge saveDocumentToPageCache]):
+ (-[WebCoreBridge canCachePage]):
+ (attributedString):
+ (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+ (-[KWQPageState dealloc]):
+ (-[KWQPageState DOM::]):
+ (-[KWQPageState URL]):
+ (-[KWQPageState KJS::]):
+
2002-11-25 David Hyatt <hyatt at apple.com>
Fix for 3025963. Ensure that KJS looks for the form on the
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 01f61ff..097f675 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,42 @@
+2002-11-25 Richard Williamson <rjw at apple.com>
+
+ Changes for back/forward.
+
+ * ForwardingHeaders/kjs/property_map.h: Added.
+ * khtml/ecma/kjs_window.cpp:
+ (Window::hasTimeouts):
+ (WindowQObject::hasTimeouts):
+ * khtml/ecma/kjs_window.h:
+ * khtml/khtmlpart_p.h:
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::detach):
+ (DocumentImpl::inPageCache):
+ (DocumentImpl::setInPageCache):
+ * khtml/xml/dom_docimpl.h:
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::setView):
+ (KWQKHTMLPart::userAgent):
+ (KWQKHTMLPart::nextKeyViewForWidget):
+ (KWQKHTMLPart::canCachePage):
+ (KWQKHTMLPart::saveWindowProperties):
+ (KWQKHTMLPart::saveLocationProperties):
+ (KWQKHTMLPart::restoreWindowProperties):
+ (KWQKHTMLPart::restoreLocationProperties):
+ (KWQKHTMLPart::openURLFromPageCache):
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge openURL:reload:headers:lastModified:pageCache:]):
+ (-[WebCoreBridge saveDocumentToPageCache]):
+ (-[WebCoreBridge canCachePage]):
+ (attributedString):
+ (-[KWQPageState initWithDocument:DOM::URL:windowProperties:KJS::locationProperties:KJS::]):
+ (-[KWQPageState dealloc]):
+ (-[KWQPageState DOM::]):
+ (-[KWQPageState URL]):
+ (-[KWQPageState KJS::]):
+
2002-11-25 David Hyatt <hyatt at apple.com>
Fix for 3025963. Ensure that KJS looks for the form on the
diff --git a/WebCore/ForwardingHeaders/kjs/property_map.h b/WebCore/ForwardingHeaders/kjs/property_map.h
new file mode 100644
index 0000000..204b7b3
--- /dev/null
+++ b/WebCore/ForwardingHeaders/kjs/property_map.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/property_map.h>
\ No newline at end of file
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index 8d31780..cbd1864 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -852,6 +852,13 @@ void Window::clearTimeout(int timerId)
winq->clearTimeout(timerId);
}
+#if APPLE_CHANGES
+bool Window::hasTimeouts()
+{
+ return winq->hasTimeouts();
+}
+#endif
+
void Window::scheduleClose()
{
kdDebug(6070) << "Window::scheduleClose window.close() " << m_part << endl;
@@ -1519,6 +1526,13 @@ void WindowQObject::timeoutClose()
}
}
+#if APPLE_CHANGES
+bool WindowQObject::hasTimeouts()
+{
+ return scheduledActions.count();
+}
+#endif
+
Value FrameArray::get(ExecState *exec, const Identifier &p) const
{
#ifdef KJS_VERBOSE
diff --git a/WebCore/khtml/ecma/kjs_window.h b/WebCore/khtml/ecma/kjs_window.h
index 027e3ce..31258bf 100644
--- a/WebCore/khtml/ecma/kjs_window.h
+++ b/WebCore/khtml/ecma/kjs_window.h
@@ -89,6 +89,9 @@ namespace KJS {
virtual bool toBoolean(ExecState *exec) const;
int installTimeout(const Identifier &handler, int t, bool singleShot);
void clearTimeout(int timerId);
+#ifdef APPLE_CHANGES
+ bool hasTimeouts();
+#endif
void scheduleClose();
bool isSafeScript(ExecState *exec) const;
Location *location() const;
@@ -155,6 +158,10 @@ namespace KJS {
int installTimeout(const Identifier &handler, int t, bool singleShot);
int installTimeout(const Value &func, List args, int t, bool singleShot);
void clearTimeout(int timerId, bool delAction = true);
+#ifdef APPLE_CHANGES
+ bool hasTimeouts();
+#endif
+
public slots:
void timeoutClose();
protected slots:
diff --git a/WebCore/khtml/khtmlpart_p.h b/WebCore/khtml/khtmlpart_p.h
index 243c2ae..f7b66d5 100644
--- a/WebCore/khtml/khtmlpart_p.h
+++ b/WebCore/khtml/khtmlpart_p.h
@@ -225,6 +225,8 @@ public:
// Made this static so frame names are globally unique and unsigned
// so overflow is handled more gracefully.
static unsigned m_frameNameId;
+ bool m_savingPageState:1;
+ bool m_restoringPageState:1;
#else
int m_frameNameId;
#endif
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 25ebc8d..7a2afc8 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -226,7 +226,7 @@ QPtrList<DocumentImpl> * DocumentImpl::changedDocuments = 0;
DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
: NodeBaseImpl( new DocumentPtr() )
#if APPLE_CHANGES
- , m_finishedParsing(this, SIGNAL(finishedParsing()))
+ , m_finishedParsing(this, SIGNAL(finishedParsing())), m_inPageCache(0)
#endif
{
document->doc = this;
@@ -1002,6 +1002,9 @@ void DocumentImpl::attach()
void DocumentImpl::detach()
{
+#if APPLE_CHANGES
+ if (!m_inPageCache){
+#endif
RenderObject* render = m_render;
// indicate destruction mode, i.e. attached() but m_render == 0
@@ -1016,6 +1019,9 @@ void DocumentImpl::detach()
delete m_renderArena;
m_renderArena = 0;
+#if APPLE_CHANGES
+ }
+#endif
}
void DocumentImpl::setVisuallyOrdered()
@@ -2202,4 +2208,16 @@ NodeImpl *DocumentTypeImpl::cloneNode ( bool /*deep*/ )
return 0;
}
+#if APPLE_CHANGES
+bool DocumentImpl::inPageCache()
+{
+ return m_inPageCache;
+}
+
+void DocumentImpl::setInPageCache(bool flag)
+{
+ m_inPageCache = flag;
+}
+#endif
+
#include "dom_docimpl.moc"
diff --git a/WebCore/khtml/xml/dom_docimpl.h b/WebCore/khtml/xml/dom_docimpl.h
index b9eaced..6858a34 100644
--- a/WebCore/khtml/xml/dom_docimpl.h
+++ b/WebCore/khtml/xml/dom_docimpl.h
@@ -412,6 +412,12 @@ public:
KWQSignal m_finishedParsing;
static Document createInstance (DocumentImpl *impl);
+
+ bool inPageCache();
+ void setInPageCache (bool flag);
+
+private:
+ bool m_inPageCache;
#endif
protected:
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 2cb3ac0..d86cce6 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -51,6 +51,10 @@ namespace khtml {
class RenderPart;
}
+namespace KJS {
+ class SavedProperties;
+}
+
#ifdef __OBJC__
@class NSView;
@class WebCoreBridge;
@@ -95,6 +99,13 @@ public:
void unfocusWindow();
+ bool canCachePage();
+ void saveWindowProperties(KJS::SavedProperties *windowProperties);
+ void saveLocationProperties(KJS::SavedProperties *locationProperties);
+ void restoreWindowProperties(KJS::SavedProperties *windowProperties);
+ void restoreLocationProperties(KJS::SavedProperties *locationProperties);
+ void openURLFromPageCache(DOM::DocumentImpl *doc, KURL *url, KJS::SavedProperties *windowProperties, KJS::SavedProperties *locationProperties);
+
void saveDocumentState();
void restoreDocumentState();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 3d55743..64dc1b7 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -32,6 +32,8 @@
#import "render_text.h"
#import "khtmlpart_p.h"
#import "khtmlview.h"
+#import "kjs_window.h"
+#import <kjs/property_map.h>
#import "WebCoreBridge.h"
#import "WebCoreBridgePrivate.h"
@@ -41,6 +43,8 @@
#import "KWQKJobClasses.h"
#import "KWQLogging.h"
+#import "xml/dom2_eventsimpl.h"
+
#undef _KWQ_TIMING
using khtml::Cache;
@@ -219,7 +223,7 @@ ReadOnlyPart *KWQKHTMLPart::createPart(const ChildFrame &child, const KURL &url,
void KWQKHTMLPart::setView(KHTMLView *view, bool weOwnIt)
{
- if (_ownsView) {
+ if (_ownsView && !d->m_doc->inPageCache()) {
delete d->m_view;
}
d->m_view = view;
@@ -330,7 +334,11 @@ RenderObject *KWQKHTMLPart::renderer()
QString KWQKHTMLPart::userAgent() const
{
- return QString::fromNSString([_bridge userAgentForURL:part->m_url.url().getNSString()]);
+ NSString *us = [_bridge userAgentForURL:part->m_url.url().getNSString()];
+
+ if (us)
+ return QString::fromNSString(us);
+ return QString();
}
NSView *KWQKHTMLPart::nextKeyViewInFrame(NodeImpl *node, KWQSelectionDirection direction)
@@ -414,6 +422,118 @@ NSView *KWQKHTMLPart::nextKeyViewForWidget(QWidget *startingWidget, KWQSelection
return partForNode(node)->nextKeyView(node, direction);
}
+bool KWQKHTMLPart::canCachePage()
+{
+ // Only save page state if:
+ // 1. We're not a frame or frameset.
+ // 2. The page has no javascript timers.
+ // 3. The page has no unload handler.
+ // 4. The page has no plugins.
+ if (d->m_doc &&
+ (d->m_frames.count() ||
+ part->parentPart() ||
+ d->m_objects.count() ||
+ d->m_doc->getWindowEventListener (DOM::EventImpl::UNLOAD_EVENT) ||
+ (d->m_jscript && KJS::Window::retrieveWindow(part)->hasTimeouts()))){
+ printf ("Not saving page state for %s\n", part->m_url.url().latin1());
+ return false;
+ }
+ return true;
+}
+
+void KWQKHTMLPart::saveWindowProperties(KJS::SavedProperties *windowProperties)
+{
+ KJS::Window::retrieveWindow(part)->saveProperties(*windowProperties);
+}
+
+void KWQKHTMLPart::saveLocationProperties(KJS::SavedProperties *locationProperties)
+{
+ KJS::Window::retrieveWindow(part)->location()->saveProperties(*locationProperties);
+}
+
+void KWQKHTMLPart::restoreWindowProperties(KJS::SavedProperties *windowProperties)
+{
+ KJS::Window::retrieveWindow(part)->restoreProperties(*windowProperties);
+}
+
+void KWQKHTMLPart::restoreLocationProperties(KJS::SavedProperties *locationProperties)
+{
+ KJS::Window::retrieveWindow(part)->location()->restoreProperties(*locationProperties);
+}
+
+void KWQKHTMLPart::openURLFromPageCache(DOM::DocumentImpl *doc, KURL *url, KJS::SavedProperties *windowProperties, KJS::SavedProperties *locationProperties)
+{
+ printf ("KWQKHTMLPart::openURLFromPageCache\n");
+
+ d->m_redirectionTimer.stop();
+
+ // We still have to close the previous part page.
+ if (!d->m_restored){
+ part->closeURL();
+ }
+
+ d->m_bComplete = false;
+
+ // Don't re-emit the load event.
+ d->m_bLoadEventEmitted = true;
+
+ // delete old status bar msg's from kjs (if it _was_ activated on last URL)
+ if( d->m_bJScriptEnabled )
+ {
+ d->m_kjsStatusBarText = QString::null;
+ d->m_kjsDefaultStatusBarText = QString::null;
+ }
+
+ part->m_url = *url;
+
+ // set the javascript flags according to the current url
+ d->m_bJScriptEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptEnabled(part->m_url.host());
+ d->m_bJScriptDebugEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaScriptDebugEnabled();
+ d->m_bJavaEnabled = KHTMLFactory::defaultHTMLSettings()->isJavaEnabled(part->m_url.host());
+ d->m_bPluginsEnabled = KHTMLFactory::defaultHTMLSettings()->isPluginsEnabled(part->m_url.host());
+
+ // initializing m_url to the new url breaks relative links when opening such a link after this call and _before_ begin() is called (when the first
+ // data arrives) (Simon)
+ if(part->m_url.protocol().startsWith( "http" ) && !part->m_url.host().isEmpty() && part->m_url.path().isEmpty()) {
+ part->m_url.setPath("/");
+ emit d->m_extension->setLocationBarURL( part->m_url.prettyURL() );
+ }
+
+ // copy to m_workingURL after fixing m_url above
+ d->m_workingURL = part->m_url;
+
+ emit part->started( 0L );
+
+ // -----------begin-----------
+ part->clear();
+
+ d->m_bCleared = false;
+ d->m_cacheId = 0;
+ d->m_bComplete = false;
+ d->m_bLoadEventEmitted = false;
+
+ d->m_referrer = part->m_url.url();
+ part->m_url = *url;
+ KURL baseurl;
+
+ // We don't need KDE chained URI handling or window caption setting
+ if ( !part->m_url.isEmpty() ){
+ baseurl = part->m_url;
+ }
+
+ d->m_doc = doc;
+ d->m_doc->ref();
+
+ setView (doc->view(), true);
+
+ updatePolicyBaseURL();
+
+ d->m_doc->setParsing(true);
+
+ restoreWindowProperties (windowProperties);
+ restoreLocationProperties (locationProperties);
+}
+
WebCoreBridge *KWQKHTMLPart::bridgeForWidget(QWidget *widget)
{
return partForNode(nodeForWidget(widget))->bridge();
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 889b42d..dc48225 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -97,12 +97,16 @@ enum FrameBorderStyle {
- (void)setParent:(WebCoreBridge *)parent;
-- (void)openURL:(NSString *)URL reload:(BOOL)reload headers:(NSDictionary *)headers lastModified:(NSDate *)lastModified;
+- (void)openURL:(NSString *)URL reload:(BOOL)reload headers:(NSDictionary *)headers lastModified:(NSDate *)lastModified pageCache: (NSDictionary *)pageCache;
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding;
- (void)addData:(NSData *)data withOverrideEncoding:(NSString *)encoding;
- (void)closeURL;
- (void)saveDocumentState;
- (void)restoreDocumentState;
+
+- (BOOL)canCachePage;
+- (BOOL)saveDocumentToPageCache;
+
- (void)end;
- (NSString *)URL;
@@ -234,6 +238,8 @@ enum FrameBorderStyle {
- (NSView *)viewForPluginWithURL:(NSString *)URL attributes:(NSArray *)attributesArray baseURL:(NSString *)baseURL MIMEType:(NSString *)MIMEType;
- (NSView *)viewForJavaAppletWithFrame:(NSRect)frame attributes:(NSDictionary *)attributes baseURL:(NSString *)baseURL;
+- (BOOL)saveDocumentToPageCache: documentInfo;
+
@end
// This interface definition allows those who hold a WebCoreBridge * to call all the methods
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 0c3f818..d2de55e 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -52,6 +52,8 @@
#import "WebCoreDOMPrivate.h"
+#import <kjs/property_map.h>
+
using KParts::URLArgs;
using DOM::DocumentImpl;
@@ -61,6 +63,8 @@ using khtml::RenderImage;
using khtml::RenderObject;
using khtml::RenderPart;
+using KJS::SavedProperties;
+
NSString *WebCoreElementFrameKey = @"WebElementFrame";
NSString *WebCoreElementImageAltStringKey = @"WebElementImageAltString";
NSString *WebCoreElementImageKey = @"WebElementImage";
@@ -73,6 +77,20 @@ NSString *WebCoreElementLinkTitleKey = @"WebElementLinkTitle";
NSString *WebCoreElementNameKey = @"WebElementName";
NSString *WebCoreElementStringKey = @"WebElementString";
+ at interface KWQPageState : NSObject
+{
+ DOM::DocumentImpl *document;
+ KURL *URL;
+ KJS::SavedProperties *windowProperties;
+ KJS::SavedProperties *locationProperties;
+}
+- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp;
+- (DOM::DocumentImpl *)document;
+- (KURL *)URL;
+- (KJS::SavedProperties *)windowProperties;
+- (KJS::SavedProperties *)locationProperties;
+ at end
+
@implementation WebCoreBridge
- init
@@ -122,7 +140,7 @@ NSString *WebCoreElementStringKey = @"WebElementString";
_part->setParent([parent part]);
}
-- (void)openURL:(NSString *)URL reload:(BOOL)reload headers:(NSDictionary *)headers lastModified:(NSDate *)lastModified
+- (void)openURL:(NSString *)URL reload:(BOOL)reload headers:(NSDictionary *)headers lastModified:(NSDate *)lastModified pageCache: (NSDictionary *)pageCache
{
URLArgs args(_part->browserExtension()->urlArgs());
@@ -138,7 +156,12 @@ NSString *WebCoreElementStringKey = @"WebElementString";
_part->browserExtension()->setURLArgs(args);
// URL
- _part->openURL([URL cString]);
+ if (pageCache){
+ KWQPageState *state = [pageCache objectForKey: @"WebCorePageState"];
+ _part->kwq->openURLFromPageCache([state document], [state URL], [state windowProperties], [state locationProperties]);
+ }
+ else
+ _part->openURL([URL cString]);
// Refresh
NSString *refreshHeader = [headers objectForKey:@"Refresh"];
@@ -199,6 +222,26 @@ NSString *WebCoreElementStringKey = @"WebElementString";
}
}
+- (BOOL)saveDocumentToPageCache
+{
+ DocumentImpl *doc = _part->kwq->document();
+ if (doc != 0){
+ KJS::SavedProperties *windowProperties = new KJS::SavedProperties();
+ KJS::SavedProperties *locationProperties = new KJS::SavedProperties();
+
+ _part->kwq->saveWindowProperties(windowProperties);
+ _part->kwq->saveLocationProperties(locationProperties);
+ KWQPageState *pageState = [[[KWQPageState alloc] initWithDocument: doc URL:_part->m_url windowProperties:windowProperties locationProperties:locationProperties] autorelease];
+ return [self saveDocumentToPageCache: pageState];
+ }
+ return false;
+}
+
+- (BOOL)canCachePage
+{
+ return _part->kwq->canCachePage();
+}
+
- (void)end
{
_part->end();
@@ -607,8 +650,8 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
{
bool hasNewLine = true;
bool hasParagraphBreak = true;
-DOM::Node n = _startNode;
-khtml::RenderObject *renderer;
+ DOM::Node n = _startNode;
+ khtml::RenderObject *renderer;
NSFont *font;
NSMutableAttributedString *result = [[[NSMutableAttributedString alloc] init] autorelease];
NSAttributedString *partialString;
@@ -842,3 +885,53 @@ DOM::Node next = n.firstChild();
}
@end
+
+ at implementation KWQPageState
+- initWithDocument: (DOM::DocumentImpl *)doc URL: (KURL)u windowProperties: (KJS::SavedProperties *)wp locationProperties: (KJS::SavedProperties *)lp
+{
+ [super init];
+ doc->ref();
+ document = doc;
+ document->setInPageCache(YES);
+ URL = new KURL(u);
+ windowProperties = wp;
+ locationProperties =lp;
+ return self;
+
+}
+
+- (void)dealloc
+{
+ document->setInPageCache(NO);
+ document->deref();
+ document = 0;
+ delete URL;
+ URL = 0;
+ delete windowProperties;
+ delete locationProperties;
+ [super dealloc];
+}
+
+- (DOM::DocumentImpl *)document
+{
+ return document;
+}
+
+- (KURL *)URL
+{
+ return URL;
+}
+
+- (KJS::SavedProperties *)windowProperties
+{
+ return windowProperties;
+}
+
+- (KJS::SavedProperties *)locationProperties
+{
+ return locationProperties;
+}
+
+
+ at end
+
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 5eb423f..c3901bf 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,37 @@
2002-11-25 Richard Williamson <rjw at apple.com>
+ Changes for back/forward. Currently disabled.
+
+ * History.subproj/WebHistoryItem.h:
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem dealloc]):
+ (-[WebHistoryItem setPageCacheEnabled:]):
+ (-[WebHistoryItem pageCache]):
+ * Misc.subproj/WebKitLogging.h:
+ * Misc.subproj/WebKitLogging.m:
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge saveDocumentToPageCache:]):
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource startLoading]):
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _startLoading:]):
+ (-[WebDataSource _startLoading]):
+ (-[WebDataSource _commitIfReady:]):
+ (-[WebDataSource _commitIfReady]):
+ (-[WebDataSource _setStoredInPageCache:]):
+ (-[WebDataSource _storedInPageCache]):
+ * WebView.subproj/WebFramePrivate.h:
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _transitionToCommitted:]):
+ (-[WebFrame _canCachePage]):
+ (-[WebFrame _purgePageCache]):
+ (-[WebFrame _setState:]):
+ (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]):
+ (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
+
+2002-11-25 Richard Williamson <rjw at apple.com>
+
Fixed exception thrown often when creating mouseover status text (3110186).
* WebView.subproj/WebHTMLViewPrivate.m:
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 5eb423f..c3901bf 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,5 +1,37 @@
2002-11-25 Richard Williamson <rjw at apple.com>
+ Changes for back/forward. Currently disabled.
+
+ * History.subproj/WebHistoryItem.h:
+ * History.subproj/WebHistoryItem.m:
+ (-[WebHistoryItem dealloc]):
+ (-[WebHistoryItem setPageCacheEnabled:]):
+ (-[WebHistoryItem pageCache]):
+ * Misc.subproj/WebKitLogging.h:
+ * Misc.subproj/WebKitLogging.m:
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge saveDocumentToPageCache:]):
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource startLoading]):
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _startLoading:]):
+ (-[WebDataSource _startLoading]):
+ (-[WebDataSource _commitIfReady:]):
+ (-[WebDataSource _commitIfReady]):
+ (-[WebDataSource _setStoredInPageCache:]):
+ (-[WebDataSource _storedInPageCache]):
+ * WebView.subproj/WebFramePrivate.h:
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _transitionToCommitted:]):
+ (-[WebFrame _canCachePage]):
+ (-[WebFrame _purgePageCache]):
+ (-[WebFrame _setState:]):
+ (-[WebFrame _continueFragmentScrollAfterNavigationPolicy:request:]):
+ (-[WebFrame _continueLoadRequestAfterNavigationPolicy:request:]):
+
+2002-11-25 Richard Williamson <rjw at apple.com>
+
Fixed exception thrown often when creating mouseover status text (3110186).
* WebView.subproj/WebHTMLViewPrivate.m:
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 28d056e..eb60d7a 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -532,7 +532,7 @@ static const char * const stateNames[] = {
- (BOOL)_canCachePage
{
- return YES;
+ return NO;
}
- (void)_purgePageCache
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list