зеркало из https://github.com/mozilla/gecko-dev.git
bug 726539 - last value wins in the case of conflicting features in -moz-font-feature-settings. r=jdaggett
This commit is contained in:
Родитель
3093af1b69
Коммит
3c5ef7e79e
|
@ -3708,9 +3708,20 @@ gfxFontStyle::ParseFontFeatureSettings(const nsString& aFeatureString,
|
|||
PRInt32 rv;
|
||||
setting.mValue = valString.ToInteger(&rv);
|
||||
if (rv == NS_OK) {
|
||||
// we keep the features array sorted so that we can
|
||||
// use nsTArray<>::Equals() to compare feature lists
|
||||
aFeatures.InsertElementSorted(setting);
|
||||
PRUint32 i;
|
||||
// could optimize this based on the fact that the features array
|
||||
// is sorted, but it's unlikely to be more than a few entries
|
||||
for (i = 0; i < aFeatures.Length(); i++) {
|
||||
if (aFeatures[i].mTag == setting.mTag) {
|
||||
aFeatures[i].mValue = setting.mValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == aFeatures.Length()) {
|
||||
// we keep the features array sorted so that we can
|
||||
// use nsTArray<>::Equals() to compare feature lists
|
||||
aFeatures.InsertElementSorted(setting);
|
||||
}
|
||||
}
|
||||
}
|
||||
offset = limit + 1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче