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

Side by Side Diff: Source/core/html/forms/RangeInputType.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/RangeInputType.h ('k') | Source/core/html/forms/SearchInputType.h » ('j') | 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/core/html/forms/RangeInputType.h ('k') | Source/core/html/forms/SearchInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698