Skip to content

Instantly share code, notes, and snippets.

@zbraniecki
Created September 11, 2018 21:51
Show Gist options
  • Select an option

  • Save zbraniecki/dbab173d3d0aa040cccd8e1eb94e66fd to your computer and use it in GitHub Desktop.

Select an option

Save zbraniecki/dbab173d3d0aa040cccd8e1eb94e66fd to your computer and use it in GitHub Desktop.
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3360,6 +3360,12 @@ nsIDocument::LocalizationLinkAdded(Eleme
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);
} else {
// Otherwise, we're still parsing the document.
// In that case, add it to the pending list. This list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment