LayoutTests/ChangeLog

 12013-09-23 Frédéric Wang <fred.wang@free.fr>
 2
 3 Add an MathMLSelectElement class to implement <maction> and <semantics>.
 4 <https://webkit.org/b/120058>
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 New tests for the selection of the visible child in the <maction> and <semantics> elements.
 9
 10 * mathml/presentation/maction-dynamic-expected.html: Added.
 11 * mathml/presentation/maction-dynamic.html: Added.
 12 * mathml/presentation/maction-expected.html: Added.
 13 * mathml/presentation/maction.html: Added.
 14 * mathml/presentation/semantics-expected.html: Added.
 15 * mathml/presentation/semantics.html: Added.
 16
1172013-11-10 Andreas Kling <akling@apple.com>
218
319 Optimize baselines: svg/*

LayoutTests/mathml/presentation/maction-dynamic-expected.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>maction</title>
 5 </head>
 6 <body>
 7
 8 <math>
 9 <maction selection="3" actiontype="tooltip">
 10 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 11 </maction>
 12 </math>
 13 <math>
 14 <maction actiontype="tooltip" selection="3">
 15 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 16 </maction>
 17 </math>
 18 <math>
 19 <maction actiontype="statusline" selection="3">
 20 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 21 </maction>
 22 </math>
 23 <math>
 24 <maction selection="3">
 25 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 26 </maction>
 27 </math>
 28
 29 <math>
 30 <maction actiontype="toggle" selection="2">
 31 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 32 </maction>
 33 </math>
 34 <math>
 35 <maction actiontype="toggle" selection="4">
 36 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 37 </maction>
 38 </math>
 39 <math>
 40 <maction actiontype="toggle">
 41 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 42 </maction>
 43 </math>
 44
 45 <math>
 46 <maction actiontype="toggle" selection="3">
 47 <mn>2</mn><mn>3</mn><mn>4</mn>
 48 </maction>
 49 </math>
 50 <math>
 51 <maction actiontype="toggle" selection="3">
 52 <mn>1</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 53 </maction>
 54 </math>
 55
 56 </body>
 57</html>

LayoutTests/mathml/presentation/maction-dynamic.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>maction</title>
 5 <script type="text/javascript">
 6 var mathmlNS = "http://www.w3.org/1998/Math/MathML";
 7
 8 function test()
 9 {
 10 var maction = document.getElementsByTagNameNS(mathmlNS, "maction");
 11
 12 // Setting the actiontype attribute
 13 maction[0].setAttribute("actiontype", "tooltip");
 14 maction[1].setAttribute("actiontype", "tooltip");
 15 maction[2].setAttribute("actiontype", "statusline");
 16 maction[3].removeAttribute("actiontype");
 17
 18 // Setting the selection attribute
 19 maction[4].setAttribute("selection", "2");
 20 maction[5].setAttribute("selection", "4");
 21 maction[6].removeAttribute("selection");
 22
 23 // Setting the child list
 24 maction[7].removeChild(maction[7].firstElementChild);
 25 var e = maction[8].firstElementChild;
 26 maction[8].insertBefore(e.cloneNode(true), e);
 27 }
 28 </script>
 29
 30 </head>
 31 <body onload="test()">
 32
 33 <!-- This test verifies which child of the maction element is selected after a DOM change. The page should render the same as the static version. -->
 34
 35 <math>
 36 <maction selection="3">
 37 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 38 </maction>
 39 </math>
 40 <math>
 41 <maction actiontype="toggle" selection="3">
 42 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 43 </maction>
 44 </math>
 45 <math>
 46 <maction actiontype="toggle" selection="3">
 47 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 48 </maction>
 49 </math>
 50 <math>
 51 <maction actiontype="statusline" selection="3">
 52 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 53 </maction>
 54 </math>
 55
 56 <math>
 57 <maction actiontype="toggle">
 58 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 59 </maction>
 60 </math>
 61 <math>
 62 <maction actiontype="toggle" selection="3">
 63 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 64 </maction>
 65 </math>
 66 <math>
 67 <maction actiontype="toggle" selection="3">
 68 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 69 </maction>
 70 </math>
 71
 72 <math>
 73 <maction actiontype="toggle" selection="3">
 74 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 75 </maction>
 76 </math>
 77 <math>
 78 <maction actiontype="toggle" selection="3">
 79 <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
 80 </maction>
 81 </math>
 82
 83 </body>
 84</html>

LayoutTests/mathml/presentation/maction-expected.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>maction</title>
 5 </head>
 6 <body>
 7
 8 <p>
 9 <math>
 10 <mrow>
 11 <mn>1</mn>
 12 </mrow>
 13 </math>
 14 <math>
 15 <mrow>
 16 <mn>1</mn>
 17 </mrow>
 18 </math>
 19 </p>
 20
 21 <p>
 22 <math>
 23 <mrow>
 24 <mn>1</mn>
 25 </mrow>
 26 </math>
 27 <math>
 28 <mrow>
 29 <mn>1</mn>
 30 </mrow>
 31 </math>
 32 </p>
 33
 34 <p>
 35 <math>
 36 <mrow>
 37 <mn>1</mn>
 38 </mrow>
 39 </math>
 40 <math>
 41 <mrow>
 42 <mn>3</mn>
 43 </mrow>
 44 </math>
 45 </p>
 46
 47 <p>
 48 <math>
 49 <mrow>
 50 <mn>1</mn>
 51 </mrow>
 52 </math>
 53 <math>
 54 <mrow>
 55 <mn>3</mn>
 56 </mrow>
 57 </math>
 58 </p>
 59
 60 <p>
 61 <math>
 62 <mrow>
 63 <mn>2</mn>
 64 </mrow>
 65 </math>
 66 </p>
 67
 68 <p>
 69 <math>
 70 <mrow>
 71 <mn>3</mn>
 72 </mrow>
 73 </math>
 74 <math>
 75 <mrow>
 76 <mn>4</mn>
 77 </maction>
 78 </math>
 79 <math>
 80 <mrow>
 81 <mn>1</mn>
 82 </mrow>
 83 </math>
 84 <math>
 85 <mrow>
 86 <mn>2</mn>
 87 </mrow>
 88 </math>
 89 <math>
 90 <mrow>
 91 <mn>4</mn>
 92 </mrow>
 93 </math>
 94 <math>
 95 <mrow>
 96 </mrow>
 97 </math>
 98 </p>
 99
 100 </body>
 101</html>

LayoutTests/mathml/presentation/maction.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>maction</title>
 5 </head>
 6 <body>
 7
 8 <!-- This test verifies which child of the maction element is selected. -->
 9
 10 <!-- For the statusline action type, the first child should be visible and the selection attribute should be ignored. -->
 11 <p>
 12 <math>
 13 <maction actiontype="statusline">
 14 <mn>1</mn>
 15 <mn>2</mn>
 16 </maction>
 17 </math>
 18 <math>
 19 <maction actiontype="statusline" selection="3">
 20 <mn>1</mn>
 21 <mn>2</mn>
 22 <mn>3</mn>
 23 <mn>4</mn>
 24 </maction>
 25 </math>
 26 </p>
 27
 28 <!-- For the tooltip action type, the first child should be visible and the selection attribute should be ignored. -->
 29 <p>
 30 <math>
 31 <maction actiontype="tooltip">
 32 <mn>1</mn>
 33 <mn>2</mn>
 34 </maction>
 35 </math>
 36 <math>
 37 <maction actiontype="tooltip" selection="3">
 38 <mn>1</mn>
 39 <mn>2</mn>
 40 <mn>3</mn>
 41 <mn>4</mn>
 42 </maction>
 43 </math>
 44 </p>
 45
 46 <!-- For the toggle action type, we use the selection attribute to determine the selected child. -->
 47 <p>
 48 <math>
 49 <maction actiontype="toggle">
 50 <mn>1</mn>
 51 <mn>2</mn>
 52 </maction>
 53 </math>
 54 <math>
 55 <maction actiontype="toggle" selection="3">
 56 <mn>1</mn>
 57 <mn>2</mn>
 58 <mn>3</mn>
 59 <mn>4</mn>
 60 </maction>
 61 </math>
 62 </p>
 63
 64 <!-- For any unknown action type, we use the selection attribute to determine the selected child. -->
 65 <p>
 66 <math>
 67 <maction actiontype="unknown">
 68 <mn>1</mn>
 69 <mn>2</mn>
 70 <mn>3</mn>
 71 <mn>4</mn>
 72 </maction>
 73 </math>
 74 <math>
 75 <maction actiontype="unknown" selection="3">
 76 <mn>1</mn>
 77 <mn>2</mn>
 78 <mn>3</mn>
 79 <mn>4</mn>
 80 </maction>
 81 </math>
 82 </p>
 83
 84 <!-- actiontype is case-sensitive, TOOLTIP is treated as unknown -->
 85 <p>
 86 <math>
 87 <maction actiontype="TOOLTIP" selection="2">
 88 <mn>1</mn>
 89 <mn>2</mn>
 90 </maction>
 91 </math>
 92 </p>
 93
 94 <!-- Testing a couple of special values for the "selection" attribute -->
 95 <p>
 96 <!-- The selection attribute has data type xsd:positiveInteger
 97 http://www.w3.org/TR/xmlschema-2/#positiveInteger -->
 98 <math>
 99 <maction actiontype="toggle" selection="+0003">
 100 <mn>1</mn>
 101 <mn>2</mn>
 102 <mn>3</mn>
 103 <mn>4</mn>
 104 </maction>
 105 </math>
 106 <!-- The MathML spec discourages the use of leading and trailing
 107 whitespace, but they are not strictly prohibited. -->
 108 <math>
 109 <maction actiontype="toggle" selection="&#x20;&#x9;&#xD;&#xA;4&#x20;&#x9;&#xD;&#xA;">
 110 <mn>1</mn>
 111 <mn>2</mn>
 112 <mn>3</mn>
 113 <mn>4</mn>
 114 </maction>
 115 </math>
 116 <!-- The MathML spec suggests to rounded up or down to the closest value
 117 within the allowed subset -->
 118 <math>
 119 <maction actiontype="toggle" selection="0">
 120 <mn>1</mn>
 121 <mn>2</mn>
 122 <mn>3</mn>
 123 <mn>4</mn>
 124 </maction>
 125 </math>
 126 <math>
 127 <maction actiontype="toggle" selection="2.25">
 128 <mn>1</mn>
 129 <mn>2</mn>
 130 <mn>3</mn>
 131 <mn>4</mn>
 132 </maction>
 133 </math>
 134 <math>
 135 <maction actiontype="toggle" selection="5">
 136 <mn>1</mn>
 137 <mn>2</mn>
 138 <mn>3</mn>
 139 <mn>4</mn>
 140 </maction>
 141 </math>
 142 <math>
 143 <maction actiontype="toggle" selection="1">
 144 </maction>
 145 </math>
 146 </p>
 147
 148 </body>
 149</html>

LayoutTests/mathml/presentation/semantics-expected.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>semantics</title>
 5 </head>
 6 <body>
 7
 8 <math>
 9 <mrow>
 10 <mi>x</mi>
 11 </mrow>
 12 </math>
 13
 14 <math>
 15 <mrow>
 16 <mspace width="20px" height="20px" mathbackground="red"/>
 17 </mrow>
 18 </math>
 19
 20 </body>
 21</html>

LayoutTests/mathml/presentation/semantics.html

 1<!doctype html>
 2<html>
 3 <head>
 4 <title>semantics</title>
 5 </head>
 6 <body>
 7
 8 <!-- This verifies that annotations are not visible. -->
 9 <math>
 10 <semantics>
 11 <mi>x</mi>
 12 <annotation encoding="TeX">x</annotation>
 13 <annotation encoding="StarMath 5.0">x</annotation>
 14 <annotation-xml encoding="MathML-Content"><ci>x</ci></annotation-xml>
 15 </semantics>
 16 </math>
 17
 18 <!-- This is not valid MathML but has become a standard hack to include SVG in MathML because of Gecko's initial implementation. -->
 19 <math>
 20 <semantics>
 21 <annotation-xml encoding="SVG1.1">
 22 <svg width="20px" height="20px">
 23 <rect width="20px" height="20px" fill="red" stroke="none"/>
 24 </svg>
 25 </annotation-xml>
 26 </semantics>
 27 </math>
 28
 29 </body>
 30</html>

Source/WebCore/CMakeLists.txt

@@set(WebCore_SOURCES
16701670 mathml/MathMLElement.cpp
16711671 mathml/MathMLInlineContainerElement.cpp
16721672 mathml/MathMLMathElement.cpp
 1673 mathml/MathMLSelectElement.cpp
16731674 mathml/MathMLTextElement.cpp
16741675
16751676 page/AutoscrollController.cpp

Source/WebCore/ChangeLog

 12013-11-10 Frédéric Wang <fred.wang@free.fr>
 2
 3 Add an MathMLSelectElement class to implement <maction> and <semantics>.
 4 <https://webkit.org/b/120058>
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Tests: mathml/presentation/maction-dynamic.html
 9 mathml/presentation/maction.html
 10
 11 This adds a new MathMLSelectElement class to prepare the implementation of the <maction> and <semantics> elements, for which only one "selected" child is visible. We now simply display the first child of the <semantics> element instead of hiding the annotations and this allows to handle the use case of SVG-in-MathML as generated by Instiki ; Gecko's selection algorithm will be implemented later (bug 100626). We now also rely on the @actiontype and @selection attributes to select the visible <maction> child ; It remains to deal with the user interaction (bug 85734).
 12
 13 * CMakeLists.txt: add the new files.
 14 * GNUmakefile.list.am: ditto
 15 * Target.pri: ditto
 16 * WebCore.vcxproj/WebCore.vcxproj: ditto
 17 * WebCore.vcxproj/WebCore.vcxproj.filters: ditto
 18 * WebCore.xcodeproj/project.pbxproj: ditto
 19 * css/mathml.css: remove the CSS rule for annotation/annotation-xml.
 20 * mathml/MathMLAllInOne.cpp: add the new cpp file.
 21 * mathml/MathMLSelectElement.cpp: Added.
 22 (WebCore::MathMLSelectElement::MathMLSelectElement):
 23 (WebCore::MathMLSelectElement::create):
 24 (WebCore::MathMLSelectElement::createRenderer):
 25 (WebCore::MathMLSelectElement::childShouldCreateRenderer):
 26 (WebCore::MathMLSelectElement::finishParsingChildren):
 27 (WebCore::MathMLSelectElement::childrenChanged):
 28 (WebCore::MathMLSelectElement::attributeChanged):
 29 (WebCore::MathMLSelectElement::updateSelectedChild): basic implementation for maction, semantics, maction@actiontype and maction@selection.
 30 * mathml/MathMLSelectElement.h: Added.
 31 * mathml/mathattrs.in: add actiontype and selection attributes.
 32 * mathml/mathtags.in: set element classes for maction, semantics, annotation and annotation-xml.
 33
1342013-11-10 Andreas Kling <akling@apple.com>
235
336 Generate type casting helpers for Widget classes.

Source/WebCore/GNUmakefile.list.am

@@webcore_sources += \
40274027 Source/WebCore/mathml/MathMLInlineContainerElement.h \
40284028 Source/WebCore/mathml/MathMLMathElement.cpp \
40294029 Source/WebCore/mathml/MathMLMathElement.h \
 4030 Source/WebCore/mathml/MathMLSelectElement.cpp \
 4031 Source/WebCore/mathml/MathMLSelectElement.h \
40304032 Source/WebCore/mathml/MathMLTextElement.cpp \
40314033 Source/WebCore/mathml/MathMLTextElement.h \
40324034 Source/WebCore/page/animation/AnimationBase.cpp \

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

1784017840 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1784117841 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1784217842 </ClCompile>
 17843 <ClCompile Include="..\mathml\MathMLSelectElement.cpp">
 17844 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 17845 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 17846 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 17847 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 17848 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 17849 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 17850 </ClCompile>
1784317851 <ClCompile Include="..\mathml\MathMLTextElement.cpp">
1784417852 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
1784517853 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>

2073120739 <ClInclude Include="..\mathml\MathMLElement.h" />
2073220740 <ClInclude Include="..\mathml\MathMLInlineContainerElement.h" />
2073320741 <ClInclude Include="..\mathml\MathMLMathElement.h" />
 20742 <ClInclude Include="..\mathml\MathMLSelectElement.h" />
2073420743 <ClInclude Include="..\mathml\MathMLTextElement.h" />
2073520744 <ClInclude Include="..\editing\AlternativeTextController.h" />
2073620745 <ClInclude Include="..\config.h" />

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

49584958 <ClCompile Include="..\mathml\MathMLMathElement.cpp">
49594959 <Filter>rendering\mathml</Filter>
49604960 </ClCompile>
 4961 <ClCompile Include="..\mathml\MathMLSelectElement.cpp">
 4962 <Filter>rendering\mathml</Filter>
 4963 </ClCompile>
49614964 <ClCompile Include="..\mathml\MathMLTextElement.cpp">
49624965 <Filter>rendering\mathml</Filter>
49634966 </ClCompile>

1248012483 <ClInclude Include="..\mathml\MathMLMathElement.h">
1248112484 <Filter>rendering\mathml</Filter>
1248212485 </ClInclude>
 12486 <ClInclude Include="..\mathml\MathMLSelectElement.h">
 12487 <Filter>rendering\mathml</Filter>
 12488 </ClInclude>
1248312489 <ClInclude Include="..\mathml\MathMLTextElement.h">
1248412490 <Filter>rendering\mathml</Filter>
1248512491 </ClInclude>

Source/WebCore/WebCore.xcodeproj/project.pbxproj

62716271 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; };
62726272 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
62736273 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
 6274 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */; };
