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