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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCol.h

Issue 1819073004: Fix table cell background painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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, 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 const LayoutObjectChildList* children() const { return &m_children; } 70 const LayoutObjectChildList* children() const { return &m_children; }
71 LayoutObjectChildList* children() { return &m_children; } 71 LayoutObjectChildList* children() { return &m_children; }
72 72
73 void clearPreferredLogicalWidthsDirtyBits(); 73 void clearPreferredLogicalWidthsDirtyBits();
74 74
75 // The 'span' attribute in HTML. 75 // The 'span' attribute in HTML.
76 // For CSS table columns or colgroups, this is always 1. 76 // For CSS table columns or colgroups, this is always 1.
77 unsigned span() const { return m_span; } 77 unsigned span() const { return m_span; }
78 78
79 bool isTableColumnGroupWithColumnChildren() { return firstChild(); } 79 bool isTableColumnGroupWithColumnChildren() const { return firstChild(); }
80 bool isTableColumn() const { return style()->display() == TABLE_COLUMN; } 80 bool isTableColumn() const { return style()->display() == TABLE_COLUMN; }
81 bool isTableColumnGroup() const { return style()->display() == TABLE_COLUMN_ GROUP; } 81 bool isTableColumnGroup() const { return style()->display() == TABLE_COLUMN_ GROUP; }
82 82
83 LayoutTableCol* enclosingColumnGroup() const; 83 LayoutTableCol* enclosingColumnGroup() const;
84 LayoutTableCol* lastColumnInGroup() const;
84 85
85 // Returns the next column or column-group. 86 // Returns the next column or column-group.
86 LayoutTableCol* nextColumn() const; 87 LayoutTableCol* nextColumn() const;
87 88
88 const BorderValue& borderAdjoiningCellStartBorder(const LayoutTableCell*) co nst; 89 const BorderValue& borderAdjoiningCellStartBorder(const LayoutTableCell*) co nst;
89 const BorderValue& borderAdjoiningCellEndBorder(const LayoutTableCell*) cons t; 90 const BorderValue& borderAdjoiningCellEndBorder(const LayoutTableCell*) cons t;
90 const BorderValue& borderAdjoiningCellBefore(const LayoutTableCell*) const; 91 const BorderValue& borderAdjoiningCellBefore(const LayoutTableCell*) const;
91 const BorderValue& borderAdjoiningCellAfter(const LayoutTableCell*) const; 92 const BorderValue& borderAdjoiningCellAfter(const LayoutTableCell*) const;
92 93
93 const char* name() const override { return "LayoutTableCol"; } 94 const char* name() const override { return "LayoutTableCol"; }
94 95
96 // Returns col/colgroup table-relative position.
97 // <col> elements need to provide absoluteColumnIndex.
Xianzhu 2016/03/28 00:44:42 Can you rephrase the above sentence?
atotic1 2016/03/29 17:05:16 Done.
98 // This is because <col> element with span N is treated for display as
99 // N <col> elements with span 1. It does not make sense to talk
100 // about visual <col> position, only about <col> position at
101 // particular absolute column.
Xianzhu 2016/03/28 00:44:42 I think you can omit the above comments.
atotic1 2016/03/29 17:05:16 Moved it into .cpp. The comment describes a non-in
102 LayoutRect positionByCellSpan(unsigned absoluteColumnIndex) const;
103
104 // Return indexes to all columns inside this element.
105 // Can return vector with size 0 if LayoutTableCol is out of range.
106 // <col> element can return size() > 1 if it spans multiple columns
107 // <colgroup> element can return any size.
108 Vector<unsigned> getEffectiveColumnIndexes() const;
109
95 private: 110 private:
96 LayoutObjectChildList* virtualChildren() override { return children(); } 111 LayoutObjectChildList* virtualChildren() override { return children(); }
97 const LayoutObjectChildList* virtualChildren() const override { return child ren(); } 112 const LayoutObjectChildList* virtualChildren() const override { return child ren(); }
98 113
99 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectLayoutTableCol || LayoutBox::isOfType(type); } 114 bool isOfType(LayoutObjectType type) const override { return type == LayoutO bjectLayoutTableCol || LayoutBox::isOfType(type); }
100 void updateFromElement() override; 115 void updateFromElement() override;
101 void computePreferredLogicalWidths() override { ASSERT_NOT_REACHED(); } 116 void computePreferredLogicalWidths() override { ASSERT_NOT_REACHED(); }
102 117
103 void insertedIntoTree() override; 118 void insertedIntoTree() override;
104 void willBeRemovedFromTree() override; 119 void willBeRemovedFromTree() override;
(...skipping 11 matching lines...) Expand all
116 131
117 LayoutObjectChildList m_children; 132 LayoutObjectChildList m_children;
118 unsigned m_span; 133 unsigned m_span;
119 }; 134 };
120 135
121 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCol, isLayoutTableCol()); 136 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableCol, isLayoutTableCol());
122 137
123 } // namespace blink 138 } // namespace blink
124 139
125 #endif 140 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698