Commit aa70db1b authored by darin's avatar darin

WebCore:

	- fixed 3083982 -- Logging into AOL gives null view

	Turns out AOL was using a refresh header, which we were not supporting.

        * khtml/khtml_part.h: Declare receivedFirstData, a private member function.
        * khtml/khtml_part.cpp:
        (KHTMLPart::receivedFirstData): Separate out the part of slotData we
	want to share, which really seems kinda separate anyway.
        (KHTMLPart::slotData): More of the same.

        * kwq/KWQKHTMLPart.h: Declare addMetaData.
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::slotData): Call receivedFirstData instead of doing the same
	thing ourselves.
        (KWQKHTMLPart::addMetaData): Added. Puts metadata into the job.

        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow): Fix bug where this was calling
	openURL: but meant to call loadURL:.

        * kwq/WebCoreBridge.h: Add headers to openURL method. Remove setContentType.
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge openURL:withHeaders:]): Handle Content-Type and Refresh.
	This method is big enough that I should probably move the guts to KWQKHTMLPart.

	- other things

        * kwq/KWQListImpl.mm: (KWQListImpl::~KWQListImpl): I overlooked something
	while doing my "bug fix" in here a while back. Change an assignment statement
	to an assert.

WebKit:

	- fixed 3083982 -- Logging into AOL gives null view

	Turns out AOL was using a refresh header, which we were not supporting.

        * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]):
	Call openURL: and pass headers in.

        * WebView.subproj/WebFramePrivate.m:
        (-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:isFormSubmission:]):
	Pass nil for headers in this case, since we know it's just an anchor change.

	- other things

        * WebCoreSupport.subproj/WebBridge.h: Remove dataSourceChanged and dataSource
	methods. We try to keep the bridge methods down to actual bridging.
        * WebCoreSupport.subproj/WebBridge.m: Remove dataSourceChanged altogether,
	and move dataSource up in the file.

        * WebView.subproj/WebHTMLRepresentation.m:
        (-[WebHTMLRepresentation setDataSource:]): Keep the data source around, so we
	don't need to ask the bridge for it.
        (-[WebHTMLRepresentation documentSource]): Use it here.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c6ead7fe
