| 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 868 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
| 869 tickRegionWidth = trackBounds.width() - thumbSize.width(); | 869 tickRegionWidth = trackBounds.width() - thumbSize.width(); |
| 870 } else { | 870 } else { |
| 871 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); | 871 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); |
| 872 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); | 872 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); |
| 873 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom
TrackCenter() * zoomFactor)); | 873 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom
TrackCenter() * zoomFactor)); |
| 874 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 874 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
| 875 tickRegionWidth = trackBounds.height() - thumbSize.width(); | 875 tickRegionWidth = trackBounds.height() - thumbSize.width(); |
| 876 } | 876 } |
| 877 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->option
s(); | 877 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->option
s(); |
| 878 GraphicsContextStateSaver stateSaver(*paintInfo.context); | |
| 879 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor)); | |
| 880 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i+
+) { | 878 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i+
+) { |
| 881 String value = optionElement->value(); | 879 String value = optionElement->value(); |
| 882 if (!input->isValidValue(value)) | 880 if (!input->isValidValue(value)) |
| 883 continue; | 881 continue; |
| 884 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); | 882 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); |
| 885 double tickFraction = (parsedValue - min) / (max - min); | 883 double tickFraction = (parsedValue - min) / (max - min); |
| 886 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; | 884 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; |
| 887 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); | 885 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); |
| 888 if (isHorizontal) | 886 if (isHorizontal) |
| 889 tickRect.setX(tickPosition); | 887 tickRect.setX(tickPosition); |
| 890 else | 888 else |
| 891 tickRect.setY(tickPosition); | 889 tickRect.setY(tickPosition); |
| 892 paintInfo.context->fillRect(tickRect); | 890 paintInfo.context->fillRect(tickRect, o->resolveColor(CSSPropertyColor))
; |
| 893 } | 891 } |
| 894 } | 892 } |
| 895 | 893 |
| 896 double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress*) const | 894 double RenderTheme::animationRepeatIntervalForProgressBar(RenderProgress*) const |
| 897 { | 895 { |
| 898 return 0; | 896 return 0; |
| 899 } | 897 } |
| 900 | 898 |
| 901 double RenderTheme::animationDurationForProgressBar(RenderProgress*) const | 899 double RenderTheme::animationDurationForProgressBar(RenderProgress*) const |
| 902 { | 900 { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 | 1199 |
| 1202 // padding - not honored by WinIE, needs to be removed. | 1200 // padding - not honored by WinIE, needs to be removed. |
| 1203 style->resetPadding(); | 1201 style->resetPadding(); |
| 1204 | 1202 |
| 1205 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1203 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 1206 // for now, we will not honor it. | 1204 // for now, we will not honor it. |
| 1207 style->resetBorder(); | 1205 style->resetBorder(); |
| 1208 } | 1206 } |
| 1209 | 1207 |
| 1210 } // namespace blink | 1208 } // namespace blink |
| OLD | NEW |