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

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

Issue 2884763003: Combine and simplify LayoutTableSection::DirtiedRows() and DirtiedEffectiveColumns() (Closed)
Patch Set: Rebase on origin/master Created 3 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
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 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights
8 * reserved. 8 * reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 21 matching lines...) Expand all
32 #include "core/layout/TableGridCell.h" 32 #include "core/layout/TableGridCell.h"
33 #include "platform/wtf/Vector.h" 33 #include "platform/wtf/Vector.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 // Helper class for paintObject. 37 // Helper class for paintObject.
38 class CellSpan { 38 class CellSpan {
39 STACK_ALLOCATED(); 39 STACK_ALLOCATED();
40 40
41 public: 41 public:
42 CellSpan() : start_(0), end_(0) {}
42 CellSpan(unsigned start, unsigned end) : start_(start), end_(end) {} 43 CellSpan(unsigned start, unsigned end) : start_(start), end_(end) {}
43 44
44 unsigned Start() const { return start_; } 45 unsigned Start() const { return start_; }
45 unsigned end() const { return end_; } 46 unsigned End() const { return end_; }
46 47
47 void DecreaseStart() { --start_; } 48 void DecreaseStart() { --start_; }
48 void IncreaseEnd() { ++end_; } 49 void IncreaseEnd() { ++end_; }
49 50
50 void EnsureConsistency(const unsigned); 51 void EnsureConsistency(const unsigned);
51 52
52 private: 53 private:
53 unsigned start_; 54 unsigned start_;
54 unsigned end_; 55 unsigned end_;
55 }; 56 };
56 57
57 inline bool operator==(const CellSpan& s1, const CellSpan& s2) { 58 inline bool operator==(const CellSpan& s1, const CellSpan& s2) {
58 return s1.Start() == s2.Start() && s1.end() == s2.end(); 59 return s1.Start() == s2.Start() && s1.End() == s2.End();
59 } 60 }
60 inline bool operator!=(const CellSpan& s1, const CellSpan& s2) { 61 inline bool operator!=(const CellSpan& s1, const CellSpan& s2) {
61 return !(s1 == s2); 62 return !(s1 == s2);
62 } 63 }
63 64
64 class LayoutTableCell; 65 class LayoutTableCell;
65 class LayoutTableRow; 66 class LayoutTableRow;
66 67
67 // LayoutTableSection is used to represent table row group (display: 68 // LayoutTableSection is used to represent table row group (display:
68 // table-row-group), header group (display: table-header-group) and footer group 69 // table-row-group), header group (display: table-header-group) and footer group
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 const LayoutObject* parent) const override { 254 const LayoutObject* parent) const override {
254 return CreateAnonymousWithParent(parent); 255 return CreateAnonymousWithParent(parent);
255 } 256 }
256 257
257 void Paint(const PaintInfo&, const LayoutPoint&) const override; 258 void Paint(const PaintInfo&, const LayoutPoint&) const override;
258 259
259 // Flip the rect so it aligns with the coordinates used by the rowPos and 260 // Flip the rect so it aligns with the coordinates used by the rowPos and
260 // columnPos vectors. 261 // columnPos vectors.
261 LayoutRect LogicalRectForWritingModeAndDirection(const LayoutRect&) const; 262 LayoutRect LogicalRectForWritingModeAndDirection(const LayoutRect&) const;
262 263
263 // Returns a row or column span covering all grid slots from each of which 264 // Sets |rows| and |columns| to cover all cells needing repaint in
264 // a primary cell intersecting |visualRect| originates. 265 // |damage_rect|.
265 CellSpan DirtiedRows(const LayoutRect& visual_rect) const; 266 void DirtiedRowsAndEffectiveColumns(const LayoutRect& damage_rect,
266 CellSpan DirtiedEffectiveColumns(const LayoutRect& visual_rect) const; 267 CellSpan& rows,
268 CellSpan& columns) const;
267 269
268 const HashSet<const LayoutTableCell*>& OverflowingCells() const { 270 const HashSet<const LayoutTableCell*>& OverflowingCells() const {
269 return overflowing_cells_; 271 return overflowing_cells_;
270 } 272 }
271 bool HasOverflowingCell() const { 273 bool HasOverflowingCell() const {
272 return overflowing_cells_.size() || force_full_paint_; 274 return overflowing_cells_.size() || force_full_paint_;
273 } 275 }
274 bool HasMultipleCellLevels() const { return has_multiple_cell_levels_; } 276 bool HasMultipleCellLevels() const { return has_multiple_cell_levels_; }
275 277
276 const char* GetName() const override { return "LayoutTableSection"; } 278 const char* GetName() const override { return "LayoutTableSection"; }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 455
454 // Whether any cell spans multiple rows or cols. 456 // Whether any cell spans multiple rows or cols.
455 bool has_spanning_cells_; 457 bool has_spanning_cells_;
456 }; 458 };
457 459
458 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection()); 460 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection());
459 461
460 } // namespace blink 462 } // namespace blink
461 463
462 #endif // LayoutTableSection_h 464 #endif // LayoutTableSection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698