mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1146199 - Return empty string from FontFace.family if the FontFace was constructed with an invalid family name. r=jdaggett
This commit is contained in:
parent
1b8d1d5203
commit
05cbf53328
@ -401,6 +401,11 @@ FontFace::GetFamily(nsString& aResult)
|
||||
GetDesc(eCSSFontDesc_Family, value);
|
||||
|
||||
aResult.Truncate();
|
||||
|
||||
if (value.GetUnit() == eCSSUnit_Null) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsDependentString family(value.GetStringBufferValue());
|
||||
if (!family.IsEmpty()) {
|
||||
// The string length can be zero when the author passed an invalid
|
||||
|
@ -53,7 +53,7 @@ var invalidValues = {
|
||||
|
||||
// Invalid font family names.
|
||||
var invalidFontFamilyNames = [
|
||||
"", "\"\"", "sans-serif", "A, B", "inherit"
|
||||
"", "\"\"", "sans-serif", "A, B", "inherit", "a 1"
|
||||
];
|
||||
|
||||
// Will hold an ArrayBuffer containing a valid font.
|
||||
@ -293,6 +293,7 @@ function runTest() {
|
||||
familyTests = familyTests.then(function() {
|
||||
var face = new FontFace(aFamilyName, fontData);
|
||||
is(face.status, "error", "FontFace should be error immediately after construction with invalid family name " + aFamilyName + " (TEST 17)");
|
||||
is(face.family, "", "FontFace.family should be the empty string after construction with invalid family name " + aFamilyName + " (TEST 17)");
|
||||
return face.loaded.then(function() {
|
||||
ok(false, "FontFace should not load after invalid family name " + aFamilyName + " specified (TEST 17)");
|
||||
}, function(aError) {
|
||||
|
Loading…
Reference in New Issue
Block a user