Title: [165739] trunk/Source/WebCore
Revision
165739
Author
[email protected]
Date
2014-03-17 09:52:31 -0700 (Mon, 17 Mar 2014)

Log Message

Fix handling of <annotation> in MathMLTextElement.
https://bugs.webkit.org/show_bug.cgi?id=124128.

Reviewed by Darin Adler.

No new tests.

* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::createElementRenderer): do not create the special RenderMathMLToken for the <annotation> tag.
(WebCore::MathMLTextElement::childShouldCreateRenderer): only allow text inside <annotation>.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (165738 => 165739)


--- trunk/Source/WebCore/ChangeLog	2014-03-17 16:42:54 UTC (rev 165738)
+++ trunk/Source/WebCore/ChangeLog	2014-03-17 16:52:31 UTC (rev 165739)
@@ -1,3 +1,16 @@
+2014-03-17  Frédéric Wang  <[email protected]>
+
+        Fix handling of <annotation> in MathMLTextElement.
+        https://bugs.webkit.org/show_bug.cgi?id=124128.
+
+        Reviewed by Darin Adler.
+
+        No new tests.
+
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::createElementRenderer): do not create the special RenderMathMLToken for the <annotation> tag.
+        (WebCore::MathMLTextElement::childShouldCreateRenderer): only allow text inside <annotation>.
+
 2014-03-17  Martin Robinson  <[email protected]>
 
         [GTK][CMake] Credential storage is not enabled

Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (165738 => 165739)


--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2014-03-17 16:42:54 UTC (rev 165738)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp	2014-03-17 16:52:31 UTC (rev 165739)
@@ -74,6 +74,8 @@
         return createRenderer<RenderMathMLOperator>(*this, std::move(style));
     if (hasTagName(MathMLNames::mspaceTag))
         return createRenderer<RenderMathMLSpace>(*this, std::move(style));
+    if (hasTagName(MathMLNames::annotationTag))
+        return MathMLElement::createElementRenderer(std::move(style));
 
     ASSERT(hasTagName(MathMLNames::miTag) || hasTagName(MathMLNames::mnTag) || hasTagName(MathMLNames::msTag) || hasTagName(MathMLNames::mtextTag));
 
@@ -159,13 +161,15 @@
 
 bool MathMLTextElement::childShouldCreateRenderer(const Node& child) const
 {
-    // The HTML specification defines <mi>, <mo>, <mn>, <ms> and <mtext> as insertion points.
+    if (hasTagName(MathMLNames::mspaceTag))
+        return false;
 
     // FIXME: phrasing content should be accepted in <mo> elements too (https://bugs.webkit.org/show_bug.cgi?id=130245).
-    if (hasTagName(moTag))
+    if (hasTagName(MathMLNames::annotationTag) || hasTagName(MathMLNames::moTag))
         return child.isTextNode();
 
-    return !hasTagName(MathMLNames::mspaceTag) && isPhrasingContent(child);
+    // The HTML specification defines <mi>, <mo>, <mn>, <ms> and <mtext> as insertion points.
+    return isPhrasingContent(child);
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to