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

Side by Side Diff: Source/WebCore/html/RangeInputType.cpp

Issue 11360201: Merge 132983 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 1 month 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/WebCore/html/HTMLInputElement.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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple 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 25 matching lines...) Expand all
36 #include "ElementShadow.h" 36 #include "ElementShadow.h"
37 #include "HTMLDivElement.h" 37 #include "HTMLDivElement.h"
38 #include "HTMLInputElement.h" 38 #include "HTMLInputElement.h"
39 #include "HTMLNames.h" 39 #include "HTMLNames.h"
40 #include "HTMLParserIdioms.h" 40 #include "HTMLParserIdioms.h"
41 #include "InputTypeNames.h" 41 #include "InputTypeNames.h"
42 #include "KeyboardEvent.h" 42 #include "KeyboardEvent.h"
43 #include "MouseEvent.h" 43 #include "MouseEvent.h"
44 #include "PlatformMouseEvent.h" 44 #include "PlatformMouseEvent.h"
45 #include "RenderSlider.h" 45 #include "RenderSlider.h"
46 #include "ScopedEventQueue.h"
46 #include "ShadowRoot.h" 47 #include "ShadowRoot.h"
47 #include "SliderThumbElement.h" 48 #include "SliderThumbElement.h"
48 #include "StepRange.h" 49 #include "StepRange.h"
49 #include <limits> 50 #include <limits>
50 #include <wtf/MathExtras.h> 51 #include <wtf/MathExtras.h>
51 #include <wtf/PassOwnPtr.h> 52 #include <wtf/PassOwnPtr.h>
52 53
53 #if ENABLE(TOUCH_EVENTS) 54 #if ENABLE(TOUCH_EVENTS)
54 #include "Touch.h" 55 #include "Touch.h"
55 #include "TouchEvent.h" 56 #include "TouchEvent.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 else if (key == "Home") 229 else if (key == "Home")
229 newValue = isVertical ? stepRange.maximum() : stepRange.minimum(); 230 newValue = isVertical ? stepRange.maximum() : stepRange.minimum();
230 else if (key == "End") 231 else if (key == "End")
231 newValue = isVertical ? stepRange.minimum() : stepRange.maximum(); 232 newValue = isVertical ? stepRange.minimum() : stepRange.maximum();
232 else 233 else
233 return; // Did not match any key binding. 234 return; // Did not match any key binding.
234 235
235 newValue = stepRange.clampValue(newValue); 236 newValue = stepRange.clampValue(newValue);
236 237
237 if (newValue != current) { 238 if (newValue != current) {
239 EventQueueScope scope;
238 ExceptionCode ec; 240 ExceptionCode ec;
239 TextFieldEventBehavior eventBehavior = DispatchChangeEvent; 241 TextFieldEventBehavior eventBehavior = DispatchChangeEvent;
240 setValueAsDecimal(newValue, eventBehavior, ec); 242 setValueAsDecimal(newValue, eventBehavior, ec);
241 243
242 if (AXObjectCache::accessibilityEnabled()) 244 if (AXObjectCache::accessibilityEnabled())
243 element()->document()->axObjectCache()->postNotification(element(), AXObjectCache::AXValueChanged, true); 245 element()->document()->axObjectCache()->postNotification(element(), AXObjectCache::AXValueChanged, true);
244 element()->dispatchFormControlChangeEvent(); 246 element()->dispatchFormControlChangeEvent();
245 } 247 }
246 248
247 event->setDefaultHandled(); 249 event->setDefaultHandled();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 401 }
400 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal: :infinity(Decimal::Negative); 402 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal: :infinity(Decimal::Negative);
401 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV alues[middle] : Decimal::infinity(Decimal::Positive); 403 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV alues[middle] : Decimal::infinity(Decimal::Positive);
402 if (closestRight - value < value - closestLeft) 404 if (closestRight - value < value - closestLeft)
403 return closestRight; 405 return closestRight;
404 return closestLeft; 406 return closestLeft;
405 } 407 }
406 #endif 408 #endif
407 409
408 } // namespace WebCore 410 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/html/HTMLInputElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698