<!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>[203396] trunk/Source/WebCore</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/203396">203396</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-07-18 22:42:46 -0700 (Mon, 18 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move parsing of subscriptshift and superscriptshift from rendering to element classes
https://bugs.webkit.org/show_bug.cgi?id=159622

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-07-18
Reviewed by Darin Adler.

We introduce a new MathMLScriptsElement that is used for elements msub, msup, msubsup and
mmultiscripts in order to create RenderMathMLScripts and parse and expose the values of the
subscriptshift and superscriptshift attributes. This is one more step toward moving MathML
attribute parsing to the DOM (bug 156536).

No new tests, rendering is unchanged.

* CMakeLists.txt: Add MathMLScriptsElement files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* mathml/MathMLAllInOne.cpp: Ditto.
* mathml/MathMLInlineContainerElement.cpp: Remove handling of scripts.
(WebCore::MathMLInlineContainerElement::createElementRenderer): Deleted.
* mathml/MathMLScriptsElement.cpp: Added. New class to handle scripted elements supporting
parsing for the subscriptshift and superscriptshift MathML lengths.
(WebCore::MathMLScriptsElement::MathMLScriptsElement):
(WebCore::MathMLScriptsElement::create):
(WebCore::MathMLScriptsElement::subscriptShift): Expose the cached length for the shift,
parsing the attribute again if necessary.
(WebCore::MathMLScriptsElement::superscriptShift): Ditto.
(WebCore::MathMLScriptsElement::parseAttribute): Mark attributes dirty.
(WebCore::MathMLScriptsElement::createElementRenderer): Create RenderMathMLScripts.
* mathml/MathMLScriptsElement.h: Ditto.
* mathml/mathtags.in: Map msub, msup, msubsup and mmultiscripts to MathMLScriptsElement.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::scriptsElement): Helper function to cast the node to a
MathMLScriptsElement.
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Resolve the attributes
using the functions from the MathMLScriptsElement class.
* rendering/mathml/RenderMathMLScripts.h: Declare scriptsElement.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLAllInOnecpp">trunk/Source/WebCore/mathml/MathMLAllInOne.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLInlineContainerElementcpp">trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlmathtagsin">trunk/Source/WebCore/mathml/mathtags.in</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLScriptsh">trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoremathmlMathMLScriptsElementcpp">trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLScriptsElementh">trunk/Source/WebCore/mathml/MathMLScriptsElement.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -1991,6 +1991,7 @@
</span><span class="cx">     mathml/MathMLMencloseElement.cpp
</span><span class="cx">     mathml/MathMLOperatorDictionary.cpp
</span><span class="cx">     mathml/MathMLPaddedElement.cpp
</span><ins>+    mathml/MathMLScriptsElement.cpp
</ins><span class="cx">     mathml/MathMLSelectElement.cpp
</span><span class="cx">     mathml/MathMLSpaceElement.cpp
</span><span class="cx">     mathml/MathMLTextElement.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/ChangeLog        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -1,5 +1,42 @@
</span><span class="cx"> 2016-07-18  Frederic Wang  &lt;fwang@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        Move parsing of subscriptshift and superscriptshift from rendering to element classes
+        https://bugs.webkit.org/show_bug.cgi?id=159622
+
+        Reviewed by Darin Adler.
+
+        We introduce a new MathMLScriptsElement that is used for elements msub, msup, msubsup and
+        mmultiscripts in order to create RenderMathMLScripts and parse and expose the values of the
+        subscriptshift and superscriptshift attributes. This is one more step toward moving MathML
+        attribute parsing to the DOM (bug 156536).
+
+        No new tests, rendering is unchanged.
+
+        * CMakeLists.txt: Add MathMLScriptsElement files.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * mathml/MathMLAllInOne.cpp: Ditto.
+        * mathml/MathMLInlineContainerElement.cpp: Remove handling of scripts.
+        (WebCore::MathMLInlineContainerElement::createElementRenderer): Deleted.
+        * mathml/MathMLScriptsElement.cpp: Added. New class to handle scripted elements supporting
+        parsing for the subscriptshift and superscriptshift MathML lengths.
+        (WebCore::MathMLScriptsElement::MathMLScriptsElement):
+        (WebCore::MathMLScriptsElement::create):
+        (WebCore::MathMLScriptsElement::subscriptShift): Expose the cached length for the shift,
+        parsing the attribute again if necessary.
+        (WebCore::MathMLScriptsElement::superscriptShift): Ditto.
+        (WebCore::MathMLScriptsElement::parseAttribute): Mark attributes dirty.
+        (WebCore::MathMLScriptsElement::createElementRenderer): Create RenderMathMLScripts.
+        * mathml/MathMLScriptsElement.h: Ditto.
+        * mathml/mathtags.in: Map msub, msup, msubsup and mmultiscripts to MathMLScriptsElement.
+        * rendering/mathml/RenderMathMLScripts.cpp:
+        (WebCore::RenderMathMLScripts::scriptsElement): Helper function to cast the node to a
+        MathMLScriptsElement.
+        (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Resolve the attributes
+        using the functions from the MathMLScriptsElement class.
+        * rendering/mathml/RenderMathMLScripts.h: Declare scriptsElement.
+
+2016-07-18  Frederic Wang  &lt;fwang@igalia.com&gt;
+
</ins><span class="cx">         Do not store gap and shift parameters on RenderMathMLFraction
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=159876
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -5404,6 +5404,7 @@
</span><span class="cx">                 B57CB52D182A3EED0079A647 /* InlineElementBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */; };
</span><span class="cx">                 B57CB52E182A3EFC0079A647 /* InlineElementBox.h in Headers */ = {isa = PBXBuildFile; fileRef = B57CB52B182A37F60079A647 /* InlineElementBox.h */; };
</span><span class="cx">                 B595FF471824CEE300FF51CD /* RenderIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B595FF461824CEE300FF51CD /* RenderIterator.h */; };
</span><ins>+                B59CA390CED66C3255F72B48 /* MathMLScriptsElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59CA59AF170D8FAA5B8C9AD /* MathMLScriptsElement.cpp */; };
</ins><span class="cx">                 B59CA390CED66C3255F72C59 /* MathMLPaddedElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59CA59AF170D8FAA5B8CABE /* MathMLPaddedElement.cpp */; };
</span><span class="cx">                 B59DD699119029E5007E9684 /* JSDatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B59DD697119029E5007E9684 /* JSDatabaseCallback.h */; };
</span><span class="cx">                 B59DD69A119029E5007E9684 /* JSDatabaseCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B59DD698119029E5007E9684 /* JSDatabaseCallback.cpp */; };
</span><span class="lines">@@ -13403,6 +13404,8 @@
</span><span class="cx">                 B57CB52B182A37F60079A647 /* InlineElementBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineElementBox.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineElementBox.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B595FF461824CEE300FF51CD /* RenderIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                B59CA59AF170D8FAA5B8C9AD /* MathMLScriptsElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLScriptsElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                B59CA849D41E6F65D81197AB /* MathMLScriptsElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLScriptsElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 B59CA59AF170D8FAA5B8CABE /* MathMLPaddedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLPaddedElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59CA849D41E6F65D81198BC /* MathMLPaddedElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLPaddedElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59DD697119029E5007E9684 /* JSDatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -24893,6 +24896,8 @@
</span><span class="cx">                                 CE6D89294C7AACE0AD89B3DD /* MathMLMencloseElement.h */,
</span><span class="cx">                                 D4F72C653A64807A83E76FB8 /* MathMLOperatorDictionary.cpp */,
</span><span class="cx">                                 DF7E9A294C7AACE0AD89B3DD /* MathMLOperatorDictionary.h */,
</span><ins>+                                B59CA59AF170D8FAA5B8C9AD /* MathMLScriptsElement.cpp */,
+                                B59CA849D41E6F65D81197AB /* MathMLScriptsElement.h */,
</ins><span class="cx">                                 B59CA59AF170D8FAA5B8CABE /* MathMLPaddedElement.cpp */,
</span><span class="cx">                                 B59CA849D41E6F65D81198BC /* MathMLPaddedElement.h */,
</span><span class="cx">                                 F75A059AF170D8FAA5B8CABE /* MathMLSelectElement.cpp */,
</span><span class="lines">@@ -31266,6 +31271,7 @@
</span><span class="cx">                                 16EA24CEEAB2A60534218ACF /* MathMLOperatorDictionary.cpp in Sources */,
</span><span class="cx">                                 FABE72FE1059C21100D999DD /* MathMLNames.cpp in Sources */,
</span><span class="cx">                                 439176DF12DA25E17BAF80A2 /* MathMLStyle.cpp in Sources */,
</span><ins>+                                B59CA390CED66C3255F72B48 /* MathMLScriptsElement.cpp in Sources */,
</ins><span class="cx">                                 B59CA390CED66C3255F72C59 /* MathMLPaddedElement.cpp in Sources */,
</span><span class="cx">                                 FED48390CED66C3255F72C59 /* MathMLSelectElement.cpp in Sources */,
</span><span class="cx">                                 4FA65A6B1108ABED002615E0 /* MathMLSpaceElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLAllInOne.cpp (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLAllInOne.cpp        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/mathml/MathMLAllInOne.cpp        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;MathMLMencloseElement.cpp&quot;
</span><span class="cx"> #include &quot;MathMLOperatorDictionary.cpp&quot;
</span><span class="cx"> #include &quot;MathMLPaddedElement.cpp&quot;
</span><ins>+#include &quot;MathMLScriptsElement.cpp&quot;
</ins><span class="cx"> #include &quot;MathMLSelectElement.cpp&quot;
</span><span class="cx"> #include &quot;MathMLTextElement.cpp&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLInlineContainerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> #include &quot;RenderMathMLMenclose.h&quot;
</span><span class="cx"> #include &quot;RenderMathMLRoot.h&quot;
</span><span class="cx"> #include &quot;RenderMathMLRow.h&quot;
</span><del>-#include &quot;RenderMathMLScripts.h&quot;
</del><span class="cx"> #include &quot;RenderMathMLUnderOver.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -66,8 +65,6 @@
</span><span class="cx"> {
</span><span class="cx">     if (hasTagName(annotation_xmlTag) || hasTagName(merrorTag) || hasTagName(mphantomTag) || hasTagName(mrowTag) || hasTagName(mstyleTag))
</span><span class="cx">         return createRenderer&lt;RenderMathMLRow&gt;(*this, WTFMove(style));
</span><del>-    if (hasTagName(msubTag) || hasTagName(msupTag) || hasTagName(msubsupTag) || hasTagName(mmultiscriptsTag))
-        return createRenderer&lt;RenderMathMLScripts&gt;(*this, WTFMove(style));
</del><span class="cx">     if (hasTagName(moverTag) || hasTagName(munderTag) || hasTagName(munderoverTag))
</span><span class="cx">         return createRenderer&lt;RenderMathMLUnderOver&gt;(*this, WTFMove(style));
</span><span class="cx">     if (hasTagName(msqrtTag) || hasTagName(mrootTag))
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLScriptsElementcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp (0 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp                                (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(MATHML)
+#include &quot;MathMLScriptsElement.h&quot;
+
+#include &quot;RenderMathMLScripts.h&quot;
+
+namespace WebCore {
+
+using namespace MathMLNames;
+
+inline MathMLScriptsElement::MathMLScriptsElement(const QualifiedName&amp; tagName, Document&amp; document)
+    : MathMLInlineContainerElement(tagName, document)
+{
+}
+
+Ref&lt;MathMLScriptsElement&gt; MathMLScriptsElement::create(const QualifiedName&amp; tagName, Document&amp; document)
+{
+    return adoptRef(*new MathMLScriptsElement(tagName, document));
+}
+
+const MathMLElement::Length&amp; MathMLScriptsElement::subscriptShift()
+{
+    return cachedMathMLLength(subscriptshiftAttr, m_subscriptShift);
+}
+
+const MathMLElement::Length&amp; MathMLScriptsElement::superscriptShift()
+{
+    return cachedMathMLLength(superscriptshiftAttr, m_superscriptShift);
+}
+
+void MathMLScriptsElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
+{
+    if (name == subscriptshiftAttr)
+        m_subscriptShift.dirty = true;
+    else if (name == superscriptshiftAttr)
+        m_superscriptShift.dirty = true;
+
+    MathMLElement::parseAttribute(name, value);
+}
+
+RenderPtr&lt;RenderElement&gt; MathMLScriptsElement::createElementRenderer(RenderStyle&amp;&amp; style, const RenderTreePosition&amp;)
+{
+    ASSERT(hasTagName(msubTag) || hasTagName(msupTag) || hasTagName(msubsupTag) || hasTagName(mmultiscriptsTag));
+    return createRenderer&lt;RenderMathMLScripts&gt;(*this, WTFMove(style));
+}
+
+}
+
+#endif // ENABLE(MATHML)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/mathml/MathMLScriptsElement.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoremathmlMathMLScriptsElementhfromrev203395trunkSourceWebCorerenderingmathmlRenderMathMLScriptsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/mathml/MathMLScriptsElement.h (from rev 203395, trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h) (0 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLScriptsElement.h                                (rev 0)
+++ trunk/Source/WebCore/mathml/MathMLScriptsElement.h        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(MATHML)
+#include &quot;MathMLInlineContainerElement.h&quot;
+
+namespace WebCore {
+
+class MathMLScriptsElement final : public MathMLInlineContainerElement {
+public:
+    static Ref&lt;MathMLScriptsElement&gt; create(const QualifiedName&amp; tagName, Document&amp;);
+    const Length&amp; subscriptShift();
+    const Length&amp; superscriptShift();
+
+private:
+    MathMLScriptsElement(const QualifiedName&amp; tagName, Document&amp;);
+    RenderPtr&lt;RenderElement&gt; createElementRenderer(RenderStyle&amp;&amp;, const RenderTreePosition&amp;) final;
+    void parseAttribute(const QualifiedName&amp;, const AtomicString&amp;) final;
+
+    Length m_subscriptShift;
+    Length m_superscriptShift;
+};
+
+}
+
+#endif // ENABLE(MATHML)
</ins></span></pre></div>
<a id="trunkSourceWebCoremathmlmathtagsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/mathtags.in (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/mathtags.in        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/mathml/mathtags.in        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx"> math
</span><span class="cx"> mfrac interfaceName=MathMLFractionElement
</span><span class="cx"> mfenced interfaceName=MathMLInlineContainerElement
</span><del>-msubsup interfaceName=MathMLInlineContainerElement
</del><ins>+msubsup interfaceName=MathMLScriptsElement
</ins><span class="cx"> merror interfaceName=MathMLInlineContainerElement
</span><span class="cx"> mpadded interfaceName=MathMLPaddedElement
</span><span class="cx"> mphantom interfaceName=MathMLInlineContainerElement
</span><span class="lines">@@ -26,12 +26,12 @@
</span><span class="cx"> mtext interfaceName=MathMLTextElement
</span><span class="cx"> ms interfaceName=MathMLTextElement
</span><span class="cx"> mspace interfaceName=MathMLSpaceElement
</span><del>-msub interfaceName=MathMLInlineContainerElement
-msup interfaceName=MathMLInlineContainerElement
</del><ins>+msub interfaceName=MathMLScriptsElement
+msup interfaceName=MathMLScriptsElement
</ins><span class="cx"> mtable interfaceName=MathMLInlineContainerElement
</span><span class="cx"> mtr interfaceName=MathMLElement
</span><span class="cx"> mtd interfaceName=MathMLElement
</span><del>-mmultiscripts interfaceName=MathMLInlineContainerElement
</del><ins>+mmultiscripts interfaceName=MathMLScriptsElement
</ins><span class="cx"> mprescripts interfaceName=MathMLInlineContainerElement
</span><span class="cx"> menclose interfaceName=MathMLMencloseElement
</span><span class="cx"> none interfaceName=MathMLInlineContainerElement
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;RenderMathMLScripts.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MathMLElement.h&quot;
</span><ins>+#include &quot;MathMLScriptsElement.h&quot;
</ins><span class="cx"> #include &quot;RenderMathMLOperator.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -65,6 +66,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+MathMLScriptsElement&amp; RenderMathMLScripts::scriptsElement() const
+{
+    ASSERT(!isRenderMathMLUnderOver());
+    return static_cast&lt;MathMLScriptsElement&amp;&gt;(nodeForNonAnonymous());
+}
+
</ins><span class="cx"> RenderMathMLOperator* RenderMathMLScripts::unembellishedOperator()
</span><span class="cx"> {
</span><span class="cx">     auto base = firstChildBox();
</span><span class="lines">@@ -251,8 +258,9 @@
</span><span class="cx">     if (m_scriptType == Sub || m_scriptType == SubSup || m_scriptType == Multiscripts || m_scriptType == Under || m_scriptType == UnderOver) {
</span><span class="cx">         minSubScriptShift = std::max(subscriptShiftDown, baseDescent + subscriptBaselineDropMin);
</span><span class="cx">         if (!isRenderMathMLUnderOver()) {
</span><del>-            LayoutUnit specifiedMinSubShift = 0;
-            parseMathMLLength(element()-&gt;attributeWithoutSynchronization(MathMLNames::subscriptshiftAttr), specifiedMinSubShift, &amp;style(), false);
</del><ins>+            // It is not clear how to interpret the default shift and it is not available yet anyway.
+            // Hence we just pass 0 as the default value used by toUserUnits.
+            LayoutUnit specifiedMinSubShift = toUserUnits(scriptsElement().subscriptShift(), style(), 0);
</ins><span class="cx">             minSubScriptShift = std::max(minSubScriptShift, specifiedMinSubShift);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -259,8 +267,9 @@
</span><span class="cx">     if (m_scriptType == Super || m_scriptType == SubSup || m_scriptType == Multiscripts  || m_scriptType == Over || m_scriptType == UnderOver) {
</span><span class="cx">         minSupScriptShift = std::max(superscriptShiftUp, baseAscent - superScriptBaselineDropMax);
</span><span class="cx">         if (!isRenderMathMLUnderOver()) {
</span><del>-            LayoutUnit specifiedMinSupShift = 0;
-            parseMathMLLength(element()-&gt;attributeWithoutSynchronization(MathMLNames::superscriptshiftAttr), specifiedMinSupShift, &amp;style(), false);
</del><ins>+            // It is not clear how to interpret the default shift and it is not available yet anyway.
+            // Hence we just pass 0 as the default value used by toUserUnits.
+            LayoutUnit specifiedMinSupShift = toUserUnits(scriptsElement().superscriptShift(), style(), 0);
</ins><span class="cx">             minSupScriptShift = std::max(minSupScriptShift, specifiedMinSupShift);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLScriptsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h (203395 => 203396)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h        2016-07-19 05:36:16 UTC (rev 203395)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.h        2016-07-19 05:42:46 UTC (rev 203396)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx"> #include &quot;RenderMathMLBlock.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+
+class MathMLScriptsElement;
+
</ins><span class="cx"> // Render a base with scripts.
</span><span class="cx"> class RenderMathMLScripts : public RenderMathMLBlock {
</span><span class="cx"> public:
</span><span class="lines">@@ -48,6 +51,7 @@
</span><span class="cx">     ScriptsType m_scriptType;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    MathMLScriptsElement&amp; scriptsElement() const;
</ins><span class="cx">     Optional&lt;int&gt; firstLineBaseline() const final;
</span><span class="cx">     bool getBaseAndScripts(RenderBox*&amp; base, RenderBox*&amp; firstPostScript, RenderBox*&amp; firstPreScript);
</span><span class="cx">     LayoutUnit spaceAfterScript();
</span></span></pre>
</div>
</div>

</body>
</html>