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

Side by Side Diff: Source/core/rendering/RenderBox.h

Issue 33983003: Introduce DEFINE_RENDER_OBJECT_TYPE_CASTS to replace manual toRenderFoo, and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 InlineBox* m_inlineBoxWrapper; 713 InlineBox* m_inlineBoxWrapper;
714 714
715 // Our overflow information. 715 // Our overflow information.
716 OwnPtr<RenderOverflow> m_overflow; 716 OwnPtr<RenderOverflow> m_overflow;
717 717
718 private: 718 private:
719 // Used to store state between styleWillChange and styleDidChange 719 // Used to store state between styleWillChange and styleDidChange
720 static bool s_hadOverflowClip; 720 static bool s_hadOverflowClip;
721 }; 721 };
722 722
723 inline RenderBox* toRenderBox(RenderObject* object) 723 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBox, isBox());
724 {
725 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isBox());
726 return static_cast<RenderBox*>(object);
727 }
728
729 inline const RenderBox* toRenderBox(const RenderObject* object)
730 {
731 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isBox());
732 return static_cast<const RenderBox*>(object);
733 }
734
735 // This will catch anyone doing an unnecessary cast.
736 void toRenderBox(const RenderBox*);
737 724
738 inline RenderBox* RenderBox::previousSiblingBox() const 725 inline RenderBox* RenderBox::previousSiblingBox() const
739 { 726 {
740 return toRenderBox(previousSibling()); 727 return toRenderBox(previousSibling());
741 } 728 }
742 729
743 inline RenderBox* RenderBox::nextSiblingBox() const 730 inline RenderBox* RenderBox::nextSiblingBox() const
744 { 731 {
745 return toRenderBox(nextSibling()); 732 return toRenderBox(nextSibling());
746 } 733 }
(...skipping 24 matching lines...) Expand all
771 if (UNLIKELY(m_inlineBoxWrapper != 0)) 758 if (UNLIKELY(m_inlineBoxWrapper != 0))
772 deleteLineBoxWrapper(); 759 deleteLineBoxWrapper();
773 } 760 }
774 761
775 m_inlineBoxWrapper = boxWrapper; 762 m_inlineBoxWrapper = boxWrapper;
776 } 763 }
777 764
778 } // namespace WebCore 765 } // namespace WebCore
779 766
780 #endif // RenderBox_h 767 #endif // RenderBox_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698