| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 return firstChild.first->style()->order() < secondChild.first->style
()->order(); | 1371 return firstChild.first->style()->order() < secondChild.first->style
()->order(); |
| 1372 | 1372 |
| 1373 return firstChild.second < secondChild.second; | 1373 return firstChild.second < secondChild.second; |
| 1374 } | 1374 } |
| 1375 }; | 1375 }; |
| 1376 | 1376 |
| 1377 void RenderGrid::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOff
set) | 1377 void RenderGrid::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOff
set) |
| 1378 { | 1378 { |
| 1379 ASSERT_WITH_SECURITY_IMPLICATION(!gridIsDirty()); | 1379 ASSERT_WITH_SECURITY_IMPLICATION(!gridIsDirty()); |
| 1380 | 1380 |
| 1381 LayoutRect localRepaintRect = paintInfo.rect; | 1381 LayoutRect localPaintInvalidationRect = paintInfo.rect; |
| 1382 localRepaintRect.moveBy(-paintOffset); | 1382 localPaintInvalidationRect.moveBy(-paintOffset); |
| 1383 | 1383 |
| 1384 GridSpan dirtiedColumns = dirtiedGridAreas(m_columnPositions, localRepaintRe
ct.x(), localRepaintRect.maxX()); | 1384 GridSpan dirtiedColumns = dirtiedGridAreas(m_columnPositions, localPaintInva
lidationRect.x(), localPaintInvalidationRect.maxX()); |
| 1385 GridSpan dirtiedRows = dirtiedGridAreas(m_rowPositions, localRepaintRect.y()
, localRepaintRect.maxY()); | 1385 GridSpan dirtiedRows = dirtiedGridAreas(m_rowPositions, localPaintInvalidati
onRect.y(), localPaintInvalidationRect.maxY()); |
| 1386 | 1386 |
| 1387 Vector<std::pair<RenderBox*, size_t> > gridItemsToBePainted; | 1387 Vector<std::pair<RenderBox*, size_t> > gridItemsToBePainted; |
| 1388 | 1388 |
| 1389 for (GridSpan::iterator row = dirtiedRows.begin(); row != dirtiedRows.end();
++row) { | 1389 for (GridSpan::iterator row = dirtiedRows.begin(); row != dirtiedRows.end();
++row) { |
| 1390 for (GridSpan::iterator column = dirtiedColumns.begin(); column != dirti
edColumns.end(); ++column) { | 1390 for (GridSpan::iterator column = dirtiedColumns.begin(); column != dirti
edColumns.end(); ++column) { |
| 1391 const Vector<RenderBox*, 1>& children = m_grid[row.toInt()][column.t
oInt()]; | 1391 const Vector<RenderBox*, 1>& children = m_grid[row.toInt()][column.t
oInt()]; |
| 1392 for (size_t j = 0; j < children.size(); ++j) | 1392 for (size_t j = 0; j < children.size(); ++j) |
| 1393 gridItemsToBePainted.append(std::make_pair(children[j], m_gridIt
emsIndexesMap.get(children[j]))); | 1393 gridItemsToBePainted.append(std::make_pair(children[j], m_gridIt
emsIndexesMap.get(children[j]))); |
| 1394 } | 1394 } |
| 1395 } | 1395 } |
| 1396 | 1396 |
| 1397 for (Vector<RenderBox*>::const_iterator it = m_gridItemsOverflowingGridArea.
begin(); it != m_gridItemsOverflowingGridArea.end(); ++it) { | 1397 for (Vector<RenderBox*>::const_iterator it = m_gridItemsOverflowingGridArea.
begin(); it != m_gridItemsOverflowingGridArea.end(); ++it) { |
| 1398 if ((*it)->frameRect().intersects(localRepaintRect)) | 1398 if ((*it)->frameRect().intersects(localPaintInvalidationRect)) |
| 1399 gridItemsToBePainted.append(std::make_pair(*it, m_gridItemsIndexesMa
p.get(*it))); | 1399 gridItemsToBePainted.append(std::make_pair(*it, m_gridItemsIndexesMa
p.get(*it))); |
| 1400 } | 1400 } |
| 1401 | 1401 |
| 1402 // Sort grid items following order-modified document order. | 1402 // Sort grid items following order-modified document order. |
| 1403 // See http://www.w3.org/TR/css-flexbox/#order-modified-document-order | 1403 // See http://www.w3.org/TR/css-flexbox/#order-modified-document-order |
| 1404 std::stable_sort(gridItemsToBePainted.begin(), gridItemsToBePainted.end(), G
ridItemsSorter()); | 1404 std::stable_sort(gridItemsToBePainted.begin(), gridItemsToBePainted.end(), G
ridItemsSorter()); |
| 1405 | 1405 |
| 1406 RenderBox* previous = 0; | 1406 RenderBox* previous = 0; |
| 1407 for (Vector<std::pair<RenderBox*, size_t> >::const_iterator it = gridItemsTo
BePainted.begin(); it != gridItemsToBePainted.end(); ++it) { | 1407 for (Vector<std::pair<RenderBox*, size_t> >::const_iterator it = gridItemsTo
BePainted.begin(); it != gridItemsToBePainted.end(); ++it) { |
| 1408 // We might have duplicates because of spanning children are included in
all cells they span. | 1408 // We might have duplicates because of spanning children are included in
all cells they span. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1423 if (isOutOfFlowPositioned()) | 1423 if (isOutOfFlowPositioned()) |
| 1424 return "RenderGrid (positioned)"; | 1424 return "RenderGrid (positioned)"; |
| 1425 if (isAnonymous()) | 1425 if (isAnonymous()) |
| 1426 return "RenderGrid (generated)"; | 1426 return "RenderGrid (generated)"; |
| 1427 if (isRelPositioned()) | 1427 if (isRelPositioned()) |
| 1428 return "RenderGrid (relative positioned)"; | 1428 return "RenderGrid (relative positioned)"; |
| 1429 return "RenderGrid"; | 1429 return "RenderGrid"; |
| 1430 } | 1430 } |
| 1431 | 1431 |
| 1432 } // namespace blink | 1432 } // namespace blink |
| OLD | NEW |