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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (cell->rowSpan() == 1) | 298 if (cell->rowSpan() == 1) |
299 return; | 299 return; |
300 | 300 |
301 // Cells only generates visual overflow. | 301 // Cells only generates visual overflow. |
302 LayoutRect cellVisualOverflowRect = | 302 LayoutRect cellVisualOverflowRect = |
303 cell->visualOverflowRectForPropagation(styleRef()); | 303 cell->visualOverflowRectForPropagation(styleRef()); |
304 | 304 |
305 // The cell and the row share the section's coordinate system. However | 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 | 306 // the visual overflow should be determined in the coordinate system of |
307 // the row, that's why we shift it below. | 307 // the row, that's why we shift it below. |
308 LayoutUnit cellOffsetLogicalTopDifference = | 308 cellVisualOverflowRect.moveBy(-location()); |
309 cell->location().y() - location().y(); | 309 addContentsVisualOverflow(cellVisualOverflowRect); |
310 cellVisualOverflowRect.move(LayoutUnit(), cellOffsetLogicalTopDifference); | |
311 | 310 |
312 addContentsVisualOverflow(cellVisualOverflowRect); | 311 // Table row paints its background behind cells. If the cell spans multiple |
| 312 // rows, the row's visual rect should be expanded to cover the cell. |
| 313 if (styleRef().hasBackground()) { |
| 314 LayoutRect cellBackgroundRect = cell->frameRect(); |
| 315 cellBackgroundRect.moveBy(-location()); |
| 316 addSelfVisualOverflow(cellBackgroundRect); |
| 317 } |
313 } | 318 } |
314 | 319 |
315 bool LayoutTableRow::isFirstRowInSectionAfterHeader() const { | 320 bool LayoutTableRow::isFirstRowInSectionAfterHeader() const { |
316 // If there isn't room on the page for at least one content row after the | 321 // If there isn't room on the page for at least one content row after the |
317 // header group, then we won't repeat the header on each page. | 322 // header group, then we won't repeat the header on each page. |
318 // https://drafts.csswg.org/css-tables-3/#repeated-headers reads like | 323 // https://drafts.csswg.org/css-tables-3/#repeated-headers reads like |
319 // it wants us to drop headers on only the pages that a single row | 324 // it wants us to drop headers on only the pages that a single row |
320 // won't fit but we avoid the complexity of that reading until it | 325 // won't fit but we avoid the complexity of that reading until it |
321 // is clarified. Tracked by crbug.com/675904 | 326 // is clarified. Tracked by crbug.com/675904 |
322 if (rowIndex()) | 327 if (rowIndex()) |
323 return false; | 328 return false; |
324 LayoutTableSection* header = table()->header(); | 329 LayoutTableSection* header = table()->header(); |
325 return header && table()->sectionAbove(section()) == header && | 330 return header && table()->sectionAbove(section()) == header && |
326 header->getPaginationBreakability() != AllowAnyBreaks; | 331 header->getPaginationBreakability() != AllowAnyBreaks; |
327 } | 332 } |
328 | 333 |
329 } // namespace blink | 334 } // namespace blink |
OLD | NEW |