Remove superfluous LayoutUnit initializations
authorross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Nov 2018 03:14:31 +0000 (03:14 +0000)
committerross.kirsling@sony.com <ross.kirsling@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 18 Nov 2018 03:14:31 +0000 (03:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191791

Reviewed by Simon Fraser.

First step toward making LayoutUnit constructors explicit:
eliminate `= 0` when constructing LayoutUnit lvalues.

* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
(WebCore::distanceDataForNode):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::layout):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::selectionGapRectsForRepaint):
(WebCore::RenderBlock::paintSelection):
(WebCore::RenderBlock::textIndentOffset const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::marginValuesForChild const):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::determineStartPosition):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fillAvailableMeasure const):
(WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
(WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding const):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::marginWidthForChild):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::offsetWidthForColumn const):
(WebCore::RenderTable::offsetHeightForColumn const):
(WebCore::RenderTable::outerBorderBefore const):
(WebCore::RenderTable::outerBorderAfter const):
(WebCore::RenderTable::outerBorderStart const):
(WebCore::RenderTable::outerBorderEnd const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::logicalWidthFromColumns const):
(WebCore::RenderTableCell::computeIntrinsicPadding):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
(WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::calcOuterBorderBefore const):
(WebCore::RenderTableSection::calcOuterBorderAfter const):
(WebCore::RenderTableSection::calcOuterBorderStart const):
(WebCore::RenderTableSection::calcOuterBorderEnd const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/line/BreakingContext.h:
(WebCore::inlineLogicalWidth):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutItems):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
(WebCore::RenderMathMLUnderOver::layoutBlock):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowInsetExtent const):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238359 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/html/shadow/SliderThumbElement.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingContextGeometry.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/SpatialNavigation.cpp
Source/WebCore/rendering/AutoTableLayout.cpp
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBlockLineLayout.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/rendering/RenderFragmentedFlow.cpp
Source/WebCore/rendering/RenderFrameSet.cpp
Source/WebCore/rendering/RenderListItem.cpp
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderRubyRun.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/line/BreakingContext.h
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp
Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp

