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

Side by Side Diff: Source/core/rendering/RenderTableSection.h

Issue 294783004: Use tighter typing in table rendering code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix typo / bug and update copyrights Created 6 years, 7 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 | Annotate | Revision Log
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, 2013 Apple Inc. All rights reserv ed.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
11 * License as published by the Free Software Foundation; either 11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version. 12 * version 2 of the License, or (at your option) any later version.
13 * 13 *
14 * This library is distributed in the hope that it will be useful, 14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Library General Public License for more details. 17 * Library General Public License for more details.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 }; 58 };
59 59
60 class RenderTableCell; 60 class RenderTableCell;
61 class RenderTableRow; 61 class RenderTableRow;
62 62
63 class RenderTableSection FINAL : public RenderBox { 63 class RenderTableSection FINAL : public RenderBox {
64 public: 64 public:
65 RenderTableSection(Element*); 65 RenderTableSection(Element*);
66 virtual ~RenderTableSection(); 66 virtual ~RenderTableSection();
67 67
68 // FIXME: These methods should return a RenderTableRow. 68 RenderTableRow* firstRow() const;
69 RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); } 69 RenderTableRow* lastRow() const;
70 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r eturn children()->lastChild(); }
71 70
72 const RenderObjectChildList* children() const { return &m_children; } 71 const RenderObjectChildList* children() const { return &m_children; }
73 RenderObjectChildList* children() { return &m_children; } 72 RenderObjectChildList* children() { return &m_children; }
74 73
75 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OV ERRIDE; 74 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) OV ERRIDE;
76 75
77 virtual int firstLineBoxBaseline() const OVERRIDE; 76 virtual int firstLineBoxBaseline() const OVERRIDE;
78 77
79 void addCell(RenderTableCell*, RenderTableRow* row); 78 void addCell(RenderTableCell*, RenderTableRow* row);
80 79
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObj ect*); 212 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObj ect*);
214 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE 213 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE
215 { 214 {
216 return createAnonymousWithParentRenderer(parent); 215 return createAnonymousWithParentRenderer(parent);
217 } 216 }
218 217
219 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 218 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
220 219
221 protected: 220 protected:
222 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 221 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
222 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
223 223
224 private: 224 private:
225 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); } 225 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); }
226 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu rn children(); } 226 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu rn children(); }
227 227
228 virtual const char* renderName() const OVERRIDE { return (isAnonymous() || i sPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; } 228 virtual const char* renderName() const OVERRIDE { return (isAnonymous() || i sPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
229 229
230 virtual bool isTableSection() const OVERRIDE { return true; } 230 virtual bool isTableSection() const OVERRIDE { return true; }
231 231
232 virtual void willBeRemovedFromTree() OVERRIDE; 232 virtual void willBeRemovedFromTree() OVERRIDE;
233 233
234 virtual void layout() OVERRIDE; 234 virtual void layout() OVERRIDE;
235 235
236 void paintCell(RenderTableCell*, PaintInfo&, const LayoutPoint&); 236 void paintCell(RenderTableCell*, PaintInfo&, const LayoutPoint&);
237 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; 237 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE;
238 238
239 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE; 239 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
240 240
241 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
242
243 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; } 241 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; }
244 242
245 void ensureRows(unsigned); 243 void ensureRows(unsigned);
246 244
247 bool rowHasOnlySpanningCells(unsigned); 245 bool rowHasOnlySpanningCells(unsigned);
248 unsigned calcRowHeightHavingOnlySpanningCells(unsigned); 246 unsigned calcRowHeightHavingOnlySpanningCells(unsigned);
249 void updateRowsHeightHavingOnlySpanningCells(RenderTableCell*, struct Spanni ngRowsHeight&); 247 void updateRowsHeightHavingOnlySpanningCells(RenderTableCell*, struct Spanni ngRowsHeight&);
250 bool isHeightNeededForRowHavingOnlySpanningCells(unsigned); 248 bool isHeightNeededForRowHavingOnlySpanningCells(unsigned);
251 249
252 void populateSpanningRowsHeightFromCell(RenderTableCell*, struct SpanningRow sHeight&); 250 void populateSpanningRowsHeightFromCell(RenderTableCell*, struct SpanningRow sHeight&);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // This map holds the collapsed border values for cells with collapsed borde rs. 305 // This map holds the collapsed border values for cells with collapsed borde rs.
308 // It is held at RenderTableSection level to spare memory consumption by tab le cells. 306 // It is held at RenderTableSection level to spare memory consumption by tab le cells.
309 HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue > m_cellsCol lapsedBorders; 307 HashMap<pair<const RenderTableCell*, int>, CollapsedBorderValue > m_cellsCol lapsedBorders;
310 }; 308 };
311 309
312 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableSection, isTableSection()); 310 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTableSection, isTableSection());
313 311
314 } // namespace WebCore 312 } // namespace WebCore
315 313
316 #endif // RenderTableSection_h 314 #endif // RenderTableSection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698