OLD | NEW |
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 tickRect.setY(floor(rect.y() + rect.height() / 2.0 + LayoutTheme::theme(
).sliderTickOffsetFromTrackCenter() * zoomFactor)); | 275 tickRect.setY(floor(rect.y() + rect.height() / 2.0 + LayoutTheme::theme(
).sliderTickOffsetFromTrackCenter() * zoomFactor)); |
276 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 276 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
277 tickRegionWidth = trackBounds.width() - thumbSize.width(); | 277 tickRegionWidth = trackBounds.width() - thumbSize.width(); |
278 } else { | 278 } else { |
279 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); | 279 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); |
280 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); | 280 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); |
281 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + LayoutTheme::theme()
.sliderTickOffsetFromTrackCenter() * zoomFactor)); | 281 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + LayoutTheme::theme()
.sliderTickOffsetFromTrackCenter() * zoomFactor)); |
282 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 282 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
283 tickRegionWidth = trackBounds.height() - thumbSize.width(); | 283 tickRegionWidth = trackBounds.height() - thumbSize.width(); |
284 } | 284 } |
285 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->option
s(); | 285 RawPtr<HTMLDataListOptionsCollection> options = dataList->options(); |
286 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i+
+) { | 286 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i+
+) { |
287 String value = optionElement->value(); | 287 String value = optionElement->value(); |
288 if (!input->isValidValue(value)) | 288 if (!input->isValidValue(value)) |
289 continue; | 289 continue; |
290 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); | 290 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); |
291 double tickFraction = (parsedValue - min) / (max - min); | 291 double tickFraction = (parsedValue - min) / (max - min); |
292 double tickRatio = isHorizontal && o.styleRef().isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; | 292 double tickRatio = isHorizontal && o.styleRef().isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; |
293 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); | 293 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); |
294 if (isHorizontal) | 294 if (isHorizontal) |
295 tickRect.setX(tickPosition); | 295 tickRect.setX(tickPosition); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 i.context.translate(unzoomedRect.x(), unzoomedRect.y()); | 351 i.context.translate(unzoomedRect.x(), unzoomedRect.y()); |
352 i.context.scale(zoomLevel, zoomLevel); | 352 i.context.scale(zoomLevel, zoomLevel); |
353 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y()); | 353 i.context.translate(-unzoomedRect.x(), -unzoomedRect.y()); |
354 } | 354 } |
355 | 355 |
356 Platform::current()->fallbackThemeEngine()->paint(canvas, WebFallbackThemeEn
gine::PartRadio, getWebFallbackThemeState(o), WebRect(unzoomedRect), &extraParam
s); | 356 Platform::current()->fallbackThemeEngine()->paint(canvas, WebFallbackThemeEn
gine::PartRadio, getWebFallbackThemeState(o), WebRect(unzoomedRect), &extraParam
s); |
357 return false; | 357 return false; |
358 } | 358 } |
359 | 359 |
360 } // namespace blink | 360 } // namespace blink |
OLD | NEW |