| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 3 * Copyright (C) 2005 Alexey Proskuryakov. | 3 * Copyright (C) 2005 Alexey Proskuryakov. |
| 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 11 matching lines...) Expand all Loading... |
| 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 22 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/editing/iterators/BitStack.h" | 28 #include "core/editing/iterators/BitStack.h" |
| 29 | 29 |
| 30 #include "core/dom/ContainerNode.h" | 30 #include "core/dom/ContainerNode.h" |
| 31 #include "core/dom/Node.h" | 31 #include "core/dom/Node.h" |
| 32 #include "core/layout/LayoutObject.h" |
| 32 #include "core/rendering/RenderBox.h" | 33 #include "core/rendering/RenderBox.h" |
| 33 #include "core/rendering/RenderObject.h" | |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 static const unsigned bitsInWord = sizeof(unsigned) * 8; | 37 static const unsigned bitsInWord = sizeof(unsigned) * 8; |
| 38 static const unsigned bitInWordMask = bitsInWord - 1; | 38 static const unsigned bitInWordMask = bitsInWord - 1; |
| 39 | 39 |
| 40 #if ENABLE(ASSERT) | 40 #if ENABLE(ASSERT) |
| 41 static unsigned depthCrossingShadowBoundaries(Node* node) | 41 static unsigned depthCrossingShadowBoundaries(Node* node) |
| 42 { | 42 { |
| 43 unsigned depth = 0; | 43 unsigned depth = 0; |
| 44 for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent
= parent->parentOrShadowHostNode()) | 44 for (ContainerNode* parent = node->parentOrShadowHostNode(); parent; parent
= parent->parentOrShadowHostNode()) |
| 45 ++depth; | 45 ++depth; |
| 46 return depth; | 46 return depth; |
| 47 } | 47 } |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 static inline bool fullyClipsContents(Node* node) | 50 static inline bool fullyClipsContents(Node* node) |
| 51 { | 51 { |
| 52 RenderObject* renderer = node->renderer(); | 52 LayoutObject* renderer = node->renderer(); |
| 53 if (!renderer || !renderer->isBox() || !renderer->hasOverflowClip()) | 53 if (!renderer || !renderer->isBox() || !renderer->hasOverflowClip()) |
| 54 return false; | 54 return false; |
| 55 return toRenderBox(renderer)->size().isEmpty(); | 55 return toRenderBox(renderer)->size().isEmpty(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 static inline bool ignoresContainerClip(Node* node) | 58 static inline bool ignoresContainerClip(Node* node) |
| 59 { | 59 { |
| 60 RenderObject* renderer = node->renderer(); | 60 LayoutObject* renderer = node->renderer(); |
| 61 if (!renderer || renderer->isText()) | 61 if (!renderer || renderer->isText()) |
| 62 return false; | 62 return false; |
| 63 return renderer->style()->hasOutOfFlowPosition(); | 63 return renderer->style()->hasOutOfFlowPosition(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 BitStack::BitStack() | 66 BitStack::BitStack() |
| 67 : m_size(0) | 67 : m_size(0) |
| 68 { | 68 { |
| 69 } | 69 } |
| 70 | 70 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Call pushFullyClippedState on each node starting with the earliest ancest
or. | 137 // Call pushFullyClippedState on each node starting with the earliest ancest
or. |
| 138 size_t ancestrySize = ancestry.size(); | 138 size_t ancestrySize = ancestry.size(); |
| 139 for (size_t i = 0; i < ancestrySize; ++i) | 139 for (size_t i = 0; i < ancestrySize; ++i) |
| 140 pushFullyClippedState(ancestry[ancestrySize - i - 1]); | 140 pushFullyClippedState(ancestry[ancestrySize - i - 1]); |
| 141 pushFullyClippedState(node); | 141 pushFullyClippedState(node); |
| 142 | 142 |
| 143 ASSERT(size() == 1 + depthCrossingShadowBoundaries(node)); | 143 ASSERT(size() == 1 + depthCrossingShadowBoundaries(node)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace blink | 146 } // namespace blink |
| OLD | NEW |