| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Adobe Systems Incorporated. All Rights Reserved. | 2 * Copyright 2011 Adobe Systems Incorporated. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } | 197 } |
| 198 | 198 |
| 199 renderRegion->setIsValid(true); | 199 renderRegion->setIsValid(true); |
| 200 | 200 |
| 201 invalidateRegions(); | 201 invalidateRegions(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void RenderFlowThread::removeRegionFromThread(RenderRegion* renderRegion) | 204 void RenderFlowThread::removeRegionFromThread(RenderRegion* renderRegion) |
| 205 { | 205 { |
| 206 ASSERT(renderRegion); | 206 ASSERT(renderRegion); |
| 207 |
| 207 m_regionRangeMap.clear(); | 208 m_regionRangeMap.clear(); |
| 208 m_regionList.remove(renderRegion); | 209 m_regionList.remove(renderRegion); |
| 209 | 210 |
| 210 if (renderRegion->parentFlowThread()) { | 211 if (renderRegion->parentFlowThread()) { |
| 211 if (!renderRegion->isValid()) { | 212 if (!renderRegion->isValid()) { |
| 212 renderRegion->parentFlowThread()->m_observerThreadsSet.remove(this); | 213 renderRegion->parentFlowThread()->m_observerThreadsSet.remove(this); |
| 213 // No need to invalidate the regions rectangles. The removed region | 214 // No need to invalidate the regions rectangles. The removed region |
| 214 // was not taken into account. Just return here. | 215 // was not taken into account. Just return here. |
| 215 return; | 216 return; |
| 216 } | 217 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 } | 622 } |
| 622 | 623 |
| 623 void RenderFlowThread::removeRenderBoxRegionInfo(RenderBox* box) | 624 void RenderFlowThread::removeRenderBoxRegionInfo(RenderBox* box) |
| 624 { | 625 { |
| 625 if (!hasRegions()) | 626 if (!hasRegions()) |
| 626 return; | 627 return; |
| 627 | 628 |
| 628 RenderRegion* startRegion; | 629 RenderRegion* startRegion; |
| 629 RenderRegion* endRegion; | 630 RenderRegion* endRegion; |
| 630 getRegionRangeForBox(box, startRegion, endRegion); | 631 getRegionRangeForBox(box, startRegion, endRegion); |
| 631 | 632 |
| 632 for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter
!= m_regionList.end(); ++iter) { | 633 for (RenderRegionList::iterator iter = m_regionList.find(startRegion); iter
!= m_regionList.end(); ++iter) { |
| 633 RenderRegion* region = *iter; | 634 RenderRegion* region = *iter; |
| 634 if (!region->isValid()) | 635 if (!region->isValid()) |
| 635 continue; | 636 continue; |
| 636 region->removeRenderBoxRegionInfo(box); | 637 region->removeRenderBoxRegionInfo(box); |
| 637 if (region == endRegion) | 638 if (region == endRegion) |
| 638 break; | 639 break; |
| 639 } | 640 } |
| 640 | 641 |
| 642 #ifndef NDEBUG |
| 643 // We have to make sure we did not left any boxes with region info attached
in regions. |
| 644 for (RenderRegionList::iterator iter = m_regionList.begin(); iter != m_regio
nList.end(); ++iter) { |
| 645 RenderRegion* region = *iter; |
| 646 if (!region->isValid()) |
| 647 continue; |
| 648 ASSERT(!region->renderBoxRegionInfo(box)); |
| 649 } |
| 650 #endif |
| 651 |
| 641 m_regionRangeMap.remove(box); | 652 m_regionRangeMap.remove(box); |
| 642 } | 653 } |
| 643 | 654 |
| 644 bool RenderFlowThread::logicalWidthChangedInRegions(const RenderBlock* block, La
youtUnit offsetFromLogicalTopOfFirstPage) | 655 bool RenderFlowThread::logicalWidthChangedInRegions(const RenderBlock* block, La
youtUnit offsetFromLogicalTopOfFirstPage) |
| 645 { | 656 { |
| 646 if (!hasRegions() || block == this) // Not necessary, since if any region ch
anges, we do a full pagination relayout anyway. | 657 if (!hasRegions() || block == this) // Not necessary, since if any region ch
anges, we do a full pagination relayout anyway. |
| 647 return false; | 658 return false; |
| 648 | 659 |
| 649 RenderRegion* startRegion; | 660 RenderRegion* startRegion; |
| 650 RenderRegion* endRegion; | 661 RenderRegion* endRegion; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 | 829 |
| 819 WebKitNamedFlow* RenderFlowThread::ensureNamedFlow() | 830 WebKitNamedFlow* RenderFlowThread::ensureNamedFlow() |
| 820 { | 831 { |
| 821 if (!m_namedFlow) | 832 if (!m_namedFlow) |
| 822 m_namedFlow = WebKitNamedFlow::create(); | 833 m_namedFlow = WebKitNamedFlow::create(); |
| 823 | 834 |
| 824 return m_namedFlow.get(); | 835 return m_namedFlow.get(); |
| 825 } | 836 } |
| 826 | 837 |
| 827 } // namespace WebCore | 838 } // namespace WebCore |
| OLD | NEW |