Skip ConnectRoot, use TranslateFragment draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 04 Oct 2018 15:14:37 +0000
changeset 1716423 3aa5da028d668d2393be4d05ccb159e68d760b42
parent 1715534 8ed542e5e0e0b0c7ed0f4244bbcf365513dfec29
child 1716424 e13cf0203a85e8ebe591609cfe5370544e0f9cc9
push id304288
push userzbraniecki@mozilla.com
push dateThu, 04 Oct 2018 15:15:33 +0000
treeherdertry@e13cf0203a85 [default view] [failures only]
milestone64.0a1
Skip ConnectRoot, use TranslateFragment
intl/l10n/DocumentL10n.cpp
--- a/intl/l10n/DocumentL10n.cpp
+++ b/intl/l10n/DocumentL10n.cpp
@@ -298,22 +298,24 @@ DocumentL10n::TriggerInitialDocumentTran
 {
   if (mState == DocumentL10nState::InitialTranslationTriggered) {
     return;
   }
 
   mState = DocumentL10nState::InitialTranslationTriggered;
 
   Element* elem = mDocument->GetDocumentElement();
-  if (elem) {
-    mDOMLocalization->ConnectRoot(elem);
+  if (!elem) {
+    return;
+    /* mDOMLocalization->ConnectRoot(elem); */
   }
 
   RefPtr<Promise> promise;
-  mDOMLocalization->TranslateRoots(getter_AddRefs(promise));
+  /* mDOMLocalization->TranslateRoots(getter_AddRefs(promise)); */
+  mDOMLocalization->TranslateFragment(elem, getter_AddRefs(promise));
   RefPtr<PromiseNativeHandler> l10nReadyHandler = new L10nReadyHandler(mReady);
   promise->AppendNativeHandler(l10nReadyHandler);
 }
 
 Promise*
 DocumentL10n::Ready()
 {
   return mReady;