| 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 #ifndef StyleDifference_h | 5 #ifndef StyleDifference_h |
| 6 #define StyleDifference_h | 6 #define StyleDifference_h |
| 7 | 7 |
| 8 namespace WebCore { | 8 namespace WebCore { |
| 9 | 9 |
| 10 // This class represents the difference between two computed styles (RenderStyle
). | 10 // This class represents the difference between two computed styles (RenderStyle
). |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // The offset of this positioned object has been updated. | 47 // The offset of this positioned object has been updated. |
| 48 bool needsPositionedMovementLayout() const { return m_layoutType & Positione
dMovement; } | 48 bool needsPositionedMovementLayout() const { return m_layoutType & Positione
dMovement; } |
| 49 void setNeedsPositionedMovementLayout() | 49 void setNeedsPositionedMovementLayout() |
| 50 { | 50 { |
| 51 if (!needsFullLayout()) | 51 if (!needsFullLayout()) |
| 52 m_layoutType |= PositionedMovement; | 52 m_layoutType |= PositionedMovement; |
| 53 // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. | 53 // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. |
| 54 m_repaintType = NoRepaint; | 54 m_repaintType = NoRepaint; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Only overflow needs to be recomputed. | |
| 58 bool needsSimplifiedLayout() const { return m_layoutType & SimplifiedLayout;
} | |
| 59 void setNeedsSimplifiedLayout() | |
| 60 { | |
| 61 if (!needsFullLayout()) | |
| 62 m_layoutType |= SimplifiedLayout; | |
| 63 // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. | |
| 64 m_repaintType = NoRepaint; | |
| 65 } | |
| 66 | |
| 67 bool needsFullLayout() const { return m_layoutType == FullLayout; } | 57 bool needsFullLayout() const { return m_layoutType == FullLayout; } |
| 68 void setNeedsFullLayout() | 58 void setNeedsFullLayout() |
| 69 { | 59 { |
| 70 m_layoutType = FullLayout; | 60 m_layoutType = FullLayout; |
| 71 // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. | 61 // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. |
| 72 m_repaintType = NoRepaint; | 62 m_repaintType = NoRepaint; |
| 73 } | 63 } |
| 74 | 64 |
| 75 private: | 65 private: |
| 76 unsigned m_needsRecompositeLayer : 1; | 66 unsigned m_needsRecompositeLayer : 1; |
| 77 | 67 |
| 78 enum RepaintType { | 68 enum RepaintType { |
| 79 NoRepaint = 0, | 69 NoRepaint = 0, |
| 80 RepaintObjectOnly, | 70 RepaintObjectOnly, |
| 81 RepaintLayer | 71 RepaintLayer |
| 82 }; | 72 }; |
| 83 unsigned m_repaintType : 2; | 73 unsigned m_repaintType : 2; |
| 84 | 74 |
| 85 enum LayoutType { | 75 enum LayoutType { |
| 86 NoLayout = 0, | 76 NoLayout = 0, |
| 87 PositionedMovement = 1 << 0, | 77 PositionedMovement = 1 << 0, |
| 88 SimplifiedLayout = 1 << 1, | 78 FullLayout = 1 << 1 |
| 89 FullLayout = 1 << 2 | |
| 90 }; | 79 }; |
| 91 unsigned m_layoutType : 3; | 80 unsigned m_layoutType : 2; |
| 92 }; | 81 }; |
| 93 | 82 |
| 94 } // namespace WebCore | 83 } // namespace WebCore |
| 95 | 84 |
| 96 #endif // StyleDifference_h | 85 #endif // StyleDifference_h |
| OLD | NEW |