Summary: | Fonts with no vertical metrics should synthesize baselines | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dave Hyatt <hyatt> | ||||||
Component: | Layout and Rendering | Assignee: | Dave Hyatt <hyatt> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, buildbot, eric, mrobinson, rniwa, webkit-ews, webkit.review.bot | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | OS X 10.5 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 46123 | ||||||||
Attachments: |
|
Description
Dave Hyatt
2010-10-28 11:45:59 PDT
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. 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']) |