Changeset 294231 in webkit
- Timestamp:
- May 16, 2022 6:16:41 AM (2 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r294229 r294231 1 2022-05-16 Alan Bujtas <zalan@apple.com> 2 3 [LFC][FFC] Add "flex-direction: column" basic visual/logical conversion 4 https://bugs.webkit.org/show_bug.cgi?id=240430 5 6 Reviewed by Antti Koivisto. 7 8 With "flex-direction: column" the main axis progression is based on the margin box height. 9 10 * layout/formattingContexts/flex/FlexFormattingContext.cpp: 11 (WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration): 12 1 13 2022-05-15 Philippe Normand <philn@igalia.com> 2 14 -
trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp
r294217 r294231 135 135 auto convertVisualToLogical = [&] { 136 136 // FIXME: Convert visual (row/column) direction to logical. 137 auto direction = root().style().flexDirection(); 138 137 139 logicalLeft = constraints.horizontal().logicalLeft; 138 140 logicalTop = constraints.logicalTop(); 139 141 140 142 for (auto& flexItem : childrenOfType<ContainerBox>(root())) { 141 143 auto& flexItemGeometry = formattingState.boxGeometry(flexItem); 142 logicalFlexItemList.append({ { LayoutSize { flexItemGeometry.marginBoxWidth(), flexItemGeometry.marginBoxHeight() } }, flexItem }); 144 auto logicalSize = LayoutSize { }; 145 146 switch (direction) { 147 case FlexDirection::Row: 148 logicalSize = { flexItemGeometry.marginBoxWidth(), flexItemGeometry.marginBoxHeight() }; 149 break; 150 case FlexDirection::Column: 151 logicalSize = { flexItemGeometry.marginBoxHeight(), flexItemGeometry.marginBoxWidth() }; 152 break; 153 case FlexDirection::RowReverse: 154 case FlexDirection::ColumnReverse: 155 ASSERT_NOT_IMPLEMENTED_YET(); 156 break; 157 default: 158 ASSERT_NOT_REACHED(); 159 break; 160 } 161 logicalFlexItemList.append({ { logicalSize }, flexItem }); 143 162 } 144 163 }; … … 152 171 auto convertLogicalToVisual = [&] { 153 172 // FIXME: Convert logical coordinates to visual. 173 auto direction = root().style().flexDirection(); 154 174 for (auto& logicalFlexItem : logicalFlexItemList) { 155 175 auto& flexItemGeometry = formattingState.boxGeometry(logicalFlexItem.flexItem); 156 flexItemGeometry.setLogicalTopLeft(logicalFlexItem.rect.topLeft()); 176 auto topLeft = LayoutPoint { }; 177 178 switch (direction) { 179 case FlexDirection::Row: 180 topLeft = logicalFlexItem.rect.topLeft(); 181 break; 182 case FlexDirection::Column: 183 topLeft = logicalFlexItem.rect.topLeft().transposedPoint(); 184 break; 185 case FlexDirection::RowReverse: 186 case FlexDirection::ColumnReverse: 187 ASSERT_NOT_IMPLEMENTED_YET(); 188 break; 189 default: 190 ASSERT_NOT_REACHED(); 191 break; 192 } 193 flexItemGeometry.setLogicalTopLeft(topLeft); 157 194 } 158 195 };
Note: See TracChangeset
for help on using the changeset viewer.