| 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 14 matching lines...) Expand all Loading... |
| 25 #include "core/CSSValueKeywords.h" | 25 #include "core/CSSValueKeywords.h" |
| 26 #include "core/HTMLNames.h" | 26 #include "core/HTMLNames.h" |
| 27 #include "core/InputTypeNames.h" | 27 #include "core/InputTypeNames.h" |
| 28 #include "core/dom/Document.h" | 28 #include "core/dom/Document.h" |
| 29 #include "core/dom/shadow/ElementShadow.h" | 29 #include "core/dom/shadow/ElementShadow.h" |
| 30 #include "core/editing/FrameSelection.h" | 30 #include "core/editing/FrameSelection.h" |
| 31 #include "core/fileapi/FileList.h" | 31 #include "core/fileapi/FileList.h" |
| 32 #include "core/frame/LocalFrame.h" | 32 #include "core/frame/LocalFrame.h" |
| 33 #include "core/html/HTMLCollection.h" | 33 #include "core/html/HTMLCollection.h" |
| 34 #include "core/html/HTMLDataListElement.h" | 34 #include "core/html/HTMLDataListElement.h" |
| 35 #include "core/html/HTMLDataListOptionsCollection.h" |
| 35 #include "core/html/HTMLFormControlElement.h" | 36 #include "core/html/HTMLFormControlElement.h" |
| 36 #include "core/html/HTMLInputElement.h" | 37 #include "core/html/HTMLInputElement.h" |
| 37 #include "core/html/HTMLMeterElement.h" | 38 #include "core/html/HTMLMeterElement.h" |
| 38 #include "core/html/HTMLOptionElement.h" | 39 #include "core/html/HTMLOptionElement.h" |
| 39 #include "core/html/parser/HTMLParserIdioms.h" | 40 #include "core/html/parser/HTMLParserIdioms.h" |
| 40 #include "core/html/shadow/MediaControlElements.h" | 41 #include "core/html/shadow/MediaControlElements.h" |
| 41 #include "core/html/shadow/ShadowElementNames.h" | 42 #include "core/html/shadow/ShadowElementNames.h" |
| 42 #include "core/html/shadow/SpinButtonElement.h" | 43 #include "core/html/shadow/SpinButtonElement.h" |
| 43 #include "core/html/shadow/TextControlInnerElements.h" | 44 #include "core/html/shadow/TextControlInnerElements.h" |
| 44 #include "core/page/FocusController.h" | 45 #include "core/page/FocusController.h" |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 tickRect.setY(floor(rect.y() + rect.height() / 2.0 + sliderTickOffsetFro
mTrackCenter() * zoomFactor)); | 871 tickRect.setY(floor(rect.y() + rect.height() / 2.0 + sliderTickOffsetFro
mTrackCenter() * zoomFactor)); |
| 871 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 872 tickRegionSideMargin = trackBounds.x() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
| 872 tickRegionWidth = trackBounds.width() - thumbSize.width(); | 873 tickRegionWidth = trackBounds.width() - thumbSize.width(); |
| 873 } else { | 874 } else { |
| 874 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); | 875 tickRect.setWidth(floor(tickSize.height() * zoomFactor)); |
| 875 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); | 876 tickRect.setHeight(floor(tickSize.width() * zoomFactor)); |
| 876 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom
TrackCenter() * zoomFactor)); | 877 tickRect.setX(floor(rect.x() + rect.width() / 2.0 + sliderTickOffsetFrom
TrackCenter() * zoomFactor)); |
| 877 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; | 878 tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.w
idth() * zoomFactor) / 2.0; |
| 878 tickRegionWidth = trackBounds.height() - thumbSize.width(); | 879 tickRegionWidth = trackBounds.height() - thumbSize.width(); |
| 879 } | 880 } |
| 880 RefPtrWillBeRawPtr<HTMLCollection> options = dataList->options(); | 881 RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->option
s(); |
| 881 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 882 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| 882 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor)); | 883 paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor)); |
| 883 for (unsigned i = 0; Element* element = options->item(i); i++) { | 884 for (unsigned i = 0; HTMLOptionElement* optionElement = options->item(i); i+
+) { |
| 884 ASSERT(isHTMLOptionElement(*element)); | 885 String value = optionElement->value(); |
| 885 HTMLOptionElement& optionElement = toHTMLOptionElement(*element); | |
| 886 String value = optionElement.value(); | |
| 887 if (!input->isValidValue(value)) | 886 if (!input->isValidValue(value)) |
| 888 continue; | 887 continue; |
| 889 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); | 888 double parsedValue = parseToDoubleForNumberType(input->sanitizeValue(val
ue)); |
| 890 double tickFraction = (parsedValue - min) / (max - min); | 889 double tickFraction = (parsedValue - min) / (max - min); |
| 891 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; | 890 double tickRatio = isHorizontal && o->style()->isLeftToRightDirection()
? tickFraction : 1.0 - tickFraction; |
| 892 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); | 891 double tickPosition = round(tickRegionSideMargin + tickRegionWidth * tic
kRatio); |
| 893 if (isHorizontal) | 892 if (isHorizontal) |
| 894 tickRect.setX(tickPosition); | 893 tickRect.setX(tickPosition); |
| 895 else | 894 else |
| 896 tickRect.setY(tickPosition); | 895 tickRect.setY(tickPosition); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 | 1205 |
| 1207 // padding - not honored by WinIE, needs to be removed. | 1206 // padding - not honored by WinIE, needs to be removed. |
| 1208 style->resetPadding(); | 1207 style->resetPadding(); |
| 1209 | 1208 |
| 1210 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1209 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 1211 // for now, we will not honor it. | 1210 // for now, we will not honor it. |
| 1212 style->resetBorder(); | 1211 style->resetBorder(); |
| 1213 } | 1212 } |
| 1214 | 1213 |
| 1215 } // namespace blink | 1214 } // namespace blink |
| OLD | NEW |