| 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, 2009 Apple Inc. All rights reserved. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class LayoutTableCol final : public LayoutTableBoxComponent { | 60 class LayoutTableCol final : public LayoutTableBoxComponent { |
| 61 public: | 61 public: |
| 62 explicit LayoutTableCol(Element*); | 62 explicit LayoutTableCol(Element*); |
| 63 | 63 |
| 64 void ClearPreferredLogicalWidthsDirtyBits(); | 64 void ClearPreferredLogicalWidthsDirtyBits(); |
| 65 | 65 |
| 66 // The 'span' attribute in HTML. | 66 // The 'span' attribute in HTML. |
| 67 // For CSS table columns or colgroups, this is always 1. | 67 // For CSS table columns or colgroups, this is always 1. |
| 68 unsigned Span() const { return span_; } | 68 unsigned Span() const { return span_; } |
| 69 | 69 |
| 70 bool IsTableColumnGroupWithColumnChildren() { return FirstChild(); } | 70 bool IsTableColumnGroupWithColumnChildren() const { return FirstChild(); } |
| 71 bool IsTableColumn() const { | 71 bool IsTableColumn() const { |
| 72 return Style()->Display() == EDisplay::kTableColumn; | 72 return Style()->Display() == EDisplay::kTableColumn; |
| 73 } | 73 } |
| 74 bool IsTableColumnGroup() const { | 74 bool IsTableColumnGroup() const { |
| 75 return Style()->Display() == EDisplay::kTableColumnGroup; | 75 return Style()->Display() == EDisplay::kTableColumnGroup; |
| 76 } | 76 } |
| 77 | 77 |
| 78 LayoutTableCol* EnclosingColumnGroup() const; | 78 LayoutTableCol* EnclosingColumnGroup() const; |
| 79 LayoutTableCol* LastColumnInGroup() const; |
| 79 | 80 |
| 80 // Returns the next column or column-group. | 81 // Returns the next column or column-group. |
| 81 LayoutTableCol* NextColumn() const; | 82 LayoutTableCol* NextColumn() const; |
| 82 | 83 |
| 83 const BorderValue& BorderAdjoiningCellStartBorder( | 84 const BorderValue& BorderAdjoiningCellStartBorder( |
| 84 const LayoutTableCell*) const; | 85 const LayoutTableCell*) const; |
| 85 const BorderValue& BorderAdjoiningCellEndBorder(const LayoutTableCell*) const; | 86 const BorderValue& BorderAdjoiningCellEndBorder(const LayoutTableCell*) const; |
| 86 const BorderValue& BorderAdjoiningCellBefore(const LayoutTableCell*) const; | 87 const BorderValue& BorderAdjoiningCellBefore(const LayoutTableCell*) const; |
| 87 const BorderValue& BorderAdjoiningCellAfter(const LayoutTableCell*) const; | 88 const BorderValue& BorderAdjoiningCellAfter(const LayoutTableCell*) const; |
| 88 | 89 |
| 89 const char* GetName() const override { return "LayoutTableCol"; } | 90 const char* GetName() const override { return "LayoutTableCol"; } |
| 90 | 91 |
| 92 // Return indexes to all columns inside this element. |
| 93 // Can return vector with size 0 if LayoutTableCol is out of range. |
| 94 // <col> element can return size() > 2 if it spans multiple columns |
| 95 // <colgroup> element can return any size. |
| 96 Vector<unsigned> GetEffectiveColumnIndexes() const; |
| 97 |
| 91 private: | 98 private: |
| 92 bool IsOfType(LayoutObjectType type) const override { | 99 bool IsOfType(LayoutObjectType type) const override { |
| 93 return type == kLayoutObjectLayoutTableCol || LayoutBox::IsOfType(type); | 100 return type == kLayoutObjectLayoutTableCol || LayoutBox::IsOfType(type); |
| 94 } | 101 } |
| 95 void UpdateFromElement() override; | 102 void UpdateFromElement() override; |
| 96 void ComputePreferredLogicalWidths() override { NOTREACHED(); } | 103 void ComputePreferredLogicalWidths() override { NOTREACHED(); } |
| 97 | 104 |
| 98 void InsertedIntoTree() override; | 105 void InsertedIntoTree() override; |
| 99 void WillBeRemovedFromTree() override; | 106 void WillBeRemovedFromTree() override; |
| 100 | 107 |
| 101 bool IsChildAllowed(LayoutObject*, const ComputedStyle&) const override; | 108 bool IsChildAllowed(LayoutObject*, const ComputedStyle&) const override; |
| 102 bool CanHaveChildren() const override; | 109 bool CanHaveChildren() const override; |
| 103 PaintLayerType LayerTypeRequired() const override { return kNoPaintLayer; } | 110 PaintLayerType LayerTypeRequired() const override { return kNoPaintLayer; } |
| 104 | 111 |
| 105 LayoutRect LocalVisualRect() const override; | 112 LayoutRect LocalVisualRect() const override; |
| 106 | 113 |
| 107 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; | 114 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; |
| 108 | 115 |
| 109 LayoutTable* Table() const; | 116 LayoutTable* Table() const; |
| 110 | 117 |
| 111 unsigned span_; | 118 unsigned span_; |
| 112 }; | 119 }; |
| 113 | 120 |
| 114 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCol, IsLayoutTableCol()); | 121 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCol, IsLayoutTableCol()); |
| 115 | 122 |
| 116 } // namespace blink | 123 } // namespace blink |
| 117 | 124 |
| 118 #endif | 125 #endif |
| OLD | NEW |