<!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>[198859] 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/198859">198859</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-03-30 15:19:08 -0700 (Wed, 30 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
https://bugs.webkit.org/show_bug.cgi?id=155962

Reviewed by Darin Adler.

Source/WebCore:

We can control the animation direction with the NSScrollerImp property
userInterfaceLayoutDirection.

This patch also adds an Internals function to set whether or not we
should mock the scrollbars. Not mocking the scrollbars is required
to use NSScrollerImps.

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

* platform/ScrollableArea.h: Use nullptr instead of 0.
(WebCore::ScrollableArea::horizontalScrollbar):
(WebCore::ScrollableArea::verticalScrollbar):
(WebCore::ScrollableArea::tiledBacking):
(WebCore::ScrollableArea::layerForHorizontalScrollbar):
(WebCore::ScrollableArea::layerForVerticalScrollbar):
(WebCore::ScrollableArea::layerForScrolling):
(WebCore::ScrollableArea::layerForScrollCorner):
(WebCore::ScrollableArea::layerForOverhangAreas):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle): Set the direction
of the new NSScrollerImps.
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp): Set the direction
of an NSScrollerImp.
(WebCore::ScrollbarThemeMac::registerScrollbar): Call
didCreateScrollerImp().
(WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): Used for testing,
to tell if the scroller's direction is RTL.
* platform/spi/mac/NSScrollerImpSPI.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* testing/Internals.cpp:
(WebCore::Internals::setMockScrollbarsEnabled): Used for testing.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

This test only prints the &quot;RTL&quot; token when running on certain OSes.

