<!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>[200620] 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/200620">200620</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-05-10 04:41:26 -0700 (Tue, 10 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] &lt;select&gt; elements should render right-aligned when in RTL mode
https://bugs.webkit.org/show_bug.cgi?id=157501
&lt;rdar://problem/26187870&gt;

Reviewed by Antoine Quint.

Source/WebCore:

This is the equivalent of http://webkit.org/b/157112 for iOS.
Handle &lt;select&gt; elements when we're in RTL mode. This means
drawing the button with the drop-down arrow on the left
side, and the button text right-aligned.

Test: fast/forms/select-non-native-rendering-direction.html
plus a bunch of other ones that needed rebaselining.

* rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter.
(WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions.
(WebCore::adjustInputElementButtonStyle):
(WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in
RTL mode.

LayoutTests:

Rebaseline now that iOS is doing the right thing.

* platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt:
* platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt:
* platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt:
* platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt:
* platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastformslistboxbidialignexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastformsselectnonnativerenderingdirectionexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastformsselectwritingdirectionnaturalexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfasttextinternationalbidilistboxatsuiexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfasttextinternationalbidilistboxexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfasttextinternationalbidimenulistexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfasttextinternationalpopupbuttontextalignmentanddirectionexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/ChangeLog        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2016-05-09  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] &lt;select&gt; elements should render right-aligned when in RTL mode
+        https://bugs.webkit.org/show_bug.cgi?id=157501
+        &lt;rdar://problem/26187870&gt;
+
+        Reviewed by Antoine Quint.
+
+        Rebaseline now that iOS is doing the right thing.
+
+        * platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt:
+        * platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt:
+        * platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt:
+        * platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt:
+        * platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt:
+        * platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt:
+        * platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt:
+
</ins><span class="cx"> 2016-05-10  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         NodeList should be iterable
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastformslistboxbidialignexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/forms/listbox-bidi-align-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -25,13 +25,13 @@
</span><span class="cx">             RenderTableCell {TD} at (333,2) size 161x26 [r=0 c=2 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 155x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 143x14
</span><del>-                  RenderText at (123,0) size 0x14
-                    text run at (123,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (143,0) size 0x14
+                    text run at (143,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (496,2) size 166x26 [r=0 c=3 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 160x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 148x14
</span><del>-                  RenderText at (128,0) size 0x14
-                    text run at (128,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (148,0) size 0x14
+                    text run at (148,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">           RenderTableRow {TR} at (0,30) size 664x26
</span><span class="cx">             RenderTableCell {TD} at (2,30) size 161x26 [r=1 c=0 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 155x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="lines">@@ -52,23 +52,23 @@
</span><span class="cx">             RenderTableCell {TD} at (2,2) size 168x26 [r=0 c=0 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 162x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 150x14
</span><del>-                  RenderText at (130,0) size 0x14
-                    text run at (130,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (150,0) size 0x14
+                    text run at (150,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (172,2) size 155x26 [r=0 c=1 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 149x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 137x14
</span><del>-                  RenderText at (117,0) size 0x14
-                    text run at (117,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (137,0) size 0x14
+                    text run at (137,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (329,2) size 168x26 [r=0 c=2 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 162x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 150x14
</span><del>-                  RenderText at (130,0) size 0x14
-                    text run at (130,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (150,0) size 0x14
+                    text run at (150,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (499,2) size 155x26 [r=0 c=3 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 149x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 137x14
</span><del>-                  RenderText at (117,0) size 0x14
-                    text run at (117,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (137,0) size 0x14
+                    text run at (137,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">           RenderTableRow {TR} at (0,30) size 656x26
</span><span class="cx">             RenderTableCell {TD} at (2,30) size 168x26 [r=1 c=0 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 162x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="lines">@@ -89,13 +89,13 @@
</span><span class="cx">             RenderTableCell {TD} at (2,2) size 177x26 [r=0 c=0 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 171x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 159x14
</span><del>-                  RenderText at (139,0) size 0x14
-                    text run at (139,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (159,0) size 0x14
+                    text run at (159,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (181,2) size 164x26 [r=0 c=1 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 158x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 146x14
</span><del>-                  RenderText at (126,0) size 0x14
-                    text run at (126,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (146,0) size 0x14
+                    text run at (146,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (347,2) size 177x26 [r=0 c=2 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 171x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 159x14
</span><span class="lines">@@ -115,8 +115,8 @@
</span><span class="cx">             RenderTableCell {TD} at (2,2) size 173x26 [r=0 c=0 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 167x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 155x14
</span><del>-                  RenderText at (135,0) size 0x14
-                    text run at (135,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (155,0) size 0x14
+                    text run at (155,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (177,2) size 173x26 [r=0 c=1 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 167x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 155x14
</span><span class="lines">@@ -125,8 +125,8 @@
</span><span class="cx">             RenderTableCell {TD} at (352,2) size 189x26 [r=0 c=2 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 183x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 171x14
</span><del>-                  RenderText at (151,0) size 0x14
-                    text run at (151,0) width 0 RTL: &quot; &quot;
</del><ins>+                  RenderText at (171,0) size 0x14
+                    text run at (171,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">             RenderTableCell {TD} at (543,2) size 189x26 [r=0 c=3 rs=1 cs=1]
</span><span class="cx">               RenderMenuList {SELECT} at (3,3) size 183x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">                 RenderBlock (anonymous) at (6,3) size 171x14
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastformsselectnonnativerenderingdirectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/forms/select-non-native-rendering-direction-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -17,6 +17,6 @@
</span><span class="cx">           text run at (666,1) width 118: &quot;Right to left select&quot;
</span><span class="cx">         RenderMenuList {SELECT} at (544,2) size 112x20 [bgcolor=#FFFFFF02] [border: (1px solid #000000)]
</span><span class="cx">           RenderBlock (anonymous) at (6,3) size 99x14
</span><del>-            RenderText at (35,0) size 44x14
-              text run at (35,0) width 44: &quot;Alabama&quot;
</del><ins>+            RenderText at (55,0) size 44x14
+              text run at (55,0) width 44: &quot;Alabama&quot;
</ins><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastformsselectwritingdirectionnaturalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/forms/select-writing-direction-natural-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -79,58 +79,58 @@
</span><span class="cx">         RenderBlock {DIV} at (0,0) size 784x24
</span><span class="cx">           RenderMenuList {SELECT} at (222,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (24,0) size 14x14
-                text run at (24,0) width 8: &quot;A&quot;
-                text run at (31,0) width 7 RTL: &quot;\x{5D0}&quot;
</del><ins>+              RenderText at (44,0) size 14x14
+                text run at (44,0) width 8: &quot;A&quot;
+                text run at (51,0) width 7 RTL: &quot;\x{5D0}&quot;
</ins><span class="cx">           RenderText {#text} at (218,0) size 4x19
</span><span class="cx">             text run at (218,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (148,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (24,0) size 14x14
-                text run at (24,0) width 7 RTL: &quot;\x{5D0}&quot;
-                text run at (30,0) width 8: &quot;A&quot;
</del><ins>+              RenderText at (44,0) size 14x14
+                text run at (44,0) width 7 RTL: &quot;\x{5D0}&quot;
+                text run at (50,0) width 8: &quot;A&quot;
</ins><span class="cx">           RenderText {#text} at (144,0) size 4x19
</span><span class="cx">             text run at (144,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (74,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (20,0) size 18x14
-                text run at (20,0) width 9: &quot;A&quot;
-                text run at (28,0) width 10 RTL: &quot;(\x{5D0}&quot;
</del><ins>+              RenderText at (40,0) size 18x14
+                text run at (40,0) width 9: &quot;A&quot;
+                text run at (48,0) width 10 RTL: &quot;(\x{5D0}&quot;
</ins><span class="cx">           RenderText {#text} at (70,0) size 4x19
</span><span class="cx">             text run at (70,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (0,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (20,0) size 18x14
-                text run at (20,0) width 7 RTL: &quot;\x{5D0}&quot;
-                text run at (27,0) width 8: &quot;A&quot;
-                text run at (34,0) width 4 RTL: &quot;(&quot;
</del><ins>+              RenderText at (40,0) size 18x14
+                text run at (40,0) width 7 RTL: &quot;\x{5D0}&quot;
+                text run at (47,0) width 8: &quot;A&quot;
+                text run at (54,0) width 4 RTL: &quot;(&quot;
</ins><span class="cx">           RenderText {#text} at (0,0) size 0x0
</span><span class="cx">         RenderBlock {DIV} at (0,24) size 784x24
</span><span class="cx">           RenderMenuList {SELECT} at (714,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (24,0) size 14x14
-                text run at (24,0) width 8: &quot;A&quot;
-                text run at (31,0) width 7 RTL: &quot;\x{5D0}&quot;
</del><ins>+              RenderText at (44,0) size 14x14
+                text run at (44,0) width 8: &quot;A&quot;
+                text run at (51,0) width 7 RTL: &quot;\x{5D0}&quot;
</ins><span class="cx">           RenderText {#text} at (710,0) size 4x19
</span><span class="cx">             text run at (710,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (640,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (24,0) size 14x14
-                text run at (24,0) width 7 RTL: &quot;\x{5D0}&quot;
-                text run at (30,0) width 8: &quot;A&quot;
</del><ins>+              RenderText at (44,0) size 14x14
+                text run at (44,0) width 7 RTL: &quot;\x{5D0}&quot;
+                text run at (50,0) width 8: &quot;A&quot;
</ins><span class="cx">           RenderText {#text} at (636,0) size 4x19
</span><span class="cx">             text run at (636,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (566,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (20,0) size 18x14
-                text run at (20,0) width 9: &quot;A&quot;
-                text run at (28,0) width 10 RTL: &quot;(\x{5D0}&quot;
</del><ins>+              RenderText at (40,0) size 18x14
+                text run at (40,0) width 9: &quot;A&quot;
+                text run at (48,0) width 10 RTL: &quot;(\x{5D0}&quot;
</ins><span class="cx">           RenderText {#text} at (562,0) size 4x19
</span><span class="cx">             text run at (562,0) width 4 RTL: &quot; &quot;
</span><span class="cx">           RenderMenuList {SELECT} at (492,2) size 70x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">             RenderBlock (anonymous) at (6,2) size 58x16
</span><del>-              RenderText at (20,0) size 18x14
-                text run at (20,0) width 7 RTL: &quot;\x{5D0}&quot;
-                text run at (27,0) width 8: &quot;A&quot;
-                text run at (34,0) width 4 RTL: &quot;(&quot;
</del><ins>+              RenderText at (40,0) size 18x14
+                text run at (40,0) width 7 RTL: &quot;\x{5D0}&quot;
+                text run at (47,0) width 8: &quot;A&quot;
+                text run at (54,0) width 4 RTL: &quot;(&quot;
</ins><span class="cx">           RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasttextinternationalbidilistboxatsuiexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-atsui-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -15,8 +15,8 @@
</span><span class="cx">         RenderBR {BR} at (101,15) size 1x0
</span><span class="cx">         RenderMenuList {SELECT} at (2,22) size 86x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (6,3) size 74x14
</span><del>-            RenderText at (54,0) size 0x14
-              text run at (54,0) width 0 RTL: &quot; &quot;
</del><ins>+            RenderText at (74,0) size 0x14
+              text run at (74,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">         RenderBR {BR} at (90,36) size 0x0
</span><span class="cx">       RenderBlock {DIV} at (0,100) size 100x20
</span><span class="cx">         RenderText {#text} at (31,0) size 69x19
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasttextinternationalbidilistboxexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-listbox-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -15,8 +15,8 @@
</span><span class="cx">         RenderBR {BR} at (101,15) size 1x0
</span><span class="cx">         RenderMenuList {SELECT} at (2,22) size 86x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (6,3) size 74x14
</span><del>-            RenderText at (54,0) size 0x14
-              text run at (54,0) width 0 RTL: &quot; &quot;
</del><ins>+            RenderText at (74,0) size 0x14
+              text run at (74,0) width 0 RTL: &quot; &quot;
</ins><span class="cx">         RenderBR {BR} at (90,36) size 0x0
</span><span class="cx">       RenderBlock {DIV} at (0,100) size 100x20
</span><span class="cx">         RenderText {#text} at (31,0) size 69x19
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasttextinternationalbidimenulistexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/international/bidi-menulist-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -16,9 +16,9 @@
</span><span class="cx">         RenderBR {BR} at (285,15) size 1x0
</span><span class="cx">         RenderMenuList {SELECT} at (0,22) size 100x20 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (6,2) size 88x16
</span><del>-            RenderText at (14,0) size 54x14
-              text run at (14,0) width 37 RTL: &quot;\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}&quot;
-              text run at (50,0) width 18: &quot;abc&quot;
</del><ins>+            RenderText at (34,0) size 54x14
+              text run at (34,0) width 37 RTL: &quot;\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}&quot;
+              text run at (70,0) width 18: &quot;abc&quot;
</ins><span class="cx">         RenderBR {BR} at (100,35) size 0x0
</span><span class="cx">       RenderBlock {DIV} at (0,120) size 100x20
</span><span class="cx">         RenderText {#text} at (0,0) size 69x19
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfasttextinternationalpopupbuttontextalignmentanddirectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/LayoutTests/platform/ios-simulator/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -55,12 +55,12 @@
</span><span class="cx">       RenderBlock {DIV} at (0,324) size 784x286
</span><span class="cx">         RenderMenuList {SELECT} at (0,0) size 500x29 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (9,3) size 482x23
</span><del>-            RenderText at (285,0) size 177x20
-              text run at (285,0) width 36: &quot;First &quot;
-              text run at (320,0) width 54 RTL: &quot;) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}&quot;
-              text run at (373,0) width 19: &quot;03&quot;
-              text run at (391,0) width 41 RTL: &quot;\x{5E9}\x{5E0}\x{5D9}\x{5D4} (&quot;
-              text run at (431,0) width 31: &quot; fifth&quot;
</del><ins>+            RenderText at (305,0) size 177x20
+              text run at (305,0) width 36: &quot;First &quot;
+              text run at (340,0) width 54 RTL: &quot;) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}&quot;
+              text run at (393,0) width 19: &quot;03&quot;
+              text run at (411,0) width 41 RTL: &quot;\x{5E9}\x{5E0}\x{5D9}\x{5D4} (&quot;
+              text run at (451,0) width 31: &quot; fifth&quot;
</ins><span class="cx">         RenderBlock {DIV} at (0,31) size 470x39
</span><span class="cx">           RenderText {#text} at (298,10) size 162x17
</span><span class="cx">             text run at (298,10) width 34: &quot;First &quot;
</span><span class="lines">@@ -70,12 +70,12 @@
</span><span class="cx">             text run at (429,10) width 31: &quot; fifth&quot;
</span><span class="cx">         RenderMenuList {SELECT} at (0,72) size 500x29 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (9,3) size 482x23
</span><del>-            RenderText at (285,0) size 177x20
-              text run at (285,0) width 26: &quot;fifth&quot;
-              text run at (310,0) width 59 RTL: &quot;) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} &quot;
-              text run at (368,0) width 19: &quot;03&quot;
-              text run at (386,0) width 45 RTL: &quot; \x{5E9}\x{5E0}\x{5D9}\x{5D4} (&quot;
-              text run at (430,0) width 32: &quot;First&quot;
</del><ins>+            RenderText at (305,0) size 177x20
+              text run at (305,0) width 26: &quot;fifth&quot;
+              text run at (330,0) width 59 RTL: &quot;) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} &quot;
+              text run at (388,0) width 19: &quot;03&quot;
+              text run at (406,0) width 45 RTL: &quot; \x{5E9}\x{5E0}\x{5D9}\x{5D4} (&quot;
+              text run at (450,0) width 32: &quot;First&quot;
</ins><span class="cx">         RenderBlock {DIV} at (0,103) size 470x39
</span><span class="cx">           RenderText {#text} at (298,10) size 162x17
</span><span class="cx">             text run at (298,10) width 27: &quot;fifth&quot;
</span><span class="lines">@@ -85,15 +85,15 @@
</span><span class="cx">             text run at (431,10) width 29: &quot;First&quot;
</span><span class="cx">         RenderMenuList {SELECT} at (0,144) size 500x29 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (9,3) size 482x23
</span><del>-            RenderText at (285,0) size 177x20
-              text run at (285,0) width 177 LTR override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</del><ins>+            RenderText at (305,0) size 177x20
+              text run at (305,0) width 177 LTR override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</ins><span class="cx">         RenderBlock {DIV} at (0,175) size 470x39
</span><span class="cx">           RenderText {#text} at (298,10) size 162x17
</span><span class="cx">             text run at (298,10) width 162 LTR override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</span><span class="cx">         RenderMenuList {SELECT} at (0,216) size 500x29 [bgcolor=#FFFFFF02] [border: (1px solid #4C4C4C)]
</span><span class="cx">           RenderBlock (anonymous) at (9,3) size 482x23
</span><del>-            RenderText at (285,0) size 177x20
-              text run at (285,0) width 177 RTL override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</del><ins>+            RenderText at (305,0) size 177x20
+              text run at (305,0) width 177 RTL override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</ins><span class="cx">         RenderBlock {DIV} at (0,247) size 470x39
</span><span class="cx">           RenderText {#text} at (298,10) size 162x17
</span><span class="cx">             text run at (298,10) width 162 RTL override: &quot;First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/Source/WebCore/ChangeLog        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-05-09  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] &lt;select&gt; elements should render right-aligned when in RTL mode
+        https://bugs.webkit.org/show_bug.cgi?id=157501
+        &lt;rdar://problem/26187870&gt;
+
+        Reviewed by Antoine Quint.
+
+        This is the equivalent of http://webkit.org/b/157112 for iOS.
+        Handle &lt;select&gt; elements when we're in RTL mode. This means
+        drawing the button with the drop-down arrow on the left
+        side, and the button text right-aligned.
+
+        Test: fast/forms/select-non-native-rendering-direction.html
+        plus a bunch of other ones that needed rebaselining.
+
+        * rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter.
+        (WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions.
+        (WebCore::adjustInputElementButtonStyle):
+        (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in
+        RTL mode.
+
</ins><span class="cx"> 2016-05-10  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         NodeList should be iterable
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (200619 => 200620)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2016-05-10 09:47:44 UTC (rev 200619)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2016-05-10 11:41:26 UTC (rev 200620)
</span><span class="lines">@@ -526,12 +526,15 @@
</span><span class="cx"> 
</span><span class="cx"> const float MenuListArrowWidth = 7;
</span><span class="cx"> const float MenuListArrowHeight = 6;
</span><del>-const float MenuListButtonPaddingRight = 19;
</del><ins>+const float MenuListButtonPaddingAfter = 19;
</ins><span class="cx"> 
</span><span class="cx"> LengthBox RenderThemeIOS::popupInternalPaddingBox(const RenderStyle&amp; style) const
</span><span class="cx"> {
</span><del>-    if (style.appearance() == MenulistButtonPart)
-        return { 0, static_cast&lt;int&gt;(MenuListButtonPaddingRight + style.borderTopWidth()), 0, 0 };
</del><ins>+    if (style.appearance() == MenulistButtonPart) {
+        if (style.direction() == RTL)
+            return { 0, 0, 0, static_cast&lt;int&gt;(MenuListButtonPaddingAfter + style.borderTopWidth()) };
+        return { 0, static_cast&lt;int&gt;(MenuListButtonPaddingAfter + style.borderTopWidth()), 0, 0 };
+    }
</ins><span class="cx">     return { 0, 0, 0, 0 };
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -601,8 +604,8 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(maximumWidth &gt;= 0);
</span><span class="cx"> 
</span><del>-    if (maximumWidth &gt; 0) {    
-        int width = static_cast&lt;int&gt;(maximumWidth + MenuListButtonPaddingRight);
</del><ins>+    if (maximumWidth &gt; 0) {
+        int width = static_cast&lt;int&gt;(maximumWidth + MenuListButtonPaddingAfter);
</ins><span class="cx">         style.setWidth(Length(width, Fixed));
</span><span class="cx">         style.setBoxSizing(CONTENT_BOX);
</span><span class="cx">     }
</span><span class="lines">@@ -631,6 +634,7 @@
</span><span class="cx"> bool RenderThemeIOS::paintMenuListButtonDecorations(const RenderBox&amp; box, const PaintInfo&amp; paintInfo, const FloatRect&amp; rect)
</span><span class="cx"> {
</span><span class="cx">     auto&amp; style = box.style();
</span><ins>+    bool isRTL = style.direction() == RTL;
</ins><span class="cx">     float borderTopWidth = style.borderTopWidth();
</span><span class="cx">     FloatRect clip(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth(), rect.width() - style.borderLeftWidth() - style.borderRightWidth(), rect.height() - style.borderTopWidth() - style.borderBottomWidth());
</span><span class="cx">     CGContextRef cgContext = paintInfo.context().platformContext();
</span><span class="lines">@@ -640,15 +644,29 @@
</span><span class="cx">     float adjustTop = 0.5;
</span><span class="cx">     float adjustBottom = 0.5;
</span><span class="cx"> 
</span><del>-    // Paint left-hand title portion.
</del><ins>+    // Paint title portion.
</ins><span class="cx">     {
</span><del>-        FloatRect titleClip(clip.x() - adjustLeft, clip.y() - adjustTop, clip.width() - MenuListButtonPaddingRight + adjustLeft, clip.height() + adjustTop + adjustBottom);
</del><ins>+        float leftInset = isRTL ? MenuListButtonPaddingAfter : 0;
+        FloatRect titleClip(clip.x() + leftInset - adjustLeft, clip.y() - adjustTop, clip.width() - MenuListButtonPaddingAfter + adjustLeft, clip.height() + adjustTop + adjustBottom);
</ins><span class="cx"> 
</span><span class="cx">         GraphicsContextStateSaver stateSaver(paintInfo.context());
</span><span class="cx"> 
</span><ins>+        FloatSize topLeftRadius;
+        FloatSize topRightRadius;
+        FloatSize bottomLeftRadius;
+        FloatSize bottomRightRadius;
+
+        if (isRTL) {
+            topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth());
+            bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth());
+        } else {
+            topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height(), rect.height()) - style.borderTopWidth());
+            bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height(), rect.height()) - style.borderBottomWidth());
+        }
+
</ins><span class="cx">         paintInfo.context().clipRoundedRect(FloatRoundedRect(titleClip,
</span><del>-            FloatSize(valueForLength(style.borderTopLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height(), rect.height()) - style.borderTopWidth()), FloatSize(0, 0),
-            FloatSize(valueForLength(style.borderBottomLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height(), rect.height()) - style.borderBottomWidth()), FloatSize(0, 0)));
</del><ins>+            topLeftRadius, topRightRadius,
+            bottomLeftRadius, bottomRightRadius));
</ins><span class="cx"> 
</span><span class="cx">         drawAxialGradient(cgContext, gradientWithName(ShadeGradient), titleClip.location(), FloatPoint(titleClip.x(), titleClip.maxY()), LinearInterpolation);
</span><span class="cx">         drawAxialGradient(cgContext, gradientWithName(ShineGradient), FloatPoint(titleClip.x(), titleClip.maxY()), titleClip.location(), ExponentialInterpolation);
</span><span class="lines">@@ -656,19 +674,36 @@
</span><span class="cx"> 
</span><span class="cx">     // Draw the separator after the initial padding.
</span><span class="cx"> 
</span><del>-    float separator = clip.maxX() - MenuListButtonPaddingRight;
</del><ins>+    float separatorPosition = isRTL ? (clip.x() + MenuListButtonPaddingAfter) : (clip.maxX() - MenuListButtonPaddingAfter);
</ins><span class="cx"> 
</span><del>-    box.drawLineForBoxSide(paintInfo.context(), FloatRect(FloatPoint(separator - borderTopWidth, clip.y()), FloatPoint(separator, clip.maxY())), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
</del><ins>+    box.drawLineForBoxSide(paintInfo.context(), FloatRect(FloatPoint(separatorPosition - borderTopWidth, clip.y()), FloatPoint(separatorPosition, clip.maxY())), BSRight, style.visitedDependentColor(CSSPropertyBorderTopColor), style.borderTopStyle(), 0, 0);
</ins><span class="cx"> 
</span><del>-    FloatRect buttonClip(separator - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingRight + adjustTop + adjustRight, clip.height() + adjustTop + adjustBottom);
</del><ins>+    FloatRect buttonClip;
+    if (isRTL)
+        buttonClip = FloatRect(clip.x() - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingAfter + adjustTop + adjustLeft, clip.height() + adjustTop + adjustBottom);
+    else
+        buttonClip = FloatRect(separatorPosition - adjustTop, clip.y() - adjustTop, MenuListButtonPaddingAfter + adjustTop + adjustRight, clip.height() + adjustTop + adjustBottom);
</ins><span class="cx"> 
</span><span class="cx">     // Now paint the button portion.
</span><span class="cx">     {
</span><span class="cx">         GraphicsContextStateSaver stateSaver(paintInfo.context());
</span><span class="cx"> 
</span><ins>+        FloatSize topLeftRadius;
+        FloatSize topRightRadius;
+        FloatSize bottomLeftRadius;
+        FloatSize bottomRightRadius;
+
+        if (isRTL) {
+            topLeftRadius = FloatSize(valueForLength(style.borderTopLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderTopLeftRadius().height(), rect.height()) - style.borderTopWidth());
+            bottomLeftRadius = FloatSize(valueForLength(style.borderBottomLeftRadius().width(), rect.width()) - style.borderLeftWidth(), valueForLength(style.borderBottomLeftRadius().height(), rect.height()) - style.borderBottomWidth());
+        } else {
+            topRightRadius = FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth());
+            bottomRightRadius = FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth());
+        }
+
</ins><span class="cx">         paintInfo.context().clipRoundedRect(FloatRoundedRect(buttonClip,
</span><del>-            FloatSize(0, 0), FloatSize(valueForLength(style.borderTopRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderTopRightRadius().height(), rect.height()) - style.borderTopWidth()),
-            FloatSize(0, 0), FloatSize(valueForLength(style.borderBottomRightRadius().width(), rect.width()) - style.borderRightWidth(), valueForLength(style.borderBottomRightRadius().height(), rect.height()) - style.borderBottomWidth())));
</del><ins>+            topLeftRadius, topRightRadius,
+            bottomLeftRadius, bottomRightRadius));
</ins><span class="cx"> 
</span><span class="cx">         paintInfo.context().fillRect(buttonClip, style.visitedDependentColor(CSSPropertyBorderTopColor));
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>