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

Side by Side Diff: Source/core/rendering/RenderText.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/RenderTableSection.h ('k') | Source/core/rendering/RenderTextControl.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 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 218
219 inline UChar RenderText::characterAt(unsigned i) const 219 inline UChar RenderText::characterAt(unsigned i) const
220 { 220 {
221 if (i >= textLength()) 221 if (i >= textLength())
222 return 0; 222 return 0;
223 223
224 return uncheckedCharacterAt(i); 224 return uncheckedCharacterAt(i);
225 } 225 }
226 226
227 inline RenderText* toRenderText(RenderObject* object) 227 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderText, isText());
228 {
229 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isText());
230 return static_cast<RenderText*>(object);
231 }
232
233 inline const RenderText* toRenderText(const RenderObject* object)
234 {
235 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isText());
236 return static_cast<const RenderText*>(object);
237 }
238
239 // This will catch anyone doing an unnecessary cast.
240 void toRenderText(const RenderText*);
241 228
242 #ifdef NDEBUG 229 #ifdef NDEBUG
243 inline void RenderText::checkConsistency() const 230 inline void RenderText::checkConsistency() const
244 { 231 {
245 } 232 }
246 #endif 233 #endif
247 234
248 void applyTextTransform(const RenderStyle*, String&, UChar); 235 void applyTextTransform(const RenderStyle*, String&, UChar);
249 236
250 } // namespace WebCore 237 } // namespace WebCore
251 238
252 #endif // RenderText_h 239 #endif // RenderText_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableSection.h ('k') | Source/core/rendering/RenderTextControl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698