<!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>[208128] 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/208128">208128</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-10-30 09:18:57 -0700 (Sun, 30 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use HarfBuzz ot-math API to parse the OpenType MATH table
https://bugs.webkit.org/show_bug.cgi?id=162671

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-10-30
Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsGTK.cmake: Enable internal OpenType MATH parsing for HarfBuzz &lt; 1.3.3.

Source/WebCore:

No new tests, already covered by existing tests.

* platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on
HarfBuzz's new OpenType MATH API.
* platform/graphics/opentype/OpenTypeMathData.h: Ditto.
(WebCore::OpenTypeMathData::hasMathData):
(WebCore::OpenTypeMathData::HbFontDeleter::operator()):

Source/WTF:

* wtf/Platform.h: By default, do not enable internal OpenType MATH parsing on GTK.

LayoutTests:

Rebaseline one test for large operators due to small rendering changes.

* platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
* platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkmathmlopentypeopentypestretchyexpectedpng">trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformgtkmathmlopentypeopentypestretchyexpectedtxt">trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.txt</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopentypeOpenTypeMathDatacpp">trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsopentypeOpenTypeMathDatah">trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/ChangeLog        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-10-30  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Use HarfBuzz ot-math API to parse the OpenType MATH table
+        https://bugs.webkit.org/show_bug.cgi?id=162671
+
+        Reviewed by Michael Catanzaro.
+
+        * Source/cmake/OptionsGTK.cmake: Enable internal OpenType MATH parsing for HarfBuzz &lt; 1.3.3.
+
</ins><span class="cx"> 2016-10-30  Hyowon Kim  &lt;hw1008.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Build break by missing geoclue-2.0.
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/LayoutTests/ChangeLog        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-10-30  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Use HarfBuzz ot-math API to parse the OpenType MATH table
+        https://bugs.webkit.org/show_bug.cgi?id=162671
+
+        Reviewed by Michael Catanzaro.
+
+        Rebaseline one test for large operators due to small rendering changes.
+
+        * platform/gtk/mathml/opentype/opentype-stretchy-expected.png:
+        * platform/gtk/mathml/opentype/opentype-stretchy-expected.txt:
+
</ins><span class="cx"> 2016-10-30  Gyuyoung Kim  &lt;gyuyoung.kim@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Remove duplicated media/media-source tests in TestExpectations
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkmathmlopentypeopentypestretchyexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkmathmlopentypeopentypestretchyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.txt (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.txt        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/LayoutTests/platform/gtk/mathml/opentype/opentype-stretchy-expected.txt        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><del>-layer at (0,0) size 800x347
-  RenderBlock {HTML} at (0,0) size 800x347
-    RenderBody {BODY} at (8,16) size 784x315
</del><ins>+layer at (0,0) size 800x336
+  RenderBlock {HTML} at (0,0) size 800x336
+    RenderBody {BODY} at (8,16) size 784x304
</ins><span class="cx">       RenderBlock {P} at (0,0) size 784x34
</span><span class="cx">         RenderMathMLMath {math} at (0,20) size 26x11
</span><span class="cx">           RenderMathMLRow {mrow} at (0,0) size 26x11
</span><span class="lines">@@ -35,10 +35,10 @@
</span><span class="cx">                 RenderText {#text} at (0,-3) size 2x0
</span><span class="cx">                   text run at (0,-3) width 2: &quot;\x{219F}&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><del>-      RenderBlock {P} at (0,219) size 784x96
-        RenderMathMLMath {math} at (0,0) size 94x93
-          RenderMathMLRow {mrow} at (0,0) size 94x93
-            RenderMathMLOperator {mo} at (0,0) size 94x93
</del><ins>+      RenderBlock {P} at (0,219) size 784x85
+        RenderMathMLMath {math} at (0,0) size 84x82
+          RenderMathMLRow {mrow} at (0,0) size 84x82
+            RenderMathMLOperator {mo} at (0,0) size 84x82
</ins><span class="cx">               RenderBlock (anonymous) at (0,0) size 10x12
</span><span class="cx">                 RenderText {#text} at (0,6) size 10x0
</span><span class="cx">                   text run at (0,6) width 10: &quot;\x{2A1B}&quot;
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/WTF/ChangeLog        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-10-30  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Use HarfBuzz ot-math API to parse the OpenType MATH table
+        https://bugs.webkit.org/show_bug.cgi?id=162671
+
+        Reviewed by Michael Catanzaro.
+
+        * wtf/Platform.h: By default, do not enable internal OpenType MATH parsing on GTK.
+
</ins><span class="cx"> 2016-10-25  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         String.prototype.replace() should throw an OutOfMemoryError when using too much memory.
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/WTF/wtf/Platform.h        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1140,7 +1140,7 @@
</span><span class="cx"> #define HAVE_NS_ACTIVITY 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if (OS(DARWIN) &amp;&amp; USE(CG)) || USE(FREETYPE) || (PLATFORM(WIN) &amp;&amp; (USE(CG) || USE(CAIRO)))
</del><ins>+#if (OS(DARWIN) &amp;&amp; USE(CG)) || (USE(FREETYPE) &amp;&amp; !PLATFORM(GTK)) || (PLATFORM(WIN) &amp;&amp; (USE(CG) || USE(CAIRO)))
</ins><span class="cx"> #undef ENABLE_OPENTYPE_MATH
</span><span class="cx"> #define ENABLE_OPENTYPE_MATH 1
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/WebCore/ChangeLog        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-10-30  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Use HarfBuzz ot-math API to parse the OpenType MATH table
+        https://bugs.webkit.org/show_bug.cgi?id=162671
+
+        Reviewed by Michael Catanzaro.
+
+        No new tests, already covered by existing tests.
+
+        * platform/graphics/opentype/OpenTypeMathData.cpp: Add alternative implementation relying on
+        HarfBuzz's new OpenType MATH API.
+        * platform/graphics/opentype/OpenTypeMathData.h: Ditto.
+        (WebCore::OpenTypeMathData::hasMathData):
+        (WebCore::OpenTypeMathData::HbFontDeleter::operator()):
+
</ins><span class="cx"> 2016-10-29  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Support unprefixed image-sets
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopentypeOpenTypeMathDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.cpp        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2014 Frederic Wang (fred.wang@free.fr). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -253,6 +254,15 @@
</span><span class="cx">     const OpenType::MathVariants* mathVariants = math-&gt;mathVariants(*m_mathBuffer);
</span><span class="cx">     if (!mathVariants)
</span><span class="cx">         m_mathBuffer = nullptr;
</span><ins>+#elif USE(HARFBUZZ)
+OpenTypeMathData::OpenTypeMathData(const FontPlatformData&amp; font)
+{
+    HarfBuzzFace* face = font.harfBuzzFace();
+    if (face) {
+        m_mathFont.reset(face-&gt;createFont());
+        if (!hb_ot_math_has_data(hb_font_get_face(m_mathFont.get())))
+            m_mathFont.release();
+    }
</ins><span class="cx"> #else
</span><span class="cx"> OpenTypeMathData::OpenTypeMathData(const FontPlatformData&amp;)
</span><span class="cx"> {
</span><span class="lines">@@ -287,6 +297,14 @@
</span><span class="cx">         return value / 100.0;
</span><span class="cx"> 
</span><span class="cx">     return value * font.sizePerUnit();
</span><ins>+#elif USE(HARFBUZZ)
+float OpenTypeMathData::getMathConstant(const Font&amp;, MathConstant constant) const
+{
+    hb_position_t value = hb_ot_math_get_constant(m_mathFont.get(), static_cast&lt;hb_ot_math_constant_t&gt;(constant));
+    if (constant == ScriptPercentScaleDown || constant == ScriptScriptPercentScaleDown || constant == RadicalDegreeBottomRaisePercent)
+        return value / 100.0;
+
+    return value / 65536.0;
</ins><span class="cx"> #else
</span><span class="cx"> float OpenTypeMathData::getMathConstant(const Font&amp;, MathConstant) const
</span><span class="cx"> {
</span><span class="lines">@@ -309,6 +327,10 @@
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     return mathItalicsCorrectionInfo-&gt;getItalicCorrection(*m_mathBuffer, glyph) * font.sizePerUnit();
</span><ins>+#elif USE(HARFBUZZ)
+float OpenTypeMathData::getItalicCorrection(const Font&amp;, Glyph glyph) const
+{
+    return hb_ot_math_get_glyph_italics_correction(m_mathFont.get(), glyph) / 65536.0;
</ins><span class="cx"> #else
</span><span class="cx"> float OpenTypeMathData::getItalicCorrection(const Font&amp;, Glyph) const
</span><span class="cx"> {
</span><span class="lines">@@ -333,6 +355,39 @@
</span><span class="cx"> 
</span><span class="cx">     mathGlyphConstruction-&gt;getSizeVariants(*m_mathBuffer, sizeVariants);
</span><span class="cx">     mathGlyphConstruction-&gt;getAssemblyParts(*m_mathBuffer, assemblyParts);
</span><ins>+#elif USE(HARFBUZZ)
+void OpenTypeMathData::getMathVariants(Glyph glyph, bool isVertical, Vector&lt;Glyph&gt;&amp; sizeVariants, Vector&lt;AssemblyPart&gt;&amp; assemblyParts) const
+{
+    hb_direction_t direction = isVertical ? HB_DIRECTION_BTT : HB_DIRECTION_LTR;
+
+    sizeVariants.clear();
+    hb_ot_math_glyph_variant_t variants[10];
+    unsigned variantsSize = WTF_ARRAY_LENGTH(variants);
+    unsigned count;
+    unsigned offset = 0;
+    do {
+        count = variantsSize;
+        hb_ot_math_get_glyph_variants(m_mathFont.get(), glyph, direction, offset, &amp;count, variants);
+        offset += count;
+        for (unsigned i = 0; i &lt; count; i++)
+            sizeVariants.append(variants[i].glyph);
+    } while (count == variantsSize);
+
+    assemblyParts.clear();
+    hb_ot_math_glyph_part_t parts[10];
+    unsigned partsSize = WTF_ARRAY_LENGTH(parts);
+    offset = 0;
+    do {
+        count = partsSize;
+        hb_ot_math_get_glyph_assembly(m_mathFont.get(), glyph, direction, offset, &amp;count, parts, nullptr);
+        offset += count;
+        for (unsigned i = 0; i &lt; count; i++) {
+            AssemblyPart assemblyPart;
+            assemblyPart.glyph = parts[i].glyph;
+            assemblyPart.isExtender = parts[i].flags &amp; HB_MATH_GLYPH_PART_FLAG_EXTENDER;
+            assemblyParts.append(assemblyPart);
+        }
+    } while (count == partsSize);
</ins><span class="cx"> #else
</span><span class="cx"> void OpenTypeMathData::getMathVariants(Glyph, bool, Vector&lt;Glyph&gt;&amp;, Vector&lt;AssemblyPart&gt;&amp;) const
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsopentypeOpenTypeMathDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/WebCore/platform/graphics/opentype/OpenTypeMathData.h        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2014 Frederic Wang (fred.wang@free.fr). All rights reserved.
</span><ins>+ * Copyright (C) 2016 Igalia S.L. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +24,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef OpenTypeMathData_h
-#define OpenTypeMathData_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;Glyph.h&quot;
</span><span class="cx"> #include &lt;wtf/PassRefPtr.h&gt;
</span><span class="lines">@@ -31,6 +31,10 @@
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if !ENABLE(OPENTYPE_MATH) &amp;&amp; USE(HARFBUZZ)
+#include &lt;hb-ot.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class FontPlatformData;
</span><span class="lines">@@ -45,7 +49,13 @@
</span><span class="cx">     }
</span><span class="cx">     ~OpenTypeMathData();
</span><span class="cx"> 
</span><ins>+#if ENABLE(OPENTYPE_MATH)
</ins><span class="cx">     bool hasMathData() const { return m_mathBuffer; }
</span><ins>+#elif USE(HARFBUZZ)
+    bool hasMathData() const { return m_mathFont.get(); }
+#else
+    bool hasMathData() const { return false; }
+#endif
</ins><span class="cx"> 
</span><span class="cx">     // These constants are defined in the MATH table.
</span><span class="cx">     // The implementation of OpenTypeMathData::getMathConstant assumes that they correspond to the indices of the MathContant table.
</span><span class="lines">@@ -119,9 +129,18 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit OpenTypeMathData(const FontPlatformData&amp;);
</span><ins>+
+#if ENABLE(OPENTYPE_MATH)
</ins><span class="cx">     RefPtr&lt;SharedBuffer&gt; m_mathBuffer;
</span><ins>+#elif USE(HARFBUZZ)
+    struct HbFontDeleter {
+        void operator()(hb_font_t* font)
+        {
+            hb_font_destroy(font);
+        }
+    };
+    std::unique_ptr&lt;hb_font_t, HbFontDeleter&gt; m_mathFont;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // OpenTypeMathData_h
</del></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (208127 => 208128)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake        2016-10-30 15:56:26 UTC (rev 208127)
+++ trunk/Source/cmake/OptionsGTK.cmake        2016-10-30 16:18:57 UTC (rev 208128)
</span><span class="lines">@@ -57,6 +57,12 @@
</span><span class="cx"> 
</span><span class="cx"> set(USE_WOFF2 ON)
</span><span class="cx"> 
</span><ins>+# For old versions of HarfBuzz that do not expose an API for the OpenType MATH
+# table, we enable our own code to parse that table.
+if (&quot;${PC_HARFBUZZ_VERSION}&quot; VERSION_LESS &quot;1.3.3&quot;)
+    add_definitions(-DENABLE_OPENTYPE_MATH=1)
+endif ()
+
</ins><span class="cx"> # Set the default value for ENABLE_GLES2 automatically.
</span><span class="cx"> # We are not enabling or disabling automatically a feature here, because
</span><span class="cx"> # the feature is by default always on (ENABLE_OPENGL=ON).
</span></span></pre>
</div>
</div>

</body>
</html>