зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1490457 - Support dynamically inserted localization links when a document didn`t have any links during parse. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D5612 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5b41e41329
Коммит
84ee6e9599
|
@ -3361,6 +3361,13 @@ nsIDocument::LocalizationLinkAdded(Element* aLinkElement)
|
|||
AutoTArray<nsString, 1> resourceIds;
|
||||
resourceIds.AppendElement(href);
|
||||
mDocumentL10n->AddResourceIds(resourceIds);
|
||||
} else if (mReadyState == READYSTATE_COMPLETE) {
|
||||
// Otherwise, if the document has already been parsed
|
||||
// we need to lazily initialize the localization.
|
||||
AutoTArray<nsString, 1> resourceIds;
|
||||
resourceIds.AppendElement(href);
|
||||
InitializeLocalization(resourceIds);
|
||||
mDocumentL10n->TriggerInitialDocumentTranslation();
|
||||
} else {
|
||||
// Otherwise, we're still parsing the document.
|
||||
// In that case, add it to the pending list. This list
|
||||
|
|
Загрузка…
Ссылка в новой задаче