Title: [290412] trunk
Revision
290412
Author
n...@apple.com
Date
2022-02-23 22:16:30 -0800 (Wed, 23 Feb 2022)

Log Message

Use of showModalDialog should appear as a warning in WI console
https://bugs.webkit.org/show_bug.cgi?id=237046

Reviewed by Devin Rousso.

Source/WebCore:

* page/DOMWindow.cpp:
(WebCore::DOMWindow::showModalDialog):

LayoutTests:

Test gardening to take in account new console warning.

* fast/animation/request-animation-frame-during-modal-expected.txt:
* fast/dom/Window/open-window-min-size-expected.txt:
* fast/events/show-modal-dialog-onblur-onfocus-expected.txt:
* http/tests/cookies/document-cookie-after-showModalDialog-expected.txt:
* http/tests/security/navigate-when-restoring-cached-page-expected.txt:
* http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt:
* platform/mac-wk1/fast/events/beforeunload-showModalDialog-expected.txt: Added.
* platform/mac-wk1/fast/events/pagehide-showModalDialog-expected.txt: Added.
* platform/mac-wk1/fast/events/unload-showModalDialog-expected.txt: Added.
* platform/wincairo-wk1/fast/events/beforeunload-showModalDialog-expected.txt: Added.
* platform/wincairo-wk1/fast/events/pagehide-showModalDialog-expected.txt: Added.
* platform/wincairo-wk1/fast/events/unload-showModalDialog-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290411 => 290412)


--- trunk/LayoutTests/ChangeLog	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/ChangeLog	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,25 @@
+2022-02-23  Tim Nguyen  <n...@apple.com>
+
+        Use of showModalDialog should appear as a warning in WI console
+        https://bugs.webkit.org/show_bug.cgi?id=237046
+
+        Reviewed by Devin Rousso.
+
+        Test gardening to take in account new console warning.
+
+        * fast/animation/request-animation-frame-during-modal-expected.txt:
+        * fast/dom/Window/open-window-min-size-expected.txt:
+        * fast/events/show-modal-dialog-onblur-onfocus-expected.txt:
+        * http/tests/cookies/document-cookie-after-showModalDialog-expected.txt:
+        * http/tests/security/navigate-when-restoring-cached-page-expected.txt:
+        * http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt:
+        * platform/mac-wk1/fast/events/beforeunload-showModalDialog-expected.txt: Added.
+        * platform/mac-wk1/fast/events/pagehide-showModalDialog-expected.txt: Added.
+        * platform/mac-wk1/fast/events/unload-showModalDialog-expected.txt: Added.
+        * platform/wincairo-wk1/fast/events/beforeunload-showModalDialog-expected.txt: Added.
+        * platform/wincairo-wk1/fast/events/pagehide-showModalDialog-expected.txt: Added.
+        * platform/wincairo-wk1/fast/events/unload-showModalDialog-expected.txt: Added.
+
 2022-02-23  Robert Jenner  <jen...@apple.com>
 
         [ Mac wk1 Release ] imported/w3c/web-platform-tests/html/user-activation/activation-trigger-pointerevent.html is a constant text failure

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-during-modal-expected.txt (290411 => 290412)


--- trunk/LayoutTests/fast/animation/request-animation-frame-during-modal-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-during-modal-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 Tests that requestAnimationFrame callbacks are not invoked while modal dialogs are displayed.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/fast/dom/Window/open-window-min-size-expected.txt (290411 => 290412)


--- trunk/LayoutTests/fast/dom/Window/open-window-min-size-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/fast/dom/Window/open-window-min-size-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/events/show-modal-dialog-onblur-onfocus-expected.txt (290411 => 290412)


--- trunk/LayoutTests/fast/events/show-modal-dialog-onblur-onfocus-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/fast/events/show-modal-dialog-onblur-onfocus-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 Pop up a modal dialog. Verifies that focus events are not fired while inside the message loop.
 
 

