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

Side by Side Diff: Source/core/layout/LayoutTable.cpp

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. 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
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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 int bordersPaddingAndSpacing = bordersPaddingAndSpacingInRowDirection(); 672 int bordersPaddingAndSpacing = bordersPaddingAndSpacingInRowDirection();
673 m_minPreferredLogicalWidth += bordersPaddingAndSpacing; 673 m_minPreferredLogicalWidth += bordersPaddingAndSpacing;
674 m_maxPreferredLogicalWidth += bordersPaddingAndSpacing; 674 m_maxPreferredLogicalWidth += bordersPaddingAndSpacing;
675 675
676 m_tableLayout->applyPreferredLogicalWidthQuirks(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 676 m_tableLayout->applyPreferredLogicalWidthQuirks(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
677 677
678 for (unsigned i = 0; i < m_captions.size(); i++) 678 for (unsigned i = 0; i < m_captions.size(); i++)
679 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, m_capt ions[i]->minPreferredLogicalWidth()); 679 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, m_capt ions[i]->minPreferredLogicalWidth());
680 680
681 RenderStyle* styleToUse = style(); 681 const RenderStyle* styleToUse = style();
682 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width. 682 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for min-width.
683 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth() .value() > 0) { 683 if (styleToUse->logicalMinWidth().isFixed() && styleToUse->logicalMinWidth() .value() > 0) {
684 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 684 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
685 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value())); 685 m_minPreferredLogicalWidth = std::max(m_minPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMinWidth().value()));
686 } 686 }
687 687
688 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth. 688 // FIXME: This should probably be checking for isSpecified since you should be able to use percentage or calc values for maxWidth.
689 if (styleToUse->logicalMaxWidth().isFixed()) { 689 if (styleToUse->logicalMaxWidth().isFixed()) {
690 // We don't constrain m_minPreferredLogicalWidth as the table should be at least the size of its min-content, regardless of 'max-width'. 690 // We don't constrain m_minPreferredLogicalWidth as the table should be at least the size of its min-content, regardless of 'max-width'.
691 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value())); 691 m_maxPreferredLogicalWidth = std::min(m_maxPreferredLogicalWidth, adjust ContentBoxLogicalWidthForBoxSizing(styleToUse->logicalMaxWidth().value()));
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const 1344 const BorderValue& LayoutTable::tableEndBorderAdjoiningCell(const LayoutTableCel l* cell) const
1345 { 1345 {
1346 ASSERT(cell->isFirstOrLastCellInRow()); 1346 ASSERT(cell->isFirstOrLastCellInRow());
1347 if (hasSameDirectionAs(cell->row())) 1347 if (hasSameDirectionAs(cell->row()))
1348 return style()->borderEnd(); 1348 return style()->borderEnd();
1349 1349
1350 return style()->borderStart(); 1350 return style()->borderStart();
1351 } 1351 }
1352 1352
1353 } 1353 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698