<?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>122851</bug_id>
          
          <creation_ts>2013-10-15 12:22:03 -0700</creation_ts>
          <short_desc>Use unicode-range to prevent unnecessary @font-face donwnloads</short_desc>
          <delta_ts>2016-05-05 23:36:06 -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>Text</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>42154</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BlinkMergeCandidate</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>enrica</cc>
    
    <cc>jonlee</cc>
    
    <cc>kling</cc>
    
    <cc>koivisto</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>syoichi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>940079</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-10-15 12:22:03 -0700</bug_when>
    <thetext>Consider merging https://chromium.googlesource.com/chromium/blink/+/342fe16bb002b8ba9cc06a10d8124df6a28c786f

This patch delays font loading until creation of GlyphPage whose
codepoint range intersects with the @font-face&apos;s unicode-range value.
GlyphPage is created when glyph data for a character in its codepoint
range is requested, so web fonts are not donwloaded if its glyph data
is not used.

Even if any glyph is not used, font metrics may be used (for example,
&lt;input&gt; uses font metrics to calculate its size). These metrics are
accessed via SimpleFontData::primarySimpleFontData, so we start loading
there too.

Caveat:
Since GlyphPage has glyph data for contiguous 256 Unicode codepoints,
this patch does not 100% prevent unnecessary downloads. Use of codepoint
*near* the unicode-range can trigger the font load. To fix this, we need
to delay font loading until a codepoint in unicode-range is requested.
That may require changing the GlyphPage data structure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>940093</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2013-10-15 12:44:40 -0700</bug_when>
    <thetext>Also see https://chromium.googlesource.com/chromium/blink/+/79ac8708f80986662c7a1458c3a91571db637d92</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1190633</commentid>
    <comment_count>2</comment_count>
    <who name="Myles C. Maxfield">mmaxfield</who>
    <bug_when>2016-05-05 23:36:06 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 42154 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>