Changeset 21059 in webkit
- Timestamp:
- Apr 23, 2007 6:27:57 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r21058 r21059 1 2007-04-23 David Hyatt <hyatt@apple.com> 2 3 Fix for bug 13430, cap inline splitting for continuations to a maximum depth of 200. 4 5 Reviewed by olliej, antti 6 7 * rendering/RenderInline.cpp: 8 (WebCore::RenderInline::splitInlines): 9 1 10 2007-04-23 Alp Toker <alp@atoker.com> 2 11 -
trunk/WebCore/rendering/RenderInline.cpp
r20673 r21059 160 160 RenderFlow* curr = static_cast<RenderFlow*>(parent()); 161 161 RenderFlow* currChild = this; 162 163 // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap the depth at which we're willing to clone. 164 // There will eventually be a better approach to this problem that will let us nest to a much 165 // greater depth (see bugzilla bug 13430) but for now we have a limit. This *will* result in 166 // incorrect rendering, but the alternative is to hang forever. 167 unsigned splitDepth = 1; 168 const unsigned cMaxSplitDepth = 200; 162 169 while (curr && curr != fromBlock) { 163 // Create a new clone. 164 RenderInline* cloneChild = clone; 165 clone = cloneInline(curr); 166 167 // Insert our child clone as the first child. 168 clone->addChildToFlow(cloneChild, 0); 169 170 // Hook the clone up as a continuation of |curr|. 171 RenderFlow* oldCont = curr->continuation(); 172 curr->setContinuation(clone); 173 clone->setContinuation(oldCont); 174 175 // Someone may have indirectly caused a <q> to split. When this happens, the :after content 176 // has to move into the inline continuation. Call updatePseudoChild to ensure that the inline's :after 177 // content gets properly destroyed. 178 curr->updatePseudoChild(RenderStyle::AFTER); 179 180 // Now we need to take all of the children starting from the first child 181 // *after* currChild and append them all to the clone. 182 o = currChild->nextSibling(); 183 while (o) { 184 RenderObject* tmp = o; 185 o = tmp->nextSibling(); 186 clone->addChildToFlow(curr->removeChildNode(tmp), 0); 187 tmp->setNeedsLayoutAndMinMaxRecalc(); 170 if (splitDepth < cMaxSplitDepth) { 171 // Create a new clone. 172 RenderInline* cloneChild = clone; 173 clone = cloneInline(curr); 174 175 // Insert our child clone as the first child. 176 clone->addChildToFlow(cloneChild, 0); 177 178 // Hook the clone up as a continuation of |curr|. 179 RenderFlow* oldCont = curr->continuation(); 180 curr->setContinuation(clone); 181 clone->setContinuation(oldCont); 182 183 // Someone may have indirectly caused a <q> to split. When this happens, the :after content 184 // has to move into the inline continuation. Call updatePseudoChild to ensure that the inline's :after 185 // content gets properly destroyed. 186 curr->updatePseudoChild(RenderStyle::AFTER); 187 188 // Now we need to take all of the children starting from the first child 189 // *after* currChild and append them all to the clone. 190 o = currChild->nextSibling(); 191 while (o) { 192 RenderObject* tmp = o; 193 o = tmp->nextSibling(); 194 clone->addChildToFlow(curr->removeChildNode(tmp), 0); 195 tmp->setNeedsLayoutAndMinMaxRecalc(); 196 } 188 197 } 189 198 190 199 // Keep walking up the chain. 191 200 currChild = curr; 192 201 curr = static_cast<RenderFlow*>(curr->parent()); 202 splitDepth++; 193 203 } 194 204
Note: See TracChangeset
for help on using the changeset viewer.