зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1645246 - fluent shouldn't release-crash if one translation clobbers another element listed for translation, r=zbraniecki,smaug
See https://bugzilla.mozilla.org/show_bug.cgi?id=1645246#c4 for what causes the crash. I'm avoiding translating as well as attempting to update prototypes for disconnected elements, which I've verified fixes the crash. Differential Revision: https://phabricator.services.mozilla.com/D79508
This commit is contained in:
Родитель
9f02d32e17
Коммит
7a932125e9
|
@ -485,6 +485,14 @@ bool DOMLocalization::ApplyTranslations(
|
|||
hasMissingTranslation = true;
|
||||
continue;
|
||||
}
|
||||
// If we have a proto, we expect all elements are connected up.
|
||||
// If they're not, they may have been removed by earlier translations.
|
||||
// We will have added an error in L10nOverlays in this case.
|
||||
// This is an error in fluent use, but shouldn't be crashing. There's
|
||||
// also no point translating the element - skip it:
|
||||
if (aProto && !elem->IsInComposedDoc()) {
|
||||
continue;
|
||||
}
|
||||
L10nOverlays::TranslateElement(*elem, aTranslations[i].Value(), errors,
|
||||
aRv);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче