Title: [268324] trunk
Revision
268324
Author
commit-qu...@webkit.org
Date
2020-10-11 12:16:49 -0700 (Sun, 11 Oct 2020)

Log Message

Various test-cases from Gecko assert with ASSERTION FAILED: tagName == mmultiscriptsTag or ASSERTION FAILED: tagName == mrootTag
https://bugs.webkit.org/show_bug.cgi?id=202804

Patch by Rob Buis <rb...@igalia.com> on 2020-10-11
Reviewed by Frédéric Wang.

Source/WebCore:

Both rootTypeOf and scriptTypeOf were expecting the qualified name
to have no prefix, however it is possible in xhtml that prefixes are
set, as seen in the Gecko test cases. Failing to detect the qname
would hit an ASSERT in both cases. So use QualifiedName.matches
which ignores prefixes.

Tests: mathml/scripts-with-prefixes.xhtml
       mathml/square-roots-with-prefixes.xhtml

* mathml/MathMLRootElement.cpp:
(WebCore::rootTypeOf):
* mathml/MathMLScriptsElement.cpp:
(WebCore::scriptTypeOf):

LayoutTests:

Reduce Gecko test crashes into two tests.

* mathml/scripts-with-prefixes-expected.txt: Added.
* mathml/scripts-with-prefixes.xhtml: Added.
* mathml/square-roots-with-prefixes-expected.txt: Added.
* mathml/square-roots-with-prefixes.xhtml: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268323 => 268324)


--- trunk/LayoutTests/ChangeLog	2020-10-11 18:21:10 UTC (rev 268323)
+++ trunk/LayoutTests/ChangeLog	2020-10-11 19:16:49 UTC (rev 268324)
@@ -1,3 +1,17 @@
+2020-10-11  Rob Buis  <rb...@igalia.com>
+
+        Various test-cases from Gecko assert with ASSERTION FAILED: tagName == mmultiscriptsTag or ASSERTION FAILED: tagName == mrootTag
+        https://bugs.webkit.org/show_bug.cgi?id=202804
+
+        Reviewed by Frédéric Wang.
+
+        Reduce Gecko test crashes into two tests.
+
+        * mathml/scripts-with-prefixes-expected.txt: Added.
+        * mathml/scripts-with-prefixes.xhtml: Added.
+        * mathml/square-roots-with-prefixes-expected.txt: Added.
+        * mathml/square-roots-with-prefixes.xhtml: Added.
+
 2020-10-10  Darin Adler  <da...@apple.com>
 
         REGRESSION (r267761): editing/mac/spelling/autocorrection-contraction.html is a constant timeout on macOS wk2 Debug

Added: trunk/LayoutTests/mathml/scripts-with-prefixes-expected.txt (0 => 268324)


--- trunk/LayoutTests/mathml/scripts-with-prefixes-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/mathml/scripts-with-prefixes-expected.txt	2020-10-11 19:16:49 UTC (rev 268324)
@@ -0,0 +1,2 @@
+This test passes if it does not crash.
+

Added: trunk/LayoutTests/mathml/scripts-with-prefixes.xhtml (0 => 268324)


--- trunk/LayoutTests/mathml/scripts-with-prefixes.xhtml	                        (rev 0)
+++ trunk/LayoutTests/mathml/scripts-with-prefixes.xhtml	2020-10-11 19:16:49 UTC (rev 268324)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:lang="en">
+<head>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+    <mtext>This test passes if it does not crash.</mtext> 
+    <m:msub/>
+    <m:msup/>
+    <m:msubsup/>
+    <m:mover/>
+    <m:munder/>
+    <m:munderover/>
+    <m:mmultiscripts/>
+</math>
+</body>
+</html>

Added: trunk/LayoutTests/mathml/square-roots-with-prefixes-expected.txt (0 => 268324)


--- trunk/LayoutTests/mathml/square-roots-with-prefixes-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/mathml/square-roots-with-prefixes-expected.txt	2020-10-11 19:16:49 UTC (rev 268324)
@@ -0,0 +1,2 @@
+This test passes if it does not crash.
+

