Added: trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt (0 => 149450)
--- trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/block/lineboxcontain/block-with-ideographs-expected.txt 2013-05-01 20:37:04 UTC (rev 149450)
@@ -0,0 +1,68 @@
+layer at (0,0) size 785x625
+ RenderView at (0,0) size 785x600
+layer at (0,0) size 785x625
+ RenderBlock {html} at (0,0) size 785x625
+ RenderBody {body} at (8,8) size 769x609
+ RenderBlock {div} at (0,0) size 769x203
+ RenderBlock {div} at (0,0) size 57x146 [border: (1px solid #FF0000)]
+ RenderText {#text} at (1,1) size 55x48
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 55x48
+ RenderRubyRun (anonymous) at (1,49) size 55x48
+ RenderRubyBase (anonymous) at (0,0) size 55x48
+ RenderText {#text} at (0,0) size 55x48
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (1,97) size 55x48
+ text run at (1,97) width 48: "\x{7530}"
+ RenderBlock {div} at (0,146) size 769x57 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 48x55
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 48x55
+ RenderRubyRun (anonymous) at (49,1) size 48x55
+ RenderRubyBase (anonymous) at (0,0) size 48x55
+ RenderText {#text} at (0,0) size 48x55
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (97,1) size 48x55
+ text run at (97,1) width 48: "\x{7530}"
+ RenderBlock {div} at (0,203) size 769x203
+ RenderBlock {div} at (0,0) size 57x146 [border: (1px solid #FF0000)]
+ RenderText {#text} at (1,1) size 55x48
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 55x48
+ RenderRubyRun (anonymous) at (1,49) size 55x48
+ RenderRubyBase (anonymous) at (0,0) size 55x48
+ RenderText {#text} at (0,0) size 55x48
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (1,97) size 55x48
+ text run at (1,97) width 48: "\x{7530}"
+ RenderBlock {div} at (0,146) size 769x57 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 48x55
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 48x55
+ RenderRubyRun (anonymous) at (49,1) size 48x55
+ RenderRubyBase (anonymous) at (0,0) size 48x55
+ RenderText {#text} at (0,0) size 48x55
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (97,1) size 48x55
+ text run at (97,1) width 48: "\x{7530}"
+ RenderBlock {div} at (0,406) size 769x203
+ RenderBlock {div} at (0,0) size 57x146 [border: (1px solid #FF0000)]
+ RenderText {#text} at (1,1) size 55x48
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 55x48
+ RenderRubyRun (anonymous) at (1,49) size 55x48
+ RenderRubyBase (anonymous) at (0,0) size 55x48
+ RenderText {#text} at (0,0) size 55x48
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (1,97) size 55x48
+ text run at (1,97) width 48: "\x{7530}"
+ RenderBlock {div} at (0,146) size 769x57 [border: (1px solid #008000)]
+ RenderText {#text} at (1,1) size 48x55
+ text run at (1,1) width 48: "\x{70BA}"
+ RenderRuby (inline) {ruby} at (0,0) size 48x55
+ RenderRubyRun (anonymous) at (49,1) size 48x55
+ RenderRubyBase (anonymous) at (0,0) size 48x55
+ RenderText {#text} at (0,0) size 48x55
+ text run at (0,0) width 48: "\x{6AFB}"
+ RenderText {#text} at (97,1) size 48x55
+ text run at (97,1) width 48: "\x{7530}"
Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (149449 => 149450)
--- trunk/Source/WebCore/rendering/RootInlineBox.cpp 2013-05-01 20:28:27 UTC (rev 149449)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp 2013-05-01 20:37:04 UTC (rev 149450)
@@ -843,8 +843,8 @@
}
if (includeFontForBox(box) && !setUsedFont) {
- int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent();
- int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent();
+ int fontAscent = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType());
+ int fontDescent = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType());
setAscentAndDescent(ascent, descent, fontAscent, fontDescent, ascentDescentSet);
affectsAscent = fontAscent - box->logicalTop() > 0;
affectsDescent = fontDescent + box->logicalTop() > 0;
@@ -854,13 +854,13 @@
setAscentAndDescent(ascent, descent, glyphOverflow->top, glyphOverflow->bottom, ascentDescentSet);
affectsAscent = glyphOverflow->top - box->logicalTop() > 0;
affectsDescent = glyphOverflow->bottom + box->logicalTop() > 0;
- glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent()));
- glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent()));
+ glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType())));
+ glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType())));
}
if (includeMarginForBox(box)) {
- LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent();
- LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent();
+ LayoutUnit ascentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().ascent(baselineType());
+ LayoutUnit descentWithMargin = box->renderer()->style(isFirstLineStyle())->fontMetrics().descent(baselineType());
if (box->parent() && !box->renderer()->isText()) {
ascentWithMargin += box->boxModelObject()->borderBefore() + box->boxModelObject()->paddingBefore() + box->boxModelObject()->marginBefore();
descentWithMargin += box->boxModelObject()->borderAfter() + box->boxModelObject()->paddingAfter() + box->boxModelObject()->marginAfter();