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

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

Issue 166033009: *** FOR PROTOTYPE PURPOSES ONLY! NOT INTENDED FOR COMMIT! *** (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
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, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // If the marker is inside we need to redo the preferred width calcu lations 308 // If the marker is inside we need to redo the preferred width calcu lations
309 // as the size of the item now includes the size of the list marker. 309 // as the size of the item now includes the size of the list marker.
310 if (m_marker->isInside()) 310 if (m_marker->isInside())
311 containingBlock()->updateLogicalWidth(); 311 containingBlock()->updateLogicalWidth();
312 } 312 }
313 } 313 }
314 } 314 }
315 315
316 void RenderListItem::layout() 316 void RenderListItem::layout()
317 { 317 {
318 internalLayout(true);
319 }
320
321 void RenderListItem::preLayout()
322 {
323 internalLayout(false);
324 }
325
326 void RenderListItem::internalLayout(bool fullLayout)
327 {
318 ASSERT(needsLayout()); 328 ASSERT(needsLayout());
319 329
320 // The marker must be autosized before calling updateMarkerLocation. 330 // The marker must be autosized before calling updateMarkerLocation.
321 // It cannot be done in the parent's beginLayout because it is not yet in th e render tree. 331 // It cannot be done in the parent's beginLayout because it is not yet in th e render tree.
322 FastTextAutosizer* textAutosizer = document().fastTextAutosizer(); 332 FastTextAutosizer* textAutosizer = document().fastTextAutosizer();
323 if (textAutosizer) 333 if (textAutosizer)
324 textAutosizer->inflateListItem(this, m_marker); 334 textAutosizer->inflateListItem(this, m_marker);
325 335
326 LayoutRectRecorder recorder(*this); 336 LayoutRectRecorder recorder(*this);
327 updateMarkerLocation(); 337 updateMarkerLocation();
328 RenderBlockFlow::layout(); 338 if (fullLayout)
339 RenderBlockFlow::layout(); // this will traverse children...
340 else
341 RenderBlockFlow::preLayout();
342 }
343
344 void RenderListItem::postLayout()
345 {
346 RenderBlockFlow::postLayout();
329 } 347 }
330 348
331 void RenderListItem::addOverflowFromChildren() 349 void RenderListItem::addOverflowFromChildren()
332 { 350 {
333 RenderBlockFlow::addOverflowFromChildren(); 351 RenderBlockFlow::addOverflowFromChildren();
334 positionListMarker(); 352 positionListMarker();
335 } 353 }
336 354
337 void RenderListItem::positionListMarker() 355 void RenderListItem::positionListMarker()
338 { 356 {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 // assume that all the following ones have too. 542 // assume that all the following ones have too.
525 // This gives us the opportunity to stop here and avoid 543 // This gives us the opportunity to stop here and avoid
526 // marking the same nodes again. 544 // marking the same nodes again.
527 break; 545 break;
528 } 546 }
529 item->updateValue(); 547 item->updateValue();
530 } 548 }
531 } 549 }
532 550
533 } // namespace WebCore 551 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698