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 15 matching lines...) Expand all Loading... |
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/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
34 #include "core/html/HTMLCollection.h" | 34 #include "core/html/HTMLCollection.h" |
35 #include "core/html/HTMLDataListElement.h" | 35 #include "core/html/HTMLDataListElement.h" |
36 #include "core/html/HTMLFormControlElement.h" | |
37 #include "core/html/HTMLInputElement.h" | 36 #include "core/html/HTMLInputElement.h" |
38 #include "core/html/HTMLMeterElement.h" | 37 #include "core/html/HTMLMeterElement.h" |
39 #include "core/html/HTMLOptionElement.h" | 38 #include "core/html/HTMLOptionElement.h" |
40 #include "core/html/parser/HTMLParserIdioms.h" | 39 #include "core/html/parser/HTMLParserIdioms.h" |
41 #include "core/html/shadow/MediaControlElements.h" | 40 #include "core/html/shadow/MediaControlElements.h" |
42 #include "core/html/shadow/ShadowElementNames.h" | 41 #include "core/html/shadow/ShadowElementNames.h" |
43 #include "core/html/shadow/SpinButtonElement.h" | 42 #include "core/html/shadow/SpinButtonElement.h" |
44 #include "core/html/shadow/TextControlInnerElements.h" | 43 #include "core/html/shadow/TextControlInnerElements.h" |
45 #include "core/page/FocusController.h" | 44 #include "core/page/FocusController.h" |
46 #include "core/page/Page.h" | 45 #include "core/page/Page.h" |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 if (!node || !node->active() || !node->isElementNode() | 755 if (!node || !node->active() || !node->isElementNode() |
757 || !toElement(node)->isSpinButtonElement()) | 756 || !toElement(node)->isSpinButtonElement()) |
758 return false; | 757 return false; |
759 SpinButtonElement* element = toSpinButtonElement(node); | 758 SpinButtonElement* element = toSpinButtonElement(node); |
760 return element->upDownState() == SpinButtonElement::Up; | 759 return element->upDownState() == SpinButtonElement::Up; |
761 } | 760 } |
762 | 761 |
763 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const | 762 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const |
764 { | 763 { |
765 Node* node = o->node(); | 764 Node* node = o->node(); |
766 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen
t()) | 765 if (!node || !node->isElementNode()) |
767 return false; | 766 return false; |
768 HTMLFormControlElement* element = toHTMLFormControlElement(node); | 767 return toElement(node)->matchesReadOnlyPseudoClass(); |
769 return element->isReadOnly(); | |
770 } | 768 } |
771 | 769 |
772 bool RenderTheme::isHovered(const RenderObject* o) const | 770 bool RenderTheme::isHovered(const RenderObject* o) const |
773 { | 771 { |
774 Node* node = o->node(); | 772 Node* node = o->node(); |
775 if (!node) | 773 if (!node) |
776 return false; | 774 return false; |
777 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) | 775 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) |
778 return node->hovered(); | 776 return node->hovered(); |
779 SpinButtonElement* element = toSpinButtonElement(node); | 777 SpinButtonElement* element = toSpinButtonElement(node); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 | 1249 |
1252 // padding - not honored by WinIE, needs to be removed. | 1250 // padding - not honored by WinIE, needs to be removed. |
1253 style->resetPadding(); | 1251 style->resetPadding(); |
1254 | 1252 |
1255 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) | 1253 // border - honored by WinIE, but looks terrible (just paints in the control
box and turns off the Windows XP theme) |
1256 // for now, we will not honor it. | 1254 // for now, we will not honor it. |
1257 style->resetBorder(); | 1255 style->resetBorder(); |
1258 } | 1256 } |
1259 | 1257 |
1260 } // namespace WebCore | 1258 } // namespace WebCore |
OLD | NEW |