<!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>[200186] 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/200186">200186</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-04-28 05:18:23 -0700 (Thu, 28 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/200185">r200185</a>.
https://bugs.webkit.org/show_bug.cgi?id=157131

Bad temporary file added unintentionally (Requested by fredw
on #webkit).

Reverted changeset:

&quot;RenderMathMLOperator refactoring: introduce getBaseGlyph and
remove parameter from getDisplayStyleLargeOperator&quot;
https://bugs.webkit.org/show_bug.cgi?id=156910
http://trac.webkit.org/changeset/200185</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLOperatorh">trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WPE/</li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (200185 => 200186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2016-04-28 12:09:38 UTC (rev 200185)
+++ trunk/ChangeLog        2016-04-28 12:18:23 UTC (rev 200186)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-04-28  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r200185.
+        https://bugs.webkit.org/show_bug.cgi?id=157131
+
+        Bad temporary file added unintentionally (Requested by fredw
+        on #webkit).
+
+        Reverted changeset:
+
+        &quot;RenderMathMLOperator refactoring: introduce getBaseGlyph and
+        remove parameter from getDisplayStyleLargeOperator&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=156910
+        http://trac.webkit.org/changeset/200185
+
</ins><span class="cx"> 2016-04-25  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove the build flag for template elements
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200185 => 200186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-28 12:09:38 UTC (rev 200185)
+++ trunk/Source/WebCore/ChangeLog        2016-04-28 12:18:23 UTC (rev 200186)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-04-28  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r200185.
+        https://bugs.webkit.org/show_bug.cgi?id=157131
+
+        Bad temporary file added unintentionally (Requested by fredw
+        on #webkit).
+
+        Reverted changeset:
+
+        &quot;RenderMathMLOperator refactoring: introduce getBaseGlyph and
+        remove parameter from getDisplayStyleLargeOperator&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=156910
+        http://trac.webkit.org/changeset/200185
+
</ins><span class="cx"> 2016-04-28  Frederic Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         RenderMathMLOperator refactoring: introduce getBaseGlyph and remove parameter from getDisplayStyleLargeOperator
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp (200185 => 200186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-04-28 12:09:38 UTC (rev 200185)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp        2016-04-28 12:18:23 UTC (rev 200186)
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx">     if (isLargeOperatorInDisplayStyle()) {
</span><span class="cx">         const auto&amp; primaryFont = style().fontCascade().primaryFont();
</span><span class="cx">         if (auto* mathData = primaryFont.mathData()) {
</span><del>-            StretchyData largeOperator = getDisplayStyleLargeOperator();
</del><ins>+            StretchyData largeOperator = getDisplayStyleLargeOperator(m_textContent);
</ins><span class="cx">             return mathData-&gt;getItalicCorrection(primaryFont, largeOperator.variant().glyph);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -306,8 +306,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GlyphData baseGlyph;
-    float maximumGlyphWidth = getBaseGlyph(style(), baseGlyph) ? advanceWidthForGlyph(baseGlyph) : 0;
</del><ins>+    GlyphData data = style().fontCascade().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
+    float maximumGlyphWidth = advanceWidthForGlyph(data);
</ins><span class="cx">     if (!m_isVertical) {
</span><span class="cx">         if (maximumGlyphWidth &lt; stretchSize())
</span><span class="cx">             maximumGlyphWidth = stretchSize();
</span><span class="lines">@@ -317,12 +317,12 @@
</span><span class="cx">     }
</span><span class="cx">     if (isLargeOperatorInDisplayStyle()) {
</span><span class="cx">         // Large operators in STIX Word have incorrect advance width, causing misplacement of superscript, so we use the glyph bound instead (http://sourceforge.net/p/stixfonts/tracking/49/).
</span><del>-        StretchyData largeOperator = getDisplayStyleLargeOperator();
</del><ins>+        StretchyData largeOperator = getDisplayStyleLargeOperator(m_textContent);
</ins><span class="cx">         if (largeOperator.mode() == DrawSizeVariant)
</span><span class="cx">             maximumGlyphWidth = boundsForGlyph(largeOperator.variant()).width();
</span><span class="cx">     } else {
</span><span class="cx">         // FIXME: some glyphs (e.g. the one for &quot;FRACTION SLASH&quot; in the STIX Math font or large operators) have a width that depends on the height, resulting in large gaps (https://bugs.webkit.org/show_bug.cgi?id=130326).
</span><del>-        findStretchyData(&amp;maximumGlyphWidth);
</del><ins>+        findStretchyData(m_textContent, &amp;maximumGlyphWidth);
</ins><span class="cx">     }
</span><span class="cx">     m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth = m_leadingSpace + maximumGlyphWidth + m_trailingSpace;
</span><span class="cx"> }
</span><span class="lines">@@ -386,12 +386,6 @@
</span><span class="cx">     updateOperatorProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderMathMLOperator::getBaseGlyph(const RenderStyle&amp; style, GlyphData&amp; baseGlyph) const
-{
-    baseGlyph = style.fontCascade().glyphDataForCharacter(m_textContent, !style.isLeftToRightDirection());
-    return baseGlyph.isValid() &amp;&amp; baseGlyph.font == &amp;style.fontCascade().primaryFont();
-}
-
</del><span class="cx"> bool RenderMathMLOperator::getGlyphAssemblyFallBack(Vector&lt;OpenTypeMathData::AssemblyPart&gt; assemblyParts, StretchyData&amp; stretchyData) const
</span><span class="cx"> {
</span><span class="cx">     GlyphData top;
</span><span class="lines">@@ -502,29 +496,30 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderMathMLOperator::StretchyData RenderMathMLOperator::getDisplayStyleLargeOperator() const
</del><ins>+RenderMathMLOperator::StretchyData RenderMathMLOperator::getDisplayStyleLargeOperator(UChar character) const
</ins><span class="cx"> {
</span><span class="cx">     StretchyData data;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(m_isVertical &amp;&amp; isLargeOperatorInDisplayStyle());
</span><span class="cx"> 
</span><del>-    GlyphData baseGlyph;
-    if (!getBaseGlyph(style(), baseGlyph) || !baseGlyph.font-&gt;mathData())
</del><ins>+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(character, !style().isLeftToRightDirection());
+    if (!primaryFont.mathData() || baseGlyph.font != &amp;primaryFont || !baseGlyph.font || !baseGlyph.glyph)
</ins><span class="cx">         return data;
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;Glyph&gt; sizeVariants;
</span><span class="cx">     Vector&lt;OpenTypeMathData::AssemblyPart&gt; assemblyParts;
</span><span class="cx"> 
</span><span class="cx">     // The value of displayOperatorMinHeight is sometimes too small, so we ensure that it is at least \sqrt{2} times the size of the base glyph.
</span><del>-    float displayOperatorMinHeight = std::max(baseGlyph.font-&gt;boundsForGlyph(baseGlyph.glyph).height() * sqrtOfTwoFloat, baseGlyph.font-&gt;mathData()-&gt;getMathConstant(*baseGlyph.font, OpenTypeMathData::DisplayOperatorMinHeight));
</del><ins>+    float displayOperatorMinHeight = std::max(baseGlyph.font-&gt;boundsForGlyph(baseGlyph.glyph).height() * sqrtOfTwoFloat, primaryFont.mathData()-&gt;getMathConstant(primaryFont, OpenTypeMathData::DisplayOperatorMinHeight));
</ins><span class="cx"> 
</span><del>-    baseGlyph.font-&gt;mathData()-&gt;getMathVariants(baseGlyph.glyph, true, sizeVariants, assemblyParts);
</del><ins>+    primaryFont.mathData()-&gt;getMathVariants(baseGlyph.glyph, true, sizeVariants, assemblyParts);
</ins><span class="cx"> 
</span><span class="cx">     // We choose the first size variant that is larger than the expected displayOperatorMinHeight and otherwise fallback to the largest variant.
</span><span class="cx">     for (auto&amp; variant : sizeVariants) {
</span><span class="cx">         GlyphData sizeVariant;
</span><span class="cx">         sizeVariant.glyph = variant;
</span><del>-        sizeVariant.font = baseGlyph.font;
</del><ins>+        sizeVariant.font = &amp;primaryFont;
</ins><span class="cx">         data.setSizeVariantMode(sizeVariant);
</span><span class="cx">         if (boundsForGlyph(sizeVariant).height() &gt;= displayOperatorMinHeight)
</span><span class="cx">             return data;
</span><span class="lines">@@ -532,26 +527,25 @@
</span><span class="cx">     return data;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RenderMathMLOperator::StretchyData RenderMathMLOperator::findStretchyData(float* maximumGlyphWidth)
</del><ins>+RenderMathMLOperator::StretchyData RenderMathMLOperator::findStretchyData(UChar character, float* maximumGlyphWidth)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!maximumGlyphWidth || m_isVertical);
</span><span class="cx"> 
</span><span class="cx">     StretchyData data;
</span><span class="cx">     StretchyData assemblyData;
</span><span class="cx"> 
</span><del>-    GlyphData baseGlyph;
-    if (!getBaseGlyph(style(), baseGlyph))
-        return data;
</del><ins>+    const auto&amp; primaryFont = style().fontCascade().primaryFont();
+    GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(character, !style().isLeftToRightDirection());
</ins><span class="cx">     
</span><del>-    if (baseGlyph.font-&gt;mathData()) {
</del><ins>+    if (primaryFont.mathData() &amp;&amp; baseGlyph.font == &amp;primaryFont) {
</ins><span class="cx">         Vector&lt;Glyph&gt; sizeVariants;
</span><span class="cx">         Vector&lt;OpenTypeMathData::AssemblyPart&gt; assemblyParts;
</span><del>-        baseGlyph.font-&gt;mathData()-&gt;getMathVariants(baseGlyph.glyph, m_isVertical, sizeVariants, assemblyParts);
</del><ins>+        primaryFont.mathData()-&gt;getMathVariants(baseGlyph.glyph, m_isVertical, sizeVariants, assemblyParts);
</ins><span class="cx">         // We verify the size variants.
</span><span class="cx">         for (auto&amp; variant : sizeVariants) {
</span><span class="cx">             GlyphData sizeVariant;
</span><span class="cx">             sizeVariant.glyph = variant;
</span><del>-            sizeVariant.font = baseGlyph.font;
</del><ins>+            sizeVariant.font = &amp;primaryFont;
</ins><span class="cx">             if (maximumGlyphWidth)
</span><span class="cx">                 *maximumGlyphWidth = std::max(*maximumGlyphWidth, advanceWidthForGlyph(sizeVariant));
</span><span class="cx">             else {
</span><span class="lines">@@ -573,7 +567,7 @@
</span><span class="cx">         const StretchyCharacter* stretchyCharacter = nullptr;
</span><span class="cx">         const unsigned maxIndex = WTF_ARRAY_LENGTH(stretchyCharacters);
</span><span class="cx">         for (unsigned index = 0; index &lt; maxIndex; ++index) {
</span><del>-            if (stretchyCharacters[index].character == m_textContent) {
</del><ins>+            if (stretchyCharacters[index].character == character) {
</ins><span class="cx">                 stretchyCharacter = &amp;stretchyCharacters[index];
</span><span class="cx">                 if (!style().isLeftToRightDirection() &amp;&amp; index &lt; leftRightPairsCount * 2) {
</span><span class="cx">                     // If we are in right-to-left direction we select the mirrored form by adding -1 or +1 according to the parity of index.
</span><span class="lines">@@ -647,14 +641,14 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_isVertical &amp;&amp; isLargeOperatorInDisplayStyle())
</span><del>-        m_stretchyData = getDisplayStyleLargeOperator();
</del><ins>+        m_stretchyData = getDisplayStyleLargeOperator(m_textContent);
</ins><span class="cx">     else {
</span><span class="cx">         // We do not stretch if the base glyph is large enough.
</span><span class="cx">         GlyphData baseGlyph = style().fontCascade().glyphDataForCharacter(m_textContent, !style().isLeftToRightDirection());
</span><span class="cx">         float baseSize = m_isVertical ? heightForGlyph(baseGlyph) : advanceWidthForGlyph(baseGlyph);
</span><span class="cx">         if (stretchSize() &lt;= baseSize)
</span><span class="cx">             return;
</span><del>-        m_stretchyData = findStretchyData(nullptr);
</del><ins>+        m_stretchyData = findStretchyData(m_textContent, nullptr);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_isVertical &amp;&amp; m_stretchyData.mode() == DrawSizeVariant) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLOperatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h (200185 => 200186)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-04-28 12:09:38 UTC (rev 200185)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLOperator.h        2016-04-28 12:18:23 UTC (rev 200186)
</span><span class="lines">@@ -141,10 +141,9 @@
</span><span class="cx"> 
</span><span class="cx">     bool shouldAllowStretching() const;
</span><span class="cx"> 
</span><del>-    bool getBaseGlyph(const RenderStyle&amp;, GlyphData&amp;) const;
</del><span class="cx">     bool getGlyphAssemblyFallBack(Vector&lt;OpenTypeMathData::AssemblyPart&gt;, StretchyData&amp;) const;
</span><del>-    StretchyData getDisplayStyleLargeOperator() const;
-    StretchyData findStretchyData(float* maximumGlyphWidth);
</del><ins>+    StretchyData getDisplayStyleLargeOperator(UChar) const;
+    StretchyData findStretchyData(UChar, float* maximumGlyphWidth);
</ins><span class="cx"> 
</span><span class="cx">     enum GlyphPaintTrimming {
</span><span class="cx">         TrimTop,
</span></span></pre>
</div>
</div>

</body>
</html>