mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix parenthesis-matching while parsing format() function in @font-face src: descriptor. (Bug 511333) r=dbaron
This commit is contained in:
parent
325ccb4cf2
commit
6ade4eb7d1
@ -7957,16 +7957,23 @@ CSSParserImpl::ParseFontSrcFormat(nsTArray<nsCSSValue> & values)
|
||||
|
||||
do {
|
||||
if (!GetToken(PR_TRUE))
|
||||
return PR_FALSE;
|
||||
return PR_FALSE; // EOF - no need for SkipUntil
|
||||
|
||||
if (mToken.mType != eCSSToken_String)
|
||||
if (mToken.mType != eCSSToken_String) {
|
||||
SkipUntil(')');
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
nsCSSValue cur(mToken.mIdent, eCSSUnit_Font_Format);
|
||||
values.AppendElement(cur);
|
||||
} while (ExpectSymbol(',', PR_TRUE));
|
||||
|
||||
return ExpectSymbol(')', PR_TRUE);
|
||||
if (!ExpectSymbol(')', PR_TRUE)) {
|
||||
SkipUntil(')');
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
// font-ranges: urange ( ',' urange )*
|
||||
|
@ -120,7 +120,7 @@
|
||||
d: { "src" : "local(\"老鼠\"), url(\"/fonts/Mouse\") format(\"truetype\")" } },
|
||||
|
||||
// Correct but unusual src:
|
||||
{ rule: _("src: local(Hoefler Text);"),
|
||||
{ rule: _("src: local(Hoefler Text);"),
|
||||
d: {"src" : "local(\"Hoefler Text\")"}, noncanonical: true },
|
||||
|
||||
// Incorrect src:
|
||||
@ -154,6 +154,16 @@
|
||||
d: { "src" : "local(\"Mouse\")" },
|
||||
noncanonical: true },
|
||||
|
||||
// Correct parenthesis matching for format()
|
||||
{ rule: _("src: url(\"/fonts/Mouse\"); " +
|
||||
"src: url(\"/fonts/Cat\") format(Cat(); src: local(Rat); )"),
|
||||
d: { "src" : "url(\"/fonts/Mouse\")" },
|
||||
noncanonical: true },
|
||||
{ rule: _("src: url(\"/fonts/Mouse\"); " +
|
||||
"src: url(\"/fonts/Cat\") format(\"Cat\"; src: local(Rat); )"),
|
||||
d: { "src" : "url(\"/fonts/Mouse\")" },
|
||||
noncanonical: true },
|
||||
|
||||
// unicode-range is not implemented (bug 443976).
|
||||
// tests for that omitted for now.
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user