Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: Source/core/rendering/RenderTheme.cpp

Issue 236753004: Re-land "Improve support for :read-only and :read-write pseudoclasses". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
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"
45 #include "core/page/Page.h" 46 #include "core/page/Page.h"
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 if (!node || !node->active() || !node->isElementNode() 756 if (!node || !node->active() || !node->isElementNode()
756 || !toElement(node)->isSpinButtonElement()) 757 || !toElement(node)->isSpinButtonElement())
757 return false; 758 return false;
758 SpinButtonElement* element = toSpinButtonElement(node); 759 SpinButtonElement* element = toSpinButtonElement(node);
759 return element->upDownState() == SpinButtonElement::Up; 760 return element->upDownState() == SpinButtonElement::Up;
760 } 761 }
761 762
762 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const 763 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
763 { 764 {
764 Node* node = o->node(); 765 Node* node = o->node();
765 if (!node || !node->isElementNode()) 766 if (!node || !node->isElementNode() || !toElement(node)->isFormControlElemen t())
766 return false; 767 return false;
767 return toElement(node)->matchesReadOnlyPseudoClass(); 768 HTMLFormControlElement* element = toHTMLFormControlElement(node);
769 return element->isReadOnly();
768 } 770 }
769 771
770 bool RenderTheme::isHovered(const RenderObject* o) const 772 bool RenderTheme::isHovered(const RenderObject* o) const
771 { 773 {
772 Node* node = o->node(); 774 Node* node = o->node();
773 if (!node) 775 if (!node)
774 return false; 776 return false;
775 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) 777 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement())
776 return node->hovered(); 778 return node->hovered();
777 SpinButtonElement* element = toSpinButtonElement(node); 779 SpinButtonElement* element = toSpinButtonElement(node);
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 1251
1250 // padding - not honored by WinIE, needs to be removed. 1252 // padding - not honored by WinIE, needs to be removed.
1251 style->resetPadding(); 1253 style->resetPadding();
1252 1254
1253 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 1255 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
1254 // for now, we will not honor it. 1256 // for now, we will not honor it.
1255 style->resetBorder(); 1257 style->resetBorder();
1256 } 1258 }
1257 1259
1258 } // namespace WebCore 1260 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698