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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. Created 6 years, 7 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
« no previous file with comments | « Source/core/html/forms/ColorInputType.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 void RangeInputType::updateTickMarkValues() 347 void RangeInputType::updateTickMarkValues()
348 { 348 {
349 if (!m_tickMarkValuesDirty) 349 if (!m_tickMarkValuesDirty)
350 return; 350 return;
351 m_tickMarkValues.clear(); 351 m_tickMarkValues.clear();
352 m_tickMarkValuesDirty = false; 352 m_tickMarkValuesDirty = false;
353 HTMLDataListElement* dataList = element().dataList(); 353 HTMLDataListElement* dataList = element().dataList();
354 if (!dataList) 354 if (!dataList)
355 return; 355 return;
356 RefPtr<HTMLCollection> options = dataList->options(); 356 RefPtrWillBeRawPtr<HTMLCollection> options = dataList->options();
357 m_tickMarkValues.reserveCapacity(options->length()); 357 m_tickMarkValues.reserveCapacity(options->length());
358 for (unsigned i = 0; i < options->length(); ++i) { 358 for (unsigned i = 0; i < options->length(); ++i) {
359 Element* element = options->item(i); 359 Element* element = options->item(i);
360 HTMLOptionElement* optionElement = toHTMLOptionElement(element); 360 HTMLOptionElement* optionElement = toHTMLOptionElement(element);
361 String optionValue = optionElement->value(); 361 String optionValue = optionElement->value();
362 if (!this->element().isValidValue(optionValue)) 362 if (!this->element().isValidValue(optionValue))
363 continue; 363 continue;
364 m_tickMarkValues.append(parseToNumber(optionValue, Decimal::nan())); 364 m_tickMarkValues.append(parseToNumber(optionValue, Decimal::nan()));
365 } 365 }
366 m_tickMarkValues.shrinkToFit(); 366 m_tickMarkValues.shrinkToFit();
(...skipping 27 matching lines...) Expand all
394 right = middle; 394 right = middle;
395 } 395 }
396 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);
397 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);
398 if (closestRight - value < value - closestLeft) 398 if (closestRight - value < value - closestLeft)
399 return closestRight; 399 return closestRight;
400 return closestLeft; 400 return closestLeft;
401 } 401 }
402 402
403 } // namespace WebCore 403 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/ColorInputType.cpp ('k') | Source/core/inspector/InspectorDOMAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698