| 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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 if (!node || !node->active() || !node->isElementNode() | 799 if (!node || !node->active() || !node->isElementNode() |
| 799 || !toElement(node)->isSpinButtonElement()) | 800 || !toElement(node)->isSpinButtonElement()) |
| 800 return false; | 801 return false; |
| 801 SpinButtonElement* element = toSpinButtonElement(node); | 802 SpinButtonElement* element = toSpinButtonElement(node); |
| 802 return element->upDownState() == SpinButtonElement::Up; | 803 return element->upDownState() == SpinButtonElement::Up; |
| 803 } | 804 } |
| 804 | 805 |
| 805 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const | 806 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const |
| 806 { | 807 { |
| 807 Node* node = o->node(); | 808 Node* node = o->node(); |
| 808 if (!node || !node->isElementNode()) | 809 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) |
| 809 return false; | 810 return false; |
| 810 return toElement(node)->matchesReadOnlyPseudoClass(); | 811 HTMLFormControlElement* element = toHTMLFormControlElement(node); |
| 812 return element->isReadOnly(); |
| 811 } | 813 } |
| 812 | 814 |
| 813 bool RenderTheme::isHovered(const RenderObject* o) const | 815 bool RenderTheme::isHovered(const RenderObject* o) const |
| 814 { | 816 { |
| 815 Node* node = o->node(); | 817 Node* node = o->node(); |
| 816 if (!node) | 818 if (!node) |
| 817 return false; | 819 return false; |
| 818 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) | 820 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) |
| 819 return node->hovered(); | 821 return node->hovered(); |
| 820 SpinButtonElement* element = toSpinButtonElement(node); | 822 SpinButtonElement* element = toSpinButtonElement(node); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 | 1313 |
| 1312 // padding - not honored by WinIE, needs to be removed. | 1314 // padding - not honored by WinIE, needs to be removed. |
| 1313 style->resetPadding(); | 1315 style->resetPadding(); |
| 1314 | 1316 |
| 1315 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1317 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
| 1316 // for now, we will not honor it. | 1318 // for now, we will not honor it. |
| 1317 style->resetBorder(); | 1319 style->resetBorder(); |
| 1318 } | 1320 } |
| 1319 | 1321 |
| 1320 } // namespace WebCore | 1322 } // namespace WebCore |
| OLD | NEW |