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

Side by Side Diff: Source/core/rendering/RenderBlockFlow.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/RenderBlock.h ('k') | Source/core/rendering/RenderBox.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 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 LayoutUnit applyAfterBreak(RenderBox* child, LayoutUnit logicalOffset, Margi nInfo&); // If the child has an after break, then return a new offset that shift s to the top of the next page/column. 178 LayoutUnit applyAfterBreak(RenderBox* child, LayoutUnit logicalOffset, Margi nInfo&); // If the child has an after break, then return a new offset that shift s to the top of the next page/column.
179 179
180 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La youtUnit estimateWithoutPagination, RenderBox* child, bool atBeforeSideOfBlock); 180 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La youtUnit estimateWithoutPagination, RenderBox* child, bool atBeforeSideOfBlock);
181 181
182 protected: 182 protected:
183 OwnPtr<RenderBlockFlowRareData> m_rareData; 183 OwnPtr<RenderBlockFlowRareData> m_rareData;
184 184
185 friend class MarginInfo; 185 friend class MarginInfo;
186 }; 186 };
187 187
188 inline RenderBlockFlow& toRenderBlockFlow(RenderObject& object) 188 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow());
189 {
190 ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderBlockFlow());
191 return static_cast<RenderBlockFlow&>(object);
192 }
193
194 inline const RenderBlockFlow& toRenderBlockFlow(const RenderObject& object)
195 {
196 ASSERT_WITH_SECURITY_IMPLICATION(object.isRenderBlockFlow());
197 return static_cast<const RenderBlockFlow&>(object);
198 }
199
200 inline RenderBlockFlow* toRenderBlockFlow(RenderObject* object)
201 {
202 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderBlockFlow());
203 return static_cast<RenderBlockFlow*>(object);
204 }
205
206 inline const RenderBlockFlow* toRenderBlockFlow(const RenderObject* object)
207 {
208 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderBlockFlow());
209 return static_cast<const RenderBlockFlow*>(object);
210 }
211
212 // This will catch anyone doing an unnecessary cast.
213 void toRenderBlockFlow(const RenderBlockFlow*);
214 void toRenderBlockFlow(const RenderBlockFlow&);
215 189
216 } // namespace WebCore 190 } // namespace WebCore
217 191
218 #endif // RenderBlockFlow_h 192 #endif // RenderBlockFlow_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698