https://bugs.webkit.org/show_bug.cgi?id=46948 Crash with all-
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Oct 2010 01:13:37 +0000 (01:13 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Oct 2010 01:13:37 +0000 (01:13 +0000)
whitespace separators for mfenced

Reviewed by Adele Peterson.

WebCore:

Check the size of characters instead of separators in case all the
separators were whitespace.

* mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::updateFromElement):

LayoutTests:

* mathml/fenced-whitespace-separators-crash-expected.txt: Added.
* mathml/fenced-whitespace-separators-crash.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/mathml/fenced-whitespace-separators-crash-expected.txt [new file with mode: 0644]
LayoutTests/mathml/fenced-whitespace-separators-crash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/mathml/RenderMathMLFenced.cpp

index 010ccec..241b326 100644 (file)
@@ -1,3 +1,13 @@
+2010-09-30  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46948 Crash with all-
+        whitespace separators for mfenced
+
+        * mathml/fenced-whitespace-separators-crash-expected.txt: Added.
+        * mathml/fenced-whitespace-separators-crash.html: Added.
+
 2010-09-30  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Jon Honeycutt.
diff --git a/LayoutTests/mathml/fenced-whitespace-separators-crash-expected.txt b/LayoutTests/mathml/fenced-whitespace-separators-crash-expected.txt
new file mode 100644 (file)
index 0000000..7c74f87
--- /dev/null
@@ -0,0 +1 @@
+vi
diff --git a/LayoutTests/mathml/fenced-whitespace-separators-crash.html b/LayoutTests/mathml/fenced-whitespace-separators-crash.html
new file mode 100644 (file)
index 0000000..ce87b7e
--- /dev/null
@@ -0,0 +1,21 @@
+<html>
+<head>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+</head>
+
+<body>
+<math>
+    <mfenced separators=" ">
+        <mrow>
+            <mrow>
+                <mi>v</mi>
+            </mrow>
+            <mi>i</mi>
+        </mrow>
+    </mfenced>
+</math>
+</body>
+</html>
index c5f6754..07f0ca1 100644 (file)
@@ -1,3 +1,16 @@
+2010-09-30  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Adele Peterson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46948 Crash with all-
+        whitespace separators for mfenced
+
+        Check the size of characters instead of separators in case all the 
+        separators were whitespace.
+
+        * mathml/RenderMathMLFenced.cpp:
+        (WebCore::RenderMathMLFenced::updateFromElement):
+
 2010-09-30  Darin Adler  <darin@apple.com>
 
         Reviewed by Sam Weinig.
index 6c0bb0b..2582356 100644 (file)
@@ -67,7 +67,7 @@ void RenderMathMLFenced::updateFromElement()
             if (!isSpaceOrNewline(separators[i]))
                 characters.append(separators[i]);
         }
-        m_separators = !separators.length() ? 0 : StringImpl::create(characters.data() , characters.size());
+        m_separators = !characters.size() ? 0 : StringImpl::create(characters.data() , characters.size());
     } else {
         // The separator defaults to a single comma.
         m_separators = StringImpl::create(",");