Added: trunk/LayoutTests/mathml/square-roots-with-prefixes.xhtml (0 => 268324)


--- trunk/LayoutTests/mathml/square-roots-with-prefixes.xhtml	                        (rev 0)
+++ trunk/LayoutTests/mathml/square-roots-with-prefixes.xhtml	2020-10-11 19:16:49 UTC (rev 268324)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:lang="en">
+<head>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+    <mtext>This test passes if it does not crash.</mtext> 
+    <m:mroot/>
+    <m:msqrt/>
+</math>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (268323 => 268324)


--- trunk/Source/WebCore/ChangeLog	2020-10-11 18:21:10 UTC (rev 268323)
+++ trunk/Source/WebCore/ChangeLog	2020-10-11 19:16:49 UTC (rev 268324)
@@ -1,3 +1,24 @@
+2020-10-11  Rob Buis  <rb...@igalia.com>
+
+        Various test-cases from Gecko assert with ASSERTION FAILED: tagName == mmultiscriptsTag or ASSERTION FAILED: tagName == mrootTag
+        https://bugs.webkit.org/show_bug.cgi?id=202804
+
+        Reviewed by Frédéric Wang.
+
+        Both rootTypeOf and scriptTypeOf were expecting the qualified name
+        to have no prefix, however it is possible in xhtml that prefixes are
+        set, as seen in the Gecko test cases. Failing to detect the qname
+        would hit an ASSERT in both cases. So use QualifiedName.matches
+        which ignores prefixes.
+
+        Tests: mathml/scripts-with-prefixes.xhtml
+               mathml/square-roots-with-prefixes.xhtml
+
+        * mathml/MathMLRootElement.cpp:
+        (WebCore::rootTypeOf):
+        * mathml/MathMLScriptsElement.cpp:
+        (WebCore::scriptTypeOf):
+
 2020-10-11  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [MotionMark] Computing the fast bounding rect of an arc should not materialize a CGPathRef

Modified: trunk/Source/WebCore/mathml/MathMLRootElement.cpp (268323 => 268324)


--- trunk/Source/WebCore/mathml/MathMLRootElement.cpp	2020-10-11 18:21:10 UTC (rev 268323)
+++ trunk/Source/WebCore/mathml/MathMLRootElement.cpp	2020-10-11 19:16:49 UTC (rev 268324)
@@ -40,9 +40,9 @@
 
 static RootType rootTypeOf(const QualifiedName& tagName)
 {
-    if (tagName == msqrtTag)
+    if (tagName.matches(msqrtTag))
         return RootType::SquareRoot;
-    ASSERT(tagName == mrootTag);
+    ASSERT(tagName.matches(mrootTag));
     return RootType::RootWithIndex;
 }
 

Modified: trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp (268323 => 268324)


--- trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2020-10-11 18:21:10 UTC (rev 268323)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp	2020-10-11 19:16:49 UTC (rev 268324)
@@ -40,19 +40,19 @@
 
 static MathMLScriptsElement::ScriptType scriptTypeOf(const QualifiedName& tagName)
 {
-    if (tagName == msubTag)
+    if (tagName.matches(msubTag))
         return MathMLScriptsElement::ScriptType::Sub;
-    if (tagName == msupTag)
+    if (tagName.matches(msupTag))
         return MathMLScriptsElement::ScriptType::Super;
-    if (tagName == msubsupTag)
+    if (tagName.matches(msubsupTag))
         return MathMLScriptsElement::ScriptType::SubSup;
-    if (tagName == munderTag)
+    if (tagName.matches(munderTag))
         return MathMLScriptsElement::ScriptType::Under;
-    if (tagName == moverTag)
+    if (tagName.matches(moverTag))
         return MathMLScriptsElement::ScriptType::Over;
-    if (tagName == munderoverTag)
+    if (tagName.matches(munderoverTag))
         return MathMLScriptsElement::ScriptType::UnderOver;
-    ASSERT(tagName == mmultiscriptsTag);
+    ASSERT(tagName.matches(mmultiscriptsTag));
     return MathMLScriptsElement::ScriptType::Multiscripts;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to