mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 52019. Don't treat <font size='+.5'> as <font size='5'>. r=bzbarsky
This commit is contained in:
parent
a491cefc6d
commit
33910f9bb0
11
content/html/content/reftests/52019-1-ref.html
Normal file
11
content/html/content/reftests/52019-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 52019</title>
|
||||
</head>
|
||||
<body>
|
||||
<font>font</font>
|
||||
<font>font</font>
|
||||
<font size="+2">font</font>
|
||||
<font size="-2">font</font>
|
||||
</body>
|
||||
</html>
|
11
content/html/content/reftests/52019-1.html
Normal file
11
content/html/content/reftests/52019-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for Bug 52019</title>
|
||||
</head>
|
||||
<body>
|
||||
<font size="+.5">font</font>
|
||||
<font size="-.5">font</font>
|
||||
<font size="+2.5">font</font>
|
||||
<font size="-2.5">font</font>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,6 @@
|
||||
== 41464-1a.html 41464-1-ref.html
|
||||
== 41464-1b.html 41464-1-ref.html
|
||||
== 52019-1.html 52019-1-ref.html
|
||||
!= 468263-1a.html about:blank
|
||||
!= 468263-1b.html about:blank
|
||||
!= 468263-1c.html about:blank
|
||||
|
@ -150,9 +150,20 @@ nsHTMLFontElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||
nsAutoString tmp(aValue);
|
||||
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
PRUnichar ch = tmp.IsEmpty() ? 0 : tmp.First();
|
||||
if ((ch == '+' || ch == '-') &&
|
||||
aResult.ParseEnumValue(aValue, kRelFontSizeTable, PR_FALSE)) {
|
||||
return PR_TRUE;
|
||||
if ((ch == '+' || ch == '-')) {
|
||||
if (aResult.ParseEnumValue(aValue, kRelFontSizeTable, PR_FALSE))
|
||||
return PR_TRUE;
|
||||
|
||||
// truncate after digit, then parse it again.
|
||||
PRUint32 i;
|
||||
for (i = 1; i < tmp.Length(); i++) {
|
||||
ch = tmp.CharAt(i);
|
||||
if (!nsCRT::IsAsciiDigit(ch)) {
|
||||
tmp.Truncate(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return aResult.ParseEnumValue(tmp, kRelFontSizeTable, PR_FALSE);
|
||||
}
|
||||
|
||||
return aResult.ParseIntValue(aValue);
|
||||
|
Loading…
Reference in New Issue
Block a user