<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[166065] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/166065">166065</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2014-03-21 09:19:36 -0700 (Fri, 21 Mar 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Bug 130345 - Refine childShouldCreateRenderer for MathML elements
https://bugs.webkit.org/show_bug.cgi?id=130345
Reviewed by Chris Fleizach.
Source/WebCore:
This is a follow-up of bug 124128. We add more restrictions on foreign
content of MathML elements.
Tests: mathml/presentation/annotation-children.html
mathml/presentation/foreign-element-in-token.html
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isPresentationMathML): fix line wrapping
(WebCore::MathMLElement::isPhrasingContent):
- move the function from MathMLSelectElement.cpp
- add the constraint "is descendant of a map element" for area.
(WebCore::MathMLElement::isFlowContent): new function to test flow content.
(WebCore::MathMLElement::childShouldCreateRenderer):
- remove annotation since it is now tested in MathMLTextElement
- refine testing of annotation-xml
- do not create renderer for text content in MathML. Such content is only allowed inside token elements.
* mathml/MathMLElement.h: Declare isPhrasingContent and isFlowContent.
* mathml/MathMLSelectElement.cpp: Add new function to test MathML/SVG/HTML encodings.
(WebCore::MathMLSelectElement::isMathMLEncoding):
(WebCore::MathMLSelectElement::isSVGEncoding):
(WebCore::MathMLSelectElement::isHTMLEncoding):
(WebCore::MathMLSelectElement::getSelectedSemanticsChild): use the new functions.
* mathml/MathMLSelectElement.h: Declare the new public functions.
* mathml/MathMLTextElement.cpp: remove the isPhrasingContent function.
(WebCore::MathMLTextElement::childShouldCreateRenderer): Just in case, use the generic StyledElement::childShouldCreateRenderer.
LayoutTests:
We update the references of some tests after the additional
restrictions on MathML children. We replace the foreign-*.html with a
single foreign-element-in-token.html and write more tests to verify the
accepted and reject content.
* mathml/msub-anonymous-child-render-crash-expected.txt: Update reference now that text is only allowed in some token MathML elements.
* mathml/presentation/annotation-children-expected.html: Added.
* mathml/presentation/annotation-children.html: Added.
* mathml/presentation/foreign-element-in-annotation-xml.html: Added.
* mathml/presentation/foreign-element-in-annotation-xml-expected.txt: Added.
* mathml/presentation/foreign-element-in-token-expected.txt: Added.
* mathml/presentation/foreign-element-in-token.html: Added.
* mathml/presentation/foreign-mi-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mi.html: Removed.
* mathml/presentation/foreign-mn-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mn.html: Removed.
* mathml/presentation/foreign-mtext-expected-mismatch.html: Removed.
* mathml/presentation/foreign-mtext-rejected-expected.html: Removed.
* mathml/presentation/foreign-mtext-rejected.html: Removed.
* mathml/presentation/foreign-mtext.html: Removed.
* mathml/presentation/semantics-2.html: the mtext elements can not be direct child of annotation-xml. wrap them in a math tag.
* mathml/presentation/semantics-3.html: ditto.
* mathml/presentation/semantics-4.html: ditto.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmathmlmsubanonymouschildrendercrashexpectedtxt">trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemantics2html">trunk/LayoutTests/mathml/presentation/semantics-2.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemantics3html">trunk/LayoutTests/mathml/presentation/semantics-3.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemantics4html">trunk/LayoutTests/mathml/presentation/semantics-4.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementcpp">trunk/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementcpp">trunk/Source/WebCore/mathml/MathMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementh">trunk/Source/WebCore/mathml/MathMLSelectElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementcpp">trunk/Source/WebCore/mathml/MathMLTextElement.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationannotationchildrenexpectedhtml">trunk/LayoutTests/mathml/presentation/annotation-children-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationannotationchildrenhtml">trunk/LayoutTests/mathml/presentation/annotation-children.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignelementinannotationxmlexpectedtxt">trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignelementinannotationxmlhtml">trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignelementintokenexpectedtxt">trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignelementintokenhtml">trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmiexpectedmismatchhtml">trunk/LayoutTests/mathml/presentation/foreign-mi-expected-mismatch.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmihtml">trunk/LayoutTests/mathml/presentation/foreign-mi.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmnexpectedmismatchhtml">trunk/LayoutTests/mathml/presentation/foreign-mn-expected-mismatch.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmnhtml">trunk/LayoutTests/mathml/presentation/foreign-mn.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmtextexpectedmismatchhtml">trunk/LayoutTests/mathml/presentation/foreign-mtext-expected-mismatch.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmtextrejectedexpectedhtml">trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmtextrejectedhtml">trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationforeignmtexthtml">trunk/LayoutTests/mathml/presentation/foreign-mtext.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/ChangeLog        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-03-21 Frédéric Wang <fred.wang@free.fr>
+
+ Bug 130345 - Refine childShouldCreateRenderer for MathML elements
+ https://bugs.webkit.org/show_bug.cgi?id=130345
+
+ Reviewed by Chris Fleizach.
+
+ We update the references of some tests after the additional
+ restrictions on MathML children. We replace the foreign-*.html with a
+ single foreign-element-in-token.html and write more tests to verify the
+ accepted and reject content.
+
+ * mathml/msub-anonymous-child-render-crash-expected.txt: Update reference now that text is only allowed in some token MathML elements.
+ * mathml/presentation/annotation-children-expected.html: Added.
+ * mathml/presentation/annotation-children.html: Added.
+ * mathml/presentation/foreign-element-in-annotation-xml.html: Added.
+ * mathml/presentation/foreign-element-in-annotation-xml-expected.txt: Added.
+ * mathml/presentation/foreign-element-in-token-expected.txt: Added.
+ * mathml/presentation/foreign-element-in-token.html: Added.
+ * mathml/presentation/foreign-mi-expected-mismatch.html: Removed.
+ * mathml/presentation/foreign-mi.html: Removed.
+ * mathml/presentation/foreign-mn-expected-mismatch.html: Removed.
+ * mathml/presentation/foreign-mn.html: Removed.
+ * mathml/presentation/foreign-mtext-expected-mismatch.html: Removed.
+ * mathml/presentation/foreign-mtext-rejected-expected.html: Removed.
+ * mathml/presentation/foreign-mtext-rejected.html: Removed.
+ * mathml/presentation/foreign-mtext.html: Removed.
+ * mathml/presentation/semantics-2.html: the mtext elements can not be direct child of annotation-xml. wrap them in a math tag.
+ * mathml/presentation/semantics-3.html: ditto.
+ * mathml/presentation/semantics-4.html: ditto.
+
</ins><span class="cx"> 2014-03-21 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> StackLayoutPhase should find the union'ed calleeVariable before accessing its machineLocal.
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlmsubanonymouschildrendercrashexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,13 +1,9 @@
</span><span class="cx"> This test passes if it does not crash.
</span><span class="cx">
</span><span class="cx"> X
</span><del>-3
</del><span class="cx"> Y
</span><del>-3
</del><span class="cx"> X
</span><del>-3
</del><span class="cx"> 2
</span><span class="cx"> Y
</span><del>-3
</del><span class="cx"> 2
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationannotationchildrenexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/annotation-children-expected.html (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/annotation-children-expected.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/annotation-children-expected.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>annotation children</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation>PASS</annotation></semantics></math></p>
+
+ </body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/annotation-children-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationannotationchildrenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/annotation-children.html (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/annotation-children.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/annotation-children.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>annotation children</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- This verifies that the annotation element can only contain text content -->
+
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation>PA<mtext>ERROR</mtext>SS</annotation></semantics></math></p>
+
+ </body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/annotation-children.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationforeignelementinannotationxmlexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml-expected.txt (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml-expected.txt         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml-expected.txt        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+x
+y
+
+x
+y
+
+x
+y
+
+span
+
+svg
+
+mathml
+
+div
+
+h1
+
+
+h2
+
+
+h3
+
+
+h4
+
+
+h5
+
+
+h6
+
+
+blockquote
+
+
+svg
+
+mathml
+
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationforeignelementinannotationxmlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml.html (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>Foreign content in semantics</title>
+ <script type="text/javascript">
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ </script>
+ </head>
+ <body>
+
+ <!-- Text is generally not accepted inside MathML elements. -->
+ <p><math>ERROR</math></p>
+ <p><math><mfrac><mi>x</mi>ERROR<mi>y</mi></mfrac></math></p>
+ <p><math><munder><mi>x</mi>ERROR<mi>y</mi></munder></math></p>
+ <p><math><msup><mi>x</mi>ERROR<mi>y</mi></msup></math></p>
+
+ <!-- annotation-xml with HTML encoding accepts flow content. -->
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><span>span</span></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><svg><text>svg</text></svg></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><math><mtext>mathml</mtext></math></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><div>div</div></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h1>h1</h1></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h2>h2</h2></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h3>h3</h3></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h4>h4</h4></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h5>h5</h5></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><h6>h6</h6></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><blockquote>blockquote</blockquote></annotation-xml></semantics></math></p>
+
+ <!-- annotation-xml with SVG/MathML encoding only accepts the specified type. -->
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><math><mtext>ERROR</mtext></math></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><svg><text>svg</text></svg></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><math><mtext>mathml</mtext></math></annotation-xml></semantics></math></p>
+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><svg><text>ERROR</text></svg></annotation-xml></semantics></math></p>
+
+ </body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/foreign-element-in-annotation-xml.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationforeignelementintokenexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,344 @@
</span><ins>+Foreign phrasing content should create renderers:
+
+a:
+mi
+
+abbr:
+mi
+
+b:
+mi
+
+bdi:
+mi
+
+bdo:
+mi
+
+button:
+mi
+
+cite:
+mi
+
+code:
+mi
+
+datalist:
+mi
+
+del:
+mi
+
+dfn:
+mi
+
+em:
+mi
+
+embed:
+mi
+
+i:
+mi
+
+img:
+mi
+
+input:
+mi
+
+ins:
+mi
+
+kbd:
+mi
+
+keygen:
+mi
+
+label:
+mi
+
+mark:
+mi
+
+math:
+mi
+
+object:
+mi
+
+output:
+mi
+
+q:
+mi
+
+ruby:
+mi
+
+s:
+mi
+
+samp:
+mi
+
+small:
+mi
+
+span:
+mi
+
+strong:
+mi
+
+sub:
+mi
+
+sup:
+mi
+
+svg:
+mi
+
+u:
+mi
+
+var:
+mi
+
+a:
+mn
+
+abbr:
+mn
+
+b:
+mn
+
+bdi:
+mn
+
+bdo:
+mn
+
+button:
+mn
+
+cite:
+mn
+
+code:
+mn
+
+datalist:
+mn
+
+del:
+mn
+
+dfn:
+mn
+
+em:
+mn
+
+embed:
+mn
+
+i:
+mn
+
+img:
+mn
+
+input:
+mn
+
+ins:
+mn
+
+kbd:
+mn
+
+keygen:
+mn
+
+label:
+mn
+
+mark:
+mn
+
+math:
+mn
+
+object:
+mn
+
+output:
+mn
+
+q:
+mn
+
+ruby:
+mn
+
+s:
+mn
+
+samp:
+mn
+
+small:
+mn
+
+span:
+mn
+
+strong:
+mn
+
+sub:
+mn
+
+sup:
+mn
+
+svg:
+mn
+
+u:
+mn
+
+var:
+mn
+
+a:
+mtext
+
+abbr:
+mtext
+
+b:
+mtext
+
+bdi:
+mtext
+
+bdo:
+mtext
+
+button:
+mtext
+
+cite:
+mtext
+
+code:
+mtext
+
+datalist:
+mtext
+
+del:
+mtext
+
+dfn:
+mtext
+
+em:
+mtext
+
+embed:
+mtext
+
+i:
+mtext
+
+img:
+mtext
+
+input:
+mtext
+
+ins:
+mtext
+
+kbd:
+mtext
+
+keygen:
+mtext
+
+label:
+mtext
+
+mark:
+mtext
+
+math:
+mtext
+
+object:
+mtext
+
+output:
+mtext
+
+q:
+mtext
+
+ruby:
+mtext
+
+s:
+mtext
+
+samp:
+mtext
+
+small:
+mtext
+
+span:
+mtext
+
+strong:
+mtext
+
+sub:
+mtext
+
+sup:
+mtext
+
+svg:
+mtext
+
+u:
+mtext
+
+var:
+mtext
+
+Foreign non-phrasing content should not create renderers:
+
+p:
+
+div:
+
+h1:
+
+h2:
+
+h3:
+
+h4:
+
+h6:
+
+blockquote:
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/foreign-element-in-token-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationforeignelementintokenhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html (0 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -0,0 +1,141 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>Foreign content</title>
+ <script type="text/javascript">
+ if (window.testRunner)
+ testRunner.dumpAsText();
+ </script>
+ </head>
+ <body>
+
+ <p>Foreign phrasing content should create renderers:</p>
+
+ <!-- The following elements are not covered by this test: wbr, audio, data,
+ time, canvas, iframe, map, video, textarea, meter, noscript, progress,
+ script, select, template, br, area. -->
+
+ <p>a: <math><mi><a>mi</a></mi></math></p>
+ <p>abbr: <math><mi><abbr>mi</abbr></mi></math></p>
+ <p>b: <math><mi><b>mi</b></mi></math></p>
+ <p>bdi: <math><mi><bdi>mi</bdi></mi></math></p>
+ <p>bdo: <math><mi><bdo>mi</bdo></mi></math></p>
+ <p>button: <math><mi><button>mi</button></mi></math></p>
+ <p>cite: <math><mi><cite>mi</cite></mi></math></p>
+ <p>code: <math><mi><code>mi</code></mi></math></p>
+ <p>datalist: <math><mi><datalist>mi</datalist></mi></math></p>
+ <p>del: <math><mi><del>mi</del></mi></math></p>
+ <p>dfn: <math><mi><dfn>mi</dfn></mi></math></p>
+ <p>em: <math><mi><em>mi</em></mi></math></p>
+ <p>embed: <math><mi><embed>mi</embed></mi></math></p>
+ <p>i: <math><mi><i>mi</i></mi></math></p>
+ <p>img: <math><mi><img>mi</img></mi></math></p>
+ <p>input: <math><mi><input>mi</input></mi></math></p>
+ <p>ins: <math><mi><ins>mi</ins></mi></math></p>
+ <p>kbd: <math><mi><kbd>mi</kbd></mi></math></p>
+ <p>keygen: <math><mi><keygen>mi</keygen></mi></math></p>
+ <p>label: <math><mi><label>mi</label></mi></math></p>
+ <p>mark: <math><mi><mark>mi</mark></mi></math></p>
+ <p>math: <math><mi><math><mtext>mi</mtext></math></mi></math></p>
+ <p>object: <math><mi><object>mi</object></mi></math></p>
+ <p>output: <math><mi><output>mi</output></mi></math></p>
+ <p>q: <math><mi><q>mi</q></mi></math></p>
+ <p>ruby: <math><mi><ruby>mi</ruby></mi></math></p>
+ <p>s: <math><mi><s>mi</s></mi></math></p>
+ <p>samp: <math><mi><samp>mi</samp></mi></math></p>
+ <p>small: <math><mi><small>mi</small></mi></math></p>
+ <p>span: <math><mi><span>mi</span></mi></math></p>
+ <p>strong: <math><mi><strong>mi</strong></mi></math></p>
+ <p>sub: <math><mi><sub>mi</sub></mi></math></p>
+ <p>sup: <math><mi><sup>mi</sup></mi></math></p>
+ <p>svg: <math><mi><svg><text>mi</text></svg></mi></math></p>
+ <p>u: <math><mi><u>mi</u></mi></math></p>
+ <p>var: <math><mi><var>mi</var></mi></math></p>
+
+ <p>a: <math><mn><a>mn</a></mn></math></p>
+ <p>abbr: <math><mn><abbr>mn</abbr></mn></mth></p>
+ <p>b: <math><mn><b>mn</b></mn></math></p>
+ <p>bdi: <math><mn><bdi>mn</bdi></mn></math></p>
+ <p>bdo: <math><mn><bdo>mn</bdo></mn></math></p>
+ <p>button: <math><mn><button>mn</button></mn></math></p>
+ <p>cite: <math><mn><cite>mn</cite></mn></math></p>
+ <p>code: <math><mn><code>mn</code></mn></math></p>
+ <p>datalist: <math><mn><datalist>mn</datalist></mn></math></p>
+ <p>del: <math><mn><del>mn</del></mn></math></p>
+ <p>dfn: <math><mn><dfn>mn</dfn></mn></math></p>
+ <p>em: <math><mn><em>mn</em></mn></math></p>
+ <p>embed: <math><mn><embed>mn</embed></mn></math></p>
+ <p>i: <math><mn><i>mn</i></mn></math></p>
+ <p>img: <math><mn><img>mn</img></mn></math></p>
+ <p>input: <math><mn><input>mn</input></mn></math></p>
+ <p>ins: <math><mn><ins>mn</ins></mn></math></p>
+ <p>kbd: <math><mn><kbd>mn</kbd></mn></math></p>
+ <p>keygen: <math><mn><keygen>mn</keygen></mn></math></p>
+ <p>label: <math><mn><label>mn</label></mn></math></p>
+ <p>mark: <math><mn><mark>mn</mark></mn></math></p>
+ <p>math: <math><mn><math><mtext>mn</mtext></math></mn></math></p>
+ <p>object: <math><mn><object>mn</object></mn></math></p>
+ <p>output: <math><mn><output>mn</output></mn></math></p>
+ <p>q: <math><mn><q>mn</q></mn></math></p>
+ <p>ruby: <math><mn><ruby>mn</ruby></mn></math></p>
+ <p>s: <math><mn><s>mn</s></mn></math></p>
+ <p>samp: <math><mn><samp>mn</samp></mn></math></p>
+ <p>small: <math><mn><small>mn</small></mn></math></p>
+ <p>span: <math><mn><span>mn</span></mn></math></p>
+ <p>strong: <math><mn><strong>mn</strong></mn></math></p>
+ <p>sub: <math><mn><sub>mn</sub></mn></math></p>
+ <p>sup: <math><mn><sup>mn</sup></mn></math></p>
+ <p>svg: <math><mn><svg><text>mn</text></svg></mn></math></p>
+ <p>u: <math><mn><u>mn</u></mn></math></p>
+ <p>var: <math><mn><var>mn</var></mn></math></p>
+
+ <p>a: <math><mtext><a>mtext</a></mtext></math></p>
+ <p>abbr: <math><mtext><abbr>mtext</abbr></mtext></mth></p>
+ <p>b: <math><mtext><b>mtext</b></mtext></math></p>
+ <p>bdi: <math><mtext><bdi>mtext</bdi></mtext></math></p>
+ <p>bdo: <math><mtext><bdo>mtext</bdo></mtext></math></p>
+ <p>button: <math><mtext><button>mtext</button></mtext></math></p>
+ <p>cite: <math><mtext><cite>mtext</cite></mtext></math></p>
+ <p>code: <math><mtext><code>mtext</code></mtext></math></p>
+ <p>datalist: <math><mtext><datalist>mtext</datalist></mtext></math></p>
+ <p>del: <math><mtext><del>mtext</del></mtext></math></p>
+ <p>dfn: <math><mtext><dfn>mtext</dfn></mtext></math></p>
+ <p>em: <math><mtext><em>mtext</em></mtext></math></p>
+ <p>embed: <math><mtext><embed>mtext</embed></mtext></math></p>
+ <p>i: <math><mtext><i>mtext</i></mtext></math></p>
+ <p>img: <math><mtext><img>mtext</img></mtext></math></p>
+ <p>input: <math><mtext><input>mtext</input></mtext></math></p>
+ <p>ins: <math><mtext><ins>mtext</ins></mtext></math></p>
+ <p>kbd: <math><mtext><kbd>mtext</kbd></mtext></math></p>
+ <p>keygen: <math><mtext><keygen>mtext</keygen></mtext></math></p>
+ <p>label: <math><mtext><label>mtext</label></mtext></math></p>
+ <p>mark: <math><mtext><mark>mtext</mark></mtext></math></p>
+ <p>math: <math><mtext><math><mtext>mtext</mtext></math></mtext></math></p>
+ <p>object: <math><mtext><object>mtext</object></mtext></math></p>
+ <p>output: <math><mtext><output>mtext</output></mtext></math></p>
+ <p>q: <math><mtext><q>mtext</q></mtext></math></p>
+ <p>ruby: <math><mtext><ruby>mtext</ruby></mtext></math></p>
+ <p>s: <math><mtext><s>mtext</s></mtext></math></p>
+ <p>samp: <math><mtext><samp>mtext</samp></mtext></math></p>
+ <p>small: <math><mtext><small>mtext</small></mtext></math></p>
+ <p>span: <math><mtext><span>mtext</span></mtext></math></p>
+ <p>strong: <math><mtext><strong>mtext</strong></mtext></math></p>
+ <p>sub: <math><mtext><sub>mtext</sub></mtext></math></p>
+ <p>sup: <math><mtext><sup>mtext</sup></mtext></math></p>
+ <p>svg: <math><mtext><svg><text>mtext</text></svg></mtext></math></p>
+ <p>u: <math><mtext><u>mtext</u></mtext></math></p>
+ <p>var: <math><mtext><var>mtext</var></mtext></math></p>
+
+ <p>Foreign non-phrasing content should not create renderers:</p>
+
+ <p>p: <math><mi><p>mi</p></mi><mtext><p>mi</p></mtext><mn><p>mn</p></mn></math></p>
+ <p>div: <math><mi><div>mi</div></mi><mtext><div>mi</div></mtext><mn><div>mn</div></mn></math></p>
+ <p>h1: <math><mi><h1>mi</h1></mi><mtext><h1>mi</h1></mtext><mn><h1>mn</h1></mn></math></p>
+ <p>h2: <math><mi><h2>mi</h2></mi><mtext><h2>mi</h2></mtext><mn><h2>mn</h2></mn></math></p>
+ <p>h3: <math><mi><h3>mi</h3></mi><mtext><h3>mi</h3></mtext><mn><h3>mn</h3></mn></math></p>
+ <p>h4: <math><mi><h4>mi</h4></mi><mtext><h4>mi</h4></mtext><mn><h4>mn</h4></mn></math></p>
+ <p>h6: <math><mi><h6>mi</h6></mi><mtext><h6>mi</h6></mtext><mn><h6>mn</h6></mn></math></p>
+ <p>blockquote: <math><mi><blockquote>mi</blockquote></mi><mtext><blockquote>mi</blockquote></mtext><mn><blockquote>mn</blockquote></mn></math></p>
+
+ </body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/foreign-element-in-token.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmiexpectedmismatchhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mi-expected-mismatch.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mi-expected-mismatch.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mi-expected-mismatch.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mi</title>
- </head>
- <body>
-
- <math><mi></mi></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmihtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mi.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mi.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mi.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mi</title>
- </head>
- <body>
-
- <!-- The HTML-in-MathML span should be visible. -->
-
- <math><mi><span>HTML-in-MathML</span></mi></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmnexpectedmismatchhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mn-expected-mismatch.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mn-expected-mismatch.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mn-expected-mismatch.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mn</title>
- </head>
- <body>
-
- <math><mn></mn></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmnhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mn.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mn.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mn.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mn</title>
- </head>
- <body>
-
- <!-- The HTML-in-MathML span should be visible. -->
-
- <math><mn><span>HTML-in-MathML</span></mn></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmtextexpectedmismatchhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mtext-expected-mismatch.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mtext-expected-mismatch.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mtext-expected-mismatch.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mtext</title>
- </head>
- <body>
-
- <math><mtext></mtext></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmtextrejectedexpectedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected-expected.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected-expected.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected-expected.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mtext</title>
- </head>
- <body>
-
- _<math><mtext></mtext></math>_
-
- _<math><mtext></mtext></math>_
-
- _<math><mtext></mtext></math>_
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmtextrejectedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mtext-rejected.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,17 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mtext</title>
- </head>
- <body>
-
- <!-- These HTML-in-MathML elements are not phrasing content and should be rejected. -->
-
- _<math><mtext><p>HTML-in-MathML</p></mtext></math>_
-
- _<math><mtext><div>HTML-in-MathML</div></mtext></math>_
-
- _<math><mtext><blockquote>HTML-in-MathML</blockquote></mtext></math>_
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationforeignmtexthtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/foreign-mtext.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/foreign-mtext.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/foreign-mtext.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>Foreign content in mtext</title>
- </head>
- <body>
-
- <!-- The HTML-in-MathML span should be visible. -->
-
- <math><mtext><span>HTML-in-MathML</span></mtext></math>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationsemantics2html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/semantics-2.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-2.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/semantics-2.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -2,6 +2,13 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <title>Semantics</title>
</span><ins>+ <style type="text/css">
+ .nospacing {
+ border: 0 !important;
+ padding: 0 !important;
+ margin: 0 !important;
+ }
+ </style>
</ins><span class="cx"> </head>
</span><span class="cx">
</span><span class="cx"> <body>
</span><span class="lines">@@ -12,11 +19,11 @@
</span><span class="cx">
</span><span class="cx"> <!-- Presentation MathML: the child is displayed -->
</span><span class="cx"> <p>presentation MathML ; annotation: <math><semantics><mtext>presentation MathML</mtext><annotation>annotation</annotation></semantics></math></p>
</span><del>- <p>presentation MathML ; annotation-xml: <math><semantics><mtext>presentation MathML</mtext><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
</del><ins>+ <p>presentation MathML ; annotation-xml: <math><semantics><mtext>presentation MathML</mtext><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>annotation-xml</mtext></math></annotation-xml></semantics></math></p>
</ins><span class="cx">
</span><span class="cx"> <!-- Content MathML: the annotation is displayed -->
</span><span class="cx"> <p>content MathML ; annotation: <math><semantics><csymbol>content MathML</csymbol><annotation>annotation</annotation></semantics></math></p>
</span><del>- <p>content MathML ; annotation-xml: <math><semantics><csymbol>content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
</del><ins>+ <p>content MathML ; annotation-xml: <math><semantics><csymbol>content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>annotation-xml</mtext></math></annotation-xml></semantics></math></p>
</ins><span class="cx">
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationsemantics3html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/semantics-3.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-3.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/semantics-3.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -2,6 +2,13 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <title>Semantics</title>
</span><ins>+ <style type="text/css">
+ .nospacing {
+ border: 0 !important;
+ padding: 0 !important;
+ margin: 0 !important;
+ }
+ </style>
</ins><span class="cx"> </head>
</span><span class="cx">
</span><span class="cx"> <body>
</span><span class="lines">@@ -11,16 +18,16 @@
</span><span class="cx"> - An <annotation-xml> element without src attribute and with one of the encoding among "application/mathml-presentation+xml", "MathML-Presentation", "image/svg+xml", "SVG1.1", "application/xhtml+xml" and "text/html".
</span><span class="cx"> -->
</span><span class="cx">
</span><del>- <p>annotation 1: <math><semantics><csymbol>Content MathML</csymbol><annotation>annotation</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
- <p>annotation 2: <math><semantics><csymbol>Content MathML</csymbol><annotation encoding="application/x-tex">\sin x + 5</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
- <p>annotation 3: <math><semantics><csymbol>Content MathML</csymbol><annotation src="external-resource">error</annotation><annotation>annotation</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
</del><ins>+ <p>annotation 1: <math><semantics><csymbol>Content MathML</csymbol><annotation>annotation</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml></semantics></math></p>
+ <p>annotation 2: <math><semantics><csymbol>Content MathML</csymbol><annotation encoding="application/x-tex">\sin x + 5</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml></semantics></math></p>
+ <p>annotation 3: <math><semantics><csymbol>Content MathML</csymbol><annotation src="external-resource">error</annotation><annotation>annotation</annotation><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml></semantics></math></p>
</ins><span class="cx">
</span><del>- <p>annotation-xml 1: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>application/mathml-presentation+xml</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 2: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="MathML-Presentation"><mtext>MathML-Presentation</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 3: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><svg width="20px" height="20px"><rect width="20px" height="20px" fill="red" stroke="none"/></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 4: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="SVG1.1"><svg width="20px" height="20px"><rect width="20px" height="20px" fill="red" stroke="none"/></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 5: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/xhtml+xml"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>application/xhtml+xml</title></head><body><p>application/xhtml+xml</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></math></p>
- <p>annotation-xml 6: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><html><head><title>text/html</title></head><body><p>text/html</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 7: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="unknown"><mtext>error</mtext></annotation-xml><annotation-xml encoding="application/mathml+xml"><mtext>error</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
</del><ins>+ <p>annotation-xml 1: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>application/mathml-presentation+xml</mtext></math></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 2: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="MathML-Presentation"><math class="nospacing"><mtext>MathML-Presentation</mtext></math></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 3: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><svg width="20px" height="20px"><rect width="20px" height="20px" fill="red" stroke="none"/></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 4: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="SVG1.1"><svg width="20px" height="20px"><rect width="20px" height="20px" fill="red" stroke="none"/></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 5: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/xhtml+xml"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>application/xhtml+xml</title></head><body><p>application/xhtml+xml</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></math></p>
+ <p>annotation-xml 6: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><html><head><title>text/html</title></head><body><p>text/html</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 7: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="unknown"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation-xml encoding="application/mathml+xml"><math class="nospacing"><mtext>error</mtext></math></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><math class="nospacing"><mtext>annotation-xml</mtext></math></annotation-xml><annotation>error</annotation></semantics></math></p>
</ins><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationsemantics4html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/semantics-4.html (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-4.html        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/LayoutTests/mathml/presentation/semantics-4.html        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -2,13 +2,20 @@
</span><span class="cx"> <html>
</span><span class="cx"> <head>
</span><span class="cx"> <title>Semantics</title>
</span><ins>+ <style type="text/css">
+ .nospacing {
+ border: 0 !important;
+ padding: 0 !important;
+ margin: 0 !important;
+ }
+ </style>
</ins><span class="cx"> </head>
</span><span class="cx">
</span><span class="cx"> <body onload="document.getElementById('a').setAttribute('encoding', 'MathML-Presentation')">
</span><span class="cx">
</span><span class="cx"> <!-- This test verifies that setting the encoding dynamically updates the selected annotation. This should render the same as the static reference. -->
</span><span class="cx">
</span><del>- <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml id="a"><mtext>PASS</mtext></annotation-xml><annotation>FAIL</annotation></semantics></math></p>
</del><ins>+ <p><math><semantics><csymbol>Content MathML</csymbol><annotation-xml id="a"><math class="nospacing"><mtext>PASS</mtext></math></annotation-xml><annotation>FAIL</annotation></semantics></math></p>
</ins><span class="cx">
</span><span class="cx"> </body>
</span><span class="cx"> </html>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/ChangeLog        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-03-21 Frédéric Wang <fred.wang@free.fr>
+
+ Bug 130345 - Refine childShouldCreateRenderer for MathML elements
+ https://bugs.webkit.org/show_bug.cgi?id=130345
+
+ Reviewed by Chris Fleizach.
+
+ This is a follow-up of bug 124128. We add more restrictions on foreign
+ content of MathML elements.
+
+ Tests: mathml/presentation/annotation-children.html
+ mathml/presentation/foreign-element-in-token.html
+
+ * mathml/MathMLElement.cpp:
+ (WebCore::MathMLElement::isPresentationMathML): fix line wrapping
+ (WebCore::MathMLElement::isPhrasingContent):
+ - move the function from MathMLSelectElement.cpp
+ - add the constraint "is descendant of a map element" for area.
+ (WebCore::MathMLElement::isFlowContent): new function to test flow content.
+ (WebCore::MathMLElement::childShouldCreateRenderer):
+ - remove annotation since it is now tested in MathMLTextElement
+ - refine testing of annotation-xml
+ - do not create renderer for text content in MathML. Such content is only allowed inside token elements.
+ * mathml/MathMLElement.h: Declare isPhrasingContent and isFlowContent.
+ * mathml/MathMLSelectElement.cpp: Add new function to test MathML/SVG/HTML encodings.
+ (WebCore::MathMLSelectElement::isMathMLEncoding):
+ (WebCore::MathMLSelectElement::isSVGEncoding):
+ (WebCore::MathMLSelectElement::isHTMLEncoding):
+ (WebCore::MathMLSelectElement::getSelectedSemanticsChild): use the new functions.
+ * mathml/MathMLSelectElement.h: Declare the new public functions.
+ * mathml/MathMLTextElement.cpp: remove the isPhrasingContent function.
+ (WebCore::MathMLTextElement::childShouldCreateRenderer): Just in case, use the generic StyledElement::childShouldCreateRenderer.
+
</ins><span class="cx"> 2014-03-21 Darin Adler <darin@apple.com>
</span><span class="cx">
</span><span class="cx"> Stop using deprecatedCharacters in WebCore/platform/win
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.cpp        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -31,8 +31,15 @@
</span><span class="cx">
</span><span class="cx"> #include "MathMLElement.h"
</span><span class="cx">
</span><ins>+#include "ElementIterator.h"
+#include "HTMLElement.h"
+#include "HTMLMapElement.h"
+#include "HTMLNames.h"
</ins><span class="cx"> #include "MathMLNames.h"
</span><ins>+#include "MathMLSelectElement.h"
</ins><span class="cx"> #include "RenderTableCell.h"
</span><ins>+#include "SVGElement.h"
+#include "SVGNames.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -50,9 +57,142 @@
</span><span class="cx">
</span><span class="cx"> bool MathMLElement::isPresentationMathML() const
</span><span class="cx"> {
</span><del>- return hasTagName(MathMLNames::mtrTag) || hasTagName(MathMLNames::mtdTag) || hasTagName(MathMLNames::maligngroupTag) || hasTagName(MathMLNames::malignmarkTag) || hasTagName(MathMLNames::mencloseTag) || hasTagName(MathMLNames::mglyphTag) || hasTagName(MathMLNames::mlabeledtrTag) || hasTagName(MathMLNames::mlongdivTag) || hasTagName(MathMLNames::mpaddedTag) || hasTagName(MathMLNames::msTag) || hasTagName(MathMLNames::mscarriesTag) || hasTagName(MathMLNames::mscarryTag) || hasTagName(MathMLNames::msgroupTag) || hasTagName(MathMLNames::mslineTag) || hasTagName(MathMLNames::msrowTag) || hasTagName(MathMLNames::mstackTag);
</del><ins>+ return hasTagName(MathMLNames::mtrTag)
+ || hasTagName(MathMLNames::mtdTag)
+ || hasTagName(MathMLNames::maligngroupTag)
+ || hasTagName(MathMLNames::malignmarkTag)
+ || hasTagName(MathMLNames::mencloseTag)
+ || hasTagName(MathMLNames::mglyphTag)
+ || hasTagName(MathMLNames::mlabeledtrTag)
+ || hasTagName(MathMLNames::mlongdivTag)
+ || hasTagName(MathMLNames::mpaddedTag)
+ || hasTagName(MathMLNames::msTag)
+ || hasTagName(MathMLNames::mscarriesTag)
+ || hasTagName(MathMLNames::mscarryTag)
+ || hasTagName(MathMLNames::msgroupTag)
+ || hasTagName(MathMLNames::mslineTag)
+ || hasTagName(MathMLNames::msrowTag)
+ || hasTagName(MathMLNames::mstackTag);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+bool MathMLElement::isPhrasingContent(const Node& node) const
+{
+ // Phrasing content is described in the HTML 5 specification:
+ // http://www.w3.org/TR/html5/dom.html#phrasing-content.
+
+ if (!node.isElementNode())
+ return node.isTextNode();
+
+ if (node.isMathMLElement()) {
+ auto& mathmlElement = toMathMLElement(node);
+ return mathmlElement.hasTagName(MathMLNames::mathTag);
+ }
+
+ if (node.isSVGElement()) {
+ auto& svgElement = toSVGElement(node);
+ return svgElement.hasTagName(SVGNames::svgTag);
+ }
+
+ if (node.isHTMLElement()) {
+ // FIXME: add the <data> and <time> tags when they are implemented.
+ auto& htmlElement = toHTMLElement(node);
+ return htmlElement.hasTagName(HTMLNames::aTag)
+ || htmlElement.hasTagName(HTMLNames::abbrTag)
+ || (htmlElement.hasTagName(HTMLNames::areaTag) && ancestorsOfType<HTMLMapElement>(htmlElement).first())
+ || htmlElement.hasTagName(HTMLNames::audioTag)
+ || htmlElement.hasTagName(HTMLNames::bTag)
+ || htmlElement.hasTagName(HTMLNames::bdiTag)
+ || htmlElement.hasTagName(HTMLNames::bdoTag)
+ || htmlElement.hasTagName(HTMLNames::brTag)
+ || htmlElement.hasTagName(HTMLNames::buttonTag)
+ || htmlElement.hasTagName(HTMLNames::canvasTag)
+ || htmlElement.hasTagName(HTMLNames::citeTag)
+ || htmlElement.hasTagName(HTMLNames::codeTag)
+ || htmlElement.hasTagName(HTMLNames::datalistTag)
+ || htmlElement.hasTagName(HTMLNames::delTag)
+ || htmlElement.hasTagName(HTMLNames::dfnTag)
+ || htmlElement.hasTagName(HTMLNames::emTag)
+ || htmlElement.hasTagName(HTMLNames::embedTag)
+ || htmlElement.hasTagName(HTMLNames::iTag)
+ || htmlElement.hasTagName(HTMLNames::iframeTag)
+ || htmlElement.hasTagName(HTMLNames::imgTag)
+ || htmlElement.hasTagName(HTMLNames::inputTag)
+ || htmlElement.hasTagName(HTMLNames::insTag)
+ || htmlElement.hasTagName(HTMLNames::kbdTag)
+ || htmlElement.hasTagName(HTMLNames::keygenTag)
+ || htmlElement.hasTagName(HTMLNames::labelTag)
+ || htmlElement.hasTagName(HTMLNames::mapTag)
+ || htmlElement.hasTagName(HTMLNames::markTag)
+ || htmlElement.hasTagName(HTMLNames::meterTag)
+ || htmlElement.hasTagName(HTMLNames::noscriptTag)
+ || htmlElement.hasTagName(HTMLNames::objectTag)
+ || htmlElement.hasTagName(HTMLNames::outputTag)
+ || htmlElement.hasTagName(HTMLNames::progressTag)
+ || htmlElement.hasTagName(HTMLNames::qTag)
+ || htmlElement.hasTagName(HTMLNames::rubyTag)
+ || htmlElement.hasTagName(HTMLNames::sTag)
+ || htmlElement.hasTagName(HTMLNames::sampTag)
+ || htmlElement.hasTagName(HTMLNames::scriptTag)
+ || htmlElement.hasTagName(HTMLNames::selectTag)
+ || htmlElement.hasTagName(HTMLNames::smallTag)
+ || htmlElement.hasTagName(HTMLNames::spanTag)
+ || htmlElement.hasTagName(HTMLNames::strongTag)
+ || htmlElement.hasTagName(HTMLNames::subTag)
+ || htmlElement.hasTagName(HTMLNames::supTag)
+ || htmlElement.hasTagName(HTMLNames::templateTag)
+ || htmlElement.hasTagName(HTMLNames::textareaTag)
+ || htmlElement.hasTagName(HTMLNames::uTag)
+ || htmlElement.hasTagName(HTMLNames::varTag)
+ || htmlElement.hasTagName(HTMLNames::videoTag)
+ || htmlElement.hasTagName(HTMLNames::wbrTag);
+ }
+
+ return false;
+}
+
+bool MathMLElement::isFlowContent(const Node& node) const
+{
+ // Flow content is described in the HTML 5 specification:
+ // http://www.w3.org/TR/html5/dom.html#flow-content
+
+ if (isPhrasingContent(node))
+ return true;
+
+ if (!node.isHTMLElement())
+ return false;
+
+ auto& htmlElement = toHTMLElement(node);
+ // FIXME add the <dialog> tag when it is implemented.
+ return htmlElement.hasTagName(HTMLNames::addressTag)
+ || htmlElement.hasTagName(HTMLNames::articleTag)
+ || htmlElement.hasTagName(HTMLNames::asideTag)
+ || htmlElement.hasTagName(HTMLNames::blockquoteTag)
+ || htmlElement.hasTagName(HTMLNames::detailsTag)
+ || htmlElement.hasTagName(HTMLNames::divTag)
+ || htmlElement.hasTagName(HTMLNames::dlTag)
+ || htmlElement.hasTagName(HTMLNames::fieldsetTag)
+ || htmlElement.hasTagName(HTMLNames::figureTag)
+ || htmlElement.hasTagName(HTMLNames::footerTag)
+ || htmlElement.hasTagName(HTMLNames::formTag)
+ || htmlElement.hasTagName(HTMLNames::h1Tag)
+ || htmlElement.hasTagName(HTMLNames::h2Tag)
+ || htmlElement.hasTagName(HTMLNames::h3Tag)
+ || htmlElement.hasTagName(HTMLNames::h4Tag)
+ || htmlElement.hasTagName(HTMLNames::h5Tag)
+ || htmlElement.hasTagName(HTMLNames::h6Tag)
+ || htmlElement.hasTagName(HTMLNames::headerTag)
+ || htmlElement.hasTagName(HTMLNames::hrTag)
+ || htmlElement.hasTagName(HTMLNames::mainTag)
+ || htmlElement.hasTagName(HTMLNames::navTag)
+ || htmlElement.hasTagName(HTMLNames::olTag)
+ || htmlElement.hasTagName(HTMLNames::pTag)
+ || htmlElement.hasTagName(HTMLNames::preTag)
+ || htmlElement.hasTagName(HTMLNames::sectionTag)
+ || (htmlElement.hasTagName(HTMLNames::styleTag) && htmlElement.hasAttribute("scoped"))
+ || htmlElement.hasTagName(HTMLNames::tableTag)
+ || htmlElement.hasTagName(HTMLNames::ulTag);
+}
+
</ins><span class="cx"> int MathMLElement::colSpan() const
</span><span class="cx"> {
</span><span class="cx"> if (!hasTagName(mtdTag))
</span><span class="lines">@@ -123,13 +263,31 @@
</span><span class="cx">
</span><span class="cx"> bool MathMLElement::childShouldCreateRenderer(const Node& child) const
</span><span class="cx"> {
</span><del>- if (hasTagName(annotationTag))
- return child.isTextNode();
- if (hasTagName(annotation_xmlTag))
- return StyledElement::childShouldCreateRenderer(child);
</del><ins>+ if (hasTagName(annotation_xmlTag)) {
+ const AtomicString& value = fastGetAttribute(MathMLNames::encodingAttr);
</ins><span class="cx">
</span><del>- // Only create renderers for MathML elements or text. MathML prohibits non-MathML markup inside a <math> element.
- return child.isTextNode() || child.isMathMLElement();
</del><ins>+ // See annotation-xml.model.mathml, annotation-xml.model.svg and annotation-xml.model.xhtml in the HTML5 RelaxNG schema.
+
+ if (child.isMathMLElement() && (MathMLSelectElement::isMathMLEncoding(value) || MathMLSelectElement::isHTMLEncoding(value))) {
+ auto& mathmlElement = toMathMLElement(child);
+ return mathmlElement.hasTagName(MathMLNames::mathTag);
+ }
+
+ if (child.isSVGElement() && (MathMLSelectElement::isSVGEncoding(value) || MathMLSelectElement::isHTMLEncoding(value))) {
+ auto& svgElement = toSVGElement(child);
+ return svgElement.hasTagName(SVGNames::svgTag);
+ }
+
+ if (child.isHTMLElement() && MathMLSelectElement::isHTMLEncoding(value)) {
+ auto& htmlElement = toHTMLElement(child);
+ return htmlElement.hasTagName(HTMLNames::htmlTag) || (isFlowContent(htmlElement) && StyledElement::childShouldCreateRenderer(child));
+ }
+
+ return false;
+ }
+
+ // In general, only MathML children are allowed. Text nodes are only visible in token MathML elements.
+ return child.isMathMLElement();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MathMLElement::attributeChanged(const QualifiedName& name, const AtomicString& oldValue, const AtomicString& newValue, AttributeModificationReason reason)
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -66,6 +66,9 @@
</span><span class="cx"> virtual bool isPresentationAttribute(const QualifiedName&) const override;
</span><span class="cx"> virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
</span><span class="cx">
</span><ins>+ bool isPhrasingContent(const Node&) const;
+ bool isFlowContent(const Node&) const;
+
</ins><span class="cx"> private:
</span><span class="cx"> virtual void updateSelectedChild() { }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -29,8 +29,12 @@
</span><span class="cx"> #if ENABLE(MATHML)
</span><span class="cx">
</span><span class="cx"> #include "Event.h"
</span><ins>+#include "HTMLElement.h"
+#include "HTMLNames.h"
</ins><span class="cx"> #include "MathMLNames.h"
</span><span class="cx"> #include "RenderMathMLRow.h"
</span><ins>+#include "SVGElement.h"
+#include "SVGNames.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -52,6 +56,29 @@
</span><span class="cx"> return createRenderer<RenderMathMLRow>(*this, std::move(style));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// We recognize the following values for the encoding attribute of the <semantics> element:
+//
+// - "MathML-Presentation", which is mentioned in the MathML 3 recommendation.
+// - "SVG1.1" which is mentioned in the W3C note.
+// http://www.w3.org/Math/Documents/Notes/graphics.xml
+// - Other MIME Content-Types for MathML, SVG and HTML.
+//
+// We exclude "application/mathml+xml" which is ambiguous about whether it is Presentation or Content MathML. Authors must use a more explicit encoding value.
+bool MathMLSelectElement::isMathMLEncoding(const AtomicString& value)
+{
+ return value == "application/mathml-presentation+xml" || value == "MathML-Presentation";
+}
+
+bool MathMLSelectElement::isSVGEncoding(const AtomicString& value)
+{
+ return value == "image/svg+xml" || value == "SVG1.1";
+}
+
+bool MathMLSelectElement::isHTMLEncoding(const AtomicString& value)
+{
+ return value == "application/xhtml+xml" || value == "text/html";
+}
+
</ins><span class="cx"> bool MathMLSelectElement::childShouldCreateRenderer(const Node& child) const
</span><span class="cx"> {
</span><span class="cx"> return MathMLElement::childShouldCreateRenderer(child) && m_selectedChild == &child;
</span><span class="lines">@@ -155,16 +182,9 @@
</span><span class="cx"> // If the <annotation-xml> element has an src attribute then it is a reference to arbitrary binary data and it is not clear whether we can display it. Hence we just ignore the annotation.
</span><span class="cx"> if (child->hasAttribute(MathMLNames::srcAttr))
</span><span class="cx"> continue;
</span><del>- // If the <annotation-xml> element has an encoding attribute describing presentation MathML, SVG or HTML we assume the content can be displayed and we stop here. We recognize the following encoding values:
- //
- // - "MathML-Presentation", which is mentioned in the MathML 3 recommendation.
- // - "SVG1.1" which is mentioned in the W3C note.
- // http://www.w3.org/Math/Documents/Notes/graphics.xml
- // - Other MIME Content-Types for SVG and HTML.
- //
- // We exclude "application/mathml+xml" which is ambiguous about whether it is Presentation or Content MathML. Authors must use a more explicit encoding value.
</del><ins>+ // If the <annotation-xml> element has an encoding attribute describing presentation MathML, SVG or HTML we assume the content can be displayed and we stop here.
</ins><span class="cx"> const AtomicString& value = child->fastGetAttribute(MathMLNames::encodingAttr);
</span><del>- if (value == "application/mathml-presentation+xml" || value == "MathML-Presentation" || value == "image/svg+xml" || value == "SVG1.1" || value == "application/xhtml+xml" || value == "text/html")
</del><ins>+ if (isMathMLEncoding(value) || isSVGEncoding(value) || isHTMLEncoding(value))
</ins><span class="cx"> return child;
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.h (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.h        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.h        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -34,6 +34,9 @@
</span><span class="cx"> class MathMLSelectElement final : public MathMLInlineContainerElement {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<MathMLSelectElement> create(const QualifiedName& tagName, Document&);
</span><ins>+ static bool isMathMLEncoding(const AtomicString& value);
+ static bool isSVGEncoding(const AtomicString& value);
+ static bool isHTMLEncoding(const AtomicString& value);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> MathMLSelectElement(const QualifiedName& tagName, Document&);
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (166064 => 166065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-03-21 16:04:31 UTC (rev 166064)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-03-21 16:19:36 UTC (rev 166065)
</span><span class="lines">@@ -30,14 +30,10 @@
</span><span class="cx">
</span><span class="cx"> #include "MathMLTextElement.h"
</span><span class="cx">
</span><del>-#include "HTMLElement.h"
-#include "HTMLNames.h"
</del><span class="cx"> #include "MathMLNames.h"
</span><span class="cx"> #include "RenderMathMLOperator.h"
</span><span class="cx"> #include "RenderMathMLSpace.h"
</span><span class="cx"> #include "RenderMathMLToken.h"
</span><del>-#include "SVGElement.h"
-#include "SVGNames.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -82,83 +78,6 @@
</span><span class="cx"> return createRenderer<RenderMathMLToken>(*this, std::move(style));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isPhrasingContent(const Node& node)
-{
- // Phrasing content is described in the HTML 5 specification:
- // http://www.w3.org/TR/html5/dom.html#phrasing-content.
-
- if (!node.isElementNode())
- return node.isTextNode();
-
- auto& element = toElement(node);
-
- if (element.isMathMLElement()) {
- auto& mathmlElement = toMathMLElement(element);
- return mathmlElement.hasTagName(MathMLNames::mathTag);
- }
-
- if (element.isSVGElement()) {
- auto& svgElement = toSVGElement(element);
- return svgElement.hasTagName(SVGNames::svgTag);
- }
-
- if (element.isHTMLElement()) {
- // FIXME: add the <data> and <time> tags when they are implemented.
- auto& htmlElement = toHTMLElement(element);
- return htmlElement.hasTagName(HTMLNames::aTag)
- || htmlElement.hasTagName(HTMLNames::abbrTag)
- || htmlElement.hasTagName(HTMLNames::areaTag)
- || htmlElement.hasTagName(HTMLNames::audioTag)
- || htmlElement.hasTagName(HTMLNames::bTag)
- || htmlElement.hasTagName(HTMLNames::bdiTag)
- || htmlElement.hasTagName(HTMLNames::bdoTag)
- || htmlElement.hasTagName(HTMLNames::brTag)
- || htmlElement.hasTagName(HTMLNames::buttonTag)
- || htmlElement.hasTagName(HTMLNames::canvasTag)
- || htmlElement.hasTagName(HTMLNames::citeTag)
- || htmlElement.hasTagName(HTMLNames::codeTag)
- || htmlElement.hasTagName(HTMLNames::datalistTag)
- || htmlElement.hasTagName(HTMLNames::delTag)
- || htmlElement.hasTagName(HTMLNames::dfnTag)
- || htmlElement.hasTagName(HTMLNames::emTag)
- || htmlElement.hasTagName(HTMLNames::embedTag)
- || htmlElement.hasTagName(HTMLNames::iTag)
- || htmlElement.hasTagName(HTMLNames::iframeTag)
- || htmlElement.hasTagName(HTMLNames::imgTag)
- || htmlElement.hasTagName(HTMLNames::inputTag)
- || htmlElement.hasTagName(HTMLNames::insTag)
- || htmlElement.hasTagName(HTMLNames::kbdTag)
- || htmlElement.hasTagName(HTMLNames::keygenTag)
- || htmlElement.hasTagName(HTMLNames::labelTag)
- || htmlElement.hasTagName(HTMLNames::mapTag)
- || htmlElement.hasTagName(HTMLNames::markTag)
- || htmlElement.hasTagName(HTMLNames::meterTag)
- || htmlElement.hasTagName(HTMLNames::noscriptTag)
- || htmlElement.hasTagName(HTMLNames::objectTag)
- || htmlElement.hasTagName(HTMLNames::outputTag)
- || htmlElement.hasTagName(HTMLNames::progressTag)
- || htmlElement.hasTagName(HTMLNames::qTag)
- || htmlElement.hasTagName(HTMLNames::rubyTag)
- || htmlElement.hasTagName(HTMLNames::sTag)
- || htmlElement.hasTagName(HTMLNames::sampTag)
- || htmlElement.hasTagName(HTMLNames::scriptTag)
- || htmlElement.hasTagName(HTMLNames::selectTag)
- || htmlElement.hasTagName(HTMLNames::smallTag)
- || htmlElement.hasTagName(HTMLNames::spanTag)
- || htmlElement.hasTagName(HTMLNames::strongTag)
- || htmlElement.hasTagName(HTMLNames::subTag)
- || htmlElement.hasTagName(HTMLNames::supTag)
- || htmlElement.hasTagName(HTMLNames::templateTag)
- || htmlElement.hasTagName(HTMLNames::textareaTag)
- || htmlElement.hasTagName(HTMLNames::uTag)
- || htmlElement.hasTagName(HTMLNames::varTag)
- || htmlElement.hasTagName(HTMLNames::videoTag)
- || htmlElement.hasTagName(HTMLNames::wbrTag);
- }
-
- return false;
-}
-
</del><span class="cx"> bool MathMLTextElement::childShouldCreateRenderer(const Node& child) const
</span><span class="cx"> {
</span><span class="cx"> if (hasTagName(MathMLNames::mspaceTag))
</span><span class="lines">@@ -169,7 +88,7 @@
</span><span class="cx"> return child.isTextNode();
</span><span class="cx">
</span><span class="cx"> // The HTML specification defines <mi>, <mo>, <mn>, <ms> and <mtext> as insertion points.
</span><del>- return isPhrasingContent(child);
</del><ins>+ return isPhrasingContent(child) && StyledElement::childShouldCreateRenderer(child);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>