* fast/scrolling/rtl-scrollbars-animation-property.html: Added.
* platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformScrollableAreah">trunk/Source/WebCore/platform/ScrollableArea.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollAnimatorMacmm">trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollbarThemeMach">trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacScrollbarThemeMacmm">trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspimacNSScrollerImpSPIh">trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTreeAsTextcpp">trunk/Source/WebCore/rendering/RenderTreeAsText.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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarsanimationpropertyhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastscrollingrtlscrollbarsanimationpropertyexpectedtxt">trunk/LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/LayoutTests/ChangeLog        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-03-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
+        https://bugs.webkit.org/show_bug.cgi?id=155962
+
+        Reviewed by Darin Adler.
+
+        This test only prints the &quot;RTL&quot; token when running on certain OSes.
+
+        * fast/scrolling/rtl-scrollbars-animation-property.html: Added.
+        * platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.
+
</ins><span class="cx"> 2016-03-30  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         -webkit-text-underline-position: under; does not work in ToT
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarsanimationpropertyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html (0 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.internals)
+    window.internals.setMockScrollbarsEnabled(false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div style=&quot;width: 200px; height: 200px; position: relative; overflow: scroll;&quot;&gt;
+&lt;div style=&quot;width: 1px; height: 2000px; position: absolute; left: 0px; top: 0px;&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;width: 1px; height: 2000px; position: absolute; left: 0px; top: 0px;&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastscrollingrtlscrollbarsanimationpropertyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt (0 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+layer at (0,0) size 785x2000
+  RenderView at (0,0) size 785x600
+layer at (0,0) size 785x216
+  RenderBlock {HTML} at (0,0) size 785x216
+    RenderBody {BODY} at (8,8) size 769x200
+layer at (8,8) size 200x200 clip at (8,8) size 185x185 scrollHeight 2000
+  RenderBlock (relative positioned) {DIV} at (0,0) size 200x200
+layer at (8,8) size 1x2000 backgroundClip at (8,8) size 185x185 clip at (8,8) size 185x185
+  RenderBlock (positioned) {DIV} at (0,0) size 1x2000
+layer at (0,0) size 1x2000
+  RenderBlock (positioned) {DIV} at (0,0) size 1x2000
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/ChangeLog        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+2016-03-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
+        https://bugs.webkit.org/show_bug.cgi?id=155962
+
+        Reviewed by Darin Adler.
+
+        We can control the animation direction with the NSScrollerImp property
+        userInterfaceLayoutDirection.
+
+        This patch also adds an Internals function to set whether or not we
+        should mock the scrollbars. Not mocking the scrollbars is required
+        to use NSScrollerImps.
+
+        Test: fast/scrolling/rtl-scrollbars-animation-property.html
+
+        * platform/ScrollableArea.h: Use nullptr instead of 0.
+        (WebCore::ScrollableArea::horizontalScrollbar):
+        (WebCore::ScrollableArea::verticalScrollbar):
+        (WebCore::ScrollableArea::tiledBacking):
+        (WebCore::ScrollableArea::layerForHorizontalScrollbar):
+        (WebCore::ScrollableArea::layerForVerticalScrollbar):
+        (WebCore::ScrollableArea::layerForScrolling):
+        (WebCore::ScrollableArea::layerForScrollCorner):
+        (WebCore::ScrollableArea::layerForOverhangAreas):
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::updateScrollerStyle): Set the direction
+        of the new NSScrollerImps.
+        * platform/mac/ScrollbarThemeMac.h:
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::didCreateScrollerImp): Set the direction
+        of an NSScrollerImp.
+        (WebCore::ScrollbarThemeMac::registerScrollbar): Call
+        didCreateScrollerImp().
+        (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): Used for testing,
+        to tell if the scroller's direction is RTL.
+        * platform/spi/mac/NSScrollerImpSPI.h:
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::write):
+        * testing/Internals.cpp:
+        (WebCore::Internals::setMockScrollbarsEnabled): Used for testing.
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-03-30  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         -webkit-text-underline-position: under; does not work in ToT
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformScrollableAreah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ScrollableArea.h (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ScrollableArea.h        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/platform/ScrollableArea.h        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -180,8 +180,8 @@
</span><span class="cx">     int verticalScrollbarIntrusion() const;
</span><span class="cx">     WEBCORE_EXPORT IntSize scrollbarIntrusion() const;
</span><span class="cx"> 
</span><del>-    virtual Scrollbar* horizontalScrollbar() const { return 0; }
-    virtual Scrollbar* verticalScrollbar() const { return 0; }
</del><ins>+    virtual Scrollbar* horizontalScrollbar() const { return nullptr; }
+    virtual Scrollbar* verticalScrollbar() const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx">     const IntPoint&amp; scrollOrigin() const { return m_scrollOrigin; }
</span><span class="cx">     bool scrollOriginChanged() const { return m_scrollOriginChanged; }
</span><span class="lines">@@ -293,15 +293,15 @@
</span><span class="cx">     bool isPinnedVerticallyInDirection(int verticalScrollDelta) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual TiledBacking* tiledBacking() const { return 0; }
</del><ins>+    virtual TiledBacking* tiledBacking() const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx">     // True if scrolling happens by moving compositing layers.
</span><span class="cx">     virtual bool usesCompositedScrolling() const { return false; }
</span><span class="cx">     // True if the contents can be scrolled asynchronously (i.e. by a ScrollingCoordinator).
</span><span class="cx">     virtual bool usesAsyncScrolling() const { return false; }
</span><span class="cx"> 
</span><del>-    virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
-    virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
</del><ins>+    virtual GraphicsLayer* layerForHorizontalScrollbar() const { return nullptr; }
+    virtual GraphicsLayer* layerForVerticalScrollbar() const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx">     bool hasLayerForHorizontalScrollbar() const;
</span><span class="cx">     bool hasLayerForVerticalScrollbar() const;
</span><span class="lines">@@ -327,10 +327,10 @@
</span><span class="cx">     virtual void invalidateScrollCornerRect(const IntRect&amp;) = 0;
</span><span class="cx"> 
</span><span class="cx">     friend class ScrollingCoordinator;
</span><del>-    virtual GraphicsLayer* layerForScrolling() const { return 0; }
-    virtual GraphicsLayer* layerForScrollCorner() const { return 0; }
</del><ins>+    virtual GraphicsLayer* layerForScrolling() const { return nullptr; }
+    virtual GraphicsLayer* layerForScrollCorner() const { return nullptr; }
</ins><span class="cx"> #if ENABLE(RUBBER_BANDING)
</span><del>-    virtual GraphicsLayer* layerForOverhangAreas() const { return 0; }
</del><ins>+    virtual GraphicsLayer* layerForOverhangAreas() const { return nullptr; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool hasLayerForScrollCorner() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollAnimatorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -1303,6 +1303,7 @@
</span><span class="cx"> 
</span><span class="cx">         [m_scrollerImpPair setVerticalScrollerImp:newVerticalPainter];
</span><span class="cx">         macTheme-&gt;setNewPainterForScrollbar(*verticalScrollbar, newVerticalPainter);
</span><ins>+        macTheme-&gt;didCreateScrollerImp(*verticalScrollbar);
</ins><span class="cx"> 
</span><span class="cx">         // The different scrollbar styles have different thicknesses, so we must re-set the 
</span><span class="cx">         // frameRect to the new thickness, and the re-layout below will ensure the position
</span><span class="lines">@@ -1319,6 +1320,7 @@
</span><span class="cx"> 
</span><span class="cx">         [m_scrollerImpPair setHorizontalScrollerImp:newHorizontalPainter];
</span><span class="cx">         macTheme-&gt;setNewPainterForScrollbar(*horizontalScrollbar, newHorizontalPainter);
</span><ins>+        macTheme-&gt;didCreateScrollerImp(*horizontalScrollbar);
</ins><span class="cx"> 
</span><span class="cx">         // The different scrollbar styles have different thicknesses, so we must re-set the 
</span><span class="cx">         // frameRect to the new thickness, and the re-layout below will ensure the position
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollbarThemeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -64,6 +64,9 @@
</span><span class="cx">     static bool isCurrentlyDrawingIntoLayer();
</span><span class="cx">     static void setIsCurrentlyDrawingIntoLayer(bool);
</span><span class="cx"> 
</span><ins>+    void didCreateScrollerImp(Scrollbar&amp;);
+    bool isLayoutDirectionRTL(Scrollbar&amp;);
+
</ins><span class="cx"> #if ENABLE(RUBBER_BANDING)
</span><span class="cx">     WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color&amp; customBackgroundColor = Color());
</span><span class="cx">     WEBCORE_EXPORT static void removeOverhangAreaBackground(CALayer *);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacScrollbarThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -153,6 +153,17 @@
</span><span class="cx"> #pragma clang diagnostic pop
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ScrollbarThemeMac::didCreateScrollerImp(Scrollbar&amp; scrollbar)
+{
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    NSScrollerImp *scrollerImp = painterForScrollbar(scrollbar);
+    ASSERT(scrollerImp);
+    scrollerImp.userInterfaceLayoutDirection = scrollbar.scrollableArea().verticalScrollbarIsOnLeft() ? NSUserInterfaceLayoutDirectionRightToLeft : NSUserInterfaceLayoutDirectionLeftToRight;
+#else
+    UNUSED_PARAM(scrollbar);
+#endif
+}
+
</ins><span class="cx"> void ScrollbarThemeMac::registerScrollbar(Scrollbar&amp; scrollbar)
</span><span class="cx"> {
</span><span class="cx">     if (scrollbar.isCustomScrollbar())
</span><span class="lines">@@ -161,6 +172,7 @@
</span><span class="cx">     bool isHorizontal = scrollbar.orientation() == HorizontalScrollbar;
</span><span class="cx">     NSScrollerImp *scrollerImp = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(scrollbar.controlSize()) horizontal:isHorizontal replacingScrollerImp:nil];
</span><span class="cx">     scrollbarMap()-&gt;add(&amp;scrollbar, scrollerImp);
</span><ins>+    didCreateScrollerImp(scrollbar);
</ins><span class="cx">     updateEnabledState(scrollbar);
</span><span class="cx">     updateScrollbarOverlayStyle(scrollbar);
</span><span class="cx"> }
</span><span class="lines">@@ -182,6 +194,18 @@
</span><span class="cx">     return scrollbarMap()-&gt;get(&amp;scrollbar).get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ScrollbarThemeMac::isLayoutDirectionRTL(Scrollbar&amp; scrollbar)
+{
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    NSScrollerImp *scrollerImp = painterForScrollbar(scrollbar);
+    ASSERT(scrollerImp);
+    return scrollerImp.userInterfaceLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft;
+#else
+    UNUSED_PARAM(scrollbar);
+    return false;
+#endif
+}
+
</ins><span class="cx"> static bool g_isCurrentlyDrawingIntoLayer;
</span><span class="cx">     
</span><span class="cx"> bool ScrollbarThemeMac::isCurrentlyDrawingIntoLayer()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspimacNSScrollerImpSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/platform/spi/mac/NSScrollerImpSPI.h        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> @property(readonly) CGFloat knobMinLength;
</span><span class="cx"> @property(readonly) CGFloat knobOverlapEndInset;
</span><span class="cx"> @property(readonly) CGFloat trackOverlapEndInset;
</span><ins>+@property NSUserInterfaceLayoutDirection userInterfaceLayoutDirection;
</ins><span class="cx"> - (NSRect)rectForPart:(NSScrollerPart)partCode;
</span><span class="cx"> - (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag alpha:(CGFloat)alpha;
</span><span class="cx"> - (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTreeAsTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTreeAsText.cpp (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/rendering/RenderTreeAsText.cpp        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -72,6 +72,10 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/unicode/CharacterNames.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+#include &quot;ScrollbarThemeMac.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -621,6 +625,14 @@
</span><span class="cx">             ts &lt;&lt; &quot; scrollWidth &quot; &lt;&lt; layer.scrollWidth();
</span><span class="cx">         if (layer.renderBox() &amp;&amp; roundToInt(layer.renderBox()-&gt;clientHeight()) != layer.scrollHeight())
</span><span class="cx">             ts &lt;&lt; &quot; scrollHeight &quot; &lt;&lt; layer.scrollHeight();
</span><ins>+#if PLATFORM(MAC)
+        ScrollbarTheme&amp; scrollbarTheme = ScrollbarTheme::theme();
+        if (!scrollbarTheme.isMockTheme() &amp;&amp; layer.hasVerticalScrollbar()) {
+            ScrollbarThemeMac&amp; macTheme = *static_cast&lt;ScrollbarThemeMac*&gt;(&amp;scrollbarTheme);
+            if (macTheme.isLayoutDirectionRTL(*layer.verticalScrollbar()))
+                ts &lt;&lt; &quot; scrollbarHasRTLLayoutDirection&quot;;
+        }
+#endif
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (paintPhase == LayerPaintPhaseBackground)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -2737,6 +2737,11 @@
</span><span class="cx">     WebCore::Settings::setUsesMockScrollAnimator(enabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Internals::setMockScrollbarsEnabled(bool enabled)
+{
+    WebCore::Settings::setMockScrollbarsEnabled(enabled);
+}
+
</ins><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 (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/testing/Internals.h        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -348,8 +348,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool isFromCurrentWorld(Deprecated::ScriptValue) const;
</span><span class="cx"> 
</span><del>-    void setUsesOverlayScrollbars(bool enabled);
-    void setUsesMockScrollAnimator(bool enabled);
</del><ins>+    void setUsesOverlayScrollbars(bool);
+    void setUsesMockScrollAnimator(bool);
+    void setMockScrollbarsEnabled(bool);
</ins><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 (198858 => 198859)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-03-30 22:06:38 UTC (rev 198858)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-03-30 22:19:08 UTC (rev 198859)
</span><span class="lines">@@ -351,6 +351,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setUsesOverlayScrollbars(boolean enabled);
</span><span class="cx">     void setUsesMockScrollAnimator(boolean enabled);
</span><ins>+    void setMockScrollbarsEnabled(boolean enabled);
</ins><span class="cx"> 
</span><span class="cx">     void forceReload(boolean endToEnd);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>