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

Side by Side Diff: third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp

Issue 2649953003: Don't assume every cell in a row has a column (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/backgr_image-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/backgr_image-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698