62746275 FEDBFF16182B7A8D0017FA64 /* BreakpointID.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDBFF14182B7A8D0017FA64 /* BreakpointID.h */; settings = {ATTRIBUTES = (Private, ); }; };
62756276 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */; };
62766277 FEDEF84216797108000E444A /* DatabaseStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDEF84016797108000E444A /* DatabaseStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };

85948595 59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationClientMock.h; sourceTree = "<group>"; };
85958596 5958F1CB1343917C0080B31F /* XMLViewer.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = XMLViewer.css; sourceTree = "<group>"; };
85968597 5958F1CC1343917C0080B31F /* XMLViewer.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = XMLViewer.js; sourceTree = "<group>"; };
 8598 59780849D41E6F65D81198BC /* MathMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLSelectElement.h; sourceTree = "<group>"; };
85978599 598365DC1355F53C001B185D /* JSPositionCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionCallback.h; sourceTree = "<group>"; };
85988600 598365DE1355F562001B185D /* JSPositionErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionErrorCallback.h; sourceTree = "<group>"; };
85998601 598365E31355F604001B185D /* JSPositionCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionCallback.cpp; sourceTree = "<group>"; };

1305613058 F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1305713059 F5E0C6591643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseChooserOnlyDateAndTimeInputType.cpp; sourceTree = "<group>"; };
1305813060 F5E0C65A1643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseChooserOnlyDateAndTimeInputType.h; sourceTree = "<group>"; };
 13061 F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLSelectElement.cpp; sourceTree = "<group>"; };
1305913062 F7A034C3126BF6BE007DC19E /* FontOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontOrientation.h; sourceTree = "<group>"; };
1306013063 F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1306113064 F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };

2149921502 FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */,
2150021503 FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */,
2150121504 FABE72F21059C1EB00D999DD /* MathMLMathElement.h */,
 21505 F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */,
 21506 59780849D41E6F65D81198BC /* MathMLSelectElement.h */,
