<!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>[199375] 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/199375">199375</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-04-12 11:33:56 -0700 (Tue, 12 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[OS X] Flakey crash after ScrollAnimatorMac destruction
https://bugs.webkit.org/show_bug.cgi?id=156372

Reviewed by Darin Adler.

Source/WebCore:

Previously, we were disabling the mock scrollbars using JavaScript after
the WebView was created. However, enabling these mock scrollbars can be
triggered with a bit of state inside the WebPreferences object, which
means WebKit clients can change it at any point. DumpRenderTree is doing
this during the document's lifetime.

This means that the creation of the Scrollbar objects saw a non-mock
ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
returns early because it sees that there is nothing to deregister
due to the ScrollbarTheme being mocked).

This cleanup is necessary because it sets the NSScrollerImp's delegate
to nil before the NSScrollerImpDelegate gets destroyed. Because the
cleanup wasn't happening, the delegate pointer wasn't getting set to
nil, so the pointer was dangling, and AppKit was following it and
crashing.

Because the clients of this bit of state can change it at any time,
it is incorrect to change it in JavaScript. Instead, the client must
manage this bit of state (so the client and the web process are always
in sync). Therefore, the correct way to set this bit of state must be
done in the test runner rather than Javascript internals. The mechanism
we have to do that is the &lt;!-- webkit-test-runner --&gt; comment at the
beginning of the test. This patch migrates to this mechanism and removes
the old internals method.

Test: fast/scrolling/rtl-scrollbars-animation-property.html

* page/Settings.cpp:
* testing/Internals.cpp:
(WebCore::Internals::setMockScrollbarsEnabled): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Implement the new &lt;!-- webkit-test-runner --&gt; flag.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::ensureViewSupportsOptionsForTest):
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::TestController::resetStateToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WKR::PlatformWebView::viewSupportsOptions):

LayoutTests:

Migrate to the new mechanism for disabling mock scrollbars in tests.

