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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master 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 | Annotate | Revision Log
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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 result |= IndeterminateState; 796 result |= IndeterminateState;
797 return result; 797 return result;
798 } 798 }
799 799
800 bool RenderTheme::isActive(const RenderObject* o) const 800 bool RenderTheme::isActive(const RenderObject* o) const
801 { 801 {
802 Node* node = o->node(); 802 Node* node = o->node();
803 if (!node) 803 if (!node)
804 return false; 804 return false;
805 805
806 Page* page = node->document()->page(); 806 Page* page = node->document().page();
807 if (!page) 807 if (!page)
808 return false; 808 return false;
809 809
810 return page->focusController().isActive(); 810 return page->focusController().isActive();
811 } 811 }
812 812
813 bool RenderTheme::isChecked(const RenderObject* o) const 813 bool RenderTheme::isChecked(const RenderObject* o) const
814 { 814 {
815 if (!o->node() || !o->node()->hasTagName(inputTag)) 815 if (!o->node() || !o->node()->hasTagName(inputTag))
816 return false; 816 return false;
(...skipping 15 matching lines...) Expand all
832 return !toElement(node)->isDisabledFormControl(); 832 return !toElement(node)->isDisabledFormControl();
833 } 833 }
834 834
835 bool RenderTheme::isFocused(const RenderObject* o) const 835 bool RenderTheme::isFocused(const RenderObject* o) const
836 { 836 {
837 Node* node = o->node(); 837 Node* node = o->node();
838 if (!node) 838 if (!node)
839 return false; 839 return false;
840 840
841 node = node->focusDelegate(); 841 node = node->focusDelegate();
842 Document* document = node->document(); 842 Document& document = node->document();
843 Frame* frame = document->frame(); 843 Frame* frame = document.frame();
844 return node == document->focusedElement() && node->shouldHaveFocusAppearance () && frame && frame->selection()->isFocusedAndActive(); 844 return node == document.focusedElement() && node->shouldHaveFocusAppearance( ) && frame && frame->selection()->isFocusedAndActive();
845 } 845 }
846 846
847 bool RenderTheme::isPressed(const RenderObject* o) const 847 bool RenderTheme::isPressed(const RenderObject* o) const
848 { 848 {
849 if (!o->node()) 849 if (!o->node())
850 return false; 850 return false;
851 return o->node()->active(); 851 return o->node()->active();
852 } 852 }
853 853
854 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const 854 bool RenderTheme::isSpinUpButtonPartPressed(const RenderObject* o) const
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1399 1399
1400 // padding - not honored by WinIE, needs to be removed. 1400 // padding - not honored by WinIE, needs to be removed.
1401 style->resetPadding(); 1401 style->resetPadding();
1402 1402
1403 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 1403 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
1404 // for now, we will not honor it. 1404 // for now, we will not honor it.
1405 style->resetBorder(); 1405 style->resetBorder();
1406 } 1406 }
1407 1407
1408 } // namespace WebCore 1408 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTextControlSingleLine.cpp ('k') | Source/core/rendering/RenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698