From 981c08f62d444c966d5607204c517b6c1532c86d Mon Sep 17 00:00:00 2001 From: mattreaganmozilla <145381717+mattreaganmozilla@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:09:07 -0700 Subject: [PATCH] Document FXIOS-10334 ToDo's for forthcoming JS alert refactors (#22662) Add ToDo comments per 10/18 incident reverts and related FXIOS-10334 ticket --- .../Extensions/BrowserViewController+WebViewDelegates.swift | 2 ++ .../BrowserViewController/Views/BrowserViewController.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+WebViewDelegates.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+WebViewDelegates.swift index b7a59bfd28a1..c96845bec72e 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+WebViewDelegates.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+WebViewDelegates.swift @@ -62,6 +62,7 @@ extension BrowserViewController: WKUIDelegate { logger.log("Javascript message alert will be presented.", level: .info, category: .webview) present(messageAlert.alertController(), animated: true) { + // TODO: [FXIOS-10334] This should be called when the alert is dismissed, not presented completionHandler() self.logger.log("Javascript message alert was completed.", level: .info, category: .webview) } @@ -69,6 +70,7 @@ extension BrowserViewController: WKUIDelegate { logger.log("Javascript message alert is queued.", level: .info, category: .webview) promptingTab.queueJavascriptAlertPrompt(messageAlert) + // TODO: [FXIOS-10334] This should be called when the alert is dismissed, not enqueued completionHandler() } } diff --git a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift index 81ac6a41bc87..7fc81a131739 100644 --- a/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift +++ b/firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift @@ -1029,6 +1029,7 @@ class BrowserViewController: UIViewController, // Ensure the layout is updated immediately view.layoutIfNeeded() + // TODO: [FXIOS-10334] Needs investigation. Dequeuing JS alerts as part of subview layout is problematic. showQueuedAlertIfAvailable() switchToolbarIfNeeded() adjustURLBarHeightBasedOnLocationViewHeight()