зеркало из https://github.com/mozilla/gecko-dev.git
fixed bug while tokenizing ints at end of input stream
This commit is contained in:
Родитель
587f4aa26e
Коммит
e3cc02769e
|
@ -674,6 +674,7 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
} else if ('%' == c) {
|
||||
type = eCSSToken_Percentage;
|
||||
value = value / 100.0f;
|
||||
ident.SetLength(0);
|
||||
} else {
|
||||
// Put back character that stopped numeric scan
|
||||
Unread();
|
||||
|
@ -684,6 +685,13 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
ident.SetLength(0);
|
||||
}
|
||||
}
|
||||
else { // stream ended
|
||||
if (!gotDot) {
|
||||
aToken.mInteger = ident.ToInteger(&ec);
|
||||
aToken.mIntegerValid = PR_TRUE;
|
||||
}
|
||||
ident.SetLength(0);
|
||||
}
|
||||
aToken.mNumber = value;
|
||||
aToken.mType = type;
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -674,6 +674,7 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
} else if ('%' == c) {
|
||||
type = eCSSToken_Percentage;
|
||||
value = value / 100.0f;
|
||||
ident.SetLength(0);
|
||||
} else {
|
||||
// Put back character that stopped numeric scan
|
||||
Unread();
|
||||
|
@ -684,6 +685,13 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
ident.SetLength(0);
|
||||
}
|
||||
}
|
||||
else { // stream ended
|
||||
if (!gotDot) {
|
||||
aToken.mInteger = ident.ToInteger(&ec);
|
||||
aToken.mIntegerValid = PR_TRUE;
|
||||
}
|
||||
ident.SetLength(0);
|
||||
}
|
||||
aToken.mNumber = value;
|
||||
aToken.mType = type;
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -674,6 +674,7 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
} else if ('%' == c) {
|
||||
type = eCSSToken_Percentage;
|
||||
value = value / 100.0f;
|
||||
ident.SetLength(0);
|
||||
} else {
|
||||
// Put back character that stopped numeric scan
|
||||
Unread();
|
||||
|
@ -684,6 +685,13 @@ PRBool nsCSSScanner::ParseNumber(PRInt32& aErrorCode, PRInt32 c,
|
|||
ident.SetLength(0);
|
||||
}
|
||||
}
|
||||
else { // stream ended
|
||||
if (!gotDot) {
|
||||
aToken.mInteger = ident.ToInteger(&ec);
|
||||
aToken.mIntegerValid = PR_TRUE;
|
||||
}
|
||||
ident.SetLength(0);
|
||||
}
|
||||
aToken.mNumber = value;
|
||||
aToken.mType = type;
|
||||
return PR_TRUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче