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

Side by Side Diff: Source/core/rendering/RenderTable.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
« no previous file with comments | « Source/core/paint/TableSectionPainter.cpp ('k') | Source/core/rendering/RenderTable.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, 2010 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 RenderTableCell* cellBelow(const RenderTableCell*) const; 237 RenderTableCell* cellBelow(const RenderTableCell*) const;
238 RenderTableCell* cellBefore(const RenderTableCell*) const; 238 RenderTableCell* cellBefore(const RenderTableCell*) const;
239 RenderTableCell* cellAfter(const RenderTableCell*) const; 239 RenderTableCell* cellAfter(const RenderTableCell*) const;
240 240
241 typedef Vector<CollapsedBorderValue> CollapsedBorderValues; 241 typedef Vector<CollapsedBorderValue> CollapsedBorderValues;
242 void invalidateCollapsedBorders() 242 void invalidateCollapsedBorders()
243 { 243 {
244 m_collapsedBordersValid = false; 244 m_collapsedBordersValid = false;
245 m_collapsedBorders.clear(); 245 m_collapsedBorders.clear();
246 } 246 }
247
248 // FIXME: This method should be moved into TablePainter.
247 const CollapsedBorderValue* currentBorderValue() const { return m_currentBor der; } 249 const CollapsedBorderValue* currentBorderValue() const { return m_currentBor der; }
250 void setCurrentBorderValue(const CollapsedBorderValue* val) { m_currentBorde r = val; }
248 251
249 bool hasSections() const { return m_head || m_foot || m_firstBody; } 252 bool hasSections() const { return m_head || m_foot || m_firstBody; }
250 253
251 void recalcSectionsIfNeeded() const 254 void recalcSectionsIfNeeded() const
252 { 255 {
253 if (m_needsSectionRecalc) 256 if (m_needsSectionRecalc)
254 recalcSections(); 257 recalcSections();
255 } 258 }
256 259
257 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*); 260 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
258 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE 261 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE
259 { 262 {
260 return createAnonymousWithParentRenderer(parent); 263 return createAnonymousWithParentRenderer(parent);
261 } 264 }
262 265
263 const BorderValue& tableStartBorderAdjoiningCell(const RenderTableCell*) con st; 266 const BorderValue& tableStartBorderAdjoiningCell(const RenderTableCell*) con st;
264 const BorderValue& tableEndBorderAdjoiningCell(const RenderTableCell*) const ; 267 const BorderValue& tableEndBorderAdjoiningCell(const RenderTableCell*) const ;
265 268
266 void addCaption(const RenderTableCaption*); 269 void addCaption(const RenderTableCaption*);
267 void removeCaption(const RenderTableCaption*); 270 void removeCaption(const RenderTableCaption*);
268 void addColumn(const RenderTableCol*); 271 void addColumn(const RenderTableCol*);
269 void removeColumn(const RenderTableCol*); 272 void removeColumn(const RenderTableCol*);
270 273
274 // FIXME: this method should be moved into TablePainter.
275 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&) OV ERRIDE;
276
277 virtual void paintMask(PaintInfo&, const LayoutPoint&) OVERRIDE;
278
279 const CollapsedBorderValues& collapsedBorders() { return m_collapsedBorders; }
280 void subtractCaptionRect(LayoutRect&) const;
281 void recalcCollapsedBorders();
282
271 protected: 283 protected:
272 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 284 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
273 virtual void simplifiedNormalFlowLayout() OVERRIDE; 285 virtual void simplifiedNormalFlowLayout() OVERRIDE;
274 286
275 private: 287 private:
276 virtual const char* renderName() const OVERRIDE { return "RenderTable"; } 288 virtual const char* renderName() const OVERRIDE { return "RenderTable"; }
277 289
278 virtual bool isTable() const OVERRIDE { return true; } 290 virtual bool isTable() const OVERRIDE { return true; }
279 291
280 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 292 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
281 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; 293 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE;
282 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&) OV ERRIDE;
283 virtual void paintMask(PaintInfo&, const LayoutPoint&) OVERRIDE;
284 virtual void layout() OVERRIDE; 294 virtual void layout() OVERRIDE;
285 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) const OVERRIDE; 295 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) const OVERRIDE;
286 virtual void computePreferredLogicalWidths() OVERRIDE; 296 virtual void computePreferredLogicalWidths() OVERRIDE;
287 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE; 297 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
288 298
289 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const OVERRIDE; 299 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const OVERRIDE;
290 virtual int firstLineBoxBaseline() const OVERRIDE; 300 virtual int firstLineBoxBaseline() const OVERRIDE;
291 virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE; 301 virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
292 302
293 RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const; 303 RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const;
294 304
295 void updateColumnCache() const; 305 void updateColumnCache() const;
296 void invalidateCachedColumns(); 306 void invalidateCachedColumns();
297 307
298 virtual void updateLogicalWidth() OVERRIDE; 308 virtual void updateLogicalWidth() OVERRIDE;
299 309
300 LayoutUnit convertStyleLogicalWidthToComputedWidth(const Length& styleLogica lWidth, LayoutUnit availableWidth); 310 LayoutUnit convertStyleLogicalWidthToComputedWidth(const Length& styleLogica lWidth, LayoutUnit availableWidth);
301 LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogi calHeight); 311 LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogi calHeight);
302 312
303 virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScro llbarSizeRelevancy = IgnoreOverlayScrollbarSize) OVERRIDE; 313 virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScro llbarSizeRelevancy = IgnoreOverlayScrollbarSize) OVERRIDE;
304 314
305 virtual void addOverflowFromChildren() OVERRIDE; 315 virtual void addOverflowFromChildren() OVERRIDE;
306 316
307 void subtractCaptionRect(LayoutRect&) const;
308
309 void recalcCollapsedBorders();
310 void recalcSections() const; 317 void recalcSections() const;
311 void layoutCaption(RenderTableCaption*); 318 void layoutCaption(RenderTableCaption*);
312 319
313 void distributeExtraLogicalHeight(int extraLogicalHeight); 320 void distributeExtraLogicalHeight(int extraLogicalHeight);
314 321
315 mutable Vector<int> m_columnPos; 322 mutable Vector<int> m_columnPos;
316 mutable Vector<ColumnStruct> m_columns; 323 mutable Vector<ColumnStruct> m_columns;
317 mutable Vector<RenderTableCaption*> m_captions; 324 mutable Vector<RenderTableCaption*> m_captions;
318 mutable Vector<RenderTableCol*> m_columnRenderers; 325 mutable Vector<RenderTableCol*> m_columnRenderers;
319 326
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (m_firstBody) 363 if (m_firstBody)
357 return m_firstBody; 364 return m_firstBody;
358 return m_foot; 365 return m_foot;
359 } 366 }
360 367
361 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable()); 368 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable());
362 369
363 } // namespace blink 370 } // namespace blink
364 371
365 #endif // RenderTable_h 372 #endif // RenderTable_h
OLDNEW
« no previous file with comments | « Source/core/paint/TableSectionPainter.cpp ('k') | Source/core/rendering/RenderTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698