| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 void RangeInputType::valueChanged() | 287 void RangeInputType::valueChanged() |
| 288 { | 288 { |
| 289 sliderThumbElementOf(element())->setPositionFromValue(); | 289 sliderThumbElementOf(element())->setPositionFromValue(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 String RangeInputType::fallbackValue() | 292 String RangeInputType::fallbackValue() |
| 293 { | 293 { |
| 294 return serializeForNumberType(StepRange(element()).defaultValue()); | 294 return serializeForNumberType(StepRange(element()).defaultValue()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 String RangeInputType::sanitizeValue(const String& proposedValue) | 297 String RangeInputType::sanitizeValue(const String& proposedValue) const |
| 298 { | 298 { |
| 299 // If the proposedValue is null than this is a reset scenario and we | |
| 300 // want the range input's value attribute to take priority over the | |
| 301 // calculated default (middle) value. | |
| 302 if (proposedValue.isNull()) | |
| 303 return proposedValue; | |
| 304 | |
| 305 return serializeForNumberType(StepRange(element()).clampValue(proposedValue)
); | 299 return serializeForNumberType(StepRange(element()).clampValue(proposedValue)
); |
| 306 } | 300 } |
| 307 | 301 |
| 308 bool RangeInputType::shouldRespectListAttribute() | 302 bool RangeInputType::shouldRespectListAttribute() |
| 309 { | 303 { |
| 310 return true; | 304 return true; |
| 311 } | 305 } |
| 312 | 306 |
| 313 } // namespace WebCore | 307 } // namespace WebCore |
| OLD | NEW |