| 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 1773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1784 GridTrackSizingDirection LayoutGrid::autoPlacementMinorAxisDirection() const | 1784 GridTrackSizingDirection LayoutGrid::autoPlacementMinorAxisDirection() const |
| 1785 { | 1785 { |
| 1786 return style()->isGridAutoFlowDirectionColumn() ? ForRows : ForColumns; | 1786 return style()->isGridAutoFlowDirectionColumn() ? ForRows : ForColumns; |
| 1787 } | 1787 } |
| 1788 | 1788 |
| 1789 void LayoutGrid::dirtyGrid() | 1789 void LayoutGrid::dirtyGrid() |
| 1790 { | 1790 { |
| 1791 if (m_gridIsDirty) | 1791 if (m_gridIsDirty) |
| 1792 return; | 1792 return; |
| 1793 | 1793 |
| 1794 // Even if this could be redundant, it could be seen as a defensive strategy
against | |
| 1795 // style changes events happening during the layout phase or even while the
painting process | |
| 1796 // is still ongoing. | |
| 1797 // Forcing a new layout for the Grid layout would cancel any ongoing paintin
g and ensure | |
| 1798 // the grid and its children are correctly laid out according to the new sty
le rules. | |
| 1799 setNeedsLayout(LayoutInvalidationReason::GridChanged); | |
| 1800 | |
| 1801 m_grid.resize(0); | 1794 m_grid.resize(0); |
| 1802 m_gridItemArea.clear(); | 1795 m_gridItemArea.clear(); |
| 1803 m_gridItemsOverflowingGridArea.resize(0); | 1796 m_gridItemsOverflowingGridArea.resize(0); |
| 1804 m_gridItemsIndexesMap.clear(); | 1797 m_gridItemsIndexesMap.clear(); |
| 1805 m_autoRepeatColumns = 0; | 1798 m_autoRepeatColumns = 0; |
| 1806 m_autoRepeatRows = 0; | 1799 m_autoRepeatRows = 0; |
| 1807 m_gridIsDirty = true; | 1800 m_gridIsDirty = true; |
| 1808 m_autoRepeatEmptyColumns = nullptr; | 1801 m_autoRepeatEmptyColumns = nullptr; |
| 1809 m_autoRepeatEmptyRows = nullptr; | 1802 m_autoRepeatEmptyRows = nullptr; |
| 1810 } | 1803 } |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2667 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2660 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
| 2668 } | 2661 } |
| 2669 | 2662 |
| 2670 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const | 2663 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const |
| 2671 { | 2664 { |
| 2672 SECURITY_DCHECK(m_hasDefiniteLogicalHeight); | 2665 SECURITY_DCHECK(m_hasDefiniteLogicalHeight); |
| 2673 return m_hasDefiniteLogicalHeight.value(); | 2666 return m_hasDefiniteLogicalHeight.value(); |
| 2674 } | 2667 } |
| 2675 | 2668 |
| 2676 } // namespace blink | 2669 } // namespace blink |
| OLD | NEW |