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

<h3>Log Message</h3>
<pre>[OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
https://bugs.webkit.org/show_bug.cgi?id=155991

Reviewed by Darin Adler.

Source/WebCore:

List boxes were created before RenderLayers, and therefore don't share
the scollbar logic with them. Instead, they manage their own Scrollbars.
The placement logic needs to be updated to take RTL scrollbars into
account.

Tests: fast/scrolling/rtl-scrollbars-listbox-scroll.html
       fast/scrolling/rtl-scrollbars-listbox-select-left.html
       fast/scrolling/rtl-scrollbars-listbox-select-right.html
       fast/scrolling/rtl-scrollbars-listbox-simple.html
       fast/scrolling/rtl-scrollbars-listbox.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::contentBoxRect):
* rendering/RenderBox.h:
(WebCore::RenderBox::contentBoxRect): Deleted.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::itemBoundingBoxRect):
(WebCore::RenderListBox::paintScrollbar):
(WebCore::RenderListBox::paintItemBackground):
(WebCore::RenderListBox::isPointInOverflowControl):
(WebCore::RenderListBox::listIndexAtOffset):
(WebCore::RenderListBox::nodeAtPoint):
(WebCore::RenderListBox::controlClipRect):
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):
(WebCore::RenderListBox::scrolledToTop):
(WebCore::RenderListBox::scrolledToBottom):

LayoutTests:

As with the previous patches, mark new tests as failing on all OSes that
don't support RTL scrollbars.

