| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/BackgroundImageGeometry.h" | 5 #include "core/paint/BackgroundImageGeometry.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
| 9 #include "core/layout/LayoutBoxModelObject.h" | 9 #include "core/layout/LayoutBoxModelObject.h" |
| 10 #include "core/layout/LayoutTableCell.h" | 10 #include "core/layout/LayoutTableCell.h" |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 static void expandToTableColumnGroup(const LayoutTableCell& cell, | 326 static void expandToTableColumnGroup(const LayoutTableCell& cell, |
| 327 const LayoutTableCol& columnGroup, | 327 const LayoutTableCol& columnGroup, |
| 328 LayoutUnit& value, | 328 LayoutUnit& value, |
| 329 ColumnGroupDirection columnDirection) { | 329 ColumnGroupDirection columnDirection) { |
| 330 auto siblingCell = columnDirection == ColumnGroupStart | 330 auto siblingCell = columnDirection == ColumnGroupStart |
| 331 ? &LayoutTableCell::previousCell | 331 ? &LayoutTableCell::previousCell |
| 332 : &LayoutTableCell::nextCell; | 332 : &LayoutTableCell::nextCell; |
| 333 for (const auto* sibling = (cell.*siblingCell)(); sibling; | 333 for (const auto* sibling = (cell.*siblingCell)(); sibling; |
| 334 sibling = (sibling->*siblingCell)()) { | 334 sibling = (sibling->*siblingCell)()) { |
| 335 if (cell.table() | 335 LayoutTableCol* innermostCol = |
| 336 cell.table() |
| 336 ->colElementAtAbsoluteColumn(sibling->absoluteColumnIndex()) | 337 ->colElementAtAbsoluteColumn(sibling->absoluteColumnIndex()) |
| 337 .innermostColOrColGroup() | 338 .innermostColOrColGroup(); |
| 338 ->enclosingColumnGroup() != columnGroup) | 339 if (!innermostCol || innermostCol->enclosingColumnGroup() != columnGroup) |
| 339 break; | 340 break; |
| 340 value += sibling->size().width(); | 341 value += sibling->size().width(); |
| 341 } | 342 } |
| 342 } | 343 } |
| 343 | 344 |
| 344 LayoutPoint BackgroundImageGeometry::getOffsetForCell( | 345 LayoutPoint BackgroundImageGeometry::getOffsetForCell( |
| 345 const LayoutTableCell& cell, | 346 const LayoutTableCell& cell, |
| 346 const LayoutBox& positioningBox) { | 347 const LayoutBox& positioningBox) { |
| 347 LayoutSize borderSpacing = LayoutSize(cell.table()->hBorderSpacing(), | 348 LayoutSize borderSpacing = LayoutSize(cell.table()->hBorderSpacing(), |
| 348 cell.table()->vBorderSpacing()); | 349 cell.table()->vBorderSpacing()); |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 useFixedAttachment(paintRect.location()); | 639 useFixedAttachment(paintRect.location()); |
| 639 | 640 |
| 640 // Clip the final output rect to the paint rect | 641 // Clip the final output rect to the paint rect |
| 641 m_destRect.intersect(paintRect); | 642 m_destRect.intersect(paintRect); |
| 642 | 643 |
| 643 // Snap as-yet unsnapped values. | 644 // Snap as-yet unsnapped values. |
| 644 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect))); | 645 setDestRect(LayoutRect(pixelSnappedIntRect(m_destRect))); |
| 645 } | 646 } |
| 646 | 647 |
| 647 } // namespace blink | 648 } // namespace blink |
| OLD | NEW |