| Index: Source/core/rendering/RenderBox.cpp
|
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
|
| index 84b19d2eb371becd6decf590071582e834a54f76..48a088ed0e9aaeeb5f343fdfe3bca5739d62724f 100644
|
| --- a/Source/core/rendering/RenderBox.cpp
|
| +++ b/Source/core/rendering/RenderBox.cpp
|
| @@ -61,8 +61,6 @@
|
| #include <algorithm>
|
| #include <math.h>
|
|
|
| -using namespace std;
|
| -
|
| namespace WebCore {
|
|
|
| using namespace HTMLNames;
|
| @@ -370,8 +368,8 @@ LayoutUnit RenderBox::scrollWidth() const
|
| // For objects with visible overflow, this matches IE.
|
| // FIXME: Need to work right with writing modes.
|
| if (style()->isLeftToRightDirection())
|
| - return max(clientWidth(), layoutOverflowRect().maxX() - borderLeft());
|
| - return clientWidth() - min<LayoutUnit>(0, layoutOverflowRect().x() - borderLeft());
|
| + return std::max(clientWidth(), layoutOverflowRect().maxX() - borderLeft());
|
| + return clientWidth() - std::min<LayoutUnit>(0, layoutOverflowRect().x() - borderLeft());
|
| }
|
|
|
| LayoutUnit RenderBox::scrollHeight() const
|
| @@ -380,7 +378,7 @@ LayoutUnit RenderBox::scrollHeight() const
|
| return layer()->scrollableArea()->scrollHeight();
|
| // For objects with visible overflow, this matches IE.
|
| // FIXME: Need to work right with writing modes.
|
| - return max(clientHeight(), layoutOverflowRect().maxY() - borderTop());
|
| + return std::max(clientHeight(), layoutOverflowRect().maxY() - borderTop());
|
| }
|
|
|
| LayoutUnit RenderBox::scrollLeft() const
|
| @@ -489,8 +487,8 @@ void RenderBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
|
| int xOffset = roundToInt(exposeRect.x());
|
| int yOffset = roundToInt(exposeRect.y());
|
| // Adjust offsets if they're outside of the allowable range.
|
| - xOffset = max(0, min(frameView->contentsWidth(), xOffset));
|
| - yOffset = max(0, min(frameView->contentsHeight(), yOffset));
|
| + xOffset = std::max(0, std::min(frameView->contentsWidth(), xOffset));
|
| + yOffset = std::max(0, std::min(frameView->contentsHeight(), yOffset));
|
|
|
| frameView->setScrollPosition(IntPoint(xOffset, yOffset));
|
| if (frameView->safeToPropagateScrollToParent()) {
|
| @@ -545,8 +543,8 @@ LayoutUnit RenderBox::constrainLogicalWidthByMinMax(LayoutUnit logicalWidth, Lay
|
| {
|
| RenderStyle* styleToUse = style();
|
| if (!styleToUse->logicalMaxWidth().isUndefined())
|
| - logicalWidth = min(logicalWidth, computeLogicalWidthUsing(MaxSize, styleToUse->logicalMaxWidth(), availableWidth, cb));
|
| - return max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse->logicalMinWidth(), availableWidth, cb));
|
| + logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize, styleToUse->logicalMaxWidth(), availableWidth, cb));
|
| + return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse->logicalMinWidth(), availableWidth, cb));
|
| }
|
|
|
| LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, LayoutUnit intrinsicContentHeight) const
|
| @@ -555,9 +553,9 @@ LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, L
|
| if (!styleToUse->logicalMaxHeight().isUndefined()) {
|
| LayoutUnit maxH = computeLogicalHeightUsing(styleToUse->logicalMaxHeight(), intrinsicContentHeight);
|
| if (maxH != -1)
|
| - logicalHeight = min(logicalHeight, maxH);
|
| + logicalHeight = std::min(logicalHeight, maxH);
|
| }
|
| - return max(logicalHeight, computeLogicalHeightUsing(styleToUse->logicalMinHeight(), intrinsicContentHeight));
|
| + return std::max(logicalHeight, computeLogicalHeightUsing(styleToUse->logicalMinHeight(), intrinsicContentHeight));
|
| }
|
|
|
| LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, LayoutUnit intrinsicContentHeight) const
|
| @@ -566,9 +564,9 @@ LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logica
|
| if (!styleToUse->logicalMaxHeight().isUndefined()) {
|
| LayoutUnit maxH = computeContentLogicalHeight(styleToUse->logicalMaxHeight(), intrinsicContentHeight);
|
| if (maxH != -1)
|
| - logicalHeight = min(logicalHeight, maxH);
|
| + logicalHeight = std::min(logicalHeight, maxH);
|
| }
|
| - return max(logicalHeight, computeContentLogicalHeight(styleToUse->logicalMinHeight(), intrinsicContentHeight));
|
| + return std::max(logicalHeight, computeContentLogicalHeight(styleToUse->logicalMinHeight(), intrinsicContentHeight));
|
| }
|
|
|
| IntRect RenderBox::absoluteContentBox() const
|
| @@ -1042,7 +1040,7 @@ LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width)
|
| LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
|
| if (style()->boxSizing() == CONTENT_BOX)
|
| return width + bordersPlusPadding;
|
| - return max(width, bordersPlusPadding);
|
| + return std::max(width, bordersPlusPadding);
|
| }
|
|
|
| LayoutUnit RenderBox::adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const
|
| @@ -1050,21 +1048,21 @@ LayoutUnit RenderBox::adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height
|
| LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight();
|
| if (style()->boxSizing() == CONTENT_BOX)
|
| return height + bordersPlusPadding;
|
| - return max(height, bordersPlusPadding);
|
| + return std::max(height, bordersPlusPadding);
|
| }
|
|
|
| LayoutUnit RenderBox::adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const
|
| {
|
| if (style()->boxSizing() == BORDER_BOX)
|
| width -= borderAndPaddingLogicalWidth();
|
| - return max<LayoutUnit>(0, width);
|
| + return std::max<LayoutUnit>(0, width);
|
| }
|
|
|
| LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit height) const
|
| {
|
| if (style()->boxSizing() == BORDER_BOX)
|
| height -= borderAndPaddingLogicalHeight();
|
| - return max<LayoutUnit>(0, height);
|
| + return std::max<LayoutUnit>(0, height);
|
| }
|
|
|
| // Hit Testing
|
| @@ -1534,8 +1532,8 @@ bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer
|
| }
|
| rendererRect = LayoutRect(-layerRenderer->marginLeft(),
|
| -layerRenderer->marginTop(),
|
| - max(layerRenderer->width() + layerRenderer->marginWidth() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw),
|
| - max(layerRenderer->height() + layerRenderer->marginHeight() + layerRenderer->borderTop() + layerRenderer->borderBottom(), rh));
|
| + std::max(layerRenderer->width() + layerRenderer->marginWidth() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw),
|
| + std::max(layerRenderer->height() + layerRenderer->marginHeight() + layerRenderer->borderTop() + layerRenderer->borderBottom(), rh));
|
| } else {
|
| layerRenderer = this;
|
| rendererRect = borderBoxRect();
|
| @@ -1750,7 +1748,7 @@ static LayoutUnit portionOfMarginNotConsumedByFloat(LayoutUnit childMargin, Layo
|
| LayoutUnit RenderBox::shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlockFlow* cb) const
|
| {
|
| LayoutUnit logicalTopPosition = logicalTop();
|
| - LayoutUnit width = cb->availableLogicalWidthForLine(logicalTopPosition, false) - max<LayoutUnit>(0, childMarginStart) - max<LayoutUnit>(0, childMarginEnd);
|
| + LayoutUnit width = cb->availableLogicalWidthForLine(logicalTopPosition, false) - std::max<LayoutUnit>(0, childMarginStart) - std::max<LayoutUnit>(0, childMarginEnd);
|
|
|
| // We need to see if margins on either the start side or the end side can contain the floats in question. If they can,
|
| // then just using the line width is inaccurate. In the case where a float completely fits, we don't need to use the line
|
| @@ -1804,7 +1802,7 @@ LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
|
| if (!logicalHeightLength.isFixed()) {
|
| LayoutUnit fillFallbackExtent = containingBlockStyle->isHorizontalWritingMode() ? view()->frameView()->visibleHeight() : view()->frameView()->visibleWidth();
|
| LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
|
| - return min(fillAvailableExtent, fillFallbackExtent);
|
| + return std::min(fillAvailableExtent, fillFallbackExtent);
|
| }
|
|
|
| // Use the content box logical height as specified by the style.
|
| @@ -2159,7 +2157,7 @@ static float getMaxWidthListMarker(const RenderBox* renderer)
|
| // Make sure to compute the autosized width.
|
| if (itemMarker->needsLayout())
|
| itemMarker->layout();
|
| - maxWidth = max<float>(maxWidth, toRenderListMarker(itemMarker)->logicalWidth().toFloat());
|
| + maxWidth = std::max<float>(maxWidth, toRenderListMarker(itemMarker)->logicalWidth().toFloat());
|
| break;
|
| }
|
| }
|
| @@ -2203,7 +2201,7 @@ void RenderBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues)
|
| Length logicalWidthLength = treatAsReplaced ? Length(computeReplacedLogicalWidth(), Fixed) : styleToUse->logicalWidth();
|
|
|
| RenderBlock* cb = containingBlock();
|
| - LayoutUnit containerLogicalWidth = max<LayoutUnit>(0, containingBlockLogicalWidthForContent());
|
| + LayoutUnit containerLogicalWidth = std::max<LayoutUnit>(0, containingBlockLogicalWidthForContent());
|
| bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode();
|
|
|
| if (isInline() && !isInlineBlockOrInlineTable()) {
|
| @@ -2211,7 +2209,7 @@ void RenderBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues)
|
| computedValues.m_margins.m_start = minimumValueForLength(styleToUse->marginStart(), containerLogicalWidth);
|
| computedValues.m_margins.m_end = minimumValueForLength(styleToUse->marginEnd(), containerLogicalWidth);
|
| if (treatAsReplaced)
|
| - computedValues.m_extent = max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth());
|
| + computedValues.m_extent = std::max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth());
|
| return;
|
| }
|
|
|
| @@ -2286,7 +2284,7 @@ LayoutUnit RenderBox::computeIntrinsicLogicalWidthUsing(const Length& logicalWid
|
| if (logicalWidthLength.type() == FitContent) {
|
| minLogicalWidth += borderAndPadding;
|
| maxLogicalWidth += borderAndPadding;
|
| - return max(minLogicalWidth, min(maxLogicalWidth, fillAvailableMeasure(availableLogicalWidth)));
|
| + return std::max(minLogicalWidth, std::min(maxLogicalWidth, fillAvailableMeasure(availableLogicalWidth)));
|
| }
|
|
|
| ASSERT_NOT_REACHED();
|
| @@ -2308,10 +2306,10 @@ LayoutUnit RenderBox::computeLogicalWidthUsing(SizeType widthType, const Length&
|
| LayoutUnit logicalWidthResult = fillAvailableMeasure(availableLogicalWidth, marginStart, marginEnd);
|
|
|
| if (shrinkToAvoidFloats() && cb->containsFloats())
|
| - logicalWidthResult = min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toRenderBlockFlow(cb)));
|
| + logicalWidthResult = std::min(logicalWidthResult, shrinkLogicalWidthToAvoidFloats(marginStart, marginEnd, toRenderBlockFlow(cb)));
|
|
|
| if (widthType == MainOrPreferredSize && sizesLogicalWidthToFitContent(logicalWidth))
|
| - return max(minPreferredLogicalWidth(), min(maxPreferredLogicalWidth(), logicalWidthResult));
|
| + return std::max(minPreferredLogicalWidth(), std::min(maxPreferredLogicalWidth(), logicalWidthResult));
|
| return logicalWidthResult;
|
| }
|
|
|
| @@ -2432,8 +2430,8 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
|
| if (avoidsFloats() && containingBlock->containsFloats()) {
|
| availableWidth = containingBlockAvailableLineWidth();
|
| if (shrinkToAvoidFloats() && availableWidth < containerWidth) {
|
| - marginStart = max<LayoutUnit>(0, marginStartWidth);
|
| - marginEnd = max<LayoutUnit>(0, marginEndWidth);
|
| + marginStart = std::max<LayoutUnit>(0, marginStartWidth);
|
| + marginEnd = std::max<LayoutUnit>(0, marginEndWidth);
|
| }
|
| }
|
|
|
| @@ -2448,7 +2446,7 @@ void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const
|
| if ((marginStartLength.isAuto() && marginEndLength.isAuto() && marginBoxWidth < availableWidth)
|
| || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlockStyle->textAlign() == WEBKIT_CENTER)) {
|
| // Other browsers center the margin box for align=center elements so we match them here.
|
| - LayoutUnit centeredMarginBoxStart = max<LayoutUnit>(0, (availableWidth - childWidth - marginStartWidth - marginEndWidth) / 2);
|
| + LayoutUnit centeredMarginBoxStart = std::max<LayoutUnit>(0, (availableWidth - childWidth - marginStartWidth - marginEndWidth) / 2);
|
| marginStart = centeredMarginBoxStart + marginStartWidth;
|
| marginEnd = availableWidth - childWidth - marginStart + marginEndWidth;
|
| return;
|
| @@ -2576,10 +2574,10 @@ void RenderBox::computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logica
|
| LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
|
| LayoutUnit visibleHeight = view()->viewLogicalHeightForPercentages();
|
| if (isDocumentElement())
|
| - computedValues.m_extent = max(computedValues.m_extent, visibleHeight - margins);
|
| + computedValues.m_extent = std::max(computedValues.m_extent, visibleHeight - margins);
|
| else {
|
| LayoutUnit marginsBordersPadding = margins + parentBox()->marginBefore() + parentBox()->marginAfter() + parentBox()->borderAndPaddingLogicalHeight();
|
| - computedValues.m_extent = max(computedValues.m_extent, visibleHeight - marginsBordersPadding);
|
| + computedValues.m_extent = std::max(computedValues.m_extent, visibleHeight - marginsBordersPadding);
|
| }
|
| }
|
| }
|
| @@ -2699,7 +2697,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
|
| }
|
| } else if (cbstyle->logicalHeight().isFixed()) {
|
| LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle->logicalHeight().value());
|
| - availableHeight = max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), -1));
|
| + availableHeight = std::max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), -1));
|
| } else if (cbstyle->logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
|
| // We need to recur and compute the percentage height for our containing block.
|
| LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle->logicalHeight());
|
| @@ -2710,7 +2708,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
|
| // return value from the recursive call will not have been adjusted
|
| // yet.
|
| LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight(), -1);
|
| - availableHeight = max<LayoutUnit>(0, contentBoxHeight);
|
| + availableHeight = std::max<LayoutUnit>(0, contentBoxHeight);
|
| }
|
| } else if (isOutOfFlowPositionedWithSpecifiedHeight) {
|
| // Don't allow this to affect the block' height() member variable, since this
|
| @@ -2733,7 +2731,7 @@ LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
|
| // box model. This is essential for sizing inside
|
| // table cells using percentage heights.
|
| result -= borderAndPaddingLogicalHeight();
|
| - return max<LayoutUnit>(0, result);
|
| + return std::max<LayoutUnit>(0, result);
|
| }
|
| return result;
|
| }
|
| @@ -2747,7 +2745,7 @@ LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUni
|
| {
|
| LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMinWidth());
|
| LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth());
|
| - return max(minLogicalWidth, min(logicalWidth, maxLogicalWidth));
|
| + return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth));
|
| }
|
|
|
| LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(const Length& logicalWidth) const
|
| @@ -2802,7 +2800,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutU
|
| {
|
| LayoutUnit minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMinHeight());
|
| LayoutUnit maxLogicalHeight = style()->logicalMaxHeight().isUndefined() ? logicalHeight : computeReplacedLogicalHeightUsing(style()->logicalMaxHeight());
|
| - return max(minLogicalHeight, min(logicalHeight, maxLogicalHeight));
|
| + return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight));
|
| }
|
|
|
| LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(const Length& logicalHeight) const
|
| @@ -2848,7 +2846,7 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(const Length& logicalHei
|
| if (cb->isTableCell()) {
|
| // Don't let table cells squeeze percent-height replaced elements
|
| // <http://bugs.webkit.org/show_bug.cgi?id=15359>
|
| - availableHeight = max(availableHeight, intrinsicLogicalHeight());
|
| + availableHeight = std::max(availableHeight, intrinsicLogicalHeight());
|
| return valueForLength(logicalHeight, availableHeight - borderAndPaddingLogicalHeight());
|
| }
|
| toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderBox*>(this));
|
| @@ -2965,7 +2963,7 @@ LayoutUnit RenderBox::containingBlockLogicalWidthForPositioned(const RenderBoxMo
|
| fromLeft = last->logicalLeft() + last->borderLogicalLeft();
|
| }
|
|
|
| - return max<LayoutUnit>(0, fromRight - fromLeft);
|
| + return std::max<LayoutUnit>(0, fromRight - fromLeft);
|
| }
|
|
|
| LayoutUnit RenderBox::containingBlockLogicalHeightForPositioned(const RenderBoxModelObject* containingBlock, bool checkForPerpendicularWritingMode) const
|
| @@ -3189,7 +3187,7 @@ void RenderBox::shrinkToFitWidth(const LayoutUnit availableSpace, const LayoutUn
|
| LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;
|
| LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;
|
| LayoutUnit availableWidth = availableSpace - logicalLeftValue;
|
| - computedValues.m_extent = min(max(preferredMinWidth, availableWidth), preferredWidth);
|
| + computedValues.m_extent = std::min(std::max(preferredMinWidth, availableWidth), preferredWidth);
|
| }
|
|
|
| void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection,
|
| @@ -3327,7 +3325,7 @@ void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const Re
|
| LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;
|
| LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;
|
| LayoutUnit availableWidth = availableSpace - logicalRightValue;
|
| - computedValues.m_extent = min(max(preferredMinWidth, availableWidth), preferredWidth);
|
| + computedValues.m_extent = std::min(std::max(preferredMinWidth, availableWidth), preferredWidth);
|
| logicalLeftValue = availableSpace - (computedValues.m_extent + logicalRightValue);
|
| } else if (!logicalLeftIsAuto && logicalWidthIsAuto && logicalRightIsAuto) {
|
| // RULE 3: (use shrink-to-fit for width, and no need solve of right)
|
| @@ -3620,7 +3618,7 @@ void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength,
|
| } else if (!logicalTopIsAuto && logicalHeightIsAuto && !logicalBottomIsAuto) {
|
| // RULE 5: (solve of height)
|
| logicalTopValue = valueForLength(logicalTop, containerLogicalHeight);
|
| - logicalHeightValue = max<LayoutUnit>(0, availableSpace - (logicalTopValue + valueForLength(logicalBottom, containerLogicalHeight)));
|
| + logicalHeightValue = std::max<LayoutUnit>(0, availableSpace - (logicalTopValue + valueForLength(logicalBottom, containerLogicalHeight)));
|
| } else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) {
|
| // RULE 6: (no need solve of bottom)
|
| logicalHeightValue = resolvedLogicalHeight;
|
| @@ -4136,19 +4134,19 @@ void RenderBox::addVisualEffectOverflow()
|
|
|
| // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right
|
| // border is at the lower x coordinate value.
|
| - overflowMinX = min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsets.left() : borderOutsets.right()));
|
| - overflowMaxX = max(overflowMaxX, borderBox.maxX() + ((!isFlipped || isHorizontal) ? borderOutsets.right() : borderOutsets.left()));
|
| - overflowMinY = min(overflowMinY, borderBox.y() - ((!isFlipped || !isHorizontal) ? borderOutsets.top() : borderOutsets.bottom()));
|
| - overflowMaxY = max(overflowMaxY, borderBox.maxY() + ((!isFlipped || !isHorizontal) ? borderOutsets.bottom() : borderOutsets.top()));
|
| + overflowMinX = std::min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsets.left() : borderOutsets.right()));
|
| + overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + ((!isFlipped || isHorizontal) ? borderOutsets.right() : borderOutsets.left()));
|
| + overflowMinY = std::min(overflowMinY, borderBox.y() - ((!isFlipped || !isHorizontal) ? borderOutsets.top() : borderOutsets.bottom()));
|
| + overflowMaxY = std::max(overflowMaxY, borderBox.maxY() + ((!isFlipped || !isHorizontal) ? borderOutsets.bottom() : borderOutsets.top()));
|
| }
|
|
|
| if (style()->hasOutline()) {
|
| LayoutUnit outlineSize = style()->outlineSize();
|
|
|
| - overflowMinX = min(overflowMinX, borderBox.x() - outlineSize);
|
| - overflowMaxX = max(overflowMaxX, borderBox.maxX() + outlineSize);
|
| - overflowMinY = min(overflowMinY, borderBox.y() - outlineSize);
|
| - overflowMaxY = max(overflowMaxY, borderBox.maxY() + outlineSize);
|
| + overflowMinX = std::min(overflowMinX, borderBox.x() - outlineSize);
|
| + overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + outlineSize);
|
| + overflowMinY = std::min(overflowMinY, borderBox.y() - outlineSize);
|
| + overflowMaxY = std::max(overflowMaxY, borderBox.maxY() + outlineSize);
|
| }
|
|
|
| // Add in the final overflow with shadows, outsets and outline combined.
|
| @@ -4202,13 +4200,13 @@ void RenderBox::addLayoutOverflow(const LayoutRect& rect)
|
| }
|
|
|
| if (!hasTopOverflow)
|
| - overflowRect.shiftYEdgeTo(max(overflowRect.y(), clientBox.y()));
|
| + overflowRect.shiftYEdgeTo(std::max(overflowRect.y(), clientBox.y()));
|
| else
|
| - overflowRect.shiftMaxYEdgeTo(min(overflowRect.maxY(), clientBox.maxY()));
|
| + overflowRect.shiftMaxYEdgeTo(std::min(overflowRect.maxY(), clientBox.maxY()));
|
| if (!hasLeftOverflow)
|
| - overflowRect.shiftXEdgeTo(max(overflowRect.x(), clientBox.x()));
|
| + overflowRect.shiftXEdgeTo(std::max(overflowRect.x(), clientBox.x()));
|
| else
|
| - overflowRect.shiftMaxXEdgeTo(min(overflowRect.maxX(), clientBox.maxX()));
|
| + overflowRect.shiftMaxXEdgeTo(std::min(overflowRect.maxX(), clientBox.maxX()));
|
|
|
| // Now re-test with the adjusted rectangle and see if it has become unreachable or fully
|
| // contained.
|
|
|