Changeset 287047 in webkit
- Timestamp:
- Dec 14, 2021, 2:10:59 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
-
ChangeLog (modified) (1 diff)
-
display/css/DisplayFillLayerImageGeometry.cpp (modified) (1 diff)
-
layout/formattingContexts/FormattingContext.cpp (modified) (1 diff)
-
layout/formattingContexts/FormattingGeometry.cpp (modified) (5 diffs)
-
layout/formattingContexts/FormattingQuirks.cpp (modified) (1 diff)
-
layout/formattingContexts/block/BlockFormattingGeometry.cpp (modified) (2 diffs)
-
layout/formattingContexts/inline/InlineLine.cpp (modified) (2 diffs)
-
layout/formattingContexts/inline/InlineLineBox.cpp (modified) (1 diff)
-
layout/formattingContexts/inline/InlineLineBoxBuilder.cpp (modified) (2 diffs)
-
layout/formattingContexts/inline/InlineLineBuilder.cpp (modified) (2 diffs)
-
layout/formattingContexts/table/TableFormattingContext.cpp (modified) (2 diffs)
-
layout/layouttree/LayoutBoxGeometry.cpp (modified) (1 diff)
-
layout/layouttree/LayoutBoxGeometry.h (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r287046 r287047 1 2021-12-14 Alan Bujtas <zalan@apple.com> 2 3 [LFC] Let BoxGeometry have logical values only 4 https://bugs.webkit.org/show_bug.cgi?id=234304 5 6 Reviewed by Antti Koivisto. 7 8 This helps when converting logical (layout) values to physical (display) values. 9 10 * display/css/DisplayFillLayerImageGeometry.cpp: 11 (WebCore::Display::geometryForLayer): 12 * layout/formattingContexts/FormattingContext.cpp: 13 (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): 14 * layout/formattingContexts/FormattingGeometry.cpp: 15 (WebCore::Layout::FormattingGeometry::outOfFlowNonReplacedVerticalGeometry const): 16 (WebCore::Layout::FormattingGeometry::outOfFlowNonReplacedHorizontalGeometry const): 17 (WebCore::Layout::FormattingGeometry::outOfFlowReplacedVerticalGeometry const): 18 (WebCore::Layout::FormattingGeometry::outOfFlowReplacedHorizontalGeometry const): 19 (WebCore::Layout::FormattingGeometry::computedPadding const): 20 * layout/formattingContexts/FormattingQuirks.cpp: 21 (WebCore::Layout::FormattingQuirks::heightValueOfNearestContainingBlockWithFixedHeight const): 22 * layout/formattingContexts/block/BlockFormattingGeometry.cpp: 23 (WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentHeightAndMargin const): 24 (WebCore::Layout::BlockFormattingGeometry::inFlowNonReplacedContentWidthAndMargin const): 25 * layout/formattingContexts/inline/InlineLine.cpp: 26 (WebCore::Layout::Line::initialize): 27 (WebCore::Layout::Line::addBorderAndPaddingEndForInlineBoxDecorationClone): 28 * layout/formattingContexts/inline/InlineLineBox.cpp: 29 (WebCore::Layout::LineBox::logicalBorderBoxForInlineBox const): 30 * layout/formattingContexts/inline/InlineLineBoxBuilder.cpp: 31 (WebCore::Layout::LineBoxBuilder::constructAndAlignInlineLevelBoxes): 32 * layout/formattingContexts/inline/InlineLineBuilder.cpp: 33 (WebCore::Layout::LineBuilder::inlineItemWidth const): 34 * layout/formattingContexts/table/TableFormattingContext.cpp: 35 (WebCore::Layout::TableFormattingContext::setUsedGeometryForCells): 36 * layout/layouttree/LayoutBoxGeometry.cpp: 37 (WebCore::Layout::BoxGeometry::paddingBox const): 38 * layout/layouttree/LayoutBoxGeometry.h: 39 (WebCore::Layout::BoxGeometry::verticalBorder const): 40 (WebCore::Layout::BoxGeometry::horizontalBorder const): 41 (WebCore::Layout::BoxGeometry::borderAndPaddingStart const): 42 (WebCore::Layout::BoxGeometry::borderAndPaddingEnd const): 43 (WebCore::Layout::BoxGeometry::contentBoxTop const): 44 (WebCore::Layout::BoxGeometry::contentBoxLeft const): 45 (WebCore::Layout::BoxGeometry::paddingBoxTop const): 46 (WebCore::Layout::BoxGeometry::paddingBoxLeft const): 47 (WebCore::Layout::BoxGeometry::paddingBoxHeight const): 48 (WebCore::Layout::BoxGeometry::paddingBoxWidth const): 49 (WebCore::Layout::BoxGeometry::borderBoxHeight const): 50 (WebCore::Layout::BoxGeometry::borderBoxWidth const): 51 (WebCore::Layout::BoxGeometry::paddingBefore const): 52 (WebCore::Layout::BoxGeometry::paddingStart const): 53 (WebCore::Layout::BoxGeometry::paddingAfter const): 54 (WebCore::Layout::BoxGeometry::paddingEnd const): 55 (WebCore::Layout::BoxGeometry::verticalPadding const): 56 (WebCore::Layout::BoxGeometry::horizontalPadding const): 57 (WebCore::Layout::BoxGeometry::borderBefore const): 58 (WebCore::Layout::BoxGeometry::borderStart const): 59 (WebCore::Layout::BoxGeometry::borderAfter const): 60 (WebCore::Layout::BoxGeometry::borderEnd const): 61 (WebCore::Layout::BoxGeometry::paddingTop const): Deleted. 62 (WebCore::Layout::BoxGeometry::paddingLeft const): Deleted. 63 (WebCore::Layout::BoxGeometry::paddingBottom const): Deleted. 64 (WebCore::Layout::BoxGeometry::paddingRight const): Deleted. 65 (WebCore::Layout::BoxGeometry::borderTop const): Deleted. 66 (WebCore::Layout::BoxGeometry::borderLeft const): Deleted. 67 (WebCore::Layout::BoxGeometry::borderBottom const): Deleted. 68 (WebCore::Layout::BoxGeometry::borderRight const): Deleted. 69 1 70 2021-12-14 Patrick Angle <pangle@apple.com> 2 71 -
trunk/Source/WebCore/display/css/DisplayFillLayerImageGeometry.cpp
r278185 r287047 264 264 LayoutUnit bottom; 265 265 if (fillLayer.origin() != FillBox::Border) { 266 left = geometry.border Left();267 right = geometry.border Right();268 top = geometry.border Top();269 bottom = geometry.border Bottom();266 left = geometry.borderStart(); 267 right = geometry.borderEnd(); 268 top = geometry.borderBefore(); 269 bottom = geometry.borderAfter(); 270 270 if (fillLayer.origin() == FillBox::Content) { 271 left += geometry.padding Left().value_or(0);272 right += geometry.padding Right().value_or(0);273 top += geometry.padding Top().value_or(0);274 bottom += geometry.padding Bottom().value_or(0);271 left += geometry.paddingStart().value_or(0); 272 right += geometry.paddingEnd().value_or(0); 273 top += geometry.paddingBefore().value_or(0); 274 bottom += geometry.paddingAfter().value_or(0); 275 275 } 276 276 } -
trunk/Source/WebCore/layout/formattingContexts/FormattingContext.cpp
r283158 r287047 292 292 // top + margin-top + border-top-width + padding-top + height + padding-bottom + border-bottom-width + margin-bottom + bottom = height of containing block 293 293 auto containingBlockHeight = containingBlockGeometry.contentBoxHeight(); 294 ASSERT(BoxGeometry::borderBoxTop(boxGeometry) + boxGeometry.marginBefore() + boxGeometry.border Top() + boxGeometry.paddingTop().value_or(0) + boxGeometry.contentBoxHeight()295 + boxGeometry.padding Bottom().value_or(0) + boxGeometry.borderBottom() + boxGeometry.marginAfter() == containingBlockHeight);296 } 297 } 298 } 299 #endif 300 301 } 302 } 303 #endif 294 ASSERT(BoxGeometry::borderBoxTop(boxGeometry) + boxGeometry.marginBefore() + boxGeometry.borderBefore() + boxGeometry.paddingBefore().value_or(0) + boxGeometry.contentBoxHeight() 295 + boxGeometry.paddingAfter().value_or(0) + boxGeometry.borderAfter() + boxGeometry.marginAfter() == containingBlockHeight); 296 } 297 } 298 } 299 #endif 300 301 } 302 } 303 #endif -
trunk/Source/WebCore/layout/formattingContexts/FormattingGeometry.cpp
r282350 r287047 361 361 auto computedVerticalMargin = FormattingGeometry::computedVerticalMargin(layoutBox, horizontalConstraints); 362 362 UsedVerticalMargin::NonCollapsedValues usedVerticalMargin; 363 auto paddingTop = boxGeometry.padding Top().value_or(0);364 auto paddingBottom = boxGeometry.padding Bottom().value_or(0);365 auto borderTop = boxGeometry.border Top();366 auto borderBottom = boxGeometry.border Bottom();363 auto paddingTop = boxGeometry.paddingBefore().value_or(0); 364 auto paddingBottom = boxGeometry.paddingAfter().value_or(0); 365 auto borderTop = boxGeometry.borderBefore(); 366 auto borderBottom = boxGeometry.borderAfter(); 367 367 368 368 if (!top && !height && !bottom) … … 481 481 auto computedHorizontalMargin = FormattingGeometry::computedHorizontalMargin(layoutBox, horizontalConstraints); 482 482 UsedHorizontalMargin usedHorizontalMargin; 483 auto paddingLeft = boxGeometry.padding Left().value_or(0);484 auto paddingRight = boxGeometry.padding Right().value_or(0);485 auto borderLeft = boxGeometry.border Left();486 auto borderRight = boxGeometry.border Right();483 auto paddingLeft = boxGeometry.paddingStart().value_or(0); 484 auto paddingRight = boxGeometry.paddingEnd().value_or(0); 485 auto borderLeft = boxGeometry.borderStart(); 486 auto borderRight = boxGeometry.borderEnd(); 487 487 if (!left && !width && !right) { 488 488 // If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0. … … 609 609 std::optional<LayoutUnit> usedMarginBefore = computedVerticalMargin.before; 610 610 std::optional<LayoutUnit> usedMarginAfter = computedVerticalMargin.after; 611 auto paddingTop = boxGeometry.padding Top().value_or(0);612 auto paddingBottom = boxGeometry.padding Bottom().value_or(0);613 auto borderTop = boxGeometry.border Top();614 auto borderBottom = boxGeometry.border Bottom();611 auto paddingTop = boxGeometry.paddingBefore().value_or(0); 612 auto paddingBottom = boxGeometry.paddingAfter().value_or(0); 613 auto borderTop = boxGeometry.borderBefore(); 614 auto borderBottom = boxGeometry.borderAfter(); 615 615 616 616 if (!top && !bottom) { … … 694 694 std::optional<LayoutUnit> usedMarginEnd = computedHorizontalMargin.end; 695 695 auto width = inlineReplacedContentWidthAndMargin(replacedBox, horizontalConstraints, verticalConstraints, overriddenHorizontalValues).contentWidth; 696 auto paddingLeft = boxGeometry.padding Left().value_or(0);697 auto paddingRight = boxGeometry.padding Right().value_or(0);698 auto borderLeft = boxGeometry.border Left();699 auto borderRight = boxGeometry.border Right();696 auto paddingLeft = boxGeometry.paddingStart().value_or(0); 697 auto paddingRight = boxGeometry.paddingEnd().value_or(0); 698 auto borderLeft = boxGeometry.borderStart(); 699 auto borderRight = boxGeometry.borderEnd(); 700 700 701 701 if (!left && !right) { … … 1110 1110 LOG_WITH_STREAM(FormattingContextLayout, stream << "[Padding] -> layoutBox: " << &layoutBox); 1111 1111 return Edges { 1112 { valueForLength(style.padding Left(), containingBlockWidth), valueForLength(style.paddingRight(), containingBlockWidth) },1113 { valueForLength(style.padding Top(), containingBlockWidth), valueForLength(style.paddingBottom(), containingBlockWidth) }1112 { valueForLength(style.paddingStart(), containingBlockWidth), valueForLength(style.paddingEnd(), containingBlockWidth) }, 1113 { valueForLength(style.paddingBefore(), containingBlockWidth), valueForLength(style.paddingAfter(), containingBlockWidth) } 1114 1114 }; 1115 1115 } -
trunk/Source/WebCore/layout/formattingContexts/FormattingQuirks.cpp
r282430 r287047 64 64 65 65 auto& boxGeometry = formattingContext.geometryForBox(*containingBlock, FormattingContext::EscapeReason::FindFixedHeightAncestorQuirk); 66 auto verticalPadding = boxGeometry.padding Top().value_or(0) + boxGeometry.paddingBottom().value_or(0);67 auto verticalBorder = boxGeometry.border Top() + boxGeometry.borderBottom();66 auto verticalPadding = boxGeometry.paddingBefore().value_or(0) + boxGeometry.paddingAfter().value_or(0); 67 auto verticalBorder = boxGeometry.borderBefore() + boxGeometry.borderAfter(); 68 68 bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before.value_or(0) + verticalMargin.after.value_or(0) + verticalPadding + verticalBorder; 69 69 } -
trunk/Source/WebCore/layout/formattingContexts/block/BlockFormattingGeometry.cpp
r282350 r287047 72 72 auto computedVerticalMargin = FormattingGeometry::computedVerticalMargin(layoutBox, horizontalConstraints); 73 73 auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.value_or(0), computedVerticalMargin.after.value_or(0) }; 74 auto borderAndPaddingTop = boxGeometry.border Top() + boxGeometry.paddingTop().value_or(0);74 auto borderAndPaddingTop = boxGeometry.borderBefore() + boxGeometry.paddingBefore().value_or(0); 75 75 auto height = overriddenVerticalValues.height ? overriddenVerticalValues.height.value() : computedHeight(layoutBox); 76 76 … … 154 154 auto computedHorizontalMargin = FormattingGeometry::computedHorizontalMargin(layoutBox, horizontalConstraints); 155 155 UsedHorizontalMargin usedHorizontalMargin; 156 auto borderLeft = boxGeometry.border Left();157 auto borderRight = boxGeometry.border Right();158 auto paddingLeft = boxGeometry.padding Left().value_or(0);159 auto paddingRight = boxGeometry.padding Right().value_or(0);156 auto borderLeft = boxGeometry.borderStart(); 157 auto borderRight = boxGeometry.borderEnd(); 158 auto paddingLeft = boxGeometry.paddingStart().value_or(0); 159 auto paddingRight = boxGeometry.paddingEnd().value_or(0); 160 160 161 161 // #1 -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLine.cpp
r285948 r287047 68 68 // clone: Each box fragment is independently wrapped with the border, padding, and margin. 69 69 auto& inlineBoxGeometry = formattingContext().geometryForBox(inlineBoxStartItem.layoutBox()); 70 auto marginBorderAndPaddingStart = inlineBoxGeometry.marginStart() + inlineBoxGeometry.border Left() + inlineBoxGeometry.paddingLeft().value_or(0_lu);70 auto marginBorderAndPaddingStart = inlineBoxGeometry.marginStart() + inlineBoxGeometry.borderStart() + inlineBoxGeometry.paddingStart().value_or(0_lu); 71 71 auto runLogicalLeft = lastRunLogicalRight(); 72 72 m_runs.append({ inlineBoxStartItem, runLogicalLeft, marginBorderAndPaddingStart }); … … 435 435 // https://drafts.csswg.org/css-break/#break-decoration 436 436 auto& inlineBoxGeometry = formattingContext().geometryForBox(inlineBoxStartItem.layoutBox()); 437 auto borderAndPaddingEnd = inlineBoxGeometry.border Right() + inlineBoxGeometry.paddingRight().value_or(0_lu);437 auto borderAndPaddingEnd = inlineBoxGeometry.borderEnd() + inlineBoxGeometry.paddingEnd().value_or(0_lu); 438 438 m_inlineBoxListWithClonedDecorationEnd.add(&inlineBoxStartItem.layoutBox(), borderAndPaddingEnd); 439 439 m_clonedEndDecorationWidthForInlineBoxRuns += borderAndPaddingEnd; -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBox.cpp
r287028 r287047 115 115 auto verticalBorderAndPadding = boxGeometry.verticalBorder() + boxGeometry.verticalPadding().value_or(0_lu); 116 116 logicalRect.expandVertically(verticalBorderAndPadding); 117 logicalRect.moveVertically(-(boxGeometry.border Top() + boxGeometry.paddingTop().value_or(0_lu)));117 logicalRect.moveVertically(-(boxGeometry.borderBefore() + boxGeometry.paddingBefore().value_or(0_lu))); 118 118 return logicalRect; 119 119 } -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBoxBuilder.cpp
r287036 r287047 276 276 // Even negative horizontal margin makes the line "contentful". 277 277 if (run.isInlineBoxStart()) 278 return inlineBoxGeometry.marginStart() || inlineBoxGeometry.border Left() || inlineBoxGeometry.paddingLeft().value_or(0_lu);278 return inlineBoxGeometry.marginStart() || inlineBoxGeometry.borderStart() || inlineBoxGeometry.paddingStart().value_or(0_lu); 279 279 if (run.isInlineBoxEnd()) 280 return inlineBoxGeometry.marginEnd() || inlineBoxGeometry.border Right() || inlineBoxGeometry.paddingRight().value_or(0_lu);280 return inlineBoxGeometry.marginEnd() || inlineBoxGeometry.borderEnd() || inlineBoxGeometry.paddingEnd().value_or(0_lu); 281 281 ASSERT_NOT_REACHED(); 282 282 return true; … … 302 302 auto& lastLine = formattingState.lines().last(); 303 303 auto inlineBlockBaseline = lastLine.lineBoxLogicalRect().top() + lastLine.baseline(); 304 ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.border Top() + inlineLevelBoxGeometry.paddingTop().value_or(0) + inlineBlockBaseline;304 ascent = inlineLevelBoxGeometry.marginBefore() + inlineLevelBoxGeometry.borderBefore() + inlineLevelBoxGeometry.paddingBefore().value_or(0) + inlineBlockBaseline; 305 305 } 306 306 } else if (layoutBox.isReplacedBox()) -
trunk/Source/WebCore/layout/formattingContexts/inline/InlineLineBuilder.cpp
r286801 r287047 254 254 255 255 if (inlineItem.isInlineBoxStart()) { 256 auto logicalWidth = boxGeometry.marginStart() + boxGeometry.border Left() + boxGeometry.paddingLeft().value_or(0);256 auto logicalWidth = boxGeometry.marginStart() + boxGeometry.borderStart() + boxGeometry.paddingStart().value_or(0); 257 257 #if ENABLE(CSS_BOX_DECORATION_BREAK) 258 258 auto& style = m_isFirstLine ? inlineItem.firstLineStyle() : inlineItem.style(); 259 259 if (style.boxDecorationBreak() == BoxDecorationBreak::Clone) 260 logicalWidth += boxGeometry.border Right() + boxGeometry.paddingRight().value_or(0_lu);260 logicalWidth += boxGeometry.borderEnd() + boxGeometry.paddingEnd().value_or(0_lu); 261 261 #endif 262 262 return logicalWidth; … … 264 264 265 265 if (inlineItem.isInlineBoxEnd()) 266 return boxGeometry.marginEnd() + boxGeometry.border Right() + boxGeometry.paddingRight().value_or(0);266 return boxGeometry.marginEnd() + boxGeometry.borderEnd() + boxGeometry.paddingEnd().value_or(0); 267 267 268 268 // Non-replaced inline box (e.g. inline-block) -
trunk/Source/WebCore/layout/formattingContexts/table/TableFormattingContext.cpp
r282961 r287047 124 124 // FIXME: Find out if it is ok to use the regular padding here to align the content box inside a tall cell or we need to 125 125 // use some kind of intrinsic padding similar to RenderTableCell. 126 auto paddingTop = cellBoxGeometry.padding Top().value_or(LayoutUnit { });127 auto paddingBottom = cellBoxGeometry.padding Bottom().value_or(LayoutUnit { });126 auto paddingTop = cellBoxGeometry.paddingBefore().value_or(LayoutUnit { }); 127 auto paddingBottom = cellBoxGeometry.paddingAfter().value_or(LayoutUnit { }); 128 128 auto intrinsicPaddingTop = LayoutUnit { }; 129 129 auto intrinsicPaddingBottom = LayoutUnit { }; … … 139 139 auto rowBaseline = LayoutUnit { rowList[cell->startRow()].baseline() }; 140 140 auto cellBaseline = LayoutUnit { cell->baseline() }; 141 intrinsicPaddingTop = std::max(0_lu, rowBaseline - cellBaseline - cellBoxGeometry.border Top());141 intrinsicPaddingTop = std::max(0_lu, rowBaseline - cellBaseline - cellBoxGeometry.borderBefore()); 142 142 intrinsicPaddingBottom = std::max(0_lu, cellLogicalHeight - cellBoxGeometry.verticalMarginBorderAndPadding() - intrinsicPaddingTop - cellBoxGeometry.contentBoxHeight()); 143 143 break; -
trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.cpp
r270109 r287047 89 89 90 90 Rect paddingBox; 91 paddingBox.setTop(borderBox.top() + border Top());92 paddingBox.setLeft(borderBox.left() + border Left());93 paddingBox.setHeight(borderBox.bottom() - verticalSpaceForScrollbar() - border Bottom() - borderTop());94 paddingBox.setWidth(borderBox.width() - border Right() - horizontalSpaceForScrollbar() - borderLeft());91 paddingBox.setTop(borderBox.top() + borderBefore()); 92 paddingBox.setLeft(borderBox.left() + borderStart()); 93 paddingBox.setHeight(borderBox.bottom() - verticalSpaceForScrollbar() - borderAfter() - borderBefore()); 94 paddingBox.setWidth(borderBox.width() - borderEnd() - horizontalSpaceForScrollbar() - borderStart()); 95 95 return paddingBox; 96 96 } -
trunk/Source/WebCore/layout/layouttree/LayoutBoxGeometry.h
r286518 r287047 64 64 LayoutUnit marginEnd() const; 65 65 66 LayoutUnit border Top() const;67 LayoutUnit border Left() const;68 LayoutUnit border Bottom() const;69 LayoutUnit border Right() const;70 LayoutUnit verticalBorder() const { return border Top() + borderBottom(); }71 LayoutUnit horizontalBorder() const { return border Left() + borderRight(); }72 73 std::optional<LayoutUnit> padding Top() const;74 std::optional<LayoutUnit> padding Left() const;75 std::optional<LayoutUnit> padding Bottom() const;76 std::optional<LayoutUnit> padding Right() const;66 LayoutUnit borderBefore() const; 67 LayoutUnit borderAfter() const; 68 LayoutUnit borderStart() const; 69 LayoutUnit borderEnd() const; 70 LayoutUnit verticalBorder() const { return borderBefore() + borderAfter(); } 71 LayoutUnit horizontalBorder() const { return borderStart() + borderEnd(); } 72 73 std::optional<LayoutUnit> paddingBefore() const; 74 std::optional<LayoutUnit> paddingAfter() const; 75 std::optional<LayoutUnit> paddingStart() const; 76 std::optional<LayoutUnit> paddingEnd() const; 77 77 std::optional<LayoutUnit> verticalPadding() const; 78 78 std::optional<LayoutUnit> horizontalPadding() const; 79 79 80 LayoutUnit borderAndPaddingStart() const { return border Left() + paddingLeft().value_or(0); }81 LayoutUnit borderAndPaddingEnd() const { return border Right() + paddingRight().value_or(0); }82 83 LayoutUnit contentBoxTop() const { return paddingBoxTop() + padding Top().value_or(0); }84 LayoutUnit contentBoxLeft() const { return paddingBoxLeft() + padding Left().value_or(0); }80 LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingStart().value_or(0); } 81 LayoutUnit borderAndPaddingEnd() const { return borderEnd() + paddingEnd().value_or(0); } 82 83 LayoutUnit contentBoxTop() const { return paddingBoxTop() + paddingBefore().value_or(0); } 84 LayoutUnit contentBoxLeft() const { return paddingBoxLeft() + paddingStart().value_or(0); } 85 85 LayoutUnit contentBoxBottom() const { return contentBoxTop() + contentBoxHeight(); } 86 86 LayoutUnit contentBoxRight() const { return contentBoxLeft() + contentBoxWidth(); } … … 88 88 LayoutUnit contentBoxWidth() const; 89 89 90 LayoutUnit paddingBoxTop() const { return border Top(); }91 LayoutUnit paddingBoxLeft() const { return border Left(); }90 LayoutUnit paddingBoxTop() const { return borderBefore(); } 91 LayoutUnit paddingBoxLeft() const { return borderStart(); } 92 92 LayoutUnit paddingBoxBottom() const { return paddingBoxTop() + paddingBoxHeight(); } 93 93 LayoutUnit paddingBoxRight() const { return paddingBoxLeft() + paddingBoxWidth(); } 94 LayoutUnit paddingBoxHeight() const { return padding Top().value_or(0) + contentBoxHeight() + paddingBottom().value_or(0); }95 LayoutUnit paddingBoxWidth() const { return padding Left().value_or(0) + contentBoxWidth() + paddingRight().value_or(0); }96 97 LayoutUnit borderBoxHeight() const { return border Top() + paddingBoxHeight() + verticalSpaceForScrollbar() + borderBottom(); }98 LayoutUnit borderBoxWidth() const { return border Left() + paddingBoxWidth() + horizontalSpaceForScrollbar() + borderRight(); }94 LayoutUnit paddingBoxHeight() const { return paddingBefore().value_or(0) + contentBoxHeight() + paddingAfter().value_or(0); } 95 LayoutUnit paddingBoxWidth() const { return paddingStart().value_or(0) + contentBoxWidth() + paddingEnd().value_or(0); } 96 97 LayoutUnit borderBoxHeight() const { return borderBefore() + paddingBoxHeight() + verticalSpaceForScrollbar() + borderAfter(); } 98 LayoutUnit borderBoxWidth() const { return borderStart() + paddingBoxWidth() + horizontalSpaceForScrollbar() + borderEnd(); } 99 99 LayoutUnit marginBoxHeight() const { return marginBefore() + borderBoxHeight() + marginAfter(); } 100 100 LayoutUnit marginBoxWidth() const { return marginStart() + borderBoxWidth() + marginEnd(); } … … 343 343 } 344 344 345 inline std::optional<LayoutUnit> BoxGeometry::padding Top() const345 inline std::optional<LayoutUnit> BoxGeometry::paddingBefore() const 346 346 { 347 347 ASSERT(m_hasValidPadding); … … 351 351 } 352 352 353 inline std::optional<LayoutUnit> BoxGeometry::padding Left() const353 inline std::optional<LayoutUnit> BoxGeometry::paddingStart() const 354 354 { 355 355 ASSERT(m_hasValidPadding); … … 359 359 } 360 360 361 inline std::optional<LayoutUnit> BoxGeometry::padding Bottom() const361 inline std::optional<LayoutUnit> BoxGeometry::paddingAfter() const 362 362 { 363 363 ASSERT(m_hasValidPadding); … … 367 367 } 368 368 369 inline std::optional<LayoutUnit> BoxGeometry::padding Right() const369 inline std::optional<LayoutUnit> BoxGeometry::paddingEnd() const 370 370 { 371 371 ASSERT(m_hasValidPadding); … … 377 377 inline std::optional<LayoutUnit> BoxGeometry::verticalPadding() const 378 378 { 379 auto paddingTop = this->padding Top();380 auto paddingBottom = this->padding Bottom();379 auto paddingTop = this->paddingBefore(); 380 auto paddingBottom = this->paddingAfter(); 381 381 if (!paddingTop && !paddingBottom) 382 382 return { }; … … 386 386 inline std::optional<LayoutUnit> BoxGeometry::horizontalPadding() const 387 387 { 388 auto paddingLeft = this->padding Left();389 auto paddingRight = this->padding Right();388 auto paddingLeft = this->paddingStart(); 389 auto paddingRight = this->paddingEnd(); 390 390 if (!paddingLeft && !paddingRight) 391 391 return { }; … … 393 393 } 394 394 395 inline LayoutUnit BoxGeometry::border Top() const395 inline LayoutUnit BoxGeometry::borderBefore() const 396 396 { 397 397 ASSERT(m_hasValidBorder); … … 399 399 } 400 400 401 inline LayoutUnit BoxGeometry::border Left() const401 inline LayoutUnit BoxGeometry::borderStart() const 402 402 { 403 403 ASSERT(m_hasValidBorder); … … 405 405 } 406 406 407 inline LayoutUnit BoxGeometry::border Bottom() const407 inline LayoutUnit BoxGeometry::borderAfter() const 408 408 { 409 409 ASSERT(m_hasValidBorder); … … 411 411 } 412 412 413 inline LayoutUnit BoxGeometry::border Right() const413 inline LayoutUnit BoxGeometry::borderEnd() const 414 414 { 415 415 ASSERT(m_hasValidBorder);
Note:
See TracChangeset
for help on using the changeset viewer.