2002-11-13 Darin Adler <darin@apple.com>
- fixed 3083982 -- Logging into AOL gives null view
Turns out AOL was using a refresh header, which we were not supporting.
* khtml/khtml_part.h: Declare receivedFirstData, a private member function.
* khtml/khtml_part.cpp:
(KHTMLPart::receivedFirstData): Separate out the part of slotData we
want to share, which really seems kinda separate anyway.
(KHTMLPart::slotData): More of the same.
* kwq/KWQKHTMLPart.h: Declare addMetaData.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::slotData): Call receivedFirstData instead of doing the same
thing ourselves.
(KWQKHTMLPart::addMetaData): Added. Puts metadata into the job.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Fix bug where this was calling
openURL: but meant to call loadURL:.
* kwq/WebCoreBridge.h: Add headers to openURL method. Remove setContentType.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:withHeaders:]): Handle Content-Type and Refresh.
This method is big enough that I should probably move the guts to KWQKHTMLPart.
- other things
* kwq/KWQListImpl.mm: (KWQListImpl::~KWQListImpl): I overlooked something
while doing my "bug fix" in here a while back. Change an assignment statement
to an assert.
2002-11-13 David Hyatt <hyatt@apple.com>
Fix for floats. Force relayout if collapsing margins
......
2002-11-13 Darin Adler <darin@apple.com>
- fixed 3083982 -- Logging into AOL gives null view
Turns out AOL was using a refresh header, which we were not supporting.
* khtml/khtml_part.h: Declare receivedFirstData, a private member function.
* khtml/khtml_part.cpp:
(KHTMLPart::receivedFirstData): Separate out the part of slotData we
want to share, which really seems kinda separate anyway.
(KHTMLPart::slotData): More of the same.
* kwq/KWQKHTMLPart.h: Declare addMetaData.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::slotData): Call receivedFirstData instead of doing the same
thing ourselves.
(KWQKHTMLPart::addMetaData): Added. Puts metadata into the job.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Fix bug where this was calling
openURL: but meant to call loadURL:.
* kwq/WebCoreBridge.h: Add headers to openURL method. Remove setContentType.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:withHeaders:]): Handle Content-Type and Refresh.
This method is big enough that I should probably move the guts to KWQKHTMLPart.
- other things
* kwq/KWQListImpl.mm: (KWQListImpl::~KWQListImpl): I overlooked something
while doing my "bug fix" in here a while back. Change an assignment statement
to an assert.
2002-11-13 David Hyatt <hyatt@apple.com>
Fix for floats. Force relayout if collapsing margins
......
2002-11-13 Darin Adler <darin@apple.com>
- fixed 3083982 -- Logging into AOL gives null view
Turns out AOL was using a refresh header, which we were not supporting.
* khtml/khtml_part.h: Declare receivedFirstData, a private member function.
* khtml/khtml_part.cpp:
(KHTMLPart::receivedFirstData): Separate out the part of slotData we
want to share, which really seems kinda separate anyway.
(KHTMLPart::slotData): More of the same.
* kwq/KWQKHTMLPart.h: Declare addMetaData.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::slotData): Call receivedFirstData instead of doing the same
thing ourselves.
(KWQKHTMLPart::addMetaData): Added. Puts metadata into the job.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Fix bug where this was calling
openURL: but meant to call loadURL:.
* kwq/WebCoreBridge.h: Add headers to openURL method. Remove setContentType.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge openURL:withHeaders:]): Handle Content-Type and Refresh.
This method is big enough that I should probably move the guts to KWQKHTMLPart.
- other things
* kwq/KWQListImpl.mm: (KWQListImpl::~KWQListImpl): I overlooked something
while doing my "bug fix" in here a while back. Change an assignment statement
to an assert.
2002-11-13 David Hyatt <hyatt@apple.com>
Fix for floats. Force relayout if collapsing margins
......
......@@ -1002,21 +1002,15 @@ DOM::DocumentImpl *KHTMLPart::xmlDocImpl() const
return 0;
}
#if !APPLE_CHANGES
/*bool KHTMLPart::isSSLInUse() const
{
return d->m_ssl_in_use;
}*/
void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
void KHTMLPart::receivedFirstData()
{
assert ( d->m_job == kio_job );
//kdDebug( 6050 ) << "slotData: " << data.size() << endl;
// The first data ?
if ( !d->m_workingURL.isEmpty() )
{
// Leave indented one extra for easier merging.
//kdDebug( 6050 ) << "begin!" << endl;
begin( d->m_workingURL, d->m_extension->urlArgs().xOffset, d->m_extension->urlArgs().yOffset );
......@@ -1028,6 +1022,9 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
d->m_cacheId = KHTMLPageCache::self()->createCacheEntry();
// When the first data arrives, the metadata has just been made available
#if APPLE_CHANGES
QString qData;
#else
d->m_bSecurityInQuestion = false;
d->m_ssl_in_use = (d->m_job->queryMetaData("ssl_in_use") == "TRUE");
kdDebug(6050) << "SSL in use? " << d->m_job->queryMetaData("ssl_in_use") << endl;
......@@ -1062,6 +1059,7 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
QString qData = d->m_job->queryMetaData("charset");
if ( !qData.isEmpty() && !d->m_haveEncoding ) // only use information if the user didn't override the settings
d->m_encoding = qData;
#endif // APPLE_CHANGES
// Support for http-refresh
qData = d->m_job->queryMetaData("http-refresh");
......@@ -1110,7 +1108,18 @@ void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
// Support for http last-modified
d->m_lastModified = d->m_job->queryMetaData("modified");
//kdDebug() << "KHTMLPart::slotData metadata modified: " << d->m_lastModified << endl;
}
}
#if !APPLE_CHANGES
void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )
{
assert ( d->m_job == kio_job );
//kdDebug( 6050 ) << "slotData: " << data.size() << endl;
// The first data ?
if ( !d->m_workingURL.isEmpty() )
receivedFirstData( );
KHTMLPageCache::self()->addData(d->m_cacheId, data);
write( data.data(), data.size() );
......
......@@ -1076,6 +1076,8 @@ private:
void checkEmitLoadEvent();
void emitLoadEvent();
void receivedFirstData();
KHTMLPartPrivate *d;
friend class KHTMLPartPrivate;
......
......@@ -147,6 +147,8 @@ public:
void setCurrentEvent(NSEvent *event);
void addMetaData(const QString &key, const QString &value);
private:
void setPolicyBaseURL(const DOM::DOMString &);
......
......@@ -37,6 +37,7 @@
#import "WebCoreViewFactory.h"
#import "KWQDummyView.h"
#import "KWQKJobClasses.h"
#import "KWQLogging.h"
#undef _KWQ_TIMING
......@@ -180,8 +181,7 @@ void KWQKHTMLPart::submitForm(const KURL &url, const URLArgs &args)
void KWQKHTMLPart::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
{
if (!d->m_workingURL.isEmpty()) {
part->begin(d->m_workingURL, 0, 0);
d->m_workingURL = KURL();
part->receivedFirstData();
}
ASSERT(d->m_doc);
......@@ -567,3 +567,8 @@ void KWQKHTMLPart::setCurrentEvent(NSEvent *event)
[_currentEvent release];
_currentEvent = event;
}
void KWQKHTMLPart::addMetaData(const QString &key, const QString &value)
{
d->m_job->addMetaData(key, value);
}
......@@ -69,7 +69,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
bridge = [m_part->kwq->bridge() findFramedNamed:frameName];
if (bridge != nil) {
if (!url.isEmpty()) {
[bridge openURL:url.getNSURL()];
[bridge loadURL:url.getNSURL() reload:urlArgs.reload triggeringEvent:nil isFormSubmission:NO];
}
*partResult = [bridge part];
return;
......
......@@ -93,7 +93,7 @@ KWQListImpl::~KWQListImpl()
for (KWQListIteratorImpl *it = iterators; it != NULL; it = next) {
next = it->next;
it->list = NULL;
it->node = NULL;
ASSERT(it->node == NULL);
it->next = NULL;
it->prev = NULL;
}
......
......@@ -94,7 +94,7 @@ enum FrameBorderStyle {
- (void)setParent:(WebCoreBridge *)parent;
- (void)openURL:(NSURL *)URL;
- (void)openURL:(NSURL *)URL withHeaders:(NSDictionary *)headers;
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding;
- (void)addData:(NSData *)data withOverrideEncoding:(NSString *)encoding;
- (void)closeURL;
......@@ -102,8 +102,6 @@ enum FrameBorderStyle {
- (void)restoreDocumentState;
- (void)end;
- (void)setContentType:(NSString*)contentType;
- (NSURL *)URL;
- (NSString *)referrer;
......
......@@ -108,9 +108,24 @@ using khtml::RenderPart;
_part->setParent([parent part]);
}
- (void)openURL:(NSURL *)URL
{
- (void)openURL:(NSURL *)URL withHeaders:(NSDictionary *)headers
{
// Content-Type
NSString *contentType = [headers objectForKey:@"Content-Type"];
if (contentType) {
KParts::URLArgs args(_part->browserExtension()->urlArgs());
args.serviceType = QString::fromNSString(contentType);
_part->browserExtension()->setURLArgs(args);
}
// URL
_part->openURL([[URL absoluteString] cString]);
// Refresh
NSString *refreshHeader = [headers objectForKey:@"Refresh"];
if (refreshHeader) {
_part->kwq->addMetaData("http-refresh", QString::fromNSString(refreshHeader));
}
}
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding
......@@ -749,13 +764,6 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
return _part->kwq->selectionEndOffset();
}
- (void)setContentType:(NSString*)contentType
{
KParts::URLArgs args( _part->browserExtension()->urlArgs() );
args.serviceType = QString::fromNSString(contentType);
_part->browserExtension()->setURLArgs(args);
}
- (void)setName:(NSString *)name
{
_part->setName(QString::fromNSString(name));
......
2002-11-13 Darin Adler <darin@apple.com>
- fixed 3083982 -- Logging into AOL gives null view
Turns out AOL was using a refresh header, which we were not supporting.
* WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]):
Call openURL: and pass headers in.
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:isFormSubmission:]):
Pass nil for headers in this case, since we know it's just an anchor change.
- other things
* WebCoreSupport.subproj/WebBridge.h: Remove dataSourceChanged and dataSource
methods. We try to keep the bridge methods down to actual bridging.
* WebCoreSupport.subproj/WebBridge.m: Remove dataSourceChanged altogether,
and move dataSource up in the file.
* WebView.subproj/WebHTMLRepresentation.m:
(-[WebHTMLRepresentation setDataSource:]): Keep the data source around, so we
don't need to ask the bridge for it.
(-[WebHTMLRepresentation documentSource]): Use it here.
2002-11-13 Trey Matteson <trey@apple.com>
Fixed 3100084 - REGRESSION: web page is not first responder after visiting web page
......
2002-11-13 Darin Adler <darin@apple.com>
- fixed 3083982 -- Logging into AOL gives null view
Turns out AOL was using a refresh header, which we were not supporting.
* WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _commitIfReady]):
Call openURL: and pass headers in.
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _loadURL:loadType:clientRedirect:triggeringEvent:isFormSubmission:]):
Pass nil for headers in this case, since we know it's just an anchor change.
- other things
* WebCoreSupport.subproj/WebBridge.h: Remove dataSourceChanged and dataSource
methods. We try to keep the bridge methods down to actual bridging.
* WebCoreSupport.subproj/WebBridge.m: Remove dataSourceChanged altogether,
and move dataSource up in the file.
* WebView.subproj/WebHTMLRepresentation.m:
(-[WebHTMLRepresentation setDataSource:]): Keep the data source around, so we
don't need to ask the bridge for it.
(-[WebHTMLRepresentation documentSource]): Use it here.
2002-11-13 Trey Matteson <trey@apple.com>
Fixed 3100084 - REGRESSION: web page is not first responder after visiting web page
......
......@@ -19,8 +19,4 @@
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
- (void)setFrame:(WebFrame *)webFrame;
- (void)dataSourceChanged;
- (WebDataSource *)dataSource;
@end
......@@ -158,6 +158,17 @@ - (NSWindow *)window
return [[[frame controller] windowOperationsDelegate] window];
}
- (WebDataSource *)dataSource
{
ASSERT(frame != nil);
WebDataSource *dataSource = [frame dataSource];
ASSERT(dataSource != nil);
ASSERT([dataSource _isCommitted]);
return dataSource;
}
- (void)setTitle:(NSString *)title
{
[[self dataSource] _setTitle:[title _web_stringByCollapsingNonPrintingCharacters]];
......@@ -243,22 +254,6 @@ - (void)setFrame:(WebFrame *)webFrame
}
}
- (void)dataSourceChanged
{
[self openURL:[[self dataSource] URL]];
}
- (WebDataSource *)dataSource
{
ASSERT(frame != nil);
WebDataSource *dataSource = [frame dataSource];
ASSERT(dataSource != nil);
ASSERT([dataSource _isCommitted]);
return dataSource;
}
- (void)unfocusWindow
{
if ([[self window] isKeyWindow] || [[[self window] attachedSheet] isKeyWindow]) {
......
......@@ -28,6 +28,7 @@
#import <WebKit/WebViewPrivate.h>
#import <WebFoundation/WebError.h>
#import <WebFoundation/WebHTTPResourceResponse.h>
#import <WebFoundation/WebNSDictionaryExtras.h>
#import <WebFoundation/WebNSStringExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
......@@ -425,9 +426,13 @@ -(void)_commitIfReady
if (![self isDownloading] && _private->gotFirstByte && !_private->committed) {
LOG(Loading, "committed resource = %@", [[self request] URL]);
_private->committed = TRUE;
[self _makeRepresentation];
[[self webFrame] _transitionToCommitted];
[[self _bridge] dataSourceChanged];
[[self _bridge] openURL:[_private->response URL]
withHeaders:[_private->response isKindOfClass:[WebHTTPResourceResponse class]]
? [(WebHTTPResourceResponse *)_private->response headers] : nil];
// Must do this after dataSourceChanged. makeRep installs a new view, which blows away
// scroll state, which is saved within _transitionToCommitted
}
......
......@@ -1080,7 +1080,7 @@ - (void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType clientRedirect
ASSERT(![_private previousItem]);
// will save form state to current item, since prevItem not set
[_private->bridge openURL:URL];
[_private->bridge openURL:URL withHeaders:nil];
[dataSrc _setURL:URL];
// NB: must happen after _setURL, since we add based on the current request
[self _addBackForwardItemClippedAtTarget:NO];
......
......@@ -14,6 +14,7 @@
@interface WebHTMLRepresentationPrivate : NSObject
{
@public
WebDataSource *dataSource;
WebBridge *bridge;
}
@end
......@@ -50,8 +51,8 @@ - (WebBridge *)_bridge
- (void)setDataSource:(WebDataSource *)dataSource
{
_private->dataSource = dataSource;
_private->bridge = [[dataSource webFrame] _bridge];
[_private->bridge setContentType: [[dataSource response] contentType]];
}
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
......@@ -70,7 +71,7 @@ - (void)finishedLoadingWithDataSource:(WebDataSource *)dataSource
- (NSString *)documentSource
{
return [WebBridge stringWithData:[[_private->bridge dataSource] data] textEncoding:[_private->bridge textEncoding]];
return [WebBridge stringWithData:[_private->dataSource data] textEncoding:[_private->bridge textEncoding]];
}
......
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