<!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>[177876] trunk/Source</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/177876">177876</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-01-04 13:26:17 -0800 (Sun, 04 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove GlyphPageTree
https://bugs.webkit.org/show_bug.cgi?id=140015

Reviewed by Darin Adler.

GlyphPageTree is a global cache consisting of a tree of nodes that match SimpleFontData instances.
The tree levels correspond to font fallback lists so that higher levels fill holes (missing glyphs)
in the lower levels. This patch replaces it with a simpler and easier to understand caching scheme.
In particular the goal is to have clearer ownership relations and better control over mutability.

The new scheme looks like this:

SimpleFontData instances cache GlyphPages for themselves. These pages are immutable after construction
and may contain holes. This is a global cache (since SimpleFontDatas are cached globally) with the same
lifetime as the GlyphPageTree used to have.

FontGlyphs instances cache resolved GlyphPages for the normal font variant. These are build by traversing
the fallback list as necessary and collecting glyphs from SimpleFontDatas. As a common case case optimization
the page from the primary font is cached directly as long as it has the requested glyphs.
FontGlyphs are shared between sufficiently similar Font instances so this is a shared cache as well.

* CMakeLists.txt:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):

    nonCJKGlyphOrientation matters for glyph selection too and needs to be part of the FontDescription cache key.

* platform/graphics/FontData.h:
(WebCore::FontData::FontData):
(WebCore::FontData::setMaxGlyphPageTreeLevel): Deleted.
(WebCore::FontData::maxGlyphPageTreeLevel): Deleted.
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::primaryFontHasGlyphForCharacter):
* platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::FontGlyphs):
(WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic):
(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
(WebCore::FontGlyphs::glyphDataForSystemFallback):
(WebCore::FontGlyphs::glyphDataForVariant):
(WebCore::FontGlyphs::glyphDataForNormalCharacter):

    Traverse the fallback list by using simple index instead of indirectly via GlyphPageTreeNode traversal.

(WebCore::pageFromFontData):

    Fetch a page from the primary font and see if we can use it as-is.
    Vertical fonts have special glyph selection and can't use this path.

(WebCore::FontGlyphs::createFlattenedGlyphPage):

    Build a hole-free glyph page by pulling characters from the fallback list.

(WebCore::FontGlyphs::glyphDataForCharacter):
* platform/graphics/FontGlyphs.h:
(WebCore::FontGlyphs::primarySimpleFontData):
* platform/graphics/GlyphPage.h:
(WebCore::GlyphPage::createForMixedFontData):
(WebCore::GlyphPage::createCopyForMixedFontData):

    Add copy version.

(WebCore::GlyphPage::createForSingleFontData):

    Remove owner node field.

(WebCore::GlyphPage::~GlyphPage):
(WebCore::GlyphPage::count):
(WebCore::GlyphPage::GlyphPage):
(WebCore::GlyphPage::createCopiedSystemFallbackPage): Deleted.
(WebCore::GlyphPage::owner): Deleted.
* platform/graphics/GlyphPageTreeNode.cpp: Removed.
* platform/graphics/GlyphPageTreeNode.h: Removed.
* platform/graphics/SegmentedFontData.cpp:
(WebCore::SegmentedFontData::SegmentedFontData):
(WebCore::SegmentedFontData::~SegmentedFontData):
(WebCore::SegmentedFontData::simpleFontDataForCharacter):

    Return null when there is no usable range so the client can tell the difference.
    Rename for clarity.

(WebCore::SegmentedFontData::simpleFontDataForFirstRange):

    Add a way to get the fallback font separately. This is always available.

(WebCore::SegmentedFontData::isLoading):
(WebCore::SegmentedFontData::fontDataForCharacter): Deleted.
* platform/graphics/SegmentedFontData.h:
(WebCore::SegmentedFontData::SegmentedFontData): Deleted.
* platform/graphics/SimpleFontData.cpp:
(WebCore::SimpleFontData::initCharWidths):
(WebCore::SimpleFontData::platformGlyphInit):
(WebCore::SimpleFontData::~SimpleFontData):
(WebCore::SimpleFontData::simpleFontDataForCharacter):
(WebCore::fillGlyphPage):
(WebCore::createAndFillGlyphPage):

    Move code for initializing glyph pages here. The code is from GlyphPageTreeNode.

(WebCore::SimpleFontData::glyphPage):

    Cache glyphs for this font. These pages may have holes.

(WebCore::SimpleFontData::glyphForCharacter):
(WebCore::SimpleFontData::glyphDataForCharacter):
(WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):

    Since the cache is now owned by the SimpleFontData all the custom pruning can go away.
    The glyph page cache dies along with it owner.

(WebCore::SimpleFontData::fontDataForCharacter): Deleted.
* platform/graphics/SimpleFontData.h:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(-[WebCascadeList objectAtIndex:]):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FontComplexTextMac.cpp:
(WebCore::Font::fontDataForCombiningCharacterSequence):
* platform/graphics/mac/GlyphPageMac.cpp: Copied from Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp.

    This was already misnamed.

(WebCore::GlyphPage::fill):
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp: Removed.
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::platformInit):
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
* platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::SimpleFontData::platformInit):
* platform/mac/DragImageMac.mm:

    Add missing FontCachePurgePreventer.

