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

Side by Side Diff: third_party/WebKit/Source/core/paint/ThemePainter.cpp

Issue 2746823002: Correct elementMatches filter for datalist.options (Closed)
Patch Set: Remove superfluous test, added filter to callees. Created 3 years, 9 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 | « third_party/WebKit/Source/core/html/forms/RangeInputType.cpp ('k') | no next file » | 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 * This file is part of the theme implementation for form controls in WebCore. 2 * This file is part of the theme implementation for form controls in WebCore.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 zoomFactor)); 320 zoomFactor));
321 tickRegionSideMargin = 321 tickRegionSideMargin =
322 trackBounds.y() + 322 trackBounds.y() +
323 (thumbSize.width() - tickSize.width() * zoomFactor) / 2.0; 323 (thumbSize.width() - tickSize.width() * zoomFactor) / 2.0;
324 tickRegionWidth = trackBounds.height() - thumbSize.width(); 324 tickRegionWidth = trackBounds.height() - thumbSize.width();
325 } 325 }
326 HTMLDataListOptionsCollection* options = dataList->options(); 326 HTMLDataListOptionsCollection* options = dataList->options();
327 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); 327 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i);
328 i++) { 328 i++) {
329 String value = optionElement->value(); 329 String value = optionElement->value();
330 if (optionElement->isDisabledFormControl() || value.isEmpty())
331 continue;
330 if (!input->isValidValue(value)) 332 if (!input->isValidValue(value))
331 continue; 333 continue;
332 double parsedValue = 334 double parsedValue =
333 parseToDoubleForNumberType(input->sanitizeValue(value)); 335 parseToDoubleForNumberType(input->sanitizeValue(value));
334 double tickFraction = (parsedValue - min) / (max - min); 336 double tickFraction = (parsedValue - min) / (max - min);
335 double tickRatio = isHorizontal && o.styleRef().isLeftToRightDirection() 337 double tickRatio = isHorizontal && o.styleRef().isLeftToRightDirection()
336 ? tickFraction 338 ? tickFraction
337 : 1.0 - tickFraction; 339 : 1.0 - tickFraction;
338 double tickPosition = 340 double tickPosition =
339 round(tickRegionSideMargin + tickRegionWidth * tickRatio); 341 round(tickRegionSideMargin + tickRegionWidth * tickRatio);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y()); 406 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y());
405 } 407 }
406 408
407 Platform::current()->fallbackThemeEngine()->paint( 409 Platform::current()->fallbackThemeEngine()->paint(
408 canvas, WebFallbackThemeEngine::PartRadio, getWebFallbackThemeState(o), 410 canvas, WebFallbackThemeEngine::PartRadio, getWebFallbackThemeState(o),
409 WebRect(unzoomedRect), &extraParams); 411 WebRect(unzoomedRect), &extraParams);
410 return false; 412 return false;
411 } 413 }
412 414
413 } // namespace blink 415 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/forms/RangeInputType.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698