index 67e282c..fdd3f6d 100644 (file)
@@ -1,3 +1,149 @@
+2018-11-17  Ross Kirsling  <ross.kirsling@sony.com>
+
+        Remove superfluous LayoutUnit initializations
+        https://bugs.webkit.org/show_bug.cgi?id=191791
+
+        Reviewed by Simon Fraser.
+
+        First step toward making LayoutUnit constructors explicit:
+        eliminate `= 0` when constructing LayoutUnit lvalues.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::firstRectForRange const):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::modify):
+        (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::RenderSliderContainer::computeLogicalHeight const):
+        * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
+        (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::forceLayoutForPagination):
+        * page/SpatialNavigation.cpp:
+        (WebCore::scrollInDirection):
+        (WebCore::distanceDataForNode):
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::layout):
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::marginIntrinsicLogicalWidthForChild):
+        (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
+        * rendering/InlineFlowBox.cpp:
+        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
+        (WebCore::InlineFlowBox::paintFillLayer):
+        (WebCore::InlineFlowBox::paintBoxDecorations):
+        (WebCore::InlineFlowBox::paintMask):
+        (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
+        (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
+        (WebCore::RenderBlock::layoutPositionedObject):
+        (WebCore::RenderBlock::selectionGapRectsForRepaint):
+        (WebCore::RenderBlock::paintSelection):
+        (WebCore::RenderBlock::textIndentOffset const):
+        (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
+        (WebCore::RenderBlockFlow::layoutBlock):
+        (WebCore::RenderBlockFlow::layoutBlockChildren):
+        (WebCore::RenderBlockFlow::marginValuesForChild const):
+        (WebCore::RenderBlockFlow::estimateLogicalTopPosition):
+        (WebCore::RenderBlockFlow::applyBeforeBreak):
+        (WebCore::RenderBlockFlow::applyAfterBreak):
+        (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
+        (WebCore::RenderBlockFlow::clearFloats):
+        (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
+        (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
+        (WebCore::RenderBlockFlow::addOverhangingFloats):
+        (WebCore::RenderBlockFlow::getClearDelta):
+        (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::setLogicalWidthForTextRun):
+        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
+        (WebCore::RenderBlockFlow::determineStartPosition):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::fillAvailableMeasure const):
+        (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
+        (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
+        (WebCore::RenderBox::computePercentageLogicalHeight const):
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
+        (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
+        (WebCore::RenderBox::computePositionedLogicalHeightUsing const):
+        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
+        (WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::computedCSSPadding const):
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::marginWidthForChild):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+        (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+        * rendering/RenderFragmentedFlow.cpp:
+        (WebCore::RenderFragmentedFlow::validateFragments):
+        (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
+        (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::paint):
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::positionListMarker):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::computePreferredLogicalWidths):
+        (WebCore::RenderListMarker::updateMargins):
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
+        * rendering/RenderRubyRun.cpp:
+        (WebCore::RenderRubyRun::layoutBlock):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
+        (WebCore::RenderTable::layout):
+        (WebCore::RenderTable::offsetWidthForColumn const):
+        (WebCore::RenderTable::offsetHeightForColumn const):
+        (WebCore::RenderTable::outerBorderBefore const):
+        (WebCore::RenderTable::outerBorderAfter const):
+        (WebCore::RenderTable::outerBorderStart const):
+        (WebCore::RenderTable::outerBorderEnd const):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::logicalWidthFromColumns const):
+        (WebCore::RenderTableCell::computeIntrinsicPadding):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::calcRowLogicalHeight):
+        (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
+        (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
+        (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
+        (WebCore::RenderTableSection::layoutRows):
+        (WebCore::RenderTableSection::calcOuterBorderBefore const):
+        (WebCore::RenderTableSection::calcOuterBorderAfter const):
+        (WebCore::RenderTableSection::calcOuterBorderStart const):
+        (WebCore::RenderTableSection::calcOuterBorderEnd const):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::alignBoxesInBlockDirection):
+        (WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
+        (WebCore::RootInlineBox::lineSnapAdjustment const):
+        (WebCore::RootInlineBox::verticalPositionForBox):
+        * rendering/line/BreakingContext.h:
+        (WebCore::inlineLogicalWidth):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::layoutItems):
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::layoutBlock):
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
+        * rendering/mathml/RenderMathMLRoot.cpp:
+        (WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
+        (WebCore::RenderMathMLRoot::paint):
+        * rendering/mathml/RenderMathMLRow.cpp:
+        (WebCore::RenderMathMLRow::computePreferredLogicalWidths):
+        * rendering/mathml/RenderMathMLScripts.cpp:
+        (WebCore::RenderMathMLScripts::layoutBlock):
+        * rendering/mathml/RenderMathMLUnderOver.cpp:
+        (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
+        (WebCore::RenderMathMLUnderOver::layoutBlock):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::getShadowInsetExtent const):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::layout):
+
 2018-11-17  Simon Fraser  <simon.fraser@apple.com>
 
         Avoid triggering compositing updates when only the root layer is composited
index c2f49e6..023ed19 100644 (file)
@@ -3238,7 +3238,7 @@ IntRect Editor::firstRectForRange(Range* range) const
     if (inSameLine(startVisiblePosition, endVisiblePosition))
         return enclosingIntRect(RenderObject::absoluteBoundingBoxRectForRange(range));
 
-    LayoutUnit extraWidthToEndOfLine = 0;
+    LayoutUnit extraWidthToEndOfLine;
     IntRect startCaretRect = RenderedPosition(startVisiblePosition).absoluteRect(&extraWidthToEndOfLine);
     if (startCaretRect == IntRect())
         return IntRect();
index 2dcf18c..b2c7c5e 100644 (file)
@@ -1422,7 +1422,7 @@ bool FrameSelection::modify(EAlteration alter, unsigned verticalDistance, Vertic
     willBeModified(alter, direction == DirectionUp ? DirectionBackward : DirectionForward);
 
     VisiblePosition pos;
-    LayoutUnit xPos = 0;
+    LayoutUnit xPos;
     switch (alter) {
     case AlterationMove:
         pos = VisiblePosition(direction == DirectionUp ? m_selection.start() : m_selection.end(), m_selection.affinity());
@@ -1488,7 +1488,7 @@ bool FrameSelection::modify(EAlteration alter, unsigned verticalDistance, Vertic
 
 LayoutUnit FrameSelection::lineDirectionPointForBlockDirectionNavigation(EPositionType type)
 {
-    LayoutUnit x = 0;
+    LayoutUnit x;
 
     if (isNone())
         return x;
index 24718b6..9c459f2 100644 (file)
@@ -141,7 +141,7 @@ RenderBox::LogicalExtentComputedValues RenderSliderContainer::computeLogicalHeig
 #if ENABLE(DATALIST_ELEMENT)
     if (input.renderer()->isSlider() && !isVertical && input.list()) {
         int offsetFromCenter = theme().sliderTickOffsetFromTrackCenter();
-        LayoutUnit trackHeight = 0;
+        LayoutUnit trackHeight;
         if (offsetFromCenter < 0)
             trackHeight = -2 * offsetFromCenter;
         else {
index cd8289f..9caef92 100644 (file)
@@ -125,7 +125,7 @@ void InlineFormattingContext::Geometry::justifyRuns(InlineFormattingState& forma
         return;
 
     float expansion = widthToDistribute.toFloat() / expansionOpportunities;
-    LayoutUnit accumulatedExpansion = 0;
+    LayoutUnit accumulatedExpansion;
     for (auto runIndex = *runRange.firstRunIndex; runIndex <= *runRange.lastRunIndex; ++runIndex) {
         auto& inlineRun = inlineRuns[runIndex];
         auto expansionForRun = inlineRun.expansionOpportunity().count * expansion;
index 0ea287f..f4ad2d6 100644 (file)
@@ -4613,7 +4613,7 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS
             LayoutUnit docLogicalHeight = horizontalWritingMode ? updatedDocumentRect.height() : updatedDocumentRect.width();
             LayoutUnit docLogicalTop = horizontalWritingMode ? updatedDocumentRect.y() : updatedDocumentRect.x();
             LayoutUnit docLogicalRight = horizontalWritingMode ? updatedDocumentRect.maxX() : updatedDocumentRect.maxY();
-            LayoutUnit clippedLogicalLeft = 0;
+            LayoutUnit clippedLogicalLeft;
             if (!renderView->style().isLeftToRightDirection())
                 clippedLogicalLeft = docLogicalRight - pageLogicalWidth;
             LayoutRect overflow(clippedLogicalLeft, docLogicalTop, pageLogicalWidth, docLogicalHeight);
index 2beedd9..bafeb7a 100644 (file)
@@ -336,8 +336,8 @@ bool scrollInDirection(Frame* frame, FocusDirection direction)
     ASSERT(frame);
 
     if (frame && canScrollInDirection(frame->document(), direction)) {
-        LayoutUnit dx = 0;
-        LayoutUnit dy = 0;
+        LayoutUnit dx;
+        LayoutUnit dy;
         switch (direction) {
         case FocusDirectionLeft:
             dx = - Scrollbar::pixelsPerLineStep();
@@ -372,8 +372,8 @@ bool scrollInDirection(Node* container, FocusDirection direction)
         return false;
 
     if (canScrollInDirection(container, direction)) {
-        LayoutUnit dx = 0;
-        LayoutUnit dy = 0;
+        LayoutUnit dx;
+        LayoutUnit dy;
         switch (direction) {
         case FocusDirectionLeft:
             dx = - std::min<LayoutUnit>(Scrollbar::pixelsPerLineStep(), container->renderBox()->scrollLeft());
@@ -660,8 +660,8 @@ void distanceDataForNode(FocusDirection direction, const FocusCandidate& current
 
     LayoutPoint exitPoint;
     LayoutPoint entryPoint;
-    LayoutUnit sameAxisDistance = 0;
-    LayoutUnit otherAxisDistance = 0;
+    LayoutUnit sameAxisDistance;
+    LayoutUnit otherAxisDistance;
     entryAndExitPointsForDirection(direction, currentRect, nodeRect, exitPoint, entryPoint);
 
     switch (direction) {
index e2fea82..8de4288 100644 (file)
@@ -773,7 +773,7 @@ void AutoTableLayout::layout()
         }
     }
 
-    LayoutUnit pos = 0;
+    LayoutUnit pos;
     for (size_t i = 0; i < nEffCols; ++i) {
         m_table->setColumnPosition(i, pos);
         pos += LayoutUnit::fromFloatCeil(m_layoutStruct[i].computedLogicalWidth) + m_table->hBorderSpacing();
index d02b74a..6481a32 100644 (file)
@@ -114,7 +114,7 @@ static LayoutUnit marginIntrinsicLogicalWidthForChild(const RenderGrid* renderGr
     // Fixed margins can be added in as is.
     Length marginLeft = child.style().marginStartUsing(&renderGrid->style());
     Length marginRight = child.style().marginEndUsing(&renderGrid->style());
-    LayoutUnit margin = 0;
+    LayoutUnit margin;
     if (marginLeft.isFixed())
         margin += marginLeft.value();
     if (marginRight.isFixed())
@@ -582,7 +582,7 @@ LayoutUnit GridTrackSizingAlgorithm::gridAreaBreadthForChild(const RenderBox& ch
 
     const Vector<GridTrack>& allTracks = tracks(direction);
     const GridSpan& span = m_grid.gridItemSpan(child, direction);
-    LayoutUnit gridAreaBreadth = 0;
+    LayoutUnit gridAreaBreadth;
     for (auto trackPosition : span)
         gridAreaBreadth += allTracks[trackPosition].baseSize();
 
index 03e41e7..d5d62cd 100644 (file)
@@ -627,7 +627,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei
         setLogicalTop(roundToInt(top + maxAscent - fontMetrics.ascent(baselineType)));
     }
 
-    LayoutUnit adjustmentForChildrenWithSameLineHeightAndBaseline = 0;
+    LayoutUnit adjustmentForChildrenWithSameLineHeightAndBaseline;
     if (descendantsHaveSameLineHeightAndBaseline()) {
         adjustmentForChildrenWithSameLineHeightAndBaseline = logicalTop();
         if (parent())
@@ -1258,7 +1258,7 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& colo
         // strip.  Even though that strip has been broken up across multiple lines, you still paint it
         // as though you had one single line.  This means each line has to pick up the background where
         // the previous line left off.
-        LayoutUnit logicalOffsetOnLine = 0;
+        LayoutUnit logicalOffsetOnLine;
         LayoutUnit totalLogicalWidth;
         if (renderer().style().direction() == TextDirection::LTR) {
             for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
@@ -1403,7 +1403,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint&
         // the previous line left off.
         // FIXME: What the heck do we do with RTL here? The math we're using is obviously not right,
         // but it isn't even clear how this should work at all.
-        LayoutUnit logicalOffsetOnLine = 0;
+        LayoutUnit logicalOffsetOnLine;
         for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
             logicalOffsetOnLine += curr->logicalWidth();
         LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
@@ -1471,7 +1471,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
     } else {
         // We have a mask image that spans multiple lines.
         // We need to adjust _tx and _ty by the width of all previous lines.
-        LayoutUnit logicalOffsetOnLine = 0;
+        LayoutUnit logicalOffsetOnLine;
         for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox())
             logicalOffsetOnLine += curr->logicalWidth();
         LayoutUnit totalLogicalWidth = logicalOffsetOnLine;
@@ -1560,7 +1560,7 @@ void InlineFlowBox::clearTruncation()
 
 LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const
 {
-    LayoutUnit result = 0;
+    LayoutUnit result;
     for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
         if (child->renderer().isOutOfFlowPositioned())
             continue; // Positioned placeholders don't affect calculations.
@@ -1608,7 +1608,7 @@ LayoutUnit InlineFlowBox::computeOverAnnotationAdjustment(LayoutUnit allowedPosi
 
 LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) const
 {
-    LayoutUnit result = 0;
+    LayoutUnit result;
     for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
         if (child->renderer().isOutOfFlowPositioned())
             continue; // Positioned placeholders don't affect calculations.
index 0d90d70..8df4066 100644 (file)
@@ -970,7 +970,7 @@ LayoutUnit RenderBlock::marginIntrinsicLogicalWidthForChild(RenderBox& child) co
     // Fixed margins can be added in as is.
     Length marginLeft = child.style().marginStartUsing(&style());
     Length marginRight = child.style().marginEndUsing(&style());
-    LayoutUnit margin = 0;
+    LayoutUnit margin;
     if (marginLeft.isFixed())
         margin += marginLeft.value();
     if (marginRight.isFixed())
@@ -1011,7 +1011,7 @@ void RenderBlock::layoutPositionedObject(RenderBox& r, bool relayoutChildren, bo
         
     // If we are paginated or in a line grid, compute a vertical position for our object now.
     // If it's wrong we'll lay out again.
-    LayoutUnit oldLogicalTop = 0;
+    LayoutUnit oldLogicalTop;
     bool needsBlockDirectionLocationSetBeforeLayout = r.needsLayout() && view().frameView().layoutContext().layoutState()->needsBlockDirectionLocationSetBeforeLayout();
     if (needsBlockDirectionLocationSetBeforeLayout) {
         if (isHorizontalWritingMode() == r.isHorizontalWritingMode())
@@ -1413,7 +1413,7 @@ GapRects RenderBlock::selectionGapRectsForRepaint(const RenderLayerModelObject*
     LayoutPoint offsetFromRepaintContainer(containerPoint - toFloatSize(scrollPosition()));
 
     LogicalSelectionOffsetCaches cache(*this);
-    LayoutUnit lastTop = 0;
+    LayoutUnit lastTop;
     LayoutUnit lastLeft = logicalLeftSelectionOffset(*this, lastTop, cache);
     LayoutUnit lastRight = logicalRightSelectionOffset(*this, lastTop, cache);
     
@@ -1425,7 +1425,7 @@ void RenderBlock::paintSelection(PaintInfo& paintInfo, const LayoutPoint& paintO
 #if ENABLE(TEXT_SELECTION)
     if (shouldPaintSelectionGaps() && paintInfo.phase == PaintPhase::Foreground) {
         LogicalSelectionOffsetCaches cache(*this);
-        LayoutUnit lastTop = 0;
+        LayoutUnit lastTop;
         LayoutUnit lastLeft = logicalLeftSelectionOffset(*this, lastTop, cache);
         LayoutUnit lastRight = logicalRightSelectionOffset(*this, lastTop, cache);
         GraphicsContextStateSaver stateSaver(paintInfo.context());
@@ -1839,7 +1839,7 @@ bool RenderBlock::isContainingBlockAncestorFor(RenderObject& renderer) const
 
 LayoutUnit RenderBlock::textIndentOffset() const
 {
-    LayoutUnit cw = 0;
+    LayoutUnit cw;
     if (style().textIndent().isPercentOrCalculated())
         cw = containingBlock()->availableLogicalWidth();
     return minimumValueForLength(style().textIndent(), cw);
@@ -2308,9 +2308,9 @@ void RenderBlock::computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth
         // Fixed margins can be added in as is.
         Length startMarginLength = childStyle.marginStartUsing(&styleToUse);
         Length endMarginLength = childStyle.marginEndUsing(&styleToUse);
-        LayoutUnit margin = 0;
-        LayoutUnit marginStart = 0;
-        LayoutUnit marginEnd = 0;
+        LayoutUnit margin;
+        LayoutUnit marginStart;
+        LayoutUnit marginEnd;
         if (startMarginLength.isFixed())
             marginStart += startMarginLength.value();
         if (endMarginLength.isFixed())
index 1941427..8e3730e 100644 (file)
@@ -226,7 +226,7 @@ void RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats()
     if (parentHasFloats || (parentBlock.lowestFloatLogicalBottom() > logicalTopOffset && previousBlock && previousBlock->isSelfCollapsingBlock()))
         addIntrudingFloats(&parentBlock, &parentBlock, parentBlock.logicalLeftOffsetForContent(), logicalTopOffset);
     
-    LayoutUnit logicalLeftOffset = 0;
+    LayoutUnit logicalLeftOffset;
     if (previousBlock)
         logicalTopOffset -= previousBlock->logicalTop();
     else {
@@ -470,9 +470,9 @@ void RenderBlockFlow::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalH
     bool pageLogicalHeightChanged = false;
     checkForPaginationLogicalHeightChange(relayoutChildren, pageLogicalHeight, pageLogicalHeightChanged);
 
-    LayoutUnit repaintLogicalTop = 0;
-    LayoutUnit repaintLogicalBottom = 0;
-    LayoutUnit maxFloatLogicalBottom = 0;
+    LayoutUnit repaintLogicalTop;
+    LayoutUnit repaintLogicalBottom;
+    LayoutUnit maxFloatLogicalBottom;
     const RenderStyle& styleToUse = style();
     {
         LayoutStateMaintainer statePusher(*this, locationOffset(), hasTransform() || hasReflection() || styleToUse.isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged);
@@ -624,7 +624,7 @@ void RenderBlockFlow::layoutBlockChildren(bool relayoutChildren, LayoutUnit& max
     // It doesn't get included in the normal layout process but is instead skipped.
     layoutExcludedChildren(relayoutChildren);
 
-    LayoutUnit previousFloatLogicalBottom = 0;
+    LayoutUnit previousFloatLogicalBottom;
     maxFloatLogicalBottom = 0;
 
     RenderBox* next = firstChildBox();
@@ -907,13 +907,13 @@ void RenderBlockFlow::setStaticInlinePositionForChild(RenderBox& child, LayoutUn
 
 RenderBlockFlow::MarginValues RenderBlockFlow::marginValuesForChild(RenderBox& child) const
 {
-    LayoutUnit childBeforePositive = 0;
-    LayoutUnit childBeforeNegative = 0;
-    LayoutUnit childAfterPositive = 0;
-    LayoutUnit childAfterNegative = 0;
+    LayoutUnit childBeforePositive;
+    LayoutUnit childBeforeNegative;
+    LayoutUnit childAfterPositive;
+    LayoutUnit childAfterNegative;
 
-    LayoutUnit beforeMargin = 0;
-    LayoutUnit afterMargin = 0;
+    LayoutUnit beforeMargin;
+    LayoutUnit afterMargin;
 
     RenderBlockFlow* childRenderBlock = is<RenderBlockFlow>(child) ? &downcast<RenderBlockFlow>(child) : nullptr;
     
@@ -1263,8 +1263,8 @@ LayoutUnit RenderBlockFlow::estimateLogicalTopPosition(RenderBox& child, const M
     // relayout if there are intruding floats.
     LayoutUnit logicalTopEstimate = logicalHeight();
     if (!marginInfo.canCollapseWithMarginBefore()) {
-        LayoutUnit positiveMarginBefore = 0;
-        LayoutUnit negativeMarginBefore = 0;
+        LayoutUnit positiveMarginBefore;
+        LayoutUnit negativeMarginBefore;
         bool discardMarginBefore = false;
         if (child.selfNeedsLayout()) {
             // Try to do a basic estimation of how the collapse is going to go.
@@ -1506,7 +1506,7 @@ LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox& child, LayoutUnit logica
                 checkFragmentBreaks = true;
         }
         if (checkFragmentBreaks) {
-            LayoutUnit offsetBreakAdjustment = 0;
+            LayoutUnit offsetBreakAdjustment;
             if (fragmentedFlow->addForcedFragmentBreak(this, offsetFromLogicalTopOfFirstPage() + logicalOffset, &child, true, &offsetBreakAdjustment))
                 return logicalOffset + offsetBreakAdjustment;
         }
@@ -1536,7 +1536,7 @@ LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox& child, LayoutUnit logical
                 checkFragmentBreaks = true;
         }
         if (checkFragmentBreaks) {
-            LayoutUnit offsetBreakAdjustment = 0;
+            LayoutUnit offsetBreakAdjustment;
             if (fragmentedFlow->addForcedFragmentBreak(this, offsetFromLogicalTopOfFirstPage() + logicalOffset + marginOffset, &child, false, &offsetBreakAdjustment))
                 return logicalOffset + marginOffset + offsetBreakAdjustment;
         }
@@ -1595,7 +1595,7 @@ LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA
     LayoutUnit logicalTopBeforeUnsplittableAdjustment = result;
     LayoutUnit logicalTopAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, result);
     
-    LayoutUnit paginationStrut = 0;
+    LayoutUnit paginationStrut;
     LayoutUnit unsplittableAdjustmentDelta = logicalTopAfterUnsplittableAdjustment - logicalTopBeforeUnsplittableAdjustment;
     if (unsplittableAdjustmentDelta)
         paginationStrut = unsplittableAdjustmentDelta;
@@ -2538,7 +2538,7 @@ void RenderBlockFlow::clearFloats(Clear clear)
 {
     positionNewFloats();
     // set y position
-    LayoutUnit newY = 0;
+    LayoutUnit newY;
     switch (clear) {
     case Clear::Left:
         newY = lowestFloatLogicalBottom(FloatingObject::FloatLeft);
@@ -2592,7 +2592,7 @@ LayoutUnit RenderBlockFlow::lowestFloatLogicalBottom(FloatingObject::Type floatT
 {
     if (!m_floatingObjects)
         return 0;
-    LayoutUnit lowestFloatBottom = 0;
+    LayoutUnit lowestFloatBottom;
     const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
     auto end = floatingObjectSet.end();
     for (auto it = floatingObjectSet.begin(); it != end; ++it) {
@@ -2607,7 +2607,7 @@ LayoutUnit RenderBlockFlow::lowestInitialLetterLogicalBottom() const
 {
     if (!m_floatingObjects)
         return 0;
-    LayoutUnit lowestFloatBottom = 0;
+    LayoutUnit lowestFloatBottom;
     const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
     auto end = floatingObjectSet.end();
     for (auto it = floatingObjectSet.begin(); it != end; ++it) {
@@ -2626,7 +2626,7 @@ LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow& child, bool ma
 
     LayoutUnit childLogicalTop = child.logicalTop();
     LayoutUnit childLogicalLeft = child.logicalLeft();
-    LayoutUnit lowestFloatLogicalBottom = 0;
+    LayoutUnit lowestFloatLogicalBottom;
 
     // Floats that will remain the child's responsibility to paint should factor into its
     // overflow.
@@ -2801,7 +2801,7 @@ LayoutUnit RenderBlockFlow::getClearDelta(RenderBox& child, LayoutUnit logicalTo
     
     // At least one float is present. We need to perform the clearance computation.
     bool clearSet = child.style().clear() != Clear::None;
-    LayoutUnit logicalBottom = 0;
+    LayoutUnit logicalBottom;
     switch (child.style().clear()) {
     case Clear::None:
         break;
@@ -4144,7 +4144,7 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical
                     // Inline replaced elts add in their margins to their min/max values.
                     if (!child->isFloating())
                         lastText = nullptr;
-                    LayoutUnit margins = 0;
+                    LayoutUnit margins;
                     Length startMargin = childStyle.marginStart();
                     Length endMargin = childStyle.marginEnd();
                     if (startMargin.isFixed())
index f138006..8005250 100644 (file)
@@ -471,7 +471,7 @@ static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* ru
             glyphOverflow.computeBounds = true; 
     }
     
-    LayoutUnit hyphenWidth = 0;
+    LayoutUnit hyphenWidth;
     if (downcast<InlineTextBox>(*run->box()).hasHyphen())
         hyphenWidth = measureHyphenWidth(renderer, font, &fallbackFonts);
 
@@ -1413,7 +1413,7 @@ void RenderBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState, I
                 if (layoutState.usesRepaintBounds())
                     layoutState.updateRepaintRangeFromBox(lineBox);
                 
-                LayoutUnit adjustment = 0;
+                LayoutUnit adjustment;
                 bool overflowsFragment = false;
                 
                 layoutState.marginInfo().setAtBeforeSideOfBlock(false);
@@ -1789,7 +1789,7 @@ RootInlineBox* RenderBlockFlow::determineStartPosition(LineLayoutState& layoutSt
     if (!layoutState.isFullLayout()) {
         // Paginate all of the clean lines.
         bool paginated = view().frameView().layoutContext().layoutState() && view().frameView().layoutContext().layoutState()->isPaginated();
-        LayoutUnit paginationDelta = 0;
+        LayoutUnit paginationDelta;
         auto floatsIterator = floats.begin();
         auto end = floats.end();
         for (currentLine = firstRootBox(); currentLine && !currentLine->isDirty(); currentLine = currentLine->nextRootBox()) {
index 9b03ae9..582d5af 100644 (file)
@@ -2404,8 +2404,8 @@ void RenderBox::computeLogicalWidthInFragment(LogicalExtentComputedValues& compu
 
 LayoutUnit RenderBox::fillAvailableMeasure(LayoutUnit availableLogicalWidth) const
 {
-    LayoutUnit marginStart = 0;
-    LayoutUnit marginEnd = 0;
+    LayoutUnit marginStart;
+    LayoutUnit marginEnd;
     return fillAvailableMeasure(availableLogicalWidth, marginStart, marginEnd);
 }
 
@@ -2421,8 +2421,8 @@ LayoutUnit RenderBox::computeIntrinsicLogicalWidthUsing(Length logicalWidthLengt
     if (logicalWidthLength.type() == FillAvailable)
         return std::max(borderAndPadding, fillAvailableMeasure(availableLogicalWidth));
 
-    LayoutUnit minLogicalWidth = 0;
-    LayoutUnit maxLogicalWidth = 0;
+    LayoutUnit minLogicalWidth;
+    LayoutUnit maxLogicalWidth;
     computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWidth);
 
     if (logicalWidthLength.type() == MinContent)
@@ -2456,8 +2456,8 @@ LayoutUnit RenderBox::computeLogicalWidthInFragmentUsing(SizeType widthType, Len
     if (logicalWidth.isIntrinsic())
         return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalWidth, borderAndPaddingLogicalWidth());
 
-    LayoutUnit marginStart = 0;
-    LayoutUnit marginEnd = 0;
+    LayoutUnit marginStart;
+    LayoutUnit marginEnd;
     LayoutUnit logicalWidthResult = fillAvailableMeasure(availableLogicalWidth, marginStart, marginEnd);
 
     if (shrinkToAvoidFloats() && cb.containsFloats())
@@ -2908,7 +2908,7 @@ std::optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length
     bool skippedAutoHeightContainingBlock = false;
     RenderBlock* cb = containingBlock();
     const RenderBox* containingBlockChild = this;
-    LayoutUnit rootMarginBorderPaddingHeight = 0;
+    LayoutUnit rootMarginBorderPaddingHeight;
     bool isHorizontal = isHorizontalWritingMode();
     while (cb && !is<RenderView>(*cb) && skipContainingBlockForPercentHeightCalculation(*cb, isHorizontal != cb->isHorizontalWritingMode())) {
         if (cb->isBody() || cb->isDocumentElementRenderer())
@@ -2983,7 +2983,7 @@ LayoutUnit RenderBox::computeReplacedLogicalWidthUsing(SizeType widthType, Lengt
         case MinContent:
         case MaxContent: {
             // MinContent/MaxContent don't need the availableLogicalWidth argument.
-            LayoutUnit availableLogicalWidth = 0;
+            LayoutUnit availableLogicalWidth;
             return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalWidth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
         }
         case FitContent:
@@ -3566,7 +3566,7 @@ void RenderBox::computePositionedLogicalWidthUsing(SizeType widthType, Length lo
     // converted to the static position already
     ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto()));
 
-    LayoutUnit logicalLeftValue = 0;
+    LayoutUnit logicalLeftValue;
 
     const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock, nullptr, false);
 
@@ -3905,7 +3905,7 @@ void RenderBox::computePositionedLogicalHeightUsing(SizeType heightType, Length
 
     const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock, nullptr, false);
 
-    LayoutUnit logicalTopValue = 0;
+    LayoutUnit logicalTopValue;
 
     bool logicalHeightIsAuto = logicalHeightLength.isAuto();
     bool logicalTopIsAuto = logicalTop.isAuto();
@@ -4087,8 +4087,8 @@ void RenderBox::computePositionedLogicalWidthReplaced(LogicalExtentComputedValue
      *    ('rtl'), set 'margin-left' ('margin-right') to zero and solve for
      *    'margin-right' ('margin-left').
     \*-----------------------------------------------------------------------*/
-    LayoutUnit logicalLeftValue = 0;
-    LayoutUnit logicalRightValue = 0;
+    LayoutUnit logicalLeftValue;
+    LayoutUnit logicalRightValue;
 
     if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) {
         // 'left' and 'right' cannot be 'auto' due to step 3
@@ -4248,8 +4248,8 @@ void RenderBox::computePositionedLogicalHeightReplaced(LogicalExtentComputedValu
      *    'auto', solve the equation under the extra constraint that the two
      *    margins must get equal values.
     \*-----------------------------------------------------------------------*/
-    LayoutUnit logicalTopValue = 0;
-    LayoutUnit logicalBottomValue = 0;
+    LayoutUnit logicalTopValue;
+    LayoutUnit logicalBottomValue;
 
     if (marginBefore.isAuto() && marginAfter.isAuto()) {
         // 'top' and 'bottom' cannot be 'auto' due to step 2 and 3 combined.
index 4cabf5e..f54bbfe 100644 (file)
@@ -625,7 +625,7 @@ LayoutUnit RenderBoxModelObject::offsetTop() const
 
 LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
 {
-    LayoutUnit w = 0;
+    LayoutUnit w;
     if (padding.isPercentOrCalculated())
         w = containingBlockLogicalWidthForContent();
     return minimumValueForLength(padding, w);
@@ -1214,8 +1214,8 @@ static LayoutUnit resolveEdgeRelativeLength(const Length& length, Edge edge, Lay
 BackgroundImageGeometry RenderBoxModelObject::calculateBackgroundImageGeometry(const RenderLayerModelObject* paintContainer, const FillLayer& fillLayer, const LayoutPoint& paintOffset,
     const LayoutRect& borderBoxRect, RenderElement* backgroundObject) const
 {
-    LayoutUnit left = 0;
-    LayoutUnit top = 0;
+    LayoutUnit left;
+    LayoutUnit top;
     LayoutSize positioningAreaSize;
     // Determine the background positioning area and set destination rect to the background painting area.
     // Destination rect will be adjusted later if the background is non-repeating.
@@ -1224,8 +1224,8 @@ BackgroundImageGeometry RenderBoxModelObject::calculateBackgroundImageGeometry(c
     bool fixedAttachment = fillLayer.attachment() == FillAttachment::FixedBackground;
     float deviceScaleFactor = document().deviceScaleFactor();
     if (!fixedAttachment) {
-        LayoutUnit right = 0;
-        LayoutUnit bottom = 0;
+        LayoutUnit right;
+        LayoutUnit bottom;
         // Scroll and Local.
         if (fillLayer.origin() != FillBox::Border) {
             left = borderLeft();
index 0600a85..bfe9935 100644 (file)
@@ -136,7 +136,7 @@ static LayoutUnit marginWidthForChild(RenderBox* child)
     // Fixed margins can be added in as is.
     Length marginLeft = child->style().marginLeft();
     Length marginRight = child->style().marginRight();
-    LayoutUnit margin = 0;
+    LayoutUnit margin;
     if (marginLeft.isFixed())
         margin += marginLeft.value();
     if (marginRight.isFixed())
@@ -386,9 +386,9 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
     LayoutUnit yPos = borderTop() + paddingTop();
     LayoutUnit xPos = borderLeft() + paddingLeft();
     bool heightSpecified = false;
-    LayoutUnit oldHeight = 0;
+    LayoutUnit oldHeight;
 
-    LayoutUnit remainingSpace = 0;
+    LayoutUnit remainingSpace;
 
     FlexBoxIterator iterator(this);
     unsigned int highestFlexGroup = 0;
@@ -622,7 +622,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
     if (remainingSpace > 0 && ((style().isLeftToRightDirection() && style().boxPack() != BoxPack::Start)
         || (!style().isLeftToRightDirection() && style().boxPack() != BoxPack::End))) {
         // Children must be repositioned.
-        LayoutUnit offset = 0;
+        LayoutUnit offset;
         if (style().boxPack() == BoxPack::Justify) {
             // Determine the total number of children.
             int totalChildren = 0;
@@ -678,9 +678,9 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
     LayoutUnit yPos = borderTop() + paddingTop();
     LayoutUnit toAdd = borderBottom() + paddingBottom() + horizontalScrollbarHeight();
     bool heightSpecified = false;
-    LayoutUnit oldHeight = 0;
+    LayoutUnit oldHeight;
 
-    LayoutUnit remainingSpace = 0;
+    LayoutUnit remainingSpace;
 
     FlexBoxIterator iterator(this);
     unsigned int highestFlexGroup = 0;
@@ -878,7 +878,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren)
 
     if (style().boxPack() != BoxPack::Start && remainingSpace > 0) {
         // Children must be repositioned.
-        LayoutUnit offset = 0;
+        LayoutUnit offset;
         if (style().boxPack() == BoxPack::Justify) {
             // Determine the total number of children.
             int totalChildren = 0;
index a242e8d..6c547cf 100644 (file)
@@ -152,7 +152,7 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin
         else
             textX = contentLeft + contentWidth() - buttonAndIconWidth - font.width(textRun);
 
-        LayoutUnit textY = 0;
+        LayoutUnit textY;
         // We want to match the button's baseline
         // FIXME: Make this work with transforms.
         if (RenderButton* buttonRenderer = downcast<RenderButton>(button->renderer()))
index ea805a0..0e60594 100644 (file)
@@ -111,8 +111,8 @@ void RenderFragmentedFlow::validateFragments()
         m_fragmentsHaveUniformLogicalHeight = true;
 
         if (hasFragments()) {
-            LayoutUnit previousFragmentLogicalWidth = 0;
-            LayoutUnit previousFragmentLogicalHeight = 0;
+            LayoutUnit previousFragmentLogicalWidth;
+            LayoutUnit previousFragmentLogicalHeight;
             bool firstFragmentVisited = false;
             
             for (auto& fragment : m_fragmentList) {
@@ -292,7 +292,7 @@ LayoutPoint RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent(const R
             }
             
             // Get the logical top coordinate of the current object.
-            LayoutUnit top = 0;
+            LayoutUnit top;
             if (is<RenderBlock>(boxModelObject))
                 top = downcast<RenderBlock>(boxModelObject).offsetFromLogicalTopOfFirstPage();
             else {
@@ -780,7 +780,7 @@ void RenderFragmentedFlow::markFragmentsForOverflowLayoutIfNeeded()
 
 void RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect()
 {
-    LayoutUnit logicalHeight = 0;
+    LayoutUnit logicalHeight;
     // FIXME: Optimize not to clear the interval all the time. This implies manually managing the tree nodes lifecycle.
     m_fragmentIntervalTree.clear();
     for (auto& fragment : m_fragmentList) {
index 62cafc7..2d413b6 100644 (file)
@@ -139,9 +139,9 @@ void RenderFrameSet::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
     size_t cols = m_cols.m_sizes.size();
     LayoutUnit borderThickness = frameSetElement().border();
     
-    LayoutUnit yPos = 0;
+    LayoutUnit yPos;
     for (size_t r = 0; r < rows; r++) {
-        LayoutUnit xPos = 0;
+        LayoutUnit xPos;
         for (size_t c = 0; c < cols; c++) {
             downcast<RenderElement>(*child).paint(paintInfo, adjustedPaintOffset);
             xPos += m_cols.m_sizes[c];
index e2b0f93..653c1a6 100644 (file)
@@ -270,8 +270,8 @@ void RenderListItem::positionListMarker()
         return;
 
     LayoutUnit markerOldLogicalLeft = m_marker->logicalLeft();
-    LayoutUnit blockOffset = 0;
-    LayoutUnit lineOffset = 0;
+    LayoutUnit blockOffset;
+    LayoutUnit lineOffset;
     for (auto* ancestor = m_marker->parentBox(); ancestor && ancestor != this; ancestor = ancestor->parentBox()) {
         blockOffset += ancestor->logicalTop();
         lineOffset += ancestor->logicalLeft();
index b423796..71da6d7 100644 (file)
@@ -1554,7 +1554,7 @@ void RenderListMarker::computePreferredLogicalWidths()
 
     const FontCascade& font = style().fontCascade();
 
-    LayoutUnit logicalWidth = 0;
+    LayoutUnit logicalWidth;
     ListStyleType type = style().listStyleType();
     switch (type) {
     case ListStyleType::None:
@@ -1669,8 +1669,8 @@ void RenderListMarker::updateMargins()
 {
     const FontMetrics& fontMetrics = style().fontMetrics();
 
-    LayoutUnit marginStart = 0;
-    LayoutUnit marginEnd = 0;
+    LayoutUnit marginStart;
+    LayoutUnit marginEnd;
 
     if (isInside()) {
         if (isImage())
index 751e810..be11be1 100644 (file)
@@ -703,7 +703,7 @@ LayoutUnit RenderMultiColumnSet::initialBlockOffsetForPainting() const
     bool progressionReversed = multiColumnFlow()->progressionIsReversed();
     bool progressionIsInline = multiColumnFlow()->progressionIsInline();
     
-    LayoutUnit result = 0;
+    LayoutUnit result;
     if (!progressionIsInline && progressionReversed) {
         LayoutRect colRect = columnRectAt(0);
         result = isHorizontalWritingMode() ? colRect.y() : colRect.x();
index 161e94a..b127660 100644 (file)
@@ -155,7 +155,7 @@ void RenderRubyRun::layoutBlock(bool relayoutChildren, LayoutUnit pageHeight)
 
     // Place the RenderRubyText such that its bottom is flush with the lineTop of the first line of the RenderRubyBase.
     LayoutUnit lastLineRubyTextBottom = rt->logicalHeight();
-    LayoutUnit firstLineRubyTextTop = 0;
+    LayoutUnit firstLineRubyTextTop;
     RootInlineBox* rootBox = rt->lastRootBox();
     if (rootBox) {
         // In order to align, we have to ignore negative leading.
@@ -170,7 +170,7 @@ void RenderRubyRun::layoutBlock(bool relayoutChildren, LayoutUnit pageHeight)
         float distanceBetweenBase = max(font.letterSpacing(), 2.0f * rt->style().fontCascade().fontMetrics().height());
         setWidth(width() + distanceBetweenBase - font.letterSpacing());
         if (RenderRubyBase* rb = rubyBase()) {
-            LayoutUnit firstLineTop = 0;
+            LayoutUnit firstLineTop;
             LayoutUnit lastLineBottom = logicalHeight();
             RootInlineBox* rootBox = rb->firstRootBox();
             if (rootBox)
@@ -184,7 +184,7 @@ void RenderRubyRun::layoutBlock(bool relayoutChildren, LayoutUnit pageHeight)
             rt->setY(firstLineTop + (extent - rt->height()) / 2);
         }
     } else if (style().isFlippedLinesWritingMode() == (style().rubyPosition() == RubyPosition::After)) {
-        LayoutUnit firstLineTop = 0;
+        LayoutUnit firstLineTop;
         if (RenderRubyBase* rb = rubyBase()) {
             RootInlineBox* rootBox = rb->firstRootBox();
             if (rootBox)
index 4e3866d..a240403 100644 (file)
@@ -300,7 +300,7 @@ LayoutUnit RenderTable::convertStyleLogicalWidthToComputedWidth(const Length& st
         return computeIntrinsicLogicalWidthUsing(styleLogicalWidth, availableWidth, bordersPaddingAndSpacingInRowDirection());
 
     // HTML tables' width styles already include borders and paddings, but CSS tables' width styles do not.
-    LayoutUnit borders = 0;
+    LayoutUnit borders;
     bool isCSSTable = !is<HTMLTableElement>(element());
     if (isCSSTable && styleLogicalWidth.isSpecified() && styleLogicalWidth.isPositive() && style().boxSizing() == BoxSizing::ContentBox)
         borders = borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
@@ -400,7 +400,7 @@ void RenderTable::layout()
     // to call this before we call borderStart/borderEnd to avoid getting a stale value.
     recalcBordersInRowDirection();
     bool sectionMoved = false;
-    LayoutUnit movedSectionLogicalTop = 0;
+    LayoutUnit movedSectionLogicalTop;
 
     LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
     {
@@ -422,8 +422,8 @@ void RenderTable::layout()
         //     if ( oldWidth != width() || columns.size() + 1 != columnPos.size() )
         m_tableLayout->layout();
 
-        LayoutUnit totalSectionLogicalHeight = 0;
-        LayoutUnit oldTableLogicalTop = 0;
+        LayoutUnit totalSectionLogicalHeight;
+        LayoutUnit oldTableLogicalTop;
         for (unsigned i = 0; i < m_captions.size(); i++) {
             if (m_captions[i]->style().captionSide() == CaptionSide::Bottom)
                 continue;
@@ -465,7 +465,7 @@ void RenderTable::layout()
         if (!isOutOfFlowPositioned())
             updateLogicalHeight();
 
-        LayoutUnit computedLogicalHeight = 0;
+        LayoutUnit computedLogicalHeight;
     
         Length logicalHeightLength = style().logicalHeight();
         if (logicalHeightLength.isIntrinsic() || (logicalHeightLength.isSpecified() && logicalHeightLength.isPositive()))
@@ -934,7 +934,7 @@ LayoutUnit RenderTable::offsetWidthForColumn(const RenderTableCol& column) const
         currentColumn = currentColumn->nextColumn(); // First column in column-group
     unsigned numberOfEffectiveColumns = numEffCols();
     ASSERT_WITH_SECURITY_IMPLICATION(m_columnPos.size() >= numberOfEffectiveColumns + 1);
-    LayoutUnit width = 0;
+    LayoutUnit width;
     LayoutUnit spacing = m_hSpacing;
     while (currentColumn) {
         unsigned columnIndex = effectiveIndexOfColumn(*currentColumn);
@@ -964,7 +964,7 @@ LayoutUnit RenderTable::offsetHeightForColumn(const RenderTableCol& column) cons
         ASSERT(!needsLayout());
         return m_columnOffsetHeight;
     }
-    LayoutUnit height = 0;
+    LayoutUnit height;
     for (RenderTableSection* section = topSection(); section; section = sectionBelow(section))
         height += section->offsetHeight();
     m_columnOffsetHeight = height;
@@ -1208,7 +1208,7 @@ LayoutUnit RenderTable::outerBorderBefore() const
 {
     if (!collapseBorders())
         return 0;
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
     if (RenderTableSection* topSection = this->topSection()) {
         borderWidth = topSection->outerBorderBefore();
         if (borderWidth < 0)
@@ -1228,7 +1228,7 @@ LayoutUnit RenderTable::outerBorderAfter() const
 {
     if (!collapseBorders())
         return 0;
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     if (RenderTableSection* section = bottomSection()) {
         borderWidth = section->outerBorderAfter();
@@ -1251,7 +1251,7 @@ LayoutUnit RenderTable::outerBorderStart() const
     if (!collapseBorders())
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& tb = style().borderStart();
     if (tb.style() == BorderStyle::Hidden)
@@ -1278,7 +1278,7 @@ LayoutUnit RenderTable::outerBorderEnd() const
     if (!collapseBorders())
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& tb = style().borderEnd();
     if (tb.style() == BorderStyle::Hidden)
index 7541978..58b2270 100644 (file)
@@ -154,7 +154,7 @@ Length RenderTableCell::logicalWidthFromColumns(RenderTableCol* firstColForThisC
     RenderTableCol* tableCol = firstColForThisCell;
 
     unsigned colSpanCount = colSpan();
-    LayoutUnit colWidthSum = 0;
+    LayoutUnit colWidthSum;
     for (unsigned i = 1; i <= colSpanCount; i++) {
         Length colWidth = tableCol->style().logicalWidth();
 
@@ -208,7 +208,7 @@ void RenderTableCell::computeIntrinsicPadding(LayoutUnit rowHeight)
     LayoutUnit oldIntrinsicPaddingAfter = intrinsicPaddingAfter();
     LayoutUnit logicalHeightWithoutIntrinsicPadding = logicalHeight() - oldIntrinsicPaddingBefore - oldIntrinsicPaddingAfter;
 
-    LayoutUnit intrinsicPaddingBefore = 0;
+    LayoutUnit intrinsicPaddingBefore;
     switch (style().verticalAlign()) {
     case VerticalAlign::Sub:
     case VerticalAlign::Super:
index 604fb74..09badf9 100644 (file)
@@ -231,7 +231,7 @@ LayoutUnit RenderTableSection::calcRowLogicalHeight()
     RenderTableCell* cell;
 
     // We ignore the border-spacing on any non-top section as it is already included in the previous section's last row position.
-    LayoutUnit spacing = 0;
+    LayoutUnit spacing;
     if (this == table()->topSection())
         spacing = table()->vBorderSpacing();
 
@@ -244,7 +244,7 @@ LayoutUnit RenderTableSection::calcRowLogicalHeight()
 
     for (unsigned r = 0; r < totalRows; r++) {
         m_grid[r].baseline = 0;
-        LayoutUnit baselineDescent = 0;
+        LayoutUnit baselineDescent;
 
         // Our base size is the biggest logical height from our cells' styles (excluding row spanning cells).
         m_rowPos[r + 1] = std::max(m_rowPos[r] + resolveLogicalHeightForRow(m_grid[r].logicalHeight), LayoutUnit::fromPixel(0));
@@ -304,7 +304,7 @@ LayoutUnit RenderTableSection::calcRowLogicalHeight()
                         // The descent of a cell that spans multiple rows does not affect the height of the first row it spans, so don't let it
                         // become the baseline descent applied to the rest of the row. Also we don't account for the baseline descent of
                         // non-spanning cells when computing a spanning cell's extent.
-                        LayoutUnit cellStartRowBaselineDescent = 0;
+                        LayoutUnit cellStartRowBaselineDescent;
                         if (cell->rowSpan() == 1) {
                             baselineDescent = std::max(baselineDescent, cellLogicalHeight - baselinePosition);
                             cellStartRowBaselineDescent = baselineDescent;
@@ -383,7 +383,7 @@ void RenderTableSection::distributeExtraLogicalHeightToPercentRows(LayoutUnit& e
 
     unsigned totalRows = m_grid.size();
     LayoutUnit totalHeight = m_rowPos[totalRows] + extraLogicalHeight;
-    LayoutUnit totalLogicalHeightAdded = 0;
+    LayoutUnit totalLogicalHeightAdded;
     totalPercent = std::min(totalPercent, 100);
     LayoutUnit rowHeight = m_rowPos[1] - m_rowPos[0];
     for (unsigned r = 0; r < totalRows; ++r) {
@@ -408,7 +408,7 @@ void RenderTableSection::distributeExtraLogicalHeightToAutoRows(LayoutUnit& extr
     if (!autoRowsCount)
         return;
 
-    LayoutUnit totalLogicalHeightAdded = 0;
+    LayoutUnit totalLogicalHeightAdded;
     for (unsigned r = 0; r < m_grid.size(); ++r) {
         if (autoRowsCount > 0 && m_grid[r].logicalHeight.isAuto()) {
             // Recomputing |extraLogicalHeightForRow| guarantees that we properly ditribute round |extraLogicalHeight|.
@@ -430,7 +430,7 @@ void RenderTableSection::distributeRemainingExtraLogicalHeight(LayoutUnit& extra
 
     // FIXME: m_rowPos[totalRows] - m_rowPos[0] is the total rows' size.
     LayoutUnit totalRowSize = m_rowPos[totalRows];
-    LayoutUnit totalLogicalHeightAdded = 0;
+    LayoutUnit totalLogicalHeightAdded;
     LayoutUnit previousRowPosition = m_rowPos[0];
     for (unsigned r = 0; r < totalRows; r++) {
         // weight with the original height
@@ -568,7 +568,7 @@ void RenderTableSection::layoutRows()
             rowRenderer->addVisualEffectOverflow();
         }
 
-        LayoutUnit rowHeightIncreaseForPagination = 0;
+        LayoutUnit rowHeightIncreaseForPagination;
 
         for (unsigned c = 0; c < nEffCols; c++) {
             CellStruct& cs = cellAt(r, c);
@@ -683,7 +683,7 @@ LayoutUnit RenderTableSection::calcOuterBorderBefore() const
     if (!m_grid.size() || !totalCols)
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& sb = style().borderBefore();
     if (sb.style() == BorderStyle::Hidden)
@@ -733,7 +733,7 @@ LayoutUnit RenderTableSection::calcOuterBorderAfter() const
     if (!m_grid.size() || !totalCols)
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& sb = style().borderAfter();
     if (sb.style() == BorderStyle::Hidden)
@@ -783,7 +783,7 @@ LayoutUnit RenderTableSection::calcOuterBorderStart() const
     if (!m_grid.size() || !totalCols)
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& sb = style().borderStart();
     if (sb.style() == BorderStyle::Hidden)
@@ -826,7 +826,7 @@ LayoutUnit RenderTableSection::calcOuterBorderEnd() const
     if (!m_grid.size() || !totalCols)
         return 0;
 
-    LayoutUnit borderWidth = 0;
+    LayoutUnit borderWidth;
 
     const BorderValue& sb = style().borderEnd();
     if (sb.style() == BorderStyle::Hidden)
index 4d86d7a..3f809eb 100644 (file)
@@ -243,8 +243,8 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
     if (isSVGRootInlineBox())
         return 0;
 
-    LayoutUnit maxPositionTop = 0;
-    LayoutUnit maxPositionBottom = 0;
+    LayoutUnit maxPositionTop;
+    LayoutUnit maxPositionBottom;
     int maxAscent = 0;
     int maxDescent = 0;
     bool setMaxAscent = false;
@@ -300,7 +300,7 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
 
 LayoutUnit RootInlineBox::beforeAnnotationsAdjustment() const
 {
-    LayoutUnit result = 0;
+    LayoutUnit result;
 
     if (!renderer().style().isFlippedLinesWritingMode()) {
         // Annotations under the previous line may push us down.
@@ -373,7 +373,7 @@ LayoutUnit RootInlineBox::lineSnapAdjustment(LayoutUnit delta) const
 
     // If we're paginated, see if we're on a page after the first one. If so, the grid resets on subsequent pages.
     // FIXME: If the grid is an ancestor of the pagination establisher, then this is incorrect.
-    LayoutUnit pageLogicalTop = 0;
+    LayoutUnit pageLogicalTop;
     if (layoutState->isPaginated() && layoutState->pageLogicalHeight()) {
         pageLogicalTop = blockFlow().pageLogicalTopForOffset(lineTopWithLeading() + delta);
         if (pageLogicalTop > firstLineTopWithLeading)
@@ -1013,7 +1013,7 @@ LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositio
             return cachedPosition;
     }
 
-    LayoutUnit verticalPosition = 0;
+    LayoutUnit verticalPosition;
     VerticalAlign verticalAlign = renderer->style().verticalAlign();
     if (verticalAlign == VerticalAlign::Top || verticalAlign == VerticalAlign::Bottom)
         return 0;
index fd919cf..62f3977 100644 (file)
@@ -409,7 +409,7 @@ inline RenderObject* previousInFlowSibling(RenderObject* child)
 inline LayoutUnit inlineLogicalWidth(RenderObject* child, bool checkStartEdge = true, bool checkEndEdge = true)
 {
     unsigned lineDepth = 1;
-    LayoutUnit extraWidth = 0;
+    LayoutUnit extraWidth;
     RenderElement* parent = child->parent();
     while (is<RenderInline>(*parent) && lineDepth++ < cMaxLineDepth) {
         const auto& parentAsRenderInline = downcast<RenderInline>(*parent);
index 3cf5304..00bde6d 100644 (file)
@@ -190,7 +190,7 @@ void RenderMathMLBlock::layoutItems(bool relayoutChildren)
     LayoutUnit verticalOffset = borderBefore() + paddingBefore();
     LayoutUnit horizontalOffset = borderStart() + paddingStart();
 
-    LayoutUnit preferredHorizontalExtent = 0;
+    LayoutUnit preferredHorizontalExtent;
     for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) {
         LayoutUnit childHorizontalExtent = child->maxPreferredLogicalWidth() - child->horizontalBorderAndPaddingExtent();
         LayoutUnit childHorizontalMarginBoxExtent = child->horizontalBorderAndPaddingExtent() + childHorizontalExtent;
index d930a4a..0a87e45 100644 (file)
@@ -224,7 +224,7 @@ void RenderMathMLFraction::layoutBlock(bool relayoutChildren, LayoutUnit)
 
     setLogicalWidth(std::max(numerator().logicalWidth(), denominator().logicalWidth()));
 
-    LayoutUnit verticalOffset = 0; // This is the top of the renderer.
+    LayoutUnit verticalOffset; // This is the top of the renderer.
     LayoutPoint numeratorLocation(horizontalOffset(numerator(), element().numeratorAlignment()), verticalOffset);
     numerator().setLocation(numeratorLocation);
 
index 98f38f9..7777bdb 100644 (file)
@@ -190,7 +190,7 @@ void RenderMathMLOperator::computePreferredLogicalWidths()
 {
     ASSERT(preferredLogicalWidthsDirty());
 
-    LayoutUnit preferredWidth = 0;
+    LayoutUnit preferredWidth;
 
     if (!useMathOperator()) {
         RenderMathMLToken::computePreferredLogicalWidths();
index 8de7001..8403956 100644 (file)
@@ -161,7 +161,7 @@ void RenderMathMLRoot::computePreferredLogicalWidths()
         return;
     }
 
-    LayoutUnit preferredWidth = 0;
+    LayoutUnit preferredWidth;
     if (rootType() == RootType::SquareRoot) {
         preferredWidth += m_radicalOperator.maxPreferredWidth();
         setPreferredLogicalWidthsDirty(true);
@@ -273,7 +273,7 @@ void RenderMathMLRoot::paint(PaintInfo& info, const LayoutPoint& paintOffset)
 
     // We draw the radical operator.
     LayoutPoint radicalOperatorTopLeft = paintOffset + location();
-    LayoutUnit horizontalOffset = 0;
+    LayoutUnit horizontalOffset;
     if (rootType() == RootType::RootWithIndex) {
         auto horizontal = horizontalParameters();
         horizontalOffset = horizontal.kernBeforeDegree + getIndex().logicalWidth() + horizontal.kernAfterDegree;
index 0505ef0..1c527a8 100644 (file)
@@ -129,7 +129,7 @@ void RenderMathMLRow::computePreferredLogicalWidths()
 
     m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = 0;
 
-    LayoutUnit preferredWidth = 0;
+    LayoutUnit preferredWidth;
     for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) {
         if (child->isOutOfFlowPositioned())
             continue;
index 0251423..ec9febd 100644 (file)
@@ -371,7 +371,7 @@ void RenderMathMLScripts::layoutBlock(bool relayoutChildren, LayoutUnit)
     LayoutUnit baseAscent = ascentForChild(*reference.base);
     LayoutUnit baseDescent = reference.base->logicalHeight() - baseAscent;
     LayoutUnit baseItalicCorrection = std::min(reference.base->logicalWidth(), italicCorrection(reference));
-    LayoutUnit horizontalOffset = 0;
+    LayoutUnit horizontalOffset;
 
     LayoutUnit ascent = std::max(baseAscent, metrics.ascent + metrics.supShift);
     LayoutUnit descent = std::max(baseDescent, metrics.descent + metrics.subShift);
@@ -404,7 +404,7 @@ void RenderMathMLScripts::layoutBlock(bool relayoutChildren, LayoutUnit)
     case ScriptType::UnderOver:
     case ScriptType::Multiscripts: {
         // Calculate the logical width.
-        LayoutUnit logicalWidth = 0;
+        LayoutUnit logicalWidth;
         auto subScript = reference.firstPreScript;
         while (subScript) {
             auto supScript = subScript->nextSiblingBox();
index 4a7969a..88a8d20 100644 (file)
@@ -94,7 +94,7 @@ void RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren()
     Vector<RenderBox*, 3> embellishedOperators;
     Vector<RenderMathMLOperator*, 3> stretchyOperators;
     bool isAllStretchyOperators = true;
-    LayoutUnit stretchWidth = 0;
+    LayoutUnit stretchWidth;
 
     for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) {
         if (auto* stretchyOperator = horizontalStretchyOperator(*child)) {
@@ -317,7 +317,7 @@ void RenderMathMLUnderOver::layoutBlock(bool relayoutChildren, LayoutUnit pageLo
     setLogicalWidth(logicalWidth);
 
     VerticalParameters parameters = verticalParameters();
-    LayoutUnit verticalOffset = 0;
+    LayoutUnit verticalOffset;
     if (scriptType() == ScriptType::Over || scriptType() == ScriptType::UnderOver) {
         verticalOffset += parameters.overExtraAscender;
         over().setLocation(LayoutPoint(horizontalOffset(over()), verticalOffset));
index 7ba1091..a57d1c5 100644 (file)
@@ -1767,10 +1767,10 @@ void RenderStyle::getShadowExtent(const ShadowData* shadow, LayoutUnit& top, Lay
 
 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowData* shadow) const
 {
-    LayoutUnit top = 0;
-    LayoutUnit right = 0;
-    LayoutUnit bottom = 0;
-    LayoutUnit left = 0;
+    LayoutUnit top;
+    LayoutUnit right;
+    LayoutUnit bottom;
+    LayoutUnit left;
 
     for ( ; shadow; shadow = shadow->next()) {
         if (shadow->style() == Normal)
index 4121a83..8b355fa 100644 (file)
@@ -402,8 +402,8 @@ void RenderSVGText::layout()
     // FIXME: We need to find a way to only layout the child boxes, if needed.
     FloatRect oldBoundaries = objectBoundingBox();
     ASSERT(childrenInline());
-    LayoutUnit repaintLogicalTop = 0;
-    LayoutUnit repaintLogicalBottom = 0;
+    LayoutUnit repaintLogicalTop;
+    LayoutUnit repaintLogicalBottom;
     rebuildFloatingObjectSetFromIntrudingFloats();
     layoutInlineChildren(true, repaintLogicalTop, repaintLogicalBottom);