[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:39:26 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 020fbd890a049214d08c8f000e4ec4379700ff5c
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 17 22:10:36 2002 +0000
* History.subproj/WebHistory.h:
* History.subproj/WebHistory.m:
(-[WebHistory addEntryForURLString:]):
(-[WebHistory containsEntryForURLString:]):
Added URL string API. We should remove use of
NSURL from this API.
* History.subproj/WebHistoryPrivate.h:
* History.subproj/WebHistoryPrivate.m:
(-[WebHistoryPrivate _entryForURLString:]):
(-[WebHistoryPrivate containsEntryForURLString:]):
Implementation of above.
* WebCoreSupport.subproj/WebTextRenderer.m:
(-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
(-[WebTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
Use ((int)(x + (1.0 - FLT_EPSILON))) instead of ceil().
* khtml/css/cssstyleselector.cpp:
Fixed bug in KHTML that incorrectly modified '//' in fragment part of URL.
* kwq/KWQKHistoryProvider.mm:
Use string based API to add entry. May eventually remove NSURL from
history entirely.
* kwq/KWQKURL.mm:
(KURL::canonicalURL):
Simply return the urlString.
(KURL::parse):
Added "/" to http and https empty path URLs.
* kwq/KWQString.mm:
(QString::mid):
Optimize ascii case.
* kwq/WebCoreHistory.h:
* kwq/WebCoreHistory.m:
(-[WebCoreHistory addEntryForURLString:]):
Use string based API to add entry.
* kwq/kdecore/kurl.h:
Defined methods to access canonical components,
currently conditionally excluded.
No longer commit history in the browser, now done in WebKit.
* BrowserDocument.m:
* LocationChangeHandler.m:
(-[LocationChangeHandler locationChangeCommittedForDataSource:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 1ea81e5..c8a37d5 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,32 @@
+2002-09-17 Richard Williamson <rjw at apple.com>
+
+ * khtml/css/cssstyleselector.cpp:
+ Fixed bug in KHTML that incorrectly modified '//' in fragment part of URL.
+
+ * kwq/KWQKHistoryProvider.mm:
+ Use string based API to add entry. May eventually remove NSURL from
+ history entirely.
+
+ * kwq/KWQKURL.mm:
+ (KURL::canonicalURL):
+ Simply return the urlString.
+
+ (KURL::parse):
+ Added "/" to http and https empty path URLs.
+
+ * kwq/KWQString.mm:
+ (QString::mid):
+ Optimize ascii case.
+
+ * kwq/WebCoreHistory.h:
+ * kwq/WebCoreHistory.m:
+ (-[WebCoreHistory addEntryForURLString:]):
+ Use string based API to add entry.
+
+ * kwq/kdecore/kurl.h:
+ Defined methods to access canonical components,
+ currently conditionally excluded.
+
2002-09-16 David Hyatt <hyatt at apple.com>
Fix the stylesheet loading regression on rubyfruit.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 1ea81e5..c8a37d5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,32 @@
+2002-09-17 Richard Williamson <rjw at apple.com>
+
+ * khtml/css/cssstyleselector.cpp:
+ Fixed bug in KHTML that incorrectly modified '//' in fragment part of URL.
+
+ * kwq/KWQKHistoryProvider.mm:
+ Use string based API to add entry. May eventually remove NSURL from
+ history entirely.
+
+ * kwq/KWQKURL.mm:
+ (KURL::canonicalURL):
+ Simply return the urlString.
+
+ (KURL::parse):
+ Added "/" to http and https empty path URLs.
+
+ * kwq/KWQString.mm:
+ (QString::mid):
+ Optimize ascii case.
+
+ * kwq/WebCoreHistory.h:
+ * kwq/WebCoreHistory.m:
+ (-[WebCoreHistory addEntryForURLString:]):
+ Use string based API to add entry.
+
+ * kwq/kdecore/kurl.h:
+ Defined methods to access canonical components,
+ currently conditionally excluded.
+
2002-09-16 David Hyatt <hyatt at apple.com>
Fix the stylesheet loading regression on rubyfruit.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 1ea81e5..c8a37d5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,32 @@
+2002-09-17 Richard Williamson <rjw at apple.com>
+
+ * khtml/css/cssstyleselector.cpp:
+ Fixed bug in KHTML that incorrectly modified '//' in fragment part of URL.
+
+ * kwq/KWQKHistoryProvider.mm:
+ Use string based API to add entry. May eventually remove NSURL from
+ history entirely.
+
+ * kwq/KWQKURL.mm:
+ (KURL::canonicalURL):
+ Simply return the urlString.
+
+ (KURL::parse):
+ Added "/" to http and https empty path URLs.
+
+ * kwq/KWQString.mm:
+ (QString::mid):
+ Optimize ascii case.
+
+ * kwq/WebCoreHistory.h:
+ * kwq/WebCoreHistory.m:
+ (-[WebCoreHistory addEntryForURLString:]):
+ Use string based API to add entry.
+
+ * kwq/kdecore/kurl.h:
+ Defined methods to access canonical components,
+ currently conditionally excluded.
+
2002-09-16 David Hyatt <hyatt at apple.com>
Fix the stylesheet loading regression on rubyfruit.
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index e47fc92..b22eabd 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -617,7 +617,13 @@ static void cleanpath(QString &path)
path.remove( prev, pos- prev + 3 );
}
pos = 0;
+
+ // Don't remove "//" from an anchor identifier. -rjw
+ int refPos = path.find("#", 0);
while ( (pos = path.find( "//", pos )) != -1) {
+ if (refPos > 0 && pos >= refPos)
+ break;
+
if ( pos == 0 || path[pos-1] != ':' )
path.remove( pos, 1 );
else
diff --git a/WebCore/kwq/KWQKHistoryProvider.mm b/WebCore/kwq/KWQKHistoryProvider.mm
index 3ecd27e..79cb7a1 100644
--- a/WebCore/kwq/KWQKHistoryProvider.mm
+++ b/WebCore/kwq/KWQKHistoryProvider.mm
@@ -26,6 +26,8 @@
#import <historyprovider.h>
+#import <kurl.h>
+
#import <WebCoreHistory.h>
namespace KParts {
@@ -38,12 +40,12 @@ HistoryProvider *HistoryProvider::self()
void HistoryProvider::insert(const QString &s)
{
- // Currently handled at the browser level.
+ return [[WebCoreHistory sharedHistory] addEntryForURLString: KURL(s).canonicalURL().getNSString()];
}
bool HistoryProvider::contains(const QString &s) const
{
- return [[WebCoreHistory sharedHistory] containsURL: [NSURL URLWithString: [NSString stringWithCString: s.ascii()]]];
+ return [[WebCoreHistory sharedHistory] containsEntryForURLString: KURL(s).canonicalURL().getNSString()];
}
} // namespace KParts
diff --git a/WebCore/kwq/KWQKURL.h b/WebCore/kwq/KWQKURL.h
index 041b2d0..11f3411 100644
--- a/WebCore/kwq/KWQKURL.h
+++ b/WebCore/kwq/KWQKURL.h
@@ -48,6 +48,7 @@ public:
bool isValid() const { return m_isValid; }
bool hasPath() const;
+ QString canonicalURL() const;
QString url() const { return urlString; }
QString protocol() const;
QString host() const;
@@ -80,6 +81,13 @@ public:
private:
void parse(const char *url, const QString *originalString);
+#ifdef CONSTRUCT_CANONICAL_STRING
+ QString _path() const;
+ QString _user() const;
+ QString _pass() const;
+ QString _host() const;
+#endif
+
QString urlString;
bool m_isValid;
int schemeEndPos;
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index e97b422..ffc2f15 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -512,6 +512,50 @@ QString KURL::path() const
return decode_string(urlString.mid(portEndPos, pathEndPos - portEndPos));
}
+#ifdef CONSTRUCT_CANONICAL_STRING
+QString KURL::_path() const
+{
+ if (!m_isValid) {
+ return QString();
+ }
+
+ return urlString.mid(portEndPos, pathEndPos - portEndPos);
+}
+
+QString KURL::_user() const
+{
+ if (!m_isValid) {
+ return QString();
+ }
+
+ return urlString.mid(userStartPos, userEndPos - userStartPos);
+}
+
+QString KURL::_pass() const
+{
+ if (!m_isValid) {
+ return QString();
+ }
+
+ if (passwordEndPos == userEndPos) {
+ return QString();
+ }
+
+ return urlString.mid(userEndPos + 1, passwordEndPos - userEndPos - 1);
+}
+
+QString KURL::_host() const
+{
+ if (!m_isValid) {
+ return QString();
+ }
+
+ int start = (passwordEndPos == userStartPos) ? passwordEndPos : passwordEndPos + 1;
+ return urlString.mid(start, hostEndPos - start);
+}
+
+#endif
+
void KURL::setProtocol(const QString &s)
{
if (!m_isValid) {
@@ -576,6 +620,57 @@ void KURL::setPath(const QString &s)
}
}
+QString KURL::canonicalURL() const
+{
+#ifdef CONSTRUCT_CANONICAL_STRING
+ bool hadPrePathComponent = false;
+ QString canonicalURL;
+
+ if (!protocol().isEmpty()) {
+ canonicalURL += protocol();
+ canonicalURL += "://";
+ hadPrePathComponent = true;
+ }
+ if (!_user().isEmpty()) {
+ canonicalURL += _user();
+ if (!_pass().isEmpty()){
+ canonicalURL += ":";
+ canonicalURL += _pass();
+ }
+ canonicalURL += "@";
+ hadPrePathComponent = true;
+ }
+ if (!_host().isEmpty()) {
+ canonicalURL += _host();
+ unsigned short int p = port();
+ if (p != 0) {
+ canonicalURL += ":";
+ canonicalURL += QString::number(p);
+ }
+ hadPrePathComponent = true;
+ }
+ if (hadPrePathComponent && (strncasecmp ("http", url, schemeEnd) == 0 ||
+ strncasecmp ("https", url, schemeEnd) == 0) && _path().isEmpty()) {
+ canonicalURL += "/";
+ }
+ if (!_path().isEmpty()) {
+ canonicalURL += _path();
+ }
+ if (!query().isEmpty()) {
+ canonicalURL += "?";
+ canonicalURL += query();
+ }
+ if (!ref().isEmpty()) {
+ canonicalURL += "#";
+ canonicalURL += ref();
+ }
+ return canonicalURL;
+#else
+ return urlString;
+#endif
+}
+
+
QString KURL::prettyURL(int trailing) const
{
if (!m_isValid) {
@@ -837,6 +932,7 @@ void KURL::parse(const char *url, const QString *originalString)
char *p = buffer;
const char *strPtr = url;
+ bool isHTTPorHTTPS;
// copy in the scheme
const char *schemeEndPtr = url + schemeEnd;
@@ -845,6 +941,10 @@ void KURL::parse(const char *url, const QString *originalString)
}
schemeEndPos = p - buffer;
+ // Check if we're http or https.
+ isHTTPorHTTPS = strncasecmp ("http", url, schemeEnd) == 0 ||
+ strncasecmp ("https", url, schemeEnd) == 0;
+
// add ";"
*p++ = ':';
@@ -901,6 +1001,12 @@ void KURL::parse(const char *url, const QString *originalString)
userStartPos = userEndPos = passwordEndPos = hostEndPos = portEndPos = p - buffer;
}
+ // For canonicalization, ensure we have a '/' for no path.
+ // Only do this for http and https.
+ if (isHTTPorHTTPS && pathEnd - pathStart == 0) {
+ *p++ = '/';
+ }
+
// add path, escaping bad characters
appendEscapingBadChars(p, url + pathStart, pathEnd - pathStart);
pathEndPos = p - buffer;
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index 5a12464..6541318 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1713,14 +1713,28 @@ QString QString::mid(uint index, uint len) const
} else if ( len == 0 ) { // ## just for 1.x compat:
return QString::fromLatin1("");
} else {
- if ( len > slen-index )
- len = slen - index;
- if ( index == 0 && len == dataHandle[0]->_length )
- return *this;
- register const QChar *p = unicode()+index;
- QString s( p, len );
- return s;
+ if (dataHandle[0]->_isAsciiValid){
+ if ( len > slen-index )
+ len = slen - index;
+ if ( index == 0 && len == dataHandle[0]->_length )
+ return *this;
+ register const char *p = ascii()+index;
+ QString s( p, len );
+ return s;
+ }
+ else if (dataHandle[0]->_isUnicodeValid){
+ if ( len > slen-index )
+ len = slen - index;
+ if ( index == 0 && len == dataHandle[0]->_length )
+ return *this;
+ register const QChar *p = unicode()+index;
+ QString s( p, len );
+ return s;
+ }
+ else
+ FATAL("invalid character cache");
}
+ return QString(); // Never reached, shut the compiler up.
}
QString QString::copy() const
diff --git a/WebCore/kwq/WebCoreHistory.h b/WebCore/kwq/WebCoreHistory.h
index 5c151fc..d181e6c 100644
--- a/WebCore/kwq/WebCoreHistory.h
+++ b/WebCore/kwq/WebCoreHistory.h
@@ -32,6 +32,7 @@
+ (void)setSharedHistory: (WebCoreHistory *)h;
+ (WebCoreHistory *)sharedHistory;
-- (BOOL)containsURL: (NSURL *)url;
+- (void)addEntryForURLString: (NSString *)urlString;
+- (BOOL)containsEntryForURLString: (NSString *)urlString;
@end
diff --git a/WebCore/kwq/WebCoreHistory.m b/WebCore/kwq/WebCoreHistory.m
index b050457..e6eede4 100644
--- a/WebCore/kwq/WebCoreHistory.m
+++ b/WebCore/kwq/WebCoreHistory.m
@@ -43,8 +43,11 @@ static WebCoreHistory *_sharedHistory = nil;
return _sharedHistory;
}
+- (void)addEntryForURLString: (NSString *)urlString
+{
+}
-- (BOOL)containsURL: (NSURL *)url
+- (BOOL)containsEntryForURLString: (NSString *)urlString;
{
return false;
}
diff --git a/WebCore/kwq/kdecore/kurl.h b/WebCore/kwq/kdecore/kurl.h
index 041b2d0..11f3411 100644
--- a/WebCore/kwq/kdecore/kurl.h
+++ b/WebCore/kwq/kdecore/kurl.h
@@ -48,6 +48,7 @@ public:
bool isValid() const { return m_isValid; }
bool hasPath() const;
+ QString canonicalURL() const;
QString url() const { return urlString; }
QString protocol() const;
QString host() const;
@@ -80,6 +81,13 @@ public:
private:
void parse(const char *url, const QString *originalString);
+#ifdef CONSTRUCT_CANONICAL_STRING
+ QString _path() const;
+ QString _user() const;
+ QString _pass() const;
+ QString _host() const;
+#endif
+
QString urlString;
bool m_isValid;
int schemeEndPos;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 58e3482..2fcd6eb 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,23 @@
+2002-09-17 Richard Williamson <rjw at apple.com>
+
+ * History.subproj/WebHistory.h:
+ * History.subproj/WebHistory.m:
+ (-[WebHistory addEntryForURLString:]):
+ (-[WebHistory containsEntryForURLString:]):
+ Added URL string API. We should remove use of
+ NSURL from this API.
+
+ * History.subproj/WebHistoryPrivate.h:
+ * History.subproj/WebHistoryPrivate.m:
+ (-[WebHistoryPrivate _entryForURLString:]):
+ (-[WebHistoryPrivate containsEntryForURLString:]):
+ Implementation of above.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
+ (-[WebTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
+ Use ((int)(x + (1.0 - FLT_EPSILON))) instead of ceil().
+
2002-09-16 Darin Adler <darin at apple.com>
* History.subproj/WebHistoryPrivate.m: Do that for real.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 58e3482..2fcd6eb 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,23 @@
+2002-09-17 Richard Williamson <rjw at apple.com>
+
+ * History.subproj/WebHistory.h:
+ * History.subproj/WebHistory.m:
+ (-[WebHistory addEntryForURLString:]):
+ (-[WebHistory containsEntryForURLString:]):
+ Added URL string API. We should remove use of
+ NSURL from this API.
+
+ * History.subproj/WebHistoryPrivate.h:
+ * History.subproj/WebHistoryPrivate.m:
+ (-[WebHistoryPrivate _entryForURLString:]):
+ (-[WebHistoryPrivate containsEntryForURLString:]):
+ Implementation of above.
+
+ * WebCoreSupport.subproj/WebTextRenderer.m:
+ (-[WebTextRenderer drawGlyphs:numGlyphs:fromGlyphPosition:toGlyphPosition:atPoint:withPadding:withTextColor:backgroundColor:]):
+ (-[WebTextRenderer slowFloatWidthForCharacters:stringLength:fromCharacterPostion:numberOfCharacters:applyRounding:]):
+ Use ((int)(x + (1.0 - FLT_EPSILON))) instead of ceil().
+
2002-09-16 Darin Adler <darin at apple.com>
* History.subproj/WebHistoryPrivate.m: Do that for real.
diff --git a/WebKit/History.subproj/WebHistory.h b/WebKit/History.subproj/WebHistory.h
index e34c68f..7ddc42e 100644
--- a/WebKit/History.subproj/WebHistory.h
+++ b/WebKit/History.subproj/WebHistory.h
@@ -47,12 +47,6 @@ extern NSString *WebHistoryEntriesChangedNotification;
// specified NSCalendarDate, ordered from most recent to oldest.
- (NSArray *)orderedEntriesLastVisitedOnDay: (NSCalendarDate *)calendarDate;
-// retrieving contents for autocompletion in location field
-- (NSArray *)entriesWithAddressContainingString: (NSString *)string;
-
-// retrieving contents for searching (maybe replace with state-based search API)
-- (NSArray *)entriesWithTitleOrAddressContainingString: (NSString *)string;
-
// testing contents for visited-link mechanism
- (BOOL)containsURL: (NSURL *)URL;
diff --git a/WebKit/History.subproj/WebHistory.m b/WebKit/History.subproj/WebHistory.m
index 9b0b708..8387bd0 100644
--- a/WebKit/History.subproj/WebHistory.m
+++ b/WebKit/History.subproj/WebHistory.m
@@ -5,9 +5,9 @@
// Created by John Sullivan on Mon Feb 18 2002.
// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
-
-#import "WebHistory.h"
-#import "WebHistoryPrivate.h"
+#import <WebKit/WebHistory.h>
+#import <WebKit/WebHistoryPrivate.h>
+#import <WebKit/WebHistoryItem.h>
#import <WebFoundation/WebAssertions.h>
@@ -52,6 +52,14 @@ NSString *WebHistoryEntriesChangedNotification = @"WebHistoryEntriesChangedNotif
object: self];
}
+- (void)addEntryForURLString: (NSString *)string
+{
+ WebHistoryItem *entry = [[WebHistoryItem alloc] initWithURL:[NSURL URLWithString: string] title:nil];
+ [self addEntry: entry];
+ [entry release];
+}
+
+
- (void)addEntry: (WebHistoryItem *)entry
{
[_historyPrivate addEntry: entry];
@@ -112,20 +120,13 @@ NSString *WebHistoryEntriesChangedNotification = @"WebHistoryEntriesChangedNotif
return [_historyPrivate orderedEntriesLastVisitedOnDay: date];
}
-#pragma mark STRING-BASED RETRIEVAL
-
-- (NSArray *)entriesWithAddressContainingString: (NSString *)string
-{
- return [_historyPrivate entriesWithAddressContainingString: string];
-}
+#pragma mark URL MATCHING
-- (NSArray *)entriesWithTitleOrAddressContainingString: (NSString *)string
+- (BOOL)containsEntryForURLString: (NSString *)URLString
{
- return [_historyPrivate entriesWithTitleOrAddressContainingString: string];
+ return [_historyPrivate containsEntryForURLString: URLString];
}
-#pragma mark URL MATCHING
-
- (BOOL)containsURL: (NSURL *)URL
{
return [_historyPrivate containsURL: URL];
diff --git a/WebKit/History.subproj/WebHistoryPrivate.h b/WebKit/History.subproj/WebHistoryPrivate.h
index 2a546d0..8ca5ca9 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.h
+++ b/WebKit/History.subproj/WebHistoryPrivate.h
@@ -32,8 +32,7 @@
- (NSArray *)orderedLastVisitedDays;
- (NSArray *)orderedEntriesLastVisitedOnDay: (NSCalendarDate *)calendarDate;
-- (NSArray *)entriesWithAddressContainingString: (NSString *)string;
-- (NSArray *)entriesWithTitleOrAddressContainingString: (NSString *)string;
+- (BOOL)containsEntryForURLString: (NSString *)URLString;
- (BOOL)containsURL: (NSURL *)URL;
- (WebHistoryItem *)entryForURL:(NSURL *)URL;
diff --git a/WebKit/History.subproj/WebHistoryPrivate.m b/WebKit/History.subproj/WebHistoryPrivate.m
index cbf8b89..5df4325 100644
--- a/WebKit/History.subproj/WebHistoryPrivate.m
+++ b/WebKit/History.subproj/WebHistoryPrivate.m
@@ -280,20 +280,6 @@
return nil;
}
-#pragma mark STRING-BASED RETRIEVAL
-
-- (NSArray *)entriesWithAddressContainingString: (NSString *)string
-{
- // FIXME: not yet implemented
- return nil;
-}
-
-- (NSArray *)entriesWithTitleOrAddressContainingString: (NSString *)string
-{
- // FIXME: not yet implemented
- return nil;
-}
-
#pragma mark URL MATCHING
-(WebHistoryItem *)_entryForURLString:(NSString *)URLString
@@ -301,6 +287,11 @@
return [_entriesByURL objectForKey: URLString];
}
+- (BOOL)containsEntryForURLString: (NSString *)URLString
+{
+ return [self _entryForURLString:URLString] != nil;
+}
+
- (BOOL)containsURL: (NSURL *)URL
{
#ifdef FIX_VISITED
diff --git a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
index fc24534..ab0ba12 100644
--- a/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
+++ b/WebKit/WebCoreSupport.subproj/WebTextRenderer.m
@@ -16,12 +16,15 @@
#import <QD/ATSUnicodePriv.h>
+#import <float.h>
+
#define NON_BREAKING_SPACE 0x00A0
#define SPACE 0x0020
#define IS_CONTROL_CHARACTER(c) ((c) < 0x0020 || (c) == 0x007F)
#define ROUND_TO_INT(x) (unsigned int)((x)+.5)
+#define CEIL_TO_INT(x) ((int)(x + (1.0 - FLT_EPSILON)))
#define LOCAL_BUFFER_SIZE 1024
@@ -445,7 +448,7 @@ static BOOL bufferTextDrawing = NO;
if (glyphs[i] == spaceGlyph)
numSpaces++;
}
- padPerSpace = ceil ((((float)padding) / ((float)numSpaces)));
+ padPerSpace = CEIL_TO_INT ((((float)padding) / ((float)numSpaces)));
}
// Determine if we can use the local stack buffer, otherwise allocate.
@@ -464,7 +467,7 @@ static BOOL bufferTextDrawing = NO;
if (glyphs[i] == spaceGlyph){
if (i > 0){
//advances[i-1].width = ROUND_TO_INT (advances[i-1].width);
- advances[i-1].width += ceil (wordWidth) - wordWidth;
+ advances[i-1].width += CEIL_TO_INT (wordWidth) - wordWidth;
}
if (padding > 0){
// Only use left over padding if note evenly divisible by
@@ -757,7 +760,7 @@ cleanup:
if (glyphID == spaceGlyph){
//totalWidth -= lastWidth;
//totalWidth += ROUND_TO_INT(lastWidth);
- totalWidth += ceil(totalWidth) - totalWidth;
+ totalWidth += CEIL_TO_INT(totalWidth) - totalWidth;
}
break;
}
@@ -774,7 +777,7 @@ cleanup:
if (totalWidth > 0 && lastWidth > 0){
//totalWidth -= lastWidth;
//totalWidth += ROUND_TO_INT(lastWidth);
- totalWidth += ceil(totalWidth) - totalWidth;
+ totalWidth += CEIL_TO_INT(totalWidth) - totalWidth;
}
glyphWidth = ROUND_TO_INT(glyphWidth);
}
@@ -788,7 +791,7 @@ cleanup:
ATSClearGlyphVector(&glyphVector);
if (applyRounding)
- totalWidth += ceil(totalWidth) - totalWidth;
+ totalWidth += CEIL_TO_INT(totalWidth) - totalWidth;
return totalWidth;
}
@@ -829,7 +832,7 @@ cleanup:
if (characters[i] == NON_BREAKING_SPACE || characters[i] == SPACE)
numSpaces++;
}
- padPerSpace = ceil ((((float)padding) / ((float)numSpaces)));
+ padPerSpace = CEIL_TO_INT ((((float)padding) / ((float)numSpaces)));
}
//printf("width: font %s, size %.1f, text \"%s\"\n", [[font fontName] cString], [font pointSize], [[NSString stringWithCharacters:characters length:length] UTF8String]);
@@ -850,7 +853,7 @@ cleanup:
if ((int)i - pos >= len) {
// Check if next character is a space. If so, we have to apply rounding.
if (c == SPACE && applyRounding) {
- float delta = ceil(totalWidth) - totalWidth;
+ float delta = CEIL_TO_INT(totalWidth) - totalWidth;
totalWidth += delta;
if (widthBuffer)
widthBuffer[i - pos - 1] += delta;
@@ -883,7 +886,7 @@ cleanup:
if (glyphID > 0 || ((glyphID == 0) && substituteFont == nil)) {
if (glyphID == spaceGlyph && applyRounding) {
if (lastWidth > 0){
- float delta = ceil(totalWidth) - totalWidth;
+ float delta = CEIL_TO_INT(totalWidth) - totalWidth;
totalWidth += delta;
if (widthBuffer)
widthBuffer[i - pos - 1] += delta;
@@ -913,7 +916,7 @@ cleanup:
// Don't ever apply rounding for single character. Single character measurement
// intra word needs to be non-ceiled.
if ((len > 1 || stringLength == 1) && applyRounding){
- float delta = ceil(totalWidth) - totalWidth;
+ float delta = CEIL_TO_INT(totalWidth) - totalWidth;
totalWidth += delta;
if (widthBuffer)
widthBuffer[len-1] += delta;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list