Bug 823939 - <mmultiscripts> now doesnt consider base followed by only <mprescripts> and no (presubscript presuperscript) pair as invalid-markup. r=fredw, r=Pike
authorMohit Gahlot <mohit.www@gmail.com>
Mon, 28 Jan 2013 00:00:25 +0530
changeset 122908 196d06d151a912621dee5f65c90638a74a20bbd8
parent 122907 0470103ac4a807a1f09506ff0e258bcf06656147
child 122909 910837eec45a982d3918f97bca571fb4d0a5797f
push id1387
push userphilringnalda@gmail.com
push dateTue, 26 Feb 2013 22:32:56 +0000
treeherderfx-team@ad4cc4e97774 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfredw, Pike
bugs823939
milestone22.0a1
Bug 823939 - <mmultiscripts> now doesnt consider base followed by only <mprescripts> and no (presubscript presuperscript) pair as invalid-markup. r=fredw, r=Pike
dom/locales/en-US/chrome/mathml/mathml.properties
layout/mathml/nsMathMLmmultiscriptsFrame.cpp
layout/mathml/tests/test_bug553917.html
layout/reftests/mathml/mathml-mmultiscript-base-ref.html
layout/reftests/mathml/mathml-mmultiscript-base.html
layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
layout/reftests/mathml/mathml-mmultiscript-mprescript.html
layout/reftests/mathml/reftest.list
--- a/dom/locales/en-US/chrome/mathml/mathml.properties
+++ b/dom/locales/en-US/chrome/mathml/mathml.properties
@@ -1,15 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 ChildCountIncorrect=Invalid markup: Incorrect number of children for <%1$S/> tag.
 DuplicateMprescripts=Invalid markup: More than one <mprescripts/> in <mmultiscripts/>.
-NoSubSup=Invalid markup: Expected at least one subscript/superscript pair in <mmultiscripts/>.  Found none.
+# LOCALIZATION NOTE:  The first child of <mmultiscript/> is the base, that is the element to which scripts are attached.
+NoBase=Invalid markup: Expected exactly one Base element in <mmultiscripts/>.  Found none.
 SubSupMismatch=Invalid markup: Incomplete subscript/superscript pair in <mmultiscripts/>.
 
 # LOCALIZATION NOTE:  When localizing the single quotes ('), follow the conventions in css.properties for your target locale.
 AttributeParsingError=Error in parsing the value '%1$S' for '%2$S' attribute of <%3$S/>.  Attribute ignored.
 AttributeParsingErrorNoTag=Error in parsing the value '%1$S' for '%2$S' attribute.  Attribute ignored.
 LengthParsingError=Error in parsing MathML attribute value '%1$S' as length.  Attribute ignored.
 DeprecatedSupersededBy='%1$S' is deprecated in MathML 3, superseded by '%2$S'.
 UnitlessValuesAreDeprecated=Unitless values are deprecated in MathML 3.
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp
@@ -354,21 +354,21 @@ nsMathMLmmultiscriptsFrame::Place(nsRend
       }
 
       isSubScript = !isSubScript;
     }
     count++;
     childFrame = childFrame->GetNextSibling();
   }
   // note: width=0 if all sup-sub pairs match correctly
-  if ((0 != width) || !baseFrame || !subScriptFrame || !supScriptFrame) {
+  if ((0 != width) || !baseFrame) {
     // report an error, encourage people to get their markups in order
     if (aPlaceOrigin) {
-      if (count <= 1 || (count == 2 && mprescriptsFrame)) {
-        ReportErrorToConsole("NoSubSup");
+      if (!baseFrame) {
+        ReportErrorToConsole("NoBase");
       } else {
         ReportErrorToConsole("SubSupMismatch");
       }
     }
     return ReflowError(aRenderingContext, aDesiredSize);
   }
 
   // we left out the width of prescripts, so ...
--- a/layout/mathml/tests/test_bug553917.html
+++ b/layout/mathml/tests/test_bug553917.html
@@ -57,17 +57,17 @@ https://bugzilla.mozilla.org/show_bug.cg
           status: [false, false, false, false, false, false],
           args: [["2..0"], ["1.5notaunit"], ["2"],["BADlspace"],["BADheight"],["BADdepth"]]
         },
       /*<math><mmultiscripts></mmultiscripts></math>
         <math><mmultiscripts><mprescripts/><mprescripts/></mmultiscripts></math>
         <math><mmultiscripts><mi>x</mi><mi>y</mi></mmultiscripts></math>*/
         MMultiscriptsErrors: {
           status: [false, false, false],
-          args: ["DuplicateMprescripts", "NoSubSup", "SubSupMismatch"]
+          args: ["NoBase","DuplicateMprescripts", "SubSupMismatch"]
         },
       /*<math><mo minsize="2">+</mo></math>*/
         UnitlessValuesAreDeprecated : {
           status : [false],
           args : [[]] }};
       
       var g_errorTypes = ["ChildCountIncorrect","DeprecatedSupersededBy","AttributeParsingError",
                           "AttributeParsingErrorNoTag","LengthParsingError", "MMultiscriptsErrors",
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-base-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>mmultiscript with only base</title>
+	</head>
+	
+	<body>
+		<math>
+			<mmultiscripts>
+			<mtext>base</mtext>
+			</mmultiscripts>
+		</math>
+	</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-base.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>mmultiscript with only base and none as placeholder</title>
+	</head>
+
+	<body>
+		<math> 
+			<mmultiscripts>
+				<mtext>base</mtext>
+				<none/>
+				<none/>
+			</mmultiscripts>
+		</math>
+	</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>mmultiscript with mprescripts without none</title>
+	</head>
+
+	<body>
+		<math> 
+			<mmultiscripts>
+				<mtext>base</mtext>
+				<mprescripts/>
+			</mmultiscripts>
+		</math>
+	</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-mprescript.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<title>mmultiscript with mprescripts with none as placeholders</title>
+	</head>
+	
+	<body>
+		<math>
+			<mmultiscripts>
+				<mtext>base</mtext>
+				<none/>
+				<none/>
+				<mprescripts/>
+			</mmultiscripts>
+
+		</math>
+	</body>
+</html>
--- a/layout/reftests/mathml/reftest.list
+++ b/layout/reftests/mathml/reftest.list
@@ -111,8 +111,10 @@ skip-if(B2G) == maction-dynamic-3.html m
 == whitespace-trim-1.html whitespace-trim-1-ref.html
 == whitespace-trim-2.html whitespace-trim-2-ref.html
 == whitespace-trim-3.html whitespace-trim-3-ref.html
 fails == whitespace-trim-4.html whitespace-trim-4-ref.html # Bug 787215
 == whitespace-trim-5.html whitespace-trim-5-ref.html
 == operator-1.xhtml operator-1-ref.xhtml
 == scriptshift-1.xhtml scriptshift-1-ref.xhtml
 == number-size-1.xhtml number-size-1-ref.xhtml
+== mathml-mmultiscript-base.html mathml-mmultiscript-base-ref.html
+== mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html