Bug 1463396: Remove unused nsStyleUtil::AppendSerializedFontSrc. r=xidorn

MozReview-Commit-ID: FG6SMUQAj89
This commit is contained in:
Emilio Cobos Álvarez 2018-05-22 13:58:24 +02:00
Родитель 57de0bfa9d
Коммит 2698440ab3
2 изменённых файлов: 0 добавлений и 58 удалений

Просмотреть файл

@ -604,61 +604,6 @@ nsStyleUtil::AppendUnicodeRange(const nsCSSValue& aValue, nsAString& aResult)
CopyASCIItoUTF16(buf, aResult);
}
/* static */ void
nsStyleUtil::AppendSerializedFontSrc(const nsCSSValue& aValue,
nsAString& aResult)
{
// A src: descriptor is represented as an array value; each entry in
// the array can be eCSSUnit_URL, eCSSUnit_Local_Font, or
// eCSSUnit_Font_Format. Blocks of eCSSUnit_Font_Format may appear
// only after one of the first two. (css3-fonts only contemplates
// annotating URLs with formats, but we handle the general case.)
MOZ_ASSERT(aValue.GetUnit() == eCSSUnit_Array,
"improper value unit for src:");
const nsCSSValue::Array& sources = *aValue.GetArrayValue();
size_t i = 0;
while (i < sources.Count()) {
nsAutoString formats;
if (sources[i].GetUnit() == eCSSUnit_URL) {
aResult.AppendLiteral("url(");
nsDependentCSubstring url(sources[i].GetURLStructValue()->GetString());
nsStyleUtil::AppendEscapedCSSString(NS_ConvertUTF8toUTF16(url), aResult);
aResult.Append(')');
} else if (sources[i].GetUnit() == eCSSUnit_Local_Font) {
aResult.AppendLiteral("local(");
nsDependentString local(sources[i].GetStringBufferValue());
nsStyleUtil::AppendEscapedCSSString(local, aResult);
aResult.Append(')');
} else {
NS_NOTREACHED("entry in src: descriptor with improper unit");
i++;
continue;
}
i++;
formats.Truncate();
while (i < sources.Count() &&
sources[i].GetUnit() == eCSSUnit_Font_Format) {
formats.Append('"');
formats.Append(sources[i].GetStringBufferValue());
formats.AppendLiteral("\", ");
i++;
}
if (formats.Length() > 0) {
formats.Truncate(formats.Length() - 2); // remove the last comma
aResult.AppendLiteral(" format(");
aResult.Append(formats);
aResult.Append(')');
}
aResult.AppendLiteral(", ");
}
aResult.Truncate(aResult.Length() - 2); // remove the last comma-space
}
/* static */ void
nsStyleUtil::AppendStepsTimingFunction(nsTimingFunction::Type aType,
uint32_t aSteps,

Просмотреть файл

@ -116,9 +116,6 @@ public:
nsTimingFunction::Type aType,
nsAString& aResult);
static void AppendSerializedFontSrc(const nsCSSValue& aValue,
nsAString& aResult);
// convert bitmask value to keyword name for a functional alternate
static void GetFunctionalAlternatesName(int32_t aFeature,
nsAString& aFeatureName);