mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 18:32:00 +00:00
fixed tokenization bug (treating "+.foo" as a number)
This commit is contained in:
parent
888bd39b4a
commit
b7974865e3
@ -324,10 +324,20 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken)
|
||||
if ((ch == '.') || (ch == '+') || (ch == '-')) {
|
||||
PRInt32 nextChar = Peek(aErrorCode);
|
||||
if ((nextChar >= 0) && (nextChar <= 255)) {
|
||||
if (((lexTable[nextChar] & IS_DIGIT) != 0) ||
|
||||
(('.' == nextChar) && ('.' != ch))) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
else if (('.' == nextChar) && ('.' != ch)) {
|
||||
PRInt32 holdNext = Read(aErrorCode);
|
||||
nextChar = Peek(aErrorCode);
|
||||
if ((0 <= nextChar) && (nextChar <= 255)) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
Pushback(holdNext);
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
}
|
||||
Pushback(holdNext);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((lexTable[ch] & IS_DIGIT) != 0) {
|
||||
|
@ -324,10 +324,20 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken)
|
||||
if ((ch == '.') || (ch == '+') || (ch == '-')) {
|
||||
PRInt32 nextChar = Peek(aErrorCode);
|
||||
if ((nextChar >= 0) && (nextChar <= 255)) {
|
||||
if (((lexTable[nextChar] & IS_DIGIT) != 0) ||
|
||||
(('.' == nextChar) && ('.' != ch))) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
else if (('.' == nextChar) && ('.' != ch)) {
|
||||
PRInt32 holdNext = Read(aErrorCode);
|
||||
nextChar = Peek(aErrorCode);
|
||||
if ((0 <= nextChar) && (nextChar <= 255)) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
Pushback(holdNext);
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
}
|
||||
Pushback(holdNext);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((lexTable[ch] & IS_DIGIT) != 0) {
|
||||
|
@ -324,10 +324,20 @@ PRBool nsCSSScanner::Next(PRInt32& aErrorCode, nsCSSToken& aToken)
|
||||
if ((ch == '.') || (ch == '+') || (ch == '-')) {
|
||||
PRInt32 nextChar = Peek(aErrorCode);
|
||||
if ((nextChar >= 0) && (nextChar <= 255)) {
|
||||
if (((lexTable[nextChar] & IS_DIGIT) != 0) ||
|
||||
(('.' == nextChar) && ('.' != ch))) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
else if (('.' == nextChar) && ('.' != ch)) {
|
||||
PRInt32 holdNext = Read(aErrorCode);
|
||||
nextChar = Peek(aErrorCode);
|
||||
if ((0 <= nextChar) && (nextChar <= 255)) {
|
||||
if ((lexTable[nextChar] & IS_DIGIT) != 0) {
|
||||
Pushback(holdNext);
|
||||
return ParseNumber(aErrorCode, ch, aToken);
|
||||
}
|
||||
}
|
||||
Pushback(holdNext);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((lexTable[ch] & IS_DIGIT) != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user