[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:30:16 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 3cea4464cbc1a841ec6b86d04a145c1ea6c305e4
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 8 06:24:58 2002 +0000
WebCore:
WebCore work for:
- fixed 2956008 - Need API for getting/setting text encoding for current page
* kwq/KWQKHTMLPartImpl.h:
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::slotData): Handle the possibility of override encoding -
one that's not just a hint from the server but should override
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge addData:withEncoding:]): Adjust for slotData interface change.
(-[WebCoreBridge addData:withOverrideEncoding:]): New method that allows
passing override encoding as a CFStringEncoding.
(-[WebCoreBridge textEncoding]): Return the current text encoding.
WebKit:
WebKit work for:
- fixed 2956008 - Need API for getting/setting text encoding for current page
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge receivedData:withDataSource:]): Handle override encoding,
if any.
* WebView.subproj/WebDataSource.m:
(-[WebDataSource initWithURL:attributes:flags:]): Remember the flags and
attributes.
* WebView.subproj/WebDataSourcePrivate.h:
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSourcePrivate init]): Initialize overrideEncoding
(-[WebDataSourcePrivate dealloc]): Release attributes
(-[WebDataSource _setOverrideEncoding:]): Added.
(-[WebDataSource _overrideEncoding]): Added.
(-[WebDataSource _flags]): Added.
(-[WebDataSource _attributes]): Added.
* WebView.subproj/WebFrame.m:
(-[WebFrame startLoading]): Pass proper forceRefresh value to data source
based on load type (but the data source will ignore it).
(-[WebFrame reload:]): Made this work a bit better. Now instead of
crashing, it will actually reload, but it won't force a refresh
(and may not handle the back/forward issues properly).
* WebView.subproj/WebDocument.h: Defined new WebDocumentTextEncoding protocol.
* WebView.subproj/WebHTMLView.h:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView textEncoding]): Implemented WebDocumentTextEncoding
protocol.
(-[WebHTMLView setTextEncoding:]): Implemented WebDocumentTextEncoding
protocol.
(-[WebHTMLView setDefaultTextEncoding]): Implemented WebDocumentTextEncoding
protocol.
(-[WebHTMLView usingDefaultTextEncoding]): Implemented
WebDocumentTextEncoding protocol.
WebBrowser:
- fixed 2957200 - Text Encoding submenu is not yet implemented
* AppController.h:
* AppController.m:
(-[AppController applicationDidFinishLaunching:]): Install standard
Text Encoding menu items.
* BrowserWindowController.h:
* BrowserWindowController.m:
(-[BrowserWindowController validateMenuItem:]): Validate the menu items
properly, based on whether the current view can change encodings.
(-[BrowserWindowController changeTextEncoding:]): Hook up to new WebKit API.
* English.lproj/MainMenu.nib: Add Default item to encoding menu, hook it up
to AppController.
* TextEncodingMenu.h: Added. Stolen from Mail.
* TextEncodingMenu.m: Added. Stolen from Mail.
* WebBrowser.pbproj/project.pbxproj: Added new files.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 2d10201..490d00b 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,20 @@
+2002-08-07 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore work for:
+
+ - fixed 2956008 - Need API for getting/setting text encoding for current page
+
+ * kwq/KWQKHTMLPartImpl.h:
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::slotData): Handle the possibility of override encoding -
+ one that's not just a hint from the server but should override
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge addData:withEncoding:]): Adjust for slotData interface change.
+ (-[WebCoreBridge addData:withOverrideEncoding:]): New method that allows
+ passing override encoding as a CFStringEncoding.
+ (-[WebCoreBridge textEncoding]): Return the current text encoding.
+
2002-08-07 David Hyatt <hyatt at apple.com>
Adding support for a separate fixed font size to WebCore.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 2d10201..490d00b 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2002-08-07 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore work for:
+
+ - fixed 2956008 - Need API for getting/setting text encoding for current page
+
+ * kwq/KWQKHTMLPartImpl.h:
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::slotData): Handle the possibility of override encoding -
+ one that's not just a hint from the server but should override
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge addData:withEncoding:]): Adjust for slotData interface change.
+ (-[WebCoreBridge addData:withOverrideEncoding:]): New method that allows
+ passing override encoding as a CFStringEncoding.
+ (-[WebCoreBridge textEncoding]): Return the current text encoding.
+
2002-08-07 David Hyatt <hyatt at apple.com>
Adding support for a separate fixed font size to WebCore.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2d10201..490d00b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2002-08-07 Maciej Stachowiak <mjs at apple.com>
+
+ WebCore work for:
+
+ - fixed 2956008 - Need API for getting/setting text encoding for current page
+
+ * kwq/KWQKHTMLPartImpl.h:
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::slotData): Handle the possibility of override encoding -
+ one that's not just a hint from the server but should override
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge addData:withEncoding:]): Adjust for slotData interface change.
+ (-[WebCoreBridge addData:withOverrideEncoding:]): New method that allows
+ passing override encoding as a CFStringEncoding.
+ (-[WebCoreBridge textEncoding]): Return the current text encoding.
+
2002-08-07 David Hyatt <hyatt at apple.com>
Adding support for a separate fixed font size to WebCore.
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 46c7022..cb18e8d 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -69,7 +69,7 @@ public:
bool openURLInFrame(const KURL &, const KParts::URLArgs &);
- void slotData(NSString *, const char *bytes, int length, bool complete = false);
+ void slotData(NSString *, bool forceEncoding, const char *bytes, int length, bool complete = false);
void setTitle(const DOM::DOMString &);
void setStatusBarText(const QString &status);
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 88adf5c..3587805 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -100,7 +100,7 @@ bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &u
return true;
}
-void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int length, bool complete)
+void KWQKHTMLPartImpl::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
{
// NOTE: This code emulates the interface used by the original khtml part
QString enc;
@@ -112,7 +112,9 @@ void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int lengt
if (encoding != NULL) {
enc = QString::fromCFString((CFStringRef) encoding);
- part->setEncoding(enc, true);
+ part->setEncoding(enc, forceEncoding);
+ } else {
+ part->setEncoding(QString::null, false);
}
KWQ_ASSERT(d->m_doc != NULL);
@@ -517,3 +519,4 @@ RenderObject *KWQKHTMLPartImpl::getRenderer()
DocumentImpl *doc = part->xmlDocImpl();
return doc ? doc->renderer() : 0;
}
+
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 46c7022..cb18e8d 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -69,7 +69,7 @@ public:
bool openURLInFrame(const KURL &, const KParts::URLArgs &);
- void slotData(NSString *, const char *bytes, int length, bool complete = false);
+ void slotData(NSString *, bool forceEncoding, const char *bytes, int length, bool complete = false);
void setTitle(const DOM::DOMString &);
void setStatusBarText(const QString &status);
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 88adf5c..3587805 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -100,7 +100,7 @@ bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &u
return true;
}
-void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int length, bool complete)
+void KWQKHTMLPartImpl::slotData(NSString *encoding, bool forceEncoding, const char *bytes, int length, bool complete)
{
// NOTE: This code emulates the interface used by the original khtml part
QString enc;
@@ -112,7 +112,9 @@ void KWQKHTMLPartImpl::slotData(NSString *encoding, const char *bytes, int lengt
if (encoding != NULL) {
enc = QString::fromCFString((CFStringRef) encoding);
- part->setEncoding(enc, true);
+ part->setEncoding(enc, forceEncoding);
+ } else {
+ part->setEncoding(QString::null, false);
}
KWQ_ASSERT(d->m_doc != NULL);
@@ -517,3 +519,4 @@ RenderObject *KWQKHTMLPartImpl::getRenderer()
DocumentImpl *doc = part->xmlDocImpl();
return doc ? doc->renderer() : 0;
}
+
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 012f5db..5423adc 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -83,6 +83,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)openURL:(NSURL *)URL;
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding;
+- (void)addData:(NSData *)data withOverrideEncoding:(CFStringEncoding)encoding;
- (void)closeURL;
- (void)end;
@@ -120,6 +121,8 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)setTextSizeMultiplier:(float)multiplier;
+- (CFStringEncoding)textEncoding;
+
@end
// The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 4546712..7f2034a 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -41,6 +41,7 @@
#import <KWQDOMNode.h>
#import <WebCoreImageRenderer.h>
#import <WebFoundation/WebNSURLExtras.h>
+#import <KWQCharsets.h>
using khtml::parseURL;
using khtml::RenderImage;
@@ -102,7 +103,14 @@ using khtml::RenderPart;
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding
{
- part->impl->slotData(encoding, (const char *)[data bytes], [data length], NO);
+ part->impl->slotData(encoding, NO, (const char *)[data bytes], [data length], NO);
+}
+
+- (void)addData:(NSData *)data withOverrideEncoding:(CFStringEncoding)overrideEncoding
+{
+ NSString *encoding = (NSString *)KWQCFStringEncodingToIANACharsetName(overrideEncoding);
+
+ part->impl->slotData(encoding, YES, (const char *)[data bytes], [data length], NO);
}
- (void)closeURL
@@ -437,4 +445,9 @@ using khtml::RenderPart;
part->setZoomFactor((int)rint(multiplier * 100));
}
+- (CFStringEncoding)textEncoding
+{
+ return KWQCFStringEncodingFromIANACharsetName(part->encoding().getCFMutableString());
+}
+
@end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c357f38..77f8c30 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,41 @@
+2002-08-07 Maciej Stachowiak <mjs at apple.com>
+
+ WebKit work for:
+
+ - fixed 2956008 - Need API for getting/setting text encoding for current page
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge receivedData:withDataSource:]): Handle override encoding,
+ if any.
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource initWithURL:attributes:flags:]): Remember the flags and
+ attributes.
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate init]): Initialize overrideEncoding
+ (-[WebDataSourcePrivate dealloc]): Release attributes
+ (-[WebDataSource _setOverrideEncoding:]): Added.
+ (-[WebDataSource _overrideEncoding]): Added.
+ (-[WebDataSource _flags]): Added.
+ (-[WebDataSource _attributes]): Added.
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame startLoading]): Pass proper forceRefresh value to data source
+ based on load type (but the data source will ignore it).
+ (-[WebFrame reload:]): Made this work a bit better. Now instead of
+ crashing, it will actually reload, but it won't force a refresh
+ (and may not handle the back/forward issues properly).
+ * WebView.subproj/WebDocument.h: Defined new WebDocumentTextEncoding protocol.
+ * WebView.subproj/WebHTMLView.h:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView textEncoding]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView setTextEncoding:]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView setDefaultTextEncoding]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView usingDefaultTextEncoding]): Implemented
+ WebDocumentTextEncoding protocol.
+
2002-08-07 John Sullivan <sullivan at apple.com>
- fixed 3017245 -- Shift-Delete should go forward
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index c357f38..77f8c30 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,41 @@
+2002-08-07 Maciej Stachowiak <mjs at apple.com>
+
+ WebKit work for:
+
+ - fixed 2956008 - Need API for getting/setting text encoding for current page
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge receivedData:withDataSource:]): Handle override encoding,
+ if any.
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource initWithURL:attributes:flags:]): Remember the flags and
+ attributes.
+ * WebView.subproj/WebDataSourcePrivate.h:
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSourcePrivate init]): Initialize overrideEncoding
+ (-[WebDataSourcePrivate dealloc]): Release attributes
+ (-[WebDataSource _setOverrideEncoding:]): Added.
+ (-[WebDataSource _overrideEncoding]): Added.
+ (-[WebDataSource _flags]): Added.
+ (-[WebDataSource _attributes]): Added.
+ * WebView.subproj/WebFrame.m:
+ (-[WebFrame startLoading]): Pass proper forceRefresh value to data source
+ based on load type (but the data source will ignore it).
+ (-[WebFrame reload:]): Made this work a bit better. Now instead of
+ crashing, it will actually reload, but it won't force a refresh
+ (and may not handle the back/forward issues properly).
+ * WebView.subproj/WebDocument.h: Defined new WebDocumentTextEncoding protocol.
+ * WebView.subproj/WebHTMLView.h:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView textEncoding]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView setTextEncoding:]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView setDefaultTextEncoding]): Implemented WebDocumentTextEncoding
+ protocol.
+ (-[WebHTMLView usingDefaultTextEncoding]): Implemented
+ WebDocumentTextEncoding protocol.
+
2002-08-07 John Sullivan <sullivan at apple.com>
- fixed 3017245 -- Shift-Delete should go forward
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 68ead39..ac64be5 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -170,7 +170,11 @@
{
WEBKIT_ASSERT([self dataSource] == withDataSource);
- [self addData:data withEncoding:[withDataSource encoding]];
+ if ([withDataSource _overrideEncoding] != kCFStringEncodingInvalidId) {
+ [self addData:data withOverrideEncoding:[withDataSource _overrideEncoding]];
+ } else {
+ [self addData:data withEncoding:[withDataSource encoding]];
+ }
}
- (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 07f8d39..30ca6c7 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -32,7 +32,7 @@
return [self initWithURL:URL attributes:theAttributes flags:0];
}
--(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes flags:(unsigned)theFlags;
+-(id)initWithURL:(NSURL *)URL attributes:(NSDictionary *)theAttributes flags:(unsigned)theFlags
{
self = [super init];
if (!self) {
@@ -41,6 +41,8 @@
_private = [[WebDataSourcePrivate alloc] init];
_private->inputURL = [URL retain];
+ _private->flags = theFlags;
+ _private->attributes = [theAttributes retain];
_private->mainHandle = [[WebResourceHandle alloc] initWithURL: _private->inputURL attributes:theAttributes flags:theFlags];
++WebDataSourceCount;
@@ -259,7 +261,6 @@
return nil;
}
-
- (NSString *)encoding
{
return _private->encoding;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 9953ba3..11e124c 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -27,7 +27,9 @@
// The original URL as requested during initialization.
NSURL *inputURL;
-
+ NSDictionary *attributes;
+ unsigned flags;
+
// The original URL we may have been redirected to.
NSURL *finalURL;
@@ -55,6 +57,7 @@
NSString *pageTitle;
NSString *encoding;
+ CFStringEncoding overrideEncoding;
NSString *contentType;
@@ -106,6 +109,8 @@
- (void)_setIconURL:(NSURL *)URL;
- (void)_setIconURL:(NSURL *)URL withType:(NSString *)iconType;
- (WebResourceHandle*)_mainHandle;
+- (void)_setOverrideEncoding:(CFStringEncoding)overrideEncoding;
+- (CFStringEncoding)_overrideEncoding;
// Convenience interface for getting here from an WebDataSource.
// This returns nil if the representation is not an WebHTMLRepresentation.
@@ -116,4 +121,7 @@
- (void)_makeRepresentation;
- (void)_receivedData:(NSData *)data;
+- (int)_flags;
+- (NSDictionary *)_attributes;
+
@end
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 37d9123..99d8a2b 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -44,6 +44,8 @@
contentPolicy = WebContentPolicyNone;
+ overrideEncoding = kCFStringEncodingInvalidId;
+
return self;
}
@@ -62,6 +64,7 @@
[resourceData release];
[representation release];
[inputURL release];
+ [attributes release];
[finalURL release];
[frames release];
[mainHandle release];
@@ -297,6 +300,16 @@
_private->encoding = [encoding retain];
}
+- (void)_setOverrideEncoding:(CFStringEncoding)overrideEncoding
+{
+ _private->overrideEncoding = overrideEncoding;
+}
+
+- (CFStringEncoding)_overrideEncoding
+{
+ return _private->overrideEncoding;
+}
+
- (void)_setMainDocumentError: (WebError *)error
{
[error retain];
@@ -478,4 +491,15 @@
return _private->mainHandle;
}
+- (int)_flags
+{
+ return _private->flags;
+}
+
+- (NSDictionary *)_attributes
+{
+ return _private->attributes;
+}
+
+
@end
diff --git a/WebKit/WebView.subproj/WebDocument.h b/WebKit/WebView.subproj/WebDocument.h
index 75abe37..5362afd 100644
--- a/WebKit/WebView.subproj/WebDocument.h
+++ b/WebKit/WebView.subproj/WebDocument.h
@@ -15,17 +15,24 @@
- (void)layout;
@end
- at protocol WebDocumentDragSettings
+ at protocol WebDocumentDragSettings <NSObject>
- (void)setCanDragFrom: (BOOL)flag;
- (BOOL)canDragFrom;
- (void)setCanDragTo: (BOOL)flag;
- (BOOL)canDragTo;
@end
- at protocol WebDocumentSearching
+ at protocol WebDocumentSearching <NSObject>
- (BOOL)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
@end
+ at protocol WebDocumentTextEncoding <NSObject>
+- (CFStringEncoding)textEncoding;
+- (void)setTextEncoding:(CFStringEncoding)encoding;
+- (void)setDefaultTextEncoding;
+- (BOOL)usingDefaultTextEncoding;
+ at end
+
@protocol WebDocumentRepresentation <NSObject>
- (void)setDataSource:(WebDataSource *)dataSource;
- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
diff --git a/WebKit/WebView.subproj/WebFrame.m b/WebKit/WebView.subproj/WebFrame.m
index ccae2e2..c37618c 100644
--- a/WebKit/WebView.subproj/WebFrame.m
+++ b/WebKit/WebView.subproj/WebFrame.m
@@ -180,10 +180,7 @@
if (self == [[self controller] mainFrame])
WEBKITDEBUGLEVEL (WEBKIT_LOG_DOCUMENTLOAD, "loading %s", [[[[self provisionalDataSource] originalURL] absoluteString] cString]);
- // Force refresh is irrelevant, as this will always be the first load.
- // The controller will transition the provisional data source to the
- // committed data source.
- [_private->provisionalDataSource startLoading: NO];
+ [_private->provisionalDataSource startLoading:[self _loadType] == WebFrameLoadTypeRefresh];
}
@@ -196,9 +193,19 @@
- (void)reload: (BOOL)forceRefresh
{
- [_private->dataSource _clearErrors];
+ WebDataSource *dataSource = [self dataSource];
- [_private->dataSource startLoading: forceRefresh];
+ if (dataSource == nil) {
+ return;
+ }
+
+ WebDataSource *newDataSource = [[WebDataSource alloc] initWithURL:[dataSource originalURL] attributes:[dataSource _attributes] flags:[dataSource _flags]];
+ [newDataSource _setParent:[dataSource parent]];
+ if ([self setProvisionalDataSource:newDataSource]) {
+ [self _setLoadType:WebFrameLoadTypeRefresh];
+ [self startLoading];
+ }
+ [newDataSource release];
}
diff --git a/WebKit/WebView.subproj/WebHTMLView.h b/WebKit/WebView.subproj/WebHTMLView.h
index 0daf347..fe7c3d4 100644
--- a/WebKit/WebView.subproj/WebHTMLView.h
+++ b/WebKit/WebView.subproj/WebHTMLView.h
@@ -6,6 +6,7 @@
*/
#import <Cocoa/Cocoa.h>
+#import <WebKit/WebDocument.h>
/*
=============================================================================
@@ -14,11 +15,8 @@
@class WebDataSource;
@class WebController;
@class WebHTMLViewPrivate;
- at protocol WebDocumentLoading;
- at protocol WebDocumentDragSettings;
- at protocol WebDocumentSearching;
- at interface WebHTMLView : NSView <WebDocumentLoading, WebDocumentDragSettings, WebDocumentSearching>
+ at interface WebHTMLView : NSView <WebDocumentView, WebDocumentDragSettings, WebDocumentSearching, WebDocumentTextEncoding>
{
@private
WebHTMLViewPrivate *_private;
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index f4c3f97..921a8e5 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -518,5 +518,32 @@
return [NSArray arrayWithObject:filename];
}
+- (CFStringEncoding)textEncoding
+{
+ return [[self _bridge] textEncoding];
+}
+
+- (void)setTextEncoding:(CFStringEncoding)encoding
+{
+ WebView *webView = [self _web_parentWebView];
+ WebFrame *webFrame = [[webView _controller] frameForView:webView];
+ [webFrame reload:NO];
+ [[webFrame provisionalDataSource] _setOverrideEncoding:encoding];
+}
+
+- (void)setDefaultTextEncoding
+{
+ WebView *webView = [self _web_parentWebView];
+ WebFrame *webFrame = [[webView _controller] frameForView:webView];
+ [webFrame reload:NO];
+ [[webFrame provisionalDataSource] _setOverrideEncoding:kCFStringEncodingInvalidId];
+}
+
+- (BOOL)usingDefaultTextEncoding
+{
+ WebView *webView = [self _web_parentWebView];
+ WebFrame *webFrame = [[webView _controller] frameForView:webView];
+ return [[webFrame dataSource] _overrideEncoding] == kCFStringEncodingInvalidId;
+}
@end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list