| Index: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
|
| index a07ad8e8f1540276b2ac7b3aff04b07faa0ed7af..862c9f7d36ae9c5bd68c018b4707075159dedcac 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
|
| @@ -509,8 +509,9 @@ void LayoutReplaced::computePositionedLogicalHeight(
|
| logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight);
|
|
|
| // Solve for 'top'
|
| - logicalTopValue = availableSpace - (logicalBottomValue + marginBeforeAlias +
|
| - marginAfterAlias);
|
| + logicalTopValue =
|
| + availableSpace -
|
| + (logicalBottomValue + marginBeforeAlias + marginAfterAlias);
|
| } else if (logicalBottom.isAuto()) {
|
| marginBeforeAlias =
|
| valueForLength(marginBefore, containerRelativeLogicalWidth);
|
| @@ -528,8 +529,9 @@ void LayoutReplaced::computePositionedLogicalHeight(
|
| logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight);
|
|
|
| // Solve for 'margin-top'
|
| - marginBeforeAlias = availableSpace - (logicalTopValue + logicalBottomValue +
|
| - marginAfterAlias);
|
| + marginBeforeAlias =
|
| + availableSpace -
|
| + (logicalTopValue + logicalBottomValue + marginAfterAlias);
|
| } else if (marginAfter.isAuto()) {
|
| marginBeforeAlias =
|
| valueForLength(marginBefore, containerRelativeLogicalWidth);
|
| @@ -537,8 +539,9 @@ void LayoutReplaced::computePositionedLogicalHeight(
|
| logicalBottomValue = valueForLength(logicalBottom, containerLogicalHeight);
|
|
|
| // Solve for 'margin-bottom'
|
| - marginAfterAlias = availableSpace - (logicalTopValue + logicalBottomValue +
|
| - marginBeforeAlias);
|
| + marginAfterAlias =
|
| + availableSpace -
|
| + (logicalTopValue + logicalBottomValue + marginBeforeAlias);
|
| } else {
|
| // Nothing is 'auto', just calculate the values.
|
| marginBeforeAlias =
|
| @@ -592,8 +595,9 @@ LayoutRect LayoutReplaced::computeObjectFit(
|
| case ObjectFitScaleDown:
|
| case ObjectFitCover:
|
| finalRect.setSize(finalRect.size().fitToAspectRatio(
|
| - intrinsicSize, objectFit == ObjectFitCover ? AspectRatioFitGrow
|
| - : AspectRatioFitShrink));
|
| + intrinsicSize,
|
| + objectFit == ObjectFitCover ? AspectRatioFitGrow
|
| + : AspectRatioFitShrink));
|
| if (objectFit != ObjectFitScaleDown ||
|
| finalRect.width() <= intrinsicSize.width())
|
| break;
|
| @@ -837,21 +841,25 @@ void LayoutReplaced::computePreferredLogicalWidths() {
|
|
|
| if (styleToUse.logicalMinWidth().isFixed() &&
|
| styleToUse.logicalMinWidth().value() > 0) {
|
| - m_maxPreferredLogicalWidth = std::max(
|
| - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
|
| - styleToUse.logicalMinWidth().value()));
|
| - m_minPreferredLogicalWidth = std::max(
|
| - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
|
| - styleToUse.logicalMinWidth().value()));
|
| + m_maxPreferredLogicalWidth =
|
| + std::max(m_maxPreferredLogicalWidth,
|
| + adjustContentBoxLogicalWidthForBoxSizing(
|
| + styleToUse.logicalMinWidth().value()));
|
| + m_minPreferredLogicalWidth =
|
| + std::max(m_minPreferredLogicalWidth,
|
| + adjustContentBoxLogicalWidthForBoxSizing(
|
| + styleToUse.logicalMinWidth().value()));
|
| }
|
|
|
| if (styleToUse.logicalMaxWidth().isFixed()) {
|
| - m_maxPreferredLogicalWidth = std::min(
|
| - m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
|
| - styleToUse.logicalMaxWidth().value()));
|
| - m_minPreferredLogicalWidth = std::min(
|
| - m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing(
|
| - styleToUse.logicalMaxWidth().value()));
|
| + m_maxPreferredLogicalWidth =
|
| + std::min(m_maxPreferredLogicalWidth,
|
| + adjustContentBoxLogicalWidthForBoxSizing(
|
| + styleToUse.logicalMaxWidth().value()));
|
| + m_minPreferredLogicalWidth =
|
| + std::min(m_minPreferredLogicalWidth,
|
| + adjustContentBoxLogicalWidthForBoxSizing(
|
| + styleToUse.logicalMaxWidth().value()));
|
| }
|
|
|
| LayoutUnit borderAndPadding = borderAndPaddingLogicalWidth();
|
|
|