[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:36:56 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1240e8bed96e18504ad25ac6bcfb81e2a588c9a8
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Sep 7 00:45:04 2002 +0000
WebCore:
* kwq/WebCoreResourceLoader.h:
Define WebCoreResourceHandle protocol.
* kwq/kio/jobclasses.h:
* kwq/KWQKjobclasses.mm:
* kwq/KWQLoaderImpl.mm: (KWQServeRequest):
* kwq/WebCoreBridge.h:
Use WebCoreResourceHandle instead of WebResourceHandle.
* kwq/KWQString.mm: (QString::fill): Fix case where the new string
is going to be empty, but the old string was not. Before, it leaked
a handle.
* kwq/character-sets.txt: Updated to 2002-06-14 version from 2001-08-23 version.
* kwq/mac-encodings.txt: Updated encoding names to include ones gleaned from
the I18N-Charset-1.17 Perl module.
* kwq/KWQCharsets.mm: Formatting tweaks.
WebKit:
Almost weaned WebKit entirely from the handleDidBeginLoading and handleDidCancelLoading
loading callbacks. We are planning to remove both of them.
* Plugins.subproj/WebPluginStream.m:
(-[WebNetscapePluginStream startLoad]): Call _didStartLoading here so we don't need
to rely on handleDidBeginLoading any more.
(-[WebNetscapePluginStream stop]): Call cancel here so we don't need to rely on
handleDidCancelLoading any more.
(-[WebNetscapePluginStream handleDidBeginLoading:]): Empty out.
(-[WebNetscapePluginStream handleDidFinishLoading:]): Nil out resource here.
(-[WebNetscapePluginStream handleDidCancelLoading:]): Empty out.
(-[WebNetscapePluginStream cancel]): Put cancel code here.
(-[WebNetscapePluginStream handleDidFailLoading:withError:]): Nil out resource here.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge startLoadingResource:withURL:]): Change to use WebCoreResourceHandle.
* WebCoreSupport.subproj/WebSubresourceClient.h: Change to use WebCoreResourceHandle.
* WebCoreSupport.subproj/WebSubresourceClient.m:
(-[WebSubresourceClient dealloc]): Release handle too, now that we have it.
(-[WebSubresourceClient receivedProgressWithComplete:]): Moved up here and removed handle
parameter.
(+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Do work here so
we don't need to rely on handleDidBeginLoading any more.
(-[WebSubresourceClient receivedError:]): Removed handle parameter.
(-[WebSubresourceClient handleWillUseUserAgent:forURL:]):
(-[WebSubresourceClient handleDidBeginLoading:]): Emptied out.
(-[WebSubresourceClient handleDidCancelLoading:]): Updated, still needs to be emptied out.
(-[WebSubresourceClient handleDidFinishLoading:]): Nil out handle.
(-[WebSubresourceClient handleDidFailLoading:withError:]): Nil out handle.
(-[WebSubresourceClient cancel]): New method, used by WebCore.
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer widthForCharacters:length:]): Moved up in the file to fix build failure.
* WebView.subproj/WebDataSourcePrivate.m:
(-[WebDataSource _startLoading:]): Call didStartLoadingWithURL so we don't have to
rely on handleDidBeginLoading.
(-[WebDataSource _stopLoading]): Call didCancelWithHandle so we don't have to rely
on handleDidCancelLoading.
* WebView.subproj/WebMainResourceClient.h: Add didStartLoadingWithURL and
didCancelWithHandle to the public methods.
* WebView.subproj/WebMainResourceClient.m:
(-[WebMainResourceClient initWithDataSource:]):
(-[WebMainResourceClient handleDidBeginLoading:]): Empty out.
(-[WebMainResourceClient didCancelWithHandle:]): Move the bulk of handleDidCancelLoading here.
(-[WebMainResourceClient handleDidCancelLoading:]): Empty out.
* WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Move the mouse up a little
bit so it's "on" the dragged area, but not over the text.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 29fb304..21b43c1 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,4 +1,25 @@
-2002-09-06 Richard Williamson (Home) <rjw at apple.com>
+2002-09-06 Darin Adler <darin at apple.com>
+
+ * kwq/WebCoreResourceLoader.h:
+ Define WebCoreResourceHandle protocol.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm:
+ * kwq/KWQLoaderImpl.mm: (KWQServeRequest):
+ * kwq/WebCoreBridge.h:
+ Use WebCoreResourceHandle instead of WebResourceHandle.
+
+ * kwq/KWQString.mm: (QString::fill): Fix case where the new string
+ is going to be empty, but the old string was not. Before, it leaked
+ a handle.
+
+ * kwq/character-sets.txt: Updated to 2002-06-14 version from 2001-08-23 version.
+ * kwq/mac-encodings.txt: Updated encoding names to include ones gleaned from
+ the I18N-Charset-1.17 Perl module.
+
+ * kwq/KWQCharsets.mm: Formatting tweaks.
+
+2002-09-06 Richard Williamson <rjw at apple.com>
Start using khtml's 'toAdd' parameter to justify text.
@@ -105,14 +126,14 @@
* kwq/KWQString.mm:
(QString::fromStringWithEncoding)
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Removed debugging log.
* kwq/KWQString.mm:
(QString::fromStringWithEncoding):
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Made decoder more robust wrt nulls in content. Changed use
of QCString to null safe QString rather than modify
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 29fb304..21b43c1 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,4 +1,25 @@
-2002-09-06 Richard Williamson (Home) <rjw at apple.com>
+2002-09-06 Darin Adler <darin at apple.com>
+
+ * kwq/WebCoreResourceLoader.h:
+ Define WebCoreResourceHandle protocol.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm:
+ * kwq/KWQLoaderImpl.mm: (KWQServeRequest):
+ * kwq/WebCoreBridge.h:
+ Use WebCoreResourceHandle instead of WebResourceHandle.
+
+ * kwq/KWQString.mm: (QString::fill): Fix case where the new string
+ is going to be empty, but the old string was not. Before, it leaked
+ a handle.
+
+ * kwq/character-sets.txt: Updated to 2002-06-14 version from 2001-08-23 version.
+ * kwq/mac-encodings.txt: Updated encoding names to include ones gleaned from
+ the I18N-Charset-1.17 Perl module.
+
+ * kwq/KWQCharsets.mm: Formatting tweaks.
+
+2002-09-06 Richard Williamson <rjw at apple.com>
Start using khtml's 'toAdd' parameter to justify text.
@@ -105,14 +126,14 @@
* kwq/KWQString.mm:
(QString::fromStringWithEncoding)
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Removed debugging log.
* kwq/KWQString.mm:
(QString::fromStringWithEncoding):
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Made decoder more robust wrt nulls in content. Changed use
of QCString to null safe QString rather than modify
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 29fb304..21b43c1 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,4 +1,25 @@
-2002-09-06 Richard Williamson (Home) <rjw at apple.com>
+2002-09-06 Darin Adler <darin at apple.com>
+
+ * kwq/WebCoreResourceLoader.h:
+ Define WebCoreResourceHandle protocol.
+
+ * kwq/kio/jobclasses.h:
+ * kwq/KWQKjobclasses.mm:
+ * kwq/KWQLoaderImpl.mm: (KWQServeRequest):
+ * kwq/WebCoreBridge.h:
+ Use WebCoreResourceHandle instead of WebResourceHandle.
+
+ * kwq/KWQString.mm: (QString::fill): Fix case where the new string
+ is going to be empty, but the old string was not. Before, it leaked
+ a handle.
+
+ * kwq/character-sets.txt: Updated to 2002-06-14 version from 2001-08-23 version.
+ * kwq/mac-encodings.txt: Updated encoding names to include ones gleaned from
+ the I18N-Charset-1.17 Perl module.
+
+ * kwq/KWQCharsets.mm: Formatting tweaks.
+
+2002-09-06 Richard Williamson <rjw at apple.com>
Start using khtml's 'toAdd' parameter to justify text.
@@ -105,14 +126,14 @@
* kwq/KWQString.mm:
(QString::fromStringWithEncoding)
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Removed debugging log.
* kwq/KWQString.mm:
(QString::fromStringWithEncoding):
-2002-08-30 Richard Williamson (Home) <rjw at apple.com>
+2002-08-30 Richard Williamson <rjw at apple.com>
Made decoder more robust wrt nulls in content. Changed use
of QCString to null safe QString rather than modify
diff --git a/WebCore/kwq/KWQCharsets.mm b/WebCore/kwq/KWQCharsets.mm
index 6c74243..e4d4a60 100644
--- a/WebCore/kwq/KWQCharsets.mm
+++ b/WebCore/kwq/KWQCharsets.mm
@@ -41,92 +41,92 @@ static CFMutableDictionaryRef mibToEncoding = NULL;
static CFMutableDictionaryRef encodingToName = NULL;
static CFMutableDictionaryRef encodingToMIB = NULL;
-static void buildDictionaries (void)
+static void buildDictionaries()
{
- int i;
+ int i;
- nameToEncoding = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, NULL);
- mibToEncoding = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+ nameToEncoding = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, NULL);
+ mibToEncoding = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
- encodingToName = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks);
- encodingToMIB = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
+ encodingToName = CFDictionaryCreateMutable(NULL, 0, NULL, &kCFTypeDictionaryValueCallBacks);
+ encodingToMIB = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
- for (i = 0; table[i].name != NULL; i++) {
- CFStringRef name;
- name = CFStringCreateWithCString(NULL, table[i].name, kCFStringEncodingASCII);
+ for (i = 0; table[i].name != NULL; i++) {
+ CFStringRef name;
+ name = CFStringCreateWithCString(NULL, table[i].name, kCFStringEncodingASCII);
- if (name != NULL) {
- CFDictionarySetValue(nameToEncoding, name, (void *) table[i].encoding);
- CFDictionarySetValue(encodingToName, (void *) table[i].encoding, name);
- }
+ if (name != NULL) {
+ CFDictionarySetValue(nameToEncoding, name, (void *)table[i].encoding);
+ CFDictionarySetValue(encodingToName, (void *)table[i].encoding, name);
+ }
- if (table[i].mib != -1) {
- CFDictionarySetValue(mibToEncoding, (void *) table[i].mib, (void *) table[i].encoding);
- CFDictionarySetValue(encodingToMIB, (void *) table[i].encoding, (void *) table[i].mib);
+ if (table[i].mib != -1) {
+ CFDictionarySetValue(mibToEncoding, (void *)table[i].mib, (void *)table[i].encoding);
+ CFDictionarySetValue(encodingToMIB, (void *)table[i].encoding, (void *)table[i].mib);
+ }
}
- }
}
CFStringEncoding KWQCFStringEncodingFromIANACharsetName(CFStringRef charsetName)
{
- const void *value;
-
- if (nameToEncoding == NULL) {
- buildDictionaries ();
- }
-
- if (CFDictionaryGetValueIfPresent(nameToEncoding, (void *) charsetName, &value)) {
- return (CFStringEncoding) value;
- } else {
- return kCFStringEncodingInvalidId;
- }
+ const void *value;
+
+ if (nameToEncoding == NULL) {
+ buildDictionaries ();
+ }
+
+ if (CFDictionaryGetValueIfPresent(nameToEncoding, (void *)charsetName, &value)) {
+ return (CFStringEncoding)value;
+ } else {
+ return kCFStringEncodingInvalidId;
+ }
}
CFStringEncoding KWQCFStringEncodingFromMIB(int mib)
{
- const void *value;
-
- if (mibToEncoding == NULL) {
- buildDictionaries ();
- }
-
- if (CFDictionaryGetValueIfPresent(mibToEncoding, (void *) mib, &value)) {
- return (CFStringEncoding) value;
- } else {
- return kCFStringEncodingInvalidId;
- }
+ const void *value;
+
+ if (mibToEncoding == NULL) {
+ buildDictionaries ();
+ }
+
+ if (CFDictionaryGetValueIfPresent(mibToEncoding, (void *)mib, &value)) {
+ return (CFStringEncoding) value;
+ } else {
+ return kCFStringEncodingInvalidId;
+ }
}
CFStringRef KWQCFStringEncodingToIANACharsetName(CFStringEncoding encoding)
{
- const void *value;
-
- if (encodingToName == NULL) {
- buildDictionaries ();
- }
-
- if (CFDictionaryGetValueIfPresent(encodingToName, (void *) encoding, &value)) {
- return (CFStringRef) value;
- } else {
- return NULL;
- }
+ const void *value;
+
+ if (encodingToName == NULL) {
+ buildDictionaries ();
+ }
+
+ if (CFDictionaryGetValueIfPresent(encodingToName, (void *)encoding, &value)) {
+ return (CFStringRef) value;
+ } else {
+ return NULL;
+ }
}
int KWQCFStringEncodingToMIB(CFStringEncoding encoding)
{
- const void *value;
-
- if (encodingToMIB == NULL) {
- buildDictionaries ();
- }
-
- if (CFDictionaryGetValueIfPresent(encodingToMIB, (void *) encoding, &value)) {
- return (int) value;
- } else {
- return -1;
- }
+ const void *value;
+
+ if (encodingToMIB == NULL) {
+ buildDictionaries ();
+ }
+
+ if (CFDictionaryGetValueIfPresent(encodingToMIB, (void *)encoding, &value)) {
+ return (int) value;
+ } else {
+ return -1;
+ }
}
diff --git a/WebCore/kwq/KWQKJobClasses.h b/WebCore/kwq/KWQKJobClasses.h
index 2c6b4b1..9bb1f38 100644
--- a/WebCore/kwq/KWQKJobClasses.h
+++ b/WebCore/kwq/KWQKJobClasses.h
@@ -31,9 +31,11 @@
#include <qstring.h>
#ifdef __OBJC__
- at class WebResourceHandle;
+ at protocol WebCoreResourceHandle;
+typedef id <WebCoreResourceHandle> WebCoreResourceHandlePtr;
#else
-class WebResourceHandle;
+class WebCoreResourceHandle;
+typedef WebCoreResourceHandle *WebCoreResourceHandlePtr;
#endif
namespace KIO {
@@ -60,8 +62,8 @@ public:
void addMetaData(const QString &key, const QString &value);
void kill();
- void setHandle(WebResourceHandle *);
- WebResourceHandle *handle() const;
+ void setHandle(WebCoreResourceHandlePtr);
+ WebCoreResourceHandlePtr handle() const;
KURL url() const;
diff --git a/WebCore/kwq/KWQKJobClasses.mm b/WebCore/kwq/KWQKJobClasses.mm
index c703aba..98d7b88 100644
--- a/WebCore/kwq/KWQKJobClasses.mm
+++ b/WebCore/kwq/KWQKJobClasses.mm
@@ -30,8 +30,7 @@
#import <Foundation/Foundation.h>
-#import <WebFoundation/WebResourceHandle.h>
-#import <WebFoundation/WebResourceClient.h>
+#import <WebCoreResourceLoader.h>
namespace KIO {
@@ -55,7 +54,7 @@ public:
int status;
NSMutableDictionary *metaData;
KURL URL;
- WebResourceHandle *handle;
+ id <WebCoreResourceHandle> handle;
};
TransferJob::TransferJob(const KURL &url, bool reload, bool showProgressInfo)
@@ -65,6 +64,7 @@ TransferJob::TransferJob(const KURL &url, bool reload, bool showProgressInfo)
TransferJob::~TransferJob()
{
+ kill();
delete d;
}
@@ -108,17 +108,17 @@ void TransferJob::addMetaData(const QString &key, const QString &value)
void TransferJob::kill()
{
- [d->handle cancelLoadInBackground];
+ [d->handle cancel];
}
-void TransferJob::setHandle(WebResourceHandle *handle)
+void TransferJob::setHandle(id <WebCoreResourceHandle> handle)
{
[handle retain];
[d->handle release];
d->handle = handle;
}
-WebResourceHandle *TransferJob::handle() const
+id <WebCoreResourceHandle> TransferJob::handle() const
{
return d->handle;
}
diff --git a/WebCore/kwq/KWQLoader.mm b/WebCore/kwq/KWQLoader.mm
index 2dc62ac..9112291 100644
--- a/WebCore/kwq/KWQLoader.mm
+++ b/WebCore/kwq/KWQLoader.mm
@@ -112,7 +112,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
}
WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
- WebResourceHandle *handle = [bridge startLoadingResource:resourceLoader withURL:URL];
+ id <WebCoreResourceHandle> handle = [bridge startLoadingResource:resourceLoader withURL:URL];
[resourceLoader release];
if (handle == nil) {
diff --git a/WebCore/kwq/KWQLoaderImpl.mm b/WebCore/kwq/KWQLoaderImpl.mm
index 2dc62ac..9112291 100644
--- a/WebCore/kwq/KWQLoaderImpl.mm
+++ b/WebCore/kwq/KWQLoaderImpl.mm
@@ -112,7 +112,7 @@ bool KWQServeRequest(Loader *loader, Request *request, TransferJob *job)
}
WebCoreResourceLoader *resourceLoader = [[WebCoreResourceLoader alloc] initWithLoader:loader job:job];
- WebResourceHandle *handle = [bridge startLoadingResource:resourceLoader withURL:URL];
+ id <WebCoreResourceHandle> handle = [bridge startLoadingResource:resourceLoader withURL:URL];
[resourceLoader release];
if (handle == nil) {
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index e43d8a8..ba0e051 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -29,6 +29,11 @@
#import <qregexp.h>
#import <stdio.h>
+#define CHECK_FOR_HANDLE_LEAKS 0
+
+// Oops. I jumped the gun. Here's a stopgap.
+#define FATAL(x) ((void)0)
+
// Why can't I find this in a header anywhere? It's too bad we have
// to wire knowledge of allocation sizes, but it makes a huge diffence.
extern "C" {
@@ -215,18 +220,8 @@ static void freeHandle(void *free);
static const int caseDelta = ('a' - 'A');
#define ASCII_TO_LOWER (p) ((p >= 'A' && p <= 'Z') ? (p + caseDelta) : p)
-#ifdef NDEBUG
-#define QSTRING_FAILURE(str_expr) ((void)0)
-#else
-#define QSTRING_FAILURE(str_expr) \
- do { \
- struct rlimit _rlimit = {RLIM_INFINITY, RLIM_INFINITY}; \
- setrlimit(RLIMIT_CORE, &_rlimit); \
- fprintf(stderr, "QSTRING FAILURE: (%s:%d %s) %s\n", __FILE__, __LINE__, __PRETTY_FUNCTION__, str_expr); \
- raise(SIGQUIT); \
- } while (0)
-#endif //NDEBUG
-
+QStringData *QString::shared_null = 0;
+QStringData **QString::shared_null_handle = 0;
// -------------------------------------------------------------------------
// Utility functions
@@ -433,24 +428,11 @@ void QStringData::initialize(const char *a, uint l)
}
}
-
-QStringData *QString::shared_null = 0;
-QStringData **QString::shared_null_handle = 0;
-QStringData **QString::makeSharedNullHandle()
-{
- if (!shared_null_handle){
- shared_null_handle = (QStringData **)allocateHandle();
- *shared_null_handle = makeSharedNull();
- }
- return shared_null_handle;
-}
-
-QStringData* QString::makeSharedNull()
+QStringData *QString::makeSharedNull()
{
- if (!shared_null){
- shared_null = new QStringData();
+ if (!shared_null) {
+ shared_null = new QStringData;
shared_null->ref();
- shared_null->_length = 0;
shared_null->_maxAscii = 0;
shared_null->_maxUnicode = 0;
shared_null->_unicode = (QChar *)&shared_null->_internalBuffer[0];
@@ -460,14 +442,23 @@ QStringData* QString::makeSharedNull()
return shared_null;
}
+QStringData **QString::makeSharedNullHandle()
+{
+ if (!shared_null_handle) {
+ shared_null_handle = (QStringData **)allocateHandle();
+ *shared_null_handle = makeSharedNull();
+ }
+ return shared_null_handle;
+}
+
QStringData::~QStringData()
{
KWQ_ASSERT(refCount == 0);
// Ack! The destcructor will be called when the QString is deleted.
- if ( _unicode && !_isUnicodeInternal )
+ if ( _unicode && !_isUnicodeInternal)
DELETE_QCHAR (_unicode);
- if ( _ascii && !_isAsciiInternal )
+ if ( _ascii && !_isAsciiInternal)
DELETE_CHAR (_ascii);
}
@@ -514,7 +505,7 @@ void QStringData::increaseAsciiSize(uint size)
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
if (prev)
DELETE_CHAR(prev);
@@ -565,7 +556,7 @@ void QStringData::increaseUnicodeSize(uint size)
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
if (prev)
DELETE_QCHAR(prev);
@@ -619,7 +610,7 @@ char *QStringData::makeAscii()
_isAsciiValid = 1;
}
else if (!_isAsciiValid)
- QSTRING_FAILURE("ASCII character cache not valid");
+ FATAL("ASCII character cache not valid");
return _ascii;
}
@@ -665,7 +656,7 @@ QChar *QStringData::makeUnicode()
_isUnicodeValid = 1;
}
else if (!_isUnicodeValid)
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return _unicode;
}
@@ -773,7 +764,7 @@ NSString *QString::getNSString() const
return [(NSString *)CFStringCreateWithCString(kCFAllocatorDefault, ascii(), kCFStringEncodingISOLatin1) autorelease];
}
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return nil;
}
@@ -781,9 +772,8 @@ const QString QString::null;
QString::~QString()
{
- bool needToFreeHandle = false;
- QStringData *oldData = (*dataHandle);
QStringData **oldHandle = dataHandle;
+ QStringData *oldData = *oldHandle;
KWQ_ASSERT(oldHandle);
KWQ_ASSERT(oldData->refCount != 0);
@@ -791,8 +781,7 @@ QString::~QString()
// Only free the handle if no other string has a reference to the
// data. The handle will be freed by the string that has the
// last reference to data.
- if (dataHandle != makeSharedNullHandle() && oldData->refCount == 1)
- needToFreeHandle = true;
+ bool needToFreeHandle = oldHandle != shared_null_handle && oldData->refCount == 1;
// Copy our internal data if necessary, other strings still need it.
detachInternal();
@@ -804,7 +793,7 @@ QString::~QString()
KWQ_ASSERT(oldData != &internalData || oldData->refCount == 0);
if (needToFreeHandle)
- freeHandle (oldHandle);
+ freeHandle(oldHandle);
dataHandle = 0;
}
@@ -813,7 +802,7 @@ QString::~QString()
QString::QString()
{
#ifdef QSTRING_DEBUG_ALLOCATIONS
- countInstance (&dataHandle);
+ countInstance(&dataHandle);
#endif
internalData.deref();
dataHandle = makeSharedNullHandle();
@@ -869,7 +858,7 @@ QString::QString(const QChar *unicode, uint length)
#ifdef QSTRING_DEBUG_ALLOCATIONS
countInstance (&dataHandle);
#endif
- if ( !unicode && !length ) {
+ if (!unicode && !length) {
internalData.deref();
dataHandle = makeSharedNullHandle();
dataHandle[0]->ref();
@@ -917,22 +906,17 @@ QString::QString(const QString &qs) : dataHandle(qs.dataHandle)
QString &QString::operator=(const QString &qs)
{
- bool needToFreeHandle = false;
-
if (this == &qs)
return *this;
- // free our handle if it isn't the shared
- // null handle, and if no-one else is using
- // it.
- if (dataHandle != makeSharedNullHandle() && dataHandle[0]->refCount == 1)
- needToFreeHandle = true;
+ // Free our handle if it isn't the shared null handle, and if no-one else is using it.
+ bool needToFreeHandle = dataHandle != shared_null_handle && dataHandle[0]->refCount == 1;
qs.data()->ref();
deref();
if (needToFreeHandle)
- freeHandle (dataHandle);
+ freeHandle(dataHandle);
dataHandle = qs.dataHandle;
@@ -961,7 +945,7 @@ QString &QString::operator=(char ch)
inline QChar QString::at(uint i) const
{
- QStringData *thisData = (*dataHandle);
+ QStringData *thisData = *dataHandle;
if (i >= thisData->_length)
return QChar::null;
@@ -979,7 +963,7 @@ inline QChar QString::at(uint i) const
return thisData->_unicode[i];
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return QChar::null;
}
@@ -1015,7 +999,7 @@ bool QString::startsWith( const QString& s ) const
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return TRUE;
}
@@ -1070,7 +1054,7 @@ int QString::find(QChar qc, int index) const
else if (dataHandle[0]->_isUnicodeValid)
return find(QString(qc), index, TRUE);
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
// Should never get here. Needed for compiler.
return -1;
@@ -1094,7 +1078,7 @@ int QString::find(char ch, int index) const
else if (dataHandle[0]->_isUnicodeValid)
return find(QChar(ch), index, TRUE);
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return -1;
}
@@ -1288,7 +1272,7 @@ int QString::findRev(char ch, int index) const
else if (dataHandle[0]->_isUnicodeValid)
return findRev(QString(QChar(ch)), index);
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return -1;
}
@@ -1407,7 +1391,7 @@ int QString::contains( QChar c, bool cs ) const
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return count;
}
@@ -1442,7 +1426,7 @@ int QString::contains(const char *str, bool caseSensitive) const
else if (dataHandle[0]->_isUnicodeValid)
return contains(QString(str),caseSensitive);
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return 0;
}
@@ -1777,7 +1761,7 @@ QString QString::lower() const
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
}
return s;
}
@@ -1814,7 +1798,7 @@ QString QString::stripWhiteSpace() const
memcpy( (QChar *)result.data()->unicode(), &unicode()[start], sizeof(QChar)*l );
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return result;
}
@@ -1869,7 +1853,7 @@ QString QString::simplifyWhiteSpace() const
result.truncate( outc );
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return result;
}
@@ -1884,24 +1868,19 @@ QString &QString::setUnicode(const QChar *uni, uint len)
{
detach();
- bool needToFreeHandle = false;
-
- // free our handle if it isn't the shared
- // null handle, and if no-one else is using
- // it.
- if (dataHandle != makeSharedNullHandle() && dataHandle[0]->refCount == 1)
- needToFreeHandle = true;
+ // Free our handle if it isn't the shared null handle, and if no-one else is using it.
+ bool needToFreeHandle = dataHandle != shared_null_handle && dataHandle[0]->refCount == 1;
- if ( len == 0 ) {
+ if (len == 0) {
deref();
if (needToFreeHandle)
- freeHandle (dataHandle);
+ freeHandle(dataHandle);
dataHandle = makeSharedNullHandle();
dataHandle[0]->ref();
} else if (len > dataHandle[0]->_maxUnicode || dataHandle[0]->refCount != 1 || !dataHandle[0]->_isUnicodeValid) {
deref();
if (needToFreeHandle)
- freeHandle (dataHandle);
+ freeHandle(dataHandle);
dataHandle = (QStringData **)allocateHandle();
*dataHandle = new QStringData(uni, len);
dataHandle[0]->_isHeapAllocated = 1;
@@ -1925,24 +1904,19 @@ QString &QString::setLatin1(const char *str, int len)
detach();
- bool needToFreeHandle = false;
-
- // free our handle if it isn't the shared
- // null handle, and if no-one else is using
- // it.
- if (dataHandle != makeSharedNullHandle() && dataHandle[0]->refCount == 1)
- needToFreeHandle = true;
+ // Free our handle if it isn't the shared null handle, and if no-one else is using it.
+ bool needToFreeHandle = dataHandle != shared_null_handle && dataHandle[0]->refCount == 1;
if (len == 0) {
deref();
if (needToFreeHandle)
- freeHandle (dataHandle);
+ freeHandle(dataHandle);
dataHandle = makeSharedNullHandle();
dataHandle[0]->ref();
} else if (len+1 > (int)dataHandle[0]->_maxAscii || dataHandle[0]->refCount != 1 || !dataHandle[0]->_isAsciiValid) {
deref();
if (needToFreeHandle)
- freeHandle (dataHandle);
+ freeHandle(dataHandle);
dataHandle = (QStringData **)allocateHandle();
*dataHandle = new QStringData(str,len);
dataHandle[0]->_isHeapAllocated = 1;
@@ -2007,7 +1981,8 @@ QString &QString::sprintf(const char *format, ...)
// Arrange for storage for the resulting string.
detach();
if (len >= dataHandle[0]->_maxAscii || dataHandle[0]->refCount != 1 || !dataHandle[0]->_isAsciiValid) {
- bool needToFreeHandle = dataHandle != makeSharedNullHandle() && dataHandle[0]->refCount == 1;
+ // Free our handle if it isn't the shared null handle, and if no-one else is using it.
+ bool needToFreeHandle = dataHandle != shared_null_handle && dataHandle[0]->refCount == 1;
deref();
if (needToFreeHandle)
freeHandle(dataHandle);
@@ -2078,7 +2053,7 @@ QString &QString::insert(uint index, const char *insertChars, uint insertLength)
*target++ = *insertChars++;
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return *this;
}
@@ -2207,7 +2182,7 @@ QString &QString::insert(uint index, char ch)
targetChars[index] = (QChar)ch;
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
return *this;
}
@@ -2215,9 +2190,10 @@ QString &QString::insert(uint index, char ch)
void QString::detachInternal()
{
- QStringData *oldData = (*dataHandle), *newData = 0;
+ QStringData *oldData = *dataHandle;
- if (oldData->refCount > 1 && oldData == &internalData){
+ if (oldData->refCount > 1 && oldData == &internalData) {
+ QStringData *newData;
if (oldData->_isAsciiValid)
newData = new QStringData (oldData->ascii(), oldData->_length);
else if (oldData->_isUnicodeValid){
@@ -2231,41 +2207,40 @@ void QString::detachInternal()
newData = new QStringData (oldData->unicode(), oldData->_length);
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
newData->_isHeapAllocated = 1;
newData->refCount = oldData->refCount - 1;
*dataHandle = newData;
- oldData->refCount -= (oldData->refCount - 1);
+ oldData->refCount = 1;
}
}
-// Copy QStringData if necessary. Must be called before
-// the string data is mutated.
+// Copy QStringData if necessary. Must be called before the string data is mutated.
void QString::detach()
{
- if (dataHandle[0]->refCount == 1 && dataHandle != shared_null_handle)
+ if (dataHandle != shared_null_handle && dataHandle[0]->refCount == 1)
return;
#ifdef QSTRING_DEBUG_ALLOCATIONS
stringDataDetachments++;
#endif
- QStringData *oldData = (*dataHandle), *newData = 0;
+ QStringData *oldData = *dataHandle;
// Copy data for this string so we can safely mutate it,
// and put it in a new handle.
+ QStringData *newData;
if (oldData->_isAsciiValid)
newData = new QStringData (oldData->ascii(), oldData->_length);
else if (oldData->_isUnicodeValid)
newData = new QStringData (oldData->unicode(), oldData->_length);
- else if (oldData == shared_null){
- newData = new QStringData ();
+ else if (oldData == shared_null) {
+ newData = new QStringData;
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
- // We must copy our internal data so other strings
- // can still safely reference it.
+ // Copy our internal data so other strings can still safely reference it.
detachInternal();
newData->_isHeapAllocated = 1;
@@ -2301,7 +2276,7 @@ QString &QString::remove(uint index, uint len)
setLength( olen-len );
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
}
return *this;
}
@@ -2355,13 +2330,12 @@ void QString::forceUnicode()
// Increase buffer size if necessary. Newly allocated
// bytes will contain garbage.
-void QString::setLength( uint newLen )
+void QString::setLength(uint newLen)
{
detach();
- // If we going to change the length, we'll need our
- // own data.
- if (dataHandle == makeSharedNullHandle()){
+ // If we going to change the length, we'll need our own data.
+ if (dataHandle == shared_null_handle) {
deref();
dataHandle = (QStringData **)allocateHandle();
*dataHandle = new QStringData();
@@ -2386,7 +2360,7 @@ void QString::setLength( uint newLen )
}
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
dataHandle[0]->_length = newLen;
}
@@ -2405,14 +2379,20 @@ void QString::fill(QChar qc, int len)
#ifdef QSTRING_DEBUG_UNICODE
forceUnicode();
#endif
+
// len == -1 means fill to string length.
- if ( len < 0 )
+ if (len < 0) {
len = dataHandle[0]->_length;
+ }
- if ( len == 0 ) {
- deref();
- dataHandle = makeSharedNullHandle();
- dataHandle[0]->ref();
+ if (len == 0) {
+ if (dataHandle != shared_null_handle) {
+ KWQ_ASSERT(dataHandle[0]->refCount == 1);
+ deref();
+ freeHandle(dataHandle);
+ dataHandle = makeSharedNullHandle();
+ shared_null->ref();
+ }
} else {
if (dataHandle[0]->_isAsciiValid && IS_ASCII_QCHAR(qc)){
setLength(len);
@@ -2462,7 +2442,7 @@ QString &QString::operator+=(const QString &qs)
*tp++ = *fp++;
}
else
- QSTRING_FAILURE("invalid character cache");
+ FATAL("invalid character cache");
dataHandle[0]->_length += qs.data()->_length;
dataHandle[0]->_isAsciiValid = 0;
return *this;
@@ -2681,7 +2661,7 @@ HandleNode *_allocateNode(HandlePageNode *pageNode)
// Check to see if we're out of nodes.
if (freeNodes == 0) {
- QSTRING_FAILURE("out of nodes");
+ FATAL("out of nodes");
return 0;
}
@@ -2710,6 +2690,10 @@ HandleNode *_allocateNode(HandlePageNode *pageNode)
void *allocateHandle()
{
+#if CHECK_FOR_HANDLE_LEAKS
+ return malloc(sizeof(void *));
+#endif
+
_initializeHandleNodes();
#ifdef QSTRING_DEBUG_ALLOCATIONS
@@ -2722,6 +2706,11 @@ void *allocateHandle()
void freeHandle(void *_free)
{
+#if CHECK_FOR_HANDLE_LEAKS
+ free(_free);
+ return;
+#endif
+
HandleNode *free = (HandleNode *)_free;
HandleNode *base = (HandleNode *)trunc_page((uint)free);
HandleNode *freeNodes = base[0].type.freeNodes;
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 6564ad6..82def13 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -47,10 +47,10 @@ typedef khtml::RenderPart KHTMLRenderPart;
@class WebError;
@class WebFrame;
- at class WebResourceHandle;
@protocol WebCoreDOMTreeCopier;
@protocol WebCoreRenderTreeCopier;
+ at protocol WebCoreResourceHandle;
@protocol WebCoreResourceLoader;
#define WebCoreContextLinkURL @"WebContextLinkURL"
@@ -167,7 +167,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (NSWindow *)window;
- (void)setWindowFrame:(NSRect)frame;
-- (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL;
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)loader withURL:(NSURL *)URL;
- (void)reportError:(WebError *)error;
- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes;
- (BOOL)isReloading;
diff --git a/WebCore/kwq/WebCoreResourceLoader.h b/WebCore/kwq/WebCoreResourceLoader.h
index d7e3e23..7508c79 100644
--- a/WebCore/kwq/WebCoreResourceLoader.h
+++ b/WebCore/kwq/WebCoreResourceLoader.h
@@ -34,3 +34,9 @@
- (void)finish;
@end
+
+ at protocol WebCoreResourceHandle <NSObject>
+
+- (void)cancel;
+
+ at end
diff --git a/WebCore/kwq/character-sets.txt b/WebCore/kwq/character-sets.txt
index 7511042..331dc97 100644
--- a/WebCore/kwq/character-sets.txt
+++ b/WebCore/kwq/character-sets.txt
@@ -2,8 +2,8 @@
===================================================================
CHARACTER SETS
-(last updated 2001 August 23)
-(Apple Changes: added MIBenum: 1004 for ISO-10646-J-1, 2002 July 26)
+(last updated 2002-06-14)
+(Apple Changes: added MIBenum: 1004 for ISO-10646-J-1, 2002-06-26)
These are the official names for character sets that may be used in
the Internet and may be referred to in Internet documentation. These
@@ -26,7 +26,7 @@ that have been standardized by some standard setting organization.
This region is intended for standards that do not have subset
implementations. The second region (1000-1999) is for the Unicode and
ISO/IEC 10646 coded character sets together with a specification of a
-(set of) sub-repetoires that may occur. The third region (>1999) is
+(set of) sub-repertoires that may occur. The third region (>1999) is
intended for vendor specific coded character sets.
Assigned MIB enum Numbers
@@ -1195,35 +1195,35 @@ Source: RFC 2319
Name: IBM00858
MIBenum: 2089
-Source: IBM See (.../assignments/character-set-info/IBM00858) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00858) [Mahdi]
Alias: CCSID00858
Alias: CP00858
Alias: PC-Multilingual-850+euro
Name: IBM00924
MIBenum: 2090
-Source: IBM See (.../assignments/character-set-info/IBM00924) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00924) [Mahdi]
Alias: CCSID00924
Alias: CP00924
Alias: ebcdic-Latin9--euro
Name: IBM01140
MIBenum: 2091
-Source: IBM See (.../assignments/character-set-info/IBM01140) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01140) [Mahdi]
Alias: CCSID01140
Alias: CP01140
Alias: ebcdic-us-37+euro
Name: IBM01141
MIBenum: 2092
-Source: IBM See (.../assignments/character-set-info/IBM01141) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01141) [Mahdi]
Alias: CCSID01141
Alias: CP01141
Alias: ebcdic-de-273+euro
Name: IBM01142
MIBenum: 2093
-Source: IBM See (.../assignments/character-set-info/IBM01142) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01142) [Mahdi]
Alias: CCSID01142
Alias: CP01142
Alias: ebcdic-dk-277+euro
@@ -1231,7 +1231,7 @@ Alias: ebcdic-no-277+euro
Name: IBM01143
MIBenum: 2094
-Source: IBM See (.../assignments/character-set-info/IBM01143) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01143) [Mahdi]
Alias: CCSID01143
Alias: CP01143
Alias: ebcdic-fi-278+euro
@@ -1239,49 +1239,49 @@ Alias: ebcdic-se-278+euro
Name: IBM01144
MIBenum: 2095
-Source: IBM See (.../assignments/character-set-info/IBM01144) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01144) [Mahdi]
Alias: CCSID01144
Alias: CP01144
Alias: ebcdic-it-280+euro
Name: IBM01145
MIBenum: 2096
-Source: IBM See (.../assignments/character-set-info/IBM01145) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01145) [Mahdi]
Alias: CCSID01145
Alias: CP01145
Alias: ebcdic-es-284+euro
Name: IBM01146
MIBenum: 2097
-Source: IBM See (.../assignments/character-set-info/IBM01146) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01146) [Mahdi]
Alias: CCSID01146
Alias: CP01146
Alias: ebcdic-gb-285+euro
Name: IBM01147
MIBenum: 2098
-Source: IBM See (.../assignments/character-set-info/IBM01147) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01147) [Mahdi]
Alias: CCSID01147
Alias: CP01147
Alias: ebcdic-fr-297+euro
Name: IBM01148
MIBenum: 2099
-Source: IBM See (.../assignments/character-set-info/IBM01148) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01148) [Mahdi]
Alias: CCSID01148
Alias: CP01148
Alias: ebcdic-international-500+euro
Name: IBM01149
MIBenum: 2100
-Source: IBM See (.../assignments/character-set-info/IBM01149) [Mahdi]
+Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01149) [Mahdi]
Alias: CCSID01149
Alias: CP01149
Alias: ebcdic-is-871+euro
Name: Big5-HKSCS
MIBenum: 2101
-Source: See (.../assignments/character-set-info/Big5-HKSCS) [Yick]
+Source: See (http://www.iana.org/assignments/charset-reg/Big5-HKSCS) [Yick]
Alias: None
Name: UNICODE-1-1 [RFC1641]
@@ -1291,7 +1291,7 @@ Alias: csUnicode11
Name: SCSU
MIBenum: 1011
-Source: SCSU See (.../assignments/character-set-info/SCSU) [Scherer]
+Source: SCSU See (http://www.iana.org/assignments/charset-reg/SCSU) [Scherer]
Alias: None
Name: UTF-7 [RFC2152]
@@ -1314,6 +1314,26 @@ MIBenum: 1015
Source: RFC 2781
Alias: None
+Name: CESU-8 [Phipps]
+MIBenum: 1016
+Source: <http://www.unicode.org/unicode/reports/tr26>
+Alias: csCESU-8
+
+Name: UTF-32 [Davis]
+MIBenum: 1017
+Source: <http://www.unicode.org/unicode/reports/tr19/>
+Alias: None
+
+Name: UTF-32BE [Davis]
+MIBenum: 1018
+Source: <http://www.unicode.org/unicode/reports/tr19/>
+Alias: None
+
+Name: UTF-32LE [Davis]
+MIBenum: 1019
+Source: <http://www.unicode.org/unicode/reports/tr19/>
+Alias: None
+
Name: UNICODE-1-1-UTF-7 [RFC1642]
MIBenum: 103
Source: RFC 1642
@@ -1326,12 +1346,12 @@ Alias: None
Name: ISO-8859-13
MIBenum: 109
-Source: ISO See (...assignments/character-set-info/iso-8859-13)[Tumasonis]
+Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-13)[Tumasonis]
Alias: None
Name: ISO-8859-14
MIBenum: 110
-Source: ISO See (...assignments/character-set-info/iso-8859-14) [Simonsen]
+Source: ISO See (http://www.iana.org/assignments/charset-reg/iso-8859-14) [Simonsen]
Alias: iso-ir-199
Alias: ISO_8859-14:1998
Alias: ISO_8859-14
@@ -1349,6 +1369,20 @@ MIBenum: 112
Source: ISO
Alias:
+Name: GBK
+MIBenum: 113
+Source: Chinese IT Standardization Technical Committee
+ Please see: <http://www.iana.org/assignments/charset-reg/GBK>
+Alias: CP936
+Alias: MS936
+Alias: windows-936
+
+Name: GB18030
+MIBenum: 114
+Source: Chinese IT Standardization Technical Committee
+ Please see: <http://www.iana.org/assignments/charset-reg/GB18030>
+Alias: None
+
Name: JIS_Encoding
MIBenum: 16
Source: JIS X 0202-1991. Uses ISO 2022 escape sequences to
@@ -1424,7 +1458,7 @@ Alias: csUnicodeIBM1261
Name: ISO-Unicode-IBM-1268
MIBenum: 1006
Source: IBM Latin-4 Extended Presentation Set, GCSGID: 1268
-Alias: csUnidoceIBM1268
+Alias: csUnicodeIBM1268
Name: ISO-Unicode-IBM-1276
MIBenum: 1007
@@ -1587,47 +1621,47 @@ Alias: csBig5
Name: windows-1250
MIBenum: 2250
-Source: Microsoft (see ../character-set-info/windows-1250) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1250) [Lazhintseva]
Alias: None
Name: windows-1251
MIBenum: 2251
-Source: Microsoft (see ../character-set-info/windows-1251) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1251) [Lazhintseva]
Alias: None
Name: windows-1252
MIBenum: 2252
-Source: Microsoft (see ../character-set-info/windows-1252) [Wendt]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1252) [Wendt]
Alias: None
Name: windows-1253
MIBenum: 2253
-Source: Microsoft (see ../character-set-info/windows-1253) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1253) [Lazhintseva]
Alias: None
Name: windows-1254
MIBenum: 2254
-Source: Microsoft (see ../character-set-info/windows-1254) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1254) [Lazhintseva]
Alias: None
Name: windows-1255
MIBenum: 2255
-Source: Microsoft (see ../character-set-info/windows-1255) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1255) [Lazhintseva]
Alias: None
Name: windows-1256
MIBenum: 2256
-Source: Microsoft (see ../character-set-info/windows-1256) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1256) [Lazhintseva]
Alias: None
Name: windows-1257
MIBenum: 2257
-Source: Microsoft (see ../character-set-info/windows-1257) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1257) [Lazhintseva]
Alias: None
Name: windows-1258
MIBenum: 2258
-Source: Microsoft (see ../character-set-info/windows-1258) [Lazhintseva]
+Source: Microsoft (http://www.iana.org/assignments/charset-reg/windows-1258) [Lazhintseva]
Alias: None
Name: TIS-620
@@ -1720,15 +1754,19 @@ PEOPLE
[Choi] Woohyong Choi <whchoi at cosmos.kaist.ac.kr>
+[Davis] Mark Davis, <mark at unicode.org>, April 2002.
+
[Lazhintseva] Katya Lazhintseva, <katyal at MICROSOFT.com>, May 1996.
[Mahdi] Tamer Mahdi, <tamer at ca.ibm.com>, August 2000.
[Murai] Jun Murai <jun at wide.ad.jp>
+[Nussbacher] Hank Nussbacher, <hank at vm.tau.ac.il>
+
[Ohta] Masataka Ohta, <mohta at cc.titech.ac.jp>, July 1995.
-[Nussbacher] Hank Nussbacher, <hank at vm.tau.ac.il>
+[Phipps] Toby Phipps, <tphipps at peoplesoft.com>, March 2002.
[Pond] Rick Pond, <rickpond at vnet.ibm.com> March 1997.
@@ -1752,3 +1790,4 @@ PEOPLE
+
diff --git a/WebCore/kwq/kio/jobclasses.h b/WebCore/kwq/kio/jobclasses.h
index 2c6b4b1..9bb1f38 100644
--- a/WebCore/kwq/kio/jobclasses.h
+++ b/WebCore/kwq/kio/jobclasses.h
@@ -31,9 +31,11 @@
#include <qstring.h>
#ifdef __OBJC__
- at class WebResourceHandle;
+ at protocol WebCoreResourceHandle;
+typedef id <WebCoreResourceHandle> WebCoreResourceHandlePtr;
#else
-class WebResourceHandle;
+class WebCoreResourceHandle;
+typedef WebCoreResourceHandle *WebCoreResourceHandlePtr;
#endif
namespace KIO {
@@ -60,8 +62,8 @@ public:
void addMetaData(const QString &key, const QString &value);
void kill();
- void setHandle(WebResourceHandle *);
- WebResourceHandle *handle() const;
+ void setHandle(WebCoreResourceHandlePtr);
+ WebCoreResourceHandlePtr handle() const;
KURL url() const;
diff --git a/WebCore/kwq/mac-encodings.txt b/WebCore/kwq/mac-encodings.txt
index ac6aaa4..65a8134 100644
--- a/WebCore/kwq/mac-encodings.txt
+++ b/WebCore/kwq/mac-encodings.txt
@@ -4,15 +4,18 @@
# that group.
MacRoman: macintosh, x-mac-roman
-WindowsLatin1: windows-1252, x-ansi
+WindowsLatin1: windows-1252, winlatin1, x-ansi
ISOLatin1: iso-8859-1, iso8859-1
NextStepLatin: x-nextstep
ASCII: iso-ir-6us, us-ascii
-Unicode: iso-10646-ucs-2 # utf-16be, unicodeFFFE, unicode? (would this help us?)
- # Note the bogus entry to make UTF-16 mean UTF-8.
- # We do this because Internet Explorer does, and because web pages say UTF-16 and mean UTF-8.
- # See bug 2969378 and http://zingermans.com/ for a concrete example.
- # It's not clear what to do about 16-bit encodings in general.
+Unicode: iso-10646-ucs-2 # utf-16be, unicodeFFFE, unicode? (would adding these help us?)
+# Note the bogus entry below that makes UTF-16 mean UTF-8.
+# We do this because Internet Explorer does, and because web pages say UTF-16 and mean UTF-8.
+# See bug 2969378 and http://zingermans.com/ for a concrete example.
+# It's not clear what to do about 16-bit encodings in general.
+# We may have to add code to deal with encodings vs. character sets
+# that understands that characters sets in <head> can't change to a 16-bit
+# encoding, while character sets from the server can.
UTF8: unicode-1-1-utf-8, unicode-2-0-utf-8, utf-16, utf-8, x-unicode-2-0-utf-8
NonLossyASCII
@@ -97,18 +100,18 @@ DOSRussian: cp866
DOSGreek2: ibm869
DOSThai: cp874, dos-874, tis-620, windows-874
DOSJapanese: cp932
-DOSChineseSimplif: cp936
+DOSChineseSimplif
DOSKorean: cp949
DOSChineseTrad: cp950
-WindowsLatin2: windows-1250, x-cp1250
-WindowsCyrillic: windows-1251, x-cp1251
-WindowsGreek: windows-1253
-WindowsLatin5: windows-1254
-WindowsHebrew: windows-1255
-WindowsArabic: cp1256, windows-1256
-WindowsBalticRim: windows-1257
+WindowsLatin2: windows-1250, winlatin2, x-cp1250
+WindowsCyrillic: wincyrillic, windows-1251, x-cp1251
+WindowsGreek: windows-1253, wingreek
+WindowsLatin5: windows-1254, winturkish
+WindowsHebrew: windows-1255, winhebrew
+WindowsArabic: cp1256, winarabic, windows-1256
+WindowsBalticRim: winbaltic, windows-1257
WindowsKoreanJohab: johab
-WindowsVietnamese: windows-1258
+WindowsVietnamese: windows-1258, winvietnamese
JIS_X0201_76: jis_x0201
JIS_X0208_83: jis_x0208-1983
@@ -148,6 +151,21 @@ Big5_HKSCS_1999: big5-hkscs
EBCDIC_US
EBCDIC_CP037: cp037
- # There doesn't seem to be a kCFStringEncoding constant for this one.
- # In fact, I got this value from Mail source code, and I'm not sure how it works.
+# There doesn't seem to be a kCFStringEncoding constant for this one.
+# In fact, I got this value from Mail source code, and I'm not sure how or if it works.
0xAFE: japanese-autodetect
+
+# I got these additional items from the Perl module I18N-Charset-1.17,
+# but could not figure out what to do with them.
+#
+# Adobe-Standard-Encoding === adobe-standard
+# Adobe-Symbol-Encoding === adobe-symbol
+# EBCDIC-ES === ebcdic-cp-es
+# EBCDIC-FR === ebcdic-cp-fr
+# EBCDIC-IT === ebcdic-cp-it
+# EBCDIC-UK === ebcdic-cp-gb
+# EBCDIC-US === ebcdic-cp-us
+# EBCDIC-FI-SE === ebcdic-cp-fi
+# UTF-7 === Unicode-2-0-utf-7
+# ISO-10646-UCS-2 === ucs2
+# ISO-10646-UCS-4 === ucs4
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 3538ae8..886e9f7 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,4 +1,58 @@
-2002-09-06 Richard Williamson (Home) <rjw at apple.com>
+2002-09-06 Darin Adler <darin at apple.com>
+
+ Almost weaned WebKit entirely from the handleDidBeginLoading and handleDidCancelLoading
+ loading callbacks. We are planning to remove both of them.
+
+ * Plugins.subproj/WebPluginStream.m:
+ (-[WebNetscapePluginStream startLoad]): Call _didStartLoading here so we don't need
+ to rely on handleDidBeginLoading any more.
+ (-[WebNetscapePluginStream stop]): Call cancel here so we don't need to rely on
+ handleDidCancelLoading any more.
+ (-[WebNetscapePluginStream handleDidBeginLoading:]): Empty out.
+ (-[WebNetscapePluginStream handleDidFinishLoading:]): Nil out resource here.
+ (-[WebNetscapePluginStream handleDidCancelLoading:]): Empty out.
+ (-[WebNetscapePluginStream cancel]): Put cancel code here.
+ (-[WebNetscapePluginStream handleDidFailLoading:withError:]): Nil out resource here.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge startLoadingResource:withURL:]): Change to use WebCoreResourceHandle.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.h: Change to use WebCoreResourceHandle.
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (-[WebSubresourceClient dealloc]): Release handle too, now that we have it.
+ (-[WebSubresourceClient receivedProgressWithComplete:]): Moved up here and removed handle
+ parameter.
+ (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Do work here so
+ we don't need to rely on handleDidBeginLoading any more.
+ (-[WebSubresourceClient receivedError:]): Removed handle parameter.
+ (-[WebSubresourceClient handleWillUseUserAgent:forURL:]):
+ (-[WebSubresourceClient handleDidBeginLoading:]): Emptied out.
+ (-[WebSubresourceClient handleDidCancelLoading:]): Updated, still needs to be emptied out.
+ (-[WebSubresourceClient handleDidFinishLoading:]): Nil out handle.
+ (-[WebSubresourceClient handleDidFailLoading:withError:]): Nil out handle.
+ (-[WebSubresourceClient cancel]): New method, used by WebCore.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer widthForCharacters:length:]): Moved up in the file to fix build failure.
+
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _startLoading:]): Call didStartLoadingWithURL so we don't have to
+ rely on handleDidBeginLoading.
+ (-[WebDataSource _stopLoading]): Call didCancelWithHandle so we don't have to rely
+ on handleDidCancelLoading.
+
+ * WebView.subproj/WebMainResourceClient.h: Add didStartLoadingWithURL and
+ didCancelWithHandle to the public methods.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient initWithDataSource:]):
+ (-[WebMainResourceClient handleDidBeginLoading:]): Empty out.
+ (-[WebMainResourceClient didCancelWithHandle:]): Move the bulk of handleDidCancelLoading here.
+ (-[WebMainResourceClient handleDidCancelLoading:]): Empty out.
+
+ * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Move the mouse up a little
+ bit so it's "on" the dragged area, but not over the text.
+
+2002-09-06 Richard Williamson <rjw at apple.com>
Added support for khtml's justified text drawing. Additional padding is distributed
to space widths. (Sites like www.osnews.com now render correctly.)
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 3538ae8..886e9f7 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,4 +1,58 @@
-2002-09-06 Richard Williamson (Home) <rjw at apple.com>
+2002-09-06 Darin Adler <darin at apple.com>
+
+ Almost weaned WebKit entirely from the handleDidBeginLoading and handleDidCancelLoading
+ loading callbacks. We are planning to remove both of them.
+
+ * Plugins.subproj/WebPluginStream.m:
+ (-[WebNetscapePluginStream startLoad]): Call _didStartLoading here so we don't need
+ to rely on handleDidBeginLoading any more.
+ (-[WebNetscapePluginStream stop]): Call cancel here so we don't need to rely on
+ handleDidCancelLoading any more.
+ (-[WebNetscapePluginStream handleDidBeginLoading:]): Empty out.
+ (-[WebNetscapePluginStream handleDidFinishLoading:]): Nil out resource here.
+ (-[WebNetscapePluginStream handleDidCancelLoading:]): Empty out.
+ (-[WebNetscapePluginStream cancel]): Put cancel code here.
+ (-[WebNetscapePluginStream handleDidFailLoading:withError:]): Nil out resource here.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge startLoadingResource:withURL:]): Change to use WebCoreResourceHandle.
+
+ * WebCoreSupport.subproj/WebSubresourceClient.h: Change to use WebCoreResourceHandle.
+ * WebCoreSupport.subproj/WebSubresourceClient.m:
+ (-[WebSubresourceClient dealloc]): Release handle too, now that we have it.
+ (-[WebSubresourceClient receivedProgressWithComplete:]): Moved up here and removed handle
+ parameter.
+ (+[WebSubresourceClient startLoadingResource:withURL:dataSource:]): Do work here so
+ we don't need to rely on handleDidBeginLoading any more.
+ (-[WebSubresourceClient receivedError:]): Removed handle parameter.
+ (-[WebSubresourceClient handleWillUseUserAgent:forURL:]):
+ (-[WebSubresourceClient handleDidBeginLoading:]): Emptied out.
+ (-[WebSubresourceClient handleDidCancelLoading:]): Updated, still needs to be emptied out.
+ (-[WebSubresourceClient handleDidFinishLoading:]): Nil out handle.
+ (-[WebSubresourceClient handleDidFailLoading:withError:]): Nil out handle.
+ (-[WebSubresourceClient cancel]): New method, used by WebCore.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer widthForCharacters:length:]): Moved up in the file to fix build failure.
+
+ * WebView.subproj/WebDataSourcePrivate.m:
+ (-[WebDataSource _startLoading:]): Call didStartLoadingWithURL so we don't have to
+ rely on handleDidBeginLoading.
+ (-[WebDataSource _stopLoading]): Call didCancelWithHandle so we don't have to rely
+ on handleDidCancelLoading.
+
+ * WebView.subproj/WebMainResourceClient.h: Add didStartLoadingWithURL and
+ didCancelWithHandle to the public methods.
+ * WebView.subproj/WebMainResourceClient.m:
+ (-[WebMainResourceClient initWithDataSource:]):
+ (-[WebMainResourceClient handleDidBeginLoading:]): Empty out.
+ (-[WebMainResourceClient didCancelWithHandle:]): Move the bulk of handleDidCancelLoading here.
+ (-[WebMainResourceClient handleDidCancelLoading:]): Empty out.
+
+ * WebView.subproj/WebHTMLView.m: (-[WebHTMLView mouseDragged:]): Move the mouse up a little
+ bit so it's "on" the dragged area, but not over the text.
+
+2002-09-06 Richard Williamson <rjw at apple.com>
Added support for khtml's justified text drawing. Additional padding is distributed
to space widths. (Sites like www.osnews.com now render correctly.)
diff --git a/WebKit/Plugins.subproj/WebPluginStream.m b/WebKit/Plugins.subproj/WebPluginStream.m
index 58e6042..37bbf90 100644
--- a/WebKit/Plugins.subproj/WebPluginStream.m
+++ b/WebKit/Plugins.subproj/WebPluginStream.m
@@ -20,6 +20,7 @@
- (void)receivedData:(NSData *)data withHandle:(WebResourceHandle *)handle;
- (void)receivedError:(NPError)error;
- (void)finishedLoadingWithData:(NSData *)data;
+- (void)cancel;
@end
@interface WebNetscapePluginStream (WebResourceClient) <WebResourceClient>
@@ -102,11 +103,12 @@
resource = [[WebResourceHandle alloc] initWithRequest:request];
[resource loadInBackground];
[request release];
+ [[view webController] _didStartLoading:[resource URL]];
}
- (void)stop
{
- [resource cancelLoadInBackground];
+ [self cancel];
[resource release];
resource = nil;
[view release];
@@ -274,11 +276,12 @@
- (void)handleDidBeginLoading:(WebResourceHandle *)handle
{
- [[view webController] _didStartLoading:URL];
}
- (void)handleDidReceiveData:(WebResourceHandle *)handle data:(NSData *)data
{
+ ASSERT(resource == handle);
+
WebController *webController = [view webController];
[self receivedData:data withHandle:handle];
@@ -289,6 +292,8 @@
- (void)handleDidFinishLoading:(WebResourceHandle *)handle
{
+ ASSERT(resource == handle);
+
WebController *webController = [view webController];
[webController _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
@@ -297,22 +302,40 @@
[self finishedLoadingWithData:resourceData];
[webController _didStopLoading:URL];
+
+ [resource release];
+ resource = nil;
}
- (void)handleDidCancelLoading:(WebResourceHandle *)handle
{
+}
+
+- (void)cancel
+{
+ if (resource == nil) {
+ return;
+ }
+
+ [resource cancelLoadInBackground];
+
WebController *webController = [view webController];
[webController _receivedProgress:[WebLoadProgress progress]
- forResourceHandle: handle fromDataSource: [view webDataSource] complete: YES];
+ forResourceHandle:resource fromDataSource:[view webDataSource] complete: YES];
[self receivedError:NPRES_USER_BREAK];
[webController _didStopLoading:URL];
+
+ [resource release];
+ resource = nil;
}
- (void)handleDidFailLoading:(WebResourceHandle *)handle withError:(WebError *)result
{
+ ASSERT(resource == handle);
+
WebController *webController = [view webController];
WebLoadProgress *loadProgress = [[WebLoadProgress alloc] initWithResourceHandle:handle];
@@ -324,6 +347,9 @@
[self receivedError:NPRES_NETWORK_ERR];
[webController _didStopLoading:URL];
+
+ [resource release];
+ resource = nil;
}
- (void)handleDidRedirect:(WebResourceHandle *)handle toURL:(NSURL *)toURL
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 8b857c9..9198245 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -178,7 +178,7 @@
}
}
-- (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
+- (id <WebCoreResourceHandle>)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader withURL:(NSURL *)URL
{
return [WebSubresourceClient startLoadingResource:resourceLoader withURL:URL dataSource:[self dataSource]];
}
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
index c1c1f90..645c9b1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.h
@@ -8,17 +8,19 @@
#import <WebFoundation/WebResourceClient.h>
- at protocol WebCoreResourceLoader;
@class WebDataSource;
+ at protocol WebCoreResourceHandle;
+ at protocol WebCoreResourceLoader;
- at interface WebSubresourceClient : NSObject <WebResourceClient>
+ at interface WebSubresourceClient : NSObject <WebResourceClient, WebCoreResourceHandle>
{
id <WebCoreResourceLoader> loader;
WebDataSource *dataSource;
NSURL *currentURL;
+ WebResourceHandle *handle;
}
-+ (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
withURL:(NSURL *)URL dataSource:(WebDataSource *)dataSource;
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
index 491c0fe..f2bad33 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceClient.m
@@ -33,6 +33,17 @@
return self;
}
+- (void)dealloc
+{
+ ASSERT(currentURL == nil);
+
+ [loader release];
+ [dataSource release];
+ [handle release];
+
+ [super dealloc];
+}
+
- (void)didStartLoadingWithURL:(NSURL *)URL
{
ASSERT(currentURL == nil);
@@ -48,26 +59,21 @@
currentURL = nil;
}
-- (void)dealloc
+- (void)receivedProgressWithComplete:(BOOL)isComplete
{
- ASSERT(currentURL == nil);
-
- [loader release];
- [dataSource release];
-
- [super dealloc];
+ [[dataSource controller] _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
+ forResourceHandle:handle fromDataSource:dataSource complete:isComplete];
}
-+ (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
withURL:(NSURL *)URL dataSource:(WebDataSource *)source
{
WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
WebResourceRequest *request = [[WebResourceRequest alloc] initWithClient:client URL:URL attributes:nil flags:[source flags]];
- WebResourceHandle *handle = [[[WebResourceHandle alloc] initWithRequest:request] autorelease];
- [client release];
+ WebResourceHandle *h = [[[WebResourceHandle alloc] initWithRequest:request] autorelease];
[request release];
-
- if (handle == nil) {
+
+ if (h == nil) {
[rLoader cancel];
WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
@@ -76,63 +82,64 @@
[[source controller] _receivedError:badURLError forResourceHandle:nil
partialProgress:nil fromDataSource:source];
[badURLError release];
- } else {
- [source _addResourceHandle:handle];
- [handle loadInBackground];
+ return nil;
}
+
+ client->handle = [h retain];
+ [source _addResourceHandle:h];
+ [client didStartLoadingWithURL:[h URL]];
+ [client receivedProgressWithComplete:NO];
+ [h loadInBackground];
- return handle;
-}
-
-- (void)receivedProgressWithHandle:(WebResourceHandle *)handle complete:(BOOL)isComplete
-{
- [[dataSource controller] _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
- forResourceHandle:handle fromDataSource:dataSource complete:isComplete];
+ return [client autorelease];
}
-- (void)receivedError:(WebError *)error forHandle:(WebResourceHandle *)handle
+- (void)receivedError:(WebError *)error
{
[[dataSource controller] _receivedError:error forResourceHandle:handle
partialProgress:[WebLoadProgress progressWithResourceHandle:handle] fromDataSource:dataSource];
}
-- (NSString *)handleWillUseUserAgent:(WebResourceHandle *)handle forURL:(NSURL *)URL
+- (NSString *)handleWillUseUserAgent:(WebResourceHandle *)h forURL:(NSURL *)URL
{
return [[dataSource controller] userAgentForURL:URL];
}
-- (void)handleDidBeginLoading:(WebResourceHandle *)handle
+- (void)handleDidBeginLoading:(WebResourceHandle *)h
{
- [self didStartLoadingWithURL:[handle URL]];
- [self receivedProgressWithHandle:handle complete: NO];
}
-- (void)handleDidReceiveData:(WebResourceHandle *)handle data:(NSData *)data
+- (void)handleDidReceiveData:(WebResourceHandle *)h data:(NSData *)data
{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
- [self receivedProgressWithHandle:handle complete: NO];
+ [self receivedProgressWithComplete:NO];
[loader addData:data];
}
-- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+- (void)handleDidCancelLoading:(WebResourceHandle *)h
{
- WebError *error;
+ ASSERT(handle == h);
[loader cancel];
[dataSource _removeResourceHandle:handle];
- error = [[WebError alloc] initWithErrorCode:WebResultCancelled
+ WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
- [self receivedError:error forHandle:handle];
+ [self receivedError:error];
[error release];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle
-{
+- (void)handleDidFinishLoading:(WebResourceHandle *)h
+{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
@@ -142,29 +149,37 @@
WebError *nonTerminalError = [[handle response] error];
if (nonTerminalError) {
- [self receivedError:nonTerminalError forHandle:handle];
+ [self receivedError:nonTerminalError];
}
- [self receivedProgressWithHandle:handle complete:YES];
+ [self receivedProgressWithComplete:YES];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidFailLoading:(WebResourceHandle *)handle withError:(WebError *)error
+- (void)handleDidFailLoading:(WebResourceHandle *)h withError:(WebError *)error
{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
[loader cancel];
[dataSource _removeResourceHandle:handle];
- [self receivedError:error forHandle:handle];
+ [self receivedError:error];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidRedirect:(WebResourceHandle *)handle toURL:(NSURL *)URL
+- (void)handleDidRedirect:(WebResourceHandle *)h toURL:(NSURL *)URL
{
+ ASSERT(handle == h);
ASSERT(currentURL != nil);
ASSERT([URL isEqual:[handle URL]]);
@@ -177,6 +192,12 @@
[self didStopLoading];
[self didStartLoadingWithURL:URL];
+
+}
+
+- (void)cancel
+{
+ [handle cancelLoadInBackground];
}
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
index c1c1f90..645c9b1 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.h
@@ -8,17 +8,19 @@
#import <WebFoundation/WebResourceClient.h>
- at protocol WebCoreResourceLoader;
@class WebDataSource;
+ at protocol WebCoreResourceHandle;
+ at protocol WebCoreResourceLoader;
- at interface WebSubresourceClient : NSObject <WebResourceClient>
+ at interface WebSubresourceClient : NSObject <WebResourceClient, WebCoreResourceHandle>
{
id <WebCoreResourceLoader> loader;
WebDataSource *dataSource;
NSURL *currentURL;
+ WebResourceHandle *handle;
}
-+ (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)resourceLoader
withURL:(NSURL *)URL dataSource:(WebDataSource *)dataSource;
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
index 491c0fe..f2bad33 100644
--- a/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
+++ b/WebKit/WebCoreSupport.subproj/WebSubresourceLoader.m
@@ -33,6 +33,17 @@
return self;
}
+- (void)dealloc
+{
+ ASSERT(currentURL == nil);
+
+ [loader release];
+ [dataSource release];
+ [handle release];
+
+ [super dealloc];
+}
+
- (void)didStartLoadingWithURL:(NSURL *)URL
{
ASSERT(currentURL == nil);
@@ -48,26 +59,21 @@
currentURL = nil;
}
-- (void)dealloc
+- (void)receivedProgressWithComplete:(BOOL)isComplete
{
- ASSERT(currentURL == nil);
-
- [loader release];
- [dataSource release];
-
- [super dealloc];
+ [[dataSource controller] _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
+ forResourceHandle:handle fromDataSource:dataSource complete:isComplete];
}
-+ (WebResourceHandle *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
++ (WebSubresourceClient *)startLoadingResource:(id <WebCoreResourceLoader>)rLoader
withURL:(NSURL *)URL dataSource:(WebDataSource *)source
{
WebSubresourceClient *client = [[self alloc] initWithLoader:rLoader dataSource:source];
WebResourceRequest *request = [[WebResourceRequest alloc] initWithClient:client URL:URL attributes:nil flags:[source flags]];
- WebResourceHandle *handle = [[[WebResourceHandle alloc] initWithRequest:request] autorelease];
- [client release];
+ WebResourceHandle *h = [[[WebResourceHandle alloc] initWithRequest:request] autorelease];
[request release];
-
- if (handle == nil) {
+
+ if (h == nil) {
[rLoader cancel];
WebError *badURLError = [[WebError alloc] initWithErrorCode:WebResultBadURLError
@@ -76,63 +82,64 @@
[[source controller] _receivedError:badURLError forResourceHandle:nil
partialProgress:nil fromDataSource:source];
[badURLError release];
- } else {
- [source _addResourceHandle:handle];
- [handle loadInBackground];
+ return nil;
}
+
+ client->handle = [h retain];
+ [source _addResourceHandle:h];
+ [client didStartLoadingWithURL:[h URL]];
+ [client receivedProgressWithComplete:NO];
+ [h loadInBackground];
- return handle;
-}
-
-- (void)receivedProgressWithHandle:(WebResourceHandle *)handle complete:(BOOL)isComplete
-{
- [[dataSource controller] _receivedProgress:[WebLoadProgress progressWithResourceHandle:handle]
- forResourceHandle:handle fromDataSource:dataSource complete:isComplete];
+ return [client autorelease];
}
-- (void)receivedError:(WebError *)error forHandle:(WebResourceHandle *)handle
+- (void)receivedError:(WebError *)error
{
[[dataSource controller] _receivedError:error forResourceHandle:handle
partialProgress:[WebLoadProgress progressWithResourceHandle:handle] fromDataSource:dataSource];
}
-- (NSString *)handleWillUseUserAgent:(WebResourceHandle *)handle forURL:(NSURL *)URL
+- (NSString *)handleWillUseUserAgent:(WebResourceHandle *)h forURL:(NSURL *)URL
{
return [[dataSource controller] userAgentForURL:URL];
}
-- (void)handleDidBeginLoading:(WebResourceHandle *)handle
+- (void)handleDidBeginLoading:(WebResourceHandle *)h
{
- [self didStartLoadingWithURL:[handle URL]];
- [self receivedProgressWithHandle:handle complete: NO];
}
-- (void)handleDidReceiveData:(WebResourceHandle *)handle data:(NSData *)data
+- (void)handleDidReceiveData:(WebResourceHandle *)h data:(NSData *)data
{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
- [self receivedProgressWithHandle:handle complete: NO];
+ [self receivedProgressWithComplete:NO];
[loader addData:data];
}
-- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+- (void)handleDidCancelLoading:(WebResourceHandle *)h
{
- WebError *error;
+ ASSERT(handle == h);
[loader cancel];
[dataSource _removeResourceHandle:handle];
- error = [[WebError alloc] initWithErrorCode:WebResultCancelled
+ WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
- [self receivedError:error forHandle:handle];
+ [self receivedError:error];
[error release];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidFinishLoading:(WebResourceHandle *)handle
-{
+- (void)handleDidFinishLoading:(WebResourceHandle *)h
+{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
ASSERT([[handle response] statusCode] == WebResourceHandleStatusLoadComplete);
@@ -142,29 +149,37 @@
WebError *nonTerminalError = [[handle response] error];
if (nonTerminalError) {
- [self receivedError:nonTerminalError forHandle:handle];
+ [self receivedError:nonTerminalError];
}
- [self receivedProgressWithHandle:handle complete:YES];
+ [self receivedProgressWithComplete:YES];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidFailLoading:(WebResourceHandle *)handle withError:(WebError *)error
+- (void)handleDidFailLoading:(WebResourceHandle *)h withError:(WebError *)error
{
+ ASSERT(handle == h);
ASSERT([currentURL isEqual:[handle URL]]);
[loader cancel];
[dataSource _removeResourceHandle:handle];
- [self receivedError:error forHandle:handle];
+ [self receivedError:error];
[self didStopLoading];
+
+ [handle release];
+ handle = nil;
}
-- (void)handleDidRedirect:(WebResourceHandle *)handle toURL:(NSURL *)URL
+- (void)handleDidRedirect:(WebResourceHandle *)h toURL:(NSURL *)URL
{
+ ASSERT(handle == h);
ASSERT(currentURL != nil);
ASSERT([URL isEqual:[handle URL]]);
@@ -177,6 +192,12 @@
[self didStopLoading];
[self didStartLoadingWithURL:URL];
+
+}
+
+- (void)cancel
+{
+ [handle cancelLoadInBackground];
}
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index 7965d9e..1881fd0 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -338,6 +338,11 @@ static BOOL bufferTextDrawing = NO;
}
+- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)stringLength
+{
+ return ROUND_TO_INT([self floatWidthForCharacters:characters stringLength:stringLength fromCharacterPosition:0 numberOfCharacters:stringLength applyRounding:YES attemptFontSubstitution: YES]);
+}
+
- (int)widthForString:(NSString *)string
{
UniChar localCharacterBuffer[LOCAL_BUFFER_SIZE];
@@ -872,11 +877,6 @@ cleanup:
return totalWidth;
}
-- (int)widthForCharacters:(const UniChar *)characters length:(unsigned)stringLength
-{
- return ROUND_TO_INT([self floatWidthForCharacters:characters stringLength:stringLength fromCharacterPosition:0 numberOfCharacters:stringLength applyRounding:YES attemptFontSubstitution: YES]);
-}
-
- (ATSGlyphRef)extendCharacterToGlyphMapToInclude:(UniChar) c
{
GlyphMap *map = (GlyphMap *)calloc (1, sizeof(GlyphMap));
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 205aa85..50e5680 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -184,6 +184,7 @@
WebResourceRequest *request = [[WebResourceRequest alloc] initWithClient:_private->mainHandleClient URL:_private->inputURL attributes:_private->attributes flags:_private->flags];
_private->mainHandle = [[WebResourceHandle alloc] initWithRequest:request];
[request release];
+ [_private->mainHandleClient didStartLoadingWithURL:[_private->mainHandle URL]];
}
[_private->mainHandle loadInBackground];
}
@@ -225,6 +226,7 @@
_private->stopping = YES;
[_private->mainHandle cancelLoadInBackground];
+ [_private->mainHandleClient didCancelWithHandle:_private->mainHandle];
handles = [_private->resourceHandles copy];
[handles makeObjectsPerformSelector:@selector(cancelLoadInBackground)];
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index aab5373..7fe99ec 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -498,7 +498,7 @@
[WebURLsWithTitles writeURLs:[NSArray arrayWithObject:linkURL] andTitles:[NSArray arrayWithObject:label] toPasteboard:pasteboard];
NSPoint mousePoint = [self convertPoint:[event locationInWindow] fromView:nil];
- NSSize centerOffset = NSMakeSize(imageSize.width / 2, 0);
+ NSSize centerOffset = NSMakeSize(imageSize.width / 2, -DRAG_LABEL_BORDER_Y);
NSPoint imagePoint = NSMakePoint(mousePoint.x - centerOffset.width, mousePoint.y - centerOffset.height);
[self dragImage:dragImage
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.h b/WebKit/WebView.subproj/WebMainResourceClient.h
index 5a4449b..8a38769 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.h
+++ b/WebKit/WebView.subproj/WebMainResourceClient.h
@@ -12,6 +12,7 @@
@class WebDownloadHandler;
@class WebDataSource;
+ at class WebResourceHandle;
@protocol WebResourceClient;
@protocol WebResourceProgressHandler;
@@ -25,7 +26,12 @@
WebContentAction policyAction;
NSMutableData *resourceData;
}
+
- initWithDataSource:(WebDataSource *)dataSource;
- (WebDownloadHandler *)downloadHandler;
- (NSData *)resourceData;
+
+- (void)didStartLoadingWithURL:(NSURL *)URL;
+- (void)didCancelWithHandle:(WebResourceHandle *)handle;
+
@end
diff --git a/WebKit/WebView.subproj/WebMainResourceClient.m b/WebKit/WebView.subproj/WebMainResourceClient.m
index d90c8e6..e6165df 100644
--- a/WebKit/WebView.subproj/WebMainResourceClient.m
+++ b/WebKit/WebView.subproj/WebMainResourceClient.m
@@ -28,7 +28,7 @@
@implementation WebMainResourceClient
-- initWithDataSource: (WebDataSource *)ds
+- initWithDataSource:(WebDataSource *)ds
{
self = [super init];
@@ -117,19 +117,18 @@
- (void)handleDidBeginLoading:(WebResourceHandle *)handle
{
- WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
-
- [self didStartLoadingWithURL:[handle URL]];
}
-- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+- (void)didCancelWithHandle:(WebResourceHandle *)handle
{
- WebError *error;
+ if (currentURL == nil) {
+ return;
+ }
WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
- error = [[WebError alloc] initWithErrorCode:WebResultCancelled
+ WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
@@ -140,6 +139,10 @@
[self didStopLoading];
}
+- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+{
+}
+
- (void)handleDidFinishLoading:(WebResourceHandle *)handle
{
WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.h b/WebKit/WebView.subproj/WebMainResourceLoader.h
index 5a4449b..8a38769 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.h
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.h
@@ -12,6 +12,7 @@
@class WebDownloadHandler;
@class WebDataSource;
+ at class WebResourceHandle;
@protocol WebResourceClient;
@protocol WebResourceProgressHandler;
@@ -25,7 +26,12 @@
WebContentAction policyAction;
NSMutableData *resourceData;
}
+
- initWithDataSource:(WebDataSource *)dataSource;
- (WebDownloadHandler *)downloadHandler;
- (NSData *)resourceData;
+
+- (void)didStartLoadingWithURL:(NSURL *)URL;
+- (void)didCancelWithHandle:(WebResourceHandle *)handle;
+
@end
diff --git a/WebKit/WebView.subproj/WebMainResourceLoader.m b/WebKit/WebView.subproj/WebMainResourceLoader.m
index d90c8e6..e6165df 100644
--- a/WebKit/WebView.subproj/WebMainResourceLoader.m
+++ b/WebKit/WebView.subproj/WebMainResourceLoader.m
@@ -28,7 +28,7 @@
@implementation WebMainResourceClient
-- initWithDataSource: (WebDataSource *)ds
+- initWithDataSource:(WebDataSource *)ds
{
self = [super init];
@@ -117,19 +117,18 @@
- (void)handleDidBeginLoading:(WebResourceHandle *)handle
{
- WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
-
- [self didStartLoadingWithURL:[handle URL]];
}
-- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+- (void)didCancelWithHandle:(WebResourceHandle *)handle
{
- WebError *error;
+ if (currentURL == nil) {
+ return;
+ }
WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
// FIXME: Maybe we should be passing the URL from the handle here, not from the dataSource.
- error = [[WebError alloc] initWithErrorCode:WebResultCancelled
+ WebError *error = [[WebError alloc] initWithErrorCode:WebResultCancelled
inDomain:WebErrorDomainWebFoundation failingURL:[[dataSource originalURL] absoluteString]];
[self receivedError:error forHandle:handle];
[error release];
@@ -140,6 +139,10 @@
[self didStopLoading];
}
+- (void)handleDidCancelLoading:(WebResourceHandle *)handle
+{
+}
+
- (void)handleDidFinishLoading:(WebResourceHandle *)handle
{
WEBKITDEBUGLEVEL(WEBKIT_LOG_LOADING, "URL = %s", DEBUG_OBJECT([handle URL]));
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list