Changeset 163553 in webkit
- Timestamp:
- Feb 6, 2014 12:00:20 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r163548 r163553 1 2014-02-06 Frédéric Wang <fred.wang@free.fr> 2 3 Do not draw multi-characters <mi> in italic. 4 https://bugs.webkit.org/show_bug.cgi?id=44208 5 6 Reviewed by Chris Fleizach. 7 8 Add tests for single-char/multi-char <mi> elements, the mathvariant 9 attribute and MathML token elements dynamically modified. 10 11 * mathml/presentation/attributes-mathvariant-expected.html: 12 * mathml/presentation/attributes-mathvariant.html: 13 * mathml/presentation/tokenElements-dynamic-expected.html: Added. 14 * mathml/presentation/tokenElements-dynamic.html: Added. 15 * mathml/presentation/tokenElements-mathvariant-expected.html: 16 * mathml/presentation/tokenElements-mathvariant.html: 17 1 18 2014-02-06 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/LayoutTests/mathml/presentation/attributes-mathvariant-expected.html
r152777 r163553 16 16 --> 17 17 <div> 18 <!-- FIXME: we add new lines to workaround a width/spacing bug. --> 18 19 <math> 19 <mi style="font-style: normal;">A</mi> 20 <mi style="font-style: italic;">A</mi> 20 <mtext style="font-style: normal;">A</mtext> 21 </math><br/> 22 <math> 21 23 <mtext style="font-style: italic;">A</mtext> 22 <mi style="font-style: normal; font-weight: bold;">A</mi> 23 <mi style="font-weight: bold; font-style: italic;">A</mi> 24 </math><br/> 25 <math> 26 <mtext style="font-style: italic;">A</mtext> 27 </math><br/> 28 <math> 29 <mtext style="font-weight: bold;">A</mtext> 30 </math><br/> 31 <math> 32 <mtext style="font-weight: bold; font-style: italic;">A</mtext> 24 33 </math> 25 34 </div> -
trunk/LayoutTests/mathml/presentation/attributes-mathvariant.html
r152777 r163553 12 12 <math> 13 13 <mi mathvariant="normal">A</mi> 14 </math><br/> 15 <math> 14 16 <mi>A</mi> 17 </math><br/> 18 <math> 15 19 <mtext mathvariant="italic">A</mtext> 20 </math><br/> 21 <math> 16 22 <mi mathvariant="bold">A</mi> 23 </math><br/> 24 <math> 17 25 <mi mathvariant="bold-italic">A</mi> 18 26 </math> -
trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant-expected.html
r152777 r163553 12 12 <mtext style="font-style: normal; font-weight: normal;">text</mtext> 13 13 <ms style="font-style: normal; font-weight: normal;">&</ms> 14 <mtext style="font-style: normal; font-weight: normal;">sin</mtext> 14 15 </math> 15 16 </p> 16 <p>Following element should be in italic:17 <p>Following elements should be in italic: 17 18 <math> 18 <mi style="font-style: italic;">x</mi> 19 <mtext style="font-style: italic; font-weight: normal;">x</mtext> 20 </math><br/> 21 <math> 22 <!-- FIXME: the whitespace should be removed in the reference when 23 bug 125628 is fixed. --> 24 <mtext style="font-style: italic; font-weight: normal;"> 	
x 	
</mtext> 19 25 </math> 20 26 </p> -
trunk/LayoutTests/mathml/presentation/tokenElements-mathvariant.html
r152777 r163553 12 12 <mtext>text</mtext> 13 13 <ms>&</ms> 14 <mi>sin</mi> 14 15 </math> 15 16 </p> 16 <p>Following element should be in italic: 17 <p>Following elements should be in italic: 18 <!-- FIXME: we add a new line to workaround a width/spacing bug. --> 17 19 <math> 18 20 <mi>x</mi> 21 </math><br/> 22 <math> 23 <mi> 	
x 	
</mi> 19 24 </math> 20 25 </p> -
trunk/Source/WebCore/CMakeLists.txt
r163440 r163553 2221 2221 rendering/mathml/RenderMathMLSpace.cpp 2222 2222 rendering/mathml/RenderMathMLSquareRoot.cpp 2223 rendering/mathml/RenderMathMLToken.cpp 2223 2224 rendering/mathml/RenderMathMLUnderOver.cpp 2224 2225 -
trunk/Source/WebCore/ChangeLog
r163552 r163553 1 2014-02-06 Frédéric Wang <fred.wang@free.fr> 2 3 Do not draw multi-characters <mi> in italic. 4 https://bugs.webkit.org/show_bug.cgi?id=44208 5 6 Reviewed by Chris Fleizach. 7 8 This test prevents multi-char <mi> to be drawn in italic and prepare 9 further improvements to MathML token and mfenced elements (bugs 124838 10 and bug 99620). 11 12 Test: mathml/presentation/tokenElements-dynamic.html 13 14 * CMakeLists.txt: 15 * GNUmakefile.list.am: 16 * WebCore.vcxproj/WebCore.vcxproj: 17 * WebCore.vcxproj/WebCore.vcxproj.filters: 18 * WebCore.xcodeproj/project.pbxproj: 19 * css/mathml.css: 20 (mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose): 21 * mathml/MathMLTextElement.cpp: 22 (WebCore::MathMLTextElement::didAttachRenderers): 23 (WebCore::MathMLTextElement::childrenChanged): 24 (WebCore::MathMLTextElement::createElementRenderer): 25 * rendering/RenderObject.h: 26 (WebCore::RenderObject::isRenderMathMLToken): 27 * rendering/mathml/RenderMathMLToken.cpp: Added. 28 (WebCore::RenderMathMLToken::RenderMathMLToken): 29 (WebCore::RenderMathMLToken::addChild): 30 (WebCore::RenderMathMLToken::createWrapperIfNeeded): 31 (WebCore::RenderMathMLToken::updateTokenContent): 32 (WebCore::RenderMathMLToken::updateStyle): 33 (WebCore::RenderMathMLToken::styleDidChange): 34 (WebCore::RenderMathMLToken::updateFromElement): 35 * rendering/mathml/RenderMathMLToken.h: Added. 36 (WebCore::RenderMathMLToken::element): 37 (WebCore::RenderMathMLToken>): 38 1 39 2014-02-06 Zoltan Horvath <zoltan@webkit.org> 2 40 -
trunk/Source/WebCore/GNUmakefile.list.am
r163505 r163553 4532 4532 Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp \ 4533 4533 Source/WebCore/rendering/mathml/RenderMathMLScripts.h \ 4534 Source/WebCore/rendering/mathml/RenderMathMLToken.cpp \ 4535 Source/WebCore/rendering/mathml/RenderMathMLToken.h \ 4534 4536 Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp \ 4535 4537 Source/WebCore/rendering/mathml/RenderMathMLUnderOver.h \ -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r163359 r163553 11214 11214 <ClCompile Include="..\rendering\mathml\RenderMathMLSquareRoot.cpp" /> 11215 11215 <ClCompile Include="..\rendering\mathml\RenderMathMLScripts.cpp" /> 11216 <ClCompile Include="..\rendering\mathml\RenderMathMLToken.cpp" /> 11216 11217 <ClCompile Include="..\rendering\mathml\RenderMathMLUnderOver.cpp" /> 11217 11218 <ClCompile Include="..\rendering\style\BasicShapes.cpp" /> … … 19905 19906 <ClInclude Include="..\rendering\mathml\RenderMathMLSquareRoot.h" /> 19906 19907 <ClInclude Include="..\rendering\mathml\RenderMathMLScripts.h" /> 19908 <ClInclude Include="..\rendering\mathml\RenderMathMLToken.h" /> 19907 19909 <ClInclude Include="..\rendering\mathml\RenderMathMLUnderOver.h" /> 19908 19910 <ClInclude Include="..\rendering\style\BasicShapes.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r163359 r163553 2746 2746 <Filter>rendering\mathml</Filter> 2747 2747 </ClCompile> 2748 <ClCompile Include="..\rendering\mathml\RenderMathMLToken.cpp"> 2749 <Filter>rendering\mathml</Filter> 2750 </ClCompile> 2748 2751 <ClCompile Include="..\rendering\mathml\RenderMathMLUnderOver.cpp"> 2749 2752 <Filter>rendering\mathml</Filter> … … 9589 9592 </ClInclude> 9590 9593 <ClInclude Include="..\rendering\mathml\RenderMathMLScripts.h"> 9594 <Filter>rendering\mathml</Filter> 9595 </ClInclude> 9596 <ClInclude Include="..\rendering\mathml\RenderMathMLToken.h"> 9591 9597 <Filter>rendering\mathml</Filter> 9592 9598 </ClInclude> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r163515 r163553 1457 1457 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */; }; 1458 1458 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */; }; 1459 439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */; }; 1460 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; }; 1459 1461 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */; }; 1460 1462 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */; }; … … 8322 8324 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLScripts.cpp; path = mathml/RenderMathMLScripts.cpp; sourceTree = "<group>"; }; 8323 8325 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLScripts.h; path = mathml/RenderMathMLScripts.h; sourceTree = "<group>"; }; 8326 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLToken.cpp; path = mathml/RenderMathMLToken.cpp; sourceTree = "<group>"; }; 8327 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLToken.h; path = mathml/RenderMathMLToken.h; sourceTree = "<group>"; }; 8324 8328 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RenderMathMLUnderOver.cpp; path = mathml/RenderMathMLUnderOver.cpp; sourceTree = "<group>"; }; 8325 8329 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RenderMathMLUnderOver.h; path = mathml/RenderMathMLUnderOver.h; sourceTree = "<group>"; }; … … 15258 15262 439046D312DA25E800AF80A2 /* RenderMathMLScripts.cpp */, 15259 15263 439046D412DA25E800AF80A2 /* RenderMathMLScripts.h */, 15264 439046D712DA25E800AF80A9 /* RenderMathMLToken.cpp */, 15265 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */, 15260 15266 439046D512DA25E800AF80A2 /* RenderMathMLUnderOver.cpp */, 15261 15267 439046D612DA25E800AF80A2 /* RenderMathMLUnderOver.h */, … … 24979 24985 0783228518013ED800999E0C /* MediaStreamAudioSource.h in Headers */, 24980 24986 439046E812DA25E800AF80A2 /* RenderMathMLScripts.h in Headers */, 24987 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */, 24981 24988 439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */, 24982 24989 E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */, … … 28328 28335 439046E512DA25E800AF80A2 /* RenderMathMLSquareRoot.cpp in Sources */, 28329 28336 439046E712DA25E800AF80A2 /* RenderMathMLScripts.cpp in Sources */, 28337 439046EB12DA25E800AF80A9 /* RenderMathMLToken.cpp in Sources */, 28330 28338 439046E912DA25E800AF80A2 /* RenderMathMLUnderOver.cpp in Sources */, 28331 28339 E4C279580CF9741900E97B98 /* RenderMedia.cpp in Sources */, -
trunk/Source/WebCore/css/mathml.css
r162933 r163553 43 43 } 44 44 45 m o, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose {45 mi, mo, mrow, mfenced, mfrac, msub, msup, msubsup, mmultiscripts, mprescripts, none, munder, mover, munderover, msqrt, mroot, merror, mphantom, mstyle, menclose { 46 46 display: -webkit-inline-flex !important; 47 47 } … … 97 97 98 98 mi { 99 font-style: italic;100 99 -webkit-padding-end: 0.1em; 101 100 } -
trunk/Source/WebCore/mathml/MathMLTextElement.cpp
r161181 r163553 34 34 #include "RenderMathMLOperator.h" 35 35 #include "RenderMathMLSpace.h" 36 #include "RenderMathMLToken.h" 36 37 37 38 namespace WebCore { … … 53 54 { 54 55 MathMLElement::didAttachRenderers(); 55 if (renderer()) 56 renderer()->updateFromElement(); 56 if (renderer()) { 57 if (renderer()->isRenderMathMLToken()) 58 toRenderMathMLToken(renderer())->updateTokenContent(); 59 else 60 renderer()->updateFromElement(); 61 } 57 62 } 58 63 … … 60 65 { 61 66 MathMLElement::childrenChanged(change); 62 if (renderer()) 63 renderer()->updateFromElement(); 67 if (renderer()) { 68 if (renderer()->isRenderMathMLToken()) 69 toRenderMathMLToken(renderer())->updateTokenContent(); 70 else 71 renderer()->updateFromElement(); 72 } 64 73 } 65 74 … … 68 77 if (hasLocalName(MathMLNames::moTag)) 69 78 return createRenderer<RenderMathMLOperator>(*this, std::move(style)); 79 if (hasLocalName(MathMLNames::miTag)) 80 return createRenderer<RenderMathMLToken>(*this, std::move(style)); 70 81 if (hasLocalName(MathMLNames::mspaceTag)) 71 82 return createRenderer<RenderMathMLSpace>(*this, std::move(style)); -
trunk/Source/WebCore/rendering/RenderObject.h
r163440 r163553 415 415 virtual bool isRenderMathMLScripts() const { return false; } 416 416 virtual bool isRenderMathMLScriptsWrapper() const { return false; } 417 virtual bool isRenderMathMLToken() const { return false; } 417 418 virtual bool isRenderMathMLUnderOver() const { return false; } 418 419 #endif // ENABLE(MATHML)
Note: See TracChangeset
for help on using the changeset viewer.