(WebCore::createDragImageForLink):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::initializeFontData):
* svg/SVGFontElement.cpp:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDatah">trunk/Source/WebCore/platform/graphics/FontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontFastPathcpp">trunk/Source/WebCore/platform/graphics/FontFastPath.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphscpp">trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontGlyphsh">trunk/Source/WebCore/platform/graphics/FontGlyphs.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphPageh">trunk/Source/WebCore/platform/graphics/GlyphPage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSegmentedFontDatacpp">trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSegmentedFontDatah">trunk/Source/WebCore/platform/graphics/SegmentedFontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp">trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsSimpleFontDatah">trunk/Source/WebCore/platform/graphics/SimpleFontData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm">trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp">trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacSimpleFontDataMacmm">trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCGWincpp">trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCairoWincpp">trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinSimpleFontDataCGWincpp">trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragImageMacmm">trunk/Source/WebCore/platform/mac/DragImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontDatacpp">trunk/Source/WebCore/svg/SVGFontData.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontElementcpp">trunk/Source/WebCore/svg/SVGFontElement.cpp</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCoreStatisticsmm">trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreStatisticscpp">trunk/Source/WebKit/win/WebCoreStatistics.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGlyphPageMaccpp">trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodecpp">trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodeh">trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacGlyphPageTreeNodeMaccpp">trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -2076,7 +2076,6 @@
</span><span class="cx">     platform/graphics/FontGlyphs.cpp
</span><span class="cx">     platform/graphics/GeneratedImage.cpp
</span><span class="cx">     platform/graphics/GeometryUtilities.cpp
</span><del>-    platform/graphics/GlyphPageTreeNode.cpp
</del><span class="cx">     platform/graphics/Gradient.cpp
</span><span class="cx">     platform/graphics/GradientImage.cpp
</span><span class="cx">     platform/graphics/GraphicsContext.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/ChangeLog        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,3 +1,145 @@
</span><ins>+2015-01-02  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Remove GlyphPageTree
+        https://bugs.webkit.org/show_bug.cgi?id=140015
+
+        Reviewed by Darin Adler.
+
+        GlyphPageTree is a global cache consisting of a tree of nodes that match SimpleFontData instances.
+        The tree levels correspond to font fallback lists so that higher levels fill holes (missing glyphs)
+        in the lower levels. This patch replaces it with a simpler and easier to understand caching scheme.
+        In particular the goal is to have clearer ownership relations and better control over mutability.
+
+        The new scheme looks like this:
+
+        SimpleFontData instances cache GlyphPages for themselves. These pages are immutable after construction
+        and may contain holes. This is a global cache (since SimpleFontDatas are cached globally) with the same
+        lifetime as the GlyphPageTree used to have.
+
+        FontGlyphs instances cache resolved GlyphPages for the normal font variant. These are build by traversing
+        the fallback list as necessary and collecting glyphs from SimpleFontDatas. As a common case case optimization
+        the page from the primary font is cached directly as long as it has the requested glyphs.
+        FontGlyphs are shared between sufficiently similar Font instances so this is a shared cache as well.
+
+        * CMakeLists.txt:
+        * WebCore.exp.in:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
+
+            nonCJKGlyphOrientation matters for glyph selection too and needs to be part of the FontDescription cache key.
+
+        * platform/graphics/FontData.h:
+        (WebCore::FontData::FontData):
+        (WebCore::FontData::setMaxGlyphPageTreeLevel): Deleted.
+        (WebCore::FontData::maxGlyphPageTreeLevel): Deleted.
+        * platform/graphics/FontFastPath.cpp:
+        (WebCore::Font::primaryFontHasGlyphForCharacter):
+        * platform/graphics/FontGlyphs.cpp:
+        (WebCore::FontGlyphs::FontGlyphs):
+        (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic):
+        (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
+        (WebCore::FontGlyphs::glyphDataForSystemFallback):
+        (WebCore::FontGlyphs::glyphDataForVariant):
+        (WebCore::FontGlyphs::glyphDataForNormalCharacter):
+
+            Traverse the fallback list by using simple index instead of indirectly via GlyphPageTreeNode traversal.
+
+        (WebCore::pageFromFontData):
+
+            Fetch a page from the primary font and see if we can use it as-is.
+            Vertical fonts have special glyph selection and can't use this path.
+
+        (WebCore::FontGlyphs::createFlattenedGlyphPage):
+
+            Build a hole-free glyph page by pulling characters from the fallback list.
+
+        (WebCore::FontGlyphs::glyphDataForCharacter):
+        * platform/graphics/FontGlyphs.h:
+        (WebCore::FontGlyphs::primarySimpleFontData):
+        * platform/graphics/GlyphPage.h:
+        (WebCore::GlyphPage::createForMixedFontData):
+        (WebCore::GlyphPage::createCopyForMixedFontData):
+
+            Add copy version.
+
+        (WebCore::GlyphPage::createForSingleFontData):
+
+            Remove owner node field.
+
+        (WebCore::GlyphPage::~GlyphPage):
+        (WebCore::GlyphPage::count):
+        (WebCore::GlyphPage::GlyphPage):
+        (WebCore::GlyphPage::createCopiedSystemFallbackPage): Deleted.
+        (WebCore::GlyphPage::owner): Deleted.
+        * platform/graphics/GlyphPageTreeNode.cpp: Removed.
+        * platform/graphics/GlyphPageTreeNode.h: Removed.
+        * platform/graphics/SegmentedFontData.cpp:
+        (WebCore::SegmentedFontData::SegmentedFontData):
+        (WebCore::SegmentedFontData::~SegmentedFontData):
+        (WebCore::SegmentedFontData::simpleFontDataForCharacter):
+
+            Return null when there is no usable range so the client can tell the difference.
+            Rename for clarity.
+
+        (WebCore::SegmentedFontData::simpleFontDataForFirstRange):
+
+            Add a way to get the fallback font separately. This is always available.
+
+        (WebCore::SegmentedFontData::isLoading):
+        (WebCore::SegmentedFontData::fontDataForCharacter): Deleted.
+        * platform/graphics/SegmentedFontData.h:
+        (WebCore::SegmentedFontData::SegmentedFontData): Deleted.
+        * platform/graphics/SimpleFontData.cpp:
+        (WebCore::SimpleFontData::initCharWidths):
+        (WebCore::SimpleFontData::platformGlyphInit):
+        (WebCore::SimpleFontData::~SimpleFontData):
+        (WebCore::SimpleFontData::simpleFontDataForCharacter):
+        (WebCore::fillGlyphPage):
+        (WebCore::createAndFillGlyphPage):
+
+            Move code for initializing glyph pages here. The code is from GlyphPageTreeNode.
+
+        (WebCore::SimpleFontData::glyphPage):
+
+            Cache glyphs for this font. These pages may have holes.
+
+        (WebCore::SimpleFontData::glyphForCharacter):
+        (WebCore::SimpleFontData::glyphDataForCharacter):
+        (WebCore::SimpleFontData::DerivedFontData::~DerivedFontData):
+
+            Since the cache is now owned by the SimpleFontData all the custom pruning can go away.
+            The glyph page cache dies along with it owner.
+
+        (WebCore::SimpleFontData::fontDataForCharacter): Deleted.
+        * platform/graphics/SimpleFontData.h:
+        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+        (-[WebCascadeList objectAtIndex:]):
+        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+        * platform/graphics/mac/FontComplexTextMac.cpp:
+        (WebCore::Font::fontDataForCombiningCharacterSequence):
+        * platform/graphics/mac/GlyphPageMac.cpp: Copied from Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp.
+
+            This was already misnamed.
+
+        (WebCore::GlyphPage::fill):
+        * platform/graphics/mac/GlyphPageTreeNodeMac.cpp: Removed.
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::SimpleFontData::platformInit):
+        * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
+        * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
+        * platform/graphics/win/SimpleFontDataCGWin.cpp:
+        (WebCore::SimpleFontData::platformInit):
+        * platform/mac/DragImageMac.mm:
+
+            Add missing FontCachePurgePreventer.
+
+        (WebCore::createDragImageForLink):
+        * svg/SVGFontData.cpp:
+        (WebCore::SVGFontData::initializeFontData):
+        * svg/SVGFontElement.cpp:
+
</ins><span class="cx"> 2015-01-04  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove an unused function
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -761,7 +761,6 @@
</span><span class="cx"> __ZN7WebCore17DOMImplementation13isXMLMIMETypeERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore17DebugPageOverlays15settingsChangedERNS_9MainFrameE
</span><del>-__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
</del><span class="cx"> __ZN7WebCore17HTMLOptionElement8selectedEv
</span><span class="cx"> __ZN7WebCore17HTMLSelectElement20optionSelectedByUserEibb
</span><span class="cx"> __ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
</span><span class="lines">@@ -1493,6 +1492,7 @@
</span><span class="cx"> __ZN7WebCore9FrameView39flushCompositingStateIncludingSubframesEv
</span><span class="cx"> __ZN7WebCore9FrameView52disableLayerFlushThrottlingTemporarilyForInteractionEv
</span><span class="cx"> __ZN7WebCore9FrameView6createERNS_5FrameE
</span><ins>+__ZN7WebCore9GlyphPage7s_countE
</ins><span class="cx"> __ZN7WebCore9HTMLNames10actionAttrE
</span><span class="cx"> __ZN7WebCore9HTMLNames10listingTagE
</span><span class="cx"> __ZN7WebCore9HTMLNames11optgroupTagE
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -8055,7 +8055,6 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\FontPlatformData.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\GeometryUtilities.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\GeneratedImage.cpp&quot; /&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\platform\graphics\GlyphPageTreeNode.cpp&quot; /&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\Gradient.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\GradientImage.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\platform\graphics\GraphicsContext.cpp&quot; /&gt;
</span><span class="lines">@@ -19610,7 +19609,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\GlyphBuffer.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\GlyphMetricsMap.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\GlyphPage.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\platform\graphics\GlyphPageTreeNode.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\Gradient.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\GraphicsContext.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\platform\graphics\GraphicsLayer.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -4677,7 +4677,7 @@
</span><span class="cx">                 B2AFFC7E0D00A5C10030074D /* FontCustomPlatformData.h in Headers */ = {isa = PBXBuildFile; fileRef = B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */; };
</span><span class="cx">                 B2AFFC7F0D00A5C10030074D /* SimpleFontDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */; };
</span><span class="cx">                 B2AFFC800D00A5C10030074D /* FontMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC780D00A5C10030074D /* FontMac.mm */; };
</span><del>-                B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */; };
</del><ins>+                B2AFFC830D00A5C10030074D /* GlyphPageMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC7B0D00A5C10030074D /* GlyphPageMac.cpp */; };
</ins><span class="cx">                 B2AFFC970D00A5DF0030074D /* TextBoundaries.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8C0D00A5DF0030074D /* TextBoundaries.mm */; };
</span><span class="cx">                 B2AFFC980D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8D0D00A5DF0030074D /* TextBreakIteratorInternalICUMac.mm */; };
</span><span class="cx">                 B2AFFC990D00A5DF0030074D /* TextCodecMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2AFFC8E0D00A5DF0030074D /* TextCodecMac.cpp */; };
</span><span class="lines">@@ -4721,8 +4721,6 @@
</span><span class="cx">                 B2C3DA680D006CD600EF6F26 /* FontGlyphs.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA6B0D006CD600EF6F26 /* FontSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                B2C3DA6D0D006CD600EF6F26 /* GlyphPageTreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */; };
-                B2C3DA6E0D006CD600EF6F26 /* GlyphPageTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 B2C96D8D0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */; };
</span><span class="cx">                 B2CB92420B5BD966009BAA78 /* JSSVGElementInstance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */; };
</span><span class="cx">                 B2CB92440B5BD970009BAA78 /* JSSVGElementInstance.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */; };
</span><span class="lines">@@ -12085,7 +12083,7 @@
</span><span class="cx">                 B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontCustomPlatformData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SimpleFontDataMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2AFFC780D00A5C10030074D /* FontMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = FontMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphPageTreeNodeMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                B2AFFC7B0D00A5C10030074D /* GlyphPageMac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphPageMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 B2AFFC850D00A5DF0030074D /* character-sets.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = &quot;character-sets.txt&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2AFFC860D00A5DF0030074D /* mac-encodings.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = &quot;mac-encodings.txt&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2AFFC870D00A5DF0030074D /* make-charset-table.pl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; path = &quot;make-charset-table.pl&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12132,8 +12130,6 @@
</span><span class="cx">                 B2C3DA570D006CD600EF6F26 /* FontGlyphs.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontGlyphs.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = FontSelector.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GlyphPageTreeNode.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GlyphPageTreeNode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGPathSegCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2CB923B0B5BD941009BAA78 /* JSSVGElementInstance.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGElementInstance.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B2CB923C0B5BD941009BAA78 /* JSSVGElementInstance.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSSVGElementInstance.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20442,7 +20438,7 @@
</span><span class="cx">                                 B2AFFC750D00A5C10030074D /* FontCustomPlatformData.cpp */,
</span><span class="cx">                                 B2AFFC760D00A5C10030074D /* FontCustomPlatformData.h */,
</span><span class="cx">                                 B2AFFC780D00A5C10030074D /* FontMac.mm */,
</span><del>-                                B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */,
</del><ins>+                                B2AFFC7B0D00A5C10030074D /* GlyphPageMac.cpp */,
</ins><span class="cx">                                 49FFBF1C11C8550E006A7118 /* GraphicsContext3DMac.mm */,
</span><span class="cx">                                 B277B4030B22F37C0004BEC6 /* GraphicsContextMac.mm */,
</span><span class="cx">                                 B275358D0B053A66002CE64F /* IconMac.mm */,
</span><span class="lines">@@ -20550,8 +20546,6 @@
</span><span class="cx">                                 B2C3DA5B0D006CD600EF6F26 /* GlyphBuffer.h */,
</span><span class="cx">                                 C5D4AA78116BAFB60069CA93 /* GlyphMetricsMap.h */,
</span><span class="cx">                                 0873B86A136064EA00A522C2 /* GlyphPage.h */,
</span><del>-                                B2C3DA5C0D006CD600EF6F26 /* GlyphPageTreeNode.cpp */,
-                                B2C3DA5D0D006CD600EF6F26 /* GlyphPageTreeNode.h */,
</del><span class="cx">                                 BC53C6070DA56C570021EB5D /* Gradient.cpp */,
</span><span class="cx">                                 BC53C5F40DA56B920021EB5D /* Gradient.h */,
</span><span class="cx">                                 2D2FC0561460CD6F00263633 /* GradientImage.cpp */,
</span><span class="lines">@@ -24471,7 +24465,6 @@
</span><span class="cx">                                 B2C3DA6C0D006CD600EF6F26 /* GlyphBuffer.h in Headers */,
</span><span class="cx">                                 C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */,
</span><span class="cx">                                 0873B86B136064EA00A522C2 /* GlyphPage.h in Headers */,
</span><del>-                                B2C3DA6E0D006CD600EF6F26 /* GlyphPageTreeNode.h in Headers */,
</del><span class="cx">                                 BC53C5F50DA56B920021EB5D /* Gradient.h in Headers */,
</span><span class="cx">                                 B22279640D00BF220071B782 /* GradientAttributes.h in Headers */,
</span><span class="cx">                                 2D481F04146B5C6B00AA7834 /* GradientImage.h in Headers */,
</span><span class="lines">@@ -27971,8 +27964,7 @@
</span><span class="cx">                                 9746AF2314F4DDE6003E7A70 /* Geolocation.cpp in Sources */,
</span><span class="cx">                                 9746AF2614F4DDE6003E7A70 /* GeolocationController.cpp in Sources */,
</span><span class="cx">                                 0FB6252E18DE1B1500A07C05 /* GeometryUtilities.cpp in Sources */,
</span><del>-                                B2C3DA6D0D006CD600EF6F26 /* GlyphPageTreeNode.cpp in Sources */,
-                                B2AFFC830D00A5C10030074D /* GlyphPageTreeNodeMac.cpp in Sources */,
</del><ins>+                                B2AFFC830D00A5C10030074D /* GlyphPageMac.cpp in Sources */,
</ins><span class="cx">                                 BC53C6080DA56C570021EB5D /* Gradient.cpp in Sources */,
</span><span class="cx">                                 BC53C60B0DA56CF10021EB5D /* GradientCG.cpp in Sources */,
</span><span class="cx">                                 2D481F03146B5C6500AA7834 /* GradientImage.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -79,7 +79,8 @@
</span><span class="cx">     { }
</span><span class="cx">     static unsigned makeFlagKey(const FontDescription&amp; description)
</span><span class="cx">     {
</span><del>-        return static_cast&lt;unsigned&gt;(description.widthVariant()) &lt;&lt; 4
</del><ins>+        return static_cast&lt;unsigned&gt;(description.widthVariant()) &lt;&lt; 5
+            | static_cast&lt;unsigned&gt;(description.nonCJKGlyphOrientation()) &lt;&lt; 4
</ins><span class="cx">             | static_cast&lt;unsigned&gt;(description.orientation()) &lt;&lt; 3
</span><span class="cx">             | static_cast&lt;unsigned&gt;(description.italic()) &lt;&lt; 2
</span><span class="cx">             | static_cast&lt;unsigned&gt;(description.usePrinterFont()) &lt;&lt; 1
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontData.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontData.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/FontData.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2015 Apple Inc. 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">@@ -41,26 +41,20 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(FontData); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     FontData()
</span><del>-        : m_maxGlyphPageTreeLevel(0)
</del><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     virtual ~FontData();
</span><span class="cx"> 
</span><del>-    virtual const SimpleFontData* fontDataForCharacter(UChar32) const = 0;
</del><ins>+    virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const = 0;
+    virtual const SimpleFontData&amp; simpleFontDataForFirstRange() const = 0;
</ins><span class="cx">     virtual bool isCustomFont() const = 0;
</span><span class="cx">     virtual bool isLoading() const = 0;
</span><span class="cx">     virtual bool isSegmented() const = 0;
</span><span class="cx"> 
</span><del>-    void setMaxGlyphPageTreeLevel(unsigned level) const { m_maxGlyphPageTreeLevel = level; }
-    unsigned maxGlyphPageTreeLevel() const { return m_maxGlyphPageTreeLevel; }
-
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     virtual String description() const = 0;
</span><span class="cx"> #endif
</span><del>-
-private:
-    mutable unsigned m_maxGlyphPageTreeLevel;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontFastPathcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontFastPath.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/FontFastPath.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> #include &quot;FontGlyphs.h&quot;
</span><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><span class="cx"> #include &quot;LayoutRect.h&quot;
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> #include &quot;TextRun.h&quot;
</span><span class="lines">@@ -43,12 +42,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool Font::primaryFontHasGlyphForCharacter(UChar32 character) const
</span><span class="cx"> {
</span><del>-    unsigned pageNumber = (character / GlyphPage::size);
-
-    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(primaryFont(), pageNumber);
-    GlyphPage* page = node-&gt;page();
-
-    return page &amp;&amp; page-&gt;fontDataForCharacter(character);
</del><ins>+    return primaryFont()-&gt;glyphForCharacter(character);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2013 Apple Inc.  All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2013-2015 Apple Inc.  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">@@ -31,15 +31,14 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> #include &quot;SegmentedFontData.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> FontGlyphs::FontGlyphs(PassRefPtr&lt;FontSelector&gt; fontSelector)
</span><del>-    : m_pageZero(0)
-    , m_cachedPrimarySimpleFontData(0)
</del><ins>+    : m_cachedPrimarySimpleFontData(0)
</ins><span class="cx">     , m_fontSelector(fontSelector)
</span><span class="cx">     , m_fontSelectorVersion(m_fontSelector ? m_fontSelector-&gt;version() : 0)
</span><span class="cx">     , m_familyIndex(0)
</span><span class="lines">@@ -51,8 +50,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FontGlyphs::FontGlyphs(const FontPlatformData&amp; platformData)
</span><del>-    : m_pageZero(0)
-    , m_cachedPrimarySimpleFontData(0)
</del><ins>+    : m_cachedPrimarySimpleFontData(0)
</ins><span class="cx">     , m_fontSelector(0)
</span><span class="cx">     , m_fontSelectorVersion(0)
</span><span class="cx">     , m_familyIndex(cAllFamiliesScanned)
</span><span class="lines">@@ -211,127 +209,158 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-static GlyphData glyphDataForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData&amp; data, unsigned pageNumber)
</del><ins>+static GlyphData glyphDataForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData&amp; data)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;SimpleFontData&gt; nonItalicFontData = data.fontData-&gt;nonSyntheticItalicFontData();
-    GlyphPageTreeNode* nonItalicNode = GlyphPageTreeNode::getRootChild(nonItalicFontData.get(), pageNumber);
-    GlyphPage* nonItalicPage = nonItalicNode-&gt;page();
-    if (nonItalicPage) {
-        GlyphData nonItalicData = nonItalicPage-&gt;glyphDataForCharacter(character);
-        if (nonItalicData.fontData)
-            return nonItalicData;
-    }
</del><ins>+    GlyphData nonItalicData = data.fontData-&gt;nonSyntheticItalicFontData()-&gt;glyphDataForCharacter(character);
+    if (nonItalicData.fontData)
+        return nonItalicData;
</ins><span class="cx">     return data;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData&amp; data, unsigned pageNumber)
</del><ins>+static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData&amp; data)
</ins><span class="cx"> {
</span><span class="cx">     if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
</span><del>-        RefPtr&lt;SimpleFontData&gt; uprightFontData = data.fontData-&gt;uprightOrientationFontData();
-        GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber);
-        GlyphPage* uprightPage = uprightNode-&gt;page();
-        if (uprightPage) {
-            GlyphData uprightData = uprightPage-&gt;glyphDataForCharacter(character);
-            // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
-            if (data.glyph == uprightData.glyph)
-                return data;
-            // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
-            // glyph, so we fall back to the upright data and use the horizontal glyph.
-            if (uprightData.fontData)
-                return uprightData;
-        }
</del><ins>+        GlyphData uprightData = data.fontData-&gt;uprightOrientationFontData()-&gt;glyphDataForCharacter(character);
+        // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
+        if (data.glyph == uprightData.glyph)
+            return data;
+        // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
+        // glyph, so we fall back to the upright data and use the horizontal glyph.
+        if (uprightData.fontData)
+            return uprightData;
</ins><span class="cx">     } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
</span><del>-        RefPtr&lt;SimpleFontData&gt; verticalRightFontData = data.fontData-&gt;verticalRightOrientationFontData();
-        GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData.get(), pageNumber);
-        GlyphPage* verticalRightPage = verticalRightNode-&gt;page();
-        if (verticalRightPage) {
-            GlyphData verticalRightData = verticalRightPage-&gt;glyphDataForCharacter(character);
-            // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
-            // into it.
-            if (data.glyph != verticalRightData.glyph)
-                return data;
-            // The glyphs are identical, meaning that we should just use the horizontal glyph.
-            if (verticalRightData.fontData)
-                return verticalRightData;
-        }
</del><ins>+        GlyphData verticalRightData = data.fontData-&gt;verticalRightOrientationFontData()-&gt;glyphDataForCharacter(character);
+        // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
+        // into it.
+        if (data.glyph != verticalRightData.glyph)
+            return data;
+        // The glyphs are identical, meaning that we should just use the horizontal glyph.
+        if (verticalRightData.fontData)
+            return verticalRightData;
</ins><span class="cx">     }
</span><span class="cx">     return data;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-GlyphData FontGlyphs::glyphDataForSystemFallback(UChar32 c, const FontDescription&amp; description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode&amp; node)
</del><ins>+GlyphData FontGlyphs::glyphDataForSystemFallback(UChar32 c, const FontDescription&amp; description, FontDataVariant variant)
</ins><span class="cx"> {
</span><del>-    ASSERT(node.page());
-    ASSERT(node.isSystemFallback());
-    // System fallback is character-dependent. When we get here, we
-    // know that the character in question isn't in the system fallback
-    // font's glyph page. Try to lazily create it here.
-    UChar codeUnits[2];
-    int codeUnitsLength;
-    if (c &lt;= 0xFFFF) {
-        codeUnits[0] = Font::normalizeSpaces(c);
-        codeUnitsLength = 1;
-    } else {
-        codeUnits[0] = U16_LEAD(c);
-        codeUnits[1] = U16_TRAIL(c);
-        codeUnitsLength = 2;
-    }
-    const SimpleFontData* originalFontData = primaryFontData(description)-&gt;fontDataForCharacter(c);
-    RefPtr&lt;SimpleFontData&gt; characterFontData = fontCache().systemFallbackForCharacters(description, originalFontData, m_isForPlatformFont, codeUnits, codeUnitsLength);
-    if (!characterFontData)
</del><ins>+    // System fallback is character-dependent.
+    auto* originalFontData = primaryFontData(description)-&gt;simpleFontDataForCharacter(c);
+    if (!originalFontData)
+        originalFontData = &amp;primaryFontData(description)-&gt;simpleFontDataForFirstRange();
+
+    RefPtr&lt;SimpleFontData&gt; systemFallbackFontData = originalFontData-&gt;systemFallbackFontDataForCharacter(c, description, m_isForPlatformFont);
+    if (!systemFallbackFontData)
</ins><span class="cx">         return GlyphData();
</span><span class="cx"> 
</span><del>-    if (characterFontData-&gt;platformData().orientation() == Vertical &amp;&amp; !characterFontData-&gt;hasVerticalGlyphs() &amp;&amp; Font::isCJKIdeographOrSymbol(c))
</del><ins>+    if (systemFallbackFontData-&gt;platformData().orientation() == Vertical &amp;&amp; !systemFallbackFontData-&gt;hasVerticalGlyphs() &amp;&amp; Font::isCJKIdeographOrSymbol(c))
</ins><span class="cx">         variant = BrokenIdeographVariant;
</span><del>-    if (variant != NormalVariant) {
-        characterFontData = characterFontData-&gt;variantFontData(description, variant);
-        ASSERT(characterFontData);
</del><ins>+
+    GlyphData fallbackGlyphData;
+    if (variant == NormalVariant)
+        fallbackGlyphData = systemFallbackFontData-&gt;glyphDataForCharacter(c);
+    else
+        fallbackGlyphData = systemFallbackFontData-&gt;variantFontData(description, variant)-&gt;glyphDataForCharacter(c);
+
+    if (variant == NormalVariant &amp;&amp; fallbackGlyphData.fontData) {
+        if (!Font::isCJKIdeographOrSymbol(c) &amp;&amp; fallbackGlyphData.fontData-&gt;platformData().orientation() == Vertical &amp;&amp; !fallbackGlyphData.fontData-&gt;isTextOrientationFallback())
+            fallbackGlyphData = glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), fallbackGlyphData);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    GlyphData data;
-    if (GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData.get(), pageNumber)-&gt;page())
-        data = fallbackPage-&gt;glyphDataForCharacter(c);
</del><ins>+    // Keep the system fallback fonts we use alive.
+    if (fallbackGlyphData.glyph)
+        m_systemFallbackFontDataSet.add(systemFallbackFontData.release());
</ins><span class="cx"> 
</span><del>-    // Cache it so we don't have to do system fallback again next time.
-    if (variant == NormalVariant &amp;&amp; data.glyph) {
-        node.page()-&gt;setGlyphDataForCharacter(c, data.glyph, data.fontData);
-        data.fontData-&gt;setMaxGlyphPageTreeLevel(std::max(data.fontData-&gt;maxGlyphPageTreeLevel(), node.level()));
-        if (!Font::isCJKIdeographOrSymbol(c) &amp;&amp; data.fontData-&gt;platformData().orientation() != Horizontal &amp;&amp; !data.fontData-&gt;isTextOrientationFallback())
-            return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, pageNumber);
</del><ins>+    return fallbackGlyphData;
+}
+
+GlyphData FontGlyphs::glyphDataForVariant(UChar32 c, const FontDescription&amp; description, FontDataVariant variant, unsigned fallbackLevel)
+{
+    for (; fallbackLevel &lt;= description.familyCount(); ++fallbackLevel) {
+        auto* fontData = realizeFontDataAt(description, fallbackLevel);
+        if (!fontData)
+            return glyphDataForSystemFallback(c, description, variant);
+
+        auto* simpleFontData = fontData-&gt;simpleFontDataForCharacter(c);
+        GlyphData data = simpleFontData ? simpleFontData-&gt;glyphDataForCharacter(c) : GlyphData();
+        if (data.fontData) {
+            // The variantFontData function should not normally return 0.
+            // But if it does, we will just render the capital letter big.
+            RefPtr&lt;SimpleFontData&gt; variantFontData = data.fontData-&gt;variantFontData(description, variant);
+            if (!variantFontData)
+                return data;
+
+            return variantFontData-&gt;glyphDataForCharacter(c);
+        }
</ins><span class="cx">     }
</span><del>-    return data;
</del><ins>+    ASSERT_NOT_REACHED();
+    return GlyphData();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-GlyphData FontGlyphs::glyphDataForVariant(UChar32 c, const FontDescription&amp; description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode*&amp; node)
</del><ins>+GlyphData FontGlyphs::glyphDataForNormalVariant(UChar32 c, const FontDescription&amp; description)
</ins><span class="cx"> {
</span><del>-    while (true) {
-        if (GlyphPage* page = node-&gt;page()) {
-            GlyphData data = page-&gt;glyphDataForCharacter(c);
-            if (data.fontData) {
-                // The variantFontData function should not normally return 0.
-                // But if it does, we will just render the capital letter big.
-                RefPtr&lt;SimpleFontData&gt; variantFontData = data.fontData-&gt;variantFontData(description, variant);
-                if (!variantFontData)
-                    return data;
</del><ins>+    const unsigned pageNumber = c / GlyphPage::size;
</ins><span class="cx"> 
</span><del>-                GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
-                GlyphPage* variantPage = variantNode-&gt;page();
-                if (variantPage)
-                    return variantPage-&gt;glyphDataForCharacter(c);
</del><ins>+    for (unsigned fallbackLevel = 0; fallbackLevel &lt;= description.familyCount(); ++fallbackLevel) {
+        auto* fontData = realizeFontDataAt(description, fallbackLevel);
+        if (!fontData)
+            return glyphDataForSystemFallback(c, description, NormalVariant);
</ins><span class="cx"> 
</span><del>-                // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
-                // a font has the lowercase character but the small caps font does not have its uppercase version.
-                return GlyphData();
</del><ins>+        auto* simpleFontData = fontData-&gt;simpleFontDataForCharacter(c);
+        auto* page = simpleFontData ? simpleFontData-&gt;glyphPage(pageNumber) : nullptr;
+        if (!page)
+            continue;
+        GlyphData data = page-&gt;glyphDataForCharacter(c);
+        if (data.fontData) {
+            if (data.fontData-&gt;platformData().orientation() == Vertical &amp;&amp; !data.fontData-&gt;isTextOrientationFallback()) {
+                if (!Font::isCJKIdeographOrSymbol(c))
+                    return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data);
+
+                if (!data.fontData-&gt;hasVerticalGlyphs()) {
+                    // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
+                    // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
+                    return glyphDataForVariant(c, description, BrokenIdeographVariant, fallbackLevel);
+                }
+#if PLATFORM(COCOA)
+                if (data.fontData-&gt;platformData().syntheticOblique())
+                    return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data);
+#endif
</ins><span class="cx">             }
</span><span class="cx"> 
</span><del>-            if (node-&gt;isSystemFallback())
-                return glyphDataForSystemFallback(c, description, variant, pageNumber, *node);
</del><ins>+            return data;
</ins><span class="cx">         }
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-        node = node-&gt;getChild(realizeFontDataAt(description, node-&gt;level()), pageNumber);
-    }
</del><ins>+    ASSERT_NOT_REACHED();
+    return GlyphData();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RefPtr&lt;GlyphPage&gt; glyphPageFromFontData(unsigned pageNumber, const FontData&amp; fontData)
+{
+    const SimpleFontData* simpleFontData = nullptr;
+    if (fontData.isSegmented()) {
+        UChar32 pageRangeFrom = pageNumber * GlyphPage::size;
+        UChar32 pageRangeTo = pageRangeFrom + GlyphPage::size - 1;
+        auto&amp; segmentedFontData = downcast&lt;SegmentedFontData&gt;(fontData);
+        for (unsigned i = 0; i &lt; segmentedFontData.numRanges(); ++i) {
+            auto&amp; range = segmentedFontData.rangeAt(i);
+            if (range.to()) {
+                if (range.from() &lt;= pageRangeFrom &amp;&amp; pageRangeTo &lt;= range.to())
+                    simpleFontData = range.fontData().get();
+                break;
+            }
+        }
+        if (!simpleFontData)
+            return nullptr;
+    } else
+        simpleFontData = &amp;downcast&lt;SimpleFontData&gt;(fontData);
+
+    if (simpleFontData-&gt;platformData().orientation() == Vertical)
+        return nullptr;
+
+    return const_cast&lt;GlyphPage*&gt;(simpleFontData-&gt;glyphPage(pageNumber));
+}
+
</ins><span class="cx"> GlyphData FontGlyphs::glyphDataForCharacter(const FontDescription&amp; description, UChar32 c, bool mirror, FontDataVariant variant)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="lines">@@ -351,43 +380,26 @@
</span><span class="cx">     if (mirror)
</span><span class="cx">         c = u_charMirror(c);
</span><span class="cx"> 
</span><del>-    const unsigned pageNumber = (c / GlyphPage::size);
-
-    GlyphPageTreeNode*&amp; node = pageNumber ? m_pages.add(pageNumber, nullptr).iterator-&gt;value : m_pageZero;
-    if (!node)
-        node = GlyphPageTreeNode::getRootChild(realizeFontDataAt(description, 0), pageNumber);
-
</del><span class="cx">     if (variant != NormalVariant)
</span><del>-        return glyphDataForVariant(c, description, variant, pageNumber, node);
</del><ins>+        return glyphDataForVariant(c, description, variant, 0);
</ins><span class="cx"> 
</span><del>-    while (true) {
-        if (GlyphPage* page = node-&gt;page()) {
-            GlyphData data = page-&gt;glyphDataForCharacter(c);
-            if (data.fontData) {
-                if (data.fontData-&gt;platformData().orientation() == Vertical &amp;&amp; !data.fontData-&gt;isTextOrientationFallback()) {
-                    if (!Font::isCJKIdeographOrSymbol(c))
-                        return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, pageNumber);
</del><ins>+    const unsigned pageNumber = c / GlyphPage::size;
</ins><span class="cx"> 
</span><del>-                    if (!data.fontData-&gt;hasVerticalGlyphs()) {
-                        // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
-                        // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
-                        return glyphDataForVariant(c, description, BrokenIdeographVariant, pageNumber, node);
-                    }
-#if PLATFORM(COCOA)
-                    if (data.fontData-&gt;platformData().syntheticOblique())
-                        return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data, pageNumber);
-#endif
-                }
</del><ins>+    RefPtr&lt;GlyphPage&gt;&amp; cachedPage = pageNumber ? m_cachedPages.add(pageNumber, nullptr).iterator-&gt;value : m_cachedPageZero;
+    if (!cachedPage)
+        cachedPage = glyphPageFromFontData(pageNumber, *primaryFontData(description));
</ins><span class="cx"> 
</span><del>-                return data;
-            }
</del><ins>+    GlyphData glyphData = cachedPage ? cachedPage-&gt;glyphDataForCharacter(c) : GlyphData();
+    if (!glyphData.glyph) {
+        if (!cachedPage)
+            cachedPage = GlyphPage::createForMixedFontData();
+        else if (cachedPage-&gt;isImmutable())
+            cachedPage = GlyphPage::createCopyForMixedFontData(*cachedPage);
</ins><span class="cx"> 
</span><del>-            if (node-&gt;isSystemFallback())
-                return glyphDataForSystemFallback(c, description, variant, pageNumber, *node);
-        }
-
-        node = node-&gt;getChild(realizeFontDataAt(description, node-&gt;level()), pageNumber);
</del><ins>+        glyphData = glyphDataForNormalVariant(c, description);
+        cachedPage-&gt;setGlyphDataForCharacter(c, glyphData.glyph, glyphData.fontData);
</ins><span class="cx">     }
</span><ins>+    return glyphData;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2010, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2010, 2013-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class GlyphPageTreeNode;
</del><span class="cx"> class GraphicsContext;
</span><span class="cx"> class IntRect;
</span><span class="cx"> class FontDescription;
</span><span class="lines">@@ -46,8 +45,6 @@
</span><span class="cx"> class FontGlyphs : public RefCounted&lt;FontGlyphs&gt; {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(FontGlyphs);
</span><span class="cx"> public:
</span><del>-    typedef HashMap&lt;int, GlyphPageTreeNode*, DefaultHash&lt;int&gt;::Hash&gt; GlyphPages;
-
</del><span class="cx">     static Ref&lt;FontGlyphs&gt; create(PassRefPtr&lt;FontSelector&gt; fontSelector) { return adoptRef(*new FontGlyphs(fontSelector)); }
</span><span class="cx">     static Ref&lt;FontGlyphs&gt; createForPlatformFont(const FontPlatformData&amp; platformData) { return adoptRef(*new FontGlyphs(platformData)); }
</span><span class="cx"> 
</span><span class="lines">@@ -78,14 +75,19 @@
</span><span class="cx">     FontGlyphs(PassRefPtr&lt;FontSelector&gt;);
</span><span class="cx">     FontGlyphs(const FontPlatformData&amp;);
</span><span class="cx"> 
</span><del>-    GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&amp;, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode&amp;);
-    GlyphData glyphDataForVariant(UChar32, const FontDescription&amp;, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode*&amp;);
</del><ins>+    GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&amp;, FontDataVariant);
+    GlyphData glyphDataForNormalVariant(UChar32, const FontDescription&amp;);
+    GlyphData glyphDataForVariant(UChar32, const FontDescription&amp;, FontDataVariant, unsigned fallbackLevel);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void releaseFontData();
</span><span class="cx">     
</span><span class="cx">     Vector&lt;RefPtr&lt;FontData&gt;, 1&gt; m_realizedFontData;
</span><del>-    GlyphPages m_pages;
-    GlyphPageTreeNode* m_pageZero;
</del><ins>+
+    RefPtr&lt;GlyphPage&gt; m_cachedPageZero;
+    HashMap&lt;int, RefPtr&lt;GlyphPage&gt;&gt; m_cachedPages;
+
+    HashSet&lt;RefPtr&lt;SimpleFontData&gt;&gt; m_systemFallbackFontDataSet;
+
</ins><span class="cx">     const SimpleFontData* m_cachedPrimarySimpleFontData;
</span><span class="cx">     RefPtr&lt;FontSelector&gt; m_fontSelector;
</span><span class="cx">     WidthCache m_widthCache;
</span><span class="lines">@@ -107,8 +109,12 @@
</span><span class="cx"> inline const SimpleFontData* FontGlyphs::primarySimpleFontData(const FontDescription&amp; description)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><del>-    if (!m_cachedPrimarySimpleFontData)
-        m_cachedPrimarySimpleFontData = primaryFontData(description)-&gt;fontDataForCharacter(' ');
</del><ins>+    if (!m_cachedPrimarySimpleFontData) {
+        auto* fontData = primaryFontData(description);
+        m_cachedPrimarySimpleFontData = fontData-&gt;simpleFontDataForCharacter(' ');
+        if (!m_cachedPrimarySimpleFontData)
+            m_cachedPrimarySimpleFontData = &amp;fontData-&gt;simpleFontDataForFirstRange();
+    }
</ins><span class="cx">     return m_cachedPrimarySimpleFontData;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GlyphPage.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphPage.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/GlyphPage.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class SimpleFontData;
</span><del>-class GlyphPageTreeNode;
</del><span class="cx"> 
</span><span class="cx"> // Holds the glyph index and the corresponding SimpleFontData information for a given
</span><span class="cx"> // character.
</span><span class="lines">@@ -64,39 +63,39 @@
</span><span class="cx"> // starting from 0 and incrementing for each 256 glyphs.
</span><span class="cx"> //
</span><span class="cx"> // One page may actually include glyphs from other fonts if the characters are
</span><del>-// missing in the primary font. It is owned by exactly one GlyphPageTreeNode,
-// although multiple nodes may reference it as their &quot;page&quot; if they are supposed
-// to be overriding the parent's node, but provide no additional information.
</del><ins>+// missing in the primary font.
</ins><span class="cx"> class GlyphPage : public RefCounted&lt;GlyphPage&gt; {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;GlyphPage&gt; createForMixedFontData(GlyphPageTreeNode* owner)
</del><ins>+    static PassRefPtr&lt;GlyphPage&gt; createForMixedFontData()
</ins><span class="cx">     {
</span><span class="cx">         void* slot = fastMalloc(sizeof(GlyphPage) + sizeof(SimpleFontData*) * GlyphPage::size);
</span><del>-        return adoptRef(new (NotNull, slot) GlyphPage(owner));
</del><ins>+        return adoptRef(new (NotNull, slot) GlyphPage(nullptr));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    static PassRefPtr&lt;GlyphPage&gt; createForSingleFontData(GlyphPageTreeNode* owner, const SimpleFontData* fontData)
</del><ins>+    static PassRefPtr&lt;GlyphPage&gt; createCopyForMixedFontData(const GlyphPage&amp; original)
</ins><span class="cx">     {
</span><ins>+        RefPtr&lt;GlyphPage&gt; page = createForMixedFontData();
+        for (unsigned i = 0; i &lt; GlyphPage::size; ++i)
+            page-&gt;setGlyphDataForIndex(i, original.glyphDataForIndex(i));
+        return page.release();
+    }
+
+    static PassRefPtr&lt;GlyphPage&gt; createForSingleFontData(const SimpleFontData* fontData)
+    {
</ins><span class="cx">         ASSERT(fontData);
</span><del>-        return adoptRef(new GlyphPage(owner, fontData));
</del><ins>+        return adoptRef(new GlyphPage(fontData));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    PassRefPtr&lt;GlyphPage&gt; createCopiedSystemFallbackPage(GlyphPageTreeNode* owner) const
</del><ins>+    ~GlyphPage()
</ins><span class="cx">     {
</span><del>-        RefPtr&lt;GlyphPage&gt; page = GlyphPage::createForMixedFontData(owner);
-        memcpy(page-&gt;m_glyphs, m_glyphs, sizeof(m_glyphs));
-        if (hasPerGlyphFontData())
-            memcpy(page-&gt;m_perGlyphFontData, m_perGlyphFontData, sizeof(SimpleFontData*) * GlyphPage::size);
-        else {
-            for (size_t i = 0; i &lt; GlyphPage::size; ++i) {
-                page-&gt;m_perGlyphFontData[i] = m_glyphs[i] ? m_fontDataForAllGlyphs : 0;
-            }
-        }
-        return page.release();
</del><ins>+        --s_count;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ~GlyphPage() { }
</del><ins>+    bool isImmutable() const { return m_isImmutable; }
+    void setImmutable() { m_isImmutable = true; }
</ins><span class="cx"> 
</span><ins>+    static unsigned count() { return s_count; }
+
</ins><span class="cx">     static const size_t size = 256; // Covers Latin-1 in a single page.
</span><span class="cx">     static_assert((!(0xD800 % size)) &amp;&amp; (!(0xDC00 % size)) &amp;&amp; (!(0xE000 % size)), &quot;GlyphPages must never straddle code-unit length boundaries&quot;);
</span><span class="cx">     static unsigned indexForCharacter(UChar32 c) { return c % GlyphPage::size; }
</span><span class="lines">@@ -137,6 +136,8 @@
</span><span class="cx">     void setGlyphDataForIndex(unsigned index, Glyph glyph, const SimpleFontData* fontData)
</span><span class="cx">     {
</span><span class="cx">         ASSERT_WITH_SECURITY_IMPLICATION(index &lt; size);
</span><ins>+        ASSERT(!m_isImmutable);
+        
</ins><span class="cx">         m_glyphs[index] = glyph;
</span><span class="cx"> 
</span><span class="cx">         // GlyphPage getters will always return a null SimpleFontData* for glyph #0 if there's no per-glyph font array.
</span><span class="lines">@@ -154,20 +155,6 @@
</span><span class="cx">         setGlyphDataForIndex(index, glyphData.glyph, glyphData.fontData);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void removeFontDataFromSystemFallbackPage(const SimpleFontData* fontData)
-    {
-        // This method should only be called on the system fallback page, which is never single-font.
-        ASSERT(hasPerGlyphFontData());
-        for (size_t i = 0; i &lt; size; ++i) {
-            if (m_perGlyphFontData[i] == fontData) {
-                m_glyphs[i] = 0;
-                m_perGlyphFontData[i] = 0;
-            }
-        }
-    }
-
-    GlyphPageTreeNode* owner() const { return m_owner; }
-
</del><span class="cx">     // Implemented by the platform.
</span><span class="cx">     bool fill(unsigned offset, unsigned length, UChar* characterBuffer, unsigned bufferLength, const SimpleFontData*);
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -177,23 +164,25 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit GlyphPage(GlyphPageTreeNode* owner, const SimpleFontData* fontDataForAllGlyphs = 0)
</del><ins>+    explicit GlyphPage(const SimpleFontData* fontDataForAllGlyphs)
</ins><span class="cx">         : m_fontDataForAllGlyphs(fontDataForAllGlyphs)
</span><del>-        , m_owner(owner)
</del><span class="cx">     {
</span><span class="cx">         memset(m_glyphs, 0, sizeof(m_glyphs));
</span><span class="cx">         if (hasPerGlyphFontData())
</span><span class="cx">             memset(m_perGlyphFontData, 0, sizeof(SimpleFontData*) * GlyphPage::size);
</span><ins>+        ++s_count;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool hasPerGlyphFontData() const { return !m_fontDataForAllGlyphs; }
</span><span class="cx"> 
</span><span class="cx">     const SimpleFontData* m_fontDataForAllGlyphs;
</span><del>-    GlyphPageTreeNode* m_owner;
</del><span class="cx">     Glyph m_glyphs[size];
</span><span class="cx"> 
</span><ins>+    bool m_isImmutable { false };
</ins><span class="cx">     // NOTE: This array has (GlyphPage::size) elements if m_fontDataForAllGlyphs is null.
</span><span class="cx">     const SimpleFontData* m_perGlyphFontData[0];
</span><ins>+
+    static unsigned s_count;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if COMPILER(MSVC)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,444 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;GlyphPageTreeNode.h&quot;
-
-#include &quot;SegmentedFontData.h&quot;
-#include &quot;SimpleFontData.h&quot;
-#include &lt;stdio.h&gt;
-#include &lt;wtf/text/CString.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-#include &lt;wtf/unicode/CharacterNames.h&gt;
-
-#if ENABLE(OPENTYPE_VERTICAL)
-#include &quot;OpenTypeVerticalData.h&quot;
-#endif
-
-namespace WebCore {
-
-HashMap&lt;int, GlyphPageTreeNode*&gt;* GlyphPageTreeNode::roots = 0;
-GlyphPageTreeNode* GlyphPageTreeNode::pageZeroRoot = 0;
-
-GlyphPageTreeNode* GlyphPageTreeNode::getRoot(unsigned pageNumber)
-{
-    static bool initialized;
-    if (!initialized) {
-        initialized = true;
-        roots = new HashMap&lt;int, GlyphPageTreeNode*&gt;;
-        pageZeroRoot = new GlyphPageTreeNode;
-    }
-
-    if (!pageNumber)
-        return pageZeroRoot;
-
-    if (GlyphPageTreeNode* foundNode = roots-&gt;get(pageNumber))
-        return foundNode;
-
-    GlyphPageTreeNode* node = new GlyphPageTreeNode;
-#ifndef NDEBUG
-    node-&gt;m_pageNumber = pageNumber;
-#endif
-    roots-&gt;set(pageNumber, node);
-    return node;
-}
-
-size_t GlyphPageTreeNode::treeGlyphPageCount()
-{
-    size_t count = 0;
-    if (roots) {
-        HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator end = roots-&gt;end();
-        for (HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator it = roots-&gt;begin(); it != end; ++it)
-            count += it-&gt;value-&gt;pageCount();
-    }
-    
-    if (pageZeroRoot)
-        count += pageZeroRoot-&gt;pageCount();
-
-    return count;
-}
-
-size_t GlyphPageTreeNode::pageCount() const
-{
-    size_t count = m_page &amp;&amp; m_page-&gt;owner() == this ? 1 : 0;
-    GlyphPageTreeNodeMap::const_iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::const_iterator it = m_children.begin(); it != end; ++it)
-        count += it-&gt;value-&gt;pageCount();
-
-    return count;
-}
-
-void GlyphPageTreeNode::pruneTreeCustomFontData(const FontData* fontData)
-{
-    // Enumerate all the roots and prune any tree that contains our custom font data.
-    if (roots) {
-        HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator end = roots-&gt;end();
-        for (HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator it = roots-&gt;begin(); it != end; ++it)
-            it-&gt;value-&gt;pruneCustomFontData(fontData);
-    }
-    
-    if (pageZeroRoot)
-        pageZeroRoot-&gt;pruneCustomFontData(fontData);
-}
-
-void GlyphPageTreeNode::pruneTreeFontData(const SimpleFontData* fontData)
-{
-    if (roots) {
-        HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator end = roots-&gt;end();
-        for (HashMap&lt;int, GlyphPageTreeNode*&gt;::iterator it = roots-&gt;begin(); it != end; ++it)
-            it-&gt;value-&gt;pruneFontData(fontData);
-    }
-    
-    if (pageZeroRoot)
-        pageZeroRoot-&gt;pruneFontData(fontData);
-}
-
-static bool fill(GlyphPage* pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-#if ENABLE(SVG_FONTS)
-    if (SimpleFontData::AdditionalFontData* additionalFontData = fontData-&gt;fontData())
-        return additionalFontData-&gt;fillSVGGlyphPage(pageToFill, offset, length, buffer, bufferLength, fontData);
-#endif
-    bool hasGlyphs = pageToFill-&gt;fill(offset, length, buffer, bufferLength, fontData);
-#if ENABLE(OPENTYPE_VERTICAL)
-    if (hasGlyphs &amp;&amp; fontData-&gt;verticalData())
-        fontData-&gt;verticalData()-&gt;substituteWithVerticalGlyphs(fontData, pageToFill, offset, length);
-#endif
-    return hasGlyphs;
-}
-
-void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNumber)
-{
-    ASSERT(!m_page);
-
-    // This function must not be called for the root of the tree, because that
-    // level does not contain any glyphs.
-    ASSERT(m_level &gt; 0 &amp;&amp; m_parent);
-
-    // The parent's page will be 0 if we are level one or the parent's font data
-    // did not contain any glyphs for that page.
-    GlyphPage* parentPage = m_parent-&gt;page();
-
-    // NULL FontData means we're being asked for the system fallback font.
-    if (fontData) {
-        if (m_level == 1) {
-            // Children of the root hold pure pages. These will cover only one
-            // font data's glyphs, and will have glyph index 0 if the font data does not
-            // contain the glyph.
-            unsigned start = pageNumber * GlyphPage::size;
-            UChar buffer[GlyphPage::size * 2 + 2];
-            unsigned bufferLength;
-            unsigned i;
-
-            // Fill in a buffer with the entire &quot;page&quot; of characters that we want to look up glyphs for.
-            if (start &lt; 0x10000) {
-                bufferLength = GlyphPage::size;
-                for (i = 0; i &lt; GlyphPage::size; i++)
-                    buffer[i] = start + i;
-
-                if (start == 0) {
-                    // Control characters must not render at all.
-                    for (i = 0; i &lt; 0x20; ++i)
-                        buffer[i] = zeroWidthSpace;
-                    for (i = 0x7F; i &lt; 0xA0; i++)
-                        buffer[i] = zeroWidthSpace;
-                    buffer[softHyphen] = zeroWidthSpace;
-
-                    // \n, \t, and nonbreaking space must render as a space.
-                    buffer[(int)'\n'] = ' ';
-                    buffer[(int)'\t'] = ' ';
-                    buffer[noBreakSpace] = ' ';
-                } else if (start == (leftToRightMark &amp; ~(GlyphPage::size - 1))) {
-                    // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all.
-                    buffer[leftToRightMark - start] = zeroWidthSpace;
-                    buffer[rightToLeftMark - start] = zeroWidthSpace;
-                    buffer[leftToRightEmbed - start] = zeroWidthSpace;
-                    buffer[rightToLeftEmbed - start] = zeroWidthSpace;
-                    buffer[leftToRightOverride - start] = zeroWidthSpace;
-                    buffer[rightToLeftOverride - start] = zeroWidthSpace;
-                    buffer[zeroWidthNonJoiner - start] = zeroWidthSpace;
-                    buffer[zeroWidthJoiner - start] = zeroWidthSpace;
-                    buffer[popDirectionalFormatting - start] = zeroWidthSpace;
-                } else if (start == (objectReplacementCharacter &amp; ~(GlyphPage::size - 1))) {
-                    // Object replacement character must not render at all.
-                    buffer[objectReplacementCharacter - start] = zeroWidthSpace;
-                } else if (start == (zeroWidthNoBreakSpace &amp; ~(GlyphPage::size - 1))) {
-                    // ZWNBS/BOM must not render at all.
-                    buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace;
-                }
-            } else {
-                bufferLength = GlyphPage::size * 2;
-                for (i = 0; i &lt; GlyphPage::size; i++) {
-                    int c = i + start;
-                    buffer[i * 2] = U16_LEAD(c);
-                    buffer[i * 2 + 1] = U16_TRAIL(c);
-                }
-            }
-
-            // Now that we have a buffer full of characters, we want to get back an array
-            // of glyph indices.  This part involves calling into the platform-specific 
-            // routine of our glyph map for actually filling in the page with the glyphs.
-            // Success is not guaranteed. For example, Times fails to fill page 260, giving glyph data
-            // for only 128 out of 256 characters.
-            bool haveGlyphs;
-            if (is&lt;SimpleFontData&gt;(*fontData)) {
-                if (GlyphPage::mayUseMixedFontDataWhenFilling(buffer, bufferLength, downcast&lt;SimpleFontData&gt;(fontData)))
-                    m_page = GlyphPage::createForMixedFontData(this);
-                else
-                    m_page = GlyphPage::createForSingleFontData(this, downcast&lt;SimpleFontData&gt;(fontData));
-#if PLATFORM(IOS)
-                // FIXME: Times New Roman contains Arabic glyphs, but Core Text doesn't know how to shape them. See &lt;rdar://problem/9823975&gt;.
-                // Once we have the fix for &lt;rdar://problem/9823975&gt; then remove this code together with SimpleFontData::shouldNotBeUsedForArabic()
-                // in &lt;rdar://problem/12096835&gt;.
-                if (pageNumber == 6 &amp;&amp; downcast&lt;SimpleFontData&gt;(*fontData).shouldNotBeUsedForArabic())
-                    haveGlyphs = false;
-                else
-#endif
-                haveGlyphs = fill(m_page.get(), 0, GlyphPage::size, buffer, bufferLength, downcast&lt;SimpleFontData&gt;(fontData));
-            } else {
-                m_page = GlyphPage::createForMixedFontData(this);
-                haveGlyphs = false;
-
-                const SegmentedFontData&amp; segmentedFontData = downcast&lt;SegmentedFontData&gt;(*fontData);
-                unsigned numRanges = segmentedFontData.numRanges();
-                bool zeroFilled = false;
-                RefPtr&lt;GlyphPage&gt; scratchPage;
-                GlyphPage* pageToFill = m_page.get();
-                for (unsigned i = 0; i &lt; numRanges; i++) {
-                    const FontDataRange&amp; range = segmentedFontData.rangeAt(i);
-                    // all this casting is to ensure all the parameters to min and max have the same type,
-                    // to avoid ambiguous template parameter errors on Windows
-                    int from = std::max(0, static_cast&lt;int&gt;(range.from()) - static_cast&lt;int&gt;(start));
-                    int to = 1 + std::min(static_cast&lt;int&gt;(range.to()) - static_cast&lt;int&gt;(start), static_cast&lt;int&gt;(GlyphPage::size) - 1);
-                    if (from &lt; static_cast&lt;int&gt;(GlyphPage::size) &amp;&amp; to &gt; 0) {
-                        if (haveGlyphs &amp;&amp; !scratchPage) {
-                            scratchPage = GlyphPage::createForMixedFontData(this);
-                            pageToFill = scratchPage.get();
-                        }
-
-                        if (!zeroFilled) {
-                            if (from &gt; 0 || to &lt; static_cast&lt;int&gt;(GlyphPage::size)) {
-                                for (unsigned i = 0; i &lt; GlyphPage::size; i++)
-                                    pageToFill-&gt;setGlyphDataForIndex(i, 0, 0);
-                            }
-                            zeroFilled = true;
-                        }
-                        haveGlyphs |= fill(pageToFill, from, to - from, buffer + from * (start &lt; 0x10000 ? 1 : 2), (to - from) * (start &lt; 0x10000 ? 1 : 2), range.fontData().get());
-                        if (scratchPage) {
-                            ASSERT_WITH_SECURITY_IMPLICATION(to &lt;=  static_cast&lt;int&gt;(GlyphPage::size));
-                            for (int j = from; j &lt; to; j++) {
-                                if (!m_page-&gt;glyphAt(j) &amp;&amp; pageToFill-&gt;glyphAt(j))
-                                    m_page-&gt;setGlyphDataForIndex(j, pageToFill-&gt;glyphDataForIndex(j));
-                            }
-                        }
-                    }
-                }
-            }
-
-            if (!haveGlyphs)
-                m_page = 0;
-        } else if (parentPage &amp;&amp; parentPage-&gt;owner() != m_parent) {
-            // The page we're overriding may not be owned by our parent node.
-            // This happens when our parent node provides no useful overrides
-            // and just copies the pointer to an already-existing page (see
-            // below).
-            //
-            // We want our override to be shared by all nodes that reference
-            // that page to avoid duplication, and so standardize on having the
-            // page's owner collect all the overrides.  Call getChild on the
-            // page owner with the desired font data (this will populate
-            // the page) and then reference it.
-            m_page = parentPage-&gt;owner()-&gt;getChild(fontData, pageNumber)-&gt;page();
-        } else {
-            // Get the pure page for the fallback font (at level 1 with no
-            // overrides). getRootChild will always create a page if one
-            // doesn't exist, but the page doesn't necessarily have glyphs
-            // (this pointer may be 0).
-            GlyphPage* fallbackPage = getRootChild(fontData, pageNumber)-&gt;page();
-            if (!parentPage) {
-                // When the parent has no glyphs for this page, we can easily
-                // override it just by supplying the glyphs from our font.
-                m_page = fallbackPage;
-            } else if (!fallbackPage) {
-                // When our font has no glyphs for this page, we can just reference the
-                // parent page.
-                m_page = parentPage;
-            } else {
-                // Combine the parent's glyphs and ours to form a new more complete page.
-                m_page = GlyphPage::createForMixedFontData(this);
-
-                // Overlay the parent page on the fallback page. Check if the fallback font
-                // has added anything.
-                bool newGlyphs = false;
-                for (unsigned i = 0; i &lt; GlyphPage::size; i++) {
-                    if (parentPage-&gt;glyphAt(i))
-                        m_page-&gt;setGlyphDataForIndex(i, parentPage-&gt;glyphDataForIndex(i));
-                    else  if (fallbackPage-&gt;glyphAt(i)) {
-                        m_page-&gt;setGlyphDataForIndex(i, fallbackPage-&gt;glyphDataForIndex(i));
-                        newGlyphs = true;
-                    } else
-                        m_page-&gt;setGlyphDataForIndex(i, 0, 0);
-                }
-
-                if (!newGlyphs)
-                    // We didn't override anything, so our override is just the parent page.
-                    m_page = parentPage;
-            }
-        }
-    } else {
-        // System fallback. Initialized with the parent's page here, as individual
-        // entries may use different fonts depending on character. If the Font
-        // ever finds it needs a glyph out of the system fallback page, it will
-        // ask the system for the best font to use and fill that glyph in for us.
-        if (parentPage)
-            m_page = parentPage-&gt;createCopiedSystemFallbackPage(this);
-        else
-            m_page = GlyphPage::createForMixedFontData(this);
-    }
-}
-
-GlyphPageTreeNode* GlyphPageTreeNode::getChild(const FontData* fontData, unsigned pageNumber)
-{
-    ASSERT(fontData || !m_isSystemFallback);
-    ASSERT(pageNumber == m_pageNumber);
-
-    if (GlyphPageTreeNode* foundChild = fontData ? m_children.get(fontData) : m_systemFallbackChild.get())
-        return foundChild;
-
-    auto&amp; child = fontData ? m_children.add(fontData, nullptr).iterator-&gt;value : m_systemFallbackChild;
-    if (child)
-        return child.get();
-    
-    child = std::make_unique&lt;GlyphPageTreeNode&gt;();
-    child-&gt;m_parent = this;
-    child-&gt;m_level = m_level + 1;
-
-    if (fontData &amp;&amp; fontData-&gt;isCustomFont()) {
-        for (GlyphPageTreeNode* curr = this; curr; curr = curr-&gt;m_parent)
-            curr-&gt;m_customFontCount++;
-    }
-
-#ifndef NDEBUG
-    child-&gt;m_pageNumber = m_pageNumber;
-#endif
-    if (fontData) {
-        m_children.set(fontData, WTF::move(child));
-        fontData-&gt;setMaxGlyphPageTreeLevel(std::max(fontData-&gt;maxGlyphPageTreeLevel(), child-&gt;m_level));
-    } else {
-        m_systemFallbackChild = WTF::move(child);
-        child-&gt;m_isSystemFallback = true;
-    }
-    child-&gt;initializePage(fontData, pageNumber);
-    return child.get();
-}
-
-void GlyphPageTreeNode::pruneCustomFontData(const FontData* fontData)
-{
-    if (!fontData || !m_customFontCount)
-        return;
-        
-    // Prune any branch that contains this FontData.
-    if (auto node = m_children.take(fontData)) {
-        if (unsigned customFontCount = node-&gt;m_customFontCount + 1) {
-            for (GlyphPageTreeNode* curr = this; curr; curr = curr-&gt;m_parent)
-                curr-&gt;m_customFontCount -= customFontCount;
-        }
-    }
-    
-    // Check any branches that remain that still have custom fonts underneath them.
-    if (!m_customFontCount)
-        return;
-
-    GlyphPageTreeNodeMap::iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
-        it-&gt;value-&gt;pruneCustomFontData(fontData);
-}
-
-void GlyphPageTreeNode::pruneFontData(const SimpleFontData* fontData, unsigned level)
-{
-    ASSERT(fontData);
-
-    // Prune fall back child (if any) of this font.
-    if (m_systemFallbackChild &amp;&amp; m_systemFallbackChild-&gt;m_page)
-        m_systemFallbackChild-&gt;m_page-&gt;removeFontDataFromSystemFallbackPage(fontData);
-
-    // Prune any branch that contains this FontData.
-    if (auto node = m_children.take(fontData)) {
-        if (unsigned customFontCount = node-&gt;m_customFontCount) {
-            for (GlyphPageTreeNode* curr = this; curr; curr = curr-&gt;m_parent)
-                curr-&gt;m_customFontCount -= customFontCount;
-        }
-    }
-
-    level++;
-    if (level &gt; fontData-&gt;maxGlyphPageTreeLevel())
-        return;
-
-    GlyphPageTreeNodeMap::iterator end = m_children.end();
-    for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it)
-        it-&gt;value-&gt;pruneFontData(fontData, level);
-}
-
-#ifndef NDEBUG
-    void GlyphPageTreeNode::showSubtree()
-    {
-        Vector&lt;char&gt; indent(level());
-        indent.fill('\t', level());
-        indent.append(0);
-
-        GlyphPageTreeNodeMap::iterator end = m_children.end();
-        for (GlyphPageTreeNodeMap::iterator it = m_children.begin(); it != end; ++it) {
-            printf(&quot;%s\t%p %s\n&quot;, indent.data(), it-&gt;key, it-&gt;key-&gt;description().utf8().data());
-            it-&gt;value-&gt;showSubtree();
-        }
-        if (m_systemFallbackChild) {
-            printf(&quot;%s\t* fallback\n&quot;, indent.data());
-            m_systemFallbackChild-&gt;showSubtree();
-        }
-    }
-#endif
-
-}
-
-#ifndef NDEBUG
-void showGlyphPageTrees()
-{
-    printf(&quot;Page 0:\n&quot;);
-    showGlyphPageTree(0);
-    HashMap&lt;int, WebCore::GlyphPageTreeNode*&gt;::iterator end = WebCore::GlyphPageTreeNode::roots-&gt;end();
-    for (HashMap&lt;int, WebCore::GlyphPageTreeNode*&gt;::iterator it = WebCore::GlyphPageTreeNode::roots-&gt;begin(); it != end; ++it) {
-        printf(&quot;\nPage %d:\n&quot;, it-&gt;key);
-        showGlyphPageTree(it-&gt;key);
-    }
-}
-
-void showGlyphPageTree(unsigned pageNumber)
-{
-    WebCore::GlyphPageTreeNode::getRoot(pageNumber)-&gt;showSubtree();
-}
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphPageTreeNodeh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/GlyphPageTreeNode.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,139 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GlyphPageTreeNode_h
-#define GlyphPageTreeNode_h
-
-#include &quot;GlyphPage.h&quot;
-#include &lt;string.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-
-#ifndef NDEBUG
-void showGlyphPageTrees();
-void showGlyphPageTree(unsigned pageNumber);
-#endif
-
-namespace WebCore {
-
-class FontData;
-class SimpleFontData;
-
-// The glyph page tree is a data structure that maps (FontData, glyph page number)
-// to a GlyphPage.  Level 0 (the &quot;root&quot;) is special. There is one root
-// GlyphPageTreeNode for each glyph page number.  The roots do not have a
-// GlyphPage associated with them, and their initializePage() function is never
-// called to fill the glyphs.
-//
-// Each root node maps a FontData pointer to another GlyphPageTreeNode at
-// level 1 (the &quot;root child&quot;) that stores the actual glyphs for a specific font data.
-// These nodes will only have a GlyphPage if they have glyphs for that range.
-//
-// Levels greater than one correspond to subsequent levels of the fallback list
-// for that font. These levels override their parent's page of glyphs by
-// filling in holes with the new font (thus making a more complete page).
-//
-// A NULL FontData pointer corresponds to the system fallback
-// font. It is tracked separately from the regular pages and overrides so that
-// the glyph pages do not get polluted with these last-resort glyphs. The
-// system fallback page is not populated at construction like the other pages,
-// but on demand for each glyph, because the system may need to use different
-// fallback fonts for each. This lazy population is done by the Font.
-class GlyphPageTreeNode {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static GlyphPageTreeNode* getRootChild(const FontData* fontData, unsigned pageNumber)
-    {
-        return getRoot(pageNumber)-&gt;getChild(fontData, pageNumber);
-    }
-
-    GlyphPageTreeNode()
-        : m_parent(0)
-        , m_level(0)
-        , m_isSystemFallback(false)
-        , m_customFontCount(0)
-#ifndef NDEBUG
-        , m_pageNumber(0)
-#endif
-    {
-    }
-
-    static void pruneTreeCustomFontData(const FontData*);
-    static void pruneTreeFontData(const SimpleFontData*);
-
-    void pruneCustomFontData(const FontData*);
-    void pruneFontData(const SimpleFontData*, unsigned level = 0);
-
-    GlyphPageTreeNode* parent() const { return m_parent; }
-    GlyphPageTreeNode* getChild(const FontData*, unsigned pageNumber);
-
-    // Returns a page of glyphs (or NULL if there are no glyphs in this page's character range).
-    GlyphPage* page() const { return m_page.get(); }
-
-    // Returns the level of this node. See class-level comment.
-    unsigned level() const { return m_level; }
-
-    // The system fallback font has special rules (see above).
-    bool isSystemFallback() const { return m_isSystemFallback; }
-
-    WEBCORE_EXPORT static size_t treeGlyphPageCount();
-    size_t pageCount() const;
-
-private:
-    static GlyphPageTreeNode* getRoot(unsigned pageNumber);
-    void initializePage(const FontData*, unsigned pageNumber);
-
-#ifndef NDEBUG
-    void showSubtree();
-#endif
-
-    static HashMap&lt;int, GlyphPageTreeNode*&gt;* roots;
-    static GlyphPageTreeNode* pageZeroRoot;
-
-    typedef HashMap&lt;const FontData*, std::unique_ptr&lt;GlyphPageTreeNode&gt;&gt; GlyphPageTreeNodeMap;
-
-    GlyphPageTreeNodeMap m_children;
-    GlyphPageTreeNode* m_parent;
-    RefPtr&lt;GlyphPage&gt; m_page;
-    unsigned m_level : 31;
-    bool m_isSystemFallback : 1;
-    unsigned m_customFontCount;
-    std::unique_ptr&lt;GlyphPageTreeNode&gt; m_systemFallbackChild;
-
-#ifndef NDEBUG
-    unsigned m_pageNumber;
-
-    friend void ::showGlyphPageTrees();
-    friend void ::showGlyphPageTree(unsigned pageNumber);
-#endif
-};
-
-} // namespace WebCore
-
-#endif // GlyphPageTreeNode_h
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSegmentedFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/SegmentedFontData.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2015 Apple Inc. 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">@@ -26,28 +26,35 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;SegmentedFontData.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+SegmentedFontData::SegmentedFontData()
+{
+    
+}
+
</ins><span class="cx"> SegmentedFontData::~SegmentedFontData()
</span><span class="cx"> {
</span><del>-    GlyphPageTreeNode::pruneTreeCustomFontData(this);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const
</del><ins>+const SimpleFontData* SegmentedFontData::simpleFontDataForCharacter(UChar32 c) const
</ins><span class="cx"> {
</span><del>-    Vector&lt;FontDataRange&gt;::const_iterator end = m_ranges.end();
-    for (Vector&lt;FontDataRange&gt;::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (it-&gt;from() &lt;= c &amp;&amp; it-&gt;to() &gt;= c)
-            return it-&gt;fontData().get();
</del><ins>+    for (auto&amp; range : m_ranges) {
+        if (range.from() &lt;= c &amp;&amp; c &lt;= range.to())
+            return range.fontData().get();
</ins><span class="cx">     }
</span><del>-    return m_ranges[0].fontData().get();
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const SimpleFontData&amp; SegmentedFontData::simpleFontDataForFirstRange() const
+{
+    return *m_ranges[0].fontData();
+}
+
</ins><span class="cx"> bool SegmentedFontData::isCustomFont() const
</span><span class="cx"> {
</span><span class="cx">     // All segmented fonts are custom fonts.
</span><span class="lines">@@ -56,9 +63,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool SegmentedFontData::isLoading() const
</span><span class="cx"> {
</span><del>-    Vector&lt;FontDataRange&gt;::const_iterator end = m_ranges.end();
-    for (Vector&lt;FontDataRange&gt;::const_iterator it = m_ranges.begin(); it != end; ++it) {
-        if (it-&gt;fontData()-&gt;isLoading())
</del><ins>+    for (auto&amp; range : m_ranges) {
+        if (range.fontData()-&gt;isLoading())
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSegmentedFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SegmentedFontData.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SegmentedFontData.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/SegmentedFontData.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2008, 2009, 2015 Apple Inc. 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">@@ -67,14 +67,16 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    SegmentedFontData() { }
</del><ins>+    SegmentedFontData();
</ins><span class="cx"> 
</span><del>-    virtual const SimpleFontData* fontDataForCharacter(UChar32) const;
</del><ins>+    virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const override;
+    virtual const SimpleFontData&amp; simpleFontDataForFirstRange() const override;
</ins><span class="cx"> 
</span><span class="cx">     virtual bool isCustomFont() const;
</span><span class="cx">     virtual bool isLoading() const;
</span><span class="cx">     virtual bool isSegmented() const;
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;SimpleFontData&gt; m_nullFontData;
</ins><span class="cx">     Vector&lt;FontDataRange, 1&gt; m_ranges;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2005, 2008, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2005, 2008, 2010, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2006 Alexey Proskuryakov
</span><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="lines">@@ -35,9 +35,9 @@
</span><span class="cx"> #endif
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><span class="cx"> #include &quot;OpenTypeMathData.h&quot;
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(OPENTYPE_VERTICAL)
</span><span class="cx"> #include &quot;OpenTypeVerticalData.h&quot;
</span><span class="lines">@@ -45,6 +45,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+unsigned GlyphPage::s_count = 0;
+
</ins><span class="cx"> const float smallCapsFontSizeMultiplier = 0.7f;
</span><span class="cx"> const float emphasisMarkFontSizeMultiplier = 0.5f;
</span><span class="cx"> 
</span><span class="lines">@@ -97,7 +99,7 @@
</span><span class="cx"> // Estimates of avgCharWidth and maxCharWidth for platforms that don't support accessing these values from the font.
</span><span class="cx"> void SimpleFontData::initCharWidths()
</span><span class="cx"> {
</span><del>-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)-&gt;page();
</del><ins>+    auto* glyphPageZero = glyphPage(0);
</ins><span class="cx"> 
</span><span class="cx">     // Treat the width of a '0' as the avgCharWidth.
</span><span class="cx">     if (m_avgCharWidth &lt;= 0.f &amp;&amp; glyphPageZero) {
</span><span class="lines">@@ -117,7 +119,7 @@
</span><span class="cx"> 
</span><span class="cx"> void SimpleFontData::platformGlyphInit()
</span><span class="cx"> {
</span><del>-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)-&gt;page();
</del><ins>+    auto* glyphPageZero = glyphPage(0);
</ins><span class="cx">     if (!glyphPageZero) {
</span><span class="cx">         m_spaceGlyph = 0;
</span><span class="cx">         m_spaceWidth = 0;
</span><span class="lines">@@ -154,24 +156,139 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_fontData)
</span><span class="cx">         platformDestroy();
</span><ins>+}
</ins><span class="cx"> 
</span><del>-    if (isCustomFont())
-        GlyphPageTreeNode::pruneTreeCustomFontData(this);
</del><ins>+const SimpleFontData* SimpleFontData::simpleFontDataForCharacter(UChar32) const
+{
+    return this;
+}
+
+const SimpleFontData&amp; SimpleFontData::simpleFontDataForFirstRange() const
+{
+    return *this;
+}
+
+static bool fillGlyphPage(GlyphPage&amp; pageToFill, unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+#if ENABLE(SVG_FONTS)
+    if (SimpleFontData::AdditionalFontData* additionalFontData = fontData-&gt;fontData())
+        return additionalFontData-&gt;fillSVGGlyphPage(&amp;pageToFill, offset, length, buffer, bufferLength, fontData);
+#endif
+    bool hasGlyphs = pageToFill.fill(offset, length, buffer, bufferLength, fontData);
+#if ENABLE(OPENTYPE_VERTICAL)
+    if (hasGlyphs &amp;&amp; fontData-&gt;verticalData())
+        fontData-&gt;verticalData()-&gt;substituteWithVerticalGlyphs(fontData, &amp;pageToFill, offset, length);
+#endif
+    return hasGlyphs;
+}
+
+static RefPtr&lt;GlyphPage&gt; createAndFillGlyphPage(unsigned pageNumber, const SimpleFontData* fontData)
+{
+#if PLATFORM(IOS)
+    // FIXME: Times New Roman contains Arabic glyphs, but Core Text doesn't know how to shape them. See &lt;rdar://problem/9823975&gt;.
+    // Once we have the fix for &lt;rdar://problem/9823975&gt; then remove this code together with SimpleFontData::shouldNotBeUsedForArabic()
+    // in &lt;rdar://problem/12096835&gt;.
+    if (pageNumber == 6 &amp;&amp; shouldNotBeUsedForArabic())
+        return nullptr;
+#endif
+
+    unsigned start = pageNumber * GlyphPage::size;
+    UChar buffer[GlyphPage::size * 2 + 2];
+    unsigned bufferLength;
+    // Fill in a buffer with the entire &quot;page&quot; of characters that we want to look up glyphs for.
+    if (start &lt; 0x10000) {
+        bufferLength = GlyphPage::size;
+        for (unsigned i = 0; i &lt; GlyphPage::size; i++)
+            buffer[i] = start + i;
+
+        if (start == 0) {
+            // Control characters must not render at all.
+            for (unsigned i = 0; i &lt; 0x20; ++i)
+                buffer[i] = zeroWidthSpace;
+            for (unsigned i = 0x7F; i &lt; 0xA0; i++)
+                buffer[i] = zeroWidthSpace;
+            buffer[softHyphen] = zeroWidthSpace;
+
+            // \n, \t, and nonbreaking space must render as a space.
+            buffer[(int)'\n'] = ' ';
+            buffer[(int)'\t'] = ' ';
+            buffer[noBreakSpace] = ' ';
+        } else if (start == (leftToRightMark &amp; ~(GlyphPage::size - 1))) {
+            // LRM, RLM, LRE, RLE, ZWNJ, ZWJ, and PDF must not render at all.
+            buffer[leftToRightMark - start] = zeroWidthSpace;
+            buffer[rightToLeftMark - start] = zeroWidthSpace;
+            buffer[leftToRightEmbed - start] = zeroWidthSpace;
+            buffer[rightToLeftEmbed - start] = zeroWidthSpace;
+            buffer[leftToRightOverride - start] = zeroWidthSpace;
+            buffer[rightToLeftOverride - start] = zeroWidthSpace;
+            buffer[zeroWidthNonJoiner - start] = zeroWidthSpace;
+            buffer[zeroWidthJoiner - start] = zeroWidthSpace;
+            buffer[popDirectionalFormatting - start] = zeroWidthSpace;
+        } else if (start == (objectReplacementCharacter &amp; ~(GlyphPage::size - 1))) {
+            // Object replacement character must not render at all.
+            buffer[objectReplacementCharacter - start] = zeroWidthSpace;
+        } else if (start == (zeroWidthNoBreakSpace &amp; ~(GlyphPage::size - 1))) {
+            // ZWNBS/BOM must not render at all.
+            buffer[zeroWidthNoBreakSpace - start] = zeroWidthSpace;
+        }
+    } else {
+        bufferLength = GlyphPage::size * 2;
+        for (unsigned i = 0; i &lt; GlyphPage::size; i++) {
+            int c = i + start;
+            buffer[i * 2] = U16_LEAD(c);
+            buffer[i * 2 + 1] = U16_TRAIL(c);
+        }
+    }
+
+    // Now that we have a buffer full of characters, we want to get back an array
+    // of glyph indices. This part involves calling into the platform-specific
+    // routine of our glyph map for actually filling in the page with the glyphs.
+    // Success is not guaranteed. For example, Times fails to fill page 260, giving glyph data
+    // for only 128 out of 256 characters.
+    RefPtr&lt;GlyphPage&gt; glyphPage;
+    if (GlyphPage::mayUseMixedFontDataWhenFilling(buffer, bufferLength, fontData))
+        glyphPage = GlyphPage::createForMixedFontData();
</ins><span class="cx">     else
</span><del>-        GlyphPageTreeNode::pruneTreeFontData(this);
</del><ins>+        glyphPage = GlyphPage::createForSingleFontData(fontData);
+
+    bool haveGlyphs = fillGlyphPage(*glyphPage, 0, GlyphPage::size, buffer, bufferLength, fontData);
+    if (!haveGlyphs)
+        return nullptr;
+
+    glyphPage-&gt;setImmutable();
+    return glyphPage;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-const SimpleFontData* SimpleFontData::fontDataForCharacter(UChar32) const
</del><ins>+const GlyphPage* SimpleFontData::glyphPage(unsigned pageNumber) const
</ins><span class="cx"> {
</span><del>-    return this;
</del><ins>+    if (pageNumber == 0) {
+        if (!m_glyphPageZero)
+            m_glyphPageZero = createAndFillGlyphPage(0, this);
+        return m_glyphPageZero.get();
+    }
+    auto addResult = m_glyphPages.add(pageNumber, nullptr);
+    if (addResult.isNewEntry)
+        addResult.iterator-&gt;value = createAndFillGlyphPage(pageNumber, this);
+
+    return addResult.iterator-&gt;value.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Glyph SimpleFontData::glyphForCharacter(UChar32 character) const
</span><span class="cx"> {
</span><del>-    GlyphPageTreeNode* node = GlyphPageTreeNode::getRootChild(this, character / GlyphPage::size);
-    return node-&gt;page() ? node-&gt;page()-&gt;glyphAt(character % GlyphPage::size) : 0;
</del><ins>+    auto* page = glyphPage(character / GlyphPage::size);
+    if (!page)
+        return 0;
+    return page-&gt;glyphAt(character % GlyphPage::size);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+GlyphData SimpleFontData::glyphDataForCharacter(UChar32 character) const
+{
+    auto* page = glyphPage(character / GlyphPage::size);
+    if (!page)
+        return GlyphData();
+    return page-&gt;glyphDataForCharacter(character);
+}
+
</ins><span class="cx"> bool SimpleFontData::isSegmented() const
</span><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="lines">@@ -269,31 +386,18 @@
</span><span class="cx"> 
</span><span class="cx"> SimpleFontData::DerivedFontData::~DerivedFontData()
</span><span class="cx"> {
</span><del>-    if (!forCustomFont)
-        return;
-
-    if (smallCaps)
-        GlyphPageTreeNode::pruneTreeCustomFontData(smallCaps.get());
-    if (emphasisMark)
-        GlyphPageTreeNode::pruneTreeCustomFontData(emphasisMark.get());
-    if (brokenIdeograph)
-        GlyphPageTreeNode::pruneTreeCustomFontData(brokenIdeograph.get());
-    if (verticalRightOrientation)
-        GlyphPageTreeNode::pruneTreeCustomFontData(verticalRightOrientation.get());
-    if (uprightOrientation)
-        GlyphPageTreeNode::pruneTreeCustomFontData(uprightOrientation.get());
</del><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     if (compositeFontReferences) {
</span><ins>+        // FIXME: Why don't we use WebKit types here?
</ins><span class="cx">         CFDictionaryRef dictionary = CFDictionaryRef(compositeFontReferences.get());
</span><span class="cx">         CFIndex count = CFDictionaryGetCount(dictionary);
</span><span class="cx">         if (count &gt; 0) {
</span><span class="cx">             Vector&lt;SimpleFontData*, 2&gt; stash(count);
</span><span class="cx">             SimpleFontData** fonts = stash.data();
</span><span class="cx">             CFDictionaryGetKeysAndValues(dictionary, 0, (const void **)fonts);
</span><del>-            while (count-- &gt; 0 &amp;&amp; *fonts) {
-                RefPtr&lt;SimpleFontData&gt; afont = adoptRef(*fonts++);
-                GlyphPageTreeNode::pruneTreeCustomFontData(afont.get());
-            }
</del><ins>+            // This deletes the fonts.
+            while (count-- &gt; 0 &amp;&amp; *fonts)
+                adoptRef(*fonts++);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -324,4 +428,20 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;SimpleFontData&gt; SimpleFontData::systemFallbackFontDataForCharacter(UChar32 c, const FontDescription&amp; description, bool isForPlatformFont) const
+{
+    UChar codeUnits[2];
+    int codeUnitsLength;
+    if (c &lt;= 0xFFFF) {
+        codeUnits[0] = Font::normalizeSpaces(c);
+        codeUnitsLength = 1;
+    } else {
+        codeUnits[0] = U16_LEAD(c);
+        codeUnits[1] = U16_TRAIL(c);
+        codeUnitsLength = 2;
+    }
+
+    return fontCache().systemFallbackForCharacters(description, this, isForPlatformFont, codeUnits, codeUnitsLength);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsSimpleFontDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/SimpleFontData.h (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/SimpleFontData.h        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * This file is part of the internal font implementation.
</span><span class="cx">  *
</span><del>- * Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2008, 2010, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2007-2008 Torch Mobile, Inc.
</span><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><span class="cx"> #include &quot;GlyphMetricsMap.h&quot;
</span><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> #include &quot;OpenTypeMathData.h&quot;
</span><span class="cx"> #if ENABLE(OPENTYPE_VERTICAL)
</span><span class="cx"> #include &quot;OpenTypeVerticalData.h&quot;
</span><span class="lines">@@ -165,10 +166,13 @@
</span><span class="cx">     Glyph zeroGlyph() const { return m_zeroGlyph; }
</span><span class="cx">     void setZeroGlyph(Glyph zeroGlyph) { m_zeroGlyph = zeroGlyph; }
</span><span class="cx"> 
</span><del>-    virtual const SimpleFontData* fontDataForCharacter(UChar32) const override;
-
</del><ins>+    GlyphData glyphDataForCharacter(UChar32) const;
</ins><span class="cx">     Glyph glyphForCharacter(UChar32) const;
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;SimpleFontData&gt; systemFallbackFontDataForCharacter(UChar32, const FontDescription&amp;, bool isForPlatformFont) const;
+
+    const GlyphPage* glyphPage(unsigned pageNumber) const;
+
</ins><span class="cx">     void determinePitch();
</span><span class="cx">     Pitch pitch() const { return m_treatAsFixedPitch ? FixedPitch : VariablePitch; }
</span><span class="cx"> 
</span><span class="lines">@@ -226,6 +230,9 @@
</span><span class="cx">     PassRefPtr&lt;SimpleFontData&gt; createScaledFontData(const FontDescription&amp;, float scaleFactor) const;
</span><span class="cx">     PassRefPtr&lt;SimpleFontData&gt; platformCreateScaledFontData(const FontDescription&amp;, float scaleFactor) const;
</span><span class="cx"> 
</span><ins>+    virtual const SimpleFontData* simpleFontDataForCharacter(UChar32) const override;
+    virtual const SimpleFontData&amp; simpleFontDataForFirstRange() const override;
+
</ins><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     void initGDIFont();
</span><span class="cx">     void platformCommonDestroy();
</span><span class="lines">@@ -246,6 +253,8 @@
</span><span class="cx">     FontPlatformData m_platformData;
</span><span class="cx">     std::unique_ptr&lt;AdditionalFontData&gt; m_fontData;
</span><span class="cx"> 
</span><ins>+    mutable RefPtr&lt;GlyphPage&gt; m_glyphPageZero;
+    mutable HashMap&lt;unsigned, RefPtr&lt;GlyphPage&gt;&gt; m_glyphPages;
</ins><span class="cx">     mutable std::unique_ptr&lt;GlyphMetricsMap&lt;FloatRect&gt;&gt; m_glyphToBoundsMap;
</span><span class="cx">     mutable GlyphMetricsMap&lt;float&gt; m_glyphToWidthMap;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeGlyphPageTreeNodeFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> #include &quot;UTF16UChar32Iterator.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -82,8 +82,10 @@
</span><span class="cx">     } else
</span><span class="cx">         _fontDescriptors.grow(index + 1);
</span><span class="cx"> 
</span><del>-    const WebCore::SimpleFontData* fontData = _font-&gt;fontDataAt(index)-&gt;fontDataForCharacter(_character);
-    fontDescriptor = CTFontCopyFontDescriptor(fontData-&gt;platformData().ctFont());
</del><ins>+    const WebCore::SimpleFontData* simpleFontData = _font-&gt;fontDataAt(index)-&gt;simpleFontDataForCharacter(_character);
+    if (!simpleFontData)
+        simpleFontData = &amp;_font-&gt;fontDataAt(index)-&gt;simpleFontDataForFirstRange();
+    fontDescriptor = CTFontCopyFontDescriptor(simpleFontData-&gt;platformData().ctFont());
</ins><span class="cx">     _fontDescriptors[index] = adoptCF(fontDescriptor);
</span><span class="cx">     return (id)fontDescriptor;
</span><span class="cx"> }
</span><span class="lines">@@ -199,7 +201,9 @@
</span><span class="cx">         isSystemFallback = true;
</span><span class="cx"> 
</span><span class="cx">         U16_GET(cp, 0, 0, length, baseCharacter);
</span><del>-        fontData = m_font.fontDataAt(0)-&gt;fontDataForCharacter(baseCharacter);
</del><ins>+        fontData = m_font.fontDataAt(0)-&gt;simpleFontDataForCharacter(baseCharacter);
+        if (!fontData)
+            fontData = &amp;m_font.fontDataAt(0)-&gt;simpleFontDataForFirstRange();
</ins><span class="cx"> 
</span><span class="cx">         RetainPtr&lt;WebCascadeList&gt; cascadeList = adoptNS([[WebCascadeList alloc] initWithFont:&amp;m_font character:baseCharacter]);
</span><span class="cx"> 
</span><span class="lines">@@ -254,7 +258,9 @@
</span><span class="cx">                 // Begin trying to see if runFont matches any of the fonts in the fallback list.
</span><span class="cx">                 unsigned i = 0;
</span><span class="cx">                 for (const FontData* candidateFontData = m_font.fontDataAt(i); candidateFontData; candidateFontData = m_font.fontDataAt(++i)) {
</span><del>-                    runFontData = candidateFontData-&gt;fontDataForCharacter(baseCharacter);
</del><ins>+                    runFontData = candidateFontData-&gt;simpleFontDataForCharacter(baseCharacter);
+                    if (!runFontData)
+                        continue;
</ins><span class="cx">                     RetainPtr&lt;CFTypeRef&gt; runFontEqualityObject = runFontData-&gt;platformData().objectForEqualityCheck();
</span><span class="cx">                     if (CFEqual(runFontEqualityObject.get(), runFontEqualityObject.get()))
</span><span class="cx">                         break;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontComplexTextMaccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/mac/FontComplexTextMac.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -140,7 +140,9 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned i = 0;
</span><span class="cx">     for (const FontData* fontData = fontDataAt(0); fontData; fontData = fontDataAt(++i)) {
</span><del>-        const SimpleFontData* simpleFontData = fontData-&gt;fontDataForCharacter(baseCharacter);
</del><ins>+        const SimpleFontData* simpleFontData = fontData-&gt;simpleFontDataForCharacter(baseCharacter);
+        if (!simpleFontData)
+            continue;
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         if (baseCharacter &gt;= 0x0600 &amp;&amp; baseCharacter &lt;= 0x06ff &amp;&amp; simpleFontData-&gt;shouldNotBeUsedForArabic())
</span><span class="cx">             continue;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGlyphPageMaccppfromrev177858trunkSourceWebCoreplatformgraphicsmacGlyphPageTreeNodeMaccpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp (from rev 177858, trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp) (0 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageMac.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -0,0 +1,181 @@
</span><ins>+/*
+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer. 
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution. 
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission. 
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;GlyphPage.h&quot;
+
+#include &quot;CoreGraphicsSPI.h&quot;
+#include &quot;CoreTextSPI.h&quot;
+#include &quot;Font.h&quot;
+#include &quot;SimpleFontData.h&quot;
+#include &quot;WebCoreSystemInterface.h&quot;
+#if !PLATFORM(IOS)
+#include &lt;ApplicationServices/ApplicationServices.h&gt;
+#endif
+
+namespace WebCore {
+
+static bool shouldUseCoreText(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    if (fontData-&gt;platformData().isCompositeFontReference())
+        return true;
+    if (fontData-&gt;platformData().widthVariant() != RegularWidth || fontData-&gt;hasVerticalGlyphs()) {
+        // Ideographs don't have a vertical variant or width variants.
+        for (unsigned i = 0; i &lt; bufferLength; ++i) {
+            if (!Font::isCJKIdeograph(buffer[i]))
+                return true;
+        }
+    }
+
+    return false;
+}
+
+bool GlyphPage::mayUseMixedFontDataWhenFilling(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    // FIXME: This could be smarter if the logic currently in GlyphPage::fill() got to make the decision about what kind of GlyphPage to construct.
+    return shouldUseCoreText(buffer, bufferLength, fontData);
+}
+
+bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
+{
+    bool haveGlyphs = false;
+
+    Vector&lt;CGGlyph, 512&gt; glyphs(bufferLength);
+    if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
+        // We pass in either 256 or 512 UTF-16 characters: 256 for U+FFFF and less, 512 (double character surrogates)
+        // for U+10000 and above. It is indeed possible to get back 512 glyphs back from the API, so the glyph buffer
+        // we pass in must be 512. If we get back more than 256 glyphs though we'll ignore all the ones after 256,
+        // this should not happen as the only time we pass in 512 characters is when they are surrogates.
+        CGFontGetGlyphsForUnichars(fontData-&gt;platformData().cgFont(), buffer, glyphs.data(), bufferLength);
+        for (unsigned i = 0; i &lt; length; ++i) {
+            if (!glyphs[i])
+                setGlyphDataForIndex(offset + i, 0, 0);
+            else {
+                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
+                haveGlyphs = true;
+            }
+        }
+    } else if (!fontData-&gt;platformData().isCompositeFontReference() &amp;&amp; ((fontData-&gt;platformData().widthVariant() == RegularWidth)
+        ? CTFontGetVerticalGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength)
+        : CTFontGetGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength))) {
+        // When buffer consists of surrogate pairs, CTFontGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters
+        // place the glyphs at indices corresponding to the first character of each pair.
+        ASSERT(!(bufferLength % length) &amp;&amp; (bufferLength / length == 1 || bufferLength / length == 2));
+        unsigned glyphStep = bufferLength / length;
+        for (unsigned i = 0; i &lt; length; ++i) {
+            if (!glyphs[i * glyphStep])
+                setGlyphDataForIndex(offset + i, 0, 0);
+            else {
+                setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData);
+                haveGlyphs = true;
+            }
+        }
+    } else {
+        // We ask CoreText for possible vertical variant glyphs
+        RetainPtr&lt;CFStringRef&gt; string = adoptCF(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
+        RetainPtr&lt;CFAttributedStringRef&gt; attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData-&gt;getCFStringAttributes(0, fontData-&gt;hasVerticalGlyphs() ? Vertical : Horizontal)));
+        RetainPtr&lt;CTLineRef&gt; line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
+
+        CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
+        CFIndex runCount = CFArrayGetCount(runArray);
+
+        // Initialize glyph entries
+        for (unsigned index = 0; index &lt; length; ++index)
+            setGlyphDataForIndex(offset + index, 0, 0);
+
+        Vector&lt;CGGlyph, 512&gt; glyphVector;
+        Vector&lt;CFIndex, 512&gt; indexVector;
+        bool done = false;
+
+        RetainPtr&lt;CFTypeRef&gt; fontEqualityObject = fontData-&gt;platformData().objectForEqualityCheck();
+
+        for (CFIndex r = 0; r &lt; runCount &amp;&amp; !done ; ++r) {
+            // CTLine could map characters over multiple fonts using its own font fallback list.
+            // We need to pick runs that use the exact font we need, i.e., fontData-&gt;platformData().ctFont().
+            CTRunRef ctRun = static_cast&lt;CTRunRef&gt;(CFArrayGetValueAtIndex(runArray, r));
+            ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
+
+            CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
+            CTFontRef runFont = static_cast&lt;CTFontRef&gt;(CFDictionaryGetValue(attributes, kCTFontAttributeName));
+            bool gotBaseFont = CFEqual(fontEqualityObject.get(), FontPlatformData::objectForEqualityCheck(runFont).get());
+            if (gotBaseFont || fontData-&gt;platformData().isCompositeFontReference()) {
+                // This run uses the font we want. Extract glyphs.
+                CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
+                const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
+                if (!glyphs) {
+                    glyphVector.resize(glyphCount);
+                    CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
+                    glyphs = glyphVector.data();
+                }
+                const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
+                if (!stringIndices) {
+                    indexVector.resize(glyphCount);
+                    CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
+                    stringIndices = indexVector.data();
+                }
+
+                // When buffer consists of surrogate pairs, CTRunGetStringIndicesPtr and CTRunGetStringIndices
+                // place the glyphs at indices corresponding to the first character of each pair.
+                ASSERT(!(bufferLength % length) &amp;&amp; (bufferLength / length == 1 || bufferLength / length == 2));
+                unsigned glyphStep = bufferLength / length;
+                if (gotBaseFont) {
+                    for (CFIndex i = 0; i &lt; glyphCount; ++i) {
+                        if (stringIndices[i] &gt;= static_cast&lt;CFIndex&gt;(bufferLength)) {
+                            done = true;
+                            break;
+                        }
+                        if (glyphs[i]) {
+                            setGlyphDataForIndex(offset + (stringIndices[i] / glyphStep), glyphs[i], fontData);
+                            haveGlyphs = true;
+                        }
+                    }
+#if !PLATFORM(IOS)
+                } else {
+                    const SimpleFontData* runSimple = fontData-&gt;getCompositeFontReferenceFontData((NSFont *)runFont);
+                    if (runSimple) {
+                        for (CFIndex i = 0; i &lt; glyphCount; ++i) {
+                            if (stringIndices[i] &gt;= static_cast&lt;CFIndex&gt;(bufferLength)) {
+                                done = true;
+                                break;
+                            }
+                            if (glyphs[i]) {
+                                setGlyphDataForIndex(offset + (stringIndices[i] / glyphStep), glyphs[i], runSimple);
+                                haveGlyphs = true;
+                            }
+                        }
+                    }
+#endif // !PLATFORM(IOS)
+                }
+            }
+        }
+    }
+
+    return haveGlyphs;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacGlyphPageTreeNodeMaccpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -1,180 +0,0 @@
</span><del>-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer. 
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;GlyphPageTreeNode.h&quot;
-
-#include &quot;CoreGraphicsSPI.h&quot;
-#include &quot;CoreTextSPI.h&quot;
-#include &quot;Font.h&quot;
-#include &quot;SimpleFontData.h&quot;
-#include &quot;WebCoreSystemInterface.h&quot;
-#if !PLATFORM(IOS)
-#include &lt;ApplicationServices/ApplicationServices.h&gt;
-#endif
-
-namespace WebCore {
-
-static bool shouldUseCoreText(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    if (fontData-&gt;platformData().isCompositeFontReference())
-        return true;
-    if (fontData-&gt;platformData().widthVariant() != RegularWidth || fontData-&gt;hasVerticalGlyphs()) {
-        // Ideographs don't have a vertical variant or width variants.
-        for (unsigned i = 0; i &lt; bufferLength; ++i) {
-            if (!Font::isCJKIdeograph(buffer[i]))
-                return true;
-        }
-    }
-
-    return false;
-}
-
-bool GlyphPage::mayUseMixedFontDataWhenFilling(const UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    // FIXME: This could be smarter if the logic currently in GlyphPage::fill() got to make the decision about what kind of GlyphPage to construct.
-    return shouldUseCoreText(buffer, bufferLength, fontData);
-}
-
-bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData)
-{
-    bool haveGlyphs = false;
-
-    Vector&lt;CGGlyph, 512&gt; glyphs(bufferLength);
-    if (!shouldUseCoreText(buffer, bufferLength, fontData)) {
-        // We pass in either 256 or 512 UTF-16 characters: 256 for U+FFFF and less, 512 (double character surrogates)
-        // for U+10000 and above. It is indeed possible to get back 512 glyphs back from the API, so the glyph buffer
-        // we pass in must be 512. If we get back more than 256 glyphs though we'll ignore all the ones after 256,
-        // this should not happen as the only time we pass in 512 characters is when they are surrogates.
-        CGFontGetGlyphsForUnichars(fontData-&gt;platformData().cgFont(), buffer, glyphs.data(), bufferLength);
-        for (unsigned i = 0; i &lt; length; ++i) {
-            if (!glyphs[i])
-                setGlyphDataForIndex(offset + i, 0, 0);
-            else {
-                setGlyphDataForIndex(offset + i, glyphs[i], fontData);
-                haveGlyphs = true;
-            }
-        }
-    } else if (!fontData-&gt;platformData().isCompositeFontReference() &amp;&amp; ((fontData-&gt;platformData().widthVariant() == RegularWidth) ? CTFontGetVerticalGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength)
-               : CTFontGetGlyphsForCharacters(fontData-&gt;platformData().ctFont(), buffer, glyphs.data(), bufferLength))) {
-        // When buffer consists of surrogate pairs, CTFontGetVerticalGlyphsForCharacters and CTFontGetGlyphsForCharacters
-        // place the glyphs at indices corresponding to the first character of each pair.
-        ASSERT(!(bufferLength % length) &amp;&amp; (bufferLength / length == 1 || bufferLength / length == 2));
-        unsigned glyphStep = bufferLength / length;
-        for (unsigned i = 0; i &lt; length; ++i) {
-            if (!glyphs[i * glyphStep])
-                setGlyphDataForIndex(offset + i, 0, 0);
-            else {
-                setGlyphDataForIndex(offset + i, glyphs[i * glyphStep], fontData);
-                haveGlyphs = true;
-            }
-        }
-    } else {
-        // We ask CoreText for possible vertical variant glyphs
-        RetainPtr&lt;CFStringRef&gt; string = adoptCF(CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, buffer, bufferLength, kCFAllocatorNull));
-        RetainPtr&lt;CFAttributedStringRef&gt; attributedString = adoptCF(CFAttributedStringCreate(kCFAllocatorDefault, string.get(), fontData-&gt;getCFStringAttributes(0, fontData-&gt;hasVerticalGlyphs() ? Vertical : Horizontal)));
-        RetainPtr&lt;CTLineRef&gt; line = adoptCF(CTLineCreateWithAttributedString(attributedString.get()));
-
-        CFArrayRef runArray = CTLineGetGlyphRuns(line.get());
-        CFIndex runCount = CFArrayGetCount(runArray);
-
-        // Initialize glyph entries
-        for (unsigned index = 0; index &lt; length; ++index)
-            setGlyphDataForIndex(offset + index, 0, 0);
-
-        Vector&lt;CGGlyph, 512&gt; glyphVector;
-        Vector&lt;CFIndex, 512&gt; indexVector;
-        bool done = false;
-
-        RetainPtr&lt;CFTypeRef&gt; fontEqualityObject = fontData-&gt;platformData().objectForEqualityCheck();
-
-        for (CFIndex r = 0; r &lt; runCount &amp;&amp; !done ; ++r) {
-            // CTLine could map characters over multiple fonts using its own font fallback list.
-            // We need to pick runs that use the exact font we need, i.e., fontData-&gt;platformData().ctFont().
-            CTRunRef ctRun = static_cast&lt;CTRunRef&gt;(CFArrayGetValueAtIndex(runArray, r));
-            ASSERT(CFGetTypeID(ctRun) == CTRunGetTypeID());
-
-            CFDictionaryRef attributes = CTRunGetAttributes(ctRun);
-            CTFontRef runFont = static_cast&lt;CTFontRef&gt;(CFDictionaryGetValue(attributes, kCTFontAttributeName));
-            bool gotBaseFont = CFEqual(fontEqualityObject.get(), FontPlatformData::objectForEqualityCheck(runFont).get());
-            if (gotBaseFont || fontData-&gt;platformData().isCompositeFontReference()) {
-                // This run uses the font we want. Extract glyphs.
-                CFIndex glyphCount = CTRunGetGlyphCount(ctRun);
-                const CGGlyph* glyphs = CTRunGetGlyphsPtr(ctRun);
-                if (!glyphs) {
-                    glyphVector.resize(glyphCount);
-                    CTRunGetGlyphs(ctRun, CFRangeMake(0, 0), glyphVector.data());
-                    glyphs = glyphVector.data();
-                }
-                const CFIndex* stringIndices = CTRunGetStringIndicesPtr(ctRun);
-                if (!stringIndices) {
-                    indexVector.resize(glyphCount);
-                    CTRunGetStringIndices(ctRun, CFRangeMake(0, 0), indexVector.data());
-                    stringIndices = indexVector.data();
-                }
-
-                // When buffer consists of surrogate pairs, CTRunGetStringIndicesPtr and CTRunGetStringIndices
-                // place the glyphs at indices corresponding to the first character of each pair.
-                ASSERT(!(bufferLength % length) &amp;&amp; (bufferLength / length == 1 || bufferLength / length == 2));
-                unsigned glyphStep = bufferLength / length;
-                if (gotBaseFont) {
-                    for (CFIndex i = 0; i &lt; glyphCount; ++i) {
-                        if (stringIndices[i] &gt;= static_cast&lt;CFIndex&gt;(bufferLength)) {
-                            done = true;
-                            break;
-                        }
-                        if (glyphs[i]) {
-                            setGlyphDataForIndex(offset + (stringIndices[i] / glyphStep), glyphs[i], fontData);
-                            haveGlyphs = true;
-                        }
-                    }
-#if !PLATFORM(IOS)
-                } else {
-                    const SimpleFontData* runSimple = fontData-&gt;getCompositeFontReferenceFontData((NSFont *)runFont);
-                    if (runSimple) {
-                        for (CFIndex i = 0; i &lt; glyphCount; ++i) {
-                            if (stringIndices[i] &gt;= static_cast&lt;CFIndex&gt;(bufferLength)) {
-                                done = true;
-                                break;
-                            }
-                            if (glyphs[i]) {
-                                setGlyphDataForIndex(offset + (stringIndices[i] / glyphStep), glyphs[i], runSimple);
-                                haveGlyphs = true;
-                            }
-                        }
-                    }
-#endif // !PLATFORM(IOS)
-                }
-            }
-        }
-    }
-
-    return haveGlyphs;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacSimpleFontDataMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #import &quot;Font.h&quot;
</span><span class="cx"> #import &quot;FontCache.h&quot;
</span><span class="cx"> #import &quot;FontDescription.h&quot;
</span><del>-#import &quot;GlyphPageTreeNode.h&quot;
</del><span class="cx"> #import &quot;SharedBuffer.h&quot;
</span><span class="cx"> #import &quot;WebCoreSystemInterface.h&quot;
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -222,8 +221,7 @@
</span><span class="cx">     if (platformData().orientation() == Horizontal) {
</span><span class="cx">         // Measure the actual character &quot;x&quot;, since it's possible for it to extend below the baseline, and we need the
</span><span class="cx">         // reported x-height to only include the portion of the glyph that is above the baseline.
</span><del>-        GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)-&gt;page();
-        NSGlyph xGlyph = glyphPageZero ? glyphPageZero-&gt;glyphDataForCharacter('x').glyph : 0;
</del><ins>+        NSGlyph xGlyph = glyphForCharacter('x');
</ins><span class="cx">         if (xGlyph)
</span><span class="cx">             xHeight = -CGRectGetMinY(platformBoundsForGlyph(xGlyph));
</span><span class="cx">         else
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCGWin.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span><span class="cx"> #include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGlyphPageTreeNodeCairoWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;config.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;HWndDC.h&quot;
</span><span class="cx"> #include &quot;SimpleFontData.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinSimpleFontDataCGWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> #include &quot;Font.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> #include &quot;FontDescription.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> #include &quot;HWndDC.h&quot;
</span><span class="cx"> #include &lt;ApplicationServices/ApplicationServices.h&gt;
</span><span class="cx"> #include &lt;WebKitSystemInterface/WebKitSystemInterface.h&gt;
</span><span class="lines">@@ -89,8 +89,7 @@
</span><span class="cx">     m_fontMetrics.setLineGap(fLineGap);
</span><span class="cx">     m_fontMetrics.setLineSpacing(lroundf(fAscent) + lroundf(fDescent) + lroundf(fLineGap));
</span><span class="cx"> 
</span><del>-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(this, 0)-&gt;page();
-    Glyph xGlyph = glyphPageZero ? glyphPageZero-&gt;glyphDataForCharacter('x').glyph : 0;
</del><ins>+    Glyph xGlyph = glyphDataForCharacter('x').glyph;
</ins><span class="cx">     if (xGlyph) {
</span><span class="cx">         // Measure the actual character &quot;x&quot;, since it's possible for it to extend below the baseline, and we need the
</span><span class="cx">         // reported x-height to only include the portion of the glyph that is above the baseline.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -272,6 +272,8 @@
</span><span class="cx"> 
</span><span class="cx"> DragImageRef createDragImageForLink(URL&amp; url, const String&amp; title, FontRenderingMode)
</span><span class="cx"> {
</span><ins>+    FontCachePurgePreventer fontCachePurgePreventer;
+
</ins><span class="cx">     NSString *label = nsStringNilIfEmpty(title);
</span><span class="cx">     NSURL *cocoaURL = url;
</span><span class="cx">     NSString *urlString = [cocoaURL absoluteString];
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontData.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontData.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/svg/SVGFontData.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> #include &quot;SVGFontData.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><ins>+#include &quot;GlyphPage.h&quot;
</ins><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="cx"> #include &quot;SVGAltGlyphElement.h&quot;
</span><span class="cx"> #include &quot;SVGFontElement.h&quot;
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     float descent = svgFontFaceElement-&gt;descent() * scale;
</span><span class="cx">     float lineGap = 0.1f * fontSize;
</span><span class="cx"> 
</span><del>-    GlyphPage* glyphPageZero = GlyphPageTreeNode::getRootChild(fontData, 0)-&gt;page();
</del><ins>+    const GlyphPage* glyphPageZero = fontData-&gt;glyphPage(0);
</ins><span class="cx"> 
</span><span class="cx">     if (!xHeight &amp;&amp; glyphPageZero) {
</span><span class="cx">         // Fallback if x_heightAttr is not specified for the font element.
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontElement.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontElement.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebCore/svg/SVGFontElement.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><span class="cx"> #include &quot;Font.h&quot;
</span><del>-#include &quot;GlyphPageTreeNode.h&quot;
</del><span class="cx"> #include &quot;SVGGlyphElement.h&quot;
</span><span class="cx"> #include &quot;SVGHKernElement.h&quot;
</span><span class="cx"> #include &quot;SVGMissingGlyphElement.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCoreStatisticsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> #import &lt;WebCore/FontCache.h&gt;
</span><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/GCController.h&gt;
</span><del>-#import &lt;WebCore/GlyphPageTreeNode.h&gt;
</del><ins>+#import &lt;WebCore/GlyphPage.h&gt;
</ins><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><span class="cx"> #import &lt;WebCore/IconDatabase.h&gt;
</span><span class="cx"> #import &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> 
</span><span class="cx"> + (size_t)glyphPageCount
</span><span class="cx"> {
</span><del>-    return GlyphPageTreeNode::treeGlyphPageCount();
</del><ins>+    return GlyphPage::count();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (BOOL)shouldPrintExceptions
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreStatistics.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebKit/win/WebCoreStatistics.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> #include &lt;JavaScriptCore/MemoryStatistics.h&gt;
</span><span class="cx"> #include &lt;WebCore/FontCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/GCController.h&gt;
</span><del>-#include &lt;WebCore/GlyphPageTreeNode.h&gt;
</del><ins>+#include &lt;WebCore/GlyphPage.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IconDatabase.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageCache.h&gt;
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!count)
</span><span class="cx">         return E_POINTER;
</span><del>-    *count = (UINT) GlyphPageTreeNode::treeGlyphPageCount();
</del><ins>+    *count = (UINT) GlyphPage::count();
</ins><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (177875 => 177876)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-04 20:14:45 UTC (rev 177875)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-04 21:26:17 UTC (rev 177876)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/GCController.h&gt;
</span><del>-#include &lt;WebCore/GlyphPageTreeNode.h&gt;
</del><ins>+#include &lt;WebCore/GlyphPage.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IconDatabase.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSDOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/Language.h&gt;
</span><span class="lines">@@ -931,7 +931,7 @@
</span><span class="cx">     data.statisticsNumbers.set(ASCIILiteral(&quot;CachedFontDataInactiveCount&quot;), fontCache().inactiveFontDataCount());
</span><span class="cx">     
</span><span class="cx">     // Gather glyph page statistics.
</span><del>-    data.statisticsNumbers.set(ASCIILiteral(&quot;GlyphPageCount&quot;), GlyphPageTreeNode::treeGlyphPageCount());
</del><ins>+    data.statisticsNumbers.set(ASCIILiteral(&quot;GlyphPageCount&quot;), GlyphPage::count());
</ins><span class="cx">     
</span><span class="cx">     // Get WebCore memory cache statistics
</span><span class="cx">     getWebCoreMemoryCacheStatistics(data.webCoreCacheStatistics);
</span></span></pre>
</div>
</div>

</body>
</html>