Changeset 168971 in webkit
- Timestamp:
- May 16, 2014 11:26:24 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168970 r168971 1 2014-05-16 Radu Stavila <stavila@adobe.com> 2 3 [CSS Regions] Add ASSERT to make sure using the flowThread cache does not return incorrect results 4 https://bugs.webkit.org/show_bug.cgi?id=132906 5 6 Reviewed by Simon Fraser. 7 8 If flowThreadContainingBlock() is called on an object which is in a different 9 flow thread than the one currently being laid out, this method will return an incorrect 10 result. I added an assertion for that to make sure we catch and treat any such scenarios. 11 For the moment, this assertion is only validated for regions, as multicol still has some issues. 12 13 No new tests required. 14 15 * rendering/RenderObject.cpp: 16 (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): 17 (WebCore::RenderObject::locateFlowThreadContainingBlock): 18 * rendering/RenderObject.h: 19 1 20 2014-05-16 Martin Hock <mhock@apple.com> 2 21 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r168967 r168971 524 524 } 525 525 526 RenderFlowThread* RenderObject::locateFlowThreadContainingBlock () const526 RenderFlowThread* RenderObject::locateFlowThreadContainingBlockNoCache() const 527 527 { 528 528 ASSERT(flowThreadState() != NotInsideFlowThread); 529 529 530 // See if we have the thread cached because we're in the middle of layout.531 RenderFlowThread* flowThread = view().flowThreadController().currentRenderFlowThread();532 if (flowThread && (flowThreadState() == flowThread->flowThreadState()))533 return flowThread;534 535 // Not in the middle of layout so have to find the thread the slow way.536 530 RenderObject* curr = const_cast<RenderObject*>(this); 537 531 while (curr) { … … 541 535 } 542 536 return 0; 537 } 538 539 RenderFlowThread* RenderObject::locateFlowThreadContainingBlock() const 540 { 541 ASSERT(flowThreadState() != NotInsideFlowThread); 542 543 // See if we have the thread cached because we're in the middle of layout. 544 RenderFlowThread* flowThread = view().flowThreadController().currentRenderFlowThread(); 545 if (flowThread && (flowThreadState() == flowThread->flowThreadState())) { 546 // Make sure the slow path would return the same result as our cache. 547 // FIXME: For the moment, only apply this assertion to regions, as multicol 548 // still has some issues and triggers this assert. 549 // Created https://bugs.webkit.org/show_bug.cgi?id=132946 for this issue. 550 ASSERT(!flowThread->isRenderNamedFlowThread() || flowThread == locateFlowThreadContainingBlockNoCache()); 551 return flowThread; 552 } 553 554 // Not in the middle of layout so have to find the thread the slow way. 555 return locateFlowThreadContainingBlockNoCache(); 543 556 } 544 557 -
trunk/Source/WebCore/rendering/RenderObject.h
r168967 r168971 892 892 private: 893 893 RenderFlowThread* locateFlowThreadContainingBlock() const; 894 RenderFlowThread* locateFlowThreadContainingBlockNoCache() const; 895 894 896 void removeFromRenderFlowThread(); 895 897 void removeFromRenderFlowThreadRecursive(RenderFlowThread*);
Note: See TracChangeset
for help on using the changeset viewer.