Changeset 128861 in webkit
- Timestamp:
- Sep 18, 2012 1:39:59 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r128856 r128861 1 2012-09-18 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions]Flag auto-height regions 4 https://bugs.webkit.org/show_bug.cgi?id=96267 5 6 Reviewed by Julien Chaffraix. 7 8 The regions having auto logical height should be flagged so that their height will computed as part of a 2 pass-layout mechanism. 9 Added a test that checks whether a region in several situations is marked properly. 10 11 * fast/regions/autoheight-regions-mark.html: Added. 12 * platform/mac/fast/regions/autoheight-regions-mark-expected.png: Added. 13 * platform/mac/fast/regions/autoheight-regions-mark-expected.txt: Added. 14 * platform/chromium/TestExpectations: 15 1 16 2012-09-18 Shinya Kawanaka <shinyak@chromium.org> 2 17 -
trunk/LayoutTests/platform/chromium/TestExpectations
r128847 r128861 2490 2490 BUGWK74219 : fast/regions/positioned-objects-block-static-spanning-regions.html = PASS IMAGE 2491 2491 2492 BUGWK96267 : fast/regions/autoheight-regions-mark.html = PASS 2493 2492 2494 BUGWK74137 SNOWLEOPARD : fast/regions/outline-sides-in-region.html = PASS TIMEOUT 2493 2495 BUGWK83824 MAC : fast/regions/region-overflow-break.html = IMAGE -
trunk/Source/WebCore/ChangeLog
r128856 r128861 1 2012-09-18 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions]Flag auto-height regions 4 https://bugs.webkit.org/show_bug.cgi?id=96267 5 6 Reviewed by Julien Chaffraix. 7 8 The regions having auto logical height should be flagged so that their height will computed as part of a 2 pass-layout mechanism. 9 A valid region is flagged as having auto logical height if: 10 - has auto logical height and is part of the normal flow 11 - has auto logical height, is not part of normal flow and does not have logical top/bottom specified 12 13 An invalid region (part of circular dependency) will not be marked even if its style matches the above situations. 14 15 Test: fast/regions/autoheight-regions-mark.html 16 17 * rendering/FlowThreadController.cpp: Keep a counter of auto logical height valid regions. 18 (WebCore::FlowThreadController::FlowThreadController): 19 (WebCore::FlowThreadController::layoutRenderNamedFlowThreads): Verify that the current number of auto logical height regions is correct by iterating over all the regions attached to the flow threads 20 and compute the number of auto logical height regions on the spot. 21 (WebCore): 22 (WebCore::FlowThreadController::isAutoLogicalHeightRegionsFlagConsistent): Helper function that is used to verify the number of auto logical height regions. 23 * rendering/FlowThreadController.h: 24 (WebCore::FlowThreadController::hasAutoLogicalHeightRegions): 25 (WebCore::FlowThreadController::incrementAutoLogicalHeightRegions): 26 (WebCore::FlowThreadController::decrementAutoLogicalHeightRegions): 27 (FlowThreadController): 28 * rendering/RenderFlowThread.cpp: 29 (WebCore): 30 (WebCore::RenderFlowThread::autoLogicalHeightRegionsCount): Helper function that is used to count the number of regions marked as having auto logical height. 31 * rendering/RenderFlowThread.h: 32 * rendering/RenderRegion.cpp: 33 (WebCore::RenderRegion::RenderRegion): 34 (WebCore::RenderRegion::updateRegionHasAutoLogicalHeightFlag): 35 (WebCore): 36 (WebCore::RenderRegion::styleDidChange): For a region that is attached to a flow thread, verify whether the style change modified its auto logical height appearance. 37 (WebCore::RenderRegion::attachRegion): Handle the case of attaching region to a flow thread and the detach/attach sequence when the region is moved in the render tree. 38 (WebCore::RenderRegion::detachRegion): 39 * rendering/RenderRegion.h: 40 (WebCore::RenderRegion::shouldHaveAutoLogicalHeight): 41 (WebCore::RenderRegion::hasAutoLogicalHeight): 42 (RenderRegion): 43 * rendering/RenderTreeAsText.cpp: For the regions that use auto logical height, modify the output to reflect that. 44 (WebCore::writeRenderNamedFlowThreads): 45 1 46 2012-09-18 Shinya Kawanaka <shinyak@chromium.org> 2 47 -
trunk/Source/WebCore/rendering/FlowThreadController.cpp
r126961 r128861 50 50 , m_currentRenderFlowThread(0) 51 51 , m_isRenderNamedFlowThreadOrderDirty(false) 52 , m_autoLogicalHeightRegionsCount(0) 52 53 { 53 54 } … … 98 99 { 99 100 ASSERT(m_renderNamedFlowThreadList); 101 102 ASSERT(isAutoLogicalHeightRegionsFlagConsistent()); 100 103 101 104 // Remove the left-over flow threads. … … 157 160 } 158 161 162 #ifndef NDEBUG 163 bool FlowThreadController::isAutoLogicalHeightRegionsFlagConsistent() const 164 { 165 if (!hasRenderNamedFlowThreads()) 166 return !hasAutoLogicalHeightRegions(); 167 168 // Count the number of auto height regions 169 unsigned autoLogicalHeightRegions = 0; 170 for (RenderNamedFlowThreadList::iterator iter = m_renderNamedFlowThreadList->begin(); iter != m_renderNamedFlowThreadList->end(); ++iter) { 171 RenderNamedFlowThread* flowRenderer = *iter; 172 autoLogicalHeightRegions += flowRenderer->autoLogicalHeightRegionsCount(); 173 } 174 175 return autoLogicalHeightRegions == m_autoLogicalHeightRegionsCount; 176 } 177 #endif 178 159 179 } // namespace WebCore -
trunk/Source/WebCore/rendering/FlowThreadController.h
r128572 r128861 68 68 void unregisterNamedFlowContentNode(Node*); 69 69 70 bool hasAutoLogicalHeightRegions() const { return m_autoLogicalHeightRegionsCount; } 71 void incrementAutoLogicalHeightRegions() { ++m_autoLogicalHeightRegionsCount; } 72 void decrementAutoLogicalHeightRegions() { ASSERT(m_autoLogicalHeightRegionsCount > 0); --m_autoLogicalHeightRegionsCount; } 73 74 #ifndef NDEBUG 75 bool isAutoLogicalHeightRegionsFlagConsistent() const; 76 #endif 77 70 78 protected: 71 79 FlowThreadController(RenderView*); … … 75 83 RenderFlowThread* m_currentRenderFlowThread; 76 84 bool m_isRenderNamedFlowThreadOrderDirty; 85 unsigned m_autoLogicalHeightRegionsCount; 77 86 OwnPtr<RenderNamedFlowThreadList> m_renderNamedFlowThreadList; 78 87 // maps a content node to its render flow thread. -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r128201 r128861 755 755 } 756 756 757 #ifndef NDEBUG 758 unsigned RenderFlowThread::autoLogicalHeightRegionsCount() const 759 { 760 unsigned autoLogicalHeightRegions = 0; 761 for (RenderRegionList::const_iterator iter = m_regionList.begin(); iter != m_regionList.end(); ++iter) { 762 const RenderRegion* region = *iter; 763 if (!region->isValid()) { 764 ASSERT(!region->hasAutoLogicalHeight()); 765 continue; 766 } 767 768 if (region->hasAutoLogicalHeight()) 769 autoLogicalHeightRegions++; 770 } 771 772 return autoLogicalHeightRegions; 773 } 774 #endif 775 757 776 CurrentRenderFlowThreadMaintainer::CurrentRenderFlowThreadMaintainer(RenderFlowThread* renderFlowThread) 758 777 : m_renderFlowThread(renderFlowThread) -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r128335 r128861 132 132 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; } 133 133 134 #ifndef NDEBUG 135 unsigned autoLogicalHeightRegionsCount() const; 136 #endif 137 134 138 protected: 135 139 virtual const char* renderName() const = 0; -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r128416 r128861 50 50 , m_isValid(false) 51 51 , m_hasCustomRegionStyle(false) 52 , m_hasAutoLogicalHeight(false) 52 53 , m_regionState(RegionUndefined) 53 54 { … … 173 174 } 174 175 176 void RenderRegion::updateRegionHasAutoLogicalHeightFlag() 177 { 178 ASSERT(m_flowThread); 179 180 if (!isValid()) 181 return; 182 183 bool didHaveAutoLogicalHeight = m_hasAutoLogicalHeight; 184 m_hasAutoLogicalHeight = shouldHaveAutoLogicalHeight(); 185 if (m_hasAutoLogicalHeight != didHaveAutoLogicalHeight) { 186 if (m_hasAutoLogicalHeight) 187 view()->flowThreadController()->incrementAutoLogicalHeightRegions(); 188 else 189 view()->flowThreadController()->decrementAutoLogicalHeightRegions(); 190 } 191 } 192 175 193 void RenderRegion::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 176 194 { … … 186 204 187 205 checkRegionStyle(); 206 updateRegionHasAutoLogicalHeightFlag(); 188 207 } 189 208 … … 283 302 // it has region styling rules associated. 284 303 checkRegionStyle(); 304 305 if (!isValid()) 306 return; 307 308 m_hasAutoLogicalHeight = shouldHaveAutoLogicalHeight(); 309 if (hasAutoLogicalHeight()) 310 view()->flowThreadController()->incrementAutoLogicalHeightRegions(); 285 311 } 286 312 287 313 void RenderRegion::detachRegion() 288 314 { 289 if (m_flowThread) 315 if (m_flowThread) { 290 316 m_flowThread->removeRegionFromThread(this); 317 if (hasAutoLogicalHeight()) { 318 ASSERT(isValid()); 319 view()->flowThreadController()->decrementAutoLogicalHeightRegions(); 320 } 321 } 291 322 m_flowThread = 0; 292 323 } -
trunk/Source/WebCore/rendering/RenderRegion.h
r128416 r128861 115 115 virtual LayoutUnit logicalHeightOfAllFlowThreadContent() const; 116 116 117 bool shouldHaveAutoLogicalHeight() const 118 { 119 bool hasSpecifiedEndpointsForHeight = style()->logicalTop().isSpecified() && style()->logicalBottom().isSpecified(); 120 bool hasAnchoredEndpointsForHeight = isOutOfFlowPositioned() && hasSpecifiedEndpointsForHeight; 121 return style()->logicalHeight().isAuto() && !hasAnchoredEndpointsForHeight; 122 } 123 bool hasAutoLogicalHeight() const { return m_hasAutoLogicalHeight; } 124 117 125 // The top of the nearest page inside the region. For RenderRegions, this is just the logical top of the 118 126 // flow thread portion we contain. For sets, we have to figure out the top of the nearest column or … … 155 163 156 164 void checkRegionStyle(); 165 void updateRegionHasAutoLogicalHeightFlag(); 157 166 158 167 protected: … … 186 195 RenderObjectRegionStyleMap m_renderObjectRegionStyle; 187 196 188 bool m_isValid; 189 bool m_hasCustomRegionStyle; 197 bool m_isValid : 1; 198 bool m_hasCustomRegionStyle : 1; 199 bool m_hasAutoLogicalHeight : 1; 190 200 RegionState m_regionState; 191 201 }; -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r128564 r128861 695 695 if (renderRegion->hasCustomRegionStyle()) 696 696 ts << " region style: 1"; 697 if (renderRegion->hasAutoLogicalHeight()) 698 ts << " hasAutoLogicalHeight"; 697 699 } 698 700 if (!renderRegion->isValid())
Note: See TracChangeset
for help on using the changeset viewer.