<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[209943] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/209943">209943</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2016-12-16 15:10:56 -0800 (Fri, 16 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a setting to suppress keyboard input during provisional navigation
https://bugs.webkit.org/show_bug.cgi?id=165830

Reviewed by Brent Fulgham.

Source/WebCore:

Added a setting that suppresses keyboard input during provisional navigation. When the
setting is enabled, DOM propogation of keyboard input events (KeyboardEvents,
CompositionEvents, InputEvents, and some TextEvents) is suppressed, and text insertion is
disabled in the editor.

Non-editing default event handling still occurs, for instance keyboard scrolling, access
keys, and focus navigation.

Test: http/tests/navigation/keyboard-events-during-provisional-navigation.html

* dom/CompositionEvent.h: Added a type trait specialization.
* dom/EventDispatcher.cpp:
(WebCore::shouldSuppressEventDispatchInDOM): Added. Returns true if the event is trusted,
FrameLoader::shouldSuppressKeyboardInput() returns true, and the event is a
CompositionEvent, InputEvent, KeyboardEvent, or keyboard/composition TextEvent.
(WebCore::EventDispatcher::dispatchEvent): Called stopPropogation() on the event if
shouldSuppressEventDispatchInDOM() returns true.
* dom/InputEvent.h: Removed the inline no-op destructor so that DataTransfer does not need
to be a complete type in every translation unit that includes this header. Added a type
trait specialization.
* dom/TextEvent.h: Added isKeyboard() to determine if m_inputType is TextEventInputKeyboard.
* editing/Editor.cpp:
(WebCore::Editor::shouldInsertText): Returned false if
FrameLoader::shouldSuppressKeyboardInput() returns true and the action is
EditorInsertActionTyped.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldSuppressKeyboardInput): Added. Returns true if
Settings::shouldSuppressKeyboardInputDuringProvisionalNavigation() returns true and the
state is FrameStateProvisional.
* loader/FrameLoader.h: Declared shouldSuppressKeyboardInput().
* page/EventHandler.h: Exported accessKeyModifiers().
* page/Settings.in: Defined shouldSuppressKeyboardInputDuringProvisionalNavigation with an
initial value of false.
* testing/Internals.cpp:
(WebCore::Internals::accessKeyModifiers): Added. Returns a vector of strings representing
the access key modifiers.
* testing/Internals.h: Declared accessKeyModifiers().
* testing/Internals.idl: Exposed accessKeyModifiers() on the internals object.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h: Defined
shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
(WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
preference.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
(-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
WebCore::Setting.

LayoutTests:

* http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: Added.
* http/tests/navigation/keyboard-events-during-provisional-navigation.html: Added.
* http/tests/navigation/resources/keyboard-events-after-navigation.html: Added.
* http/tests/navigation/resources/keyboard-events-test.js: Added.
(runTest.eventHandler):
(runTest):
* http/tests/navigation/resources/never-respond.php: Added.
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomCompositionEventh">trunk/Source/WebCore/dom/CompositionEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomEventDispatchercpp">trunk/Source/WebCore/dom/EventDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebCoredomInputEventh">trunk/Source/WebCore/dom/InputEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomTextEventh">trunk/Source/WebCore/dom/TextEvent.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoaderh">trunk/Source/WebCore/loader/FrameLoader.h</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlerh">trunk/Source/WebCore/page/EventHandler.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebPreferencesDefinitionsh">trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencescpp">trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKPreferencesmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKPreferencesPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestsnavigationkeyboardeventsduringprovisionalnavigationexpectedtxt">trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationkeyboardeventsduringprovisionalnavigationhtml">trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation.html</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationresourceskeyboardeventsafternavigationhtml">trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-after-navigation.html</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationresourceskeyboardeventstestjs">trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-test.js</a></li>
<li><a href="#trunkLayoutTestshttptestsnavigationresourcesneverrespondphp">trunk/LayoutTests/http/tests/navigation/resources/never-respond.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/LayoutTests/ChangeLog        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-12-16  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Add a setting to suppress keyboard input during provisional navigation
+        https://bugs.webkit.org/show_bug.cgi?id=165830
+
+        Reviewed by Brent Fulgham.
+
+        * http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: Added.
+        * http/tests/navigation/keyboard-events-during-provisional-navigation.html: Added.
+        * http/tests/navigation/resources/keyboard-events-after-navigation.html: Added.
+        * http/tests/navigation/resources/keyboard-events-test.js: Added.
+        (runTest.eventHandler):
+        (runTest):
+        * http/tests/navigation/resources/never-respond.php: Added.
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2016-12-16  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         HTML form validation bubble should be dismissed on navigation
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationkeyboardeventsduringprovisionalnavigationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt (0 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+CONSOLE MESSAGE: line 30: Provisional navigation started.
+CONSOLE MESSAGE: line 31: No trusted events should be logged and the input element should have the value &quot;&quot;.
+CONSOLE MESSAGE: line 18: Dispatching untrusted keypress event.
+CONSOLE MESSAGE: line 5: keypressevent dispatched (isTrusted: false).
+CONSOLE MESSAGE: line 26: Pressing tab.
+CONSOLE MESSAGE: line 28: Active element after pressing tab: [object HTMLInputElement].
+CONSOLE MESSAGE: line 30: Pressing &quot;a&quot;.
+CONSOLE MESSAGE: line 33: Setting marked text to &quot;b&quot;.
+CONSOLE MESSAGE: line 36: Inserting text &quot;c&quot;.
+CONSOLE MESSAGE: line 39: Input element value after text input events: &quot;&quot;.
+CONSOLE MESSAGE: line 34: Pressing &quot;z&quot; with access key modifiers should navigate to resources/keyboard-events-after-navigation.html.
+CONSOLE MESSAGE: line 6: Finished navigating to resources/keyboard-events-after-navigation.html.
+CONSOLE MESSAGE: line 7: Trusted events should be logged and the input element should have the value &quot;ac&quot;.
+CONSOLE MESSAGE: line 18: Dispatching untrusted keypress event.
+CONSOLE MESSAGE: line 5: keypressevent dispatched (isTrusted: false).
+CONSOLE MESSAGE: line 26: Pressing tab.
+CONSOLE MESSAGE: line 5: keydownevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: keyupevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 28: Active element after pressing tab: [object HTMLInputElement].
+CONSOLE MESSAGE: line 30: Pressing &quot;a&quot;.
+CONSOLE MESSAGE: line 5: keydownevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: keypressevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: textInputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: beforeinputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: inputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: keyupevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 33: Setting marked text to &quot;b&quot;.
+CONSOLE MESSAGE: line 5: compositionstartevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: compositionupdateevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: beforeinputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: inputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 36: Inserting text &quot;c&quot;.
+CONSOLE MESSAGE: line 5: beforeinputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: inputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: textInputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: beforeinputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: inputevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 5: compositionendevent dispatched (isTrusted: true).
+CONSOLE MESSAGE: line 39: Input element value after text input events: &quot;ac&quot;.
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationkeyboardeventsduringprovisionalnavigationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation.html (0 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/keyboard-events-during-provisional-navigation.html        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+    &lt;a href=&quot;resources/keyboard-events-after-navigation.html&quot; accesskey=&quot;z&quot;&gt;&lt;/a&gt;
+    &lt;script src=&quot;resources/keyboard-events-test.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+            internals.settings.setShouldSuppressKeyboardInputDuringProvisionalNavigation(true);
+        }
+
+        function waitForProvisionalNavigation(completionHandler)
+        {
+            var xhr = new XMLHttpRequest();
+            xhr.onreadystatechange = function() {
+                if (this.readyState !== this.DONE)
+                    return;
+                window.setTimeout(function() {
+                    completionHandler();
+                }, 0);
+            };
+            xhr.open(&quot;GET&quot;, &quot;resources/never-respond.php&quot;);
+            xhr.send();
+
+            window.location = &quot;resources/never-respond.php&quot;;
+        }
+
+        waitForProvisionalNavigation(function() {
+            console.log(&quot;Provisional navigation started.&quot;);
+            console.log(&quot;No trusted events should be logged and the input element should have the value \&quot;\&quot;.&quot;);
+            runTest();
+
+            console.log(&quot;Pressing \&quot;z\&quot; with access key modifiers should navigate to resources/keyboard-events-after-navigation.html.&quot;);
+            eventSender.keyDown(&quot;z&quot;, internals.accessKeyModifiers());
+        });
+    &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationresourceskeyboardeventsafternavigationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-after-navigation.html (0 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-after-navigation.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-after-navigation.html        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+    &lt;script src=&quot;keyboard-events-test.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+        console.log(&quot;Finished navigating to resources/keyboard-events-after-navigation.html.&quot;);
+        console.log(&quot;Trusted events should be logged and the input element should have the value \&quot;ac\&quot;.&quot;);
+        runTest();
+        testRunner.notifyDone();
+    &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationresourceskeyboardeventstestjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-test.js (0 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-test.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/keyboard-events-test.js        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+function runTest()
+{
+    function eventHandler(event)
+    {
+        console.log(event.type + &quot;event dispatched (isTrusted: &quot; + event.isTrusted + &quot;).&quot;);
+    }
+
+    window.addEventListener(&quot;keydown&quot;, eventHandler, true);
+    window.addEventListener(&quot;keypress&quot;, eventHandler, true);
+    window.addEventListener(&quot;keyup&quot;, eventHandler, true);
+    window.addEventListener(&quot;compositionstart&quot;, eventHandler, true);
+    window.addEventListener(&quot;compositionupdate&quot;, eventHandler, true);
+    window.addEventListener(&quot;compositionend&quot;, eventHandler, true);
+    window.addEventListener(&quot;textInput&quot;, eventHandler, true);
+    window.addEventListener(&quot;beforeinput&quot;, eventHandler, true);
+    window.addEventListener(&quot;input&quot;, eventHandler, true);
+
+    console.log(&quot;Dispatching untrusted keypress event.&quot;);
+    var keyPressEvent = new KeyboardEvent(&quot;keypress&quot;);
+    document.body.dispatchEvent(keyPressEvent);
+
+    var textInput = document.createElement(&quot;input&quot;);
+    textInput.type = &quot;text&quot;;
+    document.body.appendChild(textInput);
+
+    console.log(&quot;Pressing tab.&quot;);
+    eventSender.keyDown(&quot;\t&quot;);
+    console.log(&quot;Active element after pressing tab: &quot; + document.activeElement + &quot;.&quot;);
+
+    console.log(&quot;Pressing \&quot;a\&quot;.&quot;);
+    eventSender.keyDown(&quot;a&quot;);
+
+    console.log(&quot;Setting marked text to \&quot;b\&quot;.&quot;);
+    textInputController.setMarkedText(&quot;b&quot;, 0, 1);
+
+    console.log(&quot;Inserting text \&quot;c\&quot;.&quot;);
+    textInputController.insertText(&quot;c&quot;);
+
+    console.log(&quot;Input element value after text input events: \&quot;&quot; + textInput.value + &quot;\&quot;.&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsnavigationresourcesneverrespondphp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/navigation/resources/never-respond.php (0 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/navigation/resources/never-respond.php                                (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/never-respond.php        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;?php
+for (;;)
+    sleep(1);
+?&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -355,6 +355,7 @@
</span><span class="cx"> fast/shadow-dom/hover-over-slotted-content.html [ Skip ]
</span><span class="cx"> fast/events/keyboardevent-key.html [ Skip ]
</span><span class="cx"> fast/events/keyboardevent-code.html [ Skip ]
</span><ins>+http/tests/navigation/keyboard-events-during-provisional-navigation.html [ Skip ]
</ins><span class="cx"> 
</span><span class="cx"> # The file-wrapper part of &lt;attachment&gt; is not yet working on iOS
</span><span class="cx"> fast/attachment/attachment-type-attribute.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/ChangeLog        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2016-12-16  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Add a setting to suppress keyboard input during provisional navigation
+        https://bugs.webkit.org/show_bug.cgi?id=165830
+
+        Reviewed by Brent Fulgham.
+
+        Added a setting that suppresses keyboard input during provisional navigation. When the
+        setting is enabled, DOM propogation of keyboard input events (KeyboardEvents,
+        CompositionEvents, InputEvents, and some TextEvents) is suppressed, and text insertion is
+        disabled in the editor.
+
+        Non-editing default event handling still occurs, for instance keyboard scrolling, access
+        keys, and focus navigation.
+
+        Test: http/tests/navigation/keyboard-events-during-provisional-navigation.html
+
+        * dom/CompositionEvent.h: Added a type trait specialization.
+        * dom/EventDispatcher.cpp:
+        (WebCore::shouldSuppressEventDispatchInDOM): Added. Returns true if the event is trusted,
+        FrameLoader::shouldSuppressKeyboardInput() returns true, and the event is a
+        CompositionEvent, InputEvent, KeyboardEvent, or keyboard/composition TextEvent.
+        (WebCore::EventDispatcher::dispatchEvent): Called stopPropogation() on the event if
+        shouldSuppressEventDispatchInDOM() returns true.
+        * dom/InputEvent.h: Removed the inline no-op destructor so that DataTransfer does not need
+        to be a complete type in every translation unit that includes this header. Added a type
+        trait specialization.
+        * dom/TextEvent.h: Added isKeyboard() to determine if m_inputType is TextEventInputKeyboard.
+        * editing/Editor.cpp:
+        (WebCore::Editor::shouldInsertText): Returned false if
+        FrameLoader::shouldSuppressKeyboardInput() returns true and the action is
+        EditorInsertActionTyped.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::shouldSuppressKeyboardInput): Added. Returns true if
+        Settings::shouldSuppressKeyboardInputDuringProvisionalNavigation() returns true and the
+        state is FrameStateProvisional.
+        * loader/FrameLoader.h: Declared shouldSuppressKeyboardInput().
+        * page/EventHandler.h: Exported accessKeyModifiers().
+        * page/Settings.in: Defined shouldSuppressKeyboardInputDuringProvisionalNavigation with an
+        initial value of false.
+        * testing/Internals.cpp:
+        (WebCore::Internals::accessKeyModifiers): Added. Returns a vector of strings representing
+        the access key modifiers.
+        * testing/Internals.h: Declared accessKeyModifiers().
+        * testing/Internals.idl: Exposed accessKeyModifiers() on the internals object.
+
</ins><span class="cx"> 2016-12-16  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         More SQLiteIDBCursor refactoring.
</span></span></pre></div>
<a id="trunkSourceWebCoredomCompositionEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CompositionEvent.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CompositionEvent.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/dom/CompositionEvent.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -70,3 +70,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+SPECIALIZE_TYPE_TRAITS_EVENT(CompositionEvent)
</ins></span></pre></div>
<a id="trunkSourceWebCoredomEventDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventDispatcher.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventDispatcher.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/dom/EventDispatcher.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -2,7 +2,7 @@
</span><span class="cx">  * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2010, 2011, 2012, 2013 Google Inc. All rights reserved.
</span><span class="lines">@@ -26,15 +26,20 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;EventDispatcher.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CompositionEvent.h&quot;
</ins><span class="cx"> #include &quot;EventContext.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;EventPath.h&quot;
</span><ins>+#include &quot;Frame.h&quot;
</ins><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><ins>+#include &quot;InputEvent.h&quot;
+#include &quot;KeyboardEvent.h&quot;
</ins><span class="cx"> #include &quot;MouseEvent.h&quot;
</span><span class="cx"> #include &quot;NoEventDispatchAssertion.h&quot;
</span><span class="cx"> #include &quot;ScopedEventQueue.h&quot;
</span><span class="cx"> #include &quot;ShadowRoot.h&quot;
</span><ins>+#include &quot;TextEvent.h&quot;
</ins><span class="cx"> #include &quot;TouchEvent.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -102,6 +107,26 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool shouldSuppressEventDispatchInDOM(Node&amp; node, Event&amp; event)
+{
+    if (!event.isTrusted())
+        return false;
+
+    auto frame = node.document().frame();
+    if (!frame)
+        return false;
+
+    if (!frame-&gt;loader().shouldSuppressKeyboardInput())
+        return false;
+
+    if (is&lt;TextEvent&gt;(event)) {
+        auto&amp; textEvent = downcast&lt;TextEvent&gt;(event);
+        return textEvent.isKeyboard() || textEvent.isComposition();
+    }
+
+    return is&lt;CompositionEvent&gt;(event) || is&lt;InputEvent&gt;(event) || is&lt;KeyboardEvent&gt;(event);
+}
+
</ins><span class="cx"> bool EventDispatcher::dispatchEvent(Node&amp; node, Event&amp; event)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_WITH_SECURITY_IMPLICATION(!NoEventDispatchAssertion::isEventDispatchForbidden());
</span><span class="lines">@@ -129,6 +154,9 @@
</span><span class="cx">     if (is&lt;HTMLInputElement&gt;(node))
</span><span class="cx">         downcast&lt;HTMLInputElement&gt;(node).willDispatchEvent(event, clickHandlingState);
</span><span class="cx"> 
</span><ins>+    if (shouldSuppressEventDispatchInDOM(node, event))
+        event.stopPropagation();
+
</ins><span class="cx">     if (!event.propagationStopped() &amp;&amp; !eventPath.isEmpty()) {
</span><span class="cx">         event.setEventPath(eventPath);
</span><span class="cx">         dispatchEventInDOM(event, eventPath);
</span></span></pre></div>
<a id="trunkSourceWebCoredomInputEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InputEvent.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InputEvent.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/dom/InputEvent.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -48,8 +48,6 @@
</span><span class="cx">     InputEvent(const AtomicString&amp; eventType, const String&amp; inputType, bool canBubble, bool cancelable, DOMWindow*, const String&amp; data, RefPtr&lt;DataTransfer&gt;&amp;&amp;, const Vector&lt;RefPtr&lt;StaticRange&gt;&gt;&amp; targetRanges, int detail);
</span><span class="cx">     InputEvent(const AtomicString&amp; eventType, const Init&amp;, IsTrusted);
</span><span class="cx"> 
</span><del>-    virtual ~InputEvent() { }
-
</del><span class="cx">     bool isInputEvent() const override { return true; }
</span><span class="cx">     EventInterface eventInterface() const final { return InputEventInterfaceType; }
</span><span class="cx">     const String&amp; inputType() const { return m_inputType; }
</span><span class="lines">@@ -65,3 +63,5 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+SPECIALIZE_TYPE_TRAITS_EVENT(InputEvent)
</ins></span></pre></div>
<a id="trunkSourceWebCoredomTextEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/TextEvent.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/TextEvent.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/dom/TextEvent.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">         bool isDrop() const { return m_inputType == TextEventInputDrop; }
</span><span class="cx">         bool isDictation() const { return m_inputType == TextEventInputDictation; }
</span><span class="cx">         bool isAutocompletion() const { return m_inputType == TextEventInputAutocompletion; }
</span><ins>+        bool isKeyboard() const { return m_inputType == TextEventInputKeyboard; }
</ins><span class="cx"> 
</span><span class="cx">         bool shouldSmartReplace() const { return m_shouldSmartReplace; }
</span><span class="cx">         bool shouldMatchStyle() const { return m_shouldMatchStyle; }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/editing/Editor.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006-2008, 2011, 2013-2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -573,6 +573,9 @@
</span><span class="cx"> 
</span><span class="cx"> bool Editor::shouldInsertText(const String&amp; text, Range* range, EditorInsertAction action) const
</span><span class="cx"> {
</span><ins>+    if (m_frame.loader().shouldSuppressKeyboardInput() &amp;&amp; action == EditorInsertActionTyped)
+        return false;
+
</ins><span class="cx">     return client() &amp;&amp; client()-&gt;shouldInsertText(text, range, action);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -3717,4 +3717,9 @@
</span><span class="cx">     return frame;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool FrameLoader::shouldSuppressKeyboardInput() const
+{
+    return m_frame.settings().shouldSuppressKeyboardInputDuringProvisionalNavigation() &amp;&amp; m_state == FrameStateProvisional;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/loader/FrameLoader.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -299,6 +299,7 @@
</span><span class="cx">     void setProvisionalLoadErrorBeingHandledURL(const URL&amp; url) { m_provisionalLoadErrorBeingHandledURL = url; }
</span><span class="cx"> 
</span><span class="cx">     bool isAlwaysOnLoggingAllowed() const;
</span><ins>+    bool shouldSuppressKeyboardInput() const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     enum FormSubmissionCacheLoadPolicy {
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/page/EventHandler.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool needsKeyboardEventDisambiguationQuirks() const;
</span><span class="cx"> 
</span><del>-    static OptionSet&lt;PlatformEvent::Modifier&gt; accessKeyModifiers();
</del><ins>+    WEBCORE_EXPORT static OptionSet&lt;PlatformEvent::Modifier&gt; accessKeyModifiers();
</ins><span class="cx">     WEBCORE_EXPORT bool handleAccessKey(const PlatformKeyboardEvent&amp;);
</span><span class="cx">     WEBCORE_EXPORT bool keyEvent(const PlatformKeyboardEvent&amp;);
</span><span class="cx">     void defaultKeyboardEventHandler(KeyboardEvent&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/page/Settings.in        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -292,3 +292,5 @@
</span><span class="cx"> animatedImageAsyncDecodingEnabled initial=true
</span><span class="cx"> 
</span><span class="cx"> es6ModulesEnabled initial=false
</span><ins>+
+shouldSuppressKeyboardInputDuringProvisionalNavigation initial=false
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -3534,5 +3534,31 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+Vector&lt;String&gt; Internals::accessKeyModifiers() const
+{
+    Vector&lt;String&gt; accessKeyModifierStrings;
</ins><span class="cx"> 
</span><ins>+    for (auto modifier : EventHandler::accessKeyModifiers()) {
+        switch (modifier) {
+        case PlatformEvent::Modifier::AltKey:
+            accessKeyModifierStrings.append(ASCIILiteral(&quot;altKey&quot;));
+            break;
+        case PlatformEvent::Modifier::CtrlKey:
+            accessKeyModifierStrings.append(ASCIILiteral(&quot;ctrlKey&quot;));
+            break;
+        case PlatformEvent::Modifier::MetaKey:
+            accessKeyModifierStrings.append(ASCIILiteral(&quot;metaKey&quot;));
+            break;
+        case PlatformEvent::Modifier::ShiftKey:
+            accessKeyModifierStrings.append(ASCIILiteral(&quot;shiftKey&quot;));
+            break;
+        case PlatformEvent::Modifier::CapsLockKey:
+            accessKeyModifierStrings.append(ASCIILiteral(&quot;capsLockKey&quot;));
+            break;
+        }
+    }
+
+    return accessKeyModifierStrings;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/testing/Internals.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -519,6 +519,8 @@
</span><span class="cx">     bool pageHasPointerLock() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    Vector&lt;String&gt; accessKeyModifiers() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document&amp;);
</span><span class="cx">     Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -491,4 +491,6 @@
</span><span class="cx"> 
</span><span class="cx">     [Conditional=POINTER_LOCK] boolean pageHasPendingPointerLock();
</span><span class="cx">     [Conditional=POINTER_LOCK] boolean pageHasPointerLock();
</span><ins>+
+    sequence&lt;DOMString&gt; accessKeyModifiers();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/ChangeLog        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-12-16  Andy Estes  &lt;aestes@apple.com&gt;
+
+        Add a setting to suppress keyboard input during provisional navigation
+        https://bugs.webkit.org/show_bug.cgi?id=165830
+
+        Reviewed by Brent Fulgham.
+
+        * Shared/WebPreferencesDefinitions.h: Defined
+        shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
+        (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
+        * UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
+        preference.
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
+        (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
+        * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
+        WebCore::Setting.
+
</ins><span class="cx"> 2016-12-16  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         HTML form validation bubble should be dismissed on navigation
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebPreferencesDefinitionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef WebPreferencesDefinitions_h
-#define WebPreferencesDefinitions_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx"> #define DEFAULT_WEBKIT_TABSTOLINKS_ENABLED true
</span><span class="lines">@@ -248,6 +247,7 @@
</span><span class="cx">     macro(EncryptedMediaAPIEnabled, encryptedMediaAPIEnabled, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</span><span class="cx">     macro(IntersectionObserverEnabled, intersectionObserverEnabled, Bool, bool, false, &quot;Intersection Observer&quot;, &quot;Enable Intersection Observer support&quot;) \
</span><span class="cx">     macro(InteractiveFormValidationEnabled, interactiveFormValidationEnabled, Bool, bool, DEFAULT_HTML_INTERACTIVE_FORM_VALIDATION_ENABLED, &quot;HTML Interactive Form Validation&quot;, &quot;HTML interactive form validation&quot;) \
</span><ins>+    macro(ShouldSuppressKeyboardInputDuringProvisionalNavigation, shouldSuppressKeyboardInputDuringProvisionalNavigation, Bool, bool, false, &quot;&quot;, &quot;&quot;) \
</ins><span class="cx">     \
</span><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_WEBKIT_DOUBLE_PREFERENCE(macro) \
</span><span class="lines">@@ -382,5 +382,3 @@
</span><span class="cx">     FOR_EACH_WEBKIT_STRING_PREFERENCE_NOT_IN_WEBCORE(macro) \
</span><span class="cx">     \
</span><span class="cx"> 
</span><del>-
-#endif // WebPreferencesDefinitions_h
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1630,3 +1630,13 @@
</span><span class="cx"> {
</span><span class="cx">     return toImpl(preferencesRef)-&gt;subtleCryptoEnabled();
</span><span class="cx"> }
</span><ins>+
+void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef, bool flag)
+{
+    toImpl(preferencesRef)-&gt;setShouldSuppressKeyboardInputDuringProvisionalNavigation(flag);
+}
+
+bool WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef preferencesRef)
+{
+    return toImpl(preferencesRef)-&gt;shouldSuppressKeyboardInputDuringProvisionalNavigation();
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPreferencesRefPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -453,6 +453,10 @@
</span><span class="cx"> WK_EXPORT void WKPreferencesSetSubtleCryptoEnabled(WKPreferencesRef, bool flag);
</span><span class="cx"> WK_EXPORT bool WKPreferencesGetSubtleCryptoEnabled(WKPreferencesRef);
</span><span class="cx"> 
</span><ins>+// Defaults to false
+WK_EXPORT void WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef, bool flag);
+WK_EXPORT bool WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation(WKPreferencesRef);
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKPreferencesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.mm        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -507,6 +507,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)_shouldSuppressKeyboardInputDuringProvisionalNavigation
+{
+    return _preferences-&gt;shouldSuppressKeyboardInputDuringProvisionalNavigation();
+}
+
+- (void)_setShouldSuppressKeyboardInputDuringProvisionalNavigation:(BOOL)shouldSuppress
+{
+    _preferences-&gt;setShouldSuppressKeyboardInputDuringProvisionalNavigation(shouldSuppress);
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> #endif // WK_API_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKPreferencesPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2014-2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -90,6 +90,7 @@
</span><span class="cx"> // FIXME: This property should not have the verb &quot;is&quot; in it.
</span><span class="cx"> @property (nonatomic, setter=_setOfflineApplicationCacheIsEnabled:) BOOL _offlineApplicationCacheIsEnabled;
</span><span class="cx"> @property (nonatomic, setter=_setFullScreenEnabled:) BOOL _fullScreenEnabled WK_API_AVAILABLE(macosx(10.11), ios(9.0));
</span><ins>+@property (nonatomic, setter=_setShouldSuppressKeyboardInputDuringProvisionalNavigation:) BOOL _shouldSuppressKeyboardInputDuringProvisionalNavigation WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
</ins><span class="cx"> 
</span><span class="cx"> @property (nonatomic, setter=_setApplePayCapabilityDisclosureAllowed:) BOOL _applePayCapabilityDisclosureAllowed WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (209942 => 209943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-12-16 23:03:26 UTC (rev 209942)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-12-16 23:10:56 UTC (rev 209943)
</span><span class="lines">@@ -3237,6 +3237,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     settings.setLargeImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::largeImageAsyncDecodingEnabledKey()));
</span><span class="cx">     settings.setAnimatedImageAsyncDecodingEnabled(store.getBoolValueForKey(WebPreferencesKey::animatedImageAsyncDecodingEnabledKey()));
</span><ins>+    settings.setShouldSuppressKeyboardInputDuringProvisionalNavigation(store.getBoolValueForKey(WebPreferencesKey::shouldSuppressKeyboardInputDuringProvisionalNavigationKey()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DATA_DETECTION)
</span></span></pre>
</div>
</div>

</body>
</html>