* TestExpectations:
* fast/scrolling/rtl-scrollbars-listbox-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-scroll.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-left.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-right.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-simple.html: Added.
* fast/scrolling/rtl-scrollbars-listbox.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxh">trunk/Source/WebCore/rendering/RenderBox.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderListBoxcpp">trunk/Source/WebCore/rendering/RenderListBox.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxexpectedhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxscrollexpectedhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxscrollhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectleftexpectedhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectlefthtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectrightexpectedhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectrighthtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxsimpleexpectedmismatchhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxsimplehtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple.html</a></li>
<li><a href="#trunkLayoutTestsfastscrollingrtlscrollbarslistboxhtml">trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/LayoutTests/ChangeLog        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-03-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=155991
+
+        Reviewed by Darin Adler.
+
+        As with the previous patches, mark new tests as failing on all OSes that
+        don't support RTL scrollbars.
+
+        * TestExpectations:
+        * fast/scrolling/rtl-scrollbars-listbox-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-scroll.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-select-left.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-select-right.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox-simple.html: Added.
+        * fast/scrolling/rtl-scrollbars-listbox.html: Added.
+
</ins><span class="cx"> 2016-03-30  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] Implement String.prototype.repeat in builtins JS
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/LayoutTests/TestExpectations        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -1013,3 +1013,8 @@
</span><span class="cx"> fast/scrolling/rtl-scrollbars-elementFromPoint-static.html [ Failure ]
</span><span class="cx"> fast/scrolling/rtl-scrollbars-iframe-scrolled.html [ ImageOnlyFailure ]
</span><span class="cx"> fast/scrolling/rtl-scrollbars-positioning.html [ ImageOnlyFailure ]
</span><ins>+fast/scrolling/rtl-scrollbars-listbox-scroll.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-listbox-select-left.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-listbox-select-right.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-listbox-simple.html [ ImageOnlyFailure ]
+fast/scrolling/rtl-scrollbars-listbox.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarslistboxexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-expected.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-expected.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body style=&quot;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/div&gt;
+&lt;div style=&quot;position: relative; width: 400px; height: 400px; overflow: hidden;&quot;&gt;
+&lt;select multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px; width: 400px; height: 100px; position: absolute; left: 11px; top: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarslistboxscrollexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,26 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/div&gt;
+&lt;select id=&quot;container&quot; multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+var container = document.getElementById(&quot;container&quot;);
+container.scrollTop = container.scrollHeight - container.clientHeight;
+&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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxscrollhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-scroll.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,29 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/div&gt;
+&lt;select multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+if (window.eventSender) {
+    eventSender.mouseMoveTo(25, 5);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -20, &quot;began&quot;, &quot;none&quot;);
+    eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, &quot;ended&quot;, &quot;none&quot;);
+}
+&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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectleftexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,26 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that cliking on an LTR scrollbar doesn't select an item in a list box.&lt;/div&gt;
+&lt;select id=&quot;container&quot; multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+var container = document.getElementById(&quot;container&quot;);
+container.focus();
+&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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectlefthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-left.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,29 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that cliking on an LTR scrollbar doesn't select an item in a list box.&lt;/div&gt;
+&lt;select multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+if (window.eventSender) {
+    eventSender.mouseMoveTo(5, 5);
+    eventSender.mouseDown();
+    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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectrightexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,28 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that cliking on the rightmost part of an item causes it to be selected.&lt;/div&gt;
+&lt;select id=&quot;container&quot; multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px; width: 200px;&quot;&gt;
+&lt;option id=&quot;january&quot;&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+var container = document.getElementById(&quot;container&quot;);
+container.focus();
+var january = document.getElementById(&quot;january&quot;);
+january.selected = true;
+&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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxselectrighthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-select-right.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,29 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that cliking on the rightmost part of an item causes it to be selected.&lt;/div&gt;
+&lt;select multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px; width: 200px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;script&gt;
+if (window.eventSender) {
+    eventSender.mouseMoveTo(195, 5);
+    eventSender.mouseDown();
+    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="trunkLayoutTestsfastscrollingrtlscrollbarslistboxsimpleexpectedmismatchhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/p&gt;
+&lt;select multiple=&quot;multiple&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarslistboxsimplehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox-simple.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;&lt;!-- webkit-test-runner [ rtlScrollbars=true ] --&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/p&gt;
+&lt;select multiple=&quot;multiple&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastscrollingrtlscrollbarslistboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox.html (0 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox.html                                (rev 0)
+++ trunk/LayoutTests/fast/scrolling/rtl-scrollbars-listbox.html        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -0,0 +1,24 @@
</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;margin: 0px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 8px; top: 200px;&quot;&gt;This test makes sure that list boxes obey RTL scrollbars.&lt;/div&gt;
+&lt;div style=&quot;position: relative; width: 385px; height: 400px; overflow: hidden; left: 11px;&quot;&gt;
+&lt;select multiple=&quot;multiple&quot; style=&quot;margin: 0px; border: 0px solid black; padding: 0px; width: 400px; height: 100px; position: absolute; left: -11px; top: 0px;&quot;&gt;
+&lt;option&gt;January&lt;/option&gt;
+&lt;option&gt;February&lt;/option&gt;
+&lt;option&gt;March&lt;/option&gt;
+&lt;option&gt;April&lt;/option&gt;
+&lt;option&gt;May&lt;/option&gt;
+&lt;option&gt;June&lt;/option&gt;
+&lt;option&gt;July&lt;/option&gt;
+&lt;option&gt;August&lt;/option&gt;
+&lt;option&gt;September&lt;/option&gt;
+&lt;option&gt;October&lt;/option&gt;
+&lt;option&gt;November&lt;/option&gt;
+&lt;option&gt;December&lt;/option&gt;
+&lt;/select&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/Source/WebCore/ChangeLog        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2016-03-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
+        https://bugs.webkit.org/show_bug.cgi?id=155991
+
+        Reviewed by Darin Adler.
+
+        List boxes were created before RenderLayers, and therefore don't share
+        the scollbar logic with them. Instead, they manage their own Scrollbars.
+        The placement logic needs to be updated to take RTL scrollbars into
+        account.
+
+        Tests: fast/scrolling/rtl-scrollbars-listbox-scroll.html
+               fast/scrolling/rtl-scrollbars-listbox-select-left.html
+               fast/scrolling/rtl-scrollbars-listbox-select-right.html
+               fast/scrolling/rtl-scrollbars-listbox-simple.html
+               fast/scrolling/rtl-scrollbars-listbox.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::contentBoxRect):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::contentBoxRect): Deleted.
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::itemBoundingBoxRect):
+        (WebCore::RenderListBox::paintScrollbar):
+        (WebCore::RenderListBox::paintItemBackground):
+        (WebCore::RenderListBox::isPointInOverflowControl):
+        (WebCore::RenderListBox::listIndexAtOffset):
+        (WebCore::RenderListBox::nodeAtPoint):
+        (WebCore::RenderListBox::controlClipRect):
+        (WebCore::RenderListBox::invalidateScrollbarRect):
+        (WebCore::RenderListBox::convertFromScrollbarToContainingView):
+        (WebCore::RenderListBox::convertFromContainingViewToScrollbar):
+        (WebCore::RenderListBox::scrolledToTop):
+        (WebCore::RenderListBox::scrolledToBottom):
+
+2016-03-30  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
</ins><span class="cx">         Use references instead of pointers in scrollbar-related code
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=155998
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -690,6 +690,15 @@
</span><span class="cx">     return style.getRoundedBorderFor(bounds).radii();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LayoutRect RenderBox::contentBoxRect() const
+{
+    LayoutUnit x = borderLeft() + paddingLeft();
+    if (layer() &amp;&amp; layer()-&gt;verticalScrollbarIsOnLeft())
+        x += verticalScrollbarWidth();
+    LayoutUnit y = borderTop() + paddingTop();
+    return LayoutRect(x, y, contentWidth(), contentHeight());
+}
+
</ins><span class="cx"> IntRect RenderBox::absoluteContentBox() const
</span><span class="cx"> {
</span><span class="cx">     // This is wrong with transforms and flipped writing modes.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.h (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.h        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/Source/WebCore/rendering/RenderBox.h        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx">     WEBCORE_EXPORT RoundedRect::Radii borderRadii() const;
</span><span class="cx"> 
</span><span class="cx">     // The content area of the box (excludes padding - and intrinsic padding for table cells, etc... - and border).
</span><del>-    LayoutRect contentBoxRect() const { return LayoutRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeight()); }
</del><ins>+    LayoutRect contentBoxRect() const;
</ins><span class="cx">     // The content box in absolute coords. Ignores transforms.
</span><span class="cx">     IntRect absoluteContentBox() const;
</span><span class="cx">     // The content box converted to absolute coords (taking transforms into account).
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderListBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (198842 => 198843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderListBox.cpp        2016-03-30 17:23:41 UTC (rev 198842)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp        2016-03-30 17:34:20 UTC (rev 198843)
</span><span class="lines">@@ -265,9 +265,11 @@
</span><span class="cx"> 
</span><span class="cx"> LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint&amp; additionalOffset, int index)
</span><span class="cx"> {
</span><del>-    return LayoutRect(additionalOffset.x() + borderLeft() + paddingLeft(),
-                   additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset),
-                   contentWidth(), itemHeight());
</del><ins>+    LayoutUnit x = additionalOffset.x() + borderLeft() + paddingLeft();
+    if (verticalScrollbarIsOnLeft() &amp;&amp; m_vBar)
+        x += m_vBar-&gt;occupiedWidth();
+    LayoutUnit y = additionalOffset.y() + borderTop() + paddingTop() + itemHeight() * (index - m_indexOffset);
+    return LayoutRect(x, y, contentWidth(), itemHeight());
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void RenderListBox::paintObject(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset)
</span><span class="lines">@@ -340,14 +342,16 @@
</span><span class="cx"> 
</span><span class="cx"> void RenderListBox::paintScrollbar(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset)
</span><span class="cx"> {
</span><del>-    if (m_vBar) {
-        IntRect scrollRect = snappedIntRect(paintOffset.x() + width() - borderRight() - m_vBar-&gt;width(),
-            paintOffset.y() + borderTop(),
-            m_vBar-&gt;width(),
-            height() - (borderTop() + borderBottom()));
-        m_vBar-&gt;setFrameRect(scrollRect);
-        m_vBar-&gt;paint(paintInfo.context(), snappedIntRect(paintInfo.rect));
-    }
</del><ins>+    if (!m_vBar)
+        return;
+
+    LayoutUnit left = paintOffset.x() + (verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - m_vBar-&gt;width());
+    LayoutUnit top = paintOffset.y() + borderTop();
+    LayoutUnit width = m_vBar-&gt;width();
+    LayoutUnit height = this-&gt;height() - (borderTop() + borderBottom());
+    IntRect scrollRect = snappedIntRect(left, top, width, height);
+    m_vBar-&gt;setFrameRect(scrollRect);
+    m_vBar-&gt;paint(paintInfo.context(), snappedIntRect(paintInfo.rect));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static LayoutSize itemOffsetForAlignment(TextRun textRun, RenderStyle* itemStyle, FontCascade itemFont, LayoutRect itemBoudingBox)
</span><span class="lines">@@ -431,11 +435,12 @@
</span><span class="cx">         backColor = itemStyle.visitedDependentColor(CSSPropertyBackgroundColor);
</span><span class="cx"> 
</span><span class="cx">     // Draw the background for this list box item
</span><del>-    if (itemStyle.visibility() != HIDDEN) {
-        LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
-        itemRect.intersect(controlClipRect(paintOffset));
-        paintInfo.context().fillRect(snappedIntRect(itemRect), backColor);
-    }
</del><ins>+    if (itemStyle.visibility() == HIDDEN)
+        return;
+
+    LayoutRect itemRect = itemBoundingBoxRect(paintOffset, listIndex);
+    itemRect.intersect(controlClipRect(paintOffset));
+    paintInfo.context().fillRect(snappedIntRect(itemRect), backColor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderListBox::isPointInOverflowControl(HitTestResult&amp; result, const LayoutPoint&amp; locationInContainer, const LayoutPoint&amp; accumulatedOffset)
</span><span class="lines">@@ -443,16 +448,17 @@
</span><span class="cx">     if (!m_vBar || !m_vBar-&gt;shouldParticipateInHitTesting())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    LayoutRect vertRect(accumulatedOffset.x() + width() - borderRight() - m_vBar-&gt;width(),
-                        accumulatedOffset.y() + borderTop(),
-                        m_vBar-&gt;width(),
-                        height() - borderTop() - borderBottom());
</del><ins>+    LayoutUnit x = accumulatedOffset.x() + (verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - m_vBar-&gt;width());
+    LayoutUnit y = accumulatedOffset.y() + borderTop();
+    LayoutUnit width = m_vBar-&gt;width();
+    LayoutUnit height = this-&gt;height() - borderTop() - borderBottom();
+    LayoutRect vertRect(x, y, width, height);
</ins><span class="cx"> 
</span><del>-    if (vertRect.contains(locationInContainer)) {
-        result.setScrollbar(m_vBar.get());
-        return true;
-    }
-    return false;
</del><ins>+    if (!vertRect.contains(locationInContainer))
+        return false;
+
+    result.setScrollbar(m_vBar.get());
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int RenderListBox::listIndexAtOffset(const LayoutSize&amp; offset)
</span><span class="lines">@@ -464,8 +470,10 @@
</span><span class="cx">         return -1;
</span><span class="cx"> 
</span><span class="cx">     int scrollbarWidth = m_vBar ? m_vBar-&gt;width() : 0;
</span><del>-    if (offset.width() &lt; borderLeft() + paddingLeft() || offset.width() &gt; width() - borderRight() - paddingRight() - scrollbarWidth)
</del><ins>+    if (verticalScrollbarIsOnLeft() &amp;&amp; (offset.width() &lt; borderLeft() + paddingLeft() + scrollbarWidth || offset.width() &gt; width() - borderRight() - paddingRight()))
</ins><span class="cx">         return -1;
</span><ins>+    if (!verticalScrollbarIsOnLeft() &amp;&amp; (offset.width() &lt; borderLeft() + paddingLeft() || offset.width() &gt; width() - borderRight() - paddingRight() - scrollbarWidth))
+        return -1;
</ins><span class="cx"> 
</span><span class="cx">     int newOffset = (offset.height() - borderTop() - paddingTop()) / itemHeight() + m_indexOffset;
</span><span class="cx">     return newOffset &lt; numItems() ? newOffset : -1;
</span><span class="lines">@@ -702,14 +710,14 @@
</span><span class="cx">     LayoutPoint adjustedLocation = accumulatedOffset + location();
</span><span class="cx"> 
</span><span class="cx">     for (int i = 0; i &lt; size; ++i) {
</span><del>-        if (itemBoundingBoxRect(adjustedLocation, i).contains(locationInContainer.point())) {
-            if (Element* node = listItems[i]) {
-                result.setInnerNode(node);
-                if (!result.innerNonSharedNode())
-                    result.setInnerNonSharedNode(node);
-                result.setLocalPoint(locationInContainer.point() - toLayoutSize(adjustedLocation));
-                break;
-            }
</del><ins>+        if (!itemBoundingBoxRect(adjustedLocation, i).contains(locationInContainer.point()))
+            continue;
+        if (Element* node = listItems[i]) {
+            result.setInnerNode(node);
+            if (!result.innerNonSharedNode())
+                result.setInnerNonSharedNode(node);
+            result.setLocalPoint(locationInContainer.point() - toLayoutSize(adjustedLocation));
+            break;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -719,6 +727,8 @@
</span><span class="cx"> LayoutRect RenderListBox::controlClipRect(const LayoutPoint&amp; additionalOffset) const
</span><span class="cx"> {
</span><span class="cx">     LayoutRect clipRect = contentBoxRect();
</span><ins>+    if (verticalScrollbarIsOnLeft() &amp;&amp; (!layer() || !layer()-&gt;verticalScrollbarIsOnLeft()))
+        clipRect.move(m_vBar-&gt;occupiedWidth(), 0);
</ins><span class="cx">     clipRect.moveBy(additionalOffset);
</span><span class="cx">     return clipRect;
</span><span class="cx"> }
</span><span class="lines">@@ -732,14 +742,14 @@
</span><span class="cx"> void RenderListBox::invalidateScrollbarRect(Scrollbar&amp; scrollbar, const IntRect&amp; rect)
</span><span class="cx"> {
</span><span class="cx">     IntRect scrollRect = rect;
</span><del>-    scrollRect.move(width() - borderRight() - scrollbar.width(), borderTop());
</del><ins>+    scrollRect.move(verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width(), borderTop());
</ins><span class="cx">     repaintRectangle(scrollRect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect RenderListBox::convertFromScrollbarToContainingView(const Scrollbar&amp; scrollbar, const IntRect&amp; scrollbarRect) const
</span><span class="cx"> {
</span><span class="cx">     IntRect rect = scrollbarRect;
</span><del>-    int scrollbarLeft = width() - borderRight() - scrollbar.width();
</del><ins>+    int scrollbarLeft = verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
</ins><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     rect.move(scrollbarLeft, scrollbarTop);
</span><span class="cx">     return view().frameView().convertFromRendererToContainingView(this, rect);
</span><span class="lines">@@ -748,7 +758,7 @@
</span><span class="cx"> IntRect RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar&amp; scrollbar, const IntRect&amp; parentRect) const
</span><span class="cx"> {
</span><span class="cx">     IntRect rect = view().frameView().convertFromContainingViewToRenderer(this, parentRect);
</span><del>-    int scrollbarLeft = width() - borderRight() - scrollbar.width();
</del><ins>+    int scrollbarLeft = verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
</ins><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     rect.move(-scrollbarLeft, -scrollbarTop);
</span><span class="cx">     return rect;
</span><span class="lines">@@ -757,7 +767,7 @@
</span><span class="cx"> IntPoint RenderListBox::convertFromScrollbarToContainingView(const Scrollbar&amp; scrollbar, const IntPoint&amp; scrollbarPoint) const
</span><span class="cx"> {
</span><span class="cx">     IntPoint point = scrollbarPoint;
</span><del>-    int scrollbarLeft = width() - borderRight() - scrollbar.width();
</del><ins>+    int scrollbarLeft = verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
</ins><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     point.move(scrollbarLeft, scrollbarTop);
</span><span class="cx">     return view().frameView().convertFromRendererToContainingView(this, point);
</span><span class="lines">@@ -766,7 +776,7 @@
</span><span class="cx"> IntPoint RenderListBox::convertFromContainingViewToScrollbar(const Scrollbar&amp; scrollbar, const IntPoint&amp; parentPoint) const
</span><span class="cx"> {
</span><span class="cx">     IntPoint point = view().frameView().convertFromContainingViewToRenderer(this, parentPoint);
</span><del>-    int scrollbarLeft = width() - borderRight() - scrollbar.width();
</del><ins>+    int scrollbarLeft = verticalScrollbarIsOnLeft() ? borderLeft() : width() - borderRight() - scrollbar.width();
</ins><span class="cx">     int scrollbarTop = borderTop();
</span><span class="cx">     point.move(-scrollbarLeft, -scrollbarTop);
</span><span class="cx">     return point;
</span><span class="lines">@@ -880,11 +890,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool RenderListBox::scrolledToTop() const
</span><span class="cx"> {
</span><del>-    Scrollbar* vbar = verticalScrollbar();
-    if (!vbar)
-        return true;
-    
</del><ins>+    if (Scrollbar* vbar = verticalScrollbar())
</ins><span class="cx">     return vbar-&gt;value() &lt;= 0;
</span><ins>+
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderListBox::scrolledToBottom() const
</span></span></pre>
</div>
</div>

</body>
</html>