List markers in RTL languages do not draw the first character.
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Dec 2014 01:30:07 +0000 (01:30 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 4 Dec 2014 01:30:07 +0000 (01:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139244

Reviewed by Simon Fraser.

Source/WebCore:

Off-by-one error when reversing the string (from LTR to RTL)

Test: fast/lists/rtl-marker.html

* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):

LayoutTests:

* fast/lists/rtl-marker-expected.html: Added.
* fast/lists/rtl-marker.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/lists/rtl-marker-expected.html [new file with mode: 0644]
LayoutTests/fast/lists/rtl-marker.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderListMarker.cpp

index d0f6181..9cb0e3d 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-03  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        List markers in RTL languages do not draw the first character.
+        https://bugs.webkit.org/show_bug.cgi?id=139244
+
+        Reviewed by Simon Fraser.
+
+        * fast/lists/rtl-marker-expected.html: Added.
+        * fast/lists/rtl-marker.html: Added.
+
 2014-12-03  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed gardening.
 2014-12-03  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed gardening.
diff --git a/LayoutTests/fast/lists/rtl-marker-expected.html b/LayoutTests/fast/lists/rtl-marker-expected.html
new file mode 100644 (file)
index 0000000..dbf9d9f
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+This test makes sure that lists whose markers are in RTL languages are correctly rendered.
+<ol style="line-height: 50px; list-style-type: hebrew; list-style-type: none;" start="97">
+<li>&#x5e6;&#x5d6;.</li>
+</ol>
diff --git a/LayoutTests/fast/lists/rtl-marker.html b/LayoutTests/fast/lists/rtl-marker.html
new file mode 100644 (file)
index 0000000..5e82017
--- /dev/null
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+This test makes sure that lists whose markers are in RTL languages are correctly rendered.
+<ol style="line-height: 50px; list-style-type: hebrew; list-style-position: inside;" start="97">
+<li></li>
+</ol>
index 979436e..4c069a6 100644 (file)
@@ -1,3 +1,17 @@
+2014-12-03  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        List markers in RTL languages do not draw the first character.
+        https://bugs.webkit.org/show_bug.cgi?id=139244
+
+        Reviewed by Simon Fraser.
+
+        Off-by-one error when reversing the string (from LTR to RTL)
+
+        Test: fast/lists/rtl-marker.html
+
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::paint):
+
 2014-12-03  Beth Dakin  <bdakin@apple.com>
 
         <input> elements get whitespace action menu instead of editable text menu
 2014-12-03  Beth Dakin  <bdakin@apple.com>
 
         <input> elements get whitespace action menu instead of editable text menu
index ed0a1b5..9ea750d 100644 (file)
@@ -1342,7 +1342,7 @@ void RenderListMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffse
             StringBuilder buffer;
             buffer.reserveCapacity(length);
             for (unsigned i = 0; i < length; ++i)
             StringBuilder buffer;
             buffer.reserveCapacity(length);
             for (unsigned i = 0; i < length; ++i)
-                buffer.append(m_text[length - i]);
+                buffer.append(m_text[length - i - 1]);
             reversedText = buffer.toString();
             textRun.setText(StringView(reversedText));
         }
             reversedText = buffer.toString();
             textRun.setText(StringView(reversedText));
         }