<!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>[177490] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/177490">177490</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-12-18 04:16:12 -0800 (Thu, 18 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Stop returning GlyphPage from various Font functions
https://bugs.webkit.org/show_bug.cgi?id=139627
Reviewed by Darin Adler.
Source/WebCore:
Make all
std::pair<GlyphData, GlyphPage*> glyphDataAndPage*(...)
style functions to just return GlyphData only. The GlyphPage value was only used for an obscure SVG fallback case.
* platform/graphics/Font.h:
(WebCore::Font::glyphDataForCharacter):
(WebCore::Font::glyphDataAndPageForCharacter): Deleted.
* platform/graphics/FontGlyphs.cpp:
(WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic):
(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
(WebCore::FontGlyphs::glyphDataForSystemFallback):
(WebCore::FontGlyphs::glyphDataForVariant):
(WebCore::FontGlyphs::glyphDataForCharacter):
(WebCore::glyphDataAndPageForCJKCharacterWithoutSyntheticItalic): Deleted.
(WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation): Deleted.
(WebCore::FontGlyphs::glyphDataAndPageForSystemFallback): Deleted.
(WebCore::FontGlyphs::glyphDataAndPageForVariant): Deleted.
(WebCore::FontGlyphs::glyphDataAndPageForCharacter): Deleted.
* platform/graphics/FontGlyphs.h:
(WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver): Deleted.
(WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver): Deleted.
No longer needed.
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
Simplify by not trying to resolve fallbacks in case context sensitive (based on lang attribute etc)
glyph selection fails. Instead just fall back to a default font. This behavior is not specified
anywhere as far as I can see. (normal non-context sensitive fallbacks will still work fine).
This removes the need to hackishly mutate glyph pages.
Also fix a bug where we didn't use the specified missing glyph when context sensitive selection failed.
LayoutTests:
These are progressions. We now correctly draw the specified missing glyph.
* platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png:
* platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt:
* platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png:
* svg/custom/glyph-selection-lang-attribute-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11fontsglyph03texpectedpng">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11fontsglyph03texpectedtxt">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomglyphselectionlangattributeexpectedpng">trunk/LayoutTests/platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png</a></li>
<li><a href="#trunkLayoutTestssvgcustomglyphselectionlangattributeexpectedtxt">trunk/LayoutTests/svg/custom/glyph-selection-lang-attribute-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFonth">trunk/Source/WebCore/platform/graphics/Font.h</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="#trunkSourceWebCorerenderingsvgSVGTextRunRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/LayoutTests/ChangeLog        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-12-18 Antti Koivisto <antti@apple.com>
+
+ Stop returning GlyphPage from various Font functions
+ https://bugs.webkit.org/show_bug.cgi?id=139627
+
+ Reviewed by Darin Adler.
+
+ These are progressions. We now correctly draw the specified missing glyph.
+
+ * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png:
+ * platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt:
+ * platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png:
+ * svg/custom/glyph-selection-lang-attribute-expected.txt:
+
</ins><span class="cx"> 2014-12-17 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] More test gardening
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11fontsglyph03texpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11fontsglyph03texpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/fonts-glyph-03-t-expected.txt        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -2,9 +2,9 @@
</span><span class="cx"> RenderView at (0,0) size 480x360
</span><span class="cx"> layer at (0,0) size 480x360
</span><span class="cx"> RenderSVGRoot {svg} at (0,0) size 480x360
</span><del>- RenderSVGContainer {g} at (50,10) size 28x260
</del><ins>+ RenderSVGContainer {g} at (50,10) size 25x260
</ins><span class="cx"> RenderSVGHiddenContainer {defs} at (0,0) size 0x0
</span><del>- RenderSVGContainer {g} at (50,10) size 28x260
</del><ins>+ RenderSVGContainer {g} at (50,10) size 25x260
</ins><span class="cx"> RenderSVGText {text} at (50,10) size 25x50 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 25x50
</span><span class="cx"> chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 1 width 25.00: "a"
</span><span class="lines">@@ -14,9 +14,9 @@
</span><span class="cx"> RenderSVGText {text} at (50,150) size 25x50 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 25x50
</span><span class="cx"> chunk 1 text run 1 at (50.00,190.00) startOffset 0 endOffset 1 width 25.00: "a"
</span><del>- RenderSVGText {text} at (50,220) size 28x50 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 28x50
- chunk 1 text run 1 at (50.00,260.00) startOffset 0 endOffset 1 width 28.00: "a"
</del><ins>+ RenderSVGText {text} at (50,220) size 25x50 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 25x50
+ chunk 1 text run 1 at (50.00,260.00) startOffset 0 endOffset 1 width 25.00: "a"
</ins><span class="cx"> RenderSVGText {text} at (10,304) size 284x46 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 284x46
</span><span class="cx"> chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 17 width 284.00: "$Revision: 1.10 $"
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomglyphselectionlangattributeexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/svg/custom/glyph-selection-lang-attribute-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestssvgcustomglyphselectionlangattributeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/custom/glyph-selection-lang-attribute-expected.txt (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/custom/glyph-selection-lang-attribute-expected.txt        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/LayoutTests/svg/custom/glyph-selection-lang-attribute-expected.txt        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -3,22 +3,22 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx"> RenderSVGRoot {svg} at (0,0) size 800x600
</span><span class="cx"> RenderSVGHiddenContainer {defs} at (0,0) size 0x0
</span><del>- RenderSVGContainer {g} at (83,16) size 47x551
</del><ins>+ RenderSVGContainer {g} at (83,16) size 42x551
</ins><span class="cx"> RenderSVGText {text} at (50,10) size 25x50 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 25x50
</span><span class="cx"> chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 1 width 24.90: "a"
</span><span class="cx"> RenderSVGText {text} at (50,80) size 25x50 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 25x50
</span><span class="cx"> chunk 1 text run 1 at (50.00,120.00) startOffset 0 endOffset 1 width 24.90: "a"
</span><del>- RenderSVGText {text} at (50,150) size 28x50 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 28x50
- chunk 1 text run 1 at (50.00,190.00) startOffset 0 endOffset 1 width 27.60: "a"
- RenderSVGText {text} at (50,220) size 28x50 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 28x50
- chunk 1 text run 1 at (50.00,260.00) startOffset 0 endOffset 1 width 27.60: "a"
- RenderSVGText {text} at (50,290) size 28x50 contains 1 chunk(s)
- RenderSVGInlineText {#text} at (0,0) size 28x50
- chunk 1 text run 1 at (50.00,330.00) startOffset 0 endOffset 1 width 27.60: "a"
</del><ins>+ RenderSVGText {text} at (50,150) size 25x50 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 25x50
+ chunk 1 text run 1 at (50.00,190.00) startOffset 0 endOffset 1 width 24.90: "a"
+ RenderSVGText {text} at (50,220) size 25x50 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 25x50
+ chunk 1 text run 1 at (50.00,260.00) startOffset 0 endOffset 1 width 24.90: "a"
+ RenderSVGText {text} at (50,290) size 25x50 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 25x50
+ chunk 1 text run 1 at (50.00,330.00) startOffset 0 endOffset 1 width 24.90: "a"
</ins><span class="cx"> RenderSVGContainer {g} at (250,16) size 42x551 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}]
</span><span class="cx"> RenderSVGText {text} at (50,10) size 25x50 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 25x50
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/Source/WebCore/ChangeLog        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2014-12-18 Antti Koivisto <antti@apple.com>
+
+ Stop returning GlyphPage from various Font functions
+ https://bugs.webkit.org/show_bug.cgi?id=139627
+
+ Reviewed by Darin Adler.
+
+ Make all
+
+ std::pair<GlyphData, GlyphPage*> glyphDataAndPage*(...)
+
+ style functions to just return GlyphData only. The GlyphPage value was only used for an obscure SVG fallback case.
+
+ * platform/graphics/Font.h:
+ (WebCore::Font::glyphDataForCharacter):
+ (WebCore::Font::glyphDataAndPageForCharacter): Deleted.
+ * platform/graphics/FontGlyphs.cpp:
+ (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic):
+ (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
+ (WebCore::FontGlyphs::glyphDataForSystemFallback):
+ (WebCore::FontGlyphs::glyphDataForVariant):
+ (WebCore::FontGlyphs::glyphDataForCharacter):
+ (WebCore::glyphDataAndPageForCJKCharacterWithoutSyntheticItalic): Deleted.
+ (WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation): Deleted.
+ (WebCore::FontGlyphs::glyphDataAndPageForSystemFallback): Deleted.
+ (WebCore::FontGlyphs::glyphDataAndPageForVariant): Deleted.
+ (WebCore::FontGlyphs::glyphDataAndPageForCharacter): Deleted.
+ * platform/graphics/FontGlyphs.h:
+ (WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver): Deleted.
+ (WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver): Deleted.
+
+ No longer needed.
+
+ * rendering/svg/SVGTextRunRenderingContext.cpp:
+ (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
+
+ Simplify by not trying to resolve fallbacks in case context sensitive (based on lang attribute etc)
+ glyph selection fails. Instead just fall back to a default font. This behavior is not specified
+ anywhere as far as I can see. (normal non-context sensitive fallbacks will still work fine).
+ This removes the need to hackishly mutate glyph pages.
+
+ Also fix a bug where we didn't use the specified missing glyph when context sensitive selection failed.
+
</ins><span class="cx"> 2014-12-18 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Move 'list-style-image' CSS property to the new StyleBuilder
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Font.h (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Font.h        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/Source/WebCore/platform/graphics/Font.h        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -187,15 +187,11 @@
</span><span class="cx"> const FontData* fontDataAt(unsigned) const;
</span><span class="cx"> GlyphData glyphDataForCharacter(UChar32 c, bool mirror, FontDataVariant variant = AutoVariant) const
</span><span class="cx"> {
</span><del>- return glyphDataAndPageForCharacter(c, mirror, variant).first;
</del><ins>+ return m_glyphs->glyphDataForCharacter(m_fontDescription, c, mirror, variant);
</ins><span class="cx"> }
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> const SimpleFontData* fontDataForCombiningCharacterSequence(const UChar*, size_t length, FontDataVariant) const;
</span><span class="cx"> #endif
</span><del>- std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
- {
- return m_glyphs->glyphDataAndPageForCharacter(m_fontDescription, c, mirror, variant);
- }
</del><span class="cx"> bool primaryFontHasGlyphForCharacter(UChar32) const;
</span><span class="cx">
</span><span class="cx"> static bool isCJKIdeograph(UChar32);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.cpp        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -209,7 +209,8 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData& data, GlyphPage* page, unsigned pageNumber)
</del><ins>+#if PLATFORM(COCOA)
+static GlyphData glyphDataForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData& data, unsigned pageNumber)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<SimpleFontData> nonItalicFontData = data.fontData->nonSyntheticItalicFontData();
</span><span class="cx"> GlyphPageTreeNode* nonItalicNode = GlyphPageTreeNode::getRootChild(nonItalicFontData.get(), pageNumber);
</span><span class="lines">@@ -217,12 +218,13 @@
</span><span class="cx"> if (nonItalicPage) {
</span><span class="cx"> GlyphData nonItalicData = nonItalicPage->glyphDataForCharacter(character);
</span><span class="cx"> if (nonItalicData.fontData)
</span><del>- return std::make_pair(nonItalicData, nonItalicPage);
</del><ins>+ return nonItalicData;
</ins><span class="cx"> }
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><del>-static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
</del><ins>+static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, unsigned pageNumber)
</ins><span class="cx"> {
</span><span class="cx"> if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
</span><span class="cx"> RefPtr<SimpleFontData> uprightFontData = data.fontData->uprightOrientationFontData();
</span><span class="lines">@@ -232,11 +234,11 @@
</span><span class="cx"> GlyphData uprightData = uprightPage->glyphDataForCharacter(character);
</span><span class="cx"> // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
</span><span class="cx"> if (data.glyph == uprightData.glyph)
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx"> // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
</span><span class="cx"> // glyph, so we fall back to the upright data and use the horizontal glyph.
</span><span class="cx"> if (uprightData.fontData)
</span><del>- return std::make_pair(uprightData, uprightPage);
</del><ins>+ return uprightData;
</ins><span class="cx"> }
</span><span class="cx"> } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
</span><span class="cx"> RefPtr<SimpleFontData> verticalRightFontData = data.fontData->verticalRightOrientationFontData();
</span><span class="lines">@@ -247,16 +249,16 @@
</span><span class="cx"> // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
</span><span class="cx"> // into it.
</span><span class="cx"> if (data.glyph != verticalRightData.glyph)
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx"> // The glyphs are identical, meaning that we should just use the horizontal glyph.
</span><span class="cx"> if (verticalRightData.fontData)
</span><del>- return std::make_pair(verticalRightData, verticalRightPage);
</del><ins>+ return verticalRightData;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForSystemFallback(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode& node)
</del><ins>+GlyphData FontGlyphs::glyphDataForSystemFallback(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode& node)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(node.page());
</span><span class="cx"> ASSERT(node.isSystemFallback());
</span><span class="lines">@@ -290,9 +292,9 @@
</span><span class="cx"> node.page()->setGlyphDataForCharacter(c, data.glyph, data.fontData);
</span><span class="cx"> data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node.level()));
</span><span class="cx"> if (!Font::isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
</span><del>- return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
</del><ins>+ return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, pageNumber);
</ins><span class="cx"> }
</span><del>- return std::make_pair(data, node.page());
</del><ins>+ return data;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Even system fallback can fail; use the missing glyph in that case.
</span><span class="lines">@@ -302,10 +304,10 @@
</span><span class="cx"> node.page()->setGlyphDataForCharacter(c, data.glyph, data.fontData);
</span><span class="cx"> data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node.level()));
</span><span class="cx"> }
</span><del>- return std::make_pair(data, node.page());
</del><ins>+ return data;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForVariant(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode*& node)
</del><ins>+GlyphData FontGlyphs::glyphDataForVariant(UChar32 c, const FontDescription& description, FontDataVariant variant, unsigned pageNumber, GlyphPageTreeNode*& node)
</ins><span class="cx"> {
</span><span class="cx"> while (true) {
</span><span class="cx"> if (GlyphPage* page = node->page()) {
</span><span class="lines">@@ -315,30 +317,30 @@
</span><span class="cx"> // But if it does, we will just render the capital letter big.
</span><span class="cx"> RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(description, variant);
</span><span class="cx"> if (!variantFontData)
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx">
</span><span class="cx"> GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
</span><span class="cx"> GlyphPage* variantPage = variantNode->page();
</span><span class="cx"> if (variantPage) {
</span><span class="cx"> GlyphData data = variantPage->glyphDataForCharacter(c);
</span><span class="cx"> if (data.fontData)
</span><del>- return std::make_pair(data, variantPage);
</del><ins>+ return data;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
</span><span class="cx"> // a font has the lowercase character but the small caps font does not have its uppercase version.
</span><del>- return std::make_pair(variantFontData->missingGlyphData(), page);
</del><ins>+ return variantFontData->missingGlyphData();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (node->isSystemFallback())
</span><del>- return glyphDataAndPageForSystemFallback(c, description, variant, pageNumber, *node);
</del><ins>+ return glyphDataForSystemFallback(c, description, variant, pageNumber, *node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForCharacter(const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant)
</del><ins>+GlyphData FontGlyphs::glyphDataForCharacter(const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx">
</span><span class="lines">@@ -364,7 +366,7 @@
</span><span class="cx"> node = GlyphPageTreeNode::getRootChild(realizeFontDataAt(description, 0), pageNumber);
</span><span class="cx">
</span><span class="cx"> if (variant != NormalVariant)
</span><del>- return glyphDataAndPageForVariant(c, description, variant, pageNumber, node);
</del><ins>+ return glyphDataForVariant(c, description, variant, pageNumber, node);
</ins><span class="cx">
</span><span class="cx"> while (true) {
</span><span class="cx"> if (GlyphPage* page = node->page()) {
</span><span class="lines">@@ -372,24 +374,24 @@
</span><span class="cx"> if (data.fontData) {
</span><span class="cx"> if (data.fontData->platformData().orientation() == Vertical && !data.fontData->isTextOrientationFallback()) {
</span><span class="cx"> if (!Font::isCJKIdeographOrSymbol(c))
</span><del>- return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, page, pageNumber);
</del><ins>+ return glyphDataForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, pageNumber);
</ins><span class="cx">
</span><span class="cx"> if (!data.fontData->hasVerticalGlyphs()) {
</span><span class="cx"> // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
</span><span class="cx"> // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
</span><del>- return glyphDataAndPageForVariant(c, description, BrokenIdeographVariant, pageNumber, node);
</del><ins>+ return glyphDataForVariant(c, description, BrokenIdeographVariant, pageNumber, node);
</ins><span class="cx"> }
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> if (data.fontData->platformData().syntheticOblique())
</span><del>- return glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(c, data, page, pageNumber);
</del><ins>+ return glyphDataForCJKCharacterWithoutSyntheticItalic(c, data, pageNumber);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return std::make_pair(data, page);
</del><ins>+ return data;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (node->isSystemFallback())
</span><del>- return glyphDataAndPageForSystemFallback(c, description, variant, pageNumber, *node);
</del><ins>+ return glyphDataForSystemFallback(c, description, variant, pageNumber, *node);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontGlyphsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontGlyphs.h (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/Source/WebCore/platform/graphics/FontGlyphs.h        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -47,27 +47,6 @@
</span><span class="cx"> public:
</span><span class="cx"> typedef HashMap<int, GlyphPageTreeNode*, DefaultHash<int>::Hash> GlyphPages;
</span><span class="cx">
</span><del>- class GlyphPagesStateSaver {
- public:
- GlyphPagesStateSaver(FontGlyphs& glyphs)
- : m_glyphs(glyphs)
- , m_pages(glyphs.m_pages)
- , m_pageZero(glyphs.m_pageZero)
- {
- }
-
- ~GlyphPagesStateSaver()
- {
- m_glyphs.m_pages = m_pages;
- m_glyphs.m_pageZero = m_pageZero;
- }
-
- private:
- FontGlyphs& m_glyphs;
- GlyphPages& m_pages;
- GlyphPageTreeNode* m_pageZero;
- };
-
</del><span class="cx"> static Ref<FontGlyphs> create(PassRefPtr<FontSelector> fontSelector) { return adoptRef(*new FontGlyphs(fontSelector)); }
</span><span class="cx"> static Ref<FontGlyphs> createForPlatformFont(const FontPlatformData& platformData) { return adoptRef(*new FontGlyphs(platformData)); }
</span><span class="cx">
</span><span class="lines">@@ -75,7 +54,7 @@
</span><span class="cx">
</span><span class="cx"> bool isForPlatformFont() const { return m_isForPlatformFont; }
</span><span class="cx">
</span><del>- std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCharacter(const FontDescription&, UChar32, bool mirror, FontDataVariant);
</del><ins>+ GlyphData glyphDataForCharacter(const FontDescription&, UChar32, bool mirror, FontDataVariant);
</ins><span class="cx">
</span><span class="cx"> bool isFixedPitch(const FontDescription&);
</span><span class="cx"> void determinePitch(const FontDescription&);
</span><span class="lines">@@ -98,8 +77,8 @@
</span><span class="cx"> FontGlyphs(PassRefPtr<FontSelector>);
</span><span class="cx"> FontGlyphs(const FontPlatformData&);
</span><span class="cx">
</span><del>- std::pair<GlyphData, GlyphPage*> glyphDataAndPageForSystemFallback(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode&);
- std::pair<GlyphData, GlyphPage*> glyphDataAndPageForVariant(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode*&);
</del><ins>+ GlyphData glyphDataForSystemFallback(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode&);
+ GlyphData glyphDataForVariant(UChar32, const FontDescription&, FontDataVariant, unsigned pageNumber, GlyphPageTreeNode*&);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void releaseFontData();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGTextRunRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp (177489 => 177490)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp        2014-12-18 09:55:48 UTC (rev 177489)
+++ trunk/Source/WebCore/rendering/svg/SVGTextRunRenderingContext.cpp        2014-12-18 12:16:12 UTC (rev 177490)
</span><span class="lines">@@ -295,8 +295,7 @@
</span><span class="cx"> const SimpleFontData* primaryFont = font.primaryFont();
</span><span class="cx"> ASSERT(primaryFont);
</span><span class="cx">
</span><del>- std::pair<GlyphData, GlyphPage*> pair = font.glyphDataAndPageForCharacter(character, mirror, AutoVariant);
- GlyphData glyphData = pair.first;
</del><ins>+ GlyphData glyphData = font.glyphDataForCharacter(character, mirror, AutoVariant);
</ins><span class="cx">
</span><span class="cx"> // Check if we have the missing glyph data, in which case we can just return.
</span><span class="cx"> GlyphData missingGlyphData = primaryFont->missingGlyphData();
</span><span class="lines">@@ -305,14 +304,7 @@
</span><span class="cx"> return glyphData;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Save data from the font fallback list because we may modify it later. Do this before the
- // potential change to glyphData.fontData below.
- FontGlyphs* glyph = font.glyphs();
- ASSERT(glyph);
- FontGlyphs::GlyphPagesStateSaver glyphPagesSaver(*glyph);
-
</del><span class="cx"> // Characters enclosed by an <altGlyph> element, may not be registered in the GlyphPage.
</span><del>- const SimpleFontData* originalFontData = glyphData.fontData;
</del><span class="cx"> if (glyphData.fontData && !glyphData.fontData->isSVGFont()) {
</span><span class="cx"> auto& elementRenderer = is<RenderElement>(renderer()) ? downcast<RenderElement>(renderer()) : *renderer().parent();
</span><span class="cx"> if (Element* parentRendererElement = elementRenderer.element()) {
</span><span class="lines">@@ -322,42 +314,32 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const SimpleFontData* fontData = glyphData.fontData;
</span><del>- if (fontData) {
- if (!fontData->isSVGFont())
- return glyphData;
</del><ins>+ if (!fontData || !fontData->isSVGFont())
+ return glyphData;
</ins><span class="cx">
</span><del>- SVGFontElement* fontElement = nullptr;
- SVGFontFaceElement* fontFaceElement = nullptr;
</del><ins>+ SVGFontElement* fontElement = nullptr;
+ SVGFontFaceElement* fontFaceElement = nullptr;
+ const SVGFontData* svgFontData = svgFontAndFontFaceElementForFontData(fontData, fontFaceElement, fontElement);
+ if (!svgFontData)
+ return glyphData;
</ins><span class="cx">
</span><del>- const SVGFontData* svgFontData = svgFontAndFontFaceElementForFontData(fontData, fontFaceElement, fontElement);
- if (!fontElement || !fontFaceElement)
- return glyphData;
</del><ins>+ // If we got here, we're dealing with a glyph defined in a SVG Font.
+ // The returned glyph by glyphDataForCharacter() is a glyph stored in the SVG Font glyph table.
+ // This doesn't necessarily mean the glyph is suitable for rendering/measuring in this context, its
+ // arabic-form/orientation/... may not match, we have to apply SVG Glyph selection to discover that.
+ if (svgFontData->applySVGGlyphSelection(iterator, glyphData, mirror, currentCharacter, advanceLength, normalizedSpacesStringCache))
+ return glyphData;
+ if (missingGlyphData.glyph)
+ return missingGlyphData;
</ins><span class="cx">
</span><del>- // If we got here, we're dealing with a glyph defined in a SVG Font.
- // The returned glyph by glyphDataAndPageForCharacter() is a glyph stored in the SVG Font glyph table.
- // This doesn't necessarily mean the glyph is suitable for rendering/measuring in this context, its
- // arabic-form/orientation/... may not match, we have to apply SVG Glyph selection to discover that.
- if (svgFontData->applySVGGlyphSelection(iterator, glyphData, mirror, currentCharacter, advanceLength, normalizedSpacesStringCache))
- return glyphData;
- }
</del><ins>+ // SVG font context sensitive selection failed and there is no defined missing glyph. Drop down to a default font.
+ // The behavior does not seem to be specified. For simplicity we don't try to resolve font fallbacks context-sensitively.
+ FontDescription fallbackDescription = font.fontDescription();
+ fallbackDescription.setFamilies(Vector<AtomicString> { sansSerifFamily });
+ Font fallbackFont(fallbackDescription, font.letterSpacing(), font.wordSpacing());
+ fallbackFont.update(font.fontSelector());
</ins><span class="cx">
</span><del>- GlyphPage* page = pair.second;
- ASSERT(page);
-
- // No suitable glyph found that is compatible with the requirments (same language, arabic-form, orientation etc.)
- // Even though our GlyphPage contains an entry for eg. glyph "a", it's not compatible. So we have to temporarily
- // remove the glyph data information from the GlyphPage, and retry the lookup, which handles font fallbacks correctly.
- page->setGlyphDataForCharacter(character, 0, nullptr);
-
- // Assure that the font fallback glyph selection worked, aka. the fallbackGlyphData font data is not the same as before.
- GlyphData fallbackGlyphData = font.glyphDataForCharacter(character, mirror);
- ASSERT(fallbackGlyphData.fontData != fontData);
-
- // Restore original state of the SVG Font glyph table and the current font fallback list,
- // to assure the next lookup of the same glyph won't immediately return the fallback glyph.
- page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData);
- ASSERT(fallbackGlyphData.fontData);
- return fallbackGlyphData;
</del><ins>+ return fallbackFont.glyphDataForCharacter(character, mirror, AutoVariant);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>