<!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>[178810] branches/safari-600.1.4.15-branch</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/178810">178810</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-01-21 00:06:54 -0800 (Wed, 21 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/175236">r175236</a>. rdar://problem/19432709</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001415branchLayoutTestsChangeLog">branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebCoreChangeLog">branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebCorerenderingRenderCombineTextcpp">branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.cpp</a></li>
<li><a href="#branchessafari6001415branchSourceWebCorerenderingRenderCombineTexth">branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6001415branchLayoutTestsfasttexttatechuyokohtml">branches/safari-600.1.4.15-branch/LayoutTests/fast/text/tatechuyoko.html</a></li>
<li><a href="#branchessafari6001415branchLayoutTestsplatformmacfasttexttatechuyokoexpectedpng">branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.png</a></li>
<li><a href="#branchessafari6001415branchLayoutTestsplatformmacfasttexttatechuyokoexpectedtxt">branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001415branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (178809 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog        2015-01-21 07:37:52 UTC (rev 178809)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-01-21 Babak Shafiei <bshafiei@apple.com>
+
+ Merge r175236.
+
+ 2014-10-24 David Hyatt <hyatt@apple.com>
+
+ text-combine needs to center text within the vertical space using glyph bounds
+ https://bugs.webkit.org/show_bug.cgi?id=138056
+ <rdar://problem/15403667>
+
+ Reviewed by Dean Jackson.
+
+ * fast/text/tatechuyoko.html: Added.
+ * platform/mac/fast/text/tatechuyoko-expected.png: Added.
+ * platform/mac/fast/text/tatechuyoko-expected.txt: Added.
+
</ins><span class="cx"> 2015-01-20 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r175241.
</span></span></pre></div>
<a id="branchessafari6001415branchLayoutTestsfasttexttatechuyokohtmlfromrev175236trunkLayoutTestsfasttexttatechuyokohtml"></a>
<div class="copfile"><h4>Copied: branches/safari-600.1.4.15-branch/LayoutTests/fast/text/tatechuyoko.html (from rev 175236, trunk/LayoutTests/fast/text/tatechuyoko.html) (0 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/LayoutTests/fast/text/tatechuyoko.html         (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/fast/text/tatechuyoko.html        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+<?xml version="1.0" encoding="utf-8"?>
+<!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" xmlns:ibooks="http://apple.com/ibooks/html-extensions" xmlns:epub="http://www.idpf.org/2007/ops">
+<head>
+<title>Text-Combine</title>
+<style>
+.text-combine{
+-webkit-text-combine: horizontal;
+}
+.vertical{
+-webkit-writing-mode:vertical-rl;
+}
+</style>
+</head>
+<body>
+<p>「向見論治道書,其間欲仿井田之意<span class="text-combine">12</span>,而科條州郡財賦之類,此固為治之具。然施之當有次第。今日先務,恐當啟迪主心</p>
+<p class="vertical">「向見論治道書,其間欲仿井田之意<span class="text-combine">12</span>,而科條州郡財賦之類,此固為治之具。然施之當有次第。今日先務,恐當啟迪主心</p>
+
+</body>
+</html>
+
</ins></span></pre></div>
<a id="branchessafari6001415branchLayoutTestsplatformmacfasttexttatechuyokoexpectedpngfromrev175236trunkLayoutTestsplatformmacfasttexttatechuyokoexpectedpng"></a>
<div class="binary"><h4>Copied: branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.png (from rev 175236, trunk/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.png)</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="branchessafari6001415branchLayoutTestsplatformmacfasttexttatechuyokoexpectedtxtfromrev175236trunkLayoutTestsplatformmacfasttexttatechuyokoexpectedtxt"></a>
<div class="copfile"><h4>Copied: branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.txt (from rev 175236, trunk/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.txt) (0 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.txt         (rev 0)
+++ branches/safari-600.1.4.15-branch/LayoutTests/platform/mac/fast/text/tatechuyoko-expected.txt        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+layer at (0,0) size 785x668
+ RenderView at (0,0) size 785x600
+layer at (0,0) size 785x668
+ RenderBlock {HTML} at (0,0) size 785x668
+ RenderBody {BODY} at (8,16) size 769x644
+ RenderBlock {P} at (0,0) size 769x44
+ RenderText {#text} at (0,3) size 256x18
+ text run at (0,3) width 256: "\x{300C}\x{5411}\x{898B}\x{8AD6}\x{6CBB}\x{9053}\x{66F8}\x{FF0C}\x{5176}\x{9593}\x{6B32}\x{4EFF}\x{4E95}\x{7530}\x{4E4B}\x{610F}"
+ RenderInline {SPAN} at (0,0) size 16x18
+ RenderCombineText {#text} at (256,3) size 16x18
+ text run at (256,3) width 16: "12"
+ RenderText {#text} at (272,3) size 768x40
+ text run at (272,3) width 496: "\x{FF0C}\x{800C}\x{79D1}\x{689D}\x{5DDE}\x{90E1}\x{8CA1}\x{8CE6}\x{4E4B}\x{985E}\x{FF0C}\x{6B64}\x{56FA}\x{70BA}\x{6CBB}\x{4E4B}\x{5177}\x{3002}\x{7136}\x{65BD}\x{4E4B}\x{7576}\x{6709}\x{6B21}\x{7B2C}\x{3002}\x{4ECA}\x{65E5}\x{5148}\x{52D9}\x{FF0C}"
+ text run at (0,25) width 96: "\x{6050}\x{7576}\x{555F}\x{8FEA}\x{4E3B}\x{5FC3}"
+ RenderBlock {P} at (16,60) size 44x584
+ RenderText {#text} at (2,0) size 18x256
+ text run at (2,0) width 256: "\x{300C}\x{5411}\x{898B}\x{8AD6}\x{6CBB}\x{9053}\x{66F8}\x{FF0C}\x{5176}\x{9593}\x{6B32}\x{4EFF}\x{4E95}\x{7530}\x{4E4B}\x{610F}"
+ RenderInline {SPAN} at (0,0) size 18x16
+ RenderCombineText {#text} at (2,256) size 18x16
+ text run at (2,256) width 16: "\x{FFFC}"
+ RenderText {#text} at (2,272) size 40x560
+ text run at (2,272) width 288: "\x{FF0C}\x{800C}\x{79D1}\x{689D}\x{5DDE}\x{90E1}\x{8CA1}\x{8CE6}\x{4E4B}\x{985E}\x{FF0C}\x{6B64}\x{56FA}\x{70BA}\x{6CBB}\x{4E4B}\x{5177}\x{3002}"
+ text run at (24,0) width 304: "\x{7136}\x{65BD}\x{4E4B}\x{7576}\x{6709}\x{6B21}\x{7B2C}\x{3002}\x{4ECA}\x{65E5}\x{5148}\x{52D9}\x{FF0C}\x{6050}\x{7576}\x{555F}\x{8FEA}\x{4E3B}\x{5FC3}"
</ins></span></pre></div>
<a id="branchessafari6001415branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (178809 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-21 07:37:52 UTC (rev 178809)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2015-01-21 Babak Shafiei <bshafiei@apple.com>
+
+ Merge r175236.
+
+ 2014-10-24 David Hyatt <hyatt@apple.com>
+
+ text-combine needs to center text within the vertical space using glyph bounds
+ https://bugs.webkit.org/show_bug.cgi?id=138056
+ <rdar://problem/15403667>
+
+ Reviewed by Dean Jackson.
+
+ Added fast/text/tatechuyoko.html
+
+ * rendering/RenderCombineText.cpp:
+ (WebCore::RenderCombineText::RenderCombineText):
+ (WebCore::RenderCombineText::adjustTextOrigin):
+ (WebCore::RenderCombineText::combineText):
+ * rendering/RenderCombineText.h:
+
</ins><span class="cx"> 2015-01-20 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r175241.
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCorerenderingRenderCombineTextcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.cpp (178809 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.cpp        2015-01-21 07:37:52 UTC (rev 178809)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.cpp        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">
</span><span class="cx"> RenderCombineText::RenderCombineText(Text& textNode, PassRefPtr<StringImpl> string)
</span><span class="cx"> : RenderText(textNode, string)
</span><del>- , m_combinedTextWidth(0)
</del><span class="cx"> , m_isCombined(false)
</span><span class="cx"> , m_needsFontUpdate(false)
</span><span class="cx"> {
</span><span class="lines">@@ -69,7 +68,7 @@
</span><span class="cx"> void RenderCombineText::adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& boxRect) const
</span><span class="cx"> {
</span><span class="cx"> if (m_isCombined)
</span><del>- textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextWidth) / 2, style().font().pixelSize());
</del><ins>+ textOrigin.move(boxRect.height() / 2 - ceilf(m_combinedTextSize.width()) / 2, boxRect.width() + (boxRect.width() - m_combinedTextSize.height()) / 2);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderCombineText::getStringToRender(int start, String& string, int& length) const
</span><span class="lines">@@ -97,15 +96,18 @@
</span><span class="cx"> if (style().isHorizontalWritingMode())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- TextRun run = RenderBlock::constructTextRun(this, originalFont(), this, style());
</del><span class="cx"> FontDescription description = originalFont().fontDescription();
</span><span class="cx"> float emWidth = description.computedSize() * textCombineMargin;
</span><span class="cx"> bool shouldUpdateFont = false;
</span><span class="cx">
</span><span class="cx"> description.setOrientation(Horizontal); // We are going to draw combined text horizontally.
</span><del>- m_combinedTextWidth = originalFont().width(run);
- m_isCombined = m_combinedTextWidth <= emWidth;
-
</del><ins>+
+ GlyphOverflow glyphOverflow;
+ glyphOverflow.computeBounds = true;
+
+ float combinedTextWidth = width(0, textLength(), originalFont(), 0, nullptr, &glyphOverflow);
+ m_isCombined = combinedTextWidth <= emWidth;
+
</ins><span class="cx"> FontSelector* fontSelector = style().font().fontSelector();
</span><span class="cx">
</span><span class="cx"> if (m_isCombined)
</span><span class="lines">@@ -117,9 +119,10 @@
</span><span class="cx"> description.setWidthVariant(widthVariants[i]);
</span><span class="cx"> Font compressedFont = Font(description, style().font().letterSpacing(), style().font().wordSpacing());
</span><span class="cx"> compressedFont.update(fontSelector);
</span><del>- float runWidth = compressedFont.width(run);
</del><ins>+
+ float runWidth = RenderText::width(0, textLength(), compressedFont, 0, nullptr, &glyphOverflow);
</ins><span class="cx"> if (runWidth <= emWidth) {
</span><del>- m_combinedTextWidth = runWidth;
</del><ins>+ combinedTextWidth = runWidth;
</ins><span class="cx"> m_isCombined = true;
</span><span class="cx">
</span><span class="cx"> // Replace my font with the new one.
</span><span class="lines">@@ -138,6 +141,7 @@
</span><span class="cx"> if (m_isCombined) {
</span><span class="cx"> DEPRECATED_DEFINE_STATIC_LOCAL(String, objectReplacementCharacterString, (&objectReplacementCharacter, 1));
</span><span class="cx"> RenderText::setRenderedText(objectReplacementCharacterString.impl());
</span><ins>+ m_combinedTextSize = FloatSize(combinedTextWidth, glyphOverflow.bottom + glyphOverflow.top);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebCorerenderingRenderCombineTexth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.h (178809 => 178810)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.h        2015-01-21 07:37:52 UTC (rev 178809)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/rendering/RenderCombineText.h        2015-01-21 08:06:54 UTC (rev 178810)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> virtual void setRenderedText(const String&) override;
</span><span class="cx">
</span><span class="cx"> RefPtr<RenderStyle> m_combineFontStyle;
</span><del>- float m_combinedTextWidth;
</del><ins>+ FloatSize m_combinedTextSize;
</ins><span class="cx"> bool m_isCombined : 1;
</span><span class="cx"> bool m_needsFontUpdate : 1;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>