| Index: third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp
|
| index 811f819a068feb7ec6e953c6089c4a9c91c45146..39637a84899dc5b680076b694c40bbf620e79630 100644
|
| --- a/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/line/RootInlineBox.cpp
|
| @@ -682,16 +682,17 @@ LayoutUnit RootInlineBox::verticalPositionForBox(
|
|
|
| LayoutUnit verticalPosition;
|
| EVerticalAlign verticalAlign = boxModel.style()->verticalAlign();
|
| - if (verticalAlign == VerticalAlignTop || verticalAlign == VerticalAlignBottom)
|
| + if (verticalAlign == EVerticalAlign::Top ||
|
| + verticalAlign == EVerticalAlign::Bottom)
|
| return LayoutUnit();
|
|
|
| LineLayoutItem parent = boxModel.parent();
|
| if (parent.isLayoutInline() &&
|
| - parent.style()->verticalAlign() != VerticalAlignTop &&
|
| - parent.style()->verticalAlign() != VerticalAlignBottom)
|
| + parent.style()->verticalAlign() != EVerticalAlign::Top &&
|
| + parent.style()->verticalAlign() != EVerticalAlign::Bottom)
|
| verticalPosition = box->parent()->logicalTop();
|
|
|
| - if (verticalAlign != VerticalAlignBaseline) {
|
| + if (verticalAlign != EVerticalAlign::Baseline) {
|
| const Font& font = parent.style(firstLine)->font();
|
| const SimpleFontData* fontData = font.primaryFont();
|
| DCHECK(fontData);
|
| @@ -704,21 +705,21 @@ LayoutUnit RootInlineBox::verticalPositionForBox(
|
| LineDirectionMode lineDirection =
|
| parent.isHorizontalWritingMode() ? HorizontalLine : VerticalLine;
|
|
|
| - if (verticalAlign == VerticalAlignSub) {
|
| + if (verticalAlign == EVerticalAlign::Sub) {
|
| verticalPosition += fontSize / 5 + 1;
|
| - } else if (verticalAlign == VerticalAlignSuper) {
|
| + } else if (verticalAlign == EVerticalAlign::Super) {
|
| verticalPosition -= fontSize / 3 + 1;
|
| - } else if (verticalAlign == VerticalAlignTextTop) {
|
| + } else if (verticalAlign == EVerticalAlign::TextTop) {
|
| verticalPosition +=
|
| boxModel.baselinePosition(baselineType(), firstLine, lineDirection) -
|
| fontMetrics.ascent(baselineType());
|
| - } else if (verticalAlign == VerticalAlignMiddle) {
|
| + } else if (verticalAlign == EVerticalAlign::Middle) {
|
| verticalPosition = LayoutUnit(
|
| (verticalPosition - LayoutUnit(fontMetrics.xHeight() / 2) -
|
| boxModel.lineHeight(firstLine, lineDirection) / 2 +
|
| boxModel.baselinePosition(baselineType(), firstLine, lineDirection))
|
| .round());
|
| - } else if (verticalAlign == VerticalAlignTextBottom) {
|
| + } else if (verticalAlign == EVerticalAlign::TextBottom) {
|
| verticalPosition += fontMetrics.descent(baselineType());
|
| // lineHeight - baselinePosition is always 0 for replaced elements (except
|
| // inline blocks), so don't bother wasting time in that case.
|
| @@ -727,11 +728,11 @@ LayoutUnit RootInlineBox::verticalPositionForBox(
|
| verticalPosition -= (boxModel.lineHeight(firstLine, lineDirection) -
|
| boxModel.baselinePosition(
|
| baselineType(), firstLine, lineDirection));
|
| - } else if (verticalAlign == VerticalAlignBaselineMiddle) {
|
| + } else if (verticalAlign == EVerticalAlign::BaselineMiddle) {
|
| verticalPosition +=
|
| -boxModel.lineHeight(firstLine, lineDirection) / 2 +
|
| boxModel.baselinePosition(baselineType(), firstLine, lineDirection);
|
| - } else if (verticalAlign == VerticalAlignLength) {
|
| + } else if (verticalAlign == EVerticalAlign::Length) {
|
| LayoutUnit lineHeight;
|
| // Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align:
|
| // 'Percentages: refer to the 'line-height' of the element itself'.
|
|
|