mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 13:30:31 +00:00
Base: Add a simple test page for window.prompt
The window prototypes alert, confirm, and prompt must "pause" execution until a response is received from the user. This test page is meant to ensure that a timeout queued before a prompt is not executed until after that prompt is closed.
This commit is contained in:
parent
4aeb1ffc12
commit
894bddf62c
Notes:
sideshowbarker
2024-07-17 04:25:37 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/894bddf62c Pull-request: https://github.com/SerenityOS/serenity/pull/16091 Reviewed-by: https://github.com/linusg
2 changed files with 18 additions and 0 deletions
17
Base/res/html/misc/prompt.html
Normal file
17
Base/res/html/misc/prompt.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<pre id=message></pre>
|
||||
<script>
|
||||
const closed = (message) => {
|
||||
console.log(message);
|
||||
document.getElementById('message').innerHTML = `Message: "${message}"\n`;
|
||||
};
|
||||
|
||||
setTimeout(() => { console.log('This must not appear until after the prompt is closed.'); }, 1000);
|
||||
closed(prompt("Hello friends!"));
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -167,6 +167,7 @@
|
|||
<li><a href="events.html">simple DOM events</a></li>
|
||||
<li><a href="dom.html">simple DOM JS</a></li>
|
||||
<li><a href="alert.html">alert()</a></li>
|
||||
<li><a href="prompt.html">prompt()</a></li>
|
||||
<li><a href="qsa.html">querySelectorAll()</a></li>
|
||||
<li><a href="innerHTML.html">innerHTML()</a></li>
|
||||
<li><a href="demo.html">fun demo</a></li>
|
||||
|
|
Loading…
Reference in a new issue