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

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

Issue 576823004: Move painting code for tables into *Paint classes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 3 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, 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 int distributeExtraLogicalHeightToRows(int extraLogicalHeight); 217 int distributeExtraLogicalHeightToRows(int extraLogicalHeight);
218 218
219 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObj ect*); 219 static RenderTableSection* createAnonymousWithParentRenderer(const RenderObj ect*);
220 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE 220 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE
221 { 221 {
222 return createAnonymousWithParentRenderer(parent); 222 return createAnonymousWithParentRenderer(parent);
223 } 223 }
224 224
225 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 225 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
226 226
227 // Flip the rect so it aligns with the coordinates used by the rowPos and co lumnPos vectors.
228 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const;
mstensho (USE GERRIT) 2014/09/19 10:50:11 Shouldn't there be a blank line after this to make
chrishtr 2014/09/19 16:35:24 Done.
229 CellSpan dirtiedRows(const LayoutRect& paintInvalidationRect) const;
230 CellSpan dirtiedColumns(const LayoutRect& paintInvalidationRect) const;
231 WillBeHeapHashSet<RawPtrWillBeMember<RenderTableCell> >& overflowingCells() { return m_overflowingCells; }
232 bool hasMultipleCellLevels() { return m_hasMultipleCellLevels; }
233
227 protected: 234 protected:
228 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 235 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
229 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE; 236 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
230 237
231 private: 238 private:
232 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); } 239 virtual RenderObjectChildList* virtualChildren() OVERRIDE { return children( ); }
233 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu rn children(); } 240 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE { retu rn children(); }
234 241
235 virtual const char* renderName() const OVERRIDE { return (isAnonymous() || i sPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; } 242 virtual const char* renderName() const OVERRIDE { return (isAnonymous() || i sPseudoElement()) ? "RenderTableSection (anonymous)" : "RenderTableSection"; }
236 243
237 virtual bool isTableSection() const OVERRIDE { return true; } 244 virtual bool isTableSection() const OVERRIDE { return true; }
238 245
239 virtual void willBeRemovedFromTree() OVERRIDE; 246 virtual void willBeRemovedFromTree() OVERRIDE;
240 247
241 virtual void layout() OVERRIDE; 248 virtual void layout() OVERRIDE;
242 249
243 void paintCell(RenderTableCell*, PaintInfo&, const LayoutPoint&);
244 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; 250 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE;
245 251
246 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE; 252 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE;
247 253
248 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; } 254 int borderSpacingForRow(unsigned row) const { return m_grid[row].rowRenderer ? table()->vBorderSpacing() : 0; }
249 255
250 void ensureRows(unsigned); 256 void ensureRows(unsigned);
251 257
252 bool rowHasOnlySpanningCells(unsigned); 258 bool rowHasOnlySpanningCells(unsigned);
253 unsigned calcRowHeightHavingOnlySpanningCells(unsigned); 259 unsigned calcRowHeightHavingOnlySpanningCells(unsigned);
254 void updateRowsHeightHavingOnlySpanningCells(RenderTableCell*, struct Spanni ngRowsHeight&); 260 void updateRowsHeightHavingOnlySpanningCells(RenderTableCell*, struct Spanni ngRowsHeight&);
255 bool isHeightNeededForRowHavingOnlySpanningCells(unsigned); 261 bool isHeightNeededForRowHavingOnlySpanningCells(unsigned);
256 262
257 void populateSpanningRowsHeightFromCell(RenderTableCell*, struct SpanningRow sHeight&); 263 void populateSpanningRowsHeightFromCell(RenderTableCell*, struct SpanningRow sHeight&);
258 void distributeExtraRowSpanHeightToPercentRows(RenderTableCell*, int, int&, Vector<int>&); 264 void distributeExtraRowSpanHeightToPercentRows(RenderTableCell*, int, int&, Vector<int>&);
259 void distributeWholeExtraRowSpanHeightToPercentRows(RenderTableCell*, int, i nt&, Vector<int>&); 265 void distributeWholeExtraRowSpanHeightToPercentRows(RenderTableCell*, int, i nt&, Vector<int>&);
260 void distributeExtraRowSpanHeightToAutoRows(RenderTableCell*, int, int&, Vec tor<int>&); 266 void distributeExtraRowSpanHeightToAutoRows(RenderTableCell*, int, int&, Vec tor<int>&);
261 void distributeExtraRowSpanHeightToRemainingRows(RenderTableCell*, int, int& , Vector<int>&); 267 void distributeExtraRowSpanHeightToRemainingRows(RenderTableCell*, int, int& , Vector<int>&);
262 void distributeRowSpanHeightToRows(SpanningRenderTableCells& rowSpanCells); 268 void distributeRowSpanHeightToRows(SpanningRenderTableCells& rowSpanCells);
263 269
264 void distributeExtraLogicalHeightToPercentRows(int& extraLogicalHeight, int totalPercent); 270 void distributeExtraLogicalHeightToPercentRows(int& extraLogicalHeight, int totalPercent);
265 void distributeExtraLogicalHeightToAutoRows(int& extraLogicalHeight, unsigne d autoRowsCount); 271 void distributeExtraLogicalHeightToAutoRows(int& extraLogicalHeight, unsigne d autoRowsCount);
266 void distributeRemainingExtraLogicalHeight(int& extraLogicalHeight); 272 void distributeRemainingExtraLogicalHeight(int& extraLogicalHeight);
267 273
268 void updateBaselineForCell(RenderTableCell*, unsigned row, LayoutUnit& basel ineDescent); 274 void updateBaselineForCell(RenderTableCell*, unsigned row, LayoutUnit& basel ineDescent);
269 275
270 bool hasOverflowingCell() const { return m_overflowingCells.size() || m_forc eSlowPaintPathWithOverflowingCell; } 276 bool hasOverflowingCell() const { return m_overflowingCells.size() || m_forc eSlowPaintPathWithOverflowingCell; }
277
271 void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols); 278 void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols);
272 279
273 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); } 280 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); }
274 CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns() .size()); } 281 CellSpan fullTableColumnSpan() const { return CellSpan(0, table()->columns() .size()); }
275 282
276 // Flip the rect so it aligns with the coordinates used by the rowPos and co lumnPos vectors.
277 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const;
278
279 CellSpan dirtiedRows(const LayoutRect& paintInvalidationRect) const;
280 CellSpan dirtiedColumns(const LayoutRect& paintInvalidationRect) const;
281
282 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection. 283 // These two functions take a rectangle as input that has been flipped by lo gicalRectForWritingModeAndDirection.
283 // The returned span of rows or columns is end-exclusive, and empty if start ==end. 284 // The returned span of rows or columns is end-exclusive, and empty if start ==end.
284 CellSpan spannedRows(const LayoutRect& flippedRect) const; 285 CellSpan spannedRows(const LayoutRect& flippedRect) const;
285 CellSpan spannedColumns(const LayoutRect& flippedRect) const; 286 CellSpan spannedColumns(const LayoutRect& flippedRect) const;
286 287
287 void setLogicalPositionForCell(RenderTableCell*, unsigned effectiveColumn) c onst; 288 void setLogicalPositionForCell(RenderTableCell*, unsigned effectiveColumn) c onst;
288 289
289 RenderObjectChildList m_children; 290 RenderObjectChildList m_children;
290 291
291 WillBeHeapVector<RowStruct> m_grid; 292 WillBeHeapVector<RowStruct> m_grid;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 static const bool needsDestruction = false; 327 static const bool needsDestruction = false;
327 }; 328 };
328 template<> struct VectorTraits<blink::RenderTableSection::RowStruct> : VectorTra itsBase<blink::RenderTableSection::RowStruct> { 329 template<> struct VectorTraits<blink::RenderTableSection::RowStruct> : VectorTra itsBase<blink::RenderTableSection::RowStruct> {
329 static const bool needsDestruction = false; 330 static const bool needsDestruction = false;
330 }; 331 };
331 #endif 332 #endif
332 333
333 } 334 }
334 335
335 #endif // RenderTableSection_h 336 #endif // RenderTableSection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698