Fonts with no vertical metrics should synthesize baselines when they appear on lines that do use fonts with vertical metrics. Basically we want to make sure that English text behaves like vertical-align:middle, i.e., its baseline should be treated as though it cuts through the middle of the ascent+descent.
<rdar://problem/8612034>
Created attachment 74096 [details] Patch
Attachment 74096 [details] did not build on mac: Build output: http://queues.webkit.org/results/6238014
Attachment 74096 [details] did not build on qt: Build output: http://queues.webkit.org/results/6177018
Attachment 74096 [details] did not build on win: Build output: http://queues.webkit.org/results/6165018
Created attachment 74124 [details] Patch
Comment on attachment 74124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=74124&action=review > WebCore/rendering/InlineFlowBox.cpp:484 > + if (verticalAlign == SUB) > + verticalPosition += fontSize / 5 + 1; > + else if (verticalAlign == SUPER) > + verticalPosition -= fontSize / 3 + 1; > + else if (verticalAlign == TEXT_TOP) > + verticalPosition += renderer->baselinePosition(baselineType, firstLine, lineDirection) - font.ascent(baselineType); > + else if (verticalAlign == MIDDLE) > + verticalPosition += -static_cast<int>(font.xHeight() / 2) - renderer->lineHeight(firstLine, lineDirection) / 2 + renderer->baselinePosition(baselineType, firstLine, lineDirection); > + else if (verticalAlign == TEXT_BOTTOM) { > + verticalPosition += font.descent(baselineType); > + // lineHeight - baselinePosition is always 0 for replaced elements (except inline blocks), so don't bother wasting time in that case. > + if (!renderer->isReplaced() || renderer->isInlineBlockOrInlineTable()) > + verticalPosition -= (renderer->lineHeight(firstLine, lineDirection) - renderer->baselinePosition(baselineType, firstLine, lineDirection)); > + } else if (verticalAlign == BASELINE_MIDDLE) > + verticalPosition += -renderer->lineHeight(firstLine, lineDirection) / 2 + renderer->baselinePosition(baselineType, firstLine, lineDirection); > + else if (verticalAlign == LENGTH) > + verticalPosition -= renderer->style()->verticalAlignLength().calcValue(renderer->lineHeight(firstLine, lineDirection)); > + } If you wanted, you could change this to a switch statement.
Fixed in r72235.
http://trac.webkit.org/changeset/72235 might have broken SnowLeopard Intel Release (Tests) The following tests are not passing: fast/blockflow/vertical-font-fallback.html fast/repaint/repaint-across-writing-mode-boundary.html
It seems like this change requires rebaselines for the following tests on GTK: fast/css/line-height-determined-by-primary-font.html fast/css/negative-leading.html +mrobinson for GTK rebaseline.
This broke snow leopard tests, and thus the commit-queue: SUCCESS: Build 20999 (r72235) was the first to show failures: set([u'fast/blockflow/vertical-font-fallback.html', u'fast/repaint/repaint-across-writing-mode-boundary.html'])