Title: [207599] branches/safari-602-branch/Source

Diff

Modified: branches/safari-602-branch/Source/WebCore/ChangeLog (207598 => 207599)


--- branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-20 09:59:27 UTC (rev 207598)
+++ branches/safari-602-branch/Source/WebCore/ChangeLog	2016-10-20 09:59:31 UTC (rev 207599)
@@ -1,5 +1,22 @@
 2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r206132. rdar://problem/28634856
+
+    2016-09-19  Anders Carlsson  <ander...@apple.com>
+
+            Suppress _javascript_ prompts early on in certain cases
+            https://bugs.webkit.org/show_bug.cgi?id=162243
+            rdar://problem/27661602
+
+            Reviewed by Geoffrey Garen.
+
+            Export symbols needed by WebKit2.
+
+            * loader/FrameLoader.h:
+            * loader/FrameLoaderStateMachine.h:
+
+2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r205326. rdar://problem/28476952
 
     2016-09-01  Ricky Mondello  <rmonde...@apple.com>

Modified: branches/safari-602-branch/Source/WebCore/loader/FrameLoader.h (207598 => 207599)


--- branches/safari-602-branch/Source/WebCore/loader/FrameLoader.h	2016-10-20 09:59:27 UTC (rev 207598)
+++ branches/safari-602-branch/Source/WebCore/loader/FrameLoader.h	2016-10-20 09:59:31 UTC (rev 207599)
@@ -230,7 +230,7 @@
 
     bool checkIfFormActionAllowedByCSP(const URL&, bool didReceiveRedirectResponse) const;
 
-    Frame* opener();
+    WEBCORE_EXPORT Frame* opener();
     WEBCORE_EXPORT void setOpener(Frame*);
 
     void resetMultipleFormSubmissionProtection();

Modified: branches/safari-602-branch/Source/WebCore/loader/FrameLoaderStateMachine.h (207598 => 207599)


--- branches/safari-602-branch/Source/WebCore/loader/FrameLoaderStateMachine.h	2016-10-20 09:59:27 UTC (rev 207598)
+++ branches/safari-602-branch/Source/WebCore/loader/FrameLoaderStateMachine.h	2016-10-20 09:59:31 UTC (rev 207599)
@@ -55,7 +55,7 @@
     WEBCORE_EXPORT bool committingFirstRealLoad() const;
     bool committedFirstRealDocumentLoad() const;
     bool creatingInitialEmptyDocument() const;
-    bool isDisplayingInitialEmptyDocument() const;
+    WEBCORE_EXPORT bool isDisplayingInitialEmptyDocument() const;
     WEBCORE_EXPORT bool firstLayoutDone() const;
     void advanceTo(State);
 

Modified: branches/safari-602-branch/Source/WebKit2/ChangeLog (207598 => 207599)


--- branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-10-20 09:59:27 UTC (rev 207598)
+++ branches/safari-602-branch/Source/WebKit2/ChangeLog	2016-10-20 09:59:31 UTC (rev 207599)
@@ -1,3 +1,24 @@
+2016-10-20  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r206132. rdar://problem/28634856
+
+    2016-09-19  Anders Carlsson  <ander...@apple.com>
+
+            Suppress _javascript_ prompts early on in certain cases
+            https://bugs.webkit.org/show_bug.cgi?id=162243
+            rdar://problem/27661602
+
+            Reviewed by Geoffrey Garen.
+
+            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+            (WebKit::shouldSuppressJavaScriptDialogs):
+            Add helper function.
+
+            (WebKit::WebChromeClient::runJavaScriptAlert):
+            (WebKit::WebChromeClient::runJavaScriptConfirm):
+            (WebKit::WebChromeClient::runJavaScriptPrompt):
+            Call helper function and return early if we should supress dialogs.
+
 2016-09-28  Babak Shafiei  <bshaf...@apple.com>
 
         Merge r206527. rdar://problem/28499358

Modified: branches/safari-602-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (207598 => 207599)


--- branches/safari-602-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-10-20 09:59:27 UTC (rev 207598)
+++ branches/safari-602-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-10-20 09:59:31 UTC (rev 207599)
@@ -379,8 +379,19 @@
     m_page->sendClose();
 }
 
+static bool shouldSuppressJavaScriptDialogs(Frame& frame)
+{
+    if (frame.loader().opener() && frame.loader().stateMachine().isDisplayingInitialEmptyDocument() && frame.loader().provisionalDocumentLoader())
+        return true;
+
+    return false;
+}
+
 void WebChromeClient::runJavaScriptAlert(Frame* frame, const String& alertText)
 {
+    if (shouldSuppressJavaScriptDialogs(*frame))
+        return;
+
     WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
     ASSERT(webFrame);
 
@@ -394,6 +405,9 @@
 
 bool WebChromeClient::runJavaScriptConfirm(Frame* frame, const String& message)
 {
+    if (shouldSuppressJavaScriptDialogs(*frame))
+        return false;
+
     WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
     ASSERT(webFrame);
 
@@ -411,6 +425,9 @@
 
 bool WebChromeClient::runJavaScriptPrompt(Frame* frame, const String& message, const String& defaultValue, String& result)
 {
+    if (shouldSuppressJavaScriptDialogs(*frame))
+        return false;
+
     WebFrame* webFrame = WebFrame::fromCoreFrame(*frame);
     ASSERT(webFrame);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to