| 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 if (!node || !node->active() || !node->isElementNode() | 768 if (!node || !node->active() || !node->isElementNode() |
| 768 || !toElement(node)->isSpinButtonElement()) | 769 || !toElement(node)->isSpinButtonElement()) |
| 769 return false; | 770 return false; |
| 770 SpinButtonElement* element = toSpinButtonElement(node); | 771 SpinButtonElement* element = toSpinButtonElement(node); |
| 771 return element->upDownState() == SpinButtonElement::Up; | 772 return element->upDownState() == SpinButtonElement::Up; |
| 772 } | 773 } |
| 773 | 774 |
| 774 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const | 775 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const |
| 775 { | 776 { |
| 776 Node* node = o->node(); | 777 Node* node = o->node(); |
| 777 if (!node || !node->isElementNode()) | 778 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) |
| 778 return false; | 779 return false; |
| 779 return toElement(node)->matchesReadOnlyPseudoClass(); | 780 HTMLFormControlElement* element = toHTMLFormControlElement(node); |
| 781 return element->isReadOnly(); |
| 780 } | 782 } |
| 781 | 783 |
| 782 bool RenderTheme::isHovered(const RenderObject* o) const | 784 bool RenderTheme::isHovered(const RenderObject* o) const |
| 783 { | 785 { |
| 784 Node* node = o->node(); | 786 Node* node = o->node(); |
| 785 if (!node) | 787 if (!node) |
| 786 return false; | 788 return false; |
| 787 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) | 789 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) |
| 788 return node->hovered(); | 790 return node->hovered(); |
| 789 SpinButtonElement* element = toSpinButtonElement(node); | 791 SpinButtonElement* element = toSpinButtonElement(node); |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 | 1274 |
| 1273 // padding - not honored by WinIE, needs to be removed. | 1275 // padding - not honored by WinIE, needs to be removed. |
| 1274 style->resetPadding(); | 1276 style->resetPadding(); |
| 1275 | 1277 |
| 1276 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1278 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 1277 // for now, we will not honor it. | 1279 // for now, we will not honor it. |
| 1278 style->resetBorder(); | 1280 style->resetBorder(); |
| 1279 } | 1281 } |
| 1280 | 1282 |
| 1281 } // namespace WebCore | 1283 } // namespace WebCore |
| OLD | NEW |