~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/rendering/RenderTableSection.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * This file is part of the DOM implementation for KDE.
3
 
 *
4
2
 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
5
3
 *           (C) 1997 Torben Weis (weis@kde.org)
6
4
 *           (C) 1998 Waldo Bastian (bastian@kde.org)
7
5
 *           (C) 1999 Lars Knoll (knoll@kde.org)
8
6
 *           (C) 1999 Antti Koivisto (koivisto@kde.org)
9
 
 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
 
7
 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
10
8
 *
11
9
 * This library is free software; you can redistribute it and/or
12
10
 * modify it under the terms of the GNU Library General Public
33
31
namespace WebCore {
34
32
 
35
33
class RenderTableCell;
 
34
class RenderTableRow;
36
35
 
37
 
class RenderTableSection : public RenderContainer {
 
36
class RenderTableSection : public RenderBox {
38
37
public:
39
38
    RenderTableSection(Node*);
40
 
    ~RenderTableSection();
41
 
 
42
 
    virtual const char* renderName() const { return isAnonymous() ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
43
 
 
44
 
    virtual bool isTableSection() const { return true; }
45
 
 
46
 
    virtual void destroy();
 
39
    virtual ~RenderTableSection();
 
40
 
 
41
    const RenderObjectChildList* children() const { return &m_children; }
 
42
    RenderObjectChildList* children() { return &m_children; }
47
43
 
48
44
    virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0);
49
45
 
50
 
    virtual int getBaselineOfFirstLineBox() const;
 
46
    virtual int firstLineBoxBaseline() const;
51
47
 
52
 
    void addCell(RenderTableCell*, RenderObject* row);
 
48
    void addCell(RenderTableCell*, RenderTableRow* row);
53
49
 
54
50
    void setCellWidths();
55
51
    int calcRowHeight();
56
52
    int layoutRows(int height);
57
53
 
58
 
    RenderTable* table() const { return static_cast<RenderTable*>(parent()); }
 
54
    RenderTable* table() const { return toRenderTable(parent()); }
59
55
 
60
56
    struct CellStruct {
61
57
        RenderTableCell* cell;
66
62
 
67
63
    struct RowStruct {
68
64
        Row* row;
69
 
        RenderObject* rowRenderer;
 
65
        RenderTableRow* rowRenderer;
70
66
        int baseline;
71
67
        Length height;
72
68
    };
77
73
    void appendColumn(int pos);
78
74
    void splitColumn(int pos, int newSize);
79
75
 
80
 
    virtual int overflowWidth(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_width : m_overflowWidth; }
81
 
    virtual int overflowLeft(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowLeft; }
82
 
    virtual int overflowHeight(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? m_height : m_overflowHeight; }
83
 
    virtual int overflowTop(bool includeInterior = true) const { return (!includeInterior && hasOverflowClip()) ? 0 : m_overflowTop; }
84
 
 
85
 
    virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
86
 
    virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
87
 
    virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
88
 
 
89
76
    int calcOuterBorderTop() const;
90
77
    int calcOuterBorderBottom() const;
91
78
    int calcOuterBorderLeft(bool rtl) const;
97
84
    int outerBorderLeft() const { return m_outerBorderLeft; }
98
85
    int outerBorderRight() const { return m_outerBorderRight; }
99
86
 
100
 
    virtual void paint(PaintInfo&, int tx, int ty);
101
 
    virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
102
 
 
103
87
    int numRows() const { return m_gridRows; }
104
88
    int numColumns() const;
105
89
    void recalcCells();
118
102
 
119
103
    int getBaseline(int row) { return m_grid[row].baseline; }
120
104
 
121
 
    virtual RenderObject* removeChildNode(RenderObject*, bool fullRemove = true);
 
105
private:
 
106
    virtual RenderObjectChildList* virtualChildren() { return children(); }
 
107
    virtual const RenderObjectChildList* virtualChildren() const { return children(); }
 
108
 
 
109
    virtual const char* renderName() const { return isAnonymous() ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
 
110
 
 
111
    virtual bool isTableSection() const { return true; }
 
112
 
 
113
    virtual void destroy();
 
114
 
 
115
    virtual void layout();
 
116
 
 
117
    virtual void removeChild(RenderObject* oldChild);
 
118
 
 
119
    virtual int lowestPosition(bool includeOverflowInterior, bool includeSelf) const;
 
120
    virtual int rightmostPosition(bool includeOverflowInterior, bool includeSelf) const;
 
121
    virtual int leftmostPosition(bool includeOverflowInterior, bool includeSelf) const;
 
122
 
 
123
    virtual void paint(PaintInfo&, int tx, int ty);
 
124
    virtual void paintObject(PaintInfo&, int tx, int ty);
 
125
 
 
126
    virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
122
127
 
123
128
    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
124
129
 
125
 
private:
126
130
    virtual int lineHeight(bool, bool) const { return 0; }
127
 
    virtual void position(InlineBox*) { }
128
131
 
129
132
    bool ensureRows(int);
130
133
    void clearGrid();
131
134
 
 
135
    RenderObjectChildList m_children;
 
136
 
132
137
    Vector<RowStruct> m_grid;
 
138
    Vector<int> m_rowPos;
 
139
 
133
140
    int m_gridRows;
134
 
    Vector<int> m_rowPos;
135
141
 
136
142
    // the current insertion position
137
143
    int m_cCol;
138
144
    int m_cRow;
139
 
    bool m_needsCellRecalc;
140
145
 
141
146
    int m_outerBorderLeft;
142
147
    int m_outerBorderRight;
143
148
    int m_outerBorderTop;
144
149
    int m_outerBorderBottom;
145
 
    int m_overflowLeft;
146
 
    int m_overflowWidth;
147
 
    int m_overflowTop;
148
 
    int m_overflowHeight;
 
150
 
 
151
    bool m_needsCellRecalc;
149
152
    bool m_hasOverflowingCell;
150
153
};
151
154
 
 
155
inline RenderTableSection* toRenderTableSection(RenderObject* object)
 
156
{
 
157
    ASSERT(!object || object->isTableSection());
 
158
    return static_cast<RenderTableSection*>(object);
 
159
}
 
160
 
 
161
inline const RenderTableSection* toRenderTableSection(const RenderObject* object)
 
162
{
 
163
    ASSERT(!object || object->isTableSection());
 
164
    return static_cast<const RenderTableSection*>(object);
 
165
}
 
166
 
 
167
// This will catch anyone doing an unnecessary cast.
 
168
void toRenderTableSection(const RenderTableSection*);
 
169
 
152
170
} // namespace WebCore
153
171
 
154
172
#endif // RenderTableSection_h