<!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>[205382] 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/205382">205382</a></dd>
<dt>Author</dt> <dd>ryanhaddad@apple.com</dd>
<dt>Date</dt> <dd>2016-09-02 16:18:48 -0700 (Fri, 02 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/205373">r205373</a>.
This change causes LayoutTest crashes under GuardMalloc
Reverted changeset:
"[Cocoa] Distinguish between paint advances and base advances"
https://bugs.webkit.org/show_bug.cgi?id=160892
http://trac.webkit.org/changeset/205373</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t051202c26psudonest00cexpectedpng">trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t051202c26psudonest00cexpectedtxt">trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss21t1508c527font00bexpectedpng">trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastinlineabsolutepositionedinlineincentredblockexpectedpng">trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastinlineabsolutepositionedinlineincentredblockexpectedtxt">trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGlyphBufferh">trunk/Source/WebCore/platform/graphics/GlyphBuffer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCascadeCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerh">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm">trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaCoreTextSPIh">trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmaccss21t1508c527font00bexpectedtxt">trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.txt</a></li>
<li>trunk/LayoutTests/platform/mac-elcapitan/css2.1/</li>
<li>trunk/LayoutTests/platform/mac-elcapitan/fast/inline/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/LayoutTests/ChangeLog        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-09-02 Ryan Haddad <ryanhaddad@apple.com>
+
+ Unreviewed, rolling out r205373.
+
+ This change causes LayoutTest crashes under GuardMalloc
+
+ Reverted changeset:
+
+ "[Cocoa] Distinguish between paint advances and base advances"
+ https://bugs.webkit.org/show_bug.cgi?id=160892
+ http://trac.webkit.org/changeset/205373
+
</ins><span class="cx"> 2016-09-02 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> Need to updateEditorState if an element change edit-ability without changing
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t051202c26psudonest00cexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t051202c26psudonest00cexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.txt (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.txt        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/LayoutTests/platform/mac/css2.1/t051202-c26-psudo-nest-00-c-expected.txt        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -56,13 +56,13 @@
</span><span class="cx"> RenderInline {STRONG} at (0,0) size 111x18
</span><span class="cx"> RenderText {#text} at (130,15) size 111x18
</span><span class="cx"> text run at (130,15) width 111: "two characters"
</span><del>- RenderText {#text} at (240,15) size 451x18
- text run at (240,15) width 120: " in this paragraph "
- text run at (359,15) width 332: "(a double-quote mark and a capital 'T') should be "
- RenderInline {STRONG} at (0,0) size 90x18
- RenderText {#text} at (690,15) size 90x18
- text run at (690,15) width 45: "200% "
- text run at (734,15) width 46: "bigger"
</del><ins>+ RenderText {#text} at (240,15) size 452x18
+ text run at (240,15) width 121: " in this paragraph "
+ text run at (360,15) width 332: "(a double-quote mark and a capital 'T') should be "
+ RenderInline {STRONG} at (0,0) size 89x18
+ RenderText {#text} at (691,15) size 89x18
+ text run at (691,15) width 45: "200% "
+ text run at (735,15) width 45: "bigger"
</ins><span class="cx"> RenderText {#text} at (0,37) size 223x18
</span><span class="cx"> text run at (0,37) width 223: "than the rest of the paragraph, and "
</span><span class="cx"> RenderInline {STRONG} at (0,0) size 34x18
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t1508c527font00bexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss21t1508c527font00bexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.txt (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.txt        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/LayoutTests/platform/mac/css2.1/t1508-c527-font-00-b-expected.txt        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-layer at (0,0) size 800x600
- RenderView at (0,0) size 800x600
-layer at (0,0) size 800x101
- RenderBlock {HTML} at (0,0) size 800x101
- RenderBody {BODY} at (8,13) size 784x75 [color=#000080]
- RenderBlock {P} at (0,0) size 784x75
- RenderText {#text} at (0,0) size 616x15
- text run at (0,0) width 616: "This text should be 13px Helvetica in small-caps and italicized. There should be a small gap between each line. "
- RenderInline {SPAN} at (0,0) size 781x75 [color=#C0C0C0]
- RenderText {#text} at (615,0) size 781x75
- text run at (615,0) width 166: "dummy text dummy text dummy"
- text run at (0,15) width 195: "text dummy text dummy text dummy "
- text run at (194,15) width 390: "text dummy text dummy text dummy text dummy text dummy text dummy "
- text run at (583,15) width 192: "text dummy text dummy text dummy"
- text run at (0,30) width 195: "text dummy text dummy text dummy "
- text run at (194,30) width 390: "text dummy text dummy text dummy text dummy text dummy text dummy "
- text run at (583,30) width 192: "text dummy text dummy text dummy"
- text run at (0,45) width 195: "text dummy text dummy text dummy "
- text run at (194,45) width 390: "text dummy text dummy text dummy text dummy text dummy text dummy "
- text run at (583,45) width 192: "text dummy text dummy text dummy"
- text run at (0,60) width 195: "text dummy text dummy text dummy "
- text run at (194,60) width 349: "text dummy text dummy text dummy text dummy text dummy text"
- RenderText {#text} at (0,0) size 0x0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastinlineabsolutepositionedinlineincentredblockexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastinlineabsolutepositionedinlineincentredblockexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/LayoutTests/platform/mac/fast/inline/absolute-positioned-inline-in-centred-block-expected.txt        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -6,5 +6,5 @@
</span><span class="cx"> RenderBlock {DIV} at (0,0) size 784x0
</span><span class="cx"> layer at (250,562) size 303x28
</span><span class="cx"> RenderBlock (positioned) {FONT} at (250,562) size 303x28
</span><del>- RenderText {#text} at (0,0) size 302x28
- text run at (0,0) width 302: "Hello World, And Stuff!"
</del><ins>+ RenderText {#text} at (0,0) size 303x28
+ text run at (0,0) width 303: "Hello World, And Stuff!"
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/ChangeLog        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-09-02 Ryan Haddad <ryanhaddad@apple.com>
+ Unreviewed, rolling out r205373.
+
+ This change causes LayoutTest crashes under GuardMalloc
+
+ Reverted changeset:
+
+ "[Cocoa] Distinguish between paint advances and base advances"
+ https://bugs.webkit.org/show_bug.cgi?id=160892
+ http://trac.webkit.org/changeset/205373
+
</ins><span class="cx"> 2016-09-02 Beth Dakin <bdakin@apple.com>
</span><span class="cx">
</span><span class="cx"> Need to updateEditorState if an element change edit-ability without changing
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGlyphBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GlyphBuffer.h (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GlyphBuffer.h        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/graphics/GlyphBuffer.h        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void setWidth(CGFloat width) { this->CGSize::width = width; }
</span><del>- void setHeight(CGFloat height) { this->CGSize::height = height; }
</del><span class="cx"> CGFloat width() const { return this->CGSize::width; }
</span><span class="cx"> CGFloat height() const { return this->CGSize::height; }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCascadeCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx"> float afterWidth = controller.runWidthSoFar();
</span><span class="cx">
</span><span class="cx"> if (run.rtl()) {
</span><del>- initialAdvance = controller.totalWidth() - afterWidth + controller.leadingExpansion();
</del><ins>+ initialAdvance = controller.totalWidth() + controller.finalRoundingWidth() - afterWidth + controller.leadingExpansion();
</ins><span class="cx"> glyphBuffer.reverse(0, glyphBuffer.size());
</span><span class="cx"> } else
</span><span class="cx"> initialAdvance = beforeWidth;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -107,13 +107,28 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> ComplexTextController::ComplexTextController(const FontCascade& font, const TextRun& run, bool mayUseNaturalWritingDirection, HashSet<const Font*>* fallbackFonts, bool forTextEmphasis)
</span><del>- : m_fallbackFonts(fallbackFonts)
- , m_font(font)
</del><ins>+ : m_font(font)
</ins><span class="cx"> , m_run(run)
</span><ins>+ , m_isLTROnly(true)
+ , m_mayUseNaturalWritingDirection(mayUseNaturalWritingDirection)
+ , m_forTextEmphasis(forTextEmphasis)
+ , m_currentCharacter(0)
</ins><span class="cx"> , m_end(run.length())
</span><ins>+ , m_totalWidth(0)
+ , m_runWidthSoFar(0)
+ , m_numGlyphsSoFar(0)
+ , m_currentRun(0)
+ , m_glyphInCurrentRun(0)
+ , m_characterInCurrentGlyph(0)
+ , m_finalRoundingWidth(0)
</ins><span class="cx"> , m_expansion(run.expansion())
</span><del>- , m_mayUseNaturalWritingDirection(mayUseNaturalWritingDirection)
- , m_forTextEmphasis(forTextEmphasis)
</del><ins>+ , m_leadingExpansion(0)
+ , m_fallbackFonts(fallbackFonts)
+ , m_minGlyphBoundingBoxX(std::numeric_limits<float>::max())
+ , m_maxGlyphBoundingBoxX(std::numeric_limits<float>::min())
+ , m_minGlyphBoundingBoxY(std::numeric_limits<float>::max())
+ , m_maxGlyphBoundingBoxY(std::numeric_limits<float>::min())
+ , m_lastRoundingGlyph(0)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_expansion)
</span><span class="cx"> m_expansionPerOpportunity = 0;
</span><span class="lines">@@ -143,7 +158,7 @@
</span><span class="cx"> m_runWidthSoFar = m_leadingExpansion;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-unsigned ComplexTextController::offsetForPosition(float h, bool includePartialGlyphs)
</del><ins>+int ComplexTextController::offsetForPosition(float h, bool includePartialGlyphs)
</ins><span class="cx"> {
</span><span class="cx"> if (h >= m_totalWidth)
</span><span class="cx"> return m_run.ltr() ? m_end : 0;
</span><span class="lines">@@ -161,7 +176,7 @@
</span><span class="cx"> const ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
</span><span class="cx"> for (unsigned j = 0; j < complexTextRun.glyphCount(); ++j) {
</span><span class="cx"> size_t index = offsetIntoAdjustedGlyphs + j;
</span><del>- CGFloat adjustedAdvance = m_adjustedBaseAdvances[index].width;
</del><ins>+ CGFloat adjustedAdvance = m_adjustedAdvances[index].width;
</ins><span class="cx"> if (!index)
</span><span class="cx"> adjustedAdvance += complexTextRun.initialAdvance().width;
</span><span class="cx"> if (x < adjustedAdvance) {
</span><span class="lines">@@ -173,7 +188,8 @@
</span><span class="cx"> hitGlyphEnd = std::max<CFIndex>(hitGlyphStart, j > 0 ? complexTextRun.indexAt(j - 1) : static_cast<CFIndex>(complexTextRun.indexEnd()));
</span><span class="cx">
</span><span class="cx"> // FIXME: Instead of dividing the glyph's advance equally between the characters, this
</span><del>- // could use the glyph's "ligature carets". This is available in CoreText via CTFontGetLigatureCaretPositions().
</del><ins>+ // could use the glyph's "ligature carets". However, there is no Core Text API to get the
+ // ligature carets.
</ins><span class="cx"> CFIndex hitIndex = hitGlyphStart + (hitGlyphEnd - hitGlyphStart) * (m_run.ltr() ? x / adjustedAdvance : 1 - x / adjustedAdvance);
</span><span class="cx"> int stringLength = complexTextRun.stringLength();
</span><span class="cx"> TextBreakIterator* cursorPositionIterator = cursorMovementIterator(StringView(complexTextRun.characters(), stringLength));
</span><span class="lines">@@ -201,7 +217,7 @@
</span><span class="cx"> clusterWidth = adjustedAdvance;
</span><span class="cx"> int firstGlyphBeforeCluster = j - 1;
</span><span class="cx"> while (firstGlyphBeforeCluster >= 0 && complexTextRun.indexAt(firstGlyphBeforeCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphBeforeCluster) < clusterEnd) {
</span><del>- CGFloat width = m_adjustedBaseAdvances[offsetIntoAdjustedGlyphs + firstGlyphBeforeCluster].width;
</del><ins>+ CGFloat width = m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphBeforeCluster].width;
</ins><span class="cx"> clusterWidth += width;
</span><span class="cx"> x += width;
</span><span class="cx"> firstGlyphBeforeCluster--;
</span><span class="lines">@@ -208,7 +224,7 @@
</span><span class="cx"> }
</span><span class="cx"> unsigned firstGlyphAfterCluster = j + 1;
</span><span class="cx"> while (firstGlyphAfterCluster < complexTextRun.glyphCount() && complexTextRun.indexAt(firstGlyphAfterCluster) >= clusterStart && complexTextRun.indexAt(firstGlyphAfterCluster) < clusterEnd) {
</span><del>- clusterWidth += m_adjustedBaseAdvances[offsetIntoAdjustedGlyphs + firstGlyphAfterCluster].width;
</del><ins>+ clusterWidth += m_adjustedAdvances[offsetIntoAdjustedGlyphs + firstGlyphAfterCluster].width;
</ins><span class="cx"> firstGlyphAfterCluster++;
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="lines">@@ -307,11 +323,10 @@
</span><span class="cx"> // We break up glyph run generation for the string by Font.
</span><span class="cx"> const UChar* cp;
</span><span class="cx">
</span><del>- Vector<String> stringsFor8BitRuns;
</del><span class="cx"> if (m_run.is8Bit()) {
</span><span class="cx"> String stringFor8BitRun = String::make16BitFrom8BitSource(m_run.characters8(), m_run.length());
</span><del>- stringsFor8BitRuns.append(WTFMove(stringFor8BitRun));
- cp = stringsFor8BitRuns.last().characters16();
</del><ins>+ cp = stringFor8BitRun.characters16();
+ m_stringsFor8BitRuns.append(stringFor8BitRun);
</ins><span class="cx"> } else
</span><span class="cx"> cp = m_run.characters16();
</span><span class="cx">
</span><span class="lines">@@ -413,7 +428,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- ASSERT(m_end >= indexOfFontTransition);
</del><span class="cx"> unsigned itemLength = m_end - indexOfFontTransition;
</span><span class="cx"> if (itemLength) {
</span><span class="cx"> unsigned itemStart = indexOfFontTransition;
</span><span class="lines">@@ -449,7 +463,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> m_glyphEndOffsets.grow(m_glyphCount);
</span><del>- for (unsigned i = 0; i < m_glyphCount; ++i) {
</del><ins>+ for (size_t i = 0; i < m_glyphCount; ++i) {
</ins><span class="cx"> CFIndex nextMappedIndex = m_indexEnd;
</span><span class="cx"> for (size_t j = indexAt(i) + 1; j < m_stringLength; ++j) {
</span><span class="cx"> if (mappedIndices[j]) {
</span><span class="lines">@@ -516,28 +530,9 @@
</span><span class="cx"> return indexOfCurrentRun(leftmostGlyph);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-float ComplexTextController::runWidthSoFarFraction(unsigned glyphStartOffset, unsigned glyphEndOffset, unsigned oldCharacterInCurrentGlyph, GlyphIterationStyle iterationStyle) const
-{
- // FIXME: Instead of dividing the glyph's advance equally between the characters, this
- // could use the glyph's "ligature carets". This is available in CoreText via CTFontGetLigatureCaretPositions().
- if (glyphStartOffset == glyphEndOffset) {
- // When there are multiple glyphs per character we need to advance by the full width of the glyph.
- ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph);
- return 1;
- }
-
- if (iterationStyle == ByWholeGlyphs) {
- if (!oldCharacterInCurrentGlyph)
- return 1;
- return 0;
- }
-
- return static_cast<float>(m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
-}
-
</del><span class="cx"> void ComplexTextController::advance(unsigned offset, GlyphBuffer* glyphBuffer, GlyphIterationStyle iterationStyle, HashSet<const Font*>* fallbackFonts)
</span><span class="cx"> {
</span><del>- if (offset > m_end)
</del><ins>+ if (static_cast<int>(offset) > m_end)
</ins><span class="cx"> offset = m_end;
</span><span class="cx">
</span><span class="cx"> if (offset <= m_currentCharacter) {
</span><span class="lines">@@ -567,14 +562,7 @@
</span><span class="cx"> // When leftmostGlyph is 0, it represents the first glyph to draw, taking into
</span><span class="cx"> // account the text direction.
</span><span class="cx"> if (glyphBuffer && !leftmostGlyph) {
</span><del>- CGSize initialAdvance = complexTextRun.initialAdvance();
-#if USE_LAYOUT_SPECIFIC_ADVANCES
- unsigned index = ltr ? 0 : m_glyphOrigins.size() - 1;
- initialAdvance.width += m_glyphOrigins[index].x;
- initialAdvance.height += m_glyphOrigins[index].y;
-#endif
- glyphBuffer->setInitialAdvance(initialAdvance);
-
</del><ins>+ glyphBuffer->setInitialAdvance(complexTextRun.initialAdvance());
</ins><span class="cx"> glyphBuffer->setLeadingExpansion(m_leadingExpansion);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -589,25 +577,28 @@
</span><span class="cx"> } else
</span><span class="cx"> glyphEndOffset = complexTextRun.endOffsetAt(g);
</span><span class="cx">
</span><del>- CGSize adjustedBaseAdvance = m_adjustedBaseAdvances[k];
</del><ins>+ CGSize adjustedAdvance = m_adjustedAdvances[k];
</ins><span class="cx">
</span><span class="cx"> if (glyphStartOffset + complexTextRun.stringLocation() >= m_currentCharacter)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (glyphBuffer && !m_characterInCurrentGlyph) {
- GlyphBufferAdvance paintAdvance = adjustedBaseAdvance;
-#if USE_LAYOUT_SPECIFIC_ADVANCES
- if (k + 1 < m_adjustedBaseAdvances.size()) {
- paintAdvance.setWidth(paintAdvance.width() + m_glyphOrigins[k + 1].x - m_glyphOrigins[k].x);
- paintAdvance.setHeight(paintAdvance.height() - m_glyphOrigins[k + 1].y + m_glyphOrigins[k].y);
- }
-#endif
- glyphBuffer->add(m_adjustedGlyphs[k], &complexTextRun.font(), paintAdvance, complexTextRun.indexAt(m_glyphInCurrentRun));
- }
</del><ins>+ if (glyphBuffer && !m_characterInCurrentGlyph)
+ glyphBuffer->add(m_adjustedGlyphs[k], &complexTextRun.font(), adjustedAdvance, complexTextRun.indexAt(m_glyphInCurrentRun));
</ins><span class="cx">
</span><span class="cx"> unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph;
</span><span class="cx"> m_characterInCurrentGlyph = std::min(m_currentCharacter - complexTextRun.stringLocation(), glyphEndOffset) - glyphStartOffset;
</span><del>- m_runWidthSoFar += adjustedBaseAdvance.width * runWidthSoFarFraction(glyphStartOffset, glyphEndOffset, oldCharacterInCurrentGlyph, iterationStyle);
</del><ins>+ // FIXME: Instead of dividing the glyph's advance equally between the characters, this
+ // could use the glyph's "ligature carets". However, there is no Core Text API to get the
+ // ligature carets.
+ if (glyphStartOffset == glyphEndOffset) {
+ // When there are multiple glyphs per character we need to advance by the full width of the glyph.
+ ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph);
+ m_runWidthSoFar += adjustedAdvance.width;
+ } else if (iterationStyle == ByWholeGlyphs) {
+ if (!oldCharacterInCurrentGlyph)
+ m_runWidthSoFar += adjustedAdvance.width;
+ } else
+ m_runWidthSoFar += adjustedAdvance.width * (m_characterInCurrentGlyph - oldCharacterInCurrentGlyph) / (glyphEndOffset - glyphStartOffset);
</ins><span class="cx">
</span><span class="cx"> if (glyphEndOffset + complexTextRun.stringLocation() > m_currentCharacter)
</span><span class="cx"> return;
</span><span class="lines">@@ -626,6 +617,8 @@
</span><span class="cx"> currentRunIndex = incrementCurrentRun(leftmostGlyph);
</span><span class="cx"> m_glyphInCurrentRun = 0;
</span><span class="cx"> }
</span><ins>+ if (!m_run.ltr() && m_numGlyphsSoFar == m_adjustedAdvances.size())
+ m_runWidthSoFar += m_finalRoundingWidth;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline std::pair<bool, bool> expansionLocation(bool ideograph, bool treatAsSpace, bool ltr, bool isAfterExpansion, bool forbidLeadingExpansion, bool forbidTrailingExpansion, bool forceLeadingExpansion, bool forceTrailingExpansion)
</span><span class="lines">@@ -663,7 +656,6 @@
</span><span class="cx"> bool runForcesTrailingExpansion = (m_run.expansionBehavior() & TrailingExpansionMask) == ForceTrailingExpansion;
</span><span class="cx"> bool runForbidsLeadingExpansion = (m_run.expansionBehavior() & LeadingExpansionMask) == ForbidLeadingExpansion;
</span><span class="cx"> bool runForbidsTrailingExpansion = (m_run.expansionBehavior() & TrailingExpansionMask) == ForbidTrailingExpansion;
</span><del>-
</del><span class="cx"> // We are iterating in glyph order, not string order. Compare this to WidthIterator::advanceInternal()
</span><span class="cx"> for (size_t r = 0; r < runCount; ++r) {
</span><span class="cx"> ComplexTextRun& complexTextRun = *m_complexTextRuns[r];
</span><span class="lines">@@ -672,11 +664,11 @@
</span><span class="cx">
</span><span class="cx"> // Represent the initial advance for a text run by adjusting the advance
</span><span class="cx"> // of the last glyph of the previous text run in the glyph buffer.
</span><del>- if (r && m_adjustedBaseAdvances.size()) {
- CGSize previousAdvance = m_adjustedBaseAdvances.last();
</del><ins>+ if (r && m_adjustedAdvances.size()) {
+ CGSize previousAdvance = m_adjustedAdvances.last();
</ins><span class="cx"> previousAdvance.width += complexTextRun.initialAdvance().width;
</span><span class="cx"> previousAdvance.height -= complexTextRun.initialAdvance().height;
</span><del>- m_adjustedBaseAdvances[m_adjustedBaseAdvances.size() - 1] = previousAdvance;
</del><ins>+ m_adjustedAdvances[m_adjustedAdvances.size() - 1] = previousAdvance;
</ins><span class="cx"> }
</span><span class="cx"> widthSinceLastCommit += complexTextRun.initialAdvance().width;
</span><span class="cx">
</span><span class="lines">@@ -684,7 +676,7 @@
</span><span class="cx"> m_isLTROnly = false;
</span><span class="cx">
</span><span class="cx"> const CGGlyph* glyphs = complexTextRun.glyphs();
</span><del>- const CGSize* advances = complexTextRun.baseAdvances();
</del><ins>+ const CGSize* advances = complexTextRun.advances();
</ins><span class="cx">
</span><span class="cx"> bool lastRun = r + 1 == runCount;
</span><span class="cx"> float spaceWidth = font.spaceWidth() - font.syntheticBoldOffset();
</span><span class="lines">@@ -758,10 +750,10 @@
</span><span class="cx"> // Increase previous width
</span><span class="cx"> m_expansion -= m_expansionPerOpportunity;
</span><span class="cx"> m_totalWidth += m_expansionPerOpportunity;
</span><del>- if (m_adjustedBaseAdvances.isEmpty())
</del><ins>+ if (m_adjustedAdvances.isEmpty())
</ins><span class="cx"> m_leadingExpansion = m_expansionPerOpportunity;
</span><span class="cx"> else
</span><del>- m_adjustedBaseAdvances.last().width += m_expansionPerOpportunity;
</del><ins>+ m_adjustedAdvances.last().width += m_expansionPerOpportunity;
</ins><span class="cx"> }
</span><span class="cx"> if (expandRight) {
</span><span class="cx"> m_expansion -= m_expansionPerOpportunity;
</span><span class="lines">@@ -785,10 +777,7 @@
</span><span class="cx"> glyph = 0;
</span><span class="cx">
</span><span class="cx"> advance.height *= -1;
</span><del>- m_adjustedBaseAdvances.append(advance);
-#if USE_LAYOUT_SPECIFIC_ADVANCES
- m_glyphOrigins.append(complexTextRun.glyphOrigins()[i]);
-#endif
</del><ins>+ m_adjustedAdvances.append(advance);
</ins><span class="cx"> m_adjustedGlyphs.append(glyph);
</span><span class="cx">
</span><span class="cx"> FloatRect glyphBounds = font.boundsForGlyph(glyph);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.h        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -32,8 +32,6 @@
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><del>-#define USE_LAYOUT_SPECIFIC_ADVANCES ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 90000))
-
</del><span class="cx"> typedef unsigned short CGGlyph;
</span><span class="cx">
</span><span class="cx"> typedef const struct __CTRun * CTRunRef;
</span><span class="lines">@@ -58,7 +56,7 @@
</span><span class="cx"> void advance(unsigned to, GlyphBuffer* = nullptr, GlyphIterationStyle = IncludePartialGlyphs, HashSet<const Font*>* fallbackFonts = nullptr);
</span><span class="cx">
</span><span class="cx"> // Compute the character offset for a given x coordinate.
</span><del>- unsigned offsetForPosition(float x, bool includePartialGlyphs);
</del><ins>+ int offsetForPosition(float x, bool includePartialGlyphs);
</ins><span class="cx">
</span><span class="cx"> // Returns the width of everything we've consumed so far.
</span><span class="cx"> float runWidthSoFar() const { return m_runWidthSoFar; }
</span><span class="lines">@@ -65,6 +63,8 @@
</span><span class="cx">
</span><span class="cx"> float totalWidth() const { return m_totalWidth; }
</span><span class="cx">
</span><ins>+ float finalRoundingWidth() const { return m_finalRoundingWidth; }
+
</ins><span class="cx"> float minGlyphBoundingBoxX() const { return m_minGlyphBoundingBoxX; }
</span><span class="cx"> float maxGlyphBoundingBoxX() const { return m_maxGlyphBoundingBoxX; }
</span><span class="cx"> float minGlyphBoundingBoxY() const { return m_minGlyphBoundingBoxY; }
</span><span class="lines">@@ -95,20 +95,8 @@
</span><span class="cx"> CFIndex indexEnd() const { return m_indexEnd; }
</span><span class="cx"> CFIndex endOffsetAt(size_t i) const { ASSERT(!m_isMonotonic); return m_glyphEndOffsets[i]; }
</span><span class="cx"> const CGGlyph* glyphs() const { return m_glyphs; }
</span><del>-
- /*
- * X (Paint glyph position) X (Paint glyph position) X (Paint glyph position)
- * 7 7 7
- * / / /
- * / (Glyph origin) / (Glyph origin) / (Glyph origin)
- * / / /
- * / / /
- * X-----------------------X--------------------------X--------------------------X---->...
- * (text position ^) (initial advance) (base advance) (base advance)
- */
</del><span class="cx"> CGSize initialAdvance() const { return m_initialAdvance; }
</span><del>- const CGSize* baseAdvances() const { return m_baseAdvances; }
- const CGPoint* glyphOrigins() const { return m_glyphOrigins.data(); }
</del><ins>+ const CGSize* advances() const { return m_advances; }
</ins><span class="cx"> bool isLTR() const { return m_isLTR; }
</span><span class="cx"> bool isMonotonic() const { return m_isMonotonic; }
</span><span class="cx"> void setIsNonMonotonic();
</span><span class="lines">@@ -117,22 +105,21 @@
</span><span class="cx"> ComplexTextRun(CTRunRef, const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange);
</span><span class="cx"> ComplexTextRun(const Font&, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr);
</span><span class="cx">
</span><del>- Vector<CGSize, 64> m_baseAdvancesVector;
- Vector<CGPoint, 64> m_glyphOrigins;
- Vector<CGGlyph, 64> m_glyphsVector;
- Vector<CFIndex, 64> m_glyphEndOffsets;
- Vector<CFIndex, 64> m_coreTextIndicesVector;
- CGSize m_initialAdvance;
</del><ins>+ unsigned m_glyphCount;
</ins><span class="cx"> const Font& m_font;
</span><span class="cx"> const UChar* m_characters;
</span><ins>+ unsigned m_stringLocation;
</ins><span class="cx"> size_t m_stringLength;
</span><ins>+ Vector<CFIndex, 64> m_coreTextIndicesVector;
</ins><span class="cx"> const CFIndex* m_coreTextIndices;
</span><del>- const CGGlyph* m_glyphs;
- const CGSize* m_baseAdvances;
</del><span class="cx"> CFIndex m_indexBegin;
</span><span class="cx"> CFIndex m_indexEnd;
</span><del>- unsigned m_glyphCount;
- unsigned m_stringLocation;
</del><ins>+ Vector<CFIndex, 64> m_glyphEndOffsets;
+ Vector<CGGlyph, 64> m_glyphsVector;
+ const CGGlyph* m_glyphs;
+ CGSize m_initialAdvance;
+ Vector<CGSize, 64> m_advancesVector;
+ const CGSize* m_advances;
</ins><span class="cx"> bool m_isLTR;
</span><span class="cx"> bool m_isMonotonic;
</span><span class="cx"> };
</span><span class="lines">@@ -148,12 +135,18 @@
</span><span class="cx"> unsigned indexOfCurrentRun(unsigned& leftmostGlyph);
</span><span class="cx"> unsigned incrementCurrentRun(unsigned& leftmostGlyph);
</span><span class="cx">
</span><del>- float runWidthSoFarFraction(unsigned glyphStartOffset, unsigned glyphEndOffset, unsigned oldCharacterInCurrentGlyph, GlyphIterationStyle) const;
</del><ins>+ // The initial capacity of these vectors was selected as being the smallest power of two greater than
+ // the average (3.5) plus one standard deviation (7.5) of nonzero sizes used on Arabic Wikipedia.
+ Vector<unsigned, 16> m_runIndices;
+ Vector<unsigned, 16> m_glyphCountFromStartToIndex;
</ins><span class="cx">
</span><del>- Vector<CGSize, 256> m_adjustedBaseAdvances;
- Vector<CGPoint, 256> m_glyphOrigins;
- Vector<CGGlyph, 256> m_adjustedGlyphs;
</del><ins>+ const FontCascade& m_font;
+ const TextRun& m_run;
+ bool m_isLTROnly;
+ bool m_mayUseNaturalWritingDirection;
+ bool m_forTextEmphasis;
</ins><span class="cx">
</span><ins>+ Vector<String> m_stringsFor8BitRuns;
</ins><span class="cx"> Vector<UChar, 256> m_smallCapsBuffer;
</span><span class="cx">
</span><span class="cx"> // There is a 3-level hierarchy here. At the top, we are interested in m_run.string(). We partition that string
</span><span class="lines">@@ -163,41 +156,34 @@
</span><span class="cx"> // relative to m_run.string(). ComplexTextRun::indexAt() returns to the offset of a codepoint relative to
</span><span class="cx"> // its Line. ComplexTextRun::glyphs() and ComplexTextRun::advances() refer to glyphs relative to the ComplexTextRun.
</span><span class="cx"> // The length of the entire TextRun is m_run.length()
</span><ins>+ Vector<RetainPtr<CTLineRef>> m_coreTextLines;
</ins><span class="cx"> Vector<RefPtr<ComplexTextRun>, 16> m_complexTextRuns;
</span><ins>+ Vector<CGSize, 256> m_adjustedAdvances;
+ Vector<CGGlyph, 256> m_adjustedGlyphs;
+
+ unsigned m_currentCharacter;
+ int m_end;
</ins><span class="cx">
</span><del>- // The initial capacity of these vectors was selected as being the smallest power of two greater than
- // the average (3.5) plus one standard deviation (7.5) of nonzero sizes used on Arabic Wikipedia.
- Vector<unsigned, 16> m_runIndices;
- Vector<unsigned, 16> m_glyphCountFromStartToIndex;
</del><ins>+ CGFloat m_totalWidth;
</ins><span class="cx">
</span><del>- Vector<RetainPtr<CTLineRef>> m_coreTextLines;
</del><ins>+ float m_runWidthSoFar;
+ unsigned m_numGlyphsSoFar;
+ size_t m_currentRun;
+ unsigned m_glyphInCurrentRun;
+ unsigned m_characterInCurrentGlyph;
+ float m_finalRoundingWidth;
+ float m_expansion;
+ float m_expansionPerOpportunity;
+ float m_leadingExpansion;
</ins><span class="cx">
</span><del>- HashSet<const Font*>* m_fallbackFonts { nullptr };
</del><ins>+ HashSet<const Font*>* m_fallbackFonts;
</ins><span class="cx">
</span><del>- const FontCascade& m_font;
- const TextRun& m_run;
-
- unsigned m_currentCharacter { 0 };
- unsigned m_end { 0 };
</del><ins>+ float m_minGlyphBoundingBoxX;
+ float m_maxGlyphBoundingBoxX;
+ float m_minGlyphBoundingBoxY;
+ float m_maxGlyphBoundingBoxY;
</ins><span class="cx">
</span><del>- float m_totalWidth { 0 };
- float m_runWidthSoFar { 0 };
- unsigned m_numGlyphsSoFar { 0 };
- unsigned m_currentRun { 0 };
- unsigned m_glyphInCurrentRun { 0 };
- unsigned m_characterInCurrentGlyph { 0 };
- float m_expansion { 0 };
- float m_expansionPerOpportunity { 0 };
- float m_leadingExpansion { 0 };
-
- float m_minGlyphBoundingBoxX { std::numeric_limits<float>::max() };
- float m_maxGlyphBoundingBoxX { std::numeric_limits<float>::min() };
- float m_minGlyphBoundingBoxY { std::numeric_limits<float>::max() };
- float m_maxGlyphBoundingBoxY { std::numeric_limits<float>::min() };
-
- bool m_isLTROnly { true };
- bool m_mayUseNaturalWritingDirection { false };
- bool m_forTextEmphasis { false };
</del><ins>+ unsigned m_lastRoundingGlyph;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "CoreTextSPI.h"
</span><span class="cx"> #include "FontCache.h"
</span><span class="cx"> #include "FontCascade.h"
</span><del>-#include "SoftLinking.h"
</del><span class="cx"> #include "TextRun.h"
</span><span class="cx"> #include "WebCoreSystemInterface.h"
</span><span class="cx"> #include <wtf/WeakPtr.h>
</span><span class="lines">@@ -40,12 +39,6 @@
</span><span class="cx"> #include <ApplicationServices/ApplicationServices.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101100) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 90000)
-SOFT_LINK_FRAMEWORK(CoreText);
-SOFT_LINK(CoreText, CTRunGetBaseAdvancesAndOrigins, void, (CTRunRef run, CFRange range, CGSize baseAdvances[], CGPoint origins[]), (run, range, baseAdvances, origins))
-#endif
-
-
</del><span class="cx"> // Note: CTFontDescriptorRefs can live forever in caches inside CoreText, so this object can too.
</span><span class="cx"> @interface WebCascadeList : NSArray {
</span><span class="cx"> @private
</span><span class="lines">@@ -107,13 +100,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> ComplexTextController::ComplexTextRun::ComplexTextRun(CTRunRef ctRun, const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, CFRange runRange)
</span><del>- : m_initialAdvance(CTRunGetInitialAdvance(ctRun))
- , m_font(font)
</del><ins>+ : m_font(font)
</ins><span class="cx"> , m_characters(characters)
</span><ins>+ , m_stringLocation(stringLocation)
</ins><span class="cx"> , m_stringLength(stringLength)
</span><span class="cx"> , m_indexBegin(runRange.location)
</span><span class="cx"> , m_indexEnd(runRange.location + runRange.length)
</span><del>- , m_stringLocation(stringLocation)
</del><ins>+ , m_initialAdvance(CTRunGetInitialAdvance(ctRun))
</ins><span class="cx"> , m_isLTR(!(CTRunGetStatus(ctRun) & kCTRunStatusRightToLeft))
</span><span class="cx"> , m_isMonotonic(true)
</span><span class="cx"> {
</span><span class="lines">@@ -132,31 +125,24 @@
</span><span class="cx"> m_glyphs = m_glyphsVector.data();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if USE_LAYOUT_SPECIFIC_ADVANCES
- m_baseAdvancesVector.grow(m_glyphCount);
- m_glyphOrigins.grow(m_glyphCount);
- CTRunGetBaseAdvancesAndOrigins(ctRun, CFRangeMake(0, 0), m_baseAdvancesVector.data(), m_glyphOrigins.data());
- m_baseAdvances = m_baseAdvancesVector.data();
-#else
- m_baseAdvances = CTRunGetAdvancesPtr(ctRun);
- if (!m_baseAdvances) {
- m_baseAdvancesVector.grow(m_glyphCount);
- CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_baseAdvancesVector.data());
- m_baseAdvances = m_baseAdvancesVector.data();
</del><ins>+ m_advances = CTRunGetAdvancesPtr(ctRun);
+ if (!m_advances) {
+ m_advancesVector.grow(m_glyphCount);
+ CTRunGetAdvances(ctRun, CFRangeMake(0, 0), m_advancesVector.data());
+ m_advances = m_advancesVector.data();
</ins><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Missing glyphs run constructor. Core Text will not generate a run of missing glyphs, instead falling back on
</span><span class="cx"> // glyphs from LastResort. We want to use the primary font's missing glyph in order to match the fast text code path.
</span><span class="cx"> ComplexTextController::ComplexTextRun::ComplexTextRun(const Font& font, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr)
</span><del>- : m_initialAdvance(CGSizeZero)
- , m_font(font)
</del><ins>+ : m_font(font)
</ins><span class="cx"> , m_characters(characters)
</span><ins>+ , m_stringLocation(stringLocation)
</ins><span class="cx"> , m_stringLength(stringLength)
</span><span class="cx"> , m_indexBegin(0)
</span><span class="cx"> , m_indexEnd(stringLength)
</span><del>- , m_stringLocation(stringLocation)
</del><ins>+ , m_initialAdvance(CGSizeZero)
</ins><span class="cx"> , m_isLTR(ltr)
</span><span class="cx"> , m_isMonotonic(true)
</span><span class="cx"> {
</span><span class="lines">@@ -164,8 +150,10 @@
</span><span class="cx"> unsigned r = 0;
</span><span class="cx"> while (r < m_stringLength) {
</span><span class="cx"> m_coreTextIndicesVector.uncheckedAppend(r);
</span><del>- UChar32 character;
- U16_NEXT(m_characters, r, m_stringLength, character);
</del><ins>+ if (U_IS_LEAD(m_characters[r]) && r + 1 < m_stringLength && U_IS_TRAIL(m_characters[r + 1]))
+ r += 2;
+ else
+ r++;
</ins><span class="cx"> }
</span><span class="cx"> m_glyphCount = m_coreTextIndicesVector.size();
</span><span class="cx"> if (!ltr) {
</span><span class="lines">@@ -177,8 +165,8 @@
</span><span class="cx"> // Synthesize a run of missing glyphs.
</span><span class="cx"> m_glyphsVector.fill(0, m_glyphCount);
</span><span class="cx"> m_glyphs = m_glyphsVector.data();
</span><del>- m_baseAdvancesVector.fill(CGSizeMake(m_font.widthForGlyph(0), 0), m_glyphCount);
- m_baseAdvances = m_baseAdvancesVector.data();
</del><ins>+ m_advancesVector.fill(CGSizeMake(m_font.widthForGlyph(0), 0), m_glyphCount);
+ m_advances = m_advancesVector.data();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> struct ProviderInfo {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaCoreTextSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h (205381 => 205382)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h        2016-09-02 23:14:34 UTC (rev 205381)
+++ trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h        2016-09-02 23:18:48 UTC (rev 205382)
</span><span class="lines">@@ -68,7 +68,6 @@
</span><span class="cx">
</span><span class="cx"> CGSize CTRunGetInitialAdvance(CTRunRef run);
</span><span class="cx"> CTLineRef CTLineCreateWithUniCharProvider(CTUniCharProviderCallback provide, CTUniCharDisposeCallback dispose, void* refCon);
</span><del>-void CTRunGetBaseAdvancesAndOrigins(CTRunRef, CFRange, CGSize baseAdvances[], CGPoint origins[]);
</del><span class="cx"> CTTypesetterRef CTTypesetterCreateWithUniCharProviderAndOptions(CTUniCharProviderCallback provide, CTUniCharDisposeCallback dispose, void* refCon, CFDictionaryRef options);
</span><span class="cx"> bool CTFontGetVerticalGlyphsForCharacters(CTFontRef, const UniChar characters[], CGGlyph glyphs[], CFIndex count);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>