Do not draw multi-characters <mi> in italic.
https://bugs.webkit.org/show_bug.cgi?id=44208

Patch by Frédéric Wang <fred.wang@free.fr> on 2014-02-06
Reviewed by Chris Fleizach.

Source/WebCore:

This test prevents multi-char <mi> 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>):

LayoutTests:

Add tests for single-char/multi-char <mi> 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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed