OLD | NEW |
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, 2007, 2008, 2009, 2010, 2013 | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 |
8 * Apple Inc. | 8 * Apple Inc. |
9 * All rights reserved. | 9 * All rights reserved. |
10 * | 10 * |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // Table row paints its background behind cells. If the cell spans multiple | 295 // Table row paints its background behind cells. If the cell spans multiple |
296 // rows, the row's visual rect should be expanded to cover the cell. | 296 // rows, the row's visual rect should be expanded to cover the cell. |
297 // Here don't check background existence to avoid requirement to invalidate | 297 // Here don't check background existence to avoid requirement to invalidate |
298 // overflow on change of background existence. | 298 // overflow on change of background existence. |
299 if (cell->RowSpan() > 1) { | 299 if (cell->RowSpan() > 1) { |
300 LayoutRect cell_background_rect = cell->FrameRect(); | 300 LayoutRect cell_background_rect = cell->FrameRect(); |
301 cell_background_rect.MoveBy(-Location()); | 301 cell_background_rect.MoveBy(-Location()); |
302 AddSelfVisualOverflow(cell_background_rect); | 302 AddSelfVisualOverflow(cell_background_rect); |
303 } | 303 } |
304 | 304 |
| 305 // The cell and the row share the section's coordinate system. However |
| 306 // the visual overflow should be determined in the coordinate system of |
| 307 // the row, that's why we shift the rects by cell_row_offset below. |
| 308 LayoutSize cell_row_offset = cell->Location() - Location(); |
| 309 |
| 310 // Let the row's self visual overflow cover the cell's whole collapsed |
| 311 // borders. This ensures correct raster invalidation on row border style |
| 312 // change. |
| 313 if (const auto* collapsed_borders = cell->GetCollapsedBorderValues()) { |
| 314 LayoutRect collapsed_border_rect = |
| 315 cell->RectForOverflowPropagation(collapsed_borders->LocalVisualRect()); |
| 316 collapsed_border_rect.Move(cell_row_offset); |
| 317 AddSelfVisualOverflow(collapsed_border_rect); |
| 318 } |
| 319 |
305 // Should propagate cell's overflow to row if the cell has row span or has | 320 // Should propagate cell's overflow to row if the cell has row span or has |
306 // overflow. | 321 // overflow. |
307 if (cell->RowSpan() == 1 && !cell->HasOverflowModel()) | 322 if (cell->RowSpan() == 1 && !cell->HasOverflowModel()) |
308 return; | 323 return; |
309 | 324 |
310 // The cell and the row share the section's coordinate system. However | |
311 // the visual overflow should be determined in the coordinate system of | |
312 // the row, that's why we shift the rects by cell_row_offset below. | |
313 LayoutSize cell_row_offset = cell->Location() - Location(); | |
314 | |
315 LayoutRect cell_visual_overflow_rect = | 325 LayoutRect cell_visual_overflow_rect = |
316 cell->VisualOverflowRectForPropagation(); | 326 cell->VisualOverflowRectForPropagation(); |
317 cell_visual_overflow_rect.Move(cell_row_offset); | 327 cell_visual_overflow_rect.Move(cell_row_offset); |
318 AddContentsVisualOverflow(cell_visual_overflow_rect); | 328 AddContentsVisualOverflow(cell_visual_overflow_rect); |
319 | 329 |
320 LayoutRect cell_layout_overflow_rect = | 330 LayoutRect cell_layout_overflow_rect = |
321 cell->LayoutOverflowRectForPropagation(); | 331 cell->LayoutOverflowRectForPropagation(); |
322 cell_layout_overflow_rect.Move(cell_row_offset); | 332 cell_layout_overflow_rect.Move(cell_row_offset); |
323 AddLayoutOverflow(cell_layout_overflow_rect); | 333 AddLayoutOverflow(cell_layout_overflow_rect); |
324 } | 334 } |
325 | 335 |
326 bool LayoutTableRow::IsFirstRowInSectionAfterHeader() const { | 336 bool LayoutTableRow::IsFirstRowInSectionAfterHeader() const { |
327 // If there isn't room on the page for at least one content row after the | 337 // If there isn't room on the page for at least one content row after the |
328 // header group, then we won't repeat the header on each page. | 338 // header group, then we won't repeat the header on each page. |
329 // https://drafts.csswg.org/css-tables-3/#repeated-headers reads like | 339 // https://drafts.csswg.org/css-tables-3/#repeated-headers reads like |
330 // it wants us to drop headers on only the pages that a single row | 340 // it wants us to drop headers on only the pages that a single row |
331 // won't fit but we avoid the complexity of that reading until it | 341 // won't fit but we avoid the complexity of that reading until it |
332 // is clarified. Tracked by crbug.com/675904 | 342 // is clarified. Tracked by crbug.com/675904 |
333 if (RowIndex()) | 343 if (RowIndex()) |
334 return false; | 344 return false; |
335 LayoutTableSection* header = Table()->Header(); | 345 LayoutTableSection* header = Table()->Header(); |
336 return header && Table()->SectionAbove(Section()) == header && | 346 return header && Table()->SectionAbove(Section()) == header && |
337 header->GetPaginationBreakability() != kAllowAnyBreaks; | 347 header->GetPaginationBreakability() != kAllowAnyBreaks; |
338 } | 348 } |
339 | 349 |
340 } // namespace blink | 350 } // namespace blink |
OLD | NEW |