[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
senorblanco at chromium.org
senorblanco at chromium.org
Wed Mar 17 18:03:22 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 272487fcf4eb5cd14c53471e16c5ee09b8cf036b
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Feb 26 21:43:44 2010 +0000
2010-02-24 Stephen White <senorblanco at chromium.org>
Reviewed by Darin Adler.
This CL implements a simple ad-hoc parser for CSS rgb() values.
If it fails, it returns false and the normal lex/yacc parser will
be invoked.
https://bugs.webkit.org/show_bug.cgi?id=35362
Covered by fast/canvas/canvas-bg.html, fast/canvas/canvas-bg-zoom.html,
and many more.
* css/CSSParser.cpp:
(WebCore::parseInt):
(WebCore::CSSParser::parseColor):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9a19a94..7386492 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-24 Stephen White <senorblanco at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ This CL implements a simple ad-hoc parser for CSS rgb() values.
+ If it fails, it returns false and the normal lex/yacc parser will
+ be invoked.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35362
+
+ Covered by fast/canvas/canvas-bg.html, fast/canvas/canvas-bg-zoom.html,
+ and many more.
+
+ * css/CSSParser.cpp:
+ (WebCore::parseInt):
+ (WebCore::CSSParser::parseColor):
+
2010-02-26 Jarkko Sakkinen <jarkko.sakkinen at tieto.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 5c65142..a746801 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -3491,6 +3491,30 @@ bool CSSParser::parseFontFaceUnicodeRange()
return true;
}
+static inline bool isCSSWhitespace(UChar c)
+{
+ return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f';
+}
+
+static inline bool parseInt(const UChar*& string, const UChar* end, UChar terminator, int& value)
+{
+ const UChar* current = string;
+ int localValue = 0;
+ while (current != end && isCSSWhitespace(*current))
+ current++;
+ if (current == end || !isASCIIDigit(*current))
+ return false;
+ while (current != end && isASCIIDigit(*current))
+ localValue = localValue * 10 + *current++ - '0';
+ while (current != end && isCSSWhitespace(*current))
+ current++;
+ if (current == end || *current++ != terminator)
+ return false;
+ value = localValue;
+ string = current;
+ return true;
+}
+
bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
{
if (!strict && Color::parseHexColor(name, rgb))
@@ -3503,7 +3527,23 @@ bool CSSParser::parseColor(const String &name, RGBA32& rgb, bool strict)
rgb = tc.rgb();
return true;
}
-
+ if (name.startsWith("rgb(")) {
+ const UChar* current = name.characters() + 4;
+ const UChar* end = name.characters() + name.length();
+ int red;
+ int green;
+ int blue;
+ if (!parseInt(current, end, ',', red))
+ return false;
+ if (!parseInt(current, end, ',', green))
+ return false;
+ if (!parseInt(current, end, ')', blue))
+ return false;
+ if (current != end)
+ return false;
+ rgb = makeRGB(red, green, blue);
+ return true;
+ }
return false;
}
@@ -4702,11 +4742,6 @@ int CSSParser::lex(void* yylvalWithoutType)
return token();
}
-static inline bool isCSSWhitespace(UChar c)
-{
- return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\f';
-}
-
void CSSParser::recheckAtKeyword(const UChar* str, int len)
{
String ruleName(str, len);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list