2150221507 FA654A691108ABED002615E0 /* MathMLTextElement.cpp */,
2150321508 FA654A6A1108ABED002615E0 /* MathMLTextElement.h */,
2150421509 FABE72F31059C1EB00D999DD /* mathtags.in */,

2549025495 FD31608512B026F700C1A359 /* AudioResampler.cpp in Sources */,
2549125496 FD31608712B026F700C1A359 /* AudioResamplerKernel.cpp in Sources */,
2549225497 FD8C46EB154608E700A5910C /* AudioScheduledSourceNode.cpp in Sources */,
 25498 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */,
2549325499 078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
2549425500 CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */,
2549525501 CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,

Source/WebCore/css/mathml.css

@@math[mathsize="big"], mstyle[mathsize="big"], mo[mathsize="big"], mn[mathsize="b
152152 font-size: 1.5em;
153153}
154154
155 annotation, annotation-xml {
156  display: none;
157 }
158 
159155mphantom {
160156 visibility: hidden;
161157}

Source/WebCore/mathml/MathMLAllInOne.cpp

2828#include "MathMLElement.cpp"
2929#include "MathMLInlineContainerElement.cpp"
3030#include "MathMLMathElement.cpp"
 31#include "MathMLSelectElement.cpp"
3132#include "MathMLTextElement.cpp"
3233

