Index: Source/core/rendering/style/StyleDifference.h |
diff --git a/Source/core/rendering/style/StyleDifference.h b/Source/core/rendering/style/StyleDifference.h |
index dac2899d04470a1b6f97f9b08a6dc40b449d8a8a..d1511a5acf6dbd82cb78f85b1a266996f78529fa 100644 |
--- a/Source/core/rendering/style/StyleDifference.h |
+++ b/Source/core/rendering/style/StyleDifference.h |
@@ -8,10 +8,13 @@ |
namespace WebCore { |
// This class represents the difference between two computed styles (RenderStyle). |
-// The difference can be of 3 types: |
-// - Layout difference |
-// - Repaint difference |
-// - Recompositing difference |
+// The difference can be combination of 3 types according to the actions needed: |
+// - Difference needing layout |
+// - Difference needing repaint |
+// - Difference needing recompositing layers |
+// |
+// Only directly needed actions are included. Indirect needed actions, such as |
Julien - ping for review
2014/04/30 18:02:26
I don't think this comment helps, especially since
Xianzhu
2014/04/30 18:40:15
Removed.
|
+// repaint caused by a layout change, are not included. |
class StyleDifference { |
public: |
StyleDifference() |
@@ -30,11 +33,11 @@ public: |
void clearNeedsRepaint() { m_repaintType = NoRepaint; } |
// The object just needs to be repainted. |
- bool needsRepaintObjectOnly() const { return m_repaintType == RepaintObjectOnly; } |
+ bool needsRepaintObject() const { return m_repaintType == RepaintObject; } |
void setNeedsRepaintObject() |
{ |
if (!needsRepaintLayer()) |
- m_repaintType = RepaintObjectOnly; |
+ m_repaintType = RepaintObject; |
} |
// The layer and its descendant layers need to be repainted. |
@@ -45,37 +48,30 @@ public: |
void clearNeedsLayout() { m_layoutType = NoLayout; } |
// The offset of this positioned object has been updated. |
- bool needsPositionedMovementLayout() const { return m_layoutType & PositionedMovement; } |
+ bool needsPositionedMovementLayout() const { return m_layoutType == PositionedMovement; } |
void setNeedsPositionedMovementLayout() |
{ |
if (!needsFullLayout()) |
- m_layoutType |= PositionedMovement; |
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. |
- m_repaintType = NoRepaint; |
+ m_layoutType = PositionedMovement; |
} |
bool needsFullLayout() const { return m_layoutType == FullLayout; } |
- void setNeedsFullLayout() |
- { |
- m_layoutType = FullLayout; |
- // FIXME: This is temporary to keep the StyleDifferenceLegacy behavior. |
- m_repaintType = NoRepaint; |
- } |
+ void setNeedsFullLayout() { m_layoutType = FullLayout; } |
private: |
unsigned m_needsRecompositeLayer : 1; |
enum RepaintType { |
NoRepaint = 0, |
- RepaintObjectOnly, |
+ RepaintObject, |
RepaintLayer |
}; |
unsigned m_repaintType : 2; |
enum LayoutType { |
NoLayout = 0, |
- PositionedMovement = 1 << 0, |
- FullLayout = 1 << 1 |
+ PositionedMovement, |
+ FullLayout |
}; |
unsigned m_layoutType : 2; |
}; |