[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 07:29:25 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit f08ab0a92d0ba40c90a30e78b43b2be6b884cd64
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 13 15:18:48 2003 +0000
Reviewed by Maciej.
- fixed 3194451 -- Textarea COLS='40.0' displays with width of 0
* khtml/xml/dom_stringimpl.h: Changed toInt to not be inline any more.
It was already really too big for inline to be a good optimization.
* khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toInt): Rewrote this to
find the valid characters at the start of the string, rather than strip
invalid characters from the end. The old code would strip non-digits from
the end, which doesn't help with a string like "40.0" or even "40 garbage3".
- fixed a bit of int/long sloppiness
* kwq/KWQString.mm:
(QString::toLong): Use LONG_MAX, not INT_MAX.
(QString::toULong): Use ULONG_MAX, not UINT_MAX.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3814 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index b785f13..a0bc8d3 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,22 @@
+2003-03-13 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej.
+
+ - fixed 3194451 -- Textarea COLS='40.0' displays with width of 0
+
+ * khtml/xml/dom_stringimpl.h: Changed toInt to not be inline any more.
+ It was already really too big for inline to be a good optimization.
+ * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toInt): Rewrote this to
+ find the valid characters at the start of the string, rather than strip
+ invalid characters from the end. The old code would strip non-digits from
+ the end, which doesn't help with a string like "40.0" or even "40 garbage3".
+
+ - fixed a bit of int/long sloppiness
+
+ * kwq/KWQString.mm:
+ (QString::toLong): Use LONG_MAX, not INT_MAX.
+ (QString::toULong): Use ULONG_MAX, not UINT_MAX.
+
2003-03-12 Richard Williamson <rjw at apple.com>
Fixed leak of RenderRoot.
@@ -38,7 +57,7 @@
Don't crash on an input element with no enclosing form.
- * kwq/WebCoreBrid
+ * kwq/WebCoreBridge.mm:
(-[WebCoreBridge formForElement:]): Gracefully bail on !form.
2003-03-11 David Hyatt <hyatt at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b785f13..a0bc8d3 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,22 @@
+2003-03-13 Darin Adler <darin at apple.com>
+
+ Reviewed by Maciej.
+
+ - fixed 3194451 -- Textarea COLS='40.0' displays with width of 0
+
+ * khtml/xml/dom_stringimpl.h: Changed toInt to not be inline any more.
+ It was already really too big for inline to be a good optimization.
+ * khtml/xml/dom_stringimpl.cpp: (DOMStringImpl::toInt): Rewrote this to
+ find the valid characters at the start of the string, rather than strip
+ invalid characters from the end. The old code would strip non-digits from
+ the end, which doesn't help with a string like "40.0" or even "40 garbage3".
+
+ - fixed a bit of int/long sloppiness
+
+ * kwq/KWQString.mm:
+ (QString::toLong): Use LONG_MAX, not INT_MAX.
+ (QString::toULong): Use ULONG_MAX, not UINT_MAX.
+
2003-03-12 Richard Williamson <rjw at apple.com>
Fixed leak of RenderRoot.
@@ -38,7 +57,7 @@
Don't crash on an input element with no enclosing form.
- * kwq/WebCoreBrid
+ * kwq/WebCoreBridge.mm:
(-[WebCoreBridge formForElement:]): Gracefully bail on !form.
2003-03-11 David Hyatt <hyatt at apple.com>
diff --git a/WebCore/khtml/xml/dom_stringimpl.cpp b/WebCore/khtml/xml/dom_stringimpl.cpp
index f679cfe..e266902 100644
--- a/WebCore/khtml/xml/dom_stringimpl.cpp
+++ b/WebCore/khtml/xml/dom_stringimpl.cpp
@@ -296,4 +296,32 @@ DOMStringImpl *DOMStringImpl::capitalize()
return c;
}
+int DOMStringImpl::toInt(bool *ok) const
+{
+ unsigned i = 0;
+
+ // Allow leading spaces.
+ for (; i != l; ++i) {
+ if (!s[i].isSpace()) {
+ break;
+ }
+ }
+
+ // Allow sign.
+ if (i != l) {
+ if (s[i] == '+' || s[i] == '-') {
+ ++i;
+ }
+ }
+
+ // Allow digits.
+ for (; i != l; ++i) {
+ if (!s[i].isDigit()) {
+ break;
+ }
+ }
+
+ return QConstString(s, i).string().toInt(ok);
+}
+
} // namespace DOM
diff --git a/WebCore/khtml/xml/dom_stringimpl.h b/WebCore/khtml/xml/dom_stringimpl.h
index b949025..0daa719 100644
--- a/WebCore/khtml/xml/dom_stringimpl.h
+++ b/WebCore/khtml/xml/dom_stringimpl.h
@@ -80,13 +80,7 @@ public:
bool containsOnlyWhitespace() const;
// ignores trailing garbage, unlike QString
- int toInt(bool* ok=0) const {
- int len = l;
- while(len > 0 && !s[len-1].isDigit())
- len--;
-
- return QConstString(s,len).string().toInt(ok);
- };
+ int toInt(bool* ok=0) const;
khtml::Length* toLengthArray(int& len) const;
bool isLower() const;
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index c3fb30b..d8b0db5 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1471,7 +1471,7 @@ long QString::toLong(bool *ok, int base) const
const QChar *p = unicode();
long val=0;
int l = dataHandle[0]->_length;
- const long max_mult = INT_MAX / base;
+ const long max_mult = LONG_MAX / base;
bool is_ok = FALSE;
int neg = 0;
if ( !p )
@@ -1501,7 +1501,7 @@ long QString::toLong(bool *ok, int base) const
else
dv = *p - 'A' + 10;
}
- if ( val > max_mult || (val == max_mult && dv > (INT_MAX%base)+neg) )
+ if ( val > max_mult || (val == max_mult && dv > (LONG_MAX % base)+neg) )
goto bye;
val = base*val + dv;
p++;
@@ -1523,7 +1523,7 @@ ulong QString::toULong(bool *ok, int base) const
const QChar *p = unicode();
ulong val=0;
int l = dataHandle[0]->_length;
- const ulong max_mult = UINT_MAX / base;
+ const ulong max_mult = ULONG_MAX / base;
bool is_ok = FALSE;
if ( !p )
goto bye;
@@ -1546,7 +1546,7 @@ ulong QString::toULong(bool *ok, int base) const
else
dv = *p - 'A' + 10;
}
- if ( val > max_mult || (val == max_mult && dv > (UINT_MAX%base)) )
+ if ( val > max_mult || (val == max_mult && dv > (ULONG_MAX % base)) )
goto bye;
val = base*val + dv;
p++;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list