Source/WebCore/mathml/MathMLInlineContainerElement.cpp

@@PassRefPtr<MathMLInlineContainerElement> MathMLInlineContainerElement::create(co
5656
5757RenderElement* MathMLInlineContainerElement::createRenderer(PassRef<RenderStyle> style)
5858{
 59 if (hasLocalName(annotation_xmlTag))
 60 return new RenderMathMLRow(*this, std::move(style));
5961 if (hasLocalName(mrowTag))
6062 return new RenderMathMLRow(*this, std::move(style));
6163 if (hasLocalName(msubTag))

Source/WebCore/mathml/MathMLSelectElement.cpp

 1/*
 2 * Copyright (C) 2013 The MathJax Consortium. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 15 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 16 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 17 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 19 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#include "config.h"
 27
 28#if ENABLE(MATHML)
 29
 30#include "MathMLSelectElement.h"
 31
 32#include "MathMLNames.h"
 33#include "RenderMathMLRow.h"
 34
 35namespace WebCore {
 36
 37using namespace MathMLNames;
 38
 39MathMLSelectElement::MathMLSelectElement(const QualifiedName& tagName, Document& document)
 40 : MathMLInlineContainerElement(tagName, document), m_selectedChild(nullptr)
 41{
 42}
 43
 44PassRefPtr<MathMLSelectElement> MathMLSelectElement::create(const QualifiedName& tagName, Document& document)
 45{
 46 return adoptRef(new MathMLSelectElement(tagName, document));
 47}
 48
 49RenderElement* MathMLSelectElement::createRenderer(PassRef<RenderStyle> style)
 50{
 51 return new RenderMathMLRow(*this, std::move(style));
 52}
 53
 54bool MathMLSelectElement::childShouldCreateRenderer(const Node* child) const
 55{
 56 return child == m_selectedChild;
 57}
 58
 59void MathMLSelectElement::finishParsingChildren()
 60{
 61 updateSelectedChild();
 62 MathMLInlineContainerElement::finishParsingChildren();
 63}
 64
 65void MathMLSelectElement::childrenChanged(const ChildChange& change)
 66{
 67 updateSelectedChild();
 68 MathMLInlineContainerElement::childrenChanged(change);
 69}
 70
 71void MathMLSelectElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason reason)
 72{
 73 if (hasLocalName(mactionTag) && (name == MathMLNames::actiontypeAttr || name == MathMLNames::selectionAttr))
 74 updateSelectedChild();
 75
 76 MathMLInlineContainerElement::attributeChanged(name, newValue, reason);
 77}
 78
 79void MathMLSelectElement::updateSelectedChild()
 80{
 81 Element* newSelectedChild = firstElementChild();
 82
 83 if (newSelectedChild) {
 84 if (hasLocalName(mactionTag)) {
 85 // FIXME: implement user interaction for the "tooltip", "statusline" and "toggle" action types. See bug 85734.
 86 const AtomicString& actiontype = fastGetAttribute(MathMLNames::actiontypeAttr);
 87 if (actiontype != "tooltip" && actiontype != "statusline") {
 88 // For the "toggle" action type or any unknown action type, we rely on the value of the selection attribute to determine the visible child.
 89 int selection = fastGetAttribute(MathMLNames::selectionAttr).toInt();
 90 for (int i = 1; i < selection; i++) {
 91 Element* nextChild = newSelectedChild->nextElementSibling();
 92 if (!nextChild)
 93 break;
 94 newSelectedChild = nextChild;
 95 }
 96 }
 97 } else {
 98 ASSERT(hasLocalName(semanticsTag));
 99 // FIXME: implement Gecko's selection algorithm for <semantics>. See bug 100626.
 100 }
 101 }
 102
 103 if (m_selectedChild == newSelectedChild)
 104 return;
 105
 106 if (m_selectedChild && m_selectedChild->renderer())
 107 Style::detachRenderTree(*m_selectedChild);
 108
 109 m_selectedChild = newSelectedChild;
 110 setNeedsStyleRecalc();
 111}
 112
 113}
 114
 115#endif // ENABLE(MATHML)

Source/WebCore/mathml/MathMLSelectElement.h

 1/*
 2 * Copyright (C) 2013 The MathJax Consortium. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions
 6 * are met:
 7 * 1. Redistributions of source code must retain the above copyright
 8 * notice, this list of conditions and the following disclaimer.
 9 * 2. Redistributions in binary form must reproduce the above copyright
 10 * notice, this list of conditions and the following disclaimer in the
 11 * documentation and/or other materials provided with the distribution.
 12 *
 13 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 14 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 15 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 16 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 17 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 19 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 24 */
 25
 26#ifndef MathMLSelectElement_h
 27#define MathMLSelectElement_h
 28
 29#if ENABLE(MATHML)
 30#include "MathMLInlineContainerElement.h"
 31
 32namespace WebCore {
 33
 34class MathMLSelectElement FINAL : public MathMLInlineContainerElement {
 35public:
 36 static PassRefPtr<MathMLSelectElement> create(const QualifiedName& tagName, Document&);
 37
 38private:
 39 MathMLSelectElement(const QualifiedName& tagName, Document&);
 40 virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
 41
 42 virtual bool childShouldCreateRenderer(const Node*) const OVERRIDE;
 43
 44 virtual void finishParsingChildren() OVERRIDE;
 45 virtual void childrenChanged(const ChildChange&) OVERRIDE;
 46 virtual void attributeChanged(const QualifiedName&, const AtomicString&, AttributeModificationReason = ModifiedDirectly) OVERRIDE;
 47
 48 void updateSelectedChild();
 49 Element* m_selectedChild;
 50};
 51
 52}
 53
 54#endif // ENABLE(MATHML)
 55#endif // MathMLSelectElement_h

Source/WebCore/mathml/mathattrs.in

@@namespaceURI="http://www.w3.org/1998/Math/MathML"
33guardFactoryWith="ENABLE(MATHML)"
44attrsNullNamespace
55
 6actiontype
67alttext
78background
89close

@@mathvariant
2526numalign
2627open
2728rowspan
 29selection
2830separators
2931stretchy
3032subscriptshift

Source/WebCore/mathml/mathtags.in

@@namespaceURI="http://www.w3.org/1998/Math/MathML"
33guardFactoryWith="ENABLE(MATHML)"
44fallbackInterfaceName="MathMLElement"
55
 6annotation interfaceName=MathMLTextElement
 7annotation-xml interfaceName=MathMLInlineContainerElement
 8maction interfaceName=MathMLSelectElement
69math
710mfrac interfaceName=MathMLInlineContainerElement
811mfenced interfaceName=MathMLInlineContainerElement

@@mtd interfaceName=MathMLElement
2629mmultiscripts interfaceName=MathMLInlineContainerElement
2730mprescripts interfaceName=MathMLInlineContainerElement
2831none interfaceName=MathMLInlineContainerElement
 32semantics interfaceName=MathMLSelectElement
2933
3034#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
3135ms
3236mglyph
3337malignmark
34 annotation-xml
3538#endif