Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index 05b17ac4098620fed46e90d51c3f57714a7eb2f8..c60757b86f7d6b1a778b03c8b206ae65457884ed 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -161,6 +161,7 @@ |
#include <cmath> // for std::pow |
using namespace WebCore; |
+using namespace std; |
// The following constants control parameters for automated scaling of webpages |
// (such as due to a double tap gesture or find in page etc.). These are |
@@ -1064,13 +1065,13 @@ |
const int absoluteSourceX = source.x + scrollOffset.width(); |
if (leftMargin > absoluteSourceX) { |
leftMargin = absoluteSourceX; |
- rightMargin = std::max(leftMargin, minimumMargin); |
+ rightMargin = max(leftMargin, minimumMargin); |
} |
const int maximumRightMargin = maxSize.width - (source.width + absoluteSourceX); |
if (rightMargin > maximumRightMargin) { |
rightMargin = maximumRightMargin; |
- leftMargin = std::min(leftMargin, std::max(rightMargin, minimumMargin)); |
+ leftMargin = min(leftMargin, max(rightMargin, minimumMargin)); |
} |
const int newWidth = source.width + leftMargin + rightMargin; |
@@ -1115,9 +1116,9 @@ |
static_cast<int>(minimumMargin * rect.width / m_size.width)); |
// Fit block to screen, respecting limits. |
scale = static_cast<float>(m_size.width) / rect.width; |
- scale = std::min(scale, legibleScale()); |
+ scale = min(scale, legibleScale()); |
if (pageScaleFactor() < defaultScaleWhenAlreadyLegible) |
- scale = std::max(scale, defaultScaleWhenAlreadyLegible); |
+ scale = max(scale, defaultScaleWhenAlreadyLegible); |
scale = clampPageScaleFactorToLimits(scale); |
} |
@@ -1138,14 +1139,14 @@ |
} else { |
// Ensure position we're zooming to (+ padding) isn't off the bottom of |
// the screen. |
- rect.y = std::max<float>(rect.y, hitPoint.y + padding - screenHeight); |
+ rect.y = max<float>(rect.y, hitPoint.y + padding - screenHeight); |
} // Otherwise top align the block. |
// Do the same thing for horizontal alignment. |
if (rect.width < screenWidth) |
rect.x -= 0.5 * (screenWidth - rect.width); |
else |
- rect.x = std::max<float>(rect.x, hitPoint.x + padding - screenWidth); |
+ rect.x = max<float>(rect.x, hitPoint.x + padding - screenWidth); |
scroll.x = rect.x; |
scroll.y = rect.y; |
@@ -2605,11 +2606,11 @@ |
// onscreen. |
int idealLeftPadding = viewWidth * leftBoxRatio; |
int maxLeftPaddingKeepingBoxOnscreen = viewWidth - textboxRectInDocumentCoordinates.width(); |
- newScroll.setX(textboxRectInDocumentCoordinates.x() - std::min<int>(idealLeftPadding, maxLeftPaddingKeepingBoxOnscreen)); |
+ newScroll.setX(textboxRectInDocumentCoordinates.x() - min<int>(idealLeftPadding, maxLeftPaddingKeepingBoxOnscreen)); |
} else { |
// Field is wider than screen. Try to left-align field, unless caret would |
// be offscreen, in which case right-align the caret. |
- newScroll.setX(std::max<int>(textboxRectInDocumentCoordinates.x(), caretInDocumentCoordinates.x() + caretInDocumentCoordinates.width() + caretPadding - viewWidth)); |
+ newScroll.setX(max<int>(textboxRectInDocumentCoordinates.x(), caretInDocumentCoordinates.x() + caretInDocumentCoordinates.width() + caretPadding - viewWidth)); |
} |
if (textboxRectInDocumentCoordinates.height() <= viewHeight) { |
// Field is shorter than screen. Vertically center it. |
@@ -2617,7 +2618,7 @@ |
} else { |
// Field is taller than screen. Try to top align field, unless caret would |
// be offscreen, in which case bottom-align the caret. |
- newScroll.setY(std::max<int>(textboxRectInDocumentCoordinates.y(), caretInDocumentCoordinates.y() + caretInDocumentCoordinates.height() + caretPadding - viewHeight)); |
+ newScroll.setY(max<int>(textboxRectInDocumentCoordinates.y(), caretInDocumentCoordinates.y() + caretInDocumentCoordinates.height() + caretPadding - viewHeight)); |
} |
needAnimation = false; |
@@ -2694,7 +2695,7 @@ |
if (zoomLevel == m_zoomLevel) |
return; |
- m_zoomLevel = std::max(std::min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel); |
+ m_zoomLevel = max(min(zoomLevel, m_maximumZoomLevel), m_minimumZoomLevel); |
m_client->zoomLevelChanged(); |
} |