Changeset 96955 in webkit
- Timestamp:
- Oct 7, 2011, 10:19:32 AM (14 years ago)
- Location:
- branches/chromium/874
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/chromium/874/Source/WebCore/rendering/RenderCounter.cpp
r95430 r96955 304 304 RenderObject* currentRenderer = previousInPreOrder(counterOwner); 305 305 previousSibling = 0; 306 RefPtr<CounterNode> previousSiblingProtector = 0; 307 306 308 while (currentRenderer) { 307 309 CounterNode* currentCounter = makeCounterNode(currentRenderer, identifier, false); … … 310 312 if (currentCounter) { 311 313 // We have a suitable counter on the EndSearchRenderer. 312 if (previousSibling ) { // But we already found another counter that we come after.314 if (previousSiblingProtector) { // But we already found another counter that we come after. 313 315 if (currentCounter->actsAsReset()) { 314 316 // We found a reset counter that is on a renderer that is a sibling of ours or a parent. … … 327 329 // In these cases the identified previousSibling will be invalid as its parent is different from 328 330 // our identified parent. 329 if (previousSibling->parent() != currentCounter) 330 previousSibling = 0; 331 if (previousSiblingProtector->parent() != currentCounter) 332 previousSiblingProtector = 0; 333 334 previousSibling = previousSiblingProtector.get(); 331 335 return true; 332 336 } … … 335 339 // If the node we are placing is not reset or we have found a counter that is attached 336 340 // to an ancestor of the placed counter's owner renderer we know we are a sibling of that node. 337 ASSERT(currentCounter->parent() == previousSibling ->parent());341 ASSERT(currentCounter->parent() == previousSiblingProtector->parent()); 338 342 parent = currentCounter->parent(); 343 previousSibling = previousSiblingProtector.get(); 339 344 return true; 340 345 } … … 351 356 } 352 357 parent = currentCounter; 358 previousSibling = previousSiblingProtector.get(); 353 359 return true; 354 360 } … … 358 364 return true; 359 365 } 360 previousSibling = currentCounter;366 previousSiblingProtector = currentCounter; 361 367 } 362 368 } … … 371 377 if (currentCounter) { 372 378 // We found a suitable counter. 373 if (previousSibling ) {379 if (previousSiblingProtector) { 374 380 // Since we had a suitable previous counter before, we should only consider this one as our 375 381 // previousSibling if it is a reset counter and hence the current previousSibling is its child. 376 382 if (currentCounter->actsAsReset()) { 377 previousSibling = currentCounter;383 previousSiblingProtector = currentCounter; 378 384 // We are no longer interested in previous siblings of the currentRenderer or their children 379 385 // as counters they may have attached cannot be the previous sibling of the counter we are placing. … … 382 388 } 383 389 } else 384 previousSibling = currentCounter;390 previousSiblingProtector = currentCounter; 385 391 currentRenderer = previousSiblingOrParent(currentRenderer); 386 392 continue; … … 391 397 // performance improvement would create more code duplication than is worthwhile in my oppinion and may further 392 398 // impede the readability of this already complex algorithm. 393 if (previousSibling )399 if (previousSiblingProtector) 394 400 currentRenderer = previousSiblingOrParent(currentRenderer); 395 401 else
Note:
See TracChangeset
for help on using the changeset viewer.