<!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>[197956] 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/197956">197956</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-03-10 14:05:30 -0800 (Thu, 10 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[OS X] Main frame scrollbars should appear on the left on RTL systems
https://bugs.webkit.org/show_bug.cgi?id=155149

Reviewed by Simon Fraser.

Source/WebCore:

A helper function, ScrollableArea::systemLanguageIsRTL() is used to determine
if we should be in this new mode. Once we have determined we should be in
this new mode, there are some scattered places where the geometry math
needed to be updated.

Tests: fast/scrolling/rtl-scrollbars-simple.html
       fast/scrolling/rtl-scrollbars.html

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
* platform/mac/ScrollableAreaMac.mm:
(WebCore::ScrollableArea::systemLanguageIsRTL):
* platform/ScrollableArea.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
(WebCore::ScrollView::scrollCornerRect):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimator::scrollbarsAreRTL):
* platform/spi/mac/NSScrollerImpSPI.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::positionForClipLayer):

Tools:

Setting the volatile default needs to be done early, so it is
plumbed through the injected bundle's initialization routine.

Control of RTL scrollbars is handled by putting the string
&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
on the first line of a test.

* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::shouldUseRTLScrollbars):
(WTR::InjectedBundle::platformInitialize):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generatePageConfiguration):
(WTR::updateTestOptionsFromTestHeader):
(WTR::TestController::getInjectedBundleInitializationUserData):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestOptions.h:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::viewSupportsOptions):

LayoutTests:

