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

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
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 const CollapsedBorderValue* currentBorderValue() const { return m_currentBor der; } 247 const CollapsedBorderValue* currentBorderValue() const { return m_currentBor der; }
248 void setCurrentBorderValue(const CollapsedBorderValue* val) { m_currentBorde r = val; }
mstensho (USE GERRIT) 2014/09/19 10:50:11 m_currentBorder is for painting. So am I right in
chrishtr 2014/09/19 16:35:24 Done.
248 249
249 bool hasSections() const { return m_head || m_foot || m_firstBody; } 250 bool hasSections() const { return m_head || m_foot || m_firstBody; }
250 251
251 void recalcSectionsIfNeeded() const 252 void recalcSectionsIfNeeded() const
252 { 253 {
253 if (m_needsSectionRecalc) 254 if (m_needsSectionRecalc)
254 recalcSections(); 255 recalcSections();
255 } 256 }
256 257
257 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*); 258 static RenderTable* createAnonymousWithParentRenderer(const RenderObject*);
258 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE 259 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare nt) const OVERRIDE
259 { 260 {
260 return createAnonymousWithParentRenderer(parent); 261 return createAnonymousWithParentRenderer(parent);
261 } 262 }
262 263
263 const BorderValue& tableStartBorderAdjoiningCell(const RenderTableCell*) con st; 264 const BorderValue& tableStartBorderAdjoiningCell(const RenderTableCell*) con st;
264 const BorderValue& tableEndBorderAdjoiningCell(const RenderTableCell*) const ; 265 const BorderValue& tableEndBorderAdjoiningCell(const RenderTableCell*) const ;
265 266
266 void addCaption(const RenderTableCaption*); 267 void addCaption(const RenderTableCaption*);
267 void removeCaption(const RenderTableCaption*); 268 void removeCaption(const RenderTableCaption*);
268 void addColumn(const RenderTableCol*); 269 void addColumn(const RenderTableCol*);
269 void removeColumn(const RenderTableCol*); 270 void removeColumn(const RenderTableCol*);
270 271
272 // FIXME: get rid of this method and move to paint/
273 virtual void paintBoxDecorationBackground(PaintInfo&, const LayoutPoint&) OV ERRIDE;
mstensho (USE GERRIT) 2014/09/19 10:50:11 If the above comment only refers to this method, I
chrishtr 2014/09/19 16:35:24 Done.
274 virtual void paintMask(PaintInfo&, const LayoutPoint&) OVERRIDE;
275
276 const CollapsedBorderValues& collapsedBorders() { return m_collapsedBorders; }
277 void subtractCaptionRect(LayoutRect&) const;
278 void recalcCollapsedBorders();
279
271 protected: 280 protected:
272 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE; 281 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE;
273 virtual void simplifiedNormalFlowLayout() OVERRIDE; 282 virtual void simplifiedNormalFlowLayout() OVERRIDE;
274 283
275 private: 284 private:
276 virtual const char* renderName() const OVERRIDE { return "RenderTable"; } 285 virtual const char* renderName() const OVERRIDE { return "RenderTable"; }
277 286
278 virtual bool isTable() const OVERRIDE { return true; } 287 virtual bool isTable() const OVERRIDE { return true; }
279 288
280 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; 289 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
281 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; 290 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; 291 virtual void layout() OVERRIDE;
285 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) const OVERRIDE; 292 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minWidth, LayoutUnit& maxWidth) const OVERRIDE;
286 virtual void computePreferredLogicalWidths() OVERRIDE; 293 virtual void computePreferredLogicalWidths() OVERRIDE;
287 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE; 294 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
288 295
289 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const OVERRIDE; 296 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const OVERRIDE;
290 virtual int firstLineBoxBaseline() const OVERRIDE; 297 virtual int firstLineBoxBaseline() const OVERRIDE;
291 virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE; 298 virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
292 299
293 RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const; 300 RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const;
294 301
295 void updateColumnCache() const; 302 void updateColumnCache() const;
296 void invalidateCachedColumns(); 303 void invalidateCachedColumns();
297 304
298 virtual void updateLogicalWidth() OVERRIDE; 305 virtual void updateLogicalWidth() OVERRIDE;
299 306
300 LayoutUnit convertStyleLogicalWidthToComputedWidth(const Length& styleLogica lWidth, LayoutUnit availableWidth); 307 LayoutUnit convertStyleLogicalWidthToComputedWidth(const Length& styleLogica lWidth, LayoutUnit availableWidth);
301 LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogi calHeight); 308 LayoutUnit convertStyleLogicalHeightToComputedHeight(const Length& styleLogi calHeight);
302 309
303 virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScro llbarSizeRelevancy = IgnoreOverlayScrollbarSize) OVERRIDE; 310 virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScro llbarSizeRelevancy = IgnoreOverlayScrollbarSize) OVERRIDE;
304 311
305 virtual void addOverflowFromChildren() OVERRIDE; 312 virtual void addOverflowFromChildren() OVERRIDE;
306 313
307 void subtractCaptionRect(LayoutRect&) const;
308
309 void recalcCollapsedBorders();
310 void recalcSections() const; 314 void recalcSections() const;
311 void layoutCaption(RenderTableCaption*); 315 void layoutCaption(RenderTableCaption*);
312 316
313 void distributeExtraLogicalHeight(int extraLogicalHeight); 317 void distributeExtraLogicalHeight(int extraLogicalHeight);
314 318
315 mutable Vector<int> m_columnPos; 319 mutable Vector<int> m_columnPos;
316 mutable Vector<ColumnStruct> m_columns; 320 mutable Vector<ColumnStruct> m_columns;
317 mutable Vector<RenderTableCaption*> m_captions; 321 mutable Vector<RenderTableCaption*> m_captions;
318 mutable Vector<RenderTableCol*> m_columnRenderers; 322 mutable Vector<RenderTableCol*> m_columnRenderers;
319 323
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (m_firstBody) 360 if (m_firstBody)
357 return m_firstBody; 361 return m_firstBody;
358 return m_foot; 362 return m_foot;
359 } 363 }
360 364
361 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable()); 365 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderTable, isTable());
362 366
363 } // namespace blink 367 } // namespace blink
364 368
365 #endif // RenderTable_h 369 #endif // RenderTable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698