| Index: Source/core/frame/LocalDOMWindow.cpp
|
| diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
|
| index 951255ace8577aa40c02952f5350e1c789f533be..2842e4b38ebbd988b33af2c22f5cad5b712fe9ab 100644
|
| --- a/Source/core/frame/LocalDOMWindow.cpp
|
| +++ b/Source/core/frame/LocalDOMWindow.cpp
|
| @@ -787,8 +787,10 @@ void LocalDOMWindow::print()
|
|
|
| if (frame()->document()->isSandboxed(SandboxModals)) {
|
| UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
|
| - if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled())
|
| + if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled()) {
|
| + frameConsole()->addMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Ignored call to 'print()'. The document is sandboxed, and the 'allow-modals' keyword is not set."));
|
| return;
|
| + }
|
| }
|
|
|
| if (frame()->isLoading()) {
|
| @@ -813,8 +815,10 @@ void LocalDOMWindow::alert(const String& message)
|
|
|
| if (frame()->document()->isSandboxed(SandboxModals)) {
|
| UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
|
| - if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled())
|
| + if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled()) {
|
| + frameConsole()->addMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Ignored call to 'alert()'. The document is sandboxed, and the 'allow-modals' keyword is not set."));
|
| return;
|
| + }
|
| }
|
|
|
| frame()->document()->updateLayoutTreeIfNeeded();
|
| @@ -833,8 +837,10 @@ bool LocalDOMWindow::confirm(const String& message)
|
|
|
| if (frame()->document()->isSandboxed(SandboxModals)) {
|
| UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
|
| - if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled())
|
| + if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled()) {
|
| + frameConsole()->addMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Ignored call to 'confirm()'. The document is sandboxed, and the 'allow-modals' keyword is not set."));
|
| return false;
|
| + }
|
| }
|
|
|
| frame()->document()->updateLayoutTreeIfNeeded();
|
| @@ -843,12 +849,6 @@ bool LocalDOMWindow::confirm(const String& message)
|
| if (!host)
|
| return false;
|
|
|
| - if (frame()->document()->isSandboxed(SandboxModals)) {
|
| - UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
|
| - if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled())
|
| - return false;
|
| - }
|
| -
|
| return host->chromeClient().openJavaScriptConfirm(frame(), message);
|
| }
|
|
|
| @@ -859,8 +859,10 @@ String LocalDOMWindow::prompt(const String& message, const String& defaultValue)
|
|
|
| if (frame()->document()->isSandboxed(SandboxModals)) {
|
| UseCounter::count(frame()->document(), UseCounter::DialogInSandboxedContext);
|
| - if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled())
|
| + if (RuntimeEnabledFeatures::sandboxBlocksModalsEnabled()) {
|
| + frameConsole()->addMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Ignored call to 'prompt()'. The document is sandboxed, and the 'allow-modals' keyword is not set."));
|
| return String();
|
| + }
|
| }
|
|
|
| frame()->document()->updateLayoutTreeIfNeeded();
|
|
|