Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1156)

Unified Diff: Source/core/rendering/RootInlineBox.cpp

Issue 339333002: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing mac error Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/RootInlineBox.cpp
diff --git a/Source/core/rendering/RootInlineBox.cpp b/Source/core/rendering/RootInlineBox.cpp
index b0a93da9dd0841999deccd8d4408048441e8b99a..ae2051ba2df8b18f05b197d3c8decd337d57cf72 100644
--- a/Source/core/rendering/RootInlineBox.cpp
+++ b/Source/core/rendering/RootInlineBox.cpp
@@ -33,8 +33,6 @@
#include "platform/text/BidiResolver.h"
#include "wtf/unicode/Unicode.h"
-using namespace std;
-
namespace WebCore {
struct SameSizeAsRootInlineBox : public InlineFlowBox {
@@ -236,7 +234,7 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
computeLogicalBoxHeights(this, maxPositionTop, maxPositionBottom, maxAscent, maxDescent, setMaxAscent, setMaxDescent, noQuirksMode,
textBoxDataMap, baselineType(), verticalPositionCache);
- if (maxAscent + maxDescent < max(maxPositionTop, maxPositionBottom))
+ if (maxAscent + maxDescent < std::max(maxPositionTop, maxPositionBottom))
adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop, maxPositionBottom);
LayoutUnit maxHeight = maxAscent + maxDescent;
@@ -253,7 +251,7 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
m_hasAnnotationsBefore = hasAnnotationsBefore;
m_hasAnnotationsAfter = hasAnnotationsAfter;
- maxHeight = max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
+ maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock + maxHeight, selectionBottom);
if (block().view()->layoutState()->isPaginated())
@@ -290,7 +288,7 @@ LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const
return result;
// Annotations over this line may push us further down.
- LayoutUnit highestAllowedPosition = prevRootBox() ? min(prevRootBox()->lineBottom(), lineTop()) + result : static_cast<LayoutUnit>(block().borderBefore());
+ LayoutUnit highestAllowedPosition = prevRootBox() ? std::min(prevRootBox()->lineBottom(), lineTop()) + result : static_cast<LayoutUnit>(block().borderBefore());
result = computeOverAnnotationAdjustment(highestAllowedPosition);
} else {
// Annotations under this line may push us up.
@@ -301,7 +299,7 @@ LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const
return result;
// We have to compute the expansion for annotations over the previous line to see how much we should move.
- LayoutUnit lowestAllowedPosition = max(prevRootBox()->lineBottom(), lineTop()) - result;
+ LayoutUnit lowestAllowedPosition = std::max(prevRootBox()->lineBottom(), lineTop()) - result;
result = prevRootBox()->computeOverAnnotationAdjustment(lowestAllowedPosition);
}
@@ -448,7 +446,7 @@ LayoutUnit RootInlineBox::selectionTopAdjustedForPrecedingBlock() const
return top;
LayoutUnit lastLineSelectionBottom = lastLine->selectionBottom() + offsetToBlockBefore.height();
- top = max(top, lastLineSelectionBottom);
+ top = std::max(top, lastLineSelectionBottom);
}
}
@@ -483,7 +481,7 @@ LayoutUnit RootInlineBox::selectionBottom() const
int RootInlineBox::blockDirectionPointInLine() const
{
- return !block().style()->isFlippedBlocksWritingMode() ? max(lineTop(), selectionTop()) : min(lineBottom(), selectionBottom());
+ return !block().style()->isFlippedBlocksWritingMode() ? std::max(lineTop(), selectionTop()) : std::min(lineBottom(), selectionBottom());
}
RenderBlockFlow& RootInlineBox::block() const
@@ -593,14 +591,14 @@ LayoutRect RootInlineBox::paddedLayoutOverflowRect(LayoutUnit endPadding) const
if (isHorizontal()) {
if (isLeftToRightDirection())
- lineLayoutOverflow.shiftMaxXEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxX(), logicalRight() + endPadding));
+ lineLayoutOverflow.shiftMaxXEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxX(), logicalRight() + endPadding));
else
- lineLayoutOverflow.shiftXEdgeTo(min<LayoutUnit>(lineLayoutOverflow.x(), logicalLeft() - endPadding));
+ lineLayoutOverflow.shiftXEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.x(), logicalLeft() - endPadding));
} else {
if (isLeftToRightDirection())
- lineLayoutOverflow.shiftMaxYEdgeTo(max<LayoutUnit>(lineLayoutOverflow.maxY(), logicalRight() + endPadding));
+ lineLayoutOverflow.shiftMaxYEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxY(), logicalRight() + endPadding));
else
- lineLayoutOverflow.shiftYEdgeTo(min<LayoutUnit>(lineLayoutOverflow.y(), logicalLeft() - endPadding));
+ lineLayoutOverflow.shiftYEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.y(), logicalLeft() - endPadding));
}
return lineLayoutOverflow;
@@ -613,8 +611,8 @@ static void setAscentAndDescent(int& ascent, int& descent, int newAscent, int ne
ascent = newAscent;
descent = newDescent;
} else {
- ascent = max(ascent, newAscent);
- descent = max(descent, newDescent);
+ ascent = std::max(ascent, newAscent);
+ descent = std::max(descent, newDescent);
}
}
@@ -701,8 +699,8 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox* box, GlyphOverflowAndFallb
setAscentAndDescent(ascent, descent, glyphOverflow->top, glyphOverflow->bottom, ascentDescentSet);
affectsAscent = glyphOverflow->top - box->logicalTop() > 0;
affectsDescent = glyphOverflow->bottom + box->logicalTop() > 0;
- glyphOverflow->top = min(glyphOverflow->top, max(0, glyphOverflow->top - box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType())));
- glyphOverflow->bottom = min(glyphOverflow->bottom, max(0, glyphOverflow->bottom - box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType())));
+ glyphOverflow->top = std::min(glyphOverflow->top, std::max(0, glyphOverflow->top - box->renderer().style(isFirstLineStyle())->fontMetrics().ascent(baselineType())));
+ glyphOverflow->bottom = std::min(glyphOverflow->bottom, std::max(0, glyphOverflow->bottom - box->renderer().style(isFirstLineStyle())->fontMetrics().descent(baselineType())));
}
if (includeMarginForBox(box)) {
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumMac.mm ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698