Changeset 136908 in webkit
- Timestamp:
- Dec 6, 2012 4:33:56 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r136907 r136908 1 2012-12-06 Andrei Bucur <abucur@adobe.com> 2 3 [CSS Regions] Remove the sanitize mechanism from LineFragmentationData 4 https://bugs.webkit.org/show_bug.cgi?id=104234 5 6 Reviewed by David Hyatt. 7 8 Remove previous work that ensured an invalid region is never returned by the containingRegion getter. After r136793 the blocks always 9 relayout children if the region chain changes. This means the sanitize() method is only necessary when all the regions are removed. 10 This case is treated separately in layoutInlineChildren. 11 12 Tests: no new functionality, no bug fixed. 13 14 * rendering/RenderBlock.cpp: 15 (WebCore::RenderBlock::lineWidthForPaginatedLineChanged): 16 * rendering/RenderBlockLineLayout.cpp: 17 (WebCore::RenderBlock::layoutInlineChildren): 18 * rendering/RootInlineBox.cpp: 19 (WebCore::RootInlineBox::containingRegion): 20 (WebCore): 21 (WebCore::RootInlineBox::setContainingRegion): 22 * rendering/RootInlineBox.h: 23 (RootInlineBox): 24 (WebCore::RootInlineBox::LineFragmentationData::LineFragmentationData): 25 (LineFragmentationData): 26 1 27 2012-12-06 Kenneth Russell <kbr@google.com> 2 28 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r136744 r136908 7252 7252 7253 7253 RenderRegion* currentRegion = regionAtBlockOffset(rootBox->lineTopWithLeading() + lineDelta); 7254 // Just bail if we still don't have a region.7255 if (!rootBox->hasContainingRegion() && !currentRegion)7256 return false;7257 7254 // Just bail if the region didn't change. 7258 if (rootBox-> hasContainingRegion() && rootBox->containingRegion() == currentRegion)7255 if (rootBox->containingRegion() == currentRegion) 7259 7256 return false; 7260 7257 return rootBox->paginatedLineWidth() != availableLogicalWidthForContent(currentRegion, offsetFromLogicalTopOfFirstPage()); -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r136857 r136908 1745 1745 layoutLineGridBox(); 1746 1746 1747 bool clearLinesForPagination = firstLineBox() && inRenderFlowThread() && !enclosingRenderFlowThread()->hasRegions(); 1748 1747 1749 // Figure out if we should clear out our line boxes. 1748 1750 // FIXME: Handle resize eventually! 1749 bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren ;1751 bool isFullLayout = !firstLineBox() || selfNeedsLayout() || relayoutChildren || clearLinesForPagination; 1750 1752 LineLayoutState layoutState(isFullLayout, repaintLogicalTop, repaintLogicalBottom); 1751 1753 -
trunk/Source/WebCore/rendering/RootInlineBox.cpp
r135750 r136908 251 251 } 252 252 253 RenderRegion* RootInlineBox::containingRegion() const 254 { 255 RenderRegion* region = m_fragmentationData ? m_fragmentationData->m_containingRegion : 0; 256 257 #ifndef NDEBUG 258 if (region) { 259 RenderFlowThread* flowThread = block()->enclosingRenderFlowThread(); 260 const RenderRegionList& regionList = flowThread->renderRegionList(); 261 ASSERT(regionList.contains(region)); 262 } 263 #endif 264 265 return region; 266 } 267 253 268 void RootInlineBox::setContainingRegion(RenderRegion* region) 254 269 { … … 257 272 LineFragmentationData* fragmentationData = ensureLineFragmentationData(); 258 273 fragmentationData->m_containingRegion = region; 259 fragmentationData->m_hasContainingRegion = !!region;260 }261 262 RootInlineBox::LineFragmentationData* RootInlineBox::LineFragmentationData::sanitize(const RenderBlock* block)263 {264 ASSERT(block->inRenderFlowThread());265 if (!m_containingRegion)266 return this;267 268 RenderFlowThread* flowThread = block->enclosingRenderFlowThread();269 const RenderRegionList& regionList = flowThread->renderRegionList();270 // For pointer types the hash function is |safeToCompareToEmptyOrDeleted|. There shouldn't be any problems if m_containingRegion was deleted.271 if (!regionList.contains(m_containingRegion))272 m_containingRegion = 0;273 274 return this;275 274 } 276 275 -
trunk/Source/WebCore/rendering/RootInlineBox.h
r135750 r136908 64 64 void setPaginatedLineWidth(LayoutUnit width) { ensureLineFragmentationData()->m_paginatedLineWidth = width; } 65 65 66 RenderRegion* containingRegion() const { return m_fragmentationData ? m_fragmentationData->sanitize(block())->m_containingRegion : 0; } 67 bool hasContainingRegion() const { return m_fragmentationData ? m_fragmentationData->m_hasContainingRegion : false; } 66 RenderRegion* containingRegion() const; 68 67 void setContainingRegion(RenderRegion*); 69 68 … … 230 229 , m_paginatedLineWidth(0) 231 230 , m_isFirstAfterPageBreak(false) 232 , m_hasContainingRegion(false)233 231 { 234 232 235 233 } 236 234 237 LineFragmentationData* sanitize(const RenderBlock*);238 239 235 // It should not be assumed the |containingRegion| is always valid. 240 // It can also be 0 if the flow has no region chain or an invalid pointer if the region is no longer in the chain. 241 // Use |sanitize| to filter an invalid region. 236 // It can also be 0 if the flow has no region chain. 242 237 RenderRegion* m_containingRegion; 243 238 LayoutUnit m_paginationStrut; 244 239 LayoutUnit m_paginatedLineWidth; 245 unsigned m_isFirstAfterPageBreak : 1; 246 unsigned m_hasContainingRegion : 1; // We need to keep this to differentiate between the case of a void region and an invalid region. 240 bool m_isFirstAfterPageBreak; 247 241 }; 248 242
Note: See TracChangeset
for help on using the changeset viewer.