mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Fix DEBUG-only crash parsing empty 'src' descriptor of @font-face rule. (Bug 511304) r=dbaron
This commit is contained in:
parent
b603ef9875
commit
eb2100a887
@ -42,3 +42,4 @@ load 495269-1.html
|
||||
load 495269-2.html
|
||||
load 509155-1.html
|
||||
load 509156-1.html
|
||||
load font-face-truncated-src.html
|
||||
|
2
layout/style/crashtests/font-face-truncated-src.html
Normal file
2
layout/style/crashtests/font-face-truncated-src.html
Normal file
@ -0,0 +1,2 @@
|
||||
<!doctype html>
|
||||
<style>@font-face { src:</style>
|
@ -7921,10 +7921,15 @@ CSSParserImpl::ParseFontSrc(nsCSSValue& aValue)
|
||||
break;
|
||||
}
|
||||
|
||||
if (values.Length() == 0)
|
||||
return PR_FALSE;
|
||||
|
||||
nsRefPtr<nsCSSValue::Array> srcVals
|
||||
= nsCSSValue::Array::Create(values.Length());
|
||||
if (!srcVals)
|
||||
if (!srcVals) {
|
||||
mScanner.SetLowLevelError(NS_ERROR_OUT_OF_MEMORY);
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRUint32 i;
|
||||
for (i = 0; i < values.Length(); i++)
|
||||
|
@ -124,6 +124,7 @@
|
||||
d: {"src" : "local(\"Hoefler Text\")"}, noncanonical: true },
|
||||
|
||||
// Incorrect src:
|
||||
{ rule: _("src:"), d: {} },
|
||||
{ rule: _("src: \"/fonts/Mouse\";"), d: {} },
|
||||
{ rule: _("src: /fonts/Mouse;"), d: {} },
|
||||
{ rule: _("src: url(\"/fonts/Mouse\") format(truetype);"), d: {} },
|
||||
|
Loading…
Reference in New Issue
Block a user