| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 #include "core/layout/LayoutTableSection.h" | 37 #include "core/layout/LayoutTableSection.h" |
| 38 #include "core/layout/LayoutView.h" | 38 #include "core/layout/LayoutView.h" |
| 39 #include "core/layout/SubtreeLayoutScope.h" | 39 #include "core/layout/SubtreeLayoutScope.h" |
| 40 #include "core/layout/TableLayoutAlgorithmAuto.h" | 40 #include "core/layout/TableLayoutAlgorithmAuto.h" |
| 41 #include "core/layout/TableLayoutAlgorithmFixed.h" | 41 #include "core/layout/TableLayoutAlgorithmFixed.h" |
| 42 #include "core/layout/TextAutosizer.h" | 42 #include "core/layout/TextAutosizer.h" |
| 43 #include "core/paint/BoxPainter.h" | 43 #include "core/paint/BoxPainter.h" |
| 44 #include "core/paint/PaintLayer.h" | 44 #include "core/paint/PaintLayer.h" |
| 45 #include "core/paint/TablePainter.h" | 45 #include "core/paint/TablePainter.h" |
| 46 #include "core/style/StyleInheritedData.h" | 46 #include "core/style/StyleInheritedData.h" |
| 47 #include "wtf/PtrUtil.h" |
| 47 | 48 |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 using namespace HTMLNames; | 51 using namespace HTMLNames; |
| 51 | 52 |
| 52 LayoutTable::LayoutTable(Element* element) | 53 LayoutTable::LayoutTable(Element* element) |
| 53 : LayoutBlock(element) | 54 : LayoutBlock(element) |
| 54 , m_head(nullptr) | 55 , m_head(nullptr) |
| 55 , m_foot(nullptr) | 56 , m_foot(nullptr) |
| 56 , m_firstBody(nullptr) | 57 , m_firstBody(nullptr) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 84 m_vSpacing = collapseBorders() ? 0 : style()->verticalBorderSpacing(); | 85 m_vSpacing = collapseBorders() ? 0 : style()->verticalBorderSpacing(); |
| 85 m_effectiveColumnPositions[0] = m_hSpacing; | 86 m_effectiveColumnPositions[0] = m_hSpacing; |
| 86 | 87 |
| 87 if (!m_tableLayout || style()->isFixedTableLayout() != oldFixedTableLayout)
{ | 88 if (!m_tableLayout || style()->isFixedTableLayout() != oldFixedTableLayout)
{ |
| 88 if (m_tableLayout) | 89 if (m_tableLayout) |
| 89 m_tableLayout->willChangeTableLayout(); | 90 m_tableLayout->willChangeTableLayout(); |
| 90 | 91 |
| 91 // According to the CSS2 spec, you only use fixed table layout if an | 92 // According to the CSS2 spec, you only use fixed table layout if an |
| 92 // explicit width is specified on the table. Auto width implies auto ta
ble layout. | 93 // explicit width is specified on the table. Auto width implies auto ta
ble layout. |
| 93 if (style()->isFixedTableLayout()) | 94 if (style()->isFixedTableLayout()) |
| 94 m_tableLayout = adoptPtr(new TableLayoutAlgorithmFixed(this)); | 95 m_tableLayout = wrapUnique(new TableLayoutAlgorithmFixed(this)); |
| 95 else | 96 else |
| 96 m_tableLayout = adoptPtr(new TableLayoutAlgorithmAuto(this)); | 97 m_tableLayout = wrapUnique(new TableLayoutAlgorithmAuto(this)); |
| 97 } | 98 } |
| 98 | 99 |
| 99 // If border was changed, invalidate collapsed borders cache. | 100 // If border was changed, invalidate collapsed borders cache. |
| 100 if (!needsLayout() && oldStyle && oldStyle->border() != style()->border()) | 101 if (!needsLayout() && oldStyle && oldStyle->border() != style()->border()) |
| 101 invalidateCollapsedBorders(); | 102 invalidateCollapsedBorders(); |
| 102 } | 103 } |
| 103 | 104 |
| 104 static inline void resetSectionPointerIfNotBefore(LayoutTableSection*& ptr, Layo
utObject* before) | 105 static inline void resetSectionPointerIfNotBefore(LayoutTableSection*& ptr, Layo
utObject* before) |
| 105 { | 106 { |
| 106 if (!before || !ptr) | 107 if (!before || !ptr) |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 | 1496 |
| 1496 LayoutUnit LayoutTable::paddingRight() const | 1497 LayoutUnit LayoutTable::paddingRight() const |
| 1497 { | 1498 { |
| 1498 if (collapseBorders()) | 1499 if (collapseBorders()) |
| 1499 return LayoutUnit(); | 1500 return LayoutUnit(); |
| 1500 | 1501 |
| 1501 return LayoutBlock::paddingRight(); | 1502 return LayoutBlock::paddingRight(); |
| 1502 } | 1503 } |
| 1503 | 1504 |
| 1504 } // namespace blink | 1505 } // namespace blink |
| OLD | NEW |