Chromium Code Reviews| Index: Source/core/rendering/RenderLayer.cpp |
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp |
| index 953e0e3d8e56eb3683396918b6b09c4bc959aba2..bb1f013b85f4a2304f8b39beb421be71e84de2b3 100644 |
| --- a/Source/core/rendering/RenderLayer.cpp |
| +++ b/Source/core/rendering/RenderLayer.cpp |
| @@ -1109,6 +1109,11 @@ const RenderLayer* RenderLayer::compositingContainer() const |
| return 0; |
| } |
| +bool RenderLayer::isRepaintContainer() const |
| +{ |
| + return compositingState() == PaintsIntoOwnBacking || compositingState() == PaintsIntoGroupedBacking; |
|
eseidel
2014/05/08 00:43:02
When is this compositing information determined?
|
| +} |
| + |
| // FIXME: having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint |
| // is error-prone and misleading for reading code that uses these functions - especially compounded with |
| // the includeSelf option. It is very likely that we don't even want either of these functions; A layer |
| @@ -1133,11 +1138,11 @@ RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(IncludeSelfOrNot i |
| { |
| ASSERT(isAllowedToQueryCompositingState()); |
| - if ((includeSelf == IncludeSelf) && (compositingState() == PaintsIntoOwnBacking || compositingState() == PaintsIntoGroupedBacking)) |
| + if ((includeSelf == IncludeSelf) && isRepaintContainer()) |
| return const_cast<RenderLayer*>(this); |
| for (const RenderLayer* curr = compositingContainer(); curr; curr = curr->compositingContainer()) { |
| - if (curr->compositingState() == PaintsIntoOwnBacking || curr->compositingState() == PaintsIntoGroupedBacking) |
| + if (curr->isRepaintContainer()) |
| return const_cast<RenderLayer*>(curr); |
| } |