| 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 "CSSValueKeywords.h" | 25 #include "CSSValueKeywords.h" |
| 26 #include "HTMLNames.h" | 26 #include "HTMLNames.h" |
| 27 #include "InputTypeNames.h" | 27 #include "InputTypeNames.h" |
| 28 #include "RuntimeEnabledFeatures.h" | 28 #include "RuntimeEnabledFeatures.h" |
| 29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
| 30 #include "core/dom/shadow/ElementShadow.h" | 30 #include "core/dom/shadow/ElementShadow.h" |
| 31 #include "core/editing/FrameSelection.h" | 31 #include "core/editing/FrameSelection.h" |
| 32 #include "core/fileapi/FileList.h" | 32 #include "core/fileapi/FileList.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/HTMLFormControlElement.h" |
| 35 #include "core/html/HTMLInputElement.h" | 36 #include "core/html/HTMLInputElement.h" |
| 36 #include "core/html/HTMLMeterElement.h" | 37 #include "core/html/HTMLMeterElement.h" |
| 37 #include "core/html/HTMLOptionElement.h" | 38 #include "core/html/HTMLOptionElement.h" |
| 38 #include "core/html/parser/HTMLParserIdioms.h" | 39 #include "core/html/parser/HTMLParserIdioms.h" |
| 39 #include "core/html/shadow/MediaControlElements.h" | 40 #include "core/html/shadow/MediaControlElements.h" |
| 40 #include "core/html/shadow/ShadowElementNames.h" | 41 #include "core/html/shadow/ShadowElementNames.h" |
| 41 #include "core/html/shadow/SpinButtonElement.h" | 42 #include "core/html/shadow/SpinButtonElement.h" |
| 42 #include "core/html/shadow/TextControlInnerElements.h" | 43 #include "core/html/shadow/TextControlInnerElements.h" |
| 43 #include "core/page/FocusController.h" | 44 #include "core/page/FocusController.h" |
| 44 #include "core/frame/Frame.h" | 45 #include "core/frame/Frame.h" |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 if (!node || !node->active() || !node->isElementNode() | 763 if (!node || !node->active() || !node->isElementNode() |
| 763 || !toElement(node)->isSpinButtonElement()) | 764 || !toElement(node)->isSpinButtonElement()) |
| 764 return false; | 765 return false; |
| 765 SpinButtonElement* element = toSpinButtonElement(node); | 766 SpinButtonElement* element = toSpinButtonElement(node); |
| 766 return element->upDownState() == SpinButtonElement::Up; | 767 return element->upDownState() == SpinButtonElement::Up; |
| 767 } | 768 } |
| 768 | 769 |
| 769 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const | 770 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const |
| 770 { | 771 { |
| 771 Node* node = o->node(); | 772 Node* node = o->node(); |
| 772 if (!node || !node->isElementNode()) | 773 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) |
| 773 return false; | 774 return false; |
| 774 return toElement(node)->matchesReadOnlyPseudoClass(); | 775 HTMLFormControlElement* element = toHTMLFormControlElement(node); |
| 776 return element->isReadOnly(); |
| 775 } | 777 } |
| 776 | 778 |
| 777 bool RenderTheme::isHovered(const RenderObject* o) const | 779 bool RenderTheme::isHovered(const RenderObject* o) const |
| 778 { | 780 { |
| 779 Node* node = o->node(); | 781 Node* node = o->node(); |
| 780 if (!node) | 782 if (!node) |
| 781 return false; | 783 return false; |
| 782 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) | 784 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) |
| 783 return node->hovered(); | 785 return node->hovered(); |
| 784 SpinButtonElement* element = toSpinButtonElement(node); | 786 SpinButtonElement* element = toSpinButtonElement(node); |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 | 1269 |
| 1268 // padding - not honored by WinIE, needs to be removed. | 1270 // padding - not honored by WinIE, needs to be removed. |
| 1269 style->resetPadding(); | 1271 style->resetPadding(); |
| 1270 | 1272 |
| 1271 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1273 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 1272 // for now, we will not honor it. | 1274 // for now, we will not honor it. |
| 1273 style->resetBorder(); | 1275 style->resetBorder(); |
| 1274 } | 1276 } |
| 1275 | 1277 |
| 1276 } // namespace WebCore | 1278 } // namespace WebCore |
| OLD | NEW |