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

Side by Side Diff: Source/core/layout/LayoutTableSection.h

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
« no previous file with comments | « Source/core/layout/LayoutTableRow.cpp ('k') | Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2013 Apple Inc. All rights reserv ed. 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
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 class LayoutTableRow; 64 class LayoutTableRow;
65 65
66 class LayoutTableSection final : public RenderBox { 66 class LayoutTableSection final : public RenderBox {
67 public: 67 public:
68 LayoutTableSection(Element*); 68 LayoutTableSection(Element*);
69 virtual ~LayoutTableSection(); 69 virtual ~LayoutTableSection();
70 70
71 LayoutTableRow* firstRow() const; 71 LayoutTableRow* firstRow() const;
72 LayoutTableRow* lastRow() const; 72 LayoutTableRow* lastRow() const;
73 73
74 const RenderObjectChildList* children() const { return &m_children; } 74 const LayoutObjectChildList* children() const { return &m_children; }
75 RenderObjectChildList* children() { return &m_children; } 75 LayoutObjectChildList* children() { return &m_children; }
76 76
77 virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0) ov erride; 77 virtual void addChild(LayoutObject* child, LayoutObject* beforeChild = 0) ov erride;
78 78
79 virtual int firstLineBoxBaseline() const override; 79 virtual int firstLineBoxBaseline() const override;
80 80
81 void addCell(LayoutTableCell*, LayoutTableRow*); 81 void addCell(LayoutTableCell*, LayoutTableRow*);
82 82
83 int calcRowLogicalHeight(); 83 int calcRowLogicalHeight();
84 void layoutRows(); 84 void layoutRows();
85 void computeOverflowFromCells(); 85 void computeOverflowFromCells();
86 86
87 LayoutTable* table() const { return toLayoutTable(parent()); } 87 LayoutTable* table() const { return toLayoutTable(parent()); }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 void rowLogicalHeightChanged(LayoutTableRow*); 207 void rowLogicalHeightChanged(LayoutTableRow*);
208 208
209 void removeCachedCollapsedBorders(const LayoutTableCell*); 209 void removeCachedCollapsedBorders(const LayoutTableCell*);
210 void setCachedCollapsedBorder(const LayoutTableCell*, CollapsedBorderSide, C ollapsedBorderValue); 210 void setCachedCollapsedBorder(const LayoutTableCell*, CollapsedBorderSide, C ollapsedBorderValue);
211 CollapsedBorderValue& cachedCollapsedBorder(const LayoutTableCell*, Collapse dBorderSide); 211 CollapsedBorderValue& cachedCollapsedBorder(const LayoutTableCell*, Collapse dBorderSide);
212 212
213 // distributeExtraLogicalHeightToRows methods return the *consumed* extra lo gical height. 213 // distributeExtraLogicalHeightToRows methods return the *consumed* extra lo gical height.
214 // FIXME: We may want to introduce a structure holding the in-flux layout in formation. 214 // FIXME: We may want to introduce a structure holding the in-flux layout in formation.
215 int distributeExtraLogicalHeightToRows(int extraLogicalHeight); 215 int distributeExtraLogicalHeightToRows(int extraLogicalHeight);
216 216
217 static LayoutTableSection* createAnonymousWithParentRenderer(const RenderObj ect*); 217 static LayoutTableSection* createAnonymousWithParentRenderer(const LayoutObj ect*);
218 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const override 218 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare nt) const override
219 { 219 {
220 return createAnonymousWithParentRenderer(parent); 220 return createAnonymousWithParentRenderer(parent);
221 } 221 }
222 222
223 virtual void paint(const PaintInfo&, const LayoutPoint&) override; 223 virtual void paint(const PaintInfo&, const LayoutPoint&) override;
224 224
225 // Flip the rect so it aligns with the coordinates used by the rowPos and co lumnPos vectors. 225 // Flip the rect so it aligns with the coordinates used by the rowPos and co lumnPos vectors.
226 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const; 226 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const;
227 227
228 CellSpan dirtiedRows(const LayoutRect& paintInvalidationRect) const; 228 CellSpan dirtiedRows(const LayoutRect& paintInvalidationRect) const;
229 CellSpan dirtiedColumns(const LayoutRect& paintInvalidationRect) const; 229 CellSpan dirtiedColumns(const LayoutRect& paintInvalidationRect) const;
230 HashSet<LayoutTableCell*>& overflowingCells() { return m_overflowingCells; } 230 HashSet<LayoutTableCell*>& overflowingCells() { return m_overflowingCells; }
231 bool hasMultipleCellLevels() { return m_hasMultipleCellLevels; } 231 bool hasMultipleCellLevels() { return m_hasMultipleCellLevels; }
232 232
233 protected: 233 protected:
234 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride; 234 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov erride;
235 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override; 235 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) override;
236 236
237 private: 237 private:
238 virtual RenderObjectChildList* virtualChildren() override { return children( ); } 238 virtual LayoutObjectChildList* virtualChildren() override { return children( ); }
239 virtual const RenderObjectChildList* virtualChildren() const override { retu rn children(); } 239 virtual const LayoutObjectChildList* virtualChildren() const override { retu rn children(); }
240 240
241 virtual const char* renderName() const override { return (isAnonymous() || i sPseudoElement()) ? "LayoutTableSection (anonymous)" : "LayoutTableSection"; } 241 virtual const char* renderName() const override { return (isAnonymous() || i sPseudoElement()) ? "LayoutTableSection (anonymous)" : "LayoutTableSection"; }
242 242
243 virtual bool isOfType(RenderObjectType type) const override { return type == RenderObjectTableSection || RenderBox::isOfType(type); } 243 virtual bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectTableSection || RenderBox::isOfType(type); }
244 244
245 virtual void willBeRemovedFromTree() override; 245 virtual void willBeRemovedFromTree() override;
246 246
247 virtual void layout() override; 247 virtual void layout() override;
248 248
249 virtual void paintObject(const PaintInfo&, const LayoutPoint&) override; 249 virtual void paintObject(const PaintInfo&, const LayoutPoint&) override;
250 250
251 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; 251 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override;
252 252
253 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; } 253 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; }
(...skipping 24 matching lines...) Expand all
278 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); } 278 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); }
279 CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns() .size()); } 279 CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns() .size()); }
280 280
281 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection. 281 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection.
282 // The returned span of rows or columns is end-exclusive, and empty if start ==end. 282 // The returned span of rows or columns is end-exclusive, and empty if start ==end.
283 CellSpan spannedRows(const LayoutRect& flippedRect) const; 283 CellSpan spannedRows(const LayoutRect& flippedRect) const;
284 CellSpan spannedColumns(const LayoutRect& flippedRect) const; 284 CellSpan spannedColumns(const LayoutRect& flippedRect) const;
285 285
286 void setLogicalPositionForCell(LayoutTableCell*, unsigned effectiveColumn) c onst; 286 void setLogicalPositionForCell(LayoutTableCell*, unsigned effectiveColumn) c onst;
287 287
288 RenderObjectChildList m_children; 288 LayoutObjectChildList m_children;
289 289
290 Vector<RowStruct> m_grid; 290 Vector<RowStruct> m_grid;
291 Vector<int> m_rowPos; 291 Vector<int> m_rowPos;
292 292
293 // the current insertion position 293 // the current insertion position
294 unsigned m_cCol; 294 unsigned m_cCol;
295 unsigned m_cRow; 295 unsigned m_cRow;
296 296
297 int m_outerBorderStart; 297 int m_outerBorderStart;
298 int m_outerBorderEnd; 298 int m_outerBorderEnd;
299 int m_outerBorderBefore; 299 int m_outerBorderBefore;
300 int m_outerBorderAfter; 300 int m_outerBorderAfter;
301 301
302 bool m_needsCellRecalc; 302 bool m_needsCellRecalc;
303 303
304 // This HashSet holds the overflowing cells for faster painting. 304 // This HashSet holds the overflowing cells for faster painting.
305 // If we have more than gMaxAllowedOverflowingCellRatio * total cells, it wi ll be empty 305 // If we have more than gMaxAllowedOverflowingCellRatio * total cells, it wi ll be empty
306 // and m_forceSlowPaintPathWithOverflowingCell will be set to save memory. 306 // and m_forceSlowPaintPathWithOverflowingCell will be set to save memory.
307 HashSet<LayoutTableCell*> m_overflowingCells; 307 HashSet<LayoutTableCell*> m_overflowingCells;
308 bool m_forceSlowPaintPathWithOverflowingCell; 308 bool m_forceSlowPaintPathWithOverflowingCell;
309 309
310 bool m_hasMultipleCellLevels; 310 bool m_hasMultipleCellLevels;
311 311
312 // This map holds the collapsed border values for cells with collapsed borde rs. 312 // This map holds the collapsed border values for cells with collapsed borde rs.
313 // It is held at LayoutTableSection level to spare memory consumption by tab le cells. 313 // It is held at LayoutTableSection level to spare memory consumption by tab le cells.
314 HashMap<pair<const LayoutTableCell*, int>, CollapsedBorderValue> m_cellsColl apsedBorders; 314 HashMap<pair<const LayoutTableCell*, int>, CollapsedBorderValue> m_cellsColl apsedBorders;
315 }; 315 };
316 316
317 DEFINE_RENDER_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); 317 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection());
318 318
319 } // namespace blink 319 } // namespace blink
320 320
321 #endif // LayoutTableSection_h 321 #endif // LayoutTableSection_h
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTableRow.cpp ('k') | Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698