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

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

Issue 1025213002: Begin tracking why layout is invalidated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 inline Element* RangeInputType::sliderTrackElement() const 320 inline Element* RangeInputType::sliderTrackElement() const
321 { 321 {
322 return element().closedShadowRoot()->getElementById(ShadowElementNames::slid erTrack()); 322 return element().closedShadowRoot()->getElementById(ShadowElementNames::slid erTrack());
323 } 323 }
324 324
325 void RangeInputType::listAttributeTargetChanged() 325 void RangeInputType::listAttributeTargetChanged()
326 { 326 {
327 m_tickMarkValuesDirty = true; 327 m_tickMarkValuesDirty = true;
328 Element* sliderTrackElement = this->sliderTrackElement(); 328 Element* sliderTrackElement = this->sliderTrackElement();
329 if (sliderTrackElement->layoutObject()) 329 if (sliderTrackElement->layoutObject())
330 sliderTrackElement->layoutObject()->setNeedsLayoutAndFullPaintInvalidati on(); 330 sliderTrackElement->layoutObject()->setNeedsLayoutAndFullPaintInvalidati on(LayoutInvalidationReason::AttributeChanged);
331 } 331 }
332 332
333 static bool decimalCompare(const Decimal& a, const Decimal& b) 333 static bool decimalCompare(const Decimal& a, const Decimal& b)
334 { 334 {
335 return a < b; 335 return a < b;
336 } 336 }
337 337
338 void RangeInputType::updateTickMarkValues() 338 void RangeInputType::updateTickMarkValues()
339 { 339 {
340 if (!m_tickMarkValuesDirty) 340 if (!m_tickMarkValuesDirty)
(...skipping 43 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/NumberInputType.cpp ('k') | Source/core/html/shadow/SliderThumbElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698