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

Side by Side Diff: Source/core/html/shadow/SliderThumbElement.cpp

Issue 334593005: Removing using declarations that import names in the C++ Standard library. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/forms/StepRange.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 28 matching lines...) Expand all
39 #include "core/frame/LocalFrame.h" 39 #include "core/frame/LocalFrame.h"
40 #include "core/html/HTMLInputElement.h" 40 #include "core/html/HTMLInputElement.h"
41 #include "core/html/forms/StepRange.h" 41 #include "core/html/forms/StepRange.h"
42 #include "core/html/parser/HTMLParserIdioms.h" 42 #include "core/html/parser/HTMLParserIdioms.h"
43 #include "core/html/shadow/ShadowElementNames.h" 43 #include "core/html/shadow/ShadowElementNames.h"
44 #include "core/page/EventHandler.h" 44 #include "core/page/EventHandler.h"
45 #include "core/rendering/RenderFlexibleBox.h" 45 #include "core/rendering/RenderFlexibleBox.h"
46 #include "core/rendering/RenderSlider.h" 46 #include "core/rendering/RenderSlider.h"
47 #include "core/rendering/RenderTheme.h" 47 #include "core/rendering/RenderTheme.h"
48 48
49 using namespace std;
50
51 namespace WebCore { 49 namespace WebCore {
52 50
53 using namespace HTMLNames; 51 using namespace HTMLNames;
54 52
55 inline static Decimal sliderPosition(HTMLInputElement* element) 53 inline static Decimal sliderPosition(HTMLInputElement* element)
56 { 54 {
57 const StepRange stepRange(element->createStepRange(RejectAny)); 55 const StepRange stepRange(element->createStepRange(RejectAny));
58 const Decimal oldValue = parseToDecimalForNumberType(element->value(), stepR ange.defaultValue()); 56 const Decimal oldValue = parseToDecimalForNumberType(element->value(), stepR ange.defaultValue());
59 return stepRange.proportionFromValue(stepRange.clampValue(oldValue)); 57 return stepRange.proportionFromValue(stepRange.clampValue(oldValue));
60 } 58 }
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 if (isVertical) { 276 if (isVertical) {
279 trackSize = trackElement->renderBox()->contentHeight() - renderBox()->he ight(); 277 trackSize = trackElement->renderBox()->contentHeight() - renderBox()->he ight();
280 position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y() - renderBox()->marginBottom(); 278 position = offset.y() - renderBox()->height() / 2 - trackBoundingBox.y() + inputBoundingBox.y() - renderBox()->marginBottom();
281 currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin. y(); 279 currentPosition = absoluteThumbOrigin.y() - absoluteSliderContentOrigin. y();
282 } else { 280 } else {
283 trackSize = trackElement->renderBox()->contentWidth() - renderBox()->wid th(); 281 trackSize = trackElement->renderBox()->contentWidth() - renderBox()->wid th();
284 position = offset.x() - renderBox()->width() / 2 - trackBoundingBox.x() + inputBoundingBox.x(); 282 position = offset.x() - renderBox()->width() / 2 - trackBoundingBox.x() + inputBoundingBox.x();
285 position -= isLeftToRightDirection ? renderBox()->marginLeft() : renderB ox()->marginRight(); 283 position -= isLeftToRightDirection ? renderBox()->marginLeft() : renderB ox()->marginRight();
286 currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin. x(); 284 currentPosition = absoluteThumbOrigin.x() - absoluteSliderContentOrigin. x();
287 } 285 }
288 position = max<LayoutUnit>(0, min(position, trackSize)); 286 position = std::max<LayoutUnit>(0, std::min(position, trackSize));
289 const Decimal ratio = Decimal::fromDouble(static_cast<double>(position) / tr ackSize); 287 const Decimal ratio = Decimal::fromDouble(static_cast<double>(position) / tr ackSize);
290 const Decimal fraction = isVertical || !isLeftToRightDirection ? Decimal(1) - ratio : ratio; 288 const Decimal fraction = isVertical || !isLeftToRightDirection ? Decimal(1) - ratio : ratio;
291 StepRange stepRange(input->createStepRange(RejectAny)); 289 StepRange stepRange(input->createStepRange(RejectAny));
292 Decimal value = stepRange.clampValue(stepRange.valueFromProportion(fraction) ); 290 Decimal value = stepRange.clampValue(stepRange.valueFromProportion(fraction) );
293 291
294 Decimal closest = input->findClosestTickMarkValue(value); 292 Decimal closest = input->findClosestTickMarkValue(value);
295 if (closest.isFinite()) { 293 if (closest.isFinite()) {
296 double closestFraction = stepRange.proportionFromValue(closest).toDouble (); 294 double closestFraction = stepRange.proportionFromValue(closest).toDouble ();
297 double closestRatio = isVertical || !isLeftToRightDirection ? 1.0 - clos estFraction : closestFraction; 295 double closestRatio = isVertical || !isLeftToRightDirection ? 1.0 - clos estFraction : closestFraction;
298 LayoutUnit closestPosition = trackSize * closestRatio; 296 LayoutUnit closestPosition = trackSize * closestRatio;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 case MediaVolumeSliderThumbPart: 465 case MediaVolumeSliderThumbPart:
468 case MediaFullScreenVolumeSliderPart: 466 case MediaFullScreenVolumeSliderPart:
469 case MediaFullScreenVolumeSliderThumbPart: 467 case MediaFullScreenVolumeSliderThumbPart:
470 return mediaSliderContainer; 468 return mediaSliderContainer;
471 default: 469 default:
472 return sliderContainer; 470 return sliderContainer;
473 } 471 }
474 } 472 }
475 473
476 } 474 }
OLDNEW
« no previous file with comments | « Source/core/html/forms/StepRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698