| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 return; | 159 return; |
| 160 thumb->dragFrom(event->absoluteLocation()); | 160 thumb->dragFrom(event->absoluteLocation()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void RangeInputType::handleTouchEvent(TouchEvent* event) | 163 void RangeInputType::handleTouchEvent(TouchEvent* event) |
| 164 { | 164 { |
| 165 if (element().isDisabledOrReadOnly()) | 165 if (element().isDisabledOrReadOnly()) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 if (event->type() == EventTypeNames::touchend) { | 168 if (event->type() == EventTypeNames::touchend) { |
| 169 element().dispatchFormControlChangeEvent(); |
| 169 event->setDefaultHandled(); | 170 event->setDefaultHandled(); |
| 170 return; | 171 return; |
| 171 } | 172 } |
| 172 | 173 |
| 173 TouchList* touches = event->targetTouches(); | 174 TouchList* touches = event->targetTouches(); |
| 174 if (touches->length() == 1) { | 175 if (touches->length() == 1) { |
| 175 sliderThumbElement()->setPositionFromPoint(touches->item(0)->absoluteLoc
ation()); | 176 sliderThumbElement()->setPositionFromPoint(touches->item(0)->absoluteLoc
ation()); |
| 176 event->setDefaultHandled(); | 177 event->setDefaultHandled(); |
| 177 } | 178 } |
| 178 } | 179 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 right = middle; | 394 right = middle; |
| 394 } | 395 } |
| 395 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); | 396 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); |
| 396 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); | 397 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); |
| 397 if (closestRight - value < value - closestLeft) | 398 if (closestRight - value < value - closestLeft) |
| 398 return closestRight; | 399 return closestRight; |
| 399 return closestLeft; | 400 return closestLeft; |
| 400 } | 401 } |
| 401 | 402 |
| 402 } // namespace WebCore | 403 } // namespace WebCore |
| OLD | NEW |