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

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

Issue 2884763003: Combine and simplify LayoutTableSection::DirtiedRows() and DirtiedEffectiveColumns() (Closed)
Patch Set: - 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 const LayoutObject* parent) const override { 257 const LayoutObject* parent) const override {
257 return CreateAnonymousWithParent(parent); 258 return CreateAnonymousWithParent(parent);
258 } 259 }
259 260
260 void Paint(const PaintInfo&, const LayoutPoint&) const override; 261 void Paint(const PaintInfo&, const LayoutPoint&) const override;
261 262
262 // Flip the rect so it aligns with the coordinates used by the rowPos and 263 // Flip the rect so it aligns with the coordinates used by the rowPos and
263 // columnPos vectors. 264 // columnPos vectors.
264 LayoutRect LogicalRectForWritingModeAndDirection(const LayoutRect&) const; 265 LayoutRect LogicalRectForWritingModeAndDirection(const LayoutRect&) const;
265 266
266 // Returns a row or column span covering all grid slots from each of which 267 // Sets |rows| and |columns| to cover all cells needing repaint in
267 // a primary cell intersecting |visualRect| originates. 268 // |damage_rect|.
268 CellSpan DirtiedRows(const LayoutRect& visual_rect) const; 269 void DirtiedRowsAndEffectiveColumns(const LayoutRect& damage_rect,
269 CellSpan DirtiedEffectiveColumns(const LayoutRect& visual_rect) const; 270 CellSpan& rows,
271 CellSpan& columns) const;
270 272
271 const HashSet<const LayoutTableCell*>& OverflowingCells() const { 273 const HashSet<const LayoutTableCell*>& OverflowingCells() const {
272 return overflowing_cells_; 274 return overflowing_cells_;
273 } 275 }
274 bool HasOverflowingCell() const { 276 bool HasOverflowingCell() const {
275 return overflowing_cells_.size() || force_full_paint_; 277 return overflowing_cells_.size() || force_full_paint_;
276 } 278 }
277 bool HasMultipleCellLevels() const { return has_multiple_cell_levels_; } 279 bool HasMultipleCellLevels() const { return has_multiple_cell_levels_; }
278 280
279 const char* GetName() const override { return "LayoutTableSection"; } 281 const char* GetName() const override { return "LayoutTableSection"; }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 458
457 // Whether any cell spans multiple rows or cols. 459 // Whether any cell spans multiple rows or cols.
458 bool has_spanning_cells_; 460 bool has_spanning_cells_;
459 }; 461 };
460 462
461 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection()); 463 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection());
462 464
463 } // namespace blink 465 } // namespace blink
464 466
465 #endif // LayoutTableSection_h 467 #endif // LayoutTableSection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698