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

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

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/rendering/RenderQuote.h ('k') | Source/core/rendering/RenderRegion.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) 2011 Nokia Inc. All rights reserved. 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 fragment = new RenderTextFragment(&document(), m_text.impl()); 271 fragment = new RenderTextFragment(&document(), m_text.impl());
272 fragment->setStyle(style()); 272 fragment->setStyle(style());
273 addChild(fragment); 273 addChild(fragment);
274 } 274 }
275 } 275 }
276 276
277 RenderTextFragment* RenderQuote::findFragmentChild() const 277 RenderTextFragment* RenderQuote::findFragmentChild() const
278 { 278 {
279 // We walk from the end of the child list because, if we've had a first-lett er 279 // We walk from the end of the child list because, if we've had a first-lett er
280 // renderer inserted then the remaining text will be at the end. 280 // renderer inserted then the remaining text will be at the end.
281 while (RenderObject* child = lastChild()) { 281 while (LayoutObject* child = lastChild()) {
282 if (child->isText() && toRenderText(child)->isTextFragment()) 282 if (child->isText() && toRenderText(child)->isTextFragment())
283 return toRenderTextFragment(child); 283 return toRenderTextFragment(child);
284 } 284 }
285 285
286 return nullptr; 286 return nullptr;
287 } 287 }
288 288
289 String RenderQuote::computeText() const 289 String RenderQuote::computeText() const
290 { 290 {
291 switch (m_type) { 291 switch (m_type) {
(...skipping 26 matching lines...) Expand all
318 ASSERT(!m_attached); 318 ASSERT(!m_attached);
319 ASSERT(!m_next && !m_previous); 319 ASSERT(!m_next && !m_previous);
320 ASSERT(isRooted()); 320 ASSERT(isRooted());
321 321
322 if (!view()->renderQuoteHead()) { 322 if (!view()->renderQuoteHead()) {
323 view()->setRenderQuoteHead(this); 323 view()->setRenderQuoteHead(this);
324 m_attached = true; 324 m_attached = true;
325 return; 325 return;
326 } 326 }
327 327
328 for (RenderObject* predecessor = previousInPreOrder(); predecessor; predeces sor = predecessor->previousInPreOrder()) { 328 for (LayoutObject* predecessor = previousInPreOrder(); predecessor; predeces sor = predecessor->previousInPreOrder()) {
329 // Skip unattached predecessors to avoid having stale m_previous pointer s 329 // Skip unattached predecessors to avoid having stale m_previous pointer s
330 // if the previous node is never attached and is then destroyed. 330 // if the previous node is never attached and is then destroyed.
331 if (!predecessor->isQuote() || !toRenderQuote(predecessor)->isAttached() ) 331 if (!predecessor->isQuote() || !toRenderQuote(predecessor)->isAttached() )
332 continue; 332 continue;
333 m_previous = toRenderQuote(predecessor); 333 m_previous = toRenderQuote(predecessor);
334 m_next = m_previous->m_next; 334 m_next = m_previous->m_next;
335 m_previous->m_next = this; 335 m_previous->m_next = this;
336 if (m_next) 336 if (m_next)
337 m_next->m_previous = this; 337 m_next->m_previous = this;
338 break; 338 break;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 if (m_depth) 399 if (m_depth)
400 m_depth--; 400 m_depth--;
401 break; 401 break;
402 } 402 }
403 } 403 }
404 if (oldDepth != m_depth) 404 if (oldDepth != m_depth)
405 updateText(); 405 updateText();
406 } 406 }
407 407
408 } // namespace blink 408 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderQuote.h ('k') | Source/core/rendering/RenderRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698