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

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

Issue 752723004: Use references in RenderBlock and RenderBlockFlow methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 computedLogicalHeight = styleLogicalHeight.value() - borders; 341 computedLogicalHeight = styleLogicalHeight.value() - borders;
342 } else if (styleLogicalHeight.isPercent()) 342 } else if (styleLogicalHeight.isPercent())
343 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeigh t); 343 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeigh t);
344 else if (styleLogicalHeight.isIntrinsic()) 344 else if (styleLogicalHeight.isIntrinsic())
345 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleL ogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding); 345 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleL ogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding);
346 else 346 else
347 ASSERT_NOT_REACHED(); 347 ASSERT_NOT_REACHED();
348 return std::max<LayoutUnit>(0, computedLogicalHeight); 348 return std::max<LayoutUnit>(0, computedLogicalHeight);
349 } 349 }
350 350
351 void RenderTable::layoutCaption(RenderTableCaption* caption) 351 void RenderTable::layoutCaption(RenderTableCaption* caption)
Julien - ping for review 2014/11/26 18:52:35 Same comment.
352 { 352 {
353 if (caption->needsLayout()) { 353 if (caption->needsLayout()) {
354 // The margins may not be available but ensure the caption is at least l ocated beneath any previous sibling caption 354 // The margins may not be available but ensure the caption is at least l ocated beneath any previous sibling caption
355 // so that it does not mistakenly think any floats in the previous capti on intrude into it. 355 // so that it does not mistakenly think any floats in the previous capti on intrude into it.
356 caption->setLogicalLocation(LayoutPoint(caption->marginStart(), collapse dMarginBeforeForChild(caption) + logicalHeight())); 356 caption->setLogicalLocation(LayoutPoint(caption->marginStart(), collapse dMarginBeforeForChild(*caption) + logicalHeight()));
357 // If RenderTableCaption ever gets a layout() function, use it here. 357 // If RenderTableCaption ever gets a layout() function, use it here.
358 caption->layoutIfNeeded(); 358 caption->layoutIfNeeded();
359 } 359 }
360 // Apply the margins to the location now that they are definitely available from layout 360 // Apply the margins to the location now that they are definitely available from layout
361 LayoutUnit captionLogicalTop = collapsedMarginBeforeForChild(caption) + logi calHeight(); 361 LayoutUnit captionLogicalTop = collapsedMarginBeforeForChild(*caption) + log icalHeight();
362 if (view()->layoutState()->isPaginated()) { 362 if (view()->layoutState()->isPaginated()) {
363 captionLogicalTop += caption->paginationStrut(); 363 captionLogicalTop += caption->paginationStrut();
364 caption->setPaginationStrut(0); 364 caption->setPaginationStrut(0);
365 } 365 }
366 caption->setLogicalLocation(LayoutPoint(caption->marginStart(), captionLogic alTop)); 366 caption->setLogicalLocation(LayoutPoint(caption->marginStart(), captionLogic alTop));
367 367
368 if (!selfNeedsLayout()) 368 if (!selfNeedsLayout())
369 caption->setMayNeedPaintInvalidation(true); 369 caption->setMayNeedPaintInvalidation(true);
370 370
371 setLogicalHeight(logicalHeight() + caption->logicalHeight() + collapsedMargi nBeforeForChild(caption) + collapsedMarginAfterForChild(caption)); 371 setLogicalHeight(logicalHeight() + caption->logicalHeight() + collapsedMargi nBeforeForChild(*caption) + collapsedMarginAfterForChild(*caption));
372 } 372 }
373 373
374 void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight) 374 void RenderTable::distributeExtraLogicalHeight(int extraLogicalHeight)
375 { 375 {
376 if (extraLogicalHeight <= 0) 376 if (extraLogicalHeight <= 0)
377 return; 377 return;
378 378
379 // FIXME: Distribute the extra logical height between all table sections ins tead of giving it all to the first one. 379 // FIXME: Distribute the extra logical height between all table sections ins tead of giving it all to the first one.
380 if (RenderTableSection* section = firstBody()) 380 if (RenderTableSection* section = firstBody())
381 extraLogicalHeight -= section->distributeExtraLogicalHeightToRows(extraL ogicalHeight); 381 extraLogicalHeight -= section->distributeExtraLogicalHeightToRows(extraL ogicalHeight);
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const 1337 const BorderValue& RenderTable::tableEndBorderAdjoiningCell(const RenderTableCel l* cell) const
1338 { 1338 {
1339 ASSERT(cell->isFirstOrLastCellInRow()); 1339 ASSERT(cell->isFirstOrLastCellInRow());
1340 if (hasSameDirectionAs(cell->row())) 1340 if (hasSameDirectionAs(cell->row()))
1341 return style()->borderEnd(); 1341 return style()->borderEnd();
1342 1342
1343 return style()->borderStart(); 1343 return style()->borderStart();
1344 } 1344 }
1345 1345
1346 } 1346 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698