* fast/scrolling/rtl-scrollbars-expected.html: Added.
* fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: Added.
* fast/scrolling/rtl-scrollbars-simple.html: Added.
* fast/scrolling/rtl-scrollbars.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/win/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp">trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm">trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollViewcpp">trunk/Source/WebCore/platform/ScrollView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreacpp">trunk/Source/WebCore/platform/ScrollableArea.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacNSScrollerImpSPIh">trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlemacInjectedBundleMacmm">trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm</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="#trunkToolsWebKitTestRunnerTestOptionsh">trunk/Tools/WebKitTestRunner/TestOptions.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacPlatformWebViewMacmm">trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarsexpectedhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarssimpleexpectedmismatchhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarssimplehtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarshtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars.html</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollableAreaMacmm">trunk/Source/WebCore/platform/mac/ScrollableAreaMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/ChangeLog        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-03-10  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Main frame scrollbars should appear on the left on RTL systems
+        https://bugs.webkit.org/show_bug.cgi?id=155149
+
+        Reviewed by Simon Fraser.
+
+        * fast/scrolling/rtl-scrollbars-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html: Added.
+        * fast/scrolling/rtl-scrollbars-simple.html: Added.
+        * fast/scrolling/rtl-scrollbars.html: Added.
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator/TestExpectations:
+        * platform/win/TestExpectations:
+
</ins><span class="cx"> 2016-03-07  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-expected.html (0 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-expected.html        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;height: 1000px; position: relative;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; bottom: 0px;&quot;&gt;This test makes sure that rtl scrollbars are on the left of the main frame.&lt;/div&gt;
+&lt;script&gt;
+window.scrollTo(0, 1000);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarssimpleexpectedmismatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html (0 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple-expected-mismatch.html        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;height: 1000px;&quot;&gt;
+This test makes sure that rtl scrollbars are on the left of the main frame.
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarssimplehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple.html (0 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-simple.html        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;height: 1000px;&quot;&gt;
+This test makes sure that rtl scrollbars are on the left of the main frame.
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars.html (0 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars.html        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;height: 1000px; position: relative;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; bottom: 0px;&quot;&gt;This test makes sure that rtl scrollbars are on the left of the main frame.&lt;/div&gt;
+&lt;script&gt;
+if (window.eventSender) {
+    eventSender.mouseMoveTo(4, 20);
+    eventSender.mouseDown();
+    eventSender.mouseMoveTo(4, window.innerHeight - 20);
+    eventSender.mouseUp();
+}
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -2957,3 +2957,7 @@
</span><span class="cx"> webkit.org/b/152602 loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html [ Crash ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/153772 fast/shadow-dom/slot-removal-crash-2.html [ Timeout ]
</span><ins>+
+# RTL Scrollbars are only implemented on OS X
+fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -2703,3 +2703,7 @@
</span><span class="cx"> 
</span><span class="cx"> # This test relies on iOS-specific font fallback.
</span><span class="cx"> fast/text/arabic-blacklisted-expected.html [ Pass ImageOnlyFailure ]
</span><ins>+
+# RTL Scrollbars are only implemented on OS X
+fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -2989,3 +2989,7 @@
</span><span class="cx"> webkit.org/b/155174 svg/animations/animate-marker-orient-from-angle-to-autostartreverse.html [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/155271 [ Debug ] js/regress/getter-richards-try-catch.html [ Skip ]
</span><ins>+
+# RTL Scrollbars are only implemented on OS X.
+fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1335,3 +1335,7 @@
</span><span class="cx"> webkit.org/b/155092 js/arraybuffer-wrappers.html [ Pass Timeout ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/155140 js/promises-tests/promises-tests-2-3-3.html [ Pass Failure ]
</span><ins>+
+# RTL Scrollbars are only implemented on certain OSes.
+[ Yosemite ElCapitan ] fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+[ Yosemite ElCapitan ] fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -195,3 +195,7 @@
</span><span class="cx"> 
</span><span class="cx"> # This test checks ScrollAnimator events only for main frame scrollbars that use native widgets in WK1.
</span><span class="cx"> fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html [ Skip ]
</span><ins>+
+# RTL Scrollbars are only implemented in WK2
+fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -3360,3 +3360,7 @@
</span><span class="cx"> 
</span><span class="cx"> # This test relies on iOS-specific font fallback.
</span><span class="cx"> fast/text/arabic-blacklisted-expected.html [ Pass ImageOnlyFailure ]
</span><ins>+
+# RTL Scrollbars are only implemented on OS X
+fast/scrolling/rtl-scrollbars.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-simple.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/ChangeLog        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2016-03-10  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Main frame scrollbars should appear on the left on RTL systems
+        https://bugs.webkit.org/show_bug.cgi?id=155149
+
+        Reviewed by Simon Fraser.
+
+        A helper function, ScrollableArea::systemLanguageIsRTL() is used to determine
+        if we should be in this new mode. Once we have determined we should be in
+        this new mode, there are some scattered places where the geometry math
+        needed to be updated.
+
+        Tests: fast/scrolling/rtl-scrollbars-simple.html
+               fast/scrolling/rtl-scrollbars.html
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
+        * platform/mac/ScrollableAreaMac.mm:
+        (WebCore::ScrollableArea::systemLanguageIsRTL):
+        * platform/ScrollableArea.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars):
+        (WebCore::ScrollView::scrollCornerRect):
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimator::scrollbarsAreRTL):
+        * platform/spi/mac/NSScrollerImpSPI.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::positionForClipLayer):
+
</ins><span class="cx"> 2016-03-07  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -979,6 +979,7 @@
</span><span class="cx">                 1C81B95A0E97330800266E07 /* InspectorController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9560E97330800266E07 /* InspectorController.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1C81B95B0E97330800266E07 /* InspectorController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C81B9570E97330800266E07 /* InspectorController.cpp */; };
</span><span class="cx">                 1C81B95C0E97330800266E07 /* InspectorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C81B9580E97330800266E07 /* InspectorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                1C99542E1C92105200DBD226 /* ScrollableAreaMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C99542D1C92105200DBD226 /* ScrollableAreaMac.mm */; };
</ins><span class="cx">                 1CA19E050DC255950065A994 /* EventLoopMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CA19E030DC255950065A994 /* EventLoopMac.mm */; };
</span><span class="cx">                 1CA19E160DC255CA0065A994 /* EventLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CA19E150DC255CA0065A994 /* EventLoop.h */; };
</span><span class="cx">                 1CAF34810A6C405200ABE06E /* WebScriptObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8431,6 +8432,7 @@
</span><span class="cx">                 1C81B9570E97330800266E07 /* InspectorController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorController.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C81B9580E97330800266E07 /* InspectorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1C904DF90BA9D2C80081E9D0 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1C99542D1C92105200DBD226 /* ScrollableAreaMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollableAreaMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1CA19E030DC255950065A994 /* EventLoopMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventLoopMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1CA19E150DC255CA0065A994 /* EventLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventLoop.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1CAF347E0A6C405200ABE06E /* WebScriptObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebScriptObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16834,7 +16836,7 @@
</span><span class="cx">                                 41F54F7D1C50C4F600338488 /* FetchBody.cpp */,
</span><span class="cx">                                 41F54F7E1C50C4F600338488 /* FetchBody.h */,
</span><span class="cx">                                 41F54F7F1C50C4F600338488 /* FetchBody.idl */,
</span><del>-                                 4147E2B21C88337F00A7E715 /* FetchBodyOwner.h */,
</del><ins>+                                4147E2B21C88337F00A7E715 /* FetchBodyOwner.h */,
</ins><span class="cx">                                 41F54F821C50C4F600338488 /* FetchHeaders.cpp */,
</span><span class="cx">                                 41F54F831C50C4F600338488 /* FetchHeaders.h */,
</span><span class="cx">                                 41F54F841C50C4F600338488 /* FetchHeaders.idl */,
</span><span class="lines">@@ -17928,6 +17930,7 @@
</span><span class="cx">                                 CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
</span><span class="cx">                                 CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
</span><span class="cx">                                 9380F47709A11ACC001FDB34 /* WidgetMac.mm */,
</span><ins>+                                1C99542D1C92105200DBD226 /* ScrollableAreaMac.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -31200,6 +31203,7 @@
</span><span class="cx">                                 F55B3DCB1251F12D003EF269 /* RadioInputType.cpp in Sources */,
</span><span class="cx">                                 B658FFA51522EFAA00DD5595 /* RadioNodeList.cpp in Sources */,
</span><span class="cx">                                 93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
</span><ins>+                                1C99542E1C92105200DBD226 /* ScrollableAreaMac.mm in Sources */,
</ins><span class="cx">                                 F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */,
</span><span class="cx">                                 6E84E9E017668BEE00815B68 /* RasterShape.cpp in Sources */,
</span><span class="cx">                                 FD31603B12B0267600C1A359 /* RealtimeAnalyser.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingAsyncScrollingCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -322,7 +322,7 @@
</span><span class="cx">             LayoutPoint scrollPositionForFixed = frameView.scrollPositionForFixedPosition();
</span><span class="cx"> 
</span><span class="cx">             float topContentInset = frameView.topContentInset();
</span><del>-            FloatPoint positionForInsetClipLayer = FloatPoint(0, FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset));
</del><ins>+            FloatPoint positionForInsetClipLayer = FloatPoint(insetClipLayer ? insetClipLayer-&gt;position().x() : 0, FrameView::yPositionForInsetClipLayer(scrollPosition, topContentInset));
</ins><span class="cx">             FloatPoint positionForContentsLayer = frameView.positionForRootContentLayer();
</span><span class="cx">             FloatPoint positionForHeaderLayer = FloatPoint(scrollPositionForFixed.x(), FrameView::yPositionForHeaderLayer(scrollPosition, topContentInset));
</span><span class="cx">             FloatPoint positionForFooterLayer = FloatPoint(scrollPositionForFixed.x(),
</span></span></pre></div>
<a id="trunkSourceWebCorepagescrollingmacScrollingTreeFrameScrollingNodeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -419,7 +419,7 @@
</span><span class="cx"> 
</span><span class="cx">     float topContentInset = this-&gt;topContentInset();
</span><span class="cx">     if (m_insetClipLayer &amp;&amp; m_scrolledContentsLayer &amp;&amp; topContentInset) {
</span><del>-        m_insetClipLayer.get().position = FloatPoint(0, FrameView::yPositionForInsetClipLayer(position, topContentInset));
</del><ins>+        m_insetClipLayer.get().position = FloatPoint(m_insetClipLayer.get().position.x, FrameView::yPositionForInsetClipLayer(position, topContentInset));
</ins><span class="cx">         m_scrolledContentsLayer.get().position = FrameView::positionForRootContentLayer(position, scrollOrigin(), topContentInset, headerHeight());
</span><span class="cx">         if (m_contentShadowLayer)
</span><span class="cx">             m_contentShadowLayer.get().position = m_scrolledContentsLayer.get().position;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollView.cpp (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollView.cpp        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/platform/ScrollView.cpp        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -709,7 +709,7 @@
</span><span class="cx">         int clientWidth = visibleWidth();
</span><span class="cx">         int pageStep = Scrollbar::pageStep(clientWidth);
</span><span class="cx">         IntRect oldRect(m_horizontalScrollbar-&gt;frameRect());
</span><del>-        IntRect hBarRect(0,
</del><ins>+        IntRect hBarRect(ScrollableArea::systemLanguageIsRTL() &amp;&amp; m_verticalScrollbar ? m_verticalScrollbar-&gt;occupiedWidth() : 0,
</ins><span class="cx">             height() - m_horizontalScrollbar-&gt;height(),
</span><span class="cx">             width() - (m_verticalScrollbar ? m_verticalScrollbar-&gt;occupiedWidth() : 0),
</span><span class="cx">             m_horizontalScrollbar-&gt;height());
</span><span class="lines">@@ -730,7 +730,7 @@
</span><span class="cx">         int clientHeight = visibleHeight();
</span><span class="cx">         int pageStep = Scrollbar::pageStep(clientHeight);
</span><span class="cx">         IntRect oldRect(m_verticalScrollbar-&gt;frameRect());
</span><del>-        IntRect vBarRect(width() - m_verticalScrollbar-&gt;width(), 
</del><ins>+        IntRect vBarRect(ScrollableArea::systemLanguageIsRTL() ? 0 : width() - m_verticalScrollbar-&gt;width(),
</ins><span class="cx">             topContentInset(),
</span><span class="cx">             m_verticalScrollbar-&gt;width(),
</span><span class="cx">             height() - topContentInset() - (m_horizontalScrollbar ? m_horizontalScrollbar-&gt;occupiedHeight() : 0));
</span><span class="lines">@@ -1124,14 +1124,14 @@
</span><span class="cx">     int heightTrackedByScrollbar = height() - topContentInset();
</span><span class="cx"> 
</span><span class="cx">     if (m_horizontalScrollbar &amp;&amp; width() - m_horizontalScrollbar-&gt;width() &gt; 0) {
</span><del>-        cornerRect.unite(IntRect(m_horizontalScrollbar-&gt;width(),
</del><ins>+        cornerRect.unite(IntRect(ScrollableArea::systemLanguageIsRTL() ? 0 : m_horizontalScrollbar-&gt;width(),
</ins><span class="cx">             height() - m_horizontalScrollbar-&gt;height(),
</span><span class="cx">             width() - m_horizontalScrollbar-&gt;width(),
</span><span class="cx">             m_horizontalScrollbar-&gt;height()));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_verticalScrollbar &amp;&amp; heightTrackedByScrollbar - m_verticalScrollbar-&gt;height() &gt; 0) {
</span><del>-        cornerRect.unite(IntRect(width() - m_verticalScrollbar-&gt;width(),
</del><ins>+        cornerRect.unite(IntRect(ScrollableArea::systemLanguageIsRTL() ? 0 : width() - m_verticalScrollbar-&gt;width(),
</ins><span class="cx">             m_verticalScrollbar-&gt;height() + topContentInset(),
</span><span class="cx">             m_verticalScrollbar-&gt;width(),
</span><span class="cx">             heightTrackedByScrollbar - m_verticalScrollbar-&gt;height()));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.cpp (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.cpp        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/platform/ScrollableArea.cpp        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (c) 2010, Google Inc. All rights reserved.
</span><del>- * Copyright (C) 2008, 2011, 2014-2015 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2008, 2011, 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 are
</span><span class="lines">@@ -527,12 +527,19 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+int ScrollableArea::horizontalScrollbarIntrusion() const
+{
+    return verticalScrollbar() ? verticalScrollbar()-&gt;occupiedWidth() : 0;
+}
+
+int ScrollableArea::verticalScrollbarIntrusion() const
+{
+    return horizontalScrollbar() ? horizontalScrollbar()-&gt;occupiedHeight() : 0;
+}
+
</ins><span class="cx"> IntSize ScrollableArea::scrollbarIntrusion() const
</span><span class="cx"> {
</span><del>-    return {
-        verticalScrollbar() ? verticalScrollbar()-&gt;occupiedWidth() : 0,
-        horizontalScrollbar() ? horizontalScrollbar()-&gt;occupiedHeight() : 0
-    };
</del><ins>+    return { horizontalScrollbarIntrusion(), verticalScrollbarIntrusion() };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScrollPosition ScrollableArea::scrollPosition() const
</span><span class="lines">@@ -682,4 +689,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(COCOA)
+bool ScrollableArea::systemLanguageIsRTL()
+{
+    return false;
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -175,7 +175,9 @@
</span><span class="cx">     {
</span><span class="cx">         return scrollbar-&gt;Widget::convertFromContainingView(parentPoint);
</span><span class="cx">     }
</span><del>-    
</del><ins>+
+    int horizontalScrollbarIntrusion() const;
+    int verticalScrollbarIntrusion() const;
</ins><span class="cx">     WEBCORE_EXPORT IntSize scrollbarIntrusion() const;
</span><span class="cx"> 
</span><span class="cx">     virtual Scrollbar* horizontalScrollbar() const { return 0; }
</span><span class="lines">@@ -310,6 +312,8 @@
</span><span class="cx">     virtual bool usesMockScrollAnimator() const { return false; }
</span><span class="cx">     virtual void logMockScrollAnimatorMessage(const String&amp;) const { };
</span><span class="cx"> 
</span><ins>+    static bool systemLanguageIsRTL();
+
</ins><span class="cx"> protected:
</span><span class="cx">     WEBCORE_EXPORT ScrollableArea();
</span><span class="cx">     WEBCORE_EXPORT virtual ~ScrollableArea();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollableAreaMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/ScrollableAreaMac.mm (0 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollableAreaMac.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/ScrollableAreaMac.mm        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All Rights Reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScrollableArea.h&quot;
+
+#if PLATFORM(MAC)
+#include &quot;NSScrollerImpSPI.h&quot;
+#endif
+
+namespace WebCore {
+
+bool ScrollableArea::systemLanguageIsRTL()
+{
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    static bool result = [NSScrollerImpPair scrollerLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft;
+    return result;
+#else
+    return false;
+#endif
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacNSScrollerImpSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -110,6 +110,7 @@
</span><span class="cx"> @property(retain) NSScrollerImp *verticalScrollerImp;
</span><span class="cx"> @property(retain) NSScrollerImp *horizontalScrollerImp;
</span><span class="cx"> @property NSScrollerStyle scrollerStyle;
</span><ins>++ (NSUserInterfaceLayoutDirection)scrollerLayoutDirection;
</ins><span class="cx"> - (void)flashScrollers;
</span><span class="cx"> - (void)hideOverlayScrollers;
</span><span class="cx"> - (void)lockOverlayScrollerState:(NSOverlayScrollerState)state;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1759,7 +1759,9 @@
</span><span class="cx"> 
</span><span class="cx"> FloatPoint RenderLayerCompositor::positionForClipLayer() const
</span><span class="cx"> {
</span><del>-    return FloatPoint(0, FrameView::yPositionForInsetClipLayer(m_renderView.frameView().scrollPosition(), m_renderView.frameView().topContentInset()));
</del><ins>+    return FloatPoint(
+        ScrollableArea::systemLanguageIsRTL() ? m_renderView.frameView().horizontalScrollbarIntrusion() : 0,
+        FrameView::yPositionForInsetClipLayer(m_renderView.frameView().scrollPosition(), m_renderView.frameView().topContentInset()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderLayerCompositor::frameViewDidScroll()
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/ChangeLog        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2016-03-10  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] Main frame scrollbars should appear on the left on RTL systems
+        https://bugs.webkit.org/show_bug.cgi?id=155149
+
+        Reviewed by Simon Fraser.
+
+        Setting the volatile default needs to be done early, so it is
+        plumbed through the injected bundle's initialization routine.
+
+        Control of RTL scrollbars is handled by putting the string
+        &lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+        on the first line of a test.
+
+        * WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
+        (WTR::shouldUseRTLScrollbars):
+        (WTR::InjectedBundle::platformInitialize):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::generatePageConfiguration):
+        (WTR::updateTestOptionsFromTestHeader):
+        (WTR::TestController::getInjectedBundleInitializationUserData):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/TestOptions.h:
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::viewSupportsOptions):
+
</ins><span class="cx"> 2016-03-08  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlemacInjectedBundleMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -37,8 +37,20 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTR {
</span><span class="cx"> 
</span><del>-void InjectedBundle::platformInitialize(WKTypeRef)
</del><ins>+static bool shouldUseRTLScrollbars(WKTypeRef initializationUserData)
</ins><span class="cx"> {
</span><ins>+    if (!initializationUserData || WKGetTypeID(initializationUserData) != WKDictionaryGetTypeID())
+        return false;
+
+    WKTypeRef item = WKDictionaryGetItemForKey(static_cast&lt;WKDictionaryRef&gt;(initializationUserData), adoptWK(WKStringCreateWithUTF8CString(&quot;UseRTLScrollbars&quot;)).get());
+    if (!item || WKGetTypeID(item) != WKBooleanGetTypeID())
+        return false;
+
+    return WKBooleanGetValue(static_cast&lt;WKBooleanRef&gt;(item));
+}
+
+void InjectedBundle::platformInitialize(WKTypeRef initializationUserData)
+{
</ins><span class="cx">     static const int NoFontSmoothing = 0;
</span><span class="cx">     static const int BlueTintedAppearance = 1;
</span><span class="cx"> 
</span><span class="lines">@@ -82,6 +94,13 @@
</span><span class="cx">         @&quot;com.apple.swipescrolldirection&quot;: @1,
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    if (shouldUseRTLScrollbars(initializationUserData)) {
+        NSMutableDictionary *newDictionary = [dict mutableCopy];
+        [newDictionary setValue:@YES forKey:@&quot;AppleTextDirection&quot;];
+        [newDictionary setValue:@YES forKey:@&quot;NSForceRightToLeftWritingDirection&quot;];
+        dict = [newDictionary autorelease];
+    }
+
</ins><span class="cx">     [[NSUserDefaults standardUserDefaults] setVolatileDomain:dict forName:NSArgumentDomain];
</span><span class="cx"> 
</span><span class="cx">     // Make NSFont use the new defaults.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -435,7 +435,7 @@
</span><span class="cx">         { 1, this },
</span><span class="cx">         didReceiveMessageFromInjectedBundle,
</span><span class="cx">         didReceiveSynchronousMessageFromInjectedBundle,
</span><del>-        0 // getInjectedBundleInitializationUserData
</del><ins>+        getInjectedBundleInitializationUserData,
</ins><span class="cx">     };
</span><span class="cx">     WKContextSetInjectedBundleClient(m_context.get(), &amp;injectedBundleClient.base);
</span><span class="cx"> 
</span><span class="lines">@@ -937,6 +937,8 @@
</span><span class="cx">             testOptions.useFlexibleViewport = parseBooleanTestHeaderValue(value);
</span><span class="cx">         if (key == &quot;useDataDetection&quot;)
</span><span class="cx">             testOptions.useDataDetection = parseBooleanTestHeaderValue(value);
</span><ins>+        if (key == &quot;rtlScrollbars&quot;)
+            testOptions.useRTLScrollbars = parseBooleanTestHeaderValue(value);
</ins><span class="cx">         pairStart = pairEnd + 1;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -1137,6 +1139,11 @@
</span><span class="cx">     *returnData = static_cast&lt;TestController*&gt;(const_cast&lt;void*&gt;(clientInfo))-&gt;didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody).leakRef();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WKTypeRef TestController::getInjectedBundleInitializationUserData(WKContextRef, const void* clientInfo)
+{
+    return static_cast&lt;TestController*&gt;(const_cast&lt;void*&gt;(clientInfo))-&gt;getInjectedBundleInitializationUserData().leakRef();
+}
+
</ins><span class="cx"> // WKPageInjectedBundleClient
</span><span class="cx"> 
</span><span class="cx"> void TestController::didReceivePageMessageFromInjectedBundle(WKPageRef page, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
</span><span class="lines">@@ -1453,6 +1460,18 @@
</span><span class="cx">     return m_currentInvocation-&gt;didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+WKRetainPtr&lt;WKTypeRef&gt; TestController::getInjectedBundleInitializationUserData()
+{
+    if (m_currentInvocation-&gt;options().useRTLScrollbars) {
+        WKRetainPtr&lt;WKStringRef&gt; key = adoptWK(WKStringCreateWithUTF8CString(&quot;UseRTLScrollbars&quot;));
+        WKRetainPtr&lt;WKBooleanRef&gt; value = adoptWK(WKBooleanCreate(true));
+        const WKStringRef keyArray[] = { key.get() };
+        const WKTypeRef valueArray[] = { value.get() };
+        return adoptWK(WKDictionaryCreate(keyArray, valueArray, WTF_ARRAY_LENGTH(keyArray)));
+    }
+    return nullptr;
+}
+
</ins><span class="cx"> // WKContextClient
</span><span class="cx"> 
</span><span class="cx"> void TestController::networkProcessDidCrash()
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -179,12 +179,14 @@
</span><span class="cx">     // WKContextInjectedBundleClient
</span><span class="cx">     static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
</span><span class="cx">     static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
</span><ins>+    static WKTypeRef getInjectedBundleInitializationUserData(WKContextRef, const void *clientInfo);
</ins><span class="cx"> 
</span><span class="cx">     // WKPageInjectedBundleClient
</span><span class="cx">     static void didReceivePageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
</span><span class="cx">     static void didReceiveSynchronousPageMessageFromInjectedBundle(WKPageRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
</span><span class="cx">     void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
</span><span class="cx">     WKRetainPtr&lt;WKTypeRef&gt; didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
</span><ins>+    WKRetainPtr&lt;WKTypeRef&gt; getInjectedBundleInitializationUserData();
</ins><span class="cx"> 
</span><span class="cx">     void didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef messageBodyDictionary, bool synchronous);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestOptions.h (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestOptions.h        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/WebKitTestRunner/TestOptions.h        2016-03-10 22:05:30 UTC (rev 197956)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx">     bool isSVGTest { false };
</span><span class="cx">     bool isHiDPITest { false };
</span><span class="cx">     bool useDataDetection { false };
</span><ins>+    bool useRTLScrollbars { false };
</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 (197955 => 197956)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2016-03-10 21:41:17 UTC (rev 197955)
+++ trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm        2016-03-10 22:05:30 UTC (rev 197956)
</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)
</del><ins>+    if (m_options.useThreadedScrolling != options.useThreadedScrolling || m_options.overrideLanguages != options.overrideLanguages || m_options.useRTLScrollbars != options.useRTLScrollbars)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span></span></pre>
</div>
</div>

</body>
</html>