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

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

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 return false; 820 return false;
821 return o->node()->active(); 821 return o->node()->active();
822 } 822 }
823 823
824 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const 824 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
825 { 825 {
826 Node* node = o->node(); 826 Node* node = o->node();
827 if (!node || !node->active() || !node->isElementNode() 827 if (!node || !node->active() || !node->isElementNode()
828 || !toElement(node)->isSpinButtonElement()) 828 || !toElement(node)->isSpinButtonElement())
829 return false; 829 return false;
830 SpinButtonElement* element = static_cast<SpinButtonElement*>(node); 830 SpinButtonElement* element = toSpinButtonElement(node);
831 return element->upDownState() == SpinButtonElement::Up; 831 return element->upDownState() == SpinButtonElement::Up;
832 } 832 }
833 833
834 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const 834 bool RenderTheme::isReadOnlyControl(const RenderObject* o) const
835 { 835 {
836 Node* node = o->node(); 836 Node* node = o->node();
837 if (!node || !node->isElementNode()) 837 if (!node || !node->isElementNode())
838 return false; 838 return false;
839 return toElement(node)->matchesReadOnlyPseudoClass(); 839 return toElement(node)->matchesReadOnlyPseudoClass();
840 } 840 }
841 841
842 bool RenderTheme::isHovered(const RenderObject* o) const 842 bool RenderTheme::isHovered(const RenderObject* o) const
843 { 843 {
844 Node* node = o->node(); 844 Node* node = o->node();
845 if (!node) 845 if (!node)
846 return false; 846 return false;
847 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement()) 847 if (!node->isElementNode() || !toElement(node)->isSpinButtonElement())
848 return node->hovered(); 848 return node->hovered();
849 SpinButtonElement* element = static_cast<SpinButtonElement*>(node); 849 SpinButtonElement* element = toSpinButtonElement(node);
850 return element->hovered() && element->upDownState() != SpinButtonElement::In determinate; 850 return element->hovered() && element->upDownState() != SpinButtonElement::In determinate;
851 } 851 }
852 852
853 bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject* o) const 853 bool RenderTheme::isSpinUpButtonPartHovered(const RenderObject* o) const
854 { 854 {
855 Node* node = o->node(); 855 Node* node = o->node();
856 if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement ()) 856 if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement ())
857 return false; 857 return false;
858 SpinButtonElement* element = static_cast<SpinButtonElement*>(node); 858 SpinButtonElement* element = toSpinButtonElement(node);
859 return element->upDownState() == SpinButtonElement::Up; 859 return element->upDownState() == SpinButtonElement::Up;
860 } 860 }
861 861
862 #if !USE(NEW_THEME) 862 #if !USE(NEW_THEME)
863 863
864 void RenderTheme::adjustCheckboxStyle(RenderStyle* style, Element*) const 864 void RenderTheme::adjustCheckboxStyle(RenderStyle* style, Element*) const
865 { 865 {
866 // A summary of the rules for checkbox designed to match WinIE: 866 // A summary of the rules for checkbox designed to match WinIE:
867 // width/height - honored (WinIE actually scales its control for small width s, but lets it overflow for small heights.) 867 // width/height - honored (WinIE actually scales its control for small width s, but lets it overflow for small heights.)
868 // font-size - not honored (control has no text), but we use it to decide wh ich control size to use. 868 // font-size - not honored (control has no text), but we use it to decide wh ich control size to use.
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1378
1379 // padding - not honored by WinIE, needs to be removed. 1379 // padding - not honored by WinIE, needs to be removed.
1380 style->resetPadding(); 1380 style->resetPadding();
1381 1381
1382 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 1382 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
1383 // for now, we will not honor it. 1383 // for now, we will not honor it.
1384 style->resetBorder(); 1384 style->resetBorder();
1385 } 1385 }
1386 1386
1387 } // namespace WebCore 1387 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMenuList.cpp ('k') | Source/core/rendering/svg/RenderSVGInlineText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698