1
edit
Changes
→Firefox Bug
: Make is_space() in nsImageMap.cpp HTML5-compliant. Ticket @[https://bugzilla.mozilla.org/show_bug.cgi?id=565031 bugzilla #565031]
: Target file to be changed @ [http://mxr-test.konigsberg.mozilla.org/mozilla-central/source/layout/generic/nsImageMap.cpp#110 mozilla-central]
* Documentation
:
* Patches
: 1-
<source lang="java">
diff -r ec44e31cc46b layout/generic/nsImageMap.cpp
--- a/layout/generic/nsImageMap.cpp Wed Mar 30 20:48:32 2011 -0400
+++ b/layout/generic/nsImageMap.cpp Wed Apr 06 22:11:22 2011 -0400
@@ -107,18 +107,21 @@ Area::~Area()
delete [] mCoords;
}
#include <stdlib.h>
inline PRBool
is_space(char c)
{
- return (c == ' ' ||
- c == '\f' ||
+ return (c == ' ');
+}
+not_space(char c)
+{
+ return (c == '\f' ||
c == '\n' ||
c == '\r' ||
c == '\t' ||
c == '\v');
}
static void logMessage(nsIContent* aContent,
const nsAString& aCoordsSpec,
@@ -181,21 +184,33 @@ void Area::ParseCoords(const nsAString&
while (*n_str != '\0')
{
PRBool has_comma;
/*
* Skip to a separator
*/
tptr = n_str;
- while (!is_space(*tptr) && *tptr != ',' && *tptr != '\0')
+ while (!is_space(*tptr) && *tptr != ',' && *tptr != ';' && *tptr != '\0')
{
- tptr++;
+ if (not_space(*tptr))
+ {
+ break;
+ }
+ else
+ {
+ tptr++;
+ }
}
n_str = tptr;
+
+ if (*tptr == ';')
+ {
+ *tptr = ',';
+ }
/*
* If no more entries, break out here
*/
if (*n_str == '\0')
{
break;
}
@@ -256,17 +271,17 @@ void Area::ParseCoords(const nsAString&
{
return;
}
/*
* Second pass to copy integer values into list.
*/
tptr = cp;
- for (i=0; i<cnt; i++)
+ for (i = 0; i < cnt; i++)
{
char *ptr;
ptr = strchr(tptr, ',');
if (ptr)
{
*ptr = '\0';
}
</source>
------------------------------------------------