Changeset 279958 in webkit
- Timestamp:
- Jul 15, 2021, 1:30:36 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r279956 r279958 1 2021-07-15 Simon Fraser <simon.fraser@apple.com> 2 3 Improve multicol logging in render tree dumps, and cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=227994 5 6 Reviewed by Alan Bujtas. 7 8 For a RenderFragmentedFlow dump the list of fragment containers, and clean up the existing 9 dumping of containers for a renderer inside a fragmented flow. Also dump column information 10 for RenderMultiColumnSet. 11 12 Use initializers for member variables in various fragmentation-related renderers. 13 14 * rendering/RenderFragmentContainer.cpp: 15 (WebCore::RenderFragmentContainer::RenderFragmentContainer): 16 * rendering/RenderFragmentContainer.h: 17 * rendering/RenderMultiColumnFlow.cpp: 18 (WebCore::RenderMultiColumnFlow::RenderMultiColumnFlow): 19 * rendering/RenderMultiColumnFlow.h: 20 * rendering/RenderMultiColumnSet.cpp: 21 (WebCore::RenderMultiColumnSet::RenderMultiColumnSet): 22 * rendering/RenderMultiColumnSet.h: 23 * rendering/RenderObject.cpp: 24 (WebCore::enclosingFragmentedFlowFromRenderer): 25 (WebCore::RenderObject::outputRegionsInformation const): 26 (WebCore::RenderObject::outputRenderObject const): 27 1 28 2021-07-15 Brady Eidson <beidson@apple.com> 2 29 -
trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp
r279918 r279958 53 53 : RenderBlockFlow(element, WTFMove(style)) 54 54 , m_fragmentedFlow(fragmentedFlow) 55 , m_isValid(false)56 55 { 57 56 } … … 60 59 : RenderBlockFlow(document, WTFMove(style)) 61 60 , m_fragmentedFlow(fragmentedFlow) 62 , m_isValid(false)63 61 { 64 62 } -
trunk/Source/WebCore/rendering/RenderFragmentContainer.h
r275478 r279958 165 165 RenderBoxFragmentInfoMap m_renderBoxFragmentInfo; 166 166 167 bool m_isValid : 1;167 bool m_isValid { false }; 168 168 }; 169 169 -
trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp
r277321 r279958 44 44 : RenderFragmentedFlow(document, WTFMove(style)) 45 45 , m_spannerMap(makeUnique<SpannerMap>()) 46 , m_lastSetWorkedOn(nullptr)47 , m_columnCount(1)48 , m_columnWidth(0)49 , m_columnHeightAvailable(0)50 , m_inLayout(false)51 , m_inBalancingPass(false)52 , m_needsHeightsRecalculation(false)53 , m_progressionIsInline(false)54 , m_progressionIsReversed(false)55 46 { 56 47 setFragmentedFlowState(InsideInFragmentedFlow); -
trunk/Source/WebCore/rendering/RenderMultiColumnFlow.h
r277321 r279958 121 121 // "current set" is difficult, since layout may jump back and forth in the tree, due to wrong 122 122 // top location estimates (due to e.g. margin collapsing), and possibly for other reasons. 123 RenderMultiColumnSet* m_lastSetWorkedOn ;123 RenderMultiColumnSet* m_lastSetWorkedOn { nullptr }; 124 124 125 unsigned m_columnCount ; // The default column count/width that are based off our containing block width. These values represent only the default,126 LayoutUnit m_columnWidth ; // A multi-column block that is split across variable width pages or fragments will have different column counts and widths in each. These values will be cached (eventually) for multi-column blocks.125 unsigned m_columnCount { 1 }; // The default column count/width that are based off our containing block width. These values represent only the default, 126 LayoutUnit m_columnWidth { 0 }; // A multi-column block that is split across variable width pages or fragments will have different column counts and widths in each. These values will be cached (eventually) for multi-column blocks. 127 127 128 128 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or 0 if auto. 129 bool m_inLayout ; // Set while we're laying out the flow thread, during which colum set heights are unknown.130 bool m_inBalancingPass ; // Guard to avoid re-entering column balancing.131 bool m_needsHeightsRecalculation ;129 bool m_inLayout { false }; // Set while we're laying out the flow thread, during which colum set heights are unknown. 130 bool m_inBalancingPass { false }; // Guard to avoid re-entering column balancing. 131 bool m_needsHeightsRecalculation { false }; 132 132 133 bool m_progressionIsInline ;134 bool m_progressionIsReversed ;133 bool m_progressionIsInline { false }; 134 bool m_progressionIsReversed { false }; 135 135 }; 136 136 -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r279918 r279958 43 43 RenderMultiColumnSet::RenderMultiColumnSet(RenderFragmentedFlow& fragmentedFlow, RenderStyle&& style) 44 44 : RenderFragmentContainerSet(fragmentedFlow.document(), WTFMove(style), fragmentedFlow) 45 , m_computedColumnCount(1)46 , m_computedColumnWidth(0)47 , m_computedColumnHeight(0)48 , m_availableColumnHeight(0)49 , m_columnHeightComputed(false)50 45 , m_maxColumnHeight(RenderFragmentedFlow::maxLogicalHeight()) 51 46 , m_minSpaceShortage(RenderFragmentedFlow::maxLogicalHeight()) 52 , m_minimumColumnHeight(0)53 , m_spaceShortageForSizeContainment(0)54 47 { 55 48 } -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r277321 r279958 139 139 unsigned columnCount() const; 140 140 141 LayoutUnit columnGap() const; 142 141 143 private: 142 144 void addOverflowFromChildren() override; … … 169 171 170 172 LayoutUnit calculateMaxColumnHeight() const; 171 LayoutUnit columnGap() const;172 173 173 174 LayoutUnit columnLogicalLeft(unsigned) const; … … 198 199 LayoutUnit calculateBalancedHeight(bool initial) const; 199 200 200 unsigned m_computedColumnCount ; // Used column count (the resulting 'N' from the pseudo-algorithm in the multicol spec)201 unsigned m_computedColumnCount { 1 }; // Used column count (the resulting 'N' from the pseudo-algorithm in the multicol spec) 201 202 LayoutUnit m_computedColumnWidth; // Used column width (the resulting 'W' from the pseudo-algorithm in the multicol spec) 202 203 LayoutUnit m_computedColumnHeight; 203 204 LayoutUnit m_availableColumnHeight; 204 bool m_columnHeightComputed ;205 bool m_columnHeightComputed { false }; 205 206 206 207 // The following variables are used when balancing the column set. … … 221 222 ContentRun(LayoutUnit breakOffset) 222 223 : m_breakOffset(breakOffset) 223 , m_assumedImplicitBreaks(0){ }224 { } 224 225 225 226 unsigned assumedImplicitBreaks() const { return m_assumedImplicitBreaks; } … … 233 234 private: 234 235 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. 235 unsigned m_assumedImplicitBreaks ; // Number of implicit breaks in this run assumed so far.236 unsigned m_assumedImplicitBreaks { 0 }; // Number of implicit breaks in this run assumed so far. 236 237 }; 237 238 Vector<ContentRun, 1> m_contentRuns; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r279918 r279958 57 57 #include "RenderLineBreak.h" 58 58 #include "RenderMultiColumnFlow.h" 59 #include "RenderMultiColumnSet.h" 59 60 #include "RenderRuby.h" 60 61 #include "RenderSVGBlock.h" … … 1068 1069 return nullptr; 1069 1070 1070 if (is<RenderFragmentedFlow>(*renderer))1071 return downcast<RenderFragmentedFlow>(renderer);1072 1073 1071 if (is<RenderBlock>(*renderer)) 1074 1072 return downcast<RenderBlock>(*renderer).cachedEnclosingFragmentedFlow(); … … 1079 1077 void RenderObject::outputRegionsInformation(TextStream& stream) const 1080 1078 { 1081 const RenderFragmentedFlow* ftcb = enclosingFragmentedFlowFromRenderer(this); 1082 1083 if (!ftcb) { 1079 if (is<RenderFragmentedFlow>(*this)) { 1080 const auto& fragmentedFlow = downcast<RenderFragmentedFlow>(*this); 1081 auto fragmentContainers = fragmentedFlow.renderFragmentContainerList(); 1082 1083 stream << " [fragment containers "; 1084 bool first = true; 1085 for (const auto* fragment : fragmentContainers) { 1086 if (!first) 1087 stream << ", "; 1088 first = false; 1089 stream << fragment; 1090 } 1091 stream << "]"; 1092 } 1093 1094 const RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlowFromRenderer(this); 1095 1096 if (!fragmentedFlow) { 1084 1097 // Only the boxes have region range information. 1085 1098 // Try to get the flow thread containing block information 1086 1099 // from the containing block of this box. 1087 1100 if (is<RenderBox>(*this)) 1088 f tcb= enclosingFragmentedFlowFromRenderer(containingBlock());1089 } 1090 1091 if (!f tcb)1092 return; 1093 1094 RenderFragmentContainer* start Region= nullptr;1095 RenderFragmentContainer* end Region= nullptr;1096 f tcb->getFragmentRangeForBox(downcast<RenderBox>(this), startRegion, endRegion);1097 stream << " [ Rs:" << startRegion << " Re:" << endRegion<< "]";1101 fragmentedFlow = enclosingFragmentedFlowFromRenderer(containingBlock()); 1102 } 1103 1104 if (!fragmentedFlow || !is<RenderBox>(*this)) 1105 return; 1106 1107 RenderFragmentContainer* startContainer = nullptr; 1108 RenderFragmentContainer* endContainer = nullptr; 1109 fragmentedFlow->getFragmentRangeForBox(downcast<RenderBox>(this), startContainer, endContainer); 1110 stream << " [spans fragment containers in flow " << fragmentedFlow << " from " << startContainer << " to " << endContainer << "]"; 1098 1111 } 1099 1112 … … 1235 1248 } 1236 1249 1250 if (is<RenderMultiColumnSet>(*this)) { 1251 const auto& multicolSet = downcast<RenderMultiColumnSet>(*this); 1252 stream << " (column count " << multicolSet.computedColumnCount() << ", size " << multicolSet.computedColumnWidth() << "x" << multicolSet.computedColumnHeight() << ", gap " << multicolSet.columnGap() << ")"; 1253 } 1254 1237 1255 outputRegionsInformation(stream); 1256 1238 1257 if (needsLayout()) { 1239 1258 stream << " layout->";
Note:
See TracChangeset
for help on using the changeset viewer.