<!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>[163553] 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/163553">163553</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-06 12:00:20 -0800 (Thu, 06 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Do not draw multi-characters &lt;mi&gt; in italic.
https://bugs.webkit.org/show_bug.cgi?id=44208

Patch by Frédéric Wang &lt;fred.wang@free.fr&gt; on 2014-02-06
Reviewed by Chris Fleizach.

Source/WebCore:

This test prevents multi-char &lt;mi&gt; to be drawn in italic and prepare
further improvements to MathML token and mfenced elements (bugs 124838
and bug 99620).

Test: mathml/presentation/tokenElements-dynamic.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/mathml.css:
(mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose):
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::didAttachRenderers):
(WebCore::MathMLTextElement::childrenChanged):
(WebCore::MathMLTextElement::createElementRenderer):
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderMathMLToken):
* rendering/mathml/RenderMathMLToken.cpp: Added.
(WebCore::RenderMathMLToken::RenderMathMLToken):
(WebCore::RenderMathMLToken::addChild):
(WebCore::RenderMathMLToken::createWrapperIfNeeded):
(WebCore::RenderMathMLToken::updateTokenContent):
(WebCore::RenderMathMLToken::updateStyle):
(WebCore::RenderMathMLToken::styleDidChange):
(WebCore::RenderMathMLToken::updateFromElement):
* rendering/mathml/RenderMathMLToken.h: Added.
(WebCore::RenderMathMLToken::element):
(WebCore::RenderMathMLToken&gt;):

LayoutTests:

Add tests for single-char/multi-char &lt;mi&gt; elements, the mathvariant
attribute and MathML token elements dynamically modified.

