2009-11-19 Rahul Kuchhal <kuchhal@chromium.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 20:25:19 +0000 (20:25 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Nov 2009 20:25:19 +0000 (20:25 +0000)
        Reviewed by Darin Adler.

        Do not assert when a high number is used for roman numerals in lists.
        https://bugs.webkit.org/show_bug.cgi?id=31652

        * fast/lists/ol-start-roman.html: Added.
        * platform/mac/fast/lists/ol-start-roman-expected.txt: Added.
2009-11-19  Rahul Kuchhal  <kuchhal@chromium.org>

        Reviewed by Darin Adler.

        Do not assert when a high number is used for roman numerals in lists.
        https://bugs.webkit.org/show_bug.cgi?id=31652

        Test: fast/lists/ol-start-roman.html

        * rendering/RenderListMarker.cpp:
        (WebCore::toRoman): Increase the char array size.

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

LayoutTests/ChangeLog
LayoutTests/fast/lists/ol-start-roman-expected.txt [new file with mode: 0644]
LayoutTests/fast/lists/ol-start-roman.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderListMarker.cpp

index 36c29f75ea72fc3d9f2a1faf6ca27f246d53eb76..ebbb71132c59a44b455c72749c5e829d4aa0273a 100644 (file)
@@ -1,3 +1,13 @@
+2009-11-19  Rahul Kuchhal  <kuchhal@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Do not assert when a high number is used for roman numerals in lists.
+        https://bugs.webkit.org/show_bug.cgi?id=31652
+
+        * fast/lists/ol-start-roman.html: Added.
+        * platform/mac/fast/lists/ol-start-roman-expected.txt: Added.
+
 2009-11-19  Eric Z. Ayers  <zundel@google.com>
 
         Reviewed by Pavel Feldman.
diff --git a/LayoutTests/fast/lists/ol-start-roman-expected.txt b/LayoutTests/fast/lists/ol-start-roman-expected.txt
new file mode 100644 (file)
index 0000000..84bb7e6
--- /dev/null
@@ -0,0 +1,2 @@
+PASS: test did not crash, bug 31652.
+PASS: test did not crash, bug 31652.
diff --git a/LayoutTests/fast/lists/ol-start-roman.html b/LayoutTests/fast/lists/ol-start-roman.html
new file mode 100644 (file)
index 0000000..6a97174
--- /dev/null
@@ -0,0 +1,10 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<ol start="3888" type="i">
+<li>PASS: test did not crash, bug 31652.</li>
+</ol>
+<ol start="4888" type="i">
+<li>PASS: test did not crash, bug 31652.</li>
+</ol>
index 68dde5bf066c3b78424207c083d8d50fb7f6e536..c971952e0fc3574397d5cb282f30b8f52f3a6857 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-19  Rahul Kuchhal  <kuchhal@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Do not assert when a high number is used for roman numerals in lists.
+        https://bugs.webkit.org/show_bug.cgi?id=31652
+
+        Test: fast/lists/ol-start-roman.html
+
+        * rendering/RenderListMarker.cpp:
+        (WebCore::toRoman): Increase the char array size.
+
 2009-11-19  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         Rubber-stamped by Oliver Hunt.
index 692666a90ef7487f9c09092bee25133cdc0e8ed1..28af4259cb0e8a3f5e7f3f088e78b929fbcc5c44 100644 (file)
@@ -48,7 +48,9 @@ static String toRoman(int number, bool upper)
     if (number < 1 || number > 3999)
         return String::number(number);
 
-    const int lettersSize = 12; // big enough for three each of I, X, C, and M
+    // Big enough to store largest roman number less than 3999 which
+    // is 3888 (MMMDCCCLXXXVIII)
+    const int lettersSize = 15;
     UChar letters[lettersSize];
 
     int length = 0;