<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>193036</bug_id>
          
          <creation_ts>2018-12-26 05:10:50 -0800</creation_ts>
          <short_desc>[FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring</short_desc>
          <delta_ts>2018-12-27 02:23:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jim Mason">jmason</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cgarcia</cc>
    
    <cc>commit-queue</cc>
    
    <cc>don.olmstead</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1490807</commentid>
    <comment_count>0</comment_count>
    <who name="Jim Mason">jmason</who>
    <bug_when>2018-12-26 05:10:50 -0800</bug_when>
    <thetext>Recent changes were made (bug# 192589) to refactor HarfBuzz font creation from OpenTypeMathData to FontPlatformData.  In the process, conditional compilation directives were lost.

The attached patch restores the conditional compilation logic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490808</commentid>
    <comment_count>1</comment_count>
      <attachid>358077</attachid>
    <who name="Jim Mason">jmason</who>
    <bug_when>2018-12-26 05:15:18 -0800</bug_when>
    <thetext>Created attachment 358077
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490815</commentid>
    <comment_count>2</comment_count>
      <attachid>358077</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-12-26 10:16:59 -0800</bug_when>
    <thetext>Comment on attachment 358077
Patch

r=me to get back to the previous status quo, but it looks problematic. Jim, what port are you building, and with what build flags?

Hey Don, here&apos;s another one. ENABLE(OPENTYPE_MATH) is not a valid feature flag, but it&apos;s being used throughout several files under platform/graphics/opentype. It&apos;s defined only in OptionsGTK.cmake using cpp flags:

add_definitions(-DENABLE_OPENTYPE_MATH=1)

Then looking at USE(HARFBUZZ), my initial reaction is confusion. Surely USE(FREETYPE) must imply USE(HARFBUZZ), but it looks like USE(HARFBUZZ) is only set in OptionsPlayStation.cmake, which is nuts because GTK and WPE both use harfbuzz too, so it must be set somewhere else, but I can&apos;t find it. It&apos;s used in FontCascade.cpp, HbUniquePtr.h, and OpenTypeMathData.[cpp,h] so that&apos;s surely not enough places to actually build if harfbuzz were actually not present.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490820</commentid>
    <comment_count>3</comment_count>
    <who name="Jim Mason">jmason</who>
    <bug_when>2018-12-26 11:03:31 -0800</bug_when>
    <thetext>(In reply to Michael Catanzaro from comment #2)
&gt; Jim,
&gt; what port are you building, and with what build flags?
&gt; 
&gt; Hey Don, here&apos;s another one. ENABLE(OPENTYPE_MATH) is not a valid feature
&gt; flag, but it&apos;s being used throughout several files under
&gt; platform/graphics/opentype. It&apos;s defined only in OptionsGTK.cmake using cpp
&gt; flags

Indeed, OPENTYPE_MATH is being set for me automatically, as I am building using an older version of HarfBuzz.  OptionsGTK.cmake sets the flag if HarfBuzz is older than version 1.3.3, and I am using 1.0.6.

When the code was in OpenTypeMathData, it was compiled according to the construct:

    #if ENABLE(OPENTYPE_MATH)
    #elif USE(HARFBUZZ)
    ..code that was refactored lived here..

Thus, the code was compiled only if USE(HARFBUZZ) &amp;&amp; !ENABLE(OPENTYPE_MATH).  Conditioning compilation on !ENABLE(OPENTYPE_MATH) is necessary, as the code references an API that is not exposed by the earlier versions of HarfBuzz.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490828</commentid>
    <comment_count>4</comment_count>
      <attachid>358077</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-12-26 12:42:54 -0800</bug_when>
    <thetext>Comment on attachment 358077
Patch

Clearing flags on attachment: 358077

Committed r239554: &lt;https://trac.webkit.org/changeset/239554&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490829</commentid>
    <comment_count>5</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2018-12-26 12:42:56 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490830</commentid>
    <comment_count>6</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-12-26 12:43:23 -0800</bug_when>
    <thetext>&lt;rdar://problem/46951923&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490891</commentid>
    <comment_count>7</comment_count>
    <who name="Jim Mason">jmason</who>
    <bug_when>2018-12-27 02:23:09 -0800</bug_when>
    <thetext>Thanks for the quick review, Michael.

To summarize, !ENABLE(OPENTYPE_MATH) is the active part of this fix.  Without it, users of older versions of HarfBuzz encounter effectively dead code that does not compile.

USE(HARFBUZZ) was included in the fix, as it was part of the original logic.  Whether it is necessary or redundant in other situations, I cannot say.  However, I can say in this specific case, it is unnecessary.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>358077</attachid>
            <date>2018-12-26 05:15:18 -0800</date>
            <delta_ts>2018-12-26 12:42:54 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-193036-20181226131517.patch</filename>
            <type>text/plain</type>
            <size>2035</size>
            <attacher name="Jim Mason">jmason</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDIzOTU1MikKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDE4LTEyLTI2ICBKaW0gTWFz
b24gIDxqbWFzb25AaWJpbnguY29tPgorCisgICAgICAgIFtGcmVlVHlwZV0gUmVzdG9yZSBjb25k
aXRpb25hbCBjb21waWxhdGlvbiBsb2dpYyBmb3IgcmVjZW50IEhhcmZCdXp6IHJlZmFjdG9yaW5n
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xOTMwMzYK
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIHBsYXRm
b3JtL2dyYXBoaWNzL0ZvbnRQbGF0Zm9ybURhdGEuaDoKKyAgICAgICAgKiBwbGF0Zm9ybS9ncmFw
aGljcy9mcmVldHlwZS9Gb250UGxhdGZvcm1EYXRhRnJlZVR5cGUuY3BwOgorCiAyMDE4LTEyLTI0
ICBGdWppaSBIaXJvbm9yaSAgPEhpcm9ub3JpLkZ1amlpQHNvbnkuY29tPgogCiAgICAgICAgIFJl
bW92ZSAidXNpbmcgbmFtZXNwYWNlIHN0ZDsiCkluZGV4OiBTb3VyY2UvV2ViQ29yZS9wbGF0Zm9y
bS9ncmFwaGljcy9Gb250UGxhdGZvcm1EYXRhLmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT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