OLD | NEW |
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 Loading... |
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 Loading... |
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 } | 402 } |
401 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); | 403 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); |
402 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); | 404 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); |
403 if (closestRight - value < value - closestLeft) | 405 if (closestRight - value < value - closestLeft) |
404 return closestRight; | 406 return closestRight; |
405 return closestLeft; | 407 return closestLeft; |
406 } | 408 } |
407 #endif | 409 #endif |
408 | 410 |
409 } // namespace WebCore | 411 } // namespace WebCore |
OLD | NEW |