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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 Document& document = element().document(); | 237 Document& document = element().document(); |
238 RefPtrWillBeRawPtr<HTMLDivElement> track = HTMLDivElement::create(document); | 238 RefPtrWillBeRawPtr<HTMLDivElement> track = HTMLDivElement::create(document); |
239 track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track", Atomi
cString::ConstructFromLiteral)); | 239 track->setShadowPseudoId(AtomicString("-webkit-slider-runnable-track", Atomi
cString::ConstructFromLiteral)); |
240 track->setAttribute(idAttr, ShadowElementNames::sliderTrack()); | 240 track->setAttribute(idAttr, ShadowElementNames::sliderTrack()); |
241 track->appendChild(SliderThumbElement::create(document)); | 241 track->appendChild(SliderThumbElement::create(document)); |
242 RefPtrWillBeRawPtr<HTMLElement> container = SliderContainerElement::create(d
ocument); | 242 RefPtrWillBeRawPtr<HTMLElement> container = SliderContainerElement::create(d
ocument); |
243 container->appendChild(track.release()); | 243 container->appendChild(track.release()); |
244 element().closedShadowRoot()->appendChild(container.release()); | 244 element().closedShadowRoot()->appendChild(container.release()); |
245 } | 245 } |
246 | 246 |
247 LayoutObject* RangeInputType::createLayoutObject(const LayoutStyle&) const | 247 LayoutObject* RangeInputType::createLayoutObject(const ComputedStyle&) const |
248 { | 248 { |
249 return new LayoutSlider(&element()); | 249 return new LayoutSlider(&element()); |
250 } | 250 } |
251 | 251 |
252 Decimal RangeInputType::parseToNumber(const String& src, const Decimal& defaultV
alue) const | 252 Decimal RangeInputType::parseToNumber(const String& src, const Decimal& defaultV
alue) const |
253 { | 253 { |
254 return parseToDecimalForNumberType(src, defaultValue); | 254 return parseToDecimalForNumberType(src, defaultValue); |
255 } | 255 } |
256 | 256 |
257 String RangeInputType::serialize(const Decimal& value) const | 257 String RangeInputType::serialize(const Decimal& value) const |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 right = middle; | 384 right = middle; |
385 } | 385 } |
386 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); | 386 const Decimal closestLeft = middle ? m_tickMarkValues[middle - 1] : Decimal:
:infinity(Decimal::Negative); |
387 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); | 387 const Decimal closestRight = middle != m_tickMarkValues.size() ? m_tickMarkV
alues[middle] : Decimal::infinity(Decimal::Positive); |
388 if (closestRight - value < value - closestLeft) | 388 if (closestRight - value < value - closestLeft) |
389 return closestRight; | 389 return closestRight; |
390 return closestLeft; | 390 return closestLeft; |
391 } | 391 } |
392 | 392 |
393 } // namespace blink | 393 } // namespace blink |
OLD | NEW |