Modified: trunk/LayoutTests/http/tests/cookies/document-cookie-after-showModalDialog-expected.txt (290411 => 290412)


--- trunk/LayoutTests/http/tests/cookies/document-cookie-after-showModalDialog-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/http/tests/cookies/document-cookie-after-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,4 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 Tests that document.cookie returns the right value after a showModalDialog() call
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Modified: trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page-expected.txt (290411 => 290412)


--- trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/http/tests/security/navigate-when-restoring-cached-page-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1 +1,3 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 This test passes if it does not print an ALERT with "secret data".

Modified: trunk/LayoutTests/http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt (290411 => 290412)


--- trunk/LayoutTests/http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/LayoutTests/http/tests/security/showModalDialog-sync-cross-origin-page-load2-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,2 +1,3 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
 This test passes if it does not alert the fail.html's content when clicking the button.
 

Added: trunk/LayoutTests/platform/mac-wk1/fast/events/beforeunload-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/mac-wk1/fast/events/beforeunload-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/events/beforeunload-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Added: trunk/LayoutTests/platform/mac-wk1/fast/events/pagehide-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/mac-wk1/fast/events/pagehide-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/events/pagehide-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Added: trunk/LayoutTests/platform/mac-wk1/fast/events/unload-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/mac-wk1/fast/events/unload-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/events/unload-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,8 @@
+main frame - has 1 onunload handler(s)
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Added: trunk/LayoutTests/platform/wincairo-wk1/fast/events/beforeunload-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/wincairo-wk1/fast/events/beforeunload-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wincairo-wk1/fast/events/beforeunload-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Added: trunk/LayoutTests/platform/wincairo-wk1/fast/events/pagehide-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/wincairo-wk1/fast/events/pagehide-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wincairo-wk1/fast/events/pagehide-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,7 @@
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Added: trunk/LayoutTests/platform/wincairo-wk1/fast/events/unload-showModalDialog-expected.txt (0 => 290412)


--- trunk/LayoutTests/platform/wincairo-wk1/fast/events/unload-showModalDialog-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wincairo-wk1/fast/events/unload-showModalDialog-expected.txt	2022-02-24 06:16:30 UTC (rev 290412)
@@ -0,0 +1,8 @@
+main frame - has 1 onunload handler(s)
+CONSOLE MESSAGE: showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead.
+CONSOLE MESSAGE: Use of window.showModalDialog is not allowed while unloading a page.
+This test verifies that prompts are forbidden when leaving a webpage.
+
+Prompts include alert, confirm, prompt, and showModalDialog.
+
+If there is no prompt, the test passed.

Modified: trunk/Source/WebCore/ChangeLog (290411 => 290412)


--- trunk/Source/WebCore/ChangeLog	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/Source/WebCore/ChangeLog	2022-02-24 06:16:30 UTC (rev 290412)
@@ -1,3 +1,13 @@
+2022-02-23  Tim Nguyen  <n...@apple.com>
+
+        Use of showModalDialog should appear as a warning in WI console
+        https://bugs.webkit.org/show_bug.cgi?id=237046
+
+        Reviewed by Devin Rousso.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::showModalDialog):
+
 2022-02-23  Chris Dumez  <cdu...@apple.com>
 
         Modernize / simplify ScrollingStateTree a bit

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (290411 => 290412)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2022-02-24 03:18:27 UTC (rev 290411)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2022-02-24 06:16:30 UTC (rev 290412)
@@ -2669,6 +2669,9 @@
 
 void DOMWindow::showModalDialog(const String& urlString, const String& dialogFeaturesString, DOMWindow& activeWindow, DOMWindow& firstWindow, const Function<void(DOMWindow&)>& prepareDialogFunction)
 {
+    if (RefPtr document = this->document())
+        document->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, "showModalDialog() is deprecated and will be removed. Please use the <dialog> element instead."_s);
+
     if (!isCurrentlyDisplayedInFrame())
         return;
     if (!activeWindow.frame())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to