* fast/scrolling/rtl-scrollbars-animation-property.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarsanimationpropertyhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastscrollingrtlscrollbarsanimationpropertyexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/scrolling/rtl-scrollbars-animation-property-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</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="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestOptionsh">trunk/Tools/WebKitTestRunner/TestOptions.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacPlatformWebViewMacmm">trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/LayoutTests/ChangeLog        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-04-12  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Flakey crash after ScrollAnimatorMac destruction
+        https://bugs.webkit.org/show_bug.cgi?id=156372
+
+        Reviewed by Darin Adler.
+
+        Migrate to the new mechanism for disabling mock scrollbars in tests.
+
+        * fast/scrolling/rtl-scrollbars-animation-property.html:
+
</ins><span class="cx"> 2016-04-12  Saam barati  &lt;sbarati@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         We incorrectly parse arrow function expressions
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarsanimationpropertyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -1,10 +1,6 @@
</span><del>-&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
</del><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true useMockScrollbars=false ] --&gt;
</ins><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><del>-&lt;script&gt;
-if (window.internals)
-    window.internals.setMockScrollbarsEnabled(false);
-&lt;/script&gt;
</del><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div style=&quot;width: 200px; height: 200px; position: relative; overflow: scroll;&quot;&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastscrollingrtlscrollbarsanimationpropertyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/scrolling/rtl-scrollbars-animation-property-expected.txt (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/scrolling/rtl-scrollbars-animation-property-expected.txt        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/LayoutTests/platform/ios-simulator/fast/scrolling/rtl-scrollbars-animation-property-expected.txt        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -3,9 +3,9 @@
</span><span class="cx"> layer at (0,0) size 800x216
</span><span class="cx">   RenderBlock {HTML} at (0,0) size 800x216
</span><span class="cx">     RenderBody {BODY} at (8,8) size 784x200
</span><del>-layer at (8,8) size 200x200 scrollHeight 2000
</del><ins>+layer at (8,8) size 200x200 clip at (8,8) size 185x185 scrollHeight 2000
</ins><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 200x200
</span><del>-layer at (8,8) size 1x2000 backgroundClip at (8,8) size 200x200 clip at (8,8) size 200x200
</del><ins>+layer at (8,8) size 1x2000 backgroundClip at (8,8) size 185x185 clip at (8,8) size 185x185
</ins><span class="cx">   RenderBlock (positioned) {DIV} at (0,0) size 1x2000
</span><span class="cx"> layer at (0,0) size 1x2000
</span><span class="cx">   RenderBlock (positioned) {DIV} at (0,0) size 1x2000
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Source/WebCore/ChangeLog        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-04-12  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Flakey crash after ScrollAnimatorMac destruction
+        https://bugs.webkit.org/show_bug.cgi?id=156372
+
+        Reviewed by Darin Adler.
+
+        Previously, we were disabling the mock scrollbars using JavaScript after
+        the WebView was created. However, enabling these mock scrollbars can be
+        triggered with a bit of state inside the WebPreferences object, which
+        means WebKit clients can change it at any point. DumpRenderTree is doing
+        this during the document's lifetime.
+
+        This means that the creation of the Scrollbar objects saw a non-mock
+        ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
+        ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
+        cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
+        returns early because it sees that there is nothing to deregister
+        due to the ScrollbarTheme being mocked).
+
+        This cleanup is necessary because it sets the NSScrollerImp's delegate
+        to nil before the NSScrollerImpDelegate gets destroyed. Because the
+        cleanup wasn't happening, the delegate pointer wasn't getting set to
+        nil, so the pointer was dangling, and AppKit was following it and
+        crashing.
+
+        Because the clients of this bit of state can change it at any time,
+        it is incorrect to change it in JavaScript. Instead, the client must
+        manage this bit of state (so the client and the web process are always
+        in sync). Therefore, the correct way to set this bit of state must be
+        done in the test runner rather than Javascript internals. The mechanism
+        we have to do that is the &lt;!-- webkit-test-runner --&gt; comment at the
+        beginning of the test. This patch migrates to this mechanism and removes
+        the old internals method.
+
+        Test: fast/scrolling/rtl-scrollbars-animation-property.html
+
+        * page/Settings.cpp:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setMockScrollbarsEnabled): Deleted.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-04-12  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove UsePointersEvenForNonNullableObjectArguments from SVG lists
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Source/WebCore/page/Settings.cpp        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -626,6 +626,10 @@
</span><span class="cx">         m_page-&gt;mainFrame().view()-&gt;setScrollingPerformanceLoggingEnabled(enabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// It's very important that this setting doesn't change in the middle of a document's lifetime.
+// The Mac port uses this flag when registering and deregistering platform-dependent scrollbar
+// objects. Therefore, if this changes at an unexpected time, deregistration may not happen
+// correctly, which may cause the platform to follow dangling pointers.
</ins><span class="cx"> void Settings::setMockScrollbarsEnabled(bool flag)
</span><span class="cx"> {
</span><span class="cx">     gMockScrollbarsEnabled = flag;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -2749,11 +2749,6 @@
</span><span class="cx">     WebCore::Settings::setUsesMockScrollAnimator(enabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Internals::setMockScrollbarsEnabled(bool enabled)
-{
-    WebCore::Settings::setMockScrollbarsEnabled(enabled);
-}
-
</del><span class="cx"> void Internals::forceReload(bool endToEnd)
</span><span class="cx"> {
</span><span class="cx">     frame()-&gt;loader().reload(endToEnd);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Source/WebCore/testing/Internals.h        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -351,7 +351,6 @@
</span><span class="cx"> 
</span><span class="cx">     void setUsesOverlayScrollbars(bool);
</span><span class="cx">     void setUsesMockScrollAnimator(bool);
</span><del>-    void setMockScrollbarsEnabled(bool);
</del><span class="cx"> 
</span><span class="cx">     String getCurrentCursorInfo(ExceptionCode&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -354,7 +354,6 @@
</span><span class="cx"> 
</span><span class="cx">     void setUsesOverlayScrollbars(boolean enabled);
</span><span class="cx">     void setUsesMockScrollAnimator(boolean enabled);
</span><del>-    void setMockScrollbarsEnabled(boolean enabled);
</del><span class="cx"> 
</span><span class="cx">     void forceReload(boolean endToEnd);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/ChangeLog        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-04-12  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Flakey crash after ScrollAnimatorMac destruction
+        https://bugs.webkit.org/show_bug.cgi?id=156372
+
+        Reviewed by Darin Adler.
+
+        Implement the new &lt;!-- webkit-test-runner --&gt; flag.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createWebViewWithOptions):
+        (WTR::TestController::ensureViewSupportsOptionsForTest):
+        (WTR::TestController::resetPreferencesToConsistentValues):
+        (WTR::TestController::resetStateToConsistentValues):
+        (WTR::updateTestOptionsFromTestHeader):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestInvocation.cpp:
+        (WTR::TestInvocation::invoke):
+        * WebKitTestRunner/TestOptions.h:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WKR::PlatformWebView::viewSupportsOptions):
+
</ins><span class="cx"> 2016-04-12  Tomas Popela  &lt;tpopela@redhat.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Modify the CXXFLAGS in webkitdirs.pm just on architectures where the flags are supported
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -489,7 +489,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Some preferences (notably mock scroll bars setting) currently cannot be re-applied to an existing view, so we need to set them now.
</span><span class="cx">     // FIXME: Migrate these preferences to WKContextConfigurationRef.
</span><del>-    resetPreferencesToConsistentValues();
</del><ins>+    resetPreferencesToConsistentValues(options);
</ins><span class="cx"> 
</span><span class="cx">     platformCreateWebView(configuration.get(), options);
</span><span class="cx">     WKPageUIClientV6 pageUIClient = {
</span><span class="lines">@@ -633,11 +633,11 @@
</span><span class="cx"> 
</span><span class="cx">     createWebViewWithOptions(options);
</span><span class="cx"> 
</span><del>-    if (!resetStateToConsistentValues())
</del><ins>+    if (!resetStateToConsistentValues(options))
</ins><span class="cx">         TestInvocation::dumpWebProcessUnresponsiveness(&quot;&lt;unknown&gt; - TestController::run - Failed to reset state to consistent values\n&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TestController::resetPreferencesToConsistentValues()
</del><ins>+void TestController::resetPreferencesToConsistentValues(const TestOptions&amp; options)
</ins><span class="cx"> {
</span><span class="cx">     // Reset preferences
</span><span class="cx">     WKPreferencesRef preferences = platformPreferences();
</span><span class="lines">@@ -664,7 +664,7 @@
</span><span class="cx">     WKPreferencesSetArtificialPluginInitializationDelayEnabled(preferences, false);
</span><span class="cx">     WKPreferencesSetTabToLinksEnabled(preferences, false);
</span><span class="cx">     WKPreferencesSetInteractiveFormValidationEnabled(preferences, true);
</span><del>-    WKPreferencesSetMockScrollbarsEnabled(preferences, true);
</del><ins>+    WKPreferencesSetMockScrollbarsEnabled(preferences, options.useMockScrollbars);
</ins><span class="cx"> 
</span><span class="cx">     static WKStringRef defaultTextEncoding = WKStringCreateWithUTF8CString(&quot;ISO-8859-1&quot;);
</span><span class="cx">     WKPreferencesSetDefaultTextEncodingName(preferences, defaultTextEncoding);
</span><span class="lines">@@ -704,7 +704,7 @@
</span><span class="cx">     platformResetPreferencesToConsistentValues();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool TestController::resetStateToConsistentValues()
</del><ins>+bool TestController::resetStateToConsistentValues(const TestOptions&amp; options)
</ins><span class="cx"> {
</span><span class="cx">     TemporaryChange&lt;State&gt; changeState(m_state, Resetting);
</span><span class="cx">     m_beforeUnloadReturnValue = true;
</span><span class="lines">@@ -744,7 +744,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Is this needed? Nothing in TestController changes preferences during tests, and if there is
</span><span class="cx">     // some other code doing this, it should probably be responsible for cleanup too.
</span><del>-    resetPreferencesToConsistentValues();
</del><ins>+    resetPreferencesToConsistentValues(options);
</ins><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx">     WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
</span><span class="lines">@@ -954,6 +954,8 @@
</span><span class="cx">             testOptions.useDataDetection = parseBooleanTestHeaderValue(value);
</span><span class="cx">         if (key == &quot;rtlScrollbars&quot;)
</span><span class="cx">             testOptions.useRTLScrollbars = parseBooleanTestHeaderValue(value);
</span><ins>+        if (key == &quot;useMockScrollbars&quot;)
+            testOptions.useMockScrollbars = parseBooleanTestHeaderValue(value);
</ins><span class="cx">         pairStart = pairEnd + 1;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -111,8 +111,8 @@
</span><span class="cx">     // Page Visibility.
</span><span class="cx">     void setHidden(bool);
</span><span class="cx"> 
</span><del>-    bool resetStateToConsistentValues();
-    void resetPreferencesToConsistentValues();
</del><ins>+    bool resetStateToConsistentValues(const TestOptions&amp;);
+    void resetPreferencesToConsistentValues(const TestOptions&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void terminateWebContentProcess();
</span><span class="cx">     void reattachPageToWebProcess();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_webProcessIsUnresponsive)
</span><span class="cx">         dumpWebProcessUnresponsiveness();
</span><del>-    else if (!TestController::singleton().resetStateToConsistentValues()) {
</del><ins>+    else if (!TestController::singleton().resetStateToConsistentValues(m_options)) {
</ins><span class="cx">         // The process froze while loading about:blank, let's start a fresh one.
</span><span class="cx">         // It would be nice to report that the previous test froze after dumping results, but we have no way to do that.
</span><span class="cx">         TestController::singleton().terminateWebContentProcess();
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestOptions.h        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx">     bool isHiDPITest { false };
</span><span class="cx">     bool useDataDetection { false };
</span><span class="cx">     bool useRTLScrollbars { false };
</span><ins>+    bool useMockScrollbars { true };
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;String&gt; overrideLanguages;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacPlatformWebViewMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm (199374 => 199375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2016-04-12 17:55:44 UTC (rev 199374)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2016-04-12 18:33:56 UTC (rev 199375)
</span><span class="lines">@@ -233,7 +233,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool PlatformWebView::viewSupportsOptions(const TestOptions&amp; options) const
</span><span class="cx"> {
</span><del>-    if (m_options.useThreadedScrolling != options.useThreadedScrolling || m_options.overrideLanguages != options.overrideLanguages || m_options.useRTLScrollbars != options.useRTLScrollbars)
</del><ins>+    if (m_options.useThreadedScrolling != options.useThreadedScrolling || m_options.overrideLanguages != options.overrideLanguages || m_options.useRTLScrollbars != options.useRTLScrollbars || m_options.useMockScrollbars != options.useMockScrollbars)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span></span></pre>
</div>
</div>

</body>
</html>