Changeset 250050 in webkit
- Timestamp:
- Sep 18, 2019 12:56:14 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r250048 r250050 1 2019-09-18 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Introduce UsedHorizontalValues::Constraints 4 https://bugs.webkit.org/show_bug.cgi?id=201919 5 <rdar://problem/55481927> 6 7 Reviewed by Antti Koivisto. 8 9 UsedHorizontalValues::Constraints holds the constraint values for a particular box geometry computation (currently it only has the horizontal width constraint) 10 11 * Sources.txt: 12 * WebCore.xcodeproj/project.pbxproj: 13 * layout/FormattingContext.cpp: 14 (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry): 15 (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry): 16 (WebCore::Layout::FormattingContext::computeBorderAndPadding): 17 * layout/FormattingContextGeometry.cpp: 18 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const): 19 (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): 20 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const): 21 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const): 22 (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): 23 (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const): 24 (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const): 25 (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const): 26 (WebCore::Layout::FormattingContext::Geometry::computedPadding const): 27 (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const): 28 (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const): 29 * layout/FormattingContextQuirks.cpp: 30 (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): 31 * layout/LayoutUnits.h: 32 (WebCore::Layout::UsedHorizontalValues::Constraints::Constraints): 33 (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues): 34 * layout/blockformatting/BlockFormattingContext.cpp: 35 (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren): 36 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): 37 (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin): 38 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin): 39 * layout/blockformatting/BlockFormattingContextGeometry.cpp: 40 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const): 41 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): 42 * layout/blockformatting/BlockFormattingContextQuirks.cpp: 43 (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight): 44 * layout/blockformatting/BlockMarginCollapse.cpp: 45 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues): 46 * layout/floats/FloatingContext.h: 47 * layout/inlineformatting/InlineFormattingContext.cpp: 48 (WebCore::Layout::InlineFormattingContext::layoutInFlowContent): 49 (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints): 50 (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot): 51 (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin): 52 * layout/inlineformatting/InlineFormattingContextGeometry.cpp: 53 (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): 54 * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: 55 (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const): 56 * layout/tableformatting/TableFormattingContext.cpp: 57 (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): 58 1 59 2019-09-18 Andy Estes <aestes@apple.com> 2 60 -
trunk/Source/WebCore/Sources.txt
r250040 r250050 1397 1397 layout/LayoutPhase.cpp 1398 1398 layout/LayoutState.cpp 1399 layout/LayoutUnits.cpp 1399 1400 layout/Verification.cpp 1400 1401 layout/blockformatting/BlockFormattingContext.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r250048 r250050 5814 5814 113D0B4F1F9FDD2B00F611BB /* FrameViewLayoutContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FrameViewLayoutContext.cpp; sourceTree = "<group>"; }; 5815 5815 113D0B501F9FDD2B00F611BB /* FrameViewLayoutContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameViewLayoutContext.h; sourceTree = "<group>"; }; 5816 115CA83023328B1E00FD3B08 /* LayoutUnits.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnits.cpp; sourceTree = "<group>"; }; 5816 5817 115CFA68208AF7D0001E6991 /* FormattingContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FormattingContext.h; sourceTree = "<group>"; }; 5817 5818 115CFA69208AF7D0001E6991 /* FormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FormattingContext.cpp; sourceTree = "<group>"; }; … … 16410 16411 6F7CA3C5208C2956002F29AB /* LayoutState.cpp */, 16411 16412 6F7CA3C4208C2956002F29AB /* LayoutState.h */, 16413 115CA83023328B1E00FD3B08 /* LayoutUnits.cpp */, 16412 16414 6F73918C2106CEDD006AF262 /* LayoutUnits.h */, 16413 16415 6FE7AA2621C37B6300296DCD /* MarginTypes.h */, -
trunk/Source/WebCore/layout/FormattingContext.cpp
r250035 r250050 71 71 72 72 auto compute = [&](Optional<LayoutUnit> usedWidth) { 73 auto usedHorizontalValues = UsedHorizontalValues { containingBlockWidth, usedWidth, { } };73 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { containingBlockWidth }, usedWidth, { } }; 74 74 auto usedVerticalValues = UsedVerticalValues { containingBlockHeight, { } }; 75 75 return geometry().outOfFlowHorizontalGeometry(layoutBox, usedHorizontalValues, usedVerticalValues); … … 106 106 107 107 auto usedVerticalValuesForHeight = UsedVerticalValues { containingBlockHeight, { } }; 108 auto usedHorizontalValues = UsedHorizontalValues { containingBlockWidth};108 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { containingBlockWidth } }; 109 109 110 110 auto verticalGeometry = compute(usedHorizontalValues, usedVerticalValuesForHeight); … … 134 134 { 135 135 if (!usedHorizontalValues) 136 usedHorizontalValues = UsedHorizontalValues { geometryForBox(*layoutBox.containingBlock()).contentBoxWidth()};136 usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(*layoutBox.containingBlock()) } }; 137 137 auto& displayBox = formattingState().displayBox(layoutBox); 138 138 displayBox.setBorder(geometry().computedBorder(layoutBox)); -
trunk/Source/WebCore/layout/FormattingContextGeometry.cpp
r250035 r250050 301 301 auto& boxGeometry = formattingContext.geometryForBox(layoutBox); 302 302 auto containingBlockHeight = *usedVerticalValues.containingBlockHeight; 303 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;303 auto containingBlockWidth = usedHorizontalValues.constraints.width; 304 304 305 305 auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); … … 424 424 auto& style = layoutBox.style(); 425 425 auto& boxGeometry = formattingContext.geometryForBox(layoutBox); 426 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;426 auto containingBlockWidth = usedHorizontalValues.constraints.width; 427 427 auto isLeftToRightDirection = layoutBox.containingBlock()->style().isLeftToRightDirection(); 428 428 … … 558 558 auto& boxGeometry = formattingContext.geometryForBox(layoutBox); 559 559 auto containingBlockHeight = *usedVerticalValues.containingBlockHeight; 560 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;560 auto containingBlockWidth = usedHorizontalValues.constraints.width; 561 561 562 562 auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); … … 642 642 auto& style = layoutBox.style(); 643 643 auto& boxGeometry = formattingContext.geometryForBox(layoutBox); 644 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;644 auto containingBlockWidth = usedHorizontalValues.constraints.width; 645 645 auto isLeftToRightDirection = layoutBox.containingBlock()->style().isLeftToRightDirection(); 646 646 … … 770 770 auto usedHorizontallMargin = UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) }; 771 771 // #2 772 auto width = computedValueIfNotAuto(usedHorizontalValues.width ? Length { usedHorizontalValues.width.value(), Fixed } : layoutBox.style().logicalWidth(), usedHorizontalValues.con tainingBlockWidth);772 auto width = computedValueIfNotAuto(usedHorizontalValues.width ? Length { usedHorizontalValues.width.value(), Fixed } : layoutBox.style().logicalWidth(), usedHorizontalValues.constraints.width); 773 773 if (!width) 774 width = shrinkToFitWidth(layoutBox, usedHorizontalValues.con tainingBlockWidth);774 width = shrinkToFitWidth(layoutBox, usedHorizontalValues.constraints.width); 775 775 776 776 LOG_WITH_STREAM(FormattingContextLayout, stream << "[Width][Margin] -> floating non-replaced -> width(" << *width << "px) margin(" << usedHorizontallMargin.start << "px, " << usedHorizontallMargin.end << "px) -> layoutBox(" << &layoutBox << ")"); … … 799 799 800 800 LOG_WITH_STREAM(FormattingContextLayout, stream << "[Height][Margin] -> floating replaced -> redirected to inline replaced"); 801 return inlineReplacedWidthAndMargin(layoutBox, UsedHorizontalValues { usedHorizontalValues.containingBlockWidth,802 usedHorizontalValues.width, UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) } });801 usedHorizontalValues.margin = UsedHorizontalMargin { computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) }; 802 return inlineReplacedWidthAndMargin(layoutBox, usedHorizontalValues); 803 803 } 804 804 … … 909 909 910 910 auto& style = layoutBox.style(); 911 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;911 auto containingBlockWidth = usedHorizontalValues.constraints.width; 912 912 auto computedHorizontalMargin = Geometry::computedHorizontalMargin(layoutBox, usedHorizontalValues); 913 913 … … 970 970 971 971 auto& style = layoutBox.style(); 972 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;972 auto containingBlockWidth = usedHorizontalValues.constraints.width; 973 973 974 974 auto top = computedValueIfNotAuto(style.logicalTop(), containingBlockWidth); … … 1047 1047 1048 1048 auto& style = layoutBox.style(); 1049 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;1049 auto containingBlockWidth = usedHorizontalValues.constraints.width; 1050 1050 LOG_WITH_STREAM(FormattingContextLayout, stream << "[Padding] -> layoutBox: " << &layoutBox); 1051 1051 return Edges { … … 1058 1058 { 1059 1059 auto& style = layoutBox.style(); 1060 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;1060 auto containingBlockWidth = usedHorizontalValues.constraints.width; 1061 1061 return { computedValueIfNotAuto(style.marginStart(), containingBlockWidth), computedValueIfNotAuto(style.marginEnd(), containingBlockWidth) }; 1062 1062 } … … 1065 1065 { 1066 1066 auto& style = layoutBox.style(); 1067 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;1067 auto containingBlockWidth = usedHorizontalValues.constraints.width; 1068 1068 return { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth), computedValueIfNotAuto(style.marginAfter(), containingBlockWidth) }; 1069 1069 } -
trunk/Source/WebCore/layout/FormattingContextQuirks.cpp
r249834 r250050 53 53 auto& boxGeometry = formattingContext.geometryForBox(*containingBlock, FormattingContext::EscapeType::AccessAncestorFormattingContext); 54 54 55 auto usedValues = UsedHorizontalValues { formattingContext.geometryForBox(*containingBlock->containingBlock(), FormattingContext::EscapeType::AccessAncestorFormattingContext).contentBoxWidth()};55 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { formattingContext.geometryForBox(*containingBlock->containingBlock(), FormattingContext::EscapeType::AccessAncestorFormattingContext) } }; 56 56 auto verticalMargin = formattingContext.geometry().computedVerticalMargin(*containingBlock, usedValues); 57 57 auto verticalPadding = boxGeometry.paddingTop().valueOr(0) + boxGeometry.paddingBottom().valueOr(0); -
trunk/Source/WebCore/layout/LayoutUnits.h
r249903 r250050 35 35 36 36 namespace WebCore { 37 38 namespace Display { 39 class Box; 40 } 41 37 42 namespace Layout { 38 43 … … 139 144 140 145 struct UsedHorizontalValues { 141 explicit UsedHorizontalValues(LayoutUnit containingBlockWidth) 142 : containingBlockWidth(containingBlockWidth) 146 struct Constraints { 147 explicit Constraints(const Display::Box& containingBlockGeometry); 148 explicit Constraints(LayoutUnit horizontalConstraint) 149 : width(horizontalConstraint) 143 150 { 144 151 } 145 152 146 explicit UsedHorizontalValues(LayoutUnit containingBlockWidth, Optional<LayoutUnit> width, Optional<UsedHorizontalMargin> margin) 147 : containingBlockWidth(containingBlockWidth) 153 LayoutUnit width; 154 }; 155 156 explicit UsedHorizontalValues(Constraints constraints) 157 : constraints(constraints) 158 { 159 } 160 161 explicit UsedHorizontalValues(Constraints constraints, Optional<LayoutUnit> width, Optional<UsedHorizontalMargin> margin) 162 : constraints(constraints) 148 163 , width(width) 149 164 , margin(margin) 150 151 165 { 166 } 152 167 153 LayoutUnit containingBlockWidth;168 Constraints constraints; 154 169 Optional<LayoutUnit> width; 155 170 Optional<UsedHorizontalMargin> margin; -
trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
r249955 r250050 34 34 #include "FloatingState.h" 35 35 #include "LayoutBox.h" 36 #include "LayoutChildIterator.h" 36 37 #include "LayoutContainer.h" 37 38 #include "LayoutState.h" … … 194 195 195 196 auto computeInFlowPositionedPosition = [&] { 196 auto usedHorizontalValues = UsedHorizontalValues { geometryForBox(*childBox.containingBlock()).contentBoxWidth()};197 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(*childBox.containingBlock()) } }; 197 198 auto positionOffset = geometry().inFlowPositionedPositionOffset(childBox, usedHorizontalValues); 198 199 … … 232 233 void BlockFormattingContext::computeEstimatedVerticalPosition(const Box& layoutBox) 233 234 { 234 auto usedHorizontalValues = UsedHorizontalValues { geometryForBox(*layoutBox.containingBlock()).contentBoxWidth()};235 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(*layoutBox.containingBlock()) } }; 235 236 auto computedVerticalMargin = geometry().computedVerticalMargin(layoutBox, usedHorizontalValues); 236 237 auto usedNonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; … … 357 358 358 359 auto compute = [&](Optional<LayoutUnit> usedWidth) -> WidthAndMargin { 359 auto usedValues = UsedHorizontalValues { availableWidth, usedWidth, { } };360 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { availableWidth }, usedWidth, { } }; 360 361 if (layoutBox.isInFlow()) 361 362 return geometry().inFlowWidthAndMargin(layoutBox, usedValues); … … 391 392 auto compute = [&](auto usedVerticalValues) -> HeightAndMargin { 392 393 393 auto usedHorizontalValues = UsedHorizontalValues { geometryForBox(*layoutBox.containingBlock()).contentBoxWidth()};394 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(*layoutBox.containingBlock()) } }; 394 395 if (layoutBox.isInFlow()) 395 396 return geometry().inFlowHeightAndMargin(layoutBox, usedHorizontalValues, usedVerticalValues); -
trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp
r250033 r250050 137 137 138 138 auto& style = layoutBox.style(); 139 auto containingBlockWidth = usedHorizontalValues.con tainingBlockWidth;139 auto containingBlockWidth = usedHorizontalValues.constraints.width; 140 140 auto& boxGeometry = formattingContext().geometryForBox(layoutBox); 141 141 … … 279 279 } 280 280 281 WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const Box& layoutBox, UsedHorizontalValues used Values)281 WidthAndMargin BlockFormattingContext::Geometry::inFlowWidthAndMargin(const Box& layoutBox, UsedHorizontalValues usedHorizontalValues) 282 282 { 283 283 ASSERT(layoutBox.isInFlow()); … … 287 287 // This is a special table "fit-content size" behavior handling. Not in the spec though. 288 288 // Table returns its final width as min/max. Use this final width value to computed horizontal margins etc. 289 used Values.width = shrinkToFitWidth(layoutBox, usedValues.containingBlockWidth);290 } 291 return inFlowNonReplacedWidthAndMargin(layoutBox, used Values);289 usedHorizontalValues.width = shrinkToFitWidth(layoutBox, usedHorizontalValues.constraints.width); 290 } 291 return inFlowNonReplacedWidthAndMargin(layoutBox, usedHorizontalValues); 292 292 } 293 return inFlowReplacedWidthAndMargin(layoutBox, used Values);293 return inFlowReplacedWidthAndMargin(layoutBox, usedHorizontalValues); 294 294 } 295 295 -
trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp
r249908 r250050 70 70 auto& documentBoxGeometry = formattingContext.geometryForBox(documentBox); 71 71 72 auto& initialContainingBloc Geometry = formattingContext.geometryForBox(initialContainingBlock(layoutBox));73 auto strechedHeight = initialContainingBloc Geometry.contentBoxHeight();72 auto& initialContainingBlockGeometry = formattingContext.geometryForBox(initialContainingBlock(layoutBox)); 73 auto strechedHeight = initialContainingBlockGeometry.contentBoxHeight(); 74 74 strechedHeight -= documentBoxGeometry.verticalBorder() + documentBoxGeometry.verticalPadding().valueOr(0); 75 75 … … 83 83 // Stretch the body using the initial containing block's height and shrink it with document box's margin/border/padding. 84 84 // This looks extremely odd when html has non-auto height. 85 auto documentBoxVerticalMargin = formattingContext.geometry().computedVerticalMargin(documentBox, UsedHorizontalValues { initialContainingBlocGeometry.contentBoxWidth()});85 auto documentBoxVerticalMargin = formattingContext.geometry().computedVerticalMargin(documentBox, UsedHorizontalValues { UsedHorizontalValues::Constraints { initialContainingBlockGeometry } }); 86 86 strechedHeight -= (documentBoxVerticalMargin.before.valueOr(0) + documentBoxVerticalMargin.after.valueOr(0)); 87 87 -
trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp
r249955 r250050 520 520 } 521 521 // This is the estimate path. We don't yet have positive/negative margin computed. 522 auto usedValues = UsedHorizontalValues { formattingContext().geometryForBox(*layoutBox.containingBlock()).contentBoxWidth()};522 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { formattingContext().geometryForBox(*layoutBox.containingBlock()) } }; 523 523 auto computedVerticalMargin = formattingContext().geometry().computedVerticalMargin(layoutBox, usedValues); 524 524 auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; -
trunk/Source/WebCore/layout/floats/FloatingContext.h
r249849 r250050 31 31 #include "FormattingContext.h" 32 32 #include "LayoutContainer.h" 33 #include "LayoutUnits.h"34 33 #include <wtf/IsoMalloc.h> 35 34 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
r249903 r250050 69 69 70 70 LOG_WITH_STREAM(FormattingContextLayout, stream << "[Start] -> inline formatting context -> formatting root(" << &root() << ")"); 71 auto availableWidth = geometryForBox(root()).contentBoxWidth(); 72 auto usedValues = UsedHorizontalValues { availableWidth }; 71 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(root()) } }; 73 72 auto* layoutBox = root().firstInFlowOrFloatingChild(); 74 73 // Compute width/height for non-text content and margin/border/padding for inline containers. … … 92 91 93 92 collectInlineContent(); 94 InlineLayout(*this).layout(formattingState().inlineItems(), availableWidth);93 InlineLayout(*this).layout(formattingState().inlineItems(), usedValues.constraints.width); 95 94 LOG_WITH_STREAM(FormattingContextLayout, stream << "[End] -> inline formatting context -> formatting root(" << &root() << ")"); 96 95 } … … 108 107 109 108 Vector<const Box*> formattingContextRootList; 110 auto usedValues = UsedHorizontalValues { LayoutUnit {} };109 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { LayoutUnit { } } }; 111 110 auto* layoutBox = root().firstInFlowOrFloatingChild(); 112 111 while (layoutBox) { … … 169 168 ASSERT(formattingRoot.establishesFormattingContext()); 170 169 171 auto usedValues = UsedHorizontalValues { LayoutUnit {} };170 auto usedValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { LayoutUnit { } } }; 172 171 computeBorderAndPadding(formattingRoot, usedValues); 173 172 computeHorizontalMargin(formattingRoot, usedValues); … … 212 211 { 213 212 HeightAndMargin heightAndMargin; 214 auto usedHorizontalValues = UsedHorizontalValues { geometryForBox(*layoutBox.containingBlock()).contentBoxWidth()};213 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { geometryForBox(*layoutBox.containingBlock()) } }; 215 214 if (layoutBox.isFloatingPositioned()) 216 215 heightAndMargin = geometry().floatingHeightAndMargin(layoutBox, usedHorizontalValues, { }); -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp
r250033 r250050 54 54 // A computed value of 'auto' for 'margin-left' or 'margin-right' becomes a used value of '0'. 55 55 // #1 56 auto width = computedValueIfNotAuto(formattingContextRoot.style().logicalWidth(), usedHorizontalValues.con tainingBlockWidth);56 auto width = computedValueIfNotAuto(formattingContextRoot.style().logicalWidth(), usedHorizontalValues.constraints.width); 57 57 if (!width) 58 width = shrinkToFitWidth(formattingContextRoot, usedHorizontalValues.con tainingBlockWidth);58 width = shrinkToFitWidth(formattingContextRoot, usedHorizontalValues.constraints.width); 59 59 60 60 // #2 -
trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp
r249879 r250050 405 405 } 406 406 407 auto usedHorizontalValues = UsedHorizontalValues { UsedHorizontalValues::Constraints { formattingContext.geometryForBox(*layoutBox.containingBlock()) } }; 407 408 // Inline level box (replaced or inline-block) 408 409 if (lineRun->isBox()) { 409 410 auto topLeft = logicalRect.topLeft(); 410 411 if (layoutBox.isInFlowPositioned()) 411 topLeft += geometry.inFlowPositionedPositionOffset(layoutBox, UsedHorizontalValues { formattingContext.geometryForBox(*layoutBox.containingBlock()).contentBoxWidth() });412 topLeft += geometry.inFlowPositionedPositionOffset(layoutBox, usedHorizontalValues); 412 413 displayBox.setTopLeft(topLeft); 413 414 lineBoxRect.expandHorizontally(logicalRect.width()); … … 426 427 if (lineRun->isContainerEnd()) { 427 428 if (layoutBox.isInFlowPositioned()) { 428 auto inflowOffset = geometry.inFlowPositionedPositionOffset(layoutBox, UsedHorizontalValues { formattingContext.geometryForBox(*layoutBox.containingBlock()).contentBoxWidth() });429 auto inflowOffset = geometry.inFlowPositionedPositionOffset(layoutBox, usedHorizontalValues); 429 430 displayBox.moveHorizontally(inflowOffset.width()); 430 431 displayBox.moveVertically(inflowOffset.height()); -
trunk/Source/WebCore/layout/tableformatting/TableFormattingContext.cpp
r249849 r250050 200 200 intrinsicWidth = geometry().constrainByMinMaxWidth(tableCellBox, *intrinsicWidth); 201 201 auto border = geometry().computedBorder(tableCellBox); 202 auto padding = *geometry().computedPadding(tableCellBox, UsedHorizontalValues ({ }));202 auto padding = *geometry().computedPadding(tableCellBox, UsedHorizontalValues { UsedHorizontalValues::Constraints { LayoutUnit { } } }); 203 203 204 204 intrinsicWidth->expand(border.horizontal.width() + padding.horizontal.width());
Note: See TracChangeset
for help on using the changeset viewer.