Changeset 166781 in webkit
- Timestamp:
- Apr 4, 2014 8:05:43 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166778 r166781 1 2014-04-04 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions] Region's behaviour not updated when becoming valid from invalid 4 https://bugs.webkit.org/show_bug.cgi?id=131211 5 6 Reviewed by Andrei Bucur. 7 8 Add tests for auto-height and region styling behaviour. 9 10 * fast/regions/auto-size/autoheight-region-valid-from-invalid-expected.html: Added. 11 * fast/regions/auto-size/autoheight-region-valid-from-invalid.html: Added. 12 * fast/regions/region-styling/region-withstyling-valid-from-invalid-expected.html: Added. 13 * fast/regions/region-styling/region-withstyling-valid-from-invalid.html: Added. 14 1 15 2014-04-04 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r166780 r166781 1 2014-04-04 Mihnea Ovidenie <mihnea@adobe.com> 2 3 [CSSRegions] Region's behaviour not updated when becoming valid from invalid 4 https://bugs.webkit.org/show_bug.cgi?id=131211 5 6 Reviewed by Andrei Bucur. 7 8 When a region becomes valid again from invalid, it was part of a dependency cycle and the dependency cycle was broken, 9 it needs to behave like a valid region again: if it has autoheight then it should compute its height based on the 10 named flow content, if it has region styling then it should apply the additional style to the flowed content. 11 12 Added a new method, updateRegionFlags, that is used to ensure that auto-height and region-styling flags 13 are properly set in several situations. Checking the behaviour, autoheight or styling, is done only 14 if the region is valid. 15 16 Tests: fast/regions/auto-size/autoheight-region-valid-from-invalid.html 17 fast/regions/region-styling/region-withstyling-valid-from-invalid.html 18 19 * rendering/RenderNamedFlowFragment.cpp: 20 (WebCore::RenderNamedFlowFragment::updateRegionFlags): 21 (WebCore::RenderNamedFlowFragment::styleDidChange): 22 (WebCore::RenderNamedFlowFragment::updateRegionHasAutoLogicalHeightFlag): 23 (WebCore::RenderNamedFlowFragment::checkRegionStyle): 24 (WebCore::RenderNamedFlowFragment::attachRegion): 25 (WebCore::RenderNamedFlowFragment::detachRegion): 26 * rendering/RenderNamedFlowFragment.h: 27 * rendering/RenderNamedFlowThread.cpp: 28 (WebCore::RenderNamedFlowThread::addFragmentToNamedFlowThread): 29 1 30 2014-04-04 Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> 2 31 -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.cpp
r166301 r166781 68 68 } 69 69 70 void RenderNamedFlowFragment::updateRegionFlags() 71 { 72 checkRegionStyle(); 73 updateRegionHasAutoLogicalHeightFlag(); 74 } 75 70 76 void RenderNamedFlowFragment::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 71 77 { 72 78 RenderRegion::styleDidChange(diff, oldStyle); 73 79 74 // If the region is not attached to any thread, there is no need to check 75 // whether the region has region styling since no content will be displayed 76 // into the region. 77 if (!m_flowThread) { 78 setHasCustomRegionStyle(false); 79 return; 80 } 81 82 updateRegionHasAutoLogicalHeightFlag(); 83 84 checkRegionStyle(); 80 if (!isValid()) 81 return; 82 83 updateRegionFlags(); 85 84 86 85 if (parent() && parent()->needsLayout()) … … 121 120 void RenderNamedFlowFragment::updateRegionHasAutoLogicalHeightFlag() 122 121 { 123 ASSERT(m_flowThread); 124 125 if (!isValid()) 126 return; 122 ASSERT(isValid()); 127 123 128 124 bool didHaveAutoLogicalHeight = m_hasAutoLogicalHeight; 129 125 m_hasAutoLogicalHeight = shouldHaveAutoLogicalHeight(); 130 if (m_hasAutoLogicalHeight != didHaveAutoLogicalHeight) { 131 if (m_hasAutoLogicalHeight) 132 incrementAutoLogicalHeightCount(); 133 else { 134 clearComputedAutoHeight(); 135 decrementAutoLogicalHeightCount(); 136 } 126 if (didHaveAutoLogicalHeight == m_hasAutoLogicalHeight) 127 return; 128 129 if (m_hasAutoLogicalHeight) 130 incrementAutoLogicalHeightCount(); 131 else { 132 clearComputedAutoHeight(); 133 decrementAutoLogicalHeightCount(); 137 134 } 138 135 } … … 339 336 void RenderNamedFlowFragment::checkRegionStyle() 340 337 { 341 ASSERT(m_flowThread); 338 ASSERT(isValid()); 339 342 340 bool customRegionStyle = false; 343 341 … … 509 507 RenderRegion::attachRegion(); 510 508 511 if (documentBeingDestroyed() || !m_flowThread) 512 return; 513 514 // The region just got attached to the flow thread, lets check whether 515 // it has region styling rules associated. 516 checkRegionStyle(); 517 518 if (!isValid()) 519 return; 520 521 m_hasAutoLogicalHeight = shouldHaveAutoLogicalHeight(); 522 if (hasAutoLogicalHeight()) 523 incrementAutoLogicalHeightCount(); 509 if (documentBeingDestroyed() || !isValid()) 510 return; 511 512 updateRegionFlags(); 524 513 } 525 514 526 515 void RenderNamedFlowFragment::detachRegion() 527 516 { 528 if (m_flowThread && hasAutoLogicalHeight()) 517 if (hasAutoLogicalHeight()) { 518 ASSERT(isValid()); 519 m_hasAutoLogicalHeight = false; 520 clearComputedAutoHeight(); 529 521 decrementAutoLogicalHeightCount(); 522 } 530 523 531 524 RenderRegion::detachRegion(); -
trunk/Source/WebCore/rendering/RenderNamedFlowFragment.h
r165542 r166781 81 81 82 82 bool hasCustomRegionStyle() const { return m_hasCustomRegionStyle; } 83 void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; }84 83 void clearObjectStyleInRegion(const RenderObject*); 85 84 … … 116 115 virtual void updateLogicalHeight() override; 117 116 118 // FIXME: Temporarily public until we move all the CSSRegions functionality from RenderRegion to here. 119 public: 120 void checkRegionStyle(); 117 void updateRegionFlags(); 121 118 122 119 private: … … 126 123 void computeChildrenStyleInRegion(RenderElement&); 127 124 void setObjectStyleInRegion(RenderObject*, PassRefPtr<RenderStyle>, bool objectRegionStyleCached); 125 126 void checkRegionStyle(); 127 void setHasCustomRegionStyle(bool hasCustomRegionStyle) { m_hasCustomRegionStyle = hasCustomRegionStyle; } 128 128 129 129 void updateRegionHasAutoLogicalHeightFlag(); -
trunk/Source/WebCore/rendering/RenderNamedFlowThread.cpp
r166354 r166781 220 220 221 221 renderNamedFlowFragment->setIsValid(true); 222 renderNamedFlowFragment->updateRegionFlags(); 222 223 addFragmentToList(m_regionList, renderNamedFlowFragment); 223 224
Note: See TracChangeset
for help on using the changeset viewer.