<!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>[160005] 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/160005">160005</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-03 09:12:38 -0800 (Tue, 03 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add an MathMLSelectElement class to implement <maction> and <semantics>.
<https://webkit.org/b/120058>
Patch by Frédéric Wang <fred.wang@free.fr> on 2013-12-03
Reviewed by Chris Fleizach.
Source/WebCore:
Tests: mathml/presentation/maction-dynamic.html
mathml/presentation/maction.html
mathml/presentation/semantics.html
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 when
bug 124128 is fixed ; 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).
* CMakeLists.txt: add the new files.
* GNUmakefile.list.am: ditto
* Target.pri: ditto
* WebCore.vcxproj/WebCore.vcxproj: ditto
* WebCore.vcxproj/WebCore.vcxproj.filters: ditto
* WebCore.xcodeproj/project.pbxproj: ditto
* css/mathml.css: remove the CSS rule for annotation/annotation-xml.
* mathml/MathMLAllInOne.cpp: add the new cpp file.
* mathml/MathMLSelectElement.cpp: Added.
(WebCore::MathMLSelectElement::MathMLSelectElement):
(WebCore::MathMLSelectElement::create):
(WebCore::MathMLSelectElement::createRenderer):
(WebCore::MathMLSelectElement::childShouldCreateRenderer):
(WebCore::MathMLSelectElement::finishParsingChildren):
(WebCore::MathMLSelectElement::childrenChanged):
(WebCore::MathMLSelectElement::attributeChanged):
(WebCore::MathMLSelectElement::updateSelectedChild): basic implementation for maction, semantics, maction@actiontype and maction@selection.
* mathml/MathMLSelectElement.h: Added.
* mathml/mathattrs.in: add actiontype and selection attributes.
* mathml/mathtags.in: set element classes for maction, semantics, annotation and annotation-xml.
LayoutTests:
New tests for the selection of the visible child in the <maction> and <semantics> elements.
* mathml/presentation/maction-dynamic-expected.html: Added.
* mathml/presentation/maction-dynamic.html: Added.
* mathml/presentation/maction-expected.html: Added.
* mathml/presentation/maction.html: Added.
* mathml/presentation/semantics-expected.html: Added.
* mathml/presentation/semantics.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</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="#trunkSourceWebCoremathmlMathMLAllInOnecpp">trunk/Source/WebCore/mathml/MathMLAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLInlineContainerElementcpp">trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlmathattrsin">trunk/Source/WebCore/mathml/mathattrs.in</a></li>
<li><a href="#trunkSourceWebCoremathmlmathtagsin">trunk/Source/WebCore/mathml/mathtags.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationmactiondynamicexpectedhtml">trunk/LayoutTests/mathml/presentation/maction-dynamic-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmactiondynamichtml">trunk/LayoutTests/mathml/presentation/maction-dynamic.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmactionexpectedhtml">trunk/LayoutTests/mathml/presentation/maction-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmactionhtml">trunk/LayoutTests/mathml/presentation/maction.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemanticsexpectedhtml">trunk/LayoutTests/mathml/presentation/semantics-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemanticshtml">trunk/LayoutTests/mathml/presentation/semantics.html</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementcpp">trunk/Source/WebCore/mathml/MathMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementh">trunk/Source/WebCore/mathml/MathMLSelectElement.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/LayoutTests/ChangeLog        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2013-12-03 Frédéric Wang <fred.wang@free.fr>
+
+ Add an MathMLSelectElement class to implement <maction> and <semantics>.
+ <https://webkit.org/b/120058>
+
+ Reviewed by Chris Fleizach.
+
+ New tests for the selection of the visible child in the <maction> and <semantics> elements.
+
+ * mathml/presentation/maction-dynamic-expected.html: Added.
+ * mathml/presentation/maction-dynamic.html: Added.
+ * mathml/presentation/maction-expected.html: Added.
+ * mathml/presentation/maction.html: Added.
+ * mathml/presentation/semantics-expected.html: Added.
+ * mathml/presentation/semantics.html: Added.
+
</ins><span class="cx"> 2013-12-02 Samuel White <samuel_white@apple.com>
</span><span class="cx">
</span><span class="cx"> AX: Add AXUIElementCountForSearchPredicate parameterized attribute.
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/LayoutTests/TestExpectations        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -21,6 +21,9 @@
</span><span class="cx"> webkit.org/b/57700 mathml/presentation/row.xhtml [ Failure ]
</span><span class="cx"> webkit.org/b/57700 mathml/presentation/mo.xhtml [ Failure ]
</span><span class="cx">
</span><ins>+# MathML regression with foreign objects
+webkit.org/b/124128 mathml/presentation/semantics.html [ Skip ]
+
</ins><span class="cx"> # These conformace tests are no longer in sync with the latest specification
</span><span class="cx"> # and expect compareDocumentPosition() to return:
</span><span class="cx"> # DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC | DOCUMENT_POSITION_DISCONNECTED
</span></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmactiondynamicexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction-dynamic-expected.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction-dynamic-expected.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction-dynamic-expected.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>maction</title>
+ </head>
+ <body>
+
+ <math>
+ <maction selection="3" actiontype="tooltip">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="tooltip" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="statusline" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ <math>
+ <maction actiontype="toggle" selection="2">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="4">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmactiondynamichtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction-dynamic.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction-dynamic.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction-dynamic.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>maction</title>
+ <script type="text/javascript">
+ var mathmlNS = "http://www.w3.org/1998/Math/MathML";
+
+ function test()
+ {
+ var maction = document.getElementsByTagNameNS(mathmlNS, "maction");
+
+ // Setting the actiontype attribute
+ maction[0].setAttribute("actiontype", "tooltip");
+ maction[1].setAttribute("actiontype", "tooltip");
+ maction[2].setAttribute("actiontype", "statusline");
+ maction[3].removeAttribute("actiontype");
+
+ // Setting the selection attribute
+ maction[4].setAttribute("selection", "2");
+ maction[5].setAttribute("selection", "4");
+ maction[6].removeAttribute("selection");
+
+ // Setting the child list
+ maction[7].removeChild(maction[7].firstElementChild);
+ var e = maction[8].firstElementChild;
+ maction[8].insertBefore(e.cloneNode(true), e);
+ }
+ </script>
+
+ </head>
+ <body onload="test()">
+
+ <!-- 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. -->
+
+ <math>
+ <maction selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="statusline" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ <math>
+ <maction actiontype="toggle">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn><mn>2</mn><mn>3</mn><mn>4</mn>
+ </maction>
+ </math>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmactionexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction-expected.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction-expected.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction-expected.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,116 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>maction</title>
+ </head>
+ <body>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>3</mn>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>3</mn>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>2</mn>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mrow>
+ <mn>3</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>2</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>4</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ <mn>4</mn>
+ </mrow>
+ </math>
+ <math>
+ <mrow>
+ </mrow>
+ </math>
+ </p>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationmactionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,173 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>maction</title>
+ </head>
+ <body>
+
+ <!-- This test verifies which child of the maction element is selected. -->
+
+ <!-- For the statusline action type, the first child should be visible and the selection attribute should be ignored. -->
+ <p>
+ <math>
+ <maction actiontype="statusline">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="statusline" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ </p>
+
+ <!-- For the tooltip action type, the first child should be visible and the selection attribute should be ignored. -->
+ <p>
+ <math>
+ <maction actiontype="tooltip">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="tooltip" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ </p>
+
+ <!-- For the toggle action type, we use the selection attribute to determine the selected child. -->
+ <p>
+ <math>
+ <maction actiontype="toggle">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ </p>
+
+ <!-- For any unknown action type, we use the selection attribute to determine the selected child. -->
+ <p>
+ <math>
+ <maction actiontype="unknown">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="unknown" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ </p>
+
+ <!-- actiontype is case-sensitive, TOOLTIP is treated as unknown -->
+ <p>
+ <math>
+ <maction actiontype="TOOLTIP" selection="2">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </math>
+ </p>
+
+ <!-- Testing a couple of special values for the "selection" attribute -->
+ <p>
+ <!-- The selection attribute has data type xsd:positiveInteger
+ http://www.w3.org/TR/xmlschema-2/#positiveInteger -->
+ <math>
+ <maction actiontype="toggle" selection="+0003">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <!-- The MathML spec discourages the use of leading and trailing
+ whitespace, but they are not strictly prohibited. -->
+ <math>
+ <maction actiontype="toggle" selection="&#x20;&#x9;&#xD;&#xA;4&#x20;&#x9;&#xD;&#xA;">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <!-- The MathML spec suggests to rounded up or down to the closest value
+ within the allowed subset -->
+ <math>
+ <maction actiontype="toggle" selection="-5">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="-1">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="0">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="2.25">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="5">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="8">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ </maction>
+ </math>
+ <math>
+ <maction actiontype="toggle" selection="1">
+ </maction>
+ </math>
+ </p>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationsemanticsexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/semantics-expected.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-expected.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/semantics-expected.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>semantics</title>
+ </head>
+ <body>
+
+ <math>
+ <mrow>
+ <mi>x</mi>
+ </mrow>
+ </math>
+
+ <math>
+ <mrow>
+ <mspace width="20px" height="20px" mathbackground="red"/>
+ </mrow>
+ </math>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationsemanticshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/semantics.html (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics.html         (rev 0)
+++ trunk/LayoutTests/mathml/presentation/semantics.html        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!doctype html>
+<html>
+ <head>
+ <title>semantics</title>
+ </head>
+ <body>
+
+ <!-- This verifies that annotations are not visible. -->
+ <math>
+ <semantics>
+ <mi>x</mi>
+ <annotation encoding="TeX">x</annotation>
+ <annotation encoding="StarMath 5.0">x</annotation>
+ <annotation-xml encoding="MathML-Content"><ci>x</ci></annotation-xml>
+ </semantics>
+ </math>
+
+ <!-- This is not valid MathML but has become a standard hack to include SVG in MathML because of Gecko's initial implementation. -->
+ <math>
+ <semantics>
+ <annotation-xml encoding="SVG1.1">
+ <svg width="20px" height="20px">
+ <rect width="20px" height="20px" fill="red" stroke="none"/>
+ </svg>
+ </annotation-xml>
+ </semantics>
+ </math>
+
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -1704,6 +1704,7 @@
</span><span class="cx"> mathml/MathMLElement.cpp
</span><span class="cx"> mathml/MathMLInlineContainerElement.cpp
</span><span class="cx"> mathml/MathMLMathElement.cpp
</span><ins>+ mathml/MathMLSelectElement.cpp
</ins><span class="cx"> mathml/MathMLTextElement.cpp
</span><span class="cx">
</span><span class="cx"> page/AutoscrollController.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/ChangeLog        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2013-12-03 Frédéric Wang <fred.wang@free.fr>
+
+ Add an MathMLSelectElement class to implement <maction> and <semantics>.
+ <https://webkit.org/b/120058>
+
+ Reviewed by Chris Fleizach.
+
+ Tests: mathml/presentation/maction-dynamic.html
+ mathml/presentation/maction.html
+ mathml/presentation/semantics.html
+
+ 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 when
+ bug 124128 is fixed ; 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).
+
+ * CMakeLists.txt: add the new files.
+ * GNUmakefile.list.am: ditto
+ * Target.pri: ditto
+ * WebCore.vcxproj/WebCore.vcxproj: ditto
+ * WebCore.vcxproj/WebCore.vcxproj.filters: ditto
+ * WebCore.xcodeproj/project.pbxproj: ditto
+ * css/mathml.css: remove the CSS rule for annotation/annotation-xml.
+ * mathml/MathMLAllInOne.cpp: add the new cpp file.
+ * mathml/MathMLSelectElement.cpp: Added.
+ (WebCore::MathMLSelectElement::MathMLSelectElement):
+ (WebCore::MathMLSelectElement::create):
+ (WebCore::MathMLSelectElement::createRenderer):
+ (WebCore::MathMLSelectElement::childShouldCreateRenderer):
+ (WebCore::MathMLSelectElement::finishParsingChildren):
+ (WebCore::MathMLSelectElement::childrenChanged):
+ (WebCore::MathMLSelectElement::attributeChanged):
+ (WebCore::MathMLSelectElement::updateSelectedChild): basic implementation for maction, semantics, maction@actiontype and maction@selection.
+ * mathml/MathMLSelectElement.h: Added.
+ * mathml/mathattrs.in: add actiontype and selection attributes.
+ * mathml/mathtags.in: set element classes for maction, semantics, annotation and annotation-xml.
+
</ins><span class="cx"> 2013-12-03 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
</span><span class="cx">
</span><span class="cx"> Nix Upstream: Adding missing nix new files to WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -4050,6 +4050,8 @@
</span><span class="cx">         Source/WebCore/mathml/MathMLInlineContainerElement.h \
</span><span class="cx">         Source/WebCore/mathml/MathMLMathElement.cpp \
</span><span class="cx">         Source/WebCore/mathml/MathMLMathElement.h \
</span><ins>+        Source/WebCore/mathml/MathMLSelectElement.cpp \
+        Source/WebCore/mathml/MathMLSelectElement.h \
</ins><span class="cx">         Source/WebCore/mathml/MathMLTextElement.cpp \
</span><span class="cx">         Source/WebCore/mathml/MathMLTextElement.h \
</span><span class="cx">         Source/WebCore/page/animation/AnimationBase.cpp \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -18040,6 +18040,14 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\mathml\MathMLSelectElement.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\mathml\MathMLTextElement.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -20976,6 +20984,7 @@
</span><span class="cx"> <ClInclude Include="..\mathml\MathMLElement.h" />
</span><span class="cx"> <ClInclude Include="..\mathml\MathMLInlineContainerElement.h" />
</span><span class="cx"> <ClInclude Include="..\mathml\MathMLMathElement.h" />
</span><ins>+ <ClInclude Include="..\mathml\MathMLSelectElement.h" />
</ins><span class="cx"> <ClInclude Include="..\mathml\MathMLTextElement.h" />
</span><span class="cx"> <ClInclude Include="..\editing\AlternativeTextController.h" />
</span><span class="cx"> <ClInclude Include="..\config.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -4977,6 +4977,9 @@
</span><span class="cx"> <ClCompile Include="..\mathml\MathMLMathElement.cpp">
</span><span class="cx"> <Filter>rendering\mathml</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\mathml\MathMLSelectElement.cpp">
+ <Filter>rendering\mathml</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="..\mathml\MathMLTextElement.cpp">
</span><span class="cx"> <Filter>rendering\mathml</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -12549,6 +12552,9 @@
</span><span class="cx"> <ClInclude Include="..\mathml\MathMLMathElement.h">
</span><span class="cx"> <Filter>rendering\mathml</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\mathml\MathMLSelectElement.h">
+ <Filter>rendering\mathml</Filter>
+ </ClInclude>
</ins><span class="cx"> <ClInclude Include="..\mathml\MathMLTextElement.h">
</span><span class="cx"> <Filter>rendering\mathml</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -6310,6 +6310,7 @@
</span><span class="cx">                 FEBC5F3116BD0CC300659BD3 /* DatabaseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEBC5F2F16BD0CC300659BD3 /* DatabaseBase.cpp */; };
</span><span class="cx">                 FEBC5F3216BD0CC300659BD3 /* DatabaseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = FEBC5F3016BD0CC300659BD3 /* DatabaseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FED13D3A0CEA934600D89466 /* EditorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FED13D390CEA934600D89466 /* EditorIOS.mm */; };
</span><ins>+                FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */; };
</ins><span class="cx">                 FEDBFF16182B7A8D0017FA64 /* BreakpointID.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDBFF14182B7A8D0017FA64 /* BreakpointID.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEDEF84116797108000E444A /* DatabaseStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEDEF83F16797108000E444A /* DatabaseStrategy.cpp */; };
</span><span class="cx">                 FEDEF84216797108000E444A /* DatabaseStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDEF84016797108000E444A /* DatabaseStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8654,6 +8655,7 @@
</span><span class="cx">                 59309A1211F4AE6A00250603 /* DeviceOrientationClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationClientMock.h; sourceTree = "<group>"; };
</span><span class="cx">                 5958F1CB1343917C0080B31F /* XMLViewer.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = XMLViewer.css; sourceTree = "<group>"; };
</span><span class="cx">                 5958F1CC1343917C0080B31F /* XMLViewer.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = XMLViewer.js; sourceTree = "<group>"; };
</span><ins>+                59780849D41E6F65D81198BC /* MathMLSelectElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLSelectElement.h; sourceTree = "<group>"; };
</ins><span class="cx">                 598365DC1355F53C001B185D /* JSPositionCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionCallback.h; sourceTree = "<group>"; };
</span><span class="cx">                 598365DE1355F562001B185D /* JSPositionErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionErrorCallback.h; sourceTree = "<group>"; };
</span><span class="cx">                 598365E31355F604001B185D /* JSPositionCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionCallback.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -13142,6 +13144,7 @@
</span><span class="cx">                 F5C2869502846DCD018635CA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
</span><span class="cx">                 F5E0C6591643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseChooserOnlyDateAndTimeInputType.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 F5E0C65A1643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseChooserOnlyDateAndTimeInputType.h; sourceTree = "<group>"; };
</span><ins>+                F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLSelectElement.cpp; sourceTree = "<group>"; };
</ins><span class="cx">                 F7A034C3126BF6BE007DC19E /* FontOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontOrientation.h; sourceTree = "<group>"; };
</span><span class="cx">                 F8216299029F4FB501000131 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 F916C48B0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSXMLHttpRequestProgressEvent.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -21643,6 +21646,8 @@
</span><span class="cx">                                 FABE72F01059C1EB00D999DD /* MathMLInlineContainerElement.h */,
</span><span class="cx">                                 FABE72F11059C1EB00D999DD /* MathMLMathElement.cpp */,
</span><span class="cx">                                 FABE72F21059C1EB00D999DD /* MathMLMathElement.h */,
</span><ins>+                                F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */,
+                                59780849D41E6F65D81198BC /* MathMLSelectElement.h */,
</ins><span class="cx">                                 FA654A691108ABED002615E0 /* MathMLTextElement.cpp */,
</span><span class="cx">                                 FA654A6A1108ABED002615E0 /* MathMLTextElement.h */,
</span><span class="cx">                                 FABE72F31059C1EB00D999DD /* mathtags.in */,
</span><span class="lines">@@ -25675,6 +25680,7 @@
</span><span class="cx">                                 FD31608512B026F700C1A359 /* AudioResampler.cpp in Sources */,
</span><span class="cx">                                 FD31608712B026F700C1A359 /* AudioResamplerKernel.cpp in Sources */,
</span><span class="cx">                                 FD8C46EB154608E700A5910C /* AudioScheduledSourceNode.cpp in Sources */,
</span><ins>+                                FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */,
</ins><span class="cx">                                 078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
</span><span class="cx">                                 CDA79824170A258300D45C55 /* AudioSession.cpp in Sources */,
</span><span class="cx">                                 CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/css/mathml.css        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -153,10 +153,6 @@
</span><span class="cx"> font-size: 1.5em;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-annotation, annotation-xml {
- display: none;
-}
-
</del><span class="cx"> mphantom {
</span><span class="cx"> visibility: hidden;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLAllInOne.cpp (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLAllInOne.cpp        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/mathml/MathMLAllInOne.cpp        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -28,5 +28,6 @@
</span><span class="cx"> #include "MathMLElement.cpp"
</span><span class="cx"> #include "MathMLInlineContainerElement.cpp"
</span><span class="cx"> #include "MathMLMathElement.cpp"
</span><ins>+#include "MathMLSelectElement.cpp"
</ins><span class="cx"> #include "MathMLTextElement.cpp"
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -45,13 +45,12 @@
</span><span class="cx"> MathMLElement(const QualifiedName& tagName, Document&);
</span><span class="cx">
</span><span class="cx"> virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
</span><ins>+ virtual bool childShouldCreateRenderer(const Node&) const OVERRIDE;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
</span><span class="cx"> virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) OVERRIDE;
</span><span class="cx">
</span><del>- virtual bool childShouldCreateRenderer(const Node&) const OVERRIDE;
-
</del><span class="cx"> inline bool isMathMLToken() const;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLInlineContainerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx">
</span><span class="cx"> RenderElement* MathMLInlineContainerElement::createRenderer(PassRef<RenderStyle> style)
</span><span class="cx"> {
</span><ins>+ if (hasLocalName(annotation_xmlTag))
+ return new RenderMathMLRow(*this, std::move(style));
</ins><span class="cx"> if (hasLocalName(mrowTag))
</span><span class="cx"> return new RenderMathMLRow(*this, std::move(style));
</span><span class="cx"> if (hasLocalName(msubTag))
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp         (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+/*
+ * Copyright (C) 2013 The MathJax Consortium. 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
+ * "AS IS" 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 "config.h"
+#include "MathMLSelectElement.h"
+
+#if ENABLE(MATHML)
+
+#include "MathMLNames.h"
+#include "RenderMathMLRow.h"
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+MathMLSelectElement::MathMLSelectElement(const QualifiedName& tagName, Document& document)
+ : MathMLInlineContainerElement(tagName, document)
+ , m_selectedChild(nullptr)
+{
+}
+
+PassRefPtr<MathMLSelectElement> MathMLSelectElement::create(const QualifiedName& tagName, Document& document)
+{
+ return adoptRef(new MathMLSelectElement(tagName, document));
+}
+
+RenderElement* MathMLSelectElement::createRenderer(PassRef<RenderStyle> style)
+{
+ return new RenderMathMLRow(*this, std::move(style));
+}
+
+bool MathMLSelectElement::childShouldCreateRenderer(const Node& child) const
+{
+ return MathMLElement::childShouldCreateRenderer(child) && m_selectedChild == &child;
+}
+
+void MathMLSelectElement::finishParsingChildren()
+{
+ updateSelectedChild();
+ MathMLInlineContainerElement::finishParsingChildren();
+}
+
+void MathMLSelectElement::childrenChanged(const ChildChange& change)
+{
+ updateSelectedChild();
+ MathMLInlineContainerElement::childrenChanged(change);
+}
+
+void MathMLSelectElement::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason reason)
+{
+ if (hasLocalName(mactionTag) && (name == MathMLNames::actiontypeAttr || name == MathMLNames::selectionAttr))
+ updateSelectedChild();
+
+ MathMLInlineContainerElement::attributeChanged(name, newValue, reason);
+}
+
+void MathMLSelectElement::updateSelectedChild()
+{
+ Element* newSelectedChild = firstElementChild();
+
+ if (newSelectedChild) {
+ if (hasLocalName(mactionTag)) {
+ // The value of the actiontype attribute is case-sensitive.
+ const AtomicString& actiontype = fastGetAttribute(MathMLNames::actiontypeAttr);
+ if (actiontype == "statusline")
+ // FIXME: implement user interaction for the "statusline" action type (http://wkbug/124922).
+ { }
+ else if (actiontype == "tooltip")
+ // FIXME: implement user interaction for the "tooltip" action type (http://wkbug/124921).
+ { }
+ else {
+ // FIXME: implement user interaction for the "toggle" action type (http://wkbug/120059).
+ // For the "toggle" action type or any unknown action type, we rely on the value of the selection attribute to determine the visible child.
+ int selection = fastGetAttribute(MathMLNames::selectionAttr).toInt();
+ for (int i = 1; i < selection; i++) {
+ Element* nextChild = newSelectedChild->nextElementSibling();
+ if (!nextChild)
+ break;
+ newSelectedChild = nextChild;
+ }
+ }
+ } else {
+ ASSERT(hasLocalName(semanticsTag));
+ // FIXME: implement Gecko's selection algorithm for <semantics> (http://wkbug/100626).
+ }
+ }
+
+ if (m_selectedChild == newSelectedChild)
+ return;
+
+ if (m_selectedChild && m_selectedChild->renderer())
+ Style::detachRenderTree(*m_selectedChild);
+
+ m_selectedChild = newSelectedChild;
+ setNeedsStyleRecalc();
+}
+
+}
+
+#endif // ENABLE(MATHML)
</ins></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementhfromrev160004trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/mathml/MathMLSelectElement.h (from rev 160004, trunk/Source/WebCore/mathml/MathMLElement.h) (0 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.h         (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.h        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+/*
+ * Copyright (C) 2013 The MathJax Consortium. 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
+ * "AS IS" 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 MathMLSelectElement_h
+#define MathMLSelectElement_h
+
+#if ENABLE(MATHML)
+#include "MathMLInlineContainerElement.h"
+
+namespace WebCore {
+
+class MathMLSelectElement FINAL : public MathMLInlineContainerElement {
+public:
+ static PassRefPtr<MathMLSelectElement> create(const QualifiedName& tagName, Document&);
+
+private:
+ MathMLSelectElement(const QualifiedName& tagName, Document&);
+ virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
+
+ virtual bool childShouldCreateRenderer(const Node&) const OVERRIDE;
+
+ virtual void finishParsingChildren() OVERRIDE;
+ virtual void childrenChanged(const ChildChange&) OVERRIDE;
+ virtual void attributeChanged(const QualifiedName&, const AtomicString&, AttributeModificationReason = ModifiedDirectly) OVERRIDE;
+
+ void updateSelectedChild();
+ Element* m_selectedChild;
+};
+
+}
+
+#endif // ENABLE(MATHML)
+#endif // MathMLSelectElement_h
</ins></span></pre></div>
<a id="trunkSourceWebCoremathmlmathattrsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/mathattrs.in (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/mathattrs.in        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/mathml/mathattrs.in        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -3,6 +3,7 @@
</span><span class="cx"> guardFactoryWith="ENABLE(MATHML)"
</span><span class="cx"> attrsNullNamespace
</span><span class="cx">
</span><ins>+actiontype
</ins><span class="cx"> alttext
</span><span class="cx"> background
</span><span class="cx"> close
</span><span class="lines">@@ -26,6 +27,7 @@
</span><span class="cx"> numalign
</span><span class="cx"> open
</span><span class="cx"> rowspan
</span><ins>+selection
</ins><span class="cx"> separators
</span><span class="cx"> stretchy
</span><span class="cx"> subscriptshift
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlmathtagsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/mathtags.in (160004 => 160005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/mathtags.in        2013-12-03 17:09:54 UTC (rev 160004)
+++ trunk/Source/WebCore/mathml/mathtags.in        2013-12-03 17:12:38 UTC (rev 160005)
</span><span class="lines">@@ -3,6 +3,9 @@
</span><span class="cx"> guardFactoryWith="ENABLE(MATHML)"
</span><span class="cx"> fallbackInterfaceName="MathMLElement"
</span><span class="cx">
</span><ins>+annotation interfaceName=MathMLTextElement
+annotation-xml interfaceName=MathMLInlineContainerElement
+maction interfaceName=MathMLSelectElement
</ins><span class="cx"> math
</span><span class="cx"> mfrac interfaceName=MathMLInlineContainerElement
</span><span class="cx"> mfenced interfaceName=MathMLInlineContainerElement
</span><span class="lines">@@ -27,10 +30,10 @@
</span><span class="cx"> mmultiscripts interfaceName=MathMLInlineContainerElement
</span><span class="cx"> mprescripts interfaceName=MathMLInlineContainerElement
</span><span class="cx"> none interfaceName=MathMLInlineContainerElement
</span><ins>+semantics interfaceName=MathMLSelectElement
</ins><span class="cx">
</span><span class="cx"> #if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
</span><span class="cx"> ms
</span><span class="cx"> mglyph
</span><span class="cx"> malignmark
</span><del>-annotation-xml
</del><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>