Changeset 92630 in webkit
- Timestamp:
- Aug 8, 2011, 1:39:23 PM (15 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
rendering/CounterNode.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r92628 r92630 1 2011-08-08 Cris Neckar <cdn@chromium.org> 2 3 Remove counter nodes from the tree and fix-up children when they are removed from the counter map. 4 https://bugs.webkit.org/show_bug.cgi?id=65346 5 6 Reviewed by Adam Barth. 7 8 Covered by existing CSS counter tests. 9 10 * rendering/CounterNode.cpp: 11 (WebCore::CounterNode::~CounterNode): 12 1 13 2011-08-08 Tony Chang <tony@chromium.org> 2 14 -
trunk/Source/WebCore/rendering/CounterNode.cpp
r81844 r92630 45 45 CounterNode::~CounterNode() 46 46 { 47 // Ideally this would be an assert and this would never be reached. In reality this happens a lot 48 // so we need to handle these cases. The node is still connected to the tree so we need to detach it. 49 if (m_parent || m_previousSibling || m_nextSibling || m_firstChild || m_lastChild) { 50 CounterNode* oldParent = 0; 51 CounterNode* oldPreviousSibling = 0; 52 // Instead of calling removeChild() we do this safely as the tree is likely broken if we get here. 53 if (m_parent) { 54 if (m_parent->m_firstChild == this) 55 m_parent->m_firstChild = m_nextSibling; 56 if (m_parent->m_lastChild == this) 57 m_parent->m_lastChild = m_previousSibling; 58 oldParent = m_parent; 59 m_parent = 0; 60 } 61 if (m_previousSibling) { 62 if (m_previousSibling->m_nextSibling == this) 63 m_previousSibling->m_nextSibling = m_nextSibling; 64 oldPreviousSibling = m_previousSibling; 65 m_previousSibling = 0; 66 } 67 if (m_nextSibling) { 68 if (m_nextSibling->m_previousSibling == this) 69 m_nextSibling->m_previousSibling = oldPreviousSibling; 70 m_nextSibling = 0; 71 } 72 if (m_firstChild) { 73 // The node's children are reparented to the old parent. 74 for (CounterNode* child = m_firstChild; child; ) { 75 CounterNode* nextChild = child->m_nextSibling; 76 CounterNode* nextSibling = 0; 77 child->m_parent = oldParent; 78 if (oldPreviousSibling) { 79 nextSibling = oldPreviousSibling->m_nextSibling; 80 child->m_previousSibling = oldPreviousSibling; 81 oldPreviousSibling->m_nextSibling = child; 82 child->m_nextSibling = nextSibling; 83 nextSibling->m_previousSibling = child; 84 oldPreviousSibling = child; 85 } 86 child = nextChild; 87 } 88 } 89 } 47 90 resetRenderers(); 48 91 }
Note:
See TracChangeset
for help on using the changeset viewer.