Changeset 168837 in webkit
- Timestamp:
- May 14, 2014 8:38:34 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r168836 r168837 1 2014-05-14 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 Andrei Bucur. 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 12 No new tests required. 13 14 * rendering/RenderObject.cpp: 15 (WebCore::RenderObject::locateFlowThreadContainingBlockNoCache): 16 (WebCore::RenderObject::locateFlowThreadContainingBlock): 17 * rendering/RenderObject.h: 18 1 19 2014-05-14 Andrei Bucur <abucur@adobe.com> 2 20 -
trunk/Source/WebCore/rendering/RenderObject.cpp
r168437 r168837 523 523 } 524 524 525 RenderFlowThread* RenderObject::locateFlowThreadContainingBlock () const525 RenderFlowThread* RenderObject::locateFlowThreadContainingBlockNoCache() const 526 526 { 527 527 ASSERT(flowThreadState() != NotInsideFlowThread); 528 528 529 // See if we have the thread cached because we're in the middle of layout.530 RenderFlowThread* flowThread = view().flowThreadController().currentRenderFlowThread();531 if (flowThread && (flowThreadState() == flowThread->flowThreadState()))532 return flowThread;533 534 // Not in the middle of layout so have to find the thread the slow way.535 529 RenderObject* curr = const_cast<RenderObject*>(this); 536 530 while (curr) { … … 540 534 } 541 535 return 0; 536 } 537 538 RenderFlowThread* RenderObject::locateFlowThreadContainingBlock() const 539 { 540 ASSERT(flowThreadState() != NotInsideFlowThread); 541 542 // See if we have the thread cached because we're in the middle of layout. 543 RenderFlowThread* flowThread = view().flowThreadController().currentRenderFlowThread(); 544 if (flowThread && (flowThreadState() == flowThread->flowThreadState())) { 545 // Make sure the slow path would return the same result as our cache. 546 ASSERT(flowThread == locateFlowThreadContainingBlockNoCache()); 547 return flowThread; 548 } 549 550 // Not in the middle of layout so have to find the thread the slow way. 551 return locateFlowThreadContainingBlockNoCache(); 542 552 } 543 553 -
trunk/Source/WebCore/rendering/RenderObject.h
r168404 r168837 890 890 private: 891 891 RenderFlowThread* locateFlowThreadContainingBlock() const; 892 893 // This will walk the tree to find the flow thread. 894 RenderFlowThread* locateFlowThreadContainingBlockNoCache() const; 895 892 896 void removeFromRenderFlowThread(); 893 897 void removeFromRenderFlowThreadRecursive(RenderFlowThread*);
Note: See TracChangeset
for help on using the changeset viewer.