<?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>61646</bug_id>
          
          <creation_ts>2011-05-27 10:14:15 -0700</creation_ts>
          <short_desc>Duplicate Fonts Put in Font Cache on Mac Due to Duplicate CGFontRefs for Same Font</short_desc>
          <delta_ts>2011-05-27 10:52:19 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Saboff">msaboff</reporter>
          <assigned_to name="Michael Saboff">msaboff</assigned_to>
          <cc>aroben</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>411513</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-05-27 10:14:15 -0700</bug_when>
    <thetext>Core Text has code paths that call into CGFontCreateFontsWithPath() directly, bypassing CG’s font database. This can and does (in TOT WebKit, for example) result in multiple distinct CGFont objects being created for the exact same font.  See &lt;rdar://problem/9089228&gt;for details. Every time we get a new and distinct CGFontRef, we create a new FontCache entry and abandon the old one.

The cache fails to find the earlier entry due to FontPlatformData::platformIsEqual() in FontPlatformDataCocoa.mm comparing the saved m_cfFont.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>411517</commentid>
    <comment_count>1</comment_count>
      <attachid>95189</attachid>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-05-27 10:20:40 -0700</bug_when>
    <thetext>Created attachment 95189
Patch to only compare the CGFontRefs if needed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>411522</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-05-27 10:28:54 -0700</bug_when>
    <thetext>&lt;rdar://problem/9515696&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>411531</commentid>
    <comment_count>3</comment_count>
      <attachid>95189</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-05-27 10:43:10 -0700</bug_when>
    <thetext>Comment on attachment 95189
Patch to only compare the CGFontRefs if needed

View in context: https://bugs.webkit.org/attachment.cgi?id=95189&amp;action=review

&gt; Source/WebCore/ChangeLog:9
&gt; +        Change the platformIsEqual to just compare the m_font members if
&gt; +        both are not null.

This doesn&apos;t match the code change. We compare the m_font members if either one is not null, not if both are not null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>411537</commentid>
    <comment_count>4</comment_count>
      <attachid>95189</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2011-05-27 10:47:54 -0700</bug_when>
    <thetext>Comment on attachment 95189
Patch to only compare the CGFontRefs if needed

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>411542</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Saboff">msaboff</who>
    <bug_when>2011-05-27 10:52:19 -0700</bug_when>
    <thetext>Committed r87524: &lt;http://trac.webkit.org/changeset/87524&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>95189</attachid>
            <date>2011-05-27 10:20:40 -0700</date>
            <delta_ts>2011-05-27 10:47:54 -0700</delta_ts>
            <desc>Patch to only compare the CGFontRefs if needed</desc>
            <filename>61646.patch</filename>
            <type>text/plain</type>
            <size>1527</size>
            <attacher name="Michael Saboff">msaboff</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDg3NTIwKQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTggQEAKKzIwMTEtMDUtMjcgIE1pY2hhZWwg
U2Fib2ZmICA8bXNhYm9mZkBhcHBsZS5jb20+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZ
IChPT1BTISkuCisKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dp
P2lkPTYxNjQ2CisgICAgICAgIER1cGxpY2F0ZSBGb250cyBQdXQgaW4gRm9udCBDYWNoZSBvbiBN
YWMgRHVlIHRvIER1cGxpY2F0ZSBDR0ZvbnRSZWZzIGZvciBTYW1lIEZvbnQKKworICAgICAgICBD
aGFuZ2UgdGhlIHBsYXRmb3JtSXNFcXVhbCB0byBqdXN0IGNvbXBhcmUgdGhlIG1fZm9udCBtZW1i
ZXJzIGlmCisgICAgICAgIGJvdGggYXJlIG5vdCBudWxsLgorCisgICAgICAgIE5vIHRlc3RzIGFk
ZGVkIC0gZnVuY3Rpb25hbGl0eSB1bmNoYW5nZWQsIGZpeGluZyBtZW1vcnkgYWJhbmRvbm1lbnQu
CisKKyAgICAgICAgKiBwbGF0Zm9ybS9ncmFwaGljcy9jb2NvYS9Gb250UGxhdGZvcm1EYXRhQ29j
b2EubW06CisgICAgICAgIChXZWJDb3JlOjpGb250UGxhdGZvcm1EYXRhOjpwbGF0Zm9ybUlzRXF1
YWwpOgorCiAyMDExLTA1LTI3ICBTdGVwaGFuaWUgTGV3aXMgIDxzbGV3aXNAYXBwbGUuY29tPgog
CiAgICAgICAgIFJ1YmJlciBTdGFtcGVkIGJ5IEFkYW0gUm9iZW4uCkluZGV4OiBTb3VyY2UvV2Vi
Q29yZS9wbGF0Zm9ybS9ncmFwaGljcy9jb2NvYS9Gb250UGxhdGZvcm1EYXRhQ29jb2EubW0KPT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PQotLS0gU291cmNlL1dlYkNvcmUvcGxhdGZvcm0vZ3JhcGhpY3MvY29jb2EvRm9udFBs
YXRmb3JtRGF0YUNvY29hLm1tCShyZXZpc2lvbiA4NzUxMSkKKysrIFNvdXJjZS9XZWJDb3JlL3Bs
YXRmb3JtL2dyYXBoaWNzL2NvY29hL0ZvbnRQbGF0Zm9ybURhdGFDb2NvYS5tbQkod29ya2luZyBj
b3B5KQpAQCAtMTA2LDggKzEwNiw5IEBAIGNvbnN0IEZvbnRQbGF0Zm9ybURhdGEmIEZvbnRQbGF0
Zm9ybURhdGEKIAogYm9vbCBGb250UGxhdGZvcm1EYXRhOjpwbGF0Zm9ybUlzRXF1YWwoY29uc3Qg
Rm9udFBsYXRmb3JtRGF0YSYgb3RoZXIpIGNvbnN0CiB7Ci0gICAgcmV0dXJuIG1fZm9udCA9PSBv
dGhlci5tX2ZvbnQKLSAgICAgICAgJiYgbV9jZ0ZvbnQgPT0gb3RoZXIubV9jZ0ZvbnQ7CisgICAg
aWYgKG1fZm9udCB8fCBvdGhlci5tX2ZvbnQpCisgICAgICAgIHJldHVybiBtX2ZvbnQgPT0gb3Ro
ZXIubV9mb250OworICAgIHJldHVybiBtX2NnRm9udCA9PSBvdGhlci5tX2NnRm9udDsKIH0KIAog
dm9pZCBGb250UGxhdGZvcm1EYXRhOjpzZXRGb250KE5TRm9udCAqZm9udCkK
</data>
<flag name="review"
          id="88634"
          type_id="1"
          status="+"
          setter="hyatt"
    />
          </attachment>
      

    </bug>

</bugzilla>