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

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

Issue 2890543002: Improve LayoutTable outer collapsed border calculation (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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // Returns null for cells with a rowspan that exceed the last row. Possibly 199 // Returns null for cells with a rowspan that exceed the last row. Possibly
200 // others. 200 // others.
201 LayoutTableRow* RowLayoutObjectAt(unsigned row) { return grid_[row].row; } 201 LayoutTableRow* RowLayoutObjectAt(unsigned row) { return grid_[row].row; }
202 const LayoutTableRow* RowLayoutObjectAt(unsigned row) const { 202 const LayoutTableRow* RowLayoutObjectAt(unsigned row) const {
203 return grid_[row].row; 203 return grid_[row].row;
204 } 204 }
205 205
206 void AppendEffectiveColumn(unsigned pos); 206 void AppendEffectiveColumn(unsigned pos);
207 void SplitEffectiveColumn(unsigned pos, unsigned first); 207 void SplitEffectiveColumn(unsigned pos, unsigned first);
208 208
209 enum BlockBorderSide { kBorderBefore, kBorderAfter };
210 int CalcBlockDirectionOuterBorder(BlockBorderSide) const;
211 enum InlineBorderSide { kBorderStart, kBorderEnd };
212 int CalcInlineDirectionOuterBorder(InlineBorderSide) const;
213 void RecalcOuterBorder();
214
215 int OuterBorderBefore() const { return outer_border_before_; }
216 int OuterBorderAfter() const { return outer_border_after_; }
217 int OuterBorderStart() const { return outer_border_start_; }
218 int OuterBorderEnd() const { return outer_border_end_; }
219
220 unsigned NumRows() const { 209 unsigned NumRows() const {
221 DCHECK(!NeedsCellRecalc()); 210 DCHECK(!NeedsCellRecalc());
222 return grid_.size(); 211 return grid_.size();
223 } 212 }
224 // This is slow. Use Table()->NumEffectiveColumns() instead if possible. 213 // This is slow. Use Table()->NumEffectiveColumns() instead if possible.
225 unsigned MaxNumEffectiveColumnsOfRows() const; 214 unsigned MaxNumEffectiveColumnsOfRows() const;
226 215
227 // recalcCells() is used when we are not sure about the section's structure 216 // recalcCells() is used when we are not sure about the section's structure
228 // and want to do an expensive (but safe) reconstruction of m_grid from 217 // and want to do an expensive (but safe) reconstruction of m_grid from
229 // scratch. 218 // scratch.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 // 418 //
430 // The reason for them is that we process cells as we discover them 419 // The reason for them is that we process cells as we discover them
431 // during parsing or during recalcCells (ie in DOM order). This means 420 // during parsing or during recalcCells (ie in DOM order). This means
432 // that we can discover changes in the structure later (e.g. due to 421 // that we can discover changes in the structure later (e.g. due to
433 // colspans, extra cells, ...). 422 // colspans, extra cells, ...).
434 // 423 //
435 // Do not use outside of recalcCells and addChild. 424 // Do not use outside of recalcCells and addChild.
436 unsigned c_col_; 425 unsigned c_col_;
437 unsigned c_row_; 426 unsigned c_row_;
438 427
439 int outer_border_start_;
440 int outer_border_end_;
441 int outer_border_before_;
442 int outer_border_after_;
443
444 bool needs_cell_recalc_; 428 bool needs_cell_recalc_;
445 429
446 // This HashSet holds the overflowing cells for the partial paint path. If we 430 // This HashSet holds the overflowing cells for the partial paint path. If we
447 // have too many overflowing cells, it will be empty and force_full_paint_ 431 // have too many overflowing cells, it will be empty and force_full_paint_
448 // will be set to save memory. See ComputeOverflowFromDescendants(). 432 // will be set to save memory. See ComputeOverflowFromDescendants().
449 HashSet<const LayoutTableCell*> overflowing_cells_; 433 HashSet<const LayoutTableCell*> overflowing_cells_;
450 bool force_full_paint_; 434 bool force_full_paint_;
451 435
452 // This boolean tracks if we have cells overlapping due to rowspan / colspan 436 // This boolean tracks if we have cells overlapping due to rowspan / colspan
453 // (see class comment above about when it could appear). 437 // (see class comment above about when it could appear).
454 // 438 //
455 // The use is to disable a painting optimization where we just paint the 439 // The use is to disable a painting optimization where we just paint the
456 // invalidated cells. 440 // invalidated cells.
457 bool has_multiple_cell_levels_; 441 bool has_multiple_cell_levels_;
458 442
459 // Whether any cell spans multiple rows or cols. 443 // Whether any cell spans multiple rows or cols.
460 bool has_spanning_cells_; 444 bool has_spanning_cells_;
461 }; 445 };
462 446
463 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection()); 447 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection());
464 448
465 } // namespace blink 449 } // namespace blink
466 450
467 #endif // LayoutTableSection_h 451 #endif // LayoutTableSection_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698