* mathml/presentation/attributes-mathvariant-expected.html:
* mathml/presentation/attributes-mathvariant.html:
* mathml/presentation/tokenElements-dynamic-expected.html: Added.
* mathml/presentation/tokenElements-dynamic.html: Added.
* mathml/presentation/tokenElements-mathvariant-expected.html:
* mathml/presentation/tokenElements-mathvariant.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationattributesmathvariantexpectedhtml">trunk/LayoutTests/mathml/presentation/attributes-mathvariant-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationattributesmathvarianthtml">trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationtokenElementsmathvariantexpectedhtml">trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationtokenElementsmathvarianthtml">trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant.html</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssmathmlcss">trunk/Source/WebCore/css/mathml.css</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementcpp">trunk/Source/WebCore/mathml/MathMLTextElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderObjecth">trunk/Source/WebCore/rendering/RenderObject.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationtokenElementsdynamicexpectedhtml">trunk/LayoutTests/mathml/presentation/tokenElements-dynamic-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationtokenElementsdynamichtml">trunk/LayoutTests/mathml/presentation/tokenElements-dynamic.html</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLTokenh">trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/LayoutTests/ChangeLog        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-02-06  Frédéric Wang  &lt;fred.wang@free.fr&gt;
+
+        Do not draw multi-characters &lt;mi&gt; in italic.
+        https://bugs.webkit.org/show_bug.cgi?id=44208
+
+        Reviewed by Chris Fleizach.
+
+        Add tests for single-char/multi-char &lt;mi&gt; elements, the mathvariant
+        attribute and MathML token elements dynamically modified.
+
+        * mathml/presentation/attributes-mathvariant-expected.html:
+        * mathml/presentation/attributes-mathvariant.html:
+        * mathml/presentation/tokenElements-dynamic-expected.html: Added.
+        * mathml/presentation/tokenElements-dynamic.html: Added.
+        * mathml/presentation/tokenElements-mathvariant-expected.html:
+        * mathml/presentation/tokenElements-mathvariant.html:
+
</ins><span class="cx"> 2014-02-06  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix a copy/paste mistake in TestExpectations.
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationattributesmathvariantexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/attributes-mathvariant-expected.html (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/attributes-mathvariant-expected.html        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/LayoutTests/mathml/presentation/attributes-mathvariant-expected.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -15,12 +15,21 @@
</span><span class="cx">          implementation relies on CSS style instead. See also bug 108778.
</span><span class="cx">       --&gt;
</span><span class="cx">     &lt;div&gt;
</span><ins>+      &lt;!-- FIXME: we add new lines to workaround a width/spacing bug. --&gt;
</ins><span class="cx">       &lt;math&gt;
</span><del>-        &lt;mi style=&quot;font-style: normal;&quot;&gt;A&lt;/mi&gt;
-        &lt;mi style=&quot;font-style: italic;&quot;&gt;A&lt;/mi&gt;
</del><ins>+        &lt;mtext style=&quot;font-style: normal;&quot;&gt;A&lt;/mtext&gt;
+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
</ins><span class="cx">         &lt;mtext style=&quot;font-style: italic;&quot;&gt;A&lt;/mtext&gt;
</span><del>-        &lt;mi style=&quot;font-style: normal; font-weight: bold;&quot;&gt;A&lt;/mi&gt;
-        &lt;mi style=&quot;font-weight: bold; font-style: italic;&quot;&gt;A&lt;/mi&gt;
</del><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
+        &lt;mtext style=&quot;font-style: italic;&quot;&gt;A&lt;/mtext&gt;
+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
+        &lt;mtext style=&quot;font-weight: bold;&quot;&gt;A&lt;/mtext&gt;
+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
+        &lt;mtext style=&quot;font-weight: bold; font-style: italic;&quot;&gt;A&lt;/mtext&gt;
</ins><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationattributesmathvarianthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -11,9 +11,17 @@
</span><span class="cx">     &lt;div&gt;
</span><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mi mathvariant=&quot;normal&quot;&gt;A&lt;/mi&gt;
</span><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
</ins><span class="cx">         &lt;mi&gt;A&lt;/mi&gt;
</span><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
</ins><span class="cx">         &lt;mtext mathvariant=&quot;italic&quot;&gt;A&lt;/mtext&gt;
</span><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
</ins><span class="cx">         &lt;mi mathvariant=&quot;bold&quot;&gt;A&lt;/mi&gt;
</span><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
</ins><span class="cx">         &lt;mi mathvariant=&quot;bold-italic&quot;&gt;A&lt;/mi&gt;
</span><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/div&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationtokenElementsdynamicexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/tokenElements-dynamic-expected.html (0 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/tokenElements-dynamic-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/tokenElements-dynamic-expected.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;Token elements - dynamic changes&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;/&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+      #styled &gt; mo { color: red; }
+      #styled &gt; mi { color: green; }
+      #styled &gt; mi ~ * { color: blue; }
+    &lt;/style&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+
+    &lt;!-- Test 1 --&gt;
+    &lt;p style=&quot;display: none;&quot;&gt;
+      &lt;math&gt;&lt;mi&gt;sin&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;cos&lt;/mi&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;tan&lt;/mi&gt;&lt;mi&gt;z&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 2 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;−&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;msqrt&gt;&lt;mfrac&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mfrac&gt;&lt;/msqrt&gt;&lt;mo&gt;]&lt;/mo&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 3 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mi mathvariant=&quot;bold&quot;&gt;x&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi mathvariant=&quot;italic&quot;&gt;sin&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;sin&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 4 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mo stretchy=&quot;false&quot;&gt;{&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+    &lt;/p&gt;
+    
+    &lt;!-- Test 5 --&gt;
+    &lt;p&gt;
+      &lt;math id=&quot;styled&quot;&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;sin&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationtokenElementsdynamichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/tokenElements-dynamic.html (0 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/tokenElements-dynamic.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/tokenElements-dynamic.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -0,0 +1,100 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;Token elements - dynamic changes&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;/&gt;
+    &lt;style type=&quot;text/css&quot;&gt;
+      #styled &gt; mo { color: red; }
+      #styled &gt; mi { color: green; }
+      #styled &gt; mi ~ * { color: blue; }
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+      function newText(t)
+      {
+        return document.createTextNode(t); 
+      }
+
+      function test()
+      {
+        var mi = document.getElementsByTagName(&quot;mi&quot;);
+        var mo = document.getElementsByTagName(&quot;mo&quot;);
+
+        // Test 1
+        mi[0].textContent = &quot;sin&quot;;
+        mi[1].textContent = &quot;x&quot;;
+        mi[2].appendChild(newText(&quot;cos&quot;));
+        mi[3].appendChild(newText(&quot;y&quot;));
+        mi[4].textContent = &quot;a&quot;;
+        mi[4].insertBefore(newText(&quot;t&quot;), mi[4].firstChild);
+        mi[4].appendChild(newText(&quot;n&quot;));
+        mi[5].appendChild(newText(&quot;oo&quot;));
+        mi[5].insertBefore(newText(&quot;z&quot;), mi[5].firstChild);
+        mi[5].removeChild(mi[5].lastChild);
+
+        // Test 2
+        mo[0].textContent = &quot;+&quot;;
+        mo[1].appendChild(newText(&quot;-&quot;));
+        mo[2].textContent = &quot;(&quot;;
+        mo[3].appendChild(newText(&quot;]&quot;));
+        mo[4].appendChild(newText(&quot;-&quot;));
+        mo[4].insertBefore(newText(&quot;+&quot;), mo[4].firstChild);
+        mo[4].removeChild(mo[4].lastChild);
+        mo[5].appendChild(newText(&quot;|&quot;));
+        mo[5].appendChild(newText(&quot;{&quot;));
+        mo[5].removeChild(mo[5].firstChild);
+
+        // Test 3
+        mi[6].setAttribute(&quot;mathvariant&quot;, &quot;bold&quot;);
+        mi[7].setAttribute(&quot;mathvariant&quot;, &quot;italic&quot;);
+        mi[8].removeAttribute(&quot;mathvariant&quot;);
+        mi[9].removeAttribute(&quot;mathvariant&quot;);
+
+        // Test 4
+        mo[6].setAttribute(&quot;stretchy&quot;, &quot;false&quot;);
+        mo[7].removeAttribute(&quot;stretchy&quot;);
+
+        // Test 5
+        document.getElementById(&quot;unstyled&quot;).setAttribute(&quot;id&quot;, &quot;styled&quot;);
+      }
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload=&quot;test()&quot;&gt;
+
+    &lt;!-- These tests perform dynamic changes on mi and mo token elements. They should render the same as the static reference. --&gt;
+
+    &lt;!-- Test 1 --&gt;
+    &lt;!-- FIXME: single-char &lt;mi&gt; should be italic. --&gt;
+    &lt;p style=&quot;display: none;&quot;&gt;
+      &lt;math&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mi&gt;&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mi&gt;&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;&lt;/mi&gt;&lt;mi&gt;&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 2 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;mo&gt;&lt;/mo&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;mo&gt;&lt;/mo&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo&gt;&lt;/mo&gt;&lt;msqrt&gt;&lt;mfrac&gt;&lt;mn&gt;4&lt;/mn&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mfrac&gt;&lt;/msqrt&gt;&lt;mo&gt;&lt;/mo&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo&gt;&lt;/mo&gt;&lt;mo&gt;&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 3 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi&gt;sin&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi mathvariant=&quot;bold&quot;&gt;x&lt;/mi&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mi mathvariant=&quot;italic&quot;&gt;sin&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+    &lt;!-- Test 4 --&gt;
+    &lt;p&gt;
+      &lt;math&gt;&lt;mo&gt;{&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+      &lt;math&gt;&lt;mo stretchy=&quot;false&quot;&gt;{&lt;/mo&gt;&lt;mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;6&lt;/mn&gt;&lt;mn&gt;7&lt;/mn&gt;&lt;/mfrac&gt;&lt;mfrac&gt;&lt;mn&gt;8&lt;/mn&gt;&lt;mn&gt;9&lt;/mn&gt;&lt;/mfrac&gt;&lt;/mfrac&gt;&lt;/math&gt;
+    &lt;/p&gt;    
+
+    &lt;!-- Test 5 --&gt;
+    &lt;p&gt;
+      &lt;math id=&quot;unstyled&quot;&gt;&lt;mo&gt;-&lt;/mo&gt;&lt;mi&gt;sin&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/math&gt;
+    &lt;/p&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationtokenElementsmathvariantexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant-expected.html (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant-expected.html        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant-expected.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -11,11 +11,17 @@
</span><span class="cx">         &lt;mo style=&quot;font-style: normal; font-weight: normal;&quot;&gt;&amp;#x2207;&lt;/mo&gt;
</span><span class="cx">         &lt;mtext style=&quot;font-style: normal; font-weight: normal;&quot;&gt;text&lt;/mtext&gt;
</span><span class="cx">         &lt;ms style=&quot;font-style: normal; font-weight: normal;&quot;&gt;&amp;amp;&lt;/ms&gt;
</span><ins>+        &lt;mtext style=&quot;font-style: normal; font-weight: normal;&quot;&gt;sin&lt;/mtext&gt;
</ins><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p&gt;Following element should be in italic: 
</del><ins>+    &lt;p&gt;Following elements should be in italic:
</ins><span class="cx">       &lt;math&gt;
</span><del>-        &lt;mi style=&quot;font-style: italic;&quot;&gt;x&lt;/mi&gt;
</del><ins>+        &lt;mtext style=&quot;font-style: italic; font-weight: normal;&quot;&gt;x&lt;/mtext&gt;
+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
+        &lt;!-- FIXME: the whitespace should be removed in the reference when
+             bug 125628 is fixed. --&gt;
+        &lt;mtext style=&quot;font-style: italic; font-weight: normal;&quot;&gt;&amp;#x20;&amp;#x9;&amp;#xD;&amp;#xA;x&amp;#x20;&amp;#x9;&amp;#xD;&amp;#xA;&lt;/mtext&gt;
</ins><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><span class="cx">   &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationtokenElementsmathvarianthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant.html (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant.html        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant.html        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -11,11 +11,16 @@
</span><span class="cx">         &lt;mo&gt;&amp;#x2207;&lt;/mo&gt;
</span><span class="cx">         &lt;mtext&gt;text&lt;/mtext&gt;
</span><span class="cx">         &lt;ms&gt;&amp;amp;&lt;/ms&gt;
</span><ins>+        &lt;mi&gt;sin&lt;/mi&gt;
</ins><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><del>-    &lt;p&gt;Following element should be in italic: 
</del><ins>+    &lt;p&gt;Following elements should be in italic: 
+      &lt;!-- FIXME: we add a new line to workaround a width/spacing bug. --&gt;
</ins><span class="cx">       &lt;math&gt;
</span><span class="cx">         &lt;mi&gt;x&lt;/mi&gt;
</span><ins>+      &lt;/math&gt;&lt;br/&gt;
+      &lt;math&gt;
+        &lt;mi&gt;&amp;#x20;&amp;#x9;&amp;#xD;&amp;#xA;x&amp;#x20;&amp;#x9;&amp;#xD;&amp;#xA;&lt;/mi&gt;
</ins><span class="cx">       &lt;/math&gt;
</span><span class="cx">     &lt;/p&gt;
</span><span class="cx">   &lt;/body&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -2220,6 +2220,7 @@
</span><span class="cx">     rendering/mathml/RenderMathMLScripts.cpp
</span><span class="cx">     rendering/mathml/RenderMathMLSpace.cpp
</span><span class="cx">     rendering/mathml/RenderMathMLSquareRoot.cpp
</span><ins>+    rendering/mathml/RenderMathMLToken.cpp
</ins><span class="cx">     rendering/mathml/RenderMathMLUnderOver.cpp
</span><span class="cx"> 
</span><span class="cx">     rendering/shapes/BoxShape.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/ChangeLog        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-02-06  Frédéric Wang  &lt;fred.wang@free.fr&gt;
+
+        Do not draw multi-characters &lt;mi&gt; in italic.
+        https://bugs.webkit.org/show_bug.cgi?id=44208
+
+        Reviewed by Chris Fleizach.
+
+        This test prevents multi-char &lt;mi&gt; to be drawn in italic and prepare
+        further improvements to MathML token and mfenced elements (bugs 124838
+        and bug 99620).
+
+        Test: mathml/presentation/tokenElements-dynamic.html
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/mathml.css:
+        (mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose):
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::didAttachRenderers):
+        (WebCore::MathMLTextElement::childrenChanged):
+        (WebCore::MathMLTextElement::createElementRenderer):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isRenderMathMLToken):
+        * rendering/mathml/RenderMathMLToken.cpp: Added.
+        (WebCore::RenderMathMLToken::RenderMathMLToken):
+        (WebCore::RenderMathMLToken::addChild):
+        (WebCore::RenderMathMLToken::createWrapperIfNeeded):
+        (WebCore::RenderMathMLToken::updateTokenContent):
+        (WebCore::RenderMathMLToken::updateStyle):
+        (WebCore::RenderMathMLToken::styleDidChange):
+        (WebCore::RenderMathMLToken::updateFromElement):
+        * rendering/mathml/RenderMathMLToken.h: Added.
+        (WebCore::RenderMathMLToken::element):
+        (WebCore::RenderMathMLToken&gt;):
+
</ins><span class="cx"> 2014-02-06  Zoltan Horvath  &lt;zoltan@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Shapes] Simplify BasicShapeInset creation
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -4531,6 +4531,8 @@
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLSquareRoot.h \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLScripts.h \
</span><ins>+        Source/WebCore/rendering/mathml/RenderMathMLToken.cpp \
+        Source/WebCore/rendering/mathml/RenderMathMLToken.h \
</ins><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp \
</span><span class="cx">         Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h \
</span><span class="cx">         Source/WebCore/rendering/shapes/BoxShape.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -11213,6 +11213,7 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLSpace.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLSquareRoot.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLScripts.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLToken.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLUnderOver.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\style\BasicShapes.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\style\ContentData.cpp&quot;&gt;
</span><span class="lines">@@ -19904,6 +19905,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLSpace.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLSquareRoot.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLScripts.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLToken.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLUnderOver.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\style\BasicShapes.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\style\BorderData.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -2745,6 +2745,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLScripts.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLToken.cpp&quot;&gt;
+      &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\mathml\RenderMathMLUnderOver.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="lines">@@ -9590,6 +9593,9 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLScripts.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLToken.h&quot;&gt;
+      &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
+    &lt;/ClInclude&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\rendering\mathml\RenderMathMLUnderOver.h&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering\mathml&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClInclude&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -1456,6 +1456,8 @@
</span><span class="cx">                 439046E612DA25E800AF80A2 /* RenderMathMLSquareRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D212DA25E800AF80A2 /* RenderMathMLSquareRoot.h */; };
</span><span class="cx">                 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */; };
</span><span class="cx">                 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */; };
</span><ins>+                439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */; };
+                439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; };
</ins><span class="cx">                 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */; };
</span><span class="cx">                 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */; };
</span><span class="cx">                 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334013A6911C00C20F4F /* SVGAnimatedType.h */; };
</span><span class="lines">@@ -8321,6 +8323,8 @@
</span><span class="cx">                 439046D212DA25E800AF80A2 /* RenderMathMLSquareRoot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLSquareRoot.h; path = mathml/RenderMathMLSquareRoot.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLScripts.cpp; path = mathml/RenderMathMLScripts.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLScripts.h; path = mathml/RenderMathMLScripts.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLToken.cpp; path = mathml/RenderMathMLToken.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                439046D812DA25E800AF80A9 /* RenderMathMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLToken.h; path = mathml/RenderMathMLToken.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLUnderOver.cpp; path = mathml/RenderMathMLUnderOver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLUnderOver.h; path = mathml/RenderMathMLUnderOver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 439D334013A6911C00C20F4F /* SVGAnimatedType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15257,6 +15261,8 @@
</span><span class="cx">                                 439046D212DA25E800AF80A2 /* RenderMathMLSquareRoot.h */,
</span><span class="cx">                                 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */,
</span><span class="cx">                                 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */,
</span><ins>+                                439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */,
+                                439046D812DA25E800AF80A9 /* RenderMathMLToken.h */,
</ins><span class="cx">                                 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */,
</span><span class="cx">                                 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */,
</span><span class="cx">                         );
</span><span class="lines">@@ -24978,6 +24984,7 @@
</span><span class="cx">                                 439046E612DA25E800AF80A2 /* RenderMathMLSquareRoot.h in Headers */,
</span><span class="cx">                                 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */,
</span><span class="cx">                                 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */,
</span><ins>+                                439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */,
</ins><span class="cx">                                 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */,
</span><span class="cx">                                 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */,
</span><span class="cx">                                 DEBCCDD216646E8200A452E1 /* RenderMediaControlElements.h in Headers */,
</span><span class="lines">@@ -28327,6 +28334,7 @@
</span><span class="cx">                                 5B7A208D2E12979B4AE19DE6 /* RenderMathMLSpace.cpp in Sources */,
</span><span class="cx">                                 439046E512DA25E800AF80A2 /* RenderMathMLSquareRoot.cpp in Sources */,
</span><span class="cx">                                 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */,
</span><ins>+                                439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */,
</ins><span class="cx">                                 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */,
</span><span class="cx">                                 E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */,
</span><span class="cx">                                 DE49B309165F2FE10010338D /* RenderMediaControlElements.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/css/mathml.css        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">     -webkit-margin-after: 1em;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose {
</del><ins>+mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose {
</ins><span class="cx">     display: -webkit-inline-flex !important;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -96,7 +96,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> mi {
</span><del>-    font-style: italic;
</del><span class="cx">     -webkit-padding-end: 0.1em;
</span><span class="cx"> }
</span><span class="cx"> msub &gt; mi:first-child, msubsup &gt; mi:first-child {
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;MathMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderMathMLOperator.h&quot;
</span><span class="cx"> #include &quot;RenderMathMLSpace.h&quot;
</span><ins>+#include &quot;RenderMathMLToken.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><span class="lines">@@ -52,21 +53,31 @@
</span><span class="cx"> void MathMLTextElement::didAttachRenderers()
</span><span class="cx"> {
</span><span class="cx">     MathMLElement::didAttachRenderers();
</span><del>-    if (renderer())
-        renderer()-&gt;updateFromElement();
</del><ins>+    if (renderer()) {
+        if (renderer()-&gt;isRenderMathMLToken())
+            toRenderMathMLToken(renderer())-&gt;updateTokenContent();
+        else
+            renderer()-&gt;updateFromElement();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MathMLTextElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     MathMLElement::childrenChanged(change);
</span><del>-    if (renderer())
-        renderer()-&gt;updateFromElement();
</del><ins>+    if (renderer()) {
+        if (renderer()-&gt;isRenderMathMLToken())
+            toRenderMathMLToken(renderer())-&gt;updateTokenContent();
+        else
+            renderer()-&gt;updateFromElement();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; MathMLTextElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><span class="cx">     if (hasLocalName(MathMLNames::moTag))
</span><span class="cx">         return createRenderer&lt;RenderMathMLOperator&gt;(*this, std::move(style));
</span><ins>+    if (hasLocalName(MathMLNames::miTag))
+        return createRenderer&lt;RenderMathMLToken&gt;(*this, std::move(style));
</ins><span class="cx">     if (hasLocalName(MathMLNames::mspaceTag))
</span><span class="cx">         return createRenderer&lt;RenderMathMLSpace&gt;(*this, std::move(style));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.h (163552 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.h        2014-02-06 19:34:33 UTC (rev 163552)
+++ trunk/Source/WebCore/rendering/RenderObject.h        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -414,6 +414,7 @@
</span><span class="cx">     virtual bool isRenderMathMLSquareRoot() const { return false; }
</span><span class="cx">     virtual bool isRenderMathMLScripts() const { return false; }
</span><span class="cx">     virtual bool isRenderMathMLScriptsWrapper() const { return false; }
</span><ins>+    virtual bool isRenderMathMLToken() const { return false; }
</ins><span class="cx">     virtual bool isRenderMathMLUnderOver() const { return false; }
</span><span class="cx"> #endif // ENABLE(MATHML)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLTokencpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp (0 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp                                (rev 0)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -0,0 +1,104 @@
</span><ins>+/*
+ * Copyright (C) 2014 Frédéric Wang (fred.wang@free.fr). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;RenderMathMLToken.h&quot;
+
+#if ENABLE(MATHML)
+
+#include &quot;MathMLNames.h&quot;
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+RenderMathMLToken::RenderMathMLToken(Element&amp; element, PassRef&lt;RenderStyle&gt; style)
+    : RenderMathMLBlock(element, std::move(style))
+{
+}
+
+RenderMathMLToken::RenderMathMLToken(Document&amp; document, PassRef&lt;RenderStyle&gt; style)
+    : RenderMathMLBlock(document, std::move(style))
+{
+}
+
+void RenderMathMLToken::addChild(RenderObject* newChild, RenderObject* beforeChild)
+{
+    createWrapperIfNeeded();
+    toRenderElement(firstChild())-&gt;addChild(newChild, beforeChild);
+}
+
+void RenderMathMLToken::createWrapperIfNeeded()
+{
+    if (!firstChild()) {
+        RenderPtr&lt;RenderMathMLBlock&gt; wrapper = createAnonymousMathMLBlock();
+        // This container doesn't offer any useful information to accessibility.
+        wrapper-&gt;setIgnoreInAccessibilityTree(true);
+        RenderMathMLBlock::addChild(wrapper.leakPtr());
+    }
+}
+
+void RenderMathMLToken::updateTokenContent()
+{
+    if (!isEmpty())
+        updateStyle();
+    setNeedsLayoutAndPrefWidthsRecalc();
+}
+
+void RenderMathMLToken::updateStyle()
+{
+    const auto&amp; tokenElement = element();
+
+    // This tries to emulate the default mathvariant value on &lt;mi&gt; using the CSS font-style property.
+    // FIXME: This should be revised when mathvariant is implemented (http://wkbug/85735) and when fonts with Mathematical Alphanumeric Symbols characters are more popular.
+    const auto&amp; wrapper = toRenderElement(firstChild());
+    auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&amp;style(), FLEX);
+    FontDescription fontDescription(newStyle.get().fontDescription());
+    FontSelector* fontSelector = newStyle.get().font().fontSelector();
+    if (element().textContent().stripWhiteSpace().simplifyWhiteSpace().length() == 1 &amp;&amp; !tokenElement.hasAttribute(mathvariantAttr))
+        fontDescription.setItalic(true);
+    if (newStyle.get().setFontDescription(fontDescription))
+        newStyle.get().font().update(fontSelector);
+    wrapper-&gt;setStyle(std::move(newStyle));
+    wrapper-&gt;setNeedsLayoutAndPrefWidthsRecalc();
+}
+
+void RenderMathMLToken::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+    RenderMathMLBlock::styleDidChange(diff, oldStyle);
+    if (!isEmpty())
+        updateStyle();
+}
+
+void RenderMathMLToken::updateFromElement()
+{
+    RenderMathMLBlock::updateFromElement();
+    if (!isEmpty())
+        updateStyle();
+}
+
+}
+
+#endif // ENABLE(MATHML)
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLTokenh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h (0 => 163553)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h                                (rev 0)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLToken.h        2014-02-06 20:00:20 UTC (rev 163553)
</span><span class="lines">@@ -0,0 +1,65 @@
</span><ins>+/*
+ * Copyright (C) 2014 Frédéric Wang (fred.wang@free.fr). All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RenderMathMLToken_h
+#define RenderMathMLToken_h
+
+#if ENABLE(MATHML)
+
+#include &quot;MathMLTextElement.h&quot;
+#include &quot;RenderMathMLBlock.h&quot;
+#include &quot;RenderText.h&quot;
+
+namespace WebCore {
+    
+class RenderMathMLToken : public RenderMathMLBlock {
+public:
+    RenderMathMLToken(Element&amp;, PassRef&lt;RenderStyle&gt;);
+    RenderMathMLToken(Document&amp;, PassRef&lt;RenderStyle&gt;);
+
+    MathMLTextElement&amp; element() { return static_cast&lt;MathMLTextElement&amp;&gt;(nodeForNonAnonymous()); }
+
+    virtual bool isRenderMathMLToken() const override final { return true; }
+    virtual bool isChildAllowed(const RenderObject&amp;, const RenderStyle&amp;) const override { return true; };
+    virtual void addChild(RenderObject* newChild, RenderObject* beforeChild) override;
+    virtual void updateTokenContent();
+
+protected:
+    void createWrapperIfNeeded();
+
+private:
+    virtual const char* renderName() const override { return isAnonymous() ? &quot;RenderMathMLToken (anonymous)&quot; : &quot;RenderMathMLToken&quot;; }
+    void updateFromElement() override;
+    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
+    virtual void updateStyle();
+};
+
+template&lt;&gt; inline bool isRendererOfType&lt;const RenderMathMLToken&gt;(const RenderObject&amp; renderer) { return renderer.isRenderMathMLToken(); }
+RENDER_OBJECT_TYPE_CASTS(RenderMathMLToken, isRenderMathMLToken())
+
+}
+
+#endif // ENABLE(MATHML)
+#endif // RenderMathMLToken_h
</ins></span></pre>
</div>
</div>

</body>
</html>