OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 compositingState != PaintsIntoGroupedBacking) { | 49 compositingState != PaintsIntoGroupedBacking) { |
50 m_compositingAncestor = &layer; | 50 m_compositingAncestor = &layer; |
51 if (layer.stackingNode()->isStackingContext()) | 51 if (layer.stackingNode()->isStackingContext()) |
52 m_compositingStackingContext = &layer; | 52 m_compositingStackingContext = &layer; |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 const PaintLayer* compositingContainer(const PaintLayer& layer) const { | 56 const PaintLayer* compositingContainer(const PaintLayer& layer) const { |
57 // TODO(chrishtr) this is not very performant for floats, but they should | 57 // TODO(chrishtr) this is not very performant for floats, but they should |
58 // be uncommon enough, and SPv2 will remove this code. | 58 // be uncommon enough, and SPv2 will remove this code. |
59 if (layer.layoutObject()->isFloating() && layer.layoutObject()->parent() && | 59 if (layer.stackingNode()->isStacked()) |
60 !layer.stackingNode()->isStacked() && | 60 return m_compositingStackingContext; |
61 !layer.layoutObject()->parent()->isLayoutBlockFlow()) { | 61 |
| 62 const LayoutObject* object = layer.layoutObject(); |
| 63 if (object->isFloating() && object->parent() && |
| 64 !object->parent()->canContainFloatingObject(*object)) |
62 return layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf); | 65 return layer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf); |
63 } | 66 |
64 return layer.stackingNode()->isStacked() ? m_compositingStackingContext | 67 return m_compositingAncestor; |
65 : m_compositingAncestor; | |
66 } | 68 } |
67 | 69 |
68 const PaintLayer* compositingStackingContext() const { | 70 const PaintLayer* compositingStackingContext() const { |
69 return m_compositingStackingContext; | 71 return m_compositingStackingContext; |
70 } | 72 } |
71 | 73 |
72 private: | 74 private: |
73 const PaintLayer* m_compositingStackingContext; | 75 const PaintLayer* m_compositingStackingContext; |
74 const PaintLayer* m_compositingAncestor; | 76 const PaintLayer* m_compositingAncestor; |
75 }; | 77 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ->assertNeedsToUpdateGraphicsLayerBitsCleared(); | 132 ->assertNeedsToUpdateGraphicsLayerBitsCleared(); |
131 | 133 |
132 for (PaintLayer* child = layer.firstChild(); child; | 134 for (PaintLayer* child = layer.firstChild(); child; |
133 child = child->nextSibling()) | 135 child = child->nextSibling()) |
134 assertNeedsToUpdateGraphicsLayerBitsCleared(*child); | 136 assertNeedsToUpdateGraphicsLayerBitsCleared(*child); |
135 } | 137 } |
136 | 138 |
137 #endif | 139 #endif |
138 | 140 |
139 } // namespace blink | 141 } // namespace blink |
OLD | NEW |