Removing using declarations that import names in the C++ Standard library.

This is as per the the coding guidelines for blink, which disallows the
use of "using" declarations of any kind to import names in the C++ Standard
library.

This is in continuation of the CL https://codereview.chromium.org/329183002/
Effected Folders: Source/core/html/

BUG=NONE

Review URL: https://codereview.chromium.org/334593005

git-svn-id: svn://svn.chromium.org/blink/trunk@176069 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b79b624e
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "platform/graphics/Path.h" #include "platform/graphics/Path.h"
#include "platform/transforms/AffineTransform.h" #include "platform/transforms/AffineTransform.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
...@@ -152,7 +150,7 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const ...@@ -152,7 +150,7 @@ Path HTMLAreaElement::getRegion(const LayoutSize& size) const
case Circle: case Circle:
if (m_coords.size() >= 3) { if (m_coords.size() >= 3) {
Length radius = m_coords[2]; Length radius = m_coords[2];
float r = min(minimumValueForLength(radius, width).toFloat(), minimumValueForLength(radius, height).toFloat()); float r = std::min(minimumValueForLength(radius, width).toFloat(), minimumValueForLength(radius, height).toFloat());
path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width).toFloat() - r, minimumValueForLength(m_coords[1], height).toFloat() - r, 2 * r, 2 * r)); path.addEllipse(FloatRect(minimumValueForLength(m_coords[0], width).toFloat() - r, minimumValueForLength(m_coords[1], height).toFloat() - r, 2 * r, 2 * r));
} }
break; break;
......
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form) HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
: LabelableElement(tagName, document) : LabelableElement(tagName, document)
......
...@@ -55,8 +55,6 @@ ...@@ -55,8 +55,6 @@
#include "platform/UserGestureIndicator.h" #include "platform/UserGestureIndicator.h"
#include "wtf/text/AtomicString.h" #include "wtf/text/AtomicString.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -43,8 +43,6 @@ ...@@ -43,8 +43,6 @@
#include "core/rendering/RenderImage.h" #include "core/rendering/RenderImage.h"
#include "platform/MIMETypeRegistry.h" #include "platform/MIMETypeRegistry.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -76,8 +76,6 @@ ...@@ -76,8 +76,6 @@
#include "platform/text/PlatformLocale.h" #include "platform/text/PlatformLocale.h"
#include "wtf/MathExtras.h" #include "wtf/MathExtras.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include "core/html/HTMLImageElement.h" #include "core/html/HTMLImageElement.h"
#include "core/rendering/HitTestResult.h" #include "core/rendering/HitTestResult.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
#include "platform/audio/AudioSourceProviderClient.h" #include "platform/audio/AudioSourceProviderClient.h"
#endif #endif
using namespace std;
using blink::WebInbandTextTrack; using blink::WebInbandTextTrack;
using blink::WebMediaPlayer; using blink::WebMediaPlayer;
using blink::WebMimeRegistry; using blink::WebMimeRegistry;
...@@ -120,7 +119,6 @@ static const char* boolString(bool val) ...@@ -120,7 +119,6 @@ static const char* boolString(bool val)
static const char mediaSourceBlobProtocol[] = "blob"; static const char mediaSourceBlobProtocol[] = "blob";
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<HTMLMediaElement> > WeakMediaElementSet; typedef WillBeHeapHashSet<RawPtrWillBeWeakMember<HTMLMediaElement> > WeakMediaElementSet;
typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Document>, WeakMediaElementSet> DocumentElementSetMap; typedef WillBeHeapHashMap<RawPtrWillBeWeakMember<Document>, WeakMediaElementSet> DocumentElementSetMap;
...@@ -244,10 +242,10 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum ...@@ -244,10 +242,10 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_readyStateMaximum(HAVE_NOTHING) , m_readyStateMaximum(HAVE_NOTHING)
, m_volume(1.0f) , m_volume(1.0f)
, m_lastSeekTime(0) , m_lastSeekTime(0)
, m_previousProgressTime(numeric_limits<double>::max()) , m_previousProgressTime(std::numeric_limits<double>::max())
, m_duration(numeric_limits<double>::quiet_NaN()) , m_duration(std::numeric_limits<double>::quiet_NaN())
, m_lastTimeUpdateEventWallTime(0) , m_lastTimeUpdateEventWallTime(0)
, m_lastTimeUpdateEventMovieTime(numeric_limits<double>::max()) , m_lastTimeUpdateEventMovieTime(std::numeric_limits<double>::max())
, m_loadState(WaitingForSource) , m_loadState(WaitingForSource)
, m_webLayer(0) , m_webLayer(0)
, m_preload(MediaPlayer::Auto) , m_preload(MediaPlayer::Auto)
...@@ -729,7 +727,7 @@ void HTMLMediaElement::prepareForLoad() ...@@ -729,7 +727,7 @@ void HTMLMediaElement::prepareForLoad()
// FIXME: Investigate whether these can be moved into m_networkState != NETWORK_EMPTY block above // FIXME: Investigate whether these can be moved into m_networkState != NETWORK_EMPTY block above
// so they are closer to the relevant spec steps. // so they are closer to the relevant spec steps.
m_lastSeekTime = 0; m_lastSeekTime = 0;
m_duration = numeric_limits<double>::quiet_NaN(); m_duration = std::numeric_limits<double>::quiet_NaN();
// The spec doesn't say to block the load event until we actually run the asynchronous section // The spec doesn't say to block the load event until we actually run the asynchronous section
// algorithm, but do it now because we won't start that until after the timer fires and the // algorithm, but do it now because we won't start that until after the timer fires and the
...@@ -1043,7 +1041,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime) ...@@ -1043,7 +1041,7 @@ void HTMLMediaElement::updateActiveTextTrackCues(double movieTime)
double cueEndTime = potentiallySkippedCues[i].high(); double cueEndTime = potentiallySkippedCues[i].high();
// Consider cues that may have been missed since the last seek time. // Consider cues that may have been missed since the last seek time.
if (cueStartTime > max(m_lastSeekTime, lastTime) && cueEndTime < movieTime) if (cueStartTime > std::max(m_lastSeekTime, lastTime) && cueEndTime < movieTime)
missedCues.append(potentiallySkippedCues[i]); missedCues.append(potentiallySkippedCues[i]);
} }
} }
...@@ -1334,7 +1332,7 @@ void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtrWillBeRawPtr< ...@@ -1334,7 +1332,7 @@ void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtrWillBeRawPtr<
// Negative duration cues need be treated in the interval tree as // Negative duration cues need be treated in the interval tree as
// zero-length cues. // zero-length cues.
double endTime = max(cue->startTime(), cue->endTime()); double endTime = std::max(cue->startTime(), cue->endTime());
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get()); CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
if (!m_cueTree.contains(interval)) if (!m_cueTree.contains(interval))
...@@ -1346,7 +1344,7 @@ void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtrWillBeRawPtr<Tex ...@@ -1346,7 +1344,7 @@ void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtrWillBeRawPtr<Tex
{ {
// Negative duration cues need to be treated in the interval tree as // Negative duration cues need to be treated in the interval tree as
// zero-length cues. // zero-length cues.
double endTime = max(cue->startTime(), cue->endTime()); double endTime = std::max(cue->startTime(), cue->endTime());
CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get()); CueInterval interval = m_cueTree.createInterval(cue->startTime(), endTime, cue.get());
m_cueTree.remove(interval); m_cueTree.remove(interval);
...@@ -1788,10 +1786,10 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState) ...@@ -1788,10 +1786,10 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
// 5 - If the new playback position is later than the end of the media resource, then let it be the end // 5 - If the new playback position is later than the end of the media resource, then let it be the end
// of the media resource instead. // of the media resource instead.
time = min(time, duration()); time = std::min(time, duration());
// 6 - If the new playback position is less than the earliest possible position, let it be that position instead. // 6 - If the new playback position is less than the earliest possible position, let it be that position instead.
time = max(time, 0.0); time = std::max(time, 0.0);
// Ask the media engine for the time value in the movie's time scale before comparing with current time. This // Ask the media engine for the time value in the movie's time scale before comparing with current time. This
// is necessary because if the seek time is not equal to currentTime but the delta is less than the movie's // is necessary because if the seek time is not equal to currentTime but the delta is less than the movie's
...@@ -1940,7 +1938,7 @@ void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionStat ...@@ -1940,7 +1938,7 @@ void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionStat
double HTMLMediaElement::duration() const double HTMLMediaElement::duration() const
{ {
if (!m_player || m_readyState < HAVE_METADATA) if (!m_player || m_readyState < HAVE_METADATA)
return numeric_limits<double>::quiet_NaN(); return std::numeric_limits<double>::quiet_NaN();
// FIXME: Refactor so m_duration is kept current (in both MSE and // FIXME: Refactor so m_duration is kept current (in both MSE and
// non-MSE cases) once we have transitioned from HAVE_NOTHING -> // non-MSE cases) once we have transitioned from HAVE_NOTHING ->
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
#include "platform/PlatformMouseEvent.h" #include "platform/PlatformMouseEvent.h"
#include "platform/text/PlatformLocale.h" #include "platform/text/PlatformLocale.h"
using namespace std;
using namespace WTF::Unicode; using namespace WTF::Unicode;
namespace WebCore { namespace WebCore {
...@@ -327,7 +326,7 @@ void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt ...@@ -327,7 +326,7 @@ void HTMLSelectElement::parseAttribute(const QualifiedName& name, const AtomicSt
if (Attribute* sizeAttribute = ensureUniqueElementData().findAttributeByName(sizeAttr)) if (Attribute* sizeAttribute = ensureUniqueElementData().findAttributeByName(sizeAttr))
sizeAttribute->setValue(attrSize); sizeAttribute->setValue(attrSize);
} }
size = max(size, 1); size = std::max(size, 1);
// Ensure that we've determined selectedness of the items at least once prior to changing the size. // Ensure that we've determined selectedness of the items at least once prior to changing the size.
if (oldSize != size) if (oldSize != size)
...@@ -635,8 +634,8 @@ void HTMLSelectElement::updateListBoxSelection(bool deselectOtherOptions) ...@@ -635,8 +634,8 @@ void HTMLSelectElement::updateListBoxSelection(bool deselectOtherOptions)
ASSERT(renderer() && (renderer()->isListBox() || m_multiple)); ASSERT(renderer() && (renderer()->isListBox() || m_multiple));
ASSERT(!listItems().size() || m_activeSelectionAnchorIndex >= 0); ASSERT(!listItems().size() || m_activeSelectionAnchorIndex >= 0);
unsigned start = min(m_activeSelectionAnchorIndex, m_activeSelectionEndIndex); unsigned start = std::min(m_activeSelectionAnchorIndex, m_activeSelectionEndIndex);
unsigned end = max(m_activeSelectionAnchorIndex, m_activeSelectionEndIndex); unsigned end = std::max(m_activeSelectionAnchorIndex, m_activeSelectionEndIndex);
const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems(); const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems();
for (unsigned i = 0; i < items.size(); ++i) { for (unsigned i = 0; i < items.size(); ++i) {
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "core/html/HTMLPictureElement.h" #include "core/html/HTMLPictureElement.h"
#include "platform/Logging.h" #include "platform/Logging.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
HTMLTextFormControlElement::HTMLTextFormControlElement(const QualifiedName& tagName, Document& doc, HTMLFormElement* form) HTMLTextFormControlElement::HTMLTextFormControlElement(const QualifiedName& tagName, Document& doc, HTMLFormElement* form)
: HTMLFormControlElementWithState(tagName, doc, form) : HTMLFormControlElementWithState(tagName, doc, form)
...@@ -164,12 +163,12 @@ void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderVal ...@@ -164,12 +163,12 @@ void HTMLTextFormControlElement::updatePlaceholderVisibility(bool placeholderVal
void HTMLTextFormControlElement::setSelectionStart(int start) void HTMLTextFormControlElement::setSelectionStart(int start)
{ {
setSelectionRange(start, max(start, selectionEnd()), selectionDirection()); setSelectionRange(start, std::max(start, selectionEnd()), selectionDirection());
} }
void HTMLTextFormControlElement::setSelectionEnd(int end) void HTMLTextFormControlElement::setSelectionEnd(int end)
{ {
setSelectionRange(min(end, selectionStart()), end, selectionDirection()); setSelectionRange(std::min(end, selectionStart()), end, selectionDirection());
} }
void HTMLTextFormControlElement::setSelectionDirection(const String& direction) void HTMLTextFormControlElement::setSelectionDirection(const String& direction)
...@@ -179,7 +178,7 @@ void HTMLTextFormControlElement::setSelectionDirection(const String& direction) ...@@ -179,7 +178,7 @@ void HTMLTextFormControlElement::setSelectionDirection(const String& direction)
void HTMLTextFormControlElement::select() void HTMLTextFormControlElement::select()
{ {
setSelectionRange(0, numeric_limits<int>::max(), SelectionHasNoDirection); setSelectionRange(0, std::numeric_limits<int>::max(), SelectionHasNoDirection);
} }
bool HTMLTextFormControlElement::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue) bool HTMLTextFormControlElement::shouldDispatchFormControlChangeEvent(String& oldValue, String& newValue)
...@@ -283,8 +282,8 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField ...@@ -283,8 +282,8 @@ void HTMLTextFormControlElement::setSelectionRange(int start, int end, TextField
if (!renderer() || !renderer()->isTextControl()) if (!renderer() || !renderer()->isTextControl())
return; return;
end = max(end, 0); end = std::max(end, 0);
start = min(max(start, 0), end); start = std::min(std::max(start, 0), end);
if (!hasVisibleTextArea(renderer(), innerTextElement())) { if (!hasVisibleTextArea(renderer(), innerTextElement())) {
cacheSelection(start, end, direction); cacheSelection(start, end, direction);
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
#include "core/html/HTMLMediaElement.h" #include "core/html/HTMLMediaElement.h"
#include "platform/Logging.h" #include "platform/Logging.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
#include "wtf/StdLibExtras.h" #include "wtf/StdLibExtras.h"
#include "wtf/text/AtomicString.h" #include "wtf/text/AtomicString.h"
using namespace std;
namespace WebCore { namespace WebCore {
PassRefPtrWillBeRawPtr<MediaController> MediaController::create(ExecutionContext* context) PassRefPtrWillBeRawPtr<MediaController> MediaController::create(ExecutionContext* context)
...@@ -139,7 +137,7 @@ double MediaController::duration() const ...@@ -139,7 +137,7 @@ double MediaController::duration() const
double duration = (*it)->duration(); double duration = (*it)->duration();
if (std::isnan(duration)) if (std::isnan(duration))
continue; continue;
maxDuration = max(maxDuration, duration); maxDuration = std::max(maxDuration, duration);
} }
return maxDuration; return maxDuration;
} }
...@@ -151,7 +149,7 @@ double MediaController::currentTime() const ...@@ -151,7 +149,7 @@ double MediaController::currentTime() const
if (m_position == MediaPlayer::invalidTime()) { if (m_position == MediaPlayer::invalidTime()) {
// Some clocks may return times outside the range of [0..duration]. // Some clocks may return times outside the range of [0..duration].
m_position = max(0.0, min(duration(), m_clock->currentTime())); m_position = std::max(0.0, std::min(duration(), m_clock->currentTime()));
m_clearPositionTimer.startOneShot(0, FROM_HERE); m_clearPositionTimer.startOneShot(0, FROM_HERE);
} }
...@@ -163,11 +161,11 @@ void MediaController::setCurrentTime(double time, ExceptionState& exceptionState ...@@ -163,11 +161,11 @@ void MediaController::setCurrentTime(double time, ExceptionState& exceptionState
// When the user agent is to seek the media controller to a particular new playback position, // When the user agent is to seek the media controller to a particular new playback position,
// it must follow these steps: // it must follow these steps:
// If the new playback position is less than zero, then set it to zero. // If the new playback position is less than zero, then set it to zero.
time = max(0.0, time); time = std::max(0.0, time);
// If the new playback position is greater than the media controller duration, then set it // If the new playback position is greater than the media controller duration, then set it
// to the media controller duration. // to the media controller duration.
time = min(time, duration()); time = std::min(time, duration());
// Set the media controller position to the new playback position. // Set the media controller position to the new playback position.
m_position = time; m_position = time;
...@@ -364,7 +362,7 @@ void MediaController::updateReadyState() ...@@ -364,7 +362,7 @@ void MediaController::updateReadyState()
MediaElementSequence::const_iterator it = m_mediaElements.begin(); MediaElementSequence::const_iterator it = m_mediaElements.begin();
newReadyState = (*it)->readyState(); newReadyState = (*it)->readyState();
for (++it; it != m_mediaElements.end(); ++it) for (++it; it != m_mediaElements.end(); ++it)
newReadyState = min(newReadyState, (*it)->readyState()); newReadyState = std::min(newReadyState, (*it)->readyState());
} }
if (newReadyState == oldReadyState) if (newReadyState == oldReadyState)
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <math.h> #include <math.h>
using namespace WebCore; using namespace WebCore;
using namespace std;
TimeRanges::TimeRanges(double start, double end) TimeRanges::TimeRanges(double start, double end)
{ {
......
...@@ -69,8 +69,6 @@ ...@@ -69,8 +69,6 @@
#include "wtf/Uint8ClampedArray.h" #include "wtf/Uint8ClampedArray.h"
#include "wtf/text/StringBuilder.h" #include "wtf/text/StringBuilder.h"
using namespace std;
namespace WebCore { namespace WebCore {
static const int defaultFontSize = 10; static const int defaultFontSize = 10;
...@@ -1415,10 +1413,10 @@ bool CanvasRenderingContext2D::shouldDrawShadows() const ...@@ -1415,10 +1413,10 @@ bool CanvasRenderingContext2D::shouldDrawShadows() const
static inline FloatRect normalizeRect(const FloatRect& rect) static inline FloatRect normalizeRect(const FloatRect& rect)
{ {
return FloatRect(min(rect.x(), rect.maxX()), return FloatRect(std::min(rect.x(), rect.maxX()),
min(rect.y(), rect.maxY()), std::min(rect.y(), rect.maxY()),
max(rect.width(), -rect.width()), std::max(rect.width(), -rect.width()),
max(rect.height(), -rect.height())); std::max(rect.height(), -rect.height()));
} }
static inline void clipRectsToImageRect(const FloatRect& imageRect, FloatRect* srcRect, FloatRect* dstRect) static inline void clipRectsToImageRect(const FloatRect& imageRect, FloatRect* srcRect, FloatRect* dstRect)
......
...@@ -43,7 +43,6 @@ namespace WebCore { ...@@ -43,7 +43,6 @@ namespace WebCore {
using blink::WebLocalizedString; using blink::WebLocalizedString;
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
static const int msecPerMinute = 60 * 1000; static const int msecPerMinute = 60 * 1000;
static const int msecPerSecond = 1000; static const int msecPerSecond = 1000;
......
...@@ -73,7 +73,6 @@ namespace WebCore { ...@@ -73,7 +73,6 @@ namespace WebCore {
using blink::WebLocalizedString; using blink::WebLocalizedString;
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&); typedef PassRefPtrWillBeRawPtr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap; typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
...@@ -200,7 +199,7 @@ void InputType::setValueAsDate(double, ExceptionState& exceptionState) const ...@@ -200,7 +199,7 @@ void InputType::setValueAsDate(double, ExceptionState& exceptionState) const
double InputType::valueAsDouble() const double InputType::valueAsDouble() const
{ {
return numeric_limits<double>::quiet_NaN(); return std::numeric_limits<double>::quiet_NaN();
} }
void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior eventBehavior, ExceptionState& exceptionState) const void InputType::setValueAsDouble(double doubleValue, TextFieldEventBehavior eventBehavior, ExceptionState& exceptionState) const
......
...@@ -49,7 +49,6 @@ namespace WebCore { ...@@ -49,7 +49,6 @@ namespace WebCore {
using blink::WebLocalizedString; using blink::WebLocalizedString;
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
static const int numberDefaultStep = 1; static const int numberDefaultStep = 1;
static const int numberDefaultStepBase = 0; static const int numberDefaultStepBase = 0;
...@@ -145,7 +144,7 @@ bool NumberInputType::typeMismatch() const ...@@ -145,7 +144,7 @@ bool NumberInputType::typeMismatch() const
StepRange NumberInputType::createStepRange(AnyStepHandling anyStepHandling) const StepRange NumberInputType::createStepRange(AnyStepHandling anyStepHandling) const
{ {
DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (numberDefaultStep, numberDefaultStepBase, numberStepScaleFactor)); DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (numberDefaultStep, numberDefaultStepBase, numberStepScaleFactor));
const Decimal doubleMax = Decimal::fromDouble(numeric_limits<double>::max()); const Decimal doubleMax = Decimal::fromDouble(std::numeric_limits<double>::max());
return InputType::createStepRange(anyStepHandling, numberDefaultStepBase, -doubleMax, doubleMax, stepDescription); return InputType::createStepRange(anyStepHandling, numberDefaultStepBase, -doubleMax, doubleMax, stepDescription);
} }
......
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
using namespace std;
static const int rangeDefaultMinimum = 0; static const int rangeDefaultMinimum = 0;
static const int rangeDefaultMaximum = 100; static const int rangeDefaultMaximum = 100;
...@@ -193,7 +192,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event) ...@@ -193,7 +192,7 @@ void RangeInputType::handleKeydownEvent(KeyboardEvent* event)
// FIXME: We can't use stepUp() for the step value "any". So, we increase // FIXME: We can't use stepUp() for the step value "any". So, we increase
// or decrease the value by 1/100 of the value range. Is it reasonable? // or decrease the value by 1/100 of the value range. Is it reasonable?
const Decimal step = equalIgnoringCase(element().fastGetAttribute(stepAttr), "any") ? (stepRange.maximum() - stepRange.minimum()) / 100 : stepRange.step(); const Decimal step = equalIgnoringCase(element().fastGetAttribute(stepAttr), "any") ? (stepRange.maximum() - stepRange.minimum()) / 100 : stepRange.step();
const Decimal bigStep = max((stepRange.maximum() - stepRange.minimum()) / 10, step); const Decimal bigStep = std::max((stepRange.maximum() - stepRange.minimum()) / 10, step);
bool isVertical = false; bool isVertical = false;
if (element().renderer()) { if (element().renderer()) {
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
#include <float.h> #include <float.h>
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
...@@ -84,7 +82,7 @@ Decimal StepRange::alignValueForStep(const Decimal& currentValue, const Decimal& ...@@ -84,7 +82,7 @@ Decimal StepRange::alignValueForStep(const Decimal& currentValue, const Decimal&
Decimal StepRange::clampValue(const Decimal& value) const Decimal StepRange::clampValue(const Decimal& value) const
{ {
const Decimal inRangeValue = max(m_minimum, min(value, m_maximum)); const Decimal inRangeValue = std::max(m_minimum, std::min(value, m_maximum));
if (!m_hasStep) if (!m_hasStep)
return inRangeValue; return inRangeValue;
// Rounds inRangeValue to stepBase + N * step. // Rounds inRangeValue to stepBase + N * step.
...@@ -121,13 +119,13 @@ Decimal StepRange::parseStep(AnyStepHandling anyStepHandling, const StepDescript ...@@ -121,13 +119,13 @@ Decimal StepRange::parseStep(AnyStepHandling anyStepHandling, const StepDescript
break; break;
case ParsedStepValueShouldBeInteger: case ParsedStepValueShouldBeInteger:
// For date, month, and week, the parsed value should be an integer for some types. // For date, month, and week, the parsed value should be an integer for some types.
step = max(step.round(), Decimal(1)); step = std::max(step.round(), Decimal(1));
step *= stepDescription.stepScaleFactor; step *= stepDescription.stepScaleFactor;
break; break;
case ScaledStepValueShouldBeInteger: case ScaledStepValueShouldBeInteger:
// For datetime, datetime-local, time, the result should be an integer. // For datetime, datetime-local, time, the result should be an integer.
step *= stepDescription.stepScaleFactor; step *= stepDescription.stepScaleFactor;
step = max(step.round(), Decimal(1)); step = std::max(step.round(), Decimal(1));
break; break;
default: default:
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
......
...@@ -46,8 +46,6 @@ ...@@ -46,8 +46,6 @@
#include "core/rendering/RenderSlider.h" #include "core/rendering/RenderSlider.h"
#include "core/rendering/RenderTheme.h" #include "core/rendering/RenderTheme.h"
using namespace std;
namespace WebCore { namespace WebCore {
using namespace HTMLNames; using namespace HTMLNames;
...@@ -285,7 +283,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point) ...@@ -285,7 +283,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& point)
position -= isLeftToRightDirection ? renderBox()->marginLeft() : renderBox()->marginRight(); position -= isLeftToRightDirection ? renderBox()->marginLeft() : renderBox()->marginRight();
currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x(); currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin.x();
} }
position = max<LayoutUnit>(0, min(position, trackSize)); position = std::max<LayoutUnit>(0, std::min(position, trackSize));
const Decimal ratio = Decimal::fromDouble(static_cast<double>(position) / trackSize); const Decimal ratio = Decimal::fromDouble(static_cast<double>(position) / trackSize);
const Decimal fraction = isVertical || !isLeftToRightDirection ? Decimal(1) - ratio : ratio; const Decimal fraction = isVertical || !isLeftToRightDirection ? Decimal(1) - ratio : ratio;
StepRange stepRange(input->createStepRange(RejectAny)); StepRange stepRange(input->createStepRange(RejectAny));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment