WebKit Bugzilla
Attachment 370273 Details for
Bug 191811
: Make lossy LayoutUnit constructors explicit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-191811-20190520153033.patch (text/plain), 150.68 KB, created by
Ross Kirsling
on 2019-05-20 15:30:35 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Ross Kirsling
Created:
2019-05-20 15:30:35 PDT
Size:
150.68 KB
patch
obsolete
>Subversion Revision: 245535 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2abed3accab80d83b1464bd7209e56e639f95e33..13c4da1d9fd114578404584d7d7e9930213ef31d 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,93 @@ >+2019-05-20 Ross Kirsling <ross.kirsling@sony.com> >+ >+ Make lossy LayoutUnit constructors explicit >+ https://bugs.webkit.org/show_bug.cgi?id=191811 >+ >+ Reviewed by Antti Koivisto. >+ >+ * platform/LayoutUnit.h: >+ Make lossy unary constructors explicit. >+ For ergonomics, give float overloads to copy constructor and round/floor/ceil functions. >+ >+ * css/LengthFunctions.h: >+ * platform/graphics/LayoutPoint.h: >+ * platform/graphics/LayoutRect.h: >+ * platform/graphics/LayoutSize.h: >+ * rendering/RenderBox.h: >+ * rendering/RenderElement.h: >+ Templatize common functions to allow LayoutUnit itself to dictate which types it allows. >+ >+ * html/shadow/SliderThumbElement.cpp: >+ * page/FrameView.cpp: >+ * page/Page.cpp: >+ * page/SpatialNavigation.cpp: >+ * page/scrolling/AxisScrollSnapOffsets.cpp: >+ * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: >+ * layout/FormattingContextGeometry.cpp: >+ * layout/FormattingContextQuirks.cpp: >+ * layout/LayoutState.cpp: >+ * layout/displaytree/DisplayBox.h: >+ * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: >+ * layout/layouttree/LayoutReplaced.cpp: >+ * platform/animation/AnimationUtilities.h: >+ * platform/cocoa/ScrollSnapAnimatorState.mm: >+ * rendering/BorderEdge.cpp: >+ * rendering/EllipsisBox.cpp: >+ * rendering/FixedTableLayout.cpp: >+ * rendering/InlineBox.cpp: >+ * rendering/InlineFlowBox.cpp: >+ * rendering/InlineFlowBox.h: >+ * rendering/InlineTextBox.cpp: >+ * rendering/RenderBlock.cpp: >+ * rendering/RenderBlockFlow.cpp: >+ * rendering/RenderBlockLineLayout.cpp: >+ * rendering/RenderBox.cpp: >+ * rendering/RenderBoxModelObject.cpp: >+ * rendering/RenderBoxModelObject.h: >+ * rendering/RenderDeprecatedFlexibleBox.cpp: >+ * rendering/RenderElement.cpp: >+ * rendering/RenderImage.cpp: >+ * rendering/RenderInline.cpp: >+ * rendering/RenderLineBreak.cpp: >+ * rendering/RenderListMarker.cpp: >+ * rendering/RenderMultiColumnSet.cpp: >+ * rendering/RenderMultiColumnSet.h: >+ * rendering/RenderObject.cpp: >+ * rendering/RenderReplaced.cpp: >+ * rendering/RenderTable.cpp: >+ * rendering/RenderTableCell.cpp: >+ * rendering/RenderTableSection.cpp: >+ * rendering/RenderText.cpp: >+ * rendering/RenderTextControlMultiLine.cpp: >+ * rendering/RenderThemeMac.mm: >+ * rendering/RenderVTTCue.cpp: >+ * rendering/RenderView.cpp: >+ * rendering/RootInlineBox.cpp: >+ * rendering/SimpleLineLayoutFunctions.cpp: >+ * rendering/SimpleLineLayoutPagination.cpp: >+ * rendering/SimpleLineLayoutResolver.cpp: >+ * rendering/line/LineWidth.cpp: >+ * rendering/mathml/MathOperator.cpp: >+ * rendering/mathml/RenderMathMLBlock.cpp: >+ * rendering/mathml/RenderMathMLBlock.h: >+ * rendering/mathml/RenderMathMLFencedOperator.h: >+ * rendering/mathml/RenderMathMLFraction.cpp: >+ * rendering/mathml/RenderMathMLMenclose.cpp: >+ * rendering/mathml/RenderMathMLOperator.cpp: >+ * rendering/mathml/RenderMathMLRoot.cpp: >+ * rendering/mathml/RenderMathMLScripts.cpp: >+ * rendering/mathml/RenderMathMLToken.cpp: >+ * rendering/shapes/BoxShape.cpp: >+ * rendering/shapes/ShapeOutsideInfo.cpp: >+ * rendering/style/CollapsedBorderValue.h: >+ * rendering/style/NinePieceImage.cpp: >+ * rendering/style/NinePieceImage.h: >+ * rendering/style/RenderStyle.cpp: >+ * rendering/style/RenderStyle.h: >+ * rendering/svg/RenderSVGText.cpp: >+ * rendering/svg/SVGInlineTextBox.cpp: >+ Make usage of LayoutUnit(float) and LayoutUnit(double) explicit where needed. >+ > 2019-05-20 Gabe Giosia <giosia@google.com> > > Range getBoundingClientRect returning zero rect on simple text node with <br> before it >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e4af44cf2e98d772ceaf15135958a8fa1ef349c2..2eefb6fd2a807f5c3700063a7178cac39fbc75d3 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-05-20 Ross Kirsling <ross.kirsling@sony.com> >+ >+ Make lossy LayoutUnit constructors explicit >+ https://bugs.webkit.org/show_bug.cgi?id=191811 >+ >+ Reviewed by Antti Koivisto. >+ >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::determinePrimarySnapshottedPlugIn): >+ Make usage of LayoutUnit(float) explicit. >+ > 2019-05-20 Per Arne Vollan <pvollan@apple.com> > > [macOS] STP can't launch any WebContent processes >diff --git a/Source/WebCore/css/LengthFunctions.h b/Source/WebCore/css/LengthFunctions.h >index 1c4e050da604a43a5683aafd2eed436a453135d0..9898c6217b1964e4f09d1e46c7f7f9a95d9c8c9b 100644 >--- a/Source/WebCore/css/LengthFunctions.h >+++ b/Source/WebCore/css/LengthFunctions.h >@@ -35,9 +35,7 @@ class RenderView; > struct Length; > struct LengthSize; > >-int minimumIntValueForLength(const Length&, LayoutUnit maximumValue); > int intValueForLength(const Length&, LayoutUnit maximumValue); >-LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue); > WEBCORE_EXPORT LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue); > LayoutSize sizeForLengthSize(const LengthSize&, const LayoutSize& maximumValue); > float floatValueForLength(const Length&, LayoutUnit maximumValue); >@@ -48,12 +46,12 @@ inline LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximum > { > switch (length.type()) { > case Fixed: >- return length.value(); >+ return LayoutUnit(length.value()); > case Percent: > // Don't remove the extra cast to float. It is needed for rounding on 32-bit Intel machines that use the FPU stack. > return LayoutUnit(static_cast<float>(maximumValue * length.percent() / 100.0f)); > case Calculated: >- return length.nonNanCalculatedValue(maximumValue); >+ return LayoutUnit(length.nonNanCalculatedValue(maximumValue)); > case FillAvailable: > case Auto: > return 0; >@@ -75,4 +73,7 @@ inline int minimumIntValueForLength(const Length& length, LayoutUnit maximumValu > return static_cast<int>(minimumValueForLength(length, maximumValue)); > } > >+template<typename T> inline LayoutUnit valueForLength(const Length& length, T maximumValue) { return valueForLength(length, LayoutUnit(maximumValue)); } >+template<typename T> inline LayoutUnit minimumValueForLength(const Length& length, T maximumValue) { return minimumValueForLength(length, LayoutUnit(maximumValue)); } >+ > } // namespace WebCore >diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp >index 9fbd58b94f01e91d25069817e1b0eb1f705f0ba0..0d443c172348579255d6978de78d55fc7f6930c5 100644 >--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp >+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp >@@ -191,7 +191,7 @@ void RenderSliderContainer::layout() > double percentageOffset = sliderPosition(input).toDouble(); > LayoutUnit availableExtent = isVertical ? track->contentHeight() : track->contentWidth(); > availableExtent -= isVertical ? thumb->height() : thumb->width(); >- LayoutUnit offset = percentageOffset * availableExtent; >+ LayoutUnit offset { percentageOffset * availableExtent }; > LayoutPoint thumbLocation = thumb->location(); > if (isVertical) > thumbLocation.setY(thumbLocation.y() + track->contentHeight() - thumb->height() - offset); >@@ -301,7 +301,7 @@ void SliderThumbElement::setPositionFromPoint(const LayoutPoint& absolutePoint) > if (Optional<Decimal> closest = input->findClosestTickMarkValue(value)) { > double closestFraction = stepRange.proportionFromValue(*closest).toDouble(); > double closestRatio = isVertical || !isLeftToRightDirection ? 1.0 - closestFraction : closestFraction; >- LayoutUnit closestPosition = trackLength * closestRatio; >+ LayoutUnit closestPosition { trackLength * closestRatio }; > if ((closestPosition - position).abs() <= snappingThreshold) > value = *closest; > } >diff --git a/Source/WebCore/layout/FormattingContextGeometry.cpp b/Source/WebCore/layout/FormattingContextGeometry.cpp >index 967cfd4998b6a1a0897d062ff0dbab5ed5a173e7..4136ad2bf7e397a6994b1f661f847d3c5c65dab2 100644 >--- a/Source/WebCore/layout/FormattingContextGeometry.cpp >+++ b/Source/WebCore/layout/FormattingContextGeometry.cpp >@@ -65,7 +65,7 @@ Optional<LayoutUnit> FormattingContext::Geometry::computedHeightValue(const Layo > return { }; > > if (height.isFixed()) >- return { height.value() }; >+ return LayoutUnit(height.value()); > > Optional<LayoutUnit> containingBlockHeightValue; > if (layoutBox.isOutOfFlowPositioned()) { >@@ -77,7 +77,7 @@ Optional<LayoutUnit> FormattingContext::Geometry::computedHeightValue(const Layo > else { > auto containingBlockHeight = layoutBox.containingBlock()->style().logicalHeight(); > if (containingBlockHeight.isFixed()) >- containingBlockHeightValue = { containingBlockHeight.value() }; >+ containingBlockHeightValue = LayoutUnit(containingBlockHeight.value()); > } > } > >@@ -160,7 +160,7 @@ Optional<LayoutUnit> FormattingContext::Geometry::fixedValue(const Length& geome > { > if (!geometryProperty.isFixed()) > return WTF::nullopt; >- return { geometryProperty.value() }; >+ return LayoutUnit(geometryProperty.value()); > } > > // https://www.w3.org/TR/CSS22/visudet.html#min-max-heights >@@ -1039,8 +1039,8 @@ Edges FormattingContext::Geometry::computedBorder(const Box& layoutBox) > auto& style = layoutBox.style(); > LOG_WITH_STREAM(FormattingContextLayout, stream << "[Border] -> layoutBox: " << &layoutBox); > return { >- { style.borderLeft().boxModelWidth(), style.borderRight().boxModelWidth() }, >- { style.borderTop().boxModelWidth(), style.borderBottom().boxModelWidth() } >+ { LayoutUnit(style.borderLeft().boxModelWidth()), LayoutUnit(style.borderRight().boxModelWidth()) }, >+ { LayoutUnit(style.borderTop().boxModelWidth()), LayoutUnit(style.borderBottom().boxModelWidth()) } > }; > } > >diff --git a/Source/WebCore/layout/FormattingContextQuirks.cpp b/Source/WebCore/layout/FormattingContextQuirks.cpp >index 9e746991e86e542137e5b07581b3c18e804140c3..3faad211c569454e993e87b3cbdc79aaec56be7e 100644 >--- a/Source/WebCore/layout/FormattingContextQuirks.cpp >+++ b/Source/WebCore/layout/FormattingContextQuirks.cpp >@@ -44,7 +44,7 @@ LayoutUnit FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFix > while (containingBlock) { > auto containingBlockHeight = containingBlock->style().logicalHeight(); > if (containingBlockHeight.isFixed()) >- return containingBlockHeight.value() - bodyAndDocumentVerticalMarginPaddingAndBorder; >+ return LayoutUnit(containingBlockHeight.value() - bodyAndDocumentVerticalMarginPaddingAndBorder); > > // If the only fixed value box we find is the ICB, then ignore the body and the document (vertical) margin, padding and border. So much quirkiness. > // -and it's totally insane because now we freely travel across formatting context boundaries and computed margins are nonexistent. >diff --git a/Source/WebCore/layout/LayoutState.cpp b/Source/WebCore/layout/LayoutState.cpp >index 7af8eb16f11a3a5179b43c90b86ed184ee7d4dd2..0776cca07cf7bc4c3eb564cbaee7b1b7605751b8 100644 >--- a/Source/WebCore/layout/LayoutState.cpp >+++ b/Source/WebCore/layout/LayoutState.cpp >@@ -59,8 +59,8 @@ LayoutState::LayoutState(const Container& initialContainingBlock) > displayBox.setBorder({ }); > displayBox.setPadding({ }); > displayBox.setTopLeft({ }); >- displayBox.setContentBoxHeight(initialContainingBlock.style().logicalHeight().value()); >- displayBox.setContentBoxWidth(initialContainingBlock.style().logicalWidth().value()); >+ displayBox.setContentBoxHeight(LayoutUnit(initialContainingBlock.style().logicalHeight().value())); >+ displayBox.setContentBoxWidth(LayoutUnit(initialContainingBlock.style().logicalWidth().value())); > > m_formattingContextRootListForLayout.add(&initialContainingBlock); > } >diff --git a/Source/WebCore/layout/displaytree/DisplayBox.h b/Source/WebCore/layout/displaytree/DisplayBox.h >index d4cd7ba141690e8bcfd37799e22b62db88fd63ef..8685c378c48a886c25c1b936d06b36a2136e2e71 100644 >--- a/Source/WebCore/layout/displaytree/DisplayBox.h >+++ b/Source/WebCore/layout/displaytree/DisplayBox.h >@@ -200,8 +200,8 @@ private: > void setTopLeft(const LayoutPoint&); > void setTop(LayoutUnit); > void setLeft(LayoutUnit); >- void moveHorizontally(LayoutUnit offset) { m_topLeft.move(offset, { }); } >- void moveVertically(LayoutUnit offset) { m_topLeft.move({ }, offset); } >+ void moveHorizontally(LayoutUnit offset) { m_topLeft.move(offset, 0_lu); } >+ void moveVertically(LayoutUnit offset) { m_topLeft.move(0_lu, offset); } > > void setContentBoxHeight(LayoutUnit); > void setContentBoxWidth(LayoutUnit); >@@ -418,13 +418,13 @@ inline void Box::Rect::shiftBottomTo(LayoutUnit bottom) > inline void Box::Rect::moveHorizontally(LayoutUnit offset) > { > ASSERT(m_hasValidLeft); >- m_rect.move(offset, { }); >+ m_rect.move(offset, 0_lu); > } > > inline void Box::Rect::moveVertically(LayoutUnit offset) > { > ASSERT(m_hasValidTop); >- m_rect.move({ }, offset); >+ m_rect.move(0_lu, offset); > } > > inline void Box::Rect::expand(LayoutUnit width, LayoutUnit height) >diff --git a/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp b/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >index 7b13ab0b4ebcbd2571fe6c368a8f77016fcaa0e4..3675fadf918f170998893ded348abe755d040aff 100644 >--- a/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >+++ b/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp >@@ -528,7 +528,7 @@ void InlineFormattingContext::LineLayout::justifyRuns(Line& line) > float expansion = widthToDistribute.toFloat() / expansionOpportunities; > LayoutUnit accumulatedExpansion; > for (auto& inlineRun : inlineRuns) { >- auto expansionForRun = inlineRun.expansionOpportunity().count * expansion; >+ LayoutUnit expansionForRun { inlineRun.expansionOpportunity().count * expansion }; > > inlineRun.expansionOpportunity().expansion = expansionForRun; > inlineRun.setLogicalLeft(inlineRun.logicalLeft() + accumulatedExpansion); >diff --git a/Source/WebCore/layout/layouttree/LayoutReplaced.cpp b/Source/WebCore/layout/layouttree/LayoutReplaced.cpp >index 00cd5d068298b1663acffc9d49f0ffb1b65c4f23..e9074231666575142799d6987bf6ba23ecb690c7 100644 >--- a/Source/WebCore/layout/layouttree/LayoutReplaced.cpp >+++ b/Source/WebCore/layout/layouttree/LayoutReplaced.cpp >@@ -64,7 +64,7 @@ LayoutUnit Replaced::intrinsicWidth() const > ASSERT(hasIntrinsicWidth()); > if (m_intrinsicSize) > return m_intrinsicSize->width(); >- return m_layoutBox->style().logicalWidth().value(); >+ return LayoutUnit(m_layoutBox->style().logicalWidth().value()); > } > > LayoutUnit Replaced::intrinsicHeight() const >@@ -72,7 +72,7 @@ LayoutUnit Replaced::intrinsicHeight() const > ASSERT(hasIntrinsicHeight()); > if (m_intrinsicSize) > return m_intrinsicSize->height(); >- return m_layoutBox->style().logicalHeight().value(); >+ return LayoutUnit(m_layoutBox->style().logicalHeight().value()); > } > > LayoutUnit Replaced::intrinsicRatio() const >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 640fa1783cae0d3892e4c8a45ae7cbfa66334c43..fcdef0cce2ffef75abdfd39f976f3f64a3f2942e 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -1525,7 +1525,7 @@ LayoutSize FrameView::expandedLayoutViewportSize(const LayoutSize& baseLayoutVie > if (layoutViewportHeight > documentHeight) > return baseLayoutViewportSize; > >- return { baseLayoutViewportSize.width(), std::min<LayoutUnit>(documentHeight, (1 + heightExpansionFactor) * layoutViewportHeight) }; >+ return { baseLayoutViewportSize.width(), std::min(documentHeight, LayoutUnit((1 + heightExpansionFactor) * layoutViewportHeight)) }; > } > > LayoutRect FrameView::computeUpdatedLayoutViewportRect(const LayoutRect& layoutViewport, const LayoutRect& documentRect, const LayoutSize& unobscuredContentSize, const LayoutRect& unobscuredContentRect, const LayoutSize& baseLayoutViewportSize, const LayoutPoint& stableLayoutViewportOriginMin, const LayoutPoint& stableLayoutViewportOriginMax, LayoutViewportConstraint constraint) >@@ -4549,7 +4549,7 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS > LayoutUnit clippedLogicalLeft; > if (!renderView.style().isLeftToRightDirection()) > clippedLogicalLeft = docLogicalRight - pageLogicalWidth; >- LayoutRect overflow(clippedLogicalLeft, docLogicalTop, pageLogicalWidth, docLogicalHeight); >+ LayoutRect overflow { clippedLogicalLeft, docLogicalTop, LayoutUnit(pageLogicalWidth), docLogicalHeight }; > > if (!horizontalWritingMode) > overflow = overflow.transposedRect(); >@@ -5194,7 +5194,7 @@ int FrameView::mapFromLayoutToCSSUnits(LayoutUnit value) const > > LayoutUnit FrameView::mapFromCSSToLayoutUnits(int value) const > { >- return value * frame().pageZoomFactor() * frame().frameScaleFactor(); >+ return LayoutUnit(value * frame().pageZoomFactor() * frame().frameScaleFactor()); > } > > void FrameView::didAddWidgetToRenderTree(Widget& widget) >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 7b2708751358fe1b069c2595defa93c0470f0212..aa013bf7633ece036de90bfe745ba437df25805d 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -2192,7 +2192,7 @@ static LayoutRect relevantViewRect(RenderView* view) > // has been determined to be relevant in the context of this goal. We may choose to tweak > // the rect over time, much like we may choose to tweak gMinimumPaintedAreaRatio and > // gMaximumUnpaintedAreaRatio. But this seems to work well right now. >- LayoutRect relevantViewRect { 0, 0, relevantViewRectWidth, 1300 }; >+ LayoutRect relevantViewRect { 0, 0, LayoutUnit(relevantViewRectWidth), 1300 }; > // If the viewRect is wider than the relevantViewRect, center the relevantViewRect. > if (viewRect.width() > relevantViewRect.width()) > relevantViewRect.setX((viewRect.width() - relevantViewRect.width()) / 2); >diff --git a/Source/WebCore/page/SpatialNavigation.cpp b/Source/WebCore/page/SpatialNavigation.cpp >index bafeb7ae66abbf63a4c79b651b5b5aab8b2fa38d..4d8b72f8e5bcb0e832d3ec3ddc2ee9292b49fe86 100644 >--- a/Source/WebCore/page/SpatialNavigation.cpp >+++ b/Source/WebCore/page/SpatialNavigation.cpp >@@ -505,7 +505,7 @@ static LayoutRect rectToAbsoluteCoordinates(Frame* initialFrame, const LayoutRec > for (Frame* frame = initialFrame; frame; frame = frame->tree().parent()) { > if (Element* element = frame->ownerElement()) { > do { >- rect.move(element->offsetLeft(), element->offsetTop()); >+ rect.move(LayoutUnit(element->offsetLeft()), LayoutUnit(element->offsetTop())); > } while ((element = element->offsetParent())); > rect.moveBy((-frame->view()->scrollPosition())); > } >diff --git a/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp b/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp >index 5933287444f575f8d89be0faf3deb4d20827f4e2..bf47775e70a3e2e81dda8145fdb15fec44596a69 100644 >--- a/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp >+++ b/Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp >@@ -197,7 +197,7 @@ static void computeAxisProximitySnapOffsetRanges(const Vector<LayoutUnit>& snapO > // instead, it is more intuitive to either return to the original snap position (which we arbitrarily choose here) > // or scroll just outside of the snap offset range. This is another minor behavior tweak that we should play around > // with to see what feels best. >- LayoutUnit proximityDistance = ratioOfScrollPortAxisLengthToBeConsideredForProximity * scrollPortAxisLength; >+ LayoutUnit proximityDistance { ratioOfScrollPortAxisLengthToBeConsideredForProximity * scrollPortAxisLength }; > for (size_t index = 1; index < snapOffsets.size(); ++index) { > auto startOffset = snapOffsets[index - 1] + proximityDistance; > auto endOffset = snapOffsets[index] - proximityDistance; >diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >index 72da19122264476eb4459d84345faf0ee6b574b2..1477441cb3e29f3e492ee5901266a311ec8cd8f3 100644 >--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm >@@ -74,7 +74,7 @@ static inline Vector<ScrollOffsetRange<LayoutUnit>> convertToLayoutUnits(const V > Vector<ScrollOffsetRange<LayoutUnit>> snapOffsetRanges; > snapOffsetRanges.reserveInitialCapacity(snapOffsetRangesAsFloat.size()); > for (auto range : snapOffsetRangesAsFloat) >- snapOffsetRanges.uncheckedAppend({ range.start, range.end }); >+ snapOffsetRanges.uncheckedAppend({ LayoutUnit(range.start), LayoutUnit(range.end) }); > > return snapOffsetRanges; > } >diff --git a/Source/WebCore/platform/LayoutUnit.h b/Source/WebCore/platform/LayoutUnit.h >index 8e605edc2ea7570d0c959b22b2b306f9a93a6ed2..46a9634bba45c9a0f424b60696c8294a9676921e 100644 >--- a/Source/WebCore/platform/LayoutUnit.h >+++ b/Source/WebCore/platform/LayoutUnit.h >@@ -68,23 +68,26 @@ public: > LayoutUnit(int value) { setValue(value); } > LayoutUnit(unsigned short value) { setValue(value); } > LayoutUnit(unsigned value) { setValue(value); } >- LayoutUnit(unsigned long value) >+ explicit LayoutUnit(unsigned long value) > { > m_value = clampTo<int>(value * kFixedPointDenominator); > } >- LayoutUnit(unsigned long long value) >+ explicit LayoutUnit(unsigned long long value) > { > m_value = clampTo<int>(value * kFixedPointDenominator); > } >- LayoutUnit(float value) >+ explicit LayoutUnit(float value) > { > m_value = clampToInteger(value * kFixedPointDenominator); > } >- LayoutUnit(double value) >+ explicit LayoutUnit(double value) > { > m_value = clampToInteger(value * kFixedPointDenominator); > } > >+ LayoutUnit& operator=(const LayoutUnit& other) = default; >+ LayoutUnit& operator=(const float& other) { return *this = LayoutUnit(other); } >+ > static LayoutUnit fromFloatCeil(float value) > { > LayoutUnit v; >@@ -811,6 +814,11 @@ inline float ceilToDevicePixel(LayoutUnit value, float pixelSnappingFactor) > return ceilf((value.rawValue() * pixelSnappingFactor) / kFixedPointDenominator) / pixelSnappingFactor; > } > >+inline int roundToInt(float value) { return roundToInt(LayoutUnit(value)); } >+inline float roundToDevicePixel(float value, float pixelSnappingFactor, bool needsDirectionalRounding = false) { return roundToDevicePixel(LayoutUnit(value), pixelSnappingFactor, needsDirectionalRounding); } >+inline float floorToDevicePixel(float value, float pixelSnappingFactor) { return floorToDevicePixel(LayoutUnit(value), pixelSnappingFactor); } >+inline float ceilToDevicePixel(float value, float pixelSnappingFactor) { return ceilToDevicePixel(LayoutUnit(value), pixelSnappingFactor); } >+ > inline LayoutUnit absoluteValue(const LayoutUnit& value) > { > return value.abs(); >diff --git a/Source/WebCore/platform/animation/AnimationUtilities.h b/Source/WebCore/platform/animation/AnimationUtilities.h >index dc4942df5069a71943f24e52af362804c8af2df6..eb08e01a88fd3d669085a2d9e23b18d9be6c1b1f 100644 >--- a/Source/WebCore/platform/animation/AnimationUtilities.h >+++ b/Source/WebCore/platform/animation/AnimationUtilities.h >@@ -53,7 +53,7 @@ inline float blend(float from, float to, double progress) > > inline LayoutUnit blend(LayoutUnit from, LayoutUnit to, double progress) > { >- return from + (to - from) * progress; >+ return LayoutUnit(from + (to - from) * progress); > } > > inline IntPoint blend(const IntPoint& from, const IntPoint& to, double progress) >diff --git a/Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm b/Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm >index e5494093b1e4214606c44cd73445e218e129ba02..00f87c6753951739fddfaf509dfc9f8ab300e16e 100644 >--- a/Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm >+++ b/Source/WebCore/platform/cocoa/ScrollSnapAnimatorState.mm >@@ -96,7 +96,7 @@ float ScrollSnapAnimatorState::targetOffsetForStartOffset(const Vector<LayoutUni > return clampTo<float>(startOffset, 0, maxScrollOffset); > } > >- float targetOffset = closestSnapOffset(snapOffsets, snapOffsetRanges, predictedOffset / pageScale, initialDelta, outActiveSnapIndex); >+ float targetOffset = closestSnapOffset(snapOffsets, snapOffsetRanges, LayoutUnit(predictedOffset / pageScale), initialDelta, outActiveSnapIndex); > float minimumTargetOffset = std::max<float>(0, snapOffsets.first()); > float maximumTargetOffset = std::min<float>(maxScrollOffset, snapOffsets.last()); > targetOffset = clampTo<float>(targetOffset, minimumTargetOffset, maximumTargetOffset); >diff --git a/Source/WebCore/platform/graphics/LayoutPoint.h b/Source/WebCore/platform/graphics/LayoutPoint.h >index dd28db959e9ff803cd31ca4249054011d634e8a7..2adb496378a1ce6298132b0a55d325244e193e0c 100644 >--- a/Source/WebCore/platform/graphics/LayoutPoint.h >+++ b/Source/WebCore/platform/graphics/LayoutPoint.h >@@ -38,7 +38,7 @@ namespace WebCore { > class LayoutPoint { > public: > LayoutPoint() : m_x(0), m_y(0) { } >- LayoutPoint(LayoutUnit x, LayoutUnit y) : m_x(x), m_y(y) { } >+ template<typename T, typename U> LayoutPoint(T x, U y) : m_x(x), m_y(y) { } > LayoutPoint(const IntPoint& point) : m_x(point.x()), m_y(point.y()) { } > explicit LayoutPoint(const FloatPoint& size) : m_x(size.x()), m_y(size.y()) { } > explicit LayoutPoint(const LayoutSize& size) : m_x(size.width()), m_y(size.height()) { } >@@ -48,12 +48,12 @@ public: > LayoutUnit x() const { return m_x; } > LayoutUnit y() const { return m_y; } > >- void setX(LayoutUnit x) { m_x = x; } >- void setY(LayoutUnit y) { m_y = y; } >+ template<typename T> void setX(T x) { m_x = x; } >+ template<typename T> void setY(T y) { m_y = y; } > > void move(const LayoutSize& s) { move(s.width(), s.height()); } > void moveBy(const LayoutPoint& offset) { move(offset.x(), offset.y()); } >- void move(LayoutUnit dx, LayoutUnit dy) { m_x += dx; m_y += dy; } >+ template<typename T, typename U> void move(T dx, U dy) { m_x += dx; m_y += dy; } > > void scale(float s) > { >diff --git a/Source/WebCore/platform/graphics/LayoutRect.h b/Source/WebCore/platform/graphics/LayoutRect.h >index 609181ea6f1cdb339d9614387f65d4bace4077c9..cc73b8dd916ca89ab5e6f48435b2075a24e73d3f 100644 >--- a/Source/WebCore/platform/graphics/LayoutRect.h >+++ b/Source/WebCore/platform/graphics/LayoutRect.h >@@ -47,7 +47,8 @@ public: > LayoutRect() { } > LayoutRect(const LayoutPoint& location, const LayoutSize& size) > : m_location(location), m_size(size) { } >- LayoutRect(LayoutUnit x, LayoutUnit y, LayoutUnit width, LayoutUnit height) >+ template<typename T1, typename T2, typename U1, typename U2> >+ LayoutRect(T1 x, T2 y, U1 width, U2 height) > : m_location(LayoutPoint(x, y)), m_size(LayoutSize(width, height)) { } > LayoutRect(const LayoutPoint& topLeft, const LayoutPoint& bottomRight) > : m_location(topLeft), m_size(LayoutSize(bottomRight.x() - topLeft.x(), bottomRight.y() - topLeft.y())) { } >@@ -70,10 +71,10 @@ public: > LayoutUnit width() const { return m_size.width(); } > LayoutUnit height() const { return m_size.height(); } > >- void setX(LayoutUnit x) { m_location.setX(x); } >- void setY(LayoutUnit y) { m_location.setY(y); } >- void setWidth(LayoutUnit width) { m_size.setWidth(width); } >- void setHeight(LayoutUnit height) { m_size.setHeight(height); } >+ template<typename T> void setX(T x) { m_location.setX(x); } >+ template<typename T> void setY(T y) { m_location.setY(y); } >+ template<typename T> void setWidth(T width) { m_size.setWidth(width); } >+ template<typename T> void setHeight(T height) { m_size.setHeight(height); } > > bool isEmpty() const { return m_size.isEmpty(); } > >@@ -83,7 +84,7 @@ public: > > void move(const LayoutSize& size) { m_location += size; } > void moveBy(const LayoutPoint& offset) { m_location.move(offset.x(), offset.y()); } >- void move(LayoutUnit dx, LayoutUnit dy) { m_location.move(dx, dy); } >+ template<typename T, typename U> void move(T dx, U dy) { m_location.move(dx, dy); } > > void expand(const LayoutSize& size) { m_size += size; } > void expand(const LayoutBoxExtent& box) >@@ -91,14 +92,14 @@ public: > m_location.move(-box.left(), -box.top()); > m_size.expand(box.left() + box.right(), box.top() + box.bottom()); > } >- void expand(LayoutUnit dw, LayoutUnit dh) { m_size.expand(dw, dh); } >+ template<typename T, typename U> void expand(T dw, U dh) { m_size.expand(dw, dh); } > void contract(const LayoutSize& size) { m_size -= size; } > void contract(const LayoutBoxExtent& box) > { > m_location.move(box.left(), box.top()); > m_size.shrink(box.left() + box.right(), box.top() + box.bottom()); > } >- void contract(LayoutUnit dw, LayoutUnit dh) { m_size.expand(-dw, -dh); } >+ template<typename T, typename U> void contract(T dw, U dh) { m_size.expand(-dw, -dh); } > > void shiftXEdgeTo(LayoutUnit edge) > { >@@ -123,6 +124,11 @@ public: > setHeight(std::max<LayoutUnit>(0, height() + delta)); > } > >+ template<typename T> void shiftXEdgeTo(T edge) { shiftXEdgeTo(LayoutUnit(edge)); } >+ template<typename T> void shiftMaxXEdgeTo(T edge) { shiftMaxXEdgeTo(LayoutUnit(edge)); } >+ template<typename T> void shiftYEdgeTo(T edge) { shiftYEdgeTo(LayoutUnit(edge)); } >+ template<typename T> void shiftMaxYEdgeTo(T edge) { shiftMaxYEdgeTo(LayoutUnit(edge)); } >+ > LayoutPoint minXMinYCorner() const { return m_location; } // typically topLeft > LayoutPoint maxXMinYCorner() const { return LayoutPoint(m_location.x() + m_size.width(), m_location.y()); } // typically topRight > LayoutPoint minXMaxYCorner() const { return LayoutPoint(m_location.x(), m_location.y() + m_size.height()); } // typically bottomLeft >@@ -160,8 +166,11 @@ public: > m_location.setY(m_location.y() - dy); > m_size.setHeight(m_size.height() + dy + dy); > } >- void inflate(LayoutUnit d) { inflateX(d); inflateY(d); } > void inflate(LayoutSize size) { inflateX(size.width()); inflateY(size.height()); } >+ template<typename T> void inflateX(T dx) { inflateX(LayoutUnit(dx)); } >+ template<typename T> void inflateY(T dy) { inflateY(LayoutUnit(dy)); } >+ template<typename T> void inflate(T d) { inflateX(d); inflateY(d); } >+ > WEBCORE_EXPORT void scale(float); > void scale(float xScale, float yScale); > >diff --git a/Source/WebCore/platform/graphics/LayoutSize.h b/Source/WebCore/platform/graphics/LayoutSize.h >index 2ae03b6444c23281cc1e4961a77d87f8b0f8b4cb..5828fd7efc16588757d4106faad2b7adeac61fa1 100644 >--- a/Source/WebCore/platform/graphics/LayoutSize.h >+++ b/Source/WebCore/platform/graphics/LayoutSize.h >@@ -51,22 +51,23 @@ class LayoutSize { > public: > LayoutSize() : m_width(0), m_height(0) { } > LayoutSize(const IntSize& size) : m_width(size.width()), m_height(size.height()) { } >- LayoutSize(LayoutUnit width, LayoutUnit height) : m_width(width), m_height(height) { } >+ template<typename T, typename U> LayoutSize(T width, U height) : m_width(width), m_height(height) { } > > explicit LayoutSize(const FloatSize& size) : m_width(size.width()), m_height(size.height()) { } > > LayoutUnit width() const { return m_width; } > LayoutUnit height() const { return m_height; } > >- void setWidth(LayoutUnit width) { m_width = width; } >- void setHeight(LayoutUnit height) { m_height = height; } >+ template<typename T> void setWidth(T width) { m_width = width; } >+ template<typename T> void setHeight(T height) { m_height = height; } > > bool isEmpty() const { return m_width <= 0 || m_height <= 0; } > bool isZero() const { return !m_width && !m_height; } > > float aspectRatio() const { return static_cast<float>(m_width) / static_cast<float>(m_height); } > >- void expand(LayoutUnit width, LayoutUnit height) >+ template<typename T, typename U> >+ void expand(T width, U height) > { > m_width += width; > m_height += height; >diff --git a/Source/WebCore/rendering/BorderEdge.cpp b/Source/WebCore/rendering/BorderEdge.cpp >index 441efe45eb83c3e4342ac01fe576b5992bca57f7..0b561ad1d1d0493ae5f87cbf01d0034f08368289 100644 >--- a/Source/WebCore/rendering/BorderEdge.cpp >+++ b/Source/WebCore/rendering/BorderEdge.cpp >@@ -87,7 +87,7 @@ bool BorderEdge::obscuresBackground() const > > void BorderEdge::getDoubleBorderStripeWidths(LayoutUnit& outerWidth, LayoutUnit& innerWidth) const > { >- LayoutUnit fullWidth = widthForPainting(); >+ LayoutUnit fullWidth { widthForPainting() }; > innerWidth = ceilToDevicePixel(fullWidth * 2 / 3, m_devicePixelRatio); > outerWidth = floorToDevicePixel(fullWidth / 3, m_devicePixelRatio); > } >diff --git a/Source/WebCore/rendering/EllipsisBox.cpp b/Source/WebCore/rendering/EllipsisBox.cpp >index 08bb3235930890863edfcce80739c8c6924aa308..35728d870cdd1c1ef1ea9ab689e4cd03f2532f18 100644 >--- a/Source/WebCore/rendering/EllipsisBox.cpp >+++ b/Source/WebCore/rendering/EllipsisBox.cpp >@@ -118,7 +118,7 @@ IntRect EllipsisBox::selectionRect() > const FontCascade& font = lineStyle.fontCascade(); > const RootInlineBox& rootBox = root(); > // FIXME: Why is this always LTR? Fix by passing correct text run flags below. >- LayoutRect selectionRect = LayoutRect(x(), y() + rootBox.selectionTopAdjustedForPrecedingBlock(), 0_lu, rootBox.selectionHeightAdjustedForPrecedingBlock()); >+ LayoutRect selectionRect { LayoutUnit(x()), LayoutUnit(y() + rootBox.selectionTopAdjustedForPrecedingBlock()), 0_lu, rootBox.selectionHeightAdjustedForPrecedingBlock() }; > font.adjustSelectionRectForText(RenderBlock::constructTextRun(m_str, lineStyle, AllowTrailingExpansion), selectionRect); > // FIXME: use directional pixel snapping instead. > return enclosingIntRect(selectionRect); >@@ -139,7 +139,7 @@ void EllipsisBox::paintSelection(GraphicsContext& context, const LayoutPoint& pa > const RootInlineBox& rootBox = root(); > GraphicsContextStateSaver stateSaver(context); > // FIXME: Why is this always LTR? Fix by passing correct text run flags below. >- LayoutRect selectionRect = LayoutRect(x() + paintOffset.x(), y() + paintOffset.y() + rootBox.selectionTop(), 0_lu, rootBox.selectionHeight()); >+ LayoutRect selectionRect { LayoutUnit(x() + paintOffset.x()), LayoutUnit(y() + paintOffset.y() + rootBox.selectionTop()), 0_lu, rootBox.selectionHeight() }; > TextRun run = RenderBlock::constructTextRun(m_str, style, AllowTrailingExpansion); > font.adjustSelectionRectForText(run, selectionRect); > context.fillRect(snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()), c); >@@ -152,15 +152,15 @@ bool EllipsisBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu > // Hit test the markup box. > if (InlineBox* markupBox = this->markupBox()) { > const RenderStyle& lineStyle = this->lineStyle(); >- LayoutUnit mtx = adjustedLocation.x() + logicalWidth() - markupBox->x(); >- LayoutUnit mty = adjustedLocation.y() + lineStyle.fontMetrics().ascent() - (markupBox->y() + markupBox->lineStyle().fontMetrics().ascent()); >+ LayoutUnit mtx { adjustedLocation.x() + logicalWidth() - markupBox->x() }; >+ LayoutUnit mty { adjustedLocation.y() + lineStyle.fontMetrics().ascent() - (markupBox->y() + markupBox->lineStyle().fontMetrics().ascent()) }; > if (markupBox->nodeAtPoint(request, result, locationInContainer, LayoutPoint(mtx, mty), lineTop, lineBottom, hitTestAction)) { > blockFlow().updateHitTestResult(result, locationInContainer.point() - LayoutSize(mtx, mty)); > return true; > } > } > >- LayoutRect boundsRect(adjustedLocation, LayoutSize(logicalWidth(), m_height)); >+ LayoutRect boundsRect { adjustedLocation, LayoutSize(LayoutUnit(logicalWidth()), m_height) }; > if (visibleToHitTesting() && boundsRect.intersects(HitTestLocation::rectForPoint(locationInContainer.point(), 0, 0, 0, 0))) { > blockFlow().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(adjustedLocation)); > if (result.addNodeToListBasedTestResult(blockFlow().element(), request, locationInContainer, boundsRect) == HitTestProgress::Stop) >diff --git a/Source/WebCore/rendering/FixedTableLayout.cpp b/Source/WebCore/rendering/FixedTableLayout.cpp >index b980e10e987ca306eb26fa9fba01afdcec110a18..b05dfee072429def64d98a8d7dc54aa3553c0f99 100644 >--- a/Source/WebCore/rendering/FixedTableLayout.cpp >+++ b/Source/WebCore/rendering/FixedTableLayout.cpp >@@ -302,12 +302,12 @@ void FixedTableLayout::layout() > > float pos = 0; > for (unsigned i = 0; i < nEffCols; i++) { >- m_table->setColumnPosition(i, pos); >+ m_table->setColumnPosition(i, LayoutUnit(pos)); > pos += calcWidth[i] + hspacing; > } > float colPositionsSize = m_table->columnPositions().size(); > if (colPositionsSize > 0) >- m_table->setColumnPosition(colPositionsSize - 1, pos); >+ m_table->setColumnPosition(colPositionsSize - 1, LayoutUnit(pos)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/rendering/InlineBox.cpp b/Source/WebCore/rendering/InlineBox.cpp >index cd23ae0b97c3c75bdf85ad40482c92d81f0c41c0..a6fca02f721e43804d6ad79831dbb69e99b8e2f4 100644 >--- a/Source/WebCore/rendering/InlineBox.cpp >+++ b/Source/WebCore/rendering/InlineBox.cpp >@@ -184,7 +184,7 @@ void InlineBox::adjustPosition(float dx, float dy) > return; > > if (m_renderer.isReplaced()) >- downcast<RenderBox>(renderer()).move(dx, dy); >+ downcast<RenderBox>(renderer()).move(LayoutUnit(dx), LayoutUnit(dy)); > } > > const RootInlineBox& InlineBox::root() const >diff --git a/Source/WebCore/rendering/InlineFlowBox.cpp b/Source/WebCore/rendering/InlineFlowBox.cpp >index 1ce8de7699052de06756f2f7c4c76bd44e86d09c..4fe793117bb41c6e7135108d001654888ba6243a 100644 >--- a/Source/WebCore/rendering/InlineFlowBox.cpp >+++ b/Source/WebCore/rendering/InlineFlowBox.cpp >@@ -265,7 +265,7 @@ void InlineFlowBox::adjustPosition(float dx, float dy) > for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) > child->adjustPosition(dx, dy); > if (m_overflow) >- m_overflow->move(dx, dy); // FIXME: Rounding error here since overflow was pixel snapped, but nobody other than list markers passes non-integral values here. >+ m_overflow->move(LayoutUnit(dx), LayoutUnit(dy)); // FIXME: Rounding error here since overflow was pixel snapped, but nobody other than list markers passes non-integral values here. > } > > static inline bool isLastChildForRenderer(const RenderElement& ancestor, const RenderObject* child) >@@ -658,9 +658,9 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei > child->setLogicalTop(child->logicalTop() + top + posAdjust); > } > >- LayoutUnit newLogicalTop = child->logicalTop(); >+ LayoutUnit newLogicalTop { child->logicalTop() }; > LayoutUnit newLogicalTopIncludingMargins = newLogicalTop; >- LayoutUnit boxHeight = child->logicalHeight(); >+ LayoutUnit boxHeight { child->logicalHeight() }; > LayoutUnit boxHeightIncludingMargins = boxHeight; > > const RenderStyle& childLineStyle = child->lineStyle(); >@@ -698,7 +698,7 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei > > auto& rubyRun = downcast<RenderRubyRun>(child->renderer()); > if (RenderRubyBase* rubyBase = rubyRun.rubyBase()) { >- LayoutUnit bottomRubyBaseLeading = (child->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : 0_lu); >+ LayoutUnit bottomRubyBaseLeading { (child->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : 0_lu) }; > LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : 0_lu); > newLogicalTop += !renderer().style().isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading; > boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading); >@@ -739,10 +739,10 @@ void InlineFlowBox::placeBoxesInBlockDirection(LayoutUnit top, LayoutUnit maxHei > lineTop = logicalTop(); > lineTopIncludingMargins = lineTop; > } else { >- lineTop = std::min<LayoutUnit>(lineTop, logicalTop()); >+ lineTop = std::min(lineTop, LayoutUnit(logicalTop())); > lineTopIncludingMargins = std::min(lineTop, lineTopIncludingMargins); > } >- lineBottom = std::max<LayoutUnit>(lineBottom, logicalBottom()); >+ lineBottom = std::max(lineBottom, LayoutUnit(logicalBottom())); > lineBottomIncludingMargins = std::max(lineBottom, lineBottomIncludingMargins); > } > >@@ -828,15 +828,15 @@ inline void InlineFlowBox::addBoxShadowVisualOverflow(LayoutRect& logicalVisualO > LayoutUnit shadowLogicalTop = lineStyle.isFlippedLinesWritingMode() ? -boxShadowLogicalBottom : boxShadowLogicalTop; > LayoutUnit shadowLogicalBottom = lineStyle.isFlippedLinesWritingMode() ? -boxShadowLogicalTop : boxShadowLogicalBottom; > >- LayoutUnit logicalTopVisualOverflow = std::min<LayoutUnit>(logicalTop() + shadowLogicalTop, logicalVisualOverflow.y()); >- LayoutUnit logicalBottomVisualOverflow = std::max<LayoutUnit>(logicalBottom() + shadowLogicalBottom, logicalVisualOverflow.maxY()); >+ LayoutUnit logicalTopVisualOverflow = std::min(LayoutUnit(logicalTop() + shadowLogicalTop), logicalVisualOverflow.y()); >+ LayoutUnit logicalBottomVisualOverflow = std::max(LayoutUnit(logicalBottom() + shadowLogicalBottom), logicalVisualOverflow.maxY()); > > LayoutUnit boxShadowLogicalLeft; > LayoutUnit boxShadowLogicalRight; > lineStyle.getBoxShadowInlineDirectionExtent(boxShadowLogicalLeft, boxShadowLogicalRight); > >- LayoutUnit logicalLeftVisualOverflow = std::min<LayoutUnit>(logicalLeft() + boxShadowLogicalLeft, logicalVisualOverflow.x()); >- LayoutUnit logicalRightVisualOverflow = std::max<LayoutUnit>(logicalRight() + boxShadowLogicalRight, logicalVisualOverflow.maxX()); >+ LayoutUnit logicalLeftVisualOverflow = std::min(LayoutUnit(logicalLeft() + boxShadowLogicalLeft), logicalVisualOverflow.x()); >+ LayoutUnit logicalRightVisualOverflow = std::max(LayoutUnit(logicalRight() + boxShadowLogicalRight), logicalVisualOverflow.maxX()); > > logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, > logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow); >@@ -864,14 +864,14 @@ inline void InlineFlowBox::addBorderOutsetVisualOverflow(LayoutRect& logicalVisu > LayoutUnit outsetLogicalTop = lineStyle.isFlippedLinesWritingMode() ? borderOutsetLogicalBottom : borderOutsetLogicalTop; > LayoutUnit outsetLogicalBottom = lineStyle.isFlippedLinesWritingMode() ? borderOutsetLogicalTop : borderOutsetLogicalBottom; > >- LayoutUnit logicalTopVisualOverflow = std::min<LayoutUnit>(logicalTop() - outsetLogicalTop, logicalVisualOverflow.y()); >- LayoutUnit logicalBottomVisualOverflow = std::max<LayoutUnit>(logicalBottom() + outsetLogicalBottom, logicalVisualOverflow.maxY()); >+ LayoutUnit logicalTopVisualOverflow = std::min(LayoutUnit(logicalTop() - outsetLogicalTop), logicalVisualOverflow.y()); >+ LayoutUnit logicalBottomVisualOverflow = std::max(LayoutUnit(logicalBottom() + outsetLogicalBottom), logicalVisualOverflow.maxY()); > > LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : 0_lu; > LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : 0_lu; > >- LayoutUnit logicalLeftVisualOverflow = std::min<LayoutUnit>(logicalLeft() - outsetLogicalLeft, logicalVisualOverflow.x()); >- LayoutUnit logicalRightVisualOverflow = std::max<LayoutUnit>(logicalRight() + outsetLogicalRight, logicalVisualOverflow.maxX()); >+ LayoutUnit logicalLeftVisualOverflow = std::min(LayoutUnit(logicalLeft() - outsetLogicalLeft), logicalVisualOverflow.x()); >+ LayoutUnit logicalRightVisualOverflow = std::max(LayoutUnit(logicalRight() + outsetLogicalRight), logicalVisualOverflow.maxX()); > > logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, > logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow); >@@ -926,10 +926,10 @@ inline void InlineFlowBox::addTextBoxVisualOverflow(InlineTextBox& textBox, Glyp > LayoutUnit childOverflowLogicalLeft = std::min<LayoutUnit>(textShadowLogicalLeft + leftGlyphOverflow, leftGlyphOverflow); > LayoutUnit childOverflowLogicalRight = std::max<LayoutUnit>(textShadowLogicalRight + rightGlyphOverflow, rightGlyphOverflow); > >- LayoutUnit logicalTopVisualOverflow = std::min<LayoutUnit>(textBox.logicalTop() + childOverflowLogicalTop, logicalVisualOverflow.y()); >- LayoutUnit logicalBottomVisualOverflow = std::max<LayoutUnit>(textBox.logicalBottom() + childOverflowLogicalBottom, logicalVisualOverflow.maxY()); >- LayoutUnit logicalLeftVisualOverflow = std::min<LayoutUnit>(textBox.logicalLeft() + childOverflowLogicalLeft, logicalVisualOverflow.x()); >- LayoutUnit logicalRightVisualOverflow = std::max<LayoutUnit>(textBox.logicalRight() + childOverflowLogicalRight, logicalVisualOverflow.maxX()); >+ LayoutUnit logicalTopVisualOverflow = std::min(LayoutUnit(textBox.logicalTop() + childOverflowLogicalTop), logicalVisualOverflow.y()); >+ LayoutUnit logicalBottomVisualOverflow = std::max(LayoutUnit(textBox.logicalBottom() + childOverflowLogicalBottom), logicalVisualOverflow.maxY()); >+ LayoutUnit logicalLeftVisualOverflow = std::min(LayoutUnit(textBox.logicalLeft() + childOverflowLogicalLeft), logicalVisualOverflow.x()); >+ LayoutUnit logicalRightVisualOverflow = std::max(LayoutUnit(textBox.logicalRight() + childOverflowLogicalRight), logicalVisualOverflow.maxX()); > > logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, > logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow); >@@ -946,7 +946,7 @@ inline void InlineFlowBox::addOutlineVisualOverflow(LayoutRect& logicalVisualOve > const auto& lineStyle = this->lineStyle(); > if (!lineStyle.hasOutlineInVisualOverflow()) > return; >- LayoutUnit outlineSize = lineStyle.outlineSize(); >+ LayoutUnit outlineSize { lineStyle.outlineSize() }; > LayoutUnit logicalTopVisualOverflow = std::min(LayoutUnit(logicalTop() - outlineSize), logicalVisualOverflow.y()); > LayoutUnit logicalBottomVisualOverflow = std::max(LayoutUnit(logicalBottom() + outlineSize), logicalVisualOverflow.maxY()); > LayoutUnit logicalLeftVisualOverflow = std::min(LayoutUnit(logicalLeft() - outlineSize), logicalVisualOverflow.x()); >@@ -1127,8 +1127,8 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re > bool noQuirksMode = renderer().document().inNoQuirksMode(); > if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) { > RootInlineBox& rootBox = root(); >- LayoutUnit top = isHorizontal() ? y() : x(); >- LayoutUnit logicalHeight = isHorizontal() ? height() : width(); >+ LayoutUnit top { isHorizontal() ? y() : x()}; >+ LayoutUnit logicalHeight { isHorizontal() ? height() : width() }; > LayoutUnit bottom = std::min(rootBox.lineBottom(), top + logicalHeight); > top = std::max(rootBox.lineTop(), top); > logicalHeight = bottom - top; >@@ -1247,7 +1247,7 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& colo > #if ENABLE(CSS_BOX_DECORATION_BREAK) > else if (renderer().style().boxDecorationBreak() == BoxDecorationBreak::Clone) { > GraphicsContextStateSaver stateSaver(paintInfo.context()); >- paintInfo.context().clip(LayoutRect(rect.x(), rect.y(), width(), height())); >+ paintInfo.context().clip({ rect.x(), rect.y(), LayoutUnit(width()), LayoutUnit(height()) }); > renderer().paintFillLayerExtended(paintInfo, color, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op); > } > #endif >@@ -1279,7 +1279,7 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& colo > LayoutUnit stripHeight = isHorizontal() ? LayoutUnit(height()) : totalLogicalWidth; > > GraphicsContextStateSaver stateSaver(paintInfo.context()); >- paintInfo.context().clip(LayoutRect(rect.x(), rect.y(), width(), height())); >+ paintInfo.context().clip({ rect.x(), rect.y(), LayoutUnit(width()), LayoutUnit(height()) }); > renderer().paintFillLayerExtended(paintInfo, color, fillLayer, LayoutRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op); > } > } >@@ -1642,10 +1642,10 @@ LayoutUnit InlineFlowBox::computeUnderAnnotationAdjustment(LayoutUnit allowedPos > Optional<bool> markExistsAndIsAbove = downcast<InlineTextBox>(*child).emphasisMarkExistsAndIsAbove(childLineStyle); > if (markExistsAndIsAbove && !*markExistsAndIsAbove) { > if (!childLineStyle.isFlippedLinesWritingMode()) { >- LayoutUnit bottomOfEmphasisMark = child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); >+ LayoutUnit bottomOfEmphasisMark { child->logicalBottom() + childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()) }; > result = std::max(result, bottomOfEmphasisMark - allowedPosition); > } else { >- LayoutUnit topOfEmphasisMark = child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()); >+ LayoutUnit topOfEmphasisMark { child->logicalTop() - childLineStyle.fontCascade().emphasisMarkHeight(childLineStyle.textEmphasisMarkString()) }; > result = std::max(result, allowedPosition - topOfEmphasisMark); > } > } >diff --git a/Source/WebCore/rendering/InlineFlowBox.h b/Source/WebCore/rendering/InlineFlowBox.h >index 0991aa734faa36bceda78f73ec5b48a863a8c564..b161215fcda7e88c25a80282e7d9c74ccd3e6552 100644 >--- a/Source/WebCore/rendering/InlineFlowBox.h >+++ b/Source/WebCore/rendering/InlineFlowBox.h >@@ -124,8 +124,8 @@ public: > bool boxShadowCanBeAppliedToBackground(const FillLayer&) const; > > // logicalLeft = left in a horizontal line and top in a vertical line. >- LayoutUnit marginBorderPaddingLogicalLeft() const { return marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft(); } >- LayoutUnit marginBorderPaddingLogicalRight() const { return marginLogicalRight() + borderLogicalRight() + paddingLogicalRight(); } >+ LayoutUnit marginBorderPaddingLogicalLeft() const { return LayoutUnit(marginLogicalLeft() + borderLogicalLeft() + paddingLogicalLeft()); } >+ LayoutUnit marginBorderPaddingLogicalRight() const { return LayoutUnit(marginLogicalRight() + borderLogicalRight() + paddingLogicalRight()); } > LayoutUnit marginLogicalLeft() const > { > if (!includeLogicalLeftEdge()) >diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp >index 0f23329c3491bad50b9c9069025b1208796a0b1c..83566aeedf2d11deeaea3f29d66fcc476c50470d 100644 >--- a/Source/WebCore/rendering/InlineTextBox.cpp >+++ b/Source/WebCore/rendering/InlineTextBox.cpp >@@ -215,7 +215,7 @@ LayoutRect InlineTextBox::localSelectionRect(unsigned startPos, unsigned endPos) > > TextRun textRun = createTextRun(); > >- LayoutRect selectionRect = LayoutRect(LayoutPoint(logicalLeft(), selectionTop), LayoutSize(logicalWidth(), selectionHeight)); >+ LayoutRect selectionRect { LayoutUnit(logicalLeft()), selectionTop, LayoutUnit(logicalWidth()), selectionHeight }; > // Avoid measuring the text when the entire line box is selected as an optimization. > if (sPos || ePos != textRun.length()) > lineFont().adjustSelectionRectForText(textRun, selectionRect, sPos, ePos); >@@ -347,7 +347,7 @@ bool InlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re > FloatRect rect(locationIncludingFlipping(), size()); > // Make sure truncated text is ignored while hittesting. > if (m_truncation != cNoTruncation) { >- LayoutUnit widthOfVisibleText = renderer().width(m_start, m_truncation, textPos(), isFirstLine()); >+ LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) }; > > if (isHorizontal()) > renderer().style().isLeftToRightDirection() ? rect.setWidth(widthOfVisibleText) : rect.shiftXEdgeTo(right() - widthOfVisibleText); >@@ -486,8 +486,8 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, > // farther to the right. > // NOTE: WebKit's behavior differs from that of IE which appears to just overlay the ellipsis on top of the > // truncated string i.e. |Hello|CBA| -> |...lo|CBA| >- LayoutUnit widthOfVisibleText = renderer().width(m_start, m_truncation, textPos(), isFirstLine()); >- LayoutUnit widthOfHiddenText = logicalWidth() - widthOfVisibleText; >+ LayoutUnit widthOfVisibleText { renderer().width(m_start, m_truncation, textPos(), isFirstLine()) }; >+ LayoutUnit widthOfHiddenText { logicalWidth() - widthOfVisibleText }; > LayoutSize truncationOffset(isLeftToRightDirection() ? widthOfHiddenText : -widthOfHiddenText, 0_lu); > localPaintOffset.move(isHorizontal() ? truncationOffset : truncationOffset.transposedSize()); > } >@@ -1018,10 +1018,10 @@ void InlineTextBox::paintMarkedTextBackground(PaintInfo& paintInfo, const FloatP > > // Use same y positioning and height as for selection, so that when the selection and this subrange are on > // the same word there are no pieces sticking out. >- LayoutUnit deltaY = renderer().style().isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop; >+ LayoutUnit deltaY { renderer().style().isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop }; > LayoutUnit selectionHeight = std::max<LayoutUnit>(0, selectionBottom - selectionTop); > >- LayoutRect selectionRect = LayoutRect(boxOrigin.x(), boxOrigin.y() - deltaY, logicalWidth(), selectionHeight); >+ LayoutRect selectionRect { LayoutUnit(boxOrigin.x()), LayoutUnit(boxOrigin.y() - deltaY), LayoutUnit(logicalWidth()), selectionHeight }; > lineFont().adjustSelectionRectForText(textRun, selectionRect, clampedStartOffset, clampedEndOffset); > > // FIXME: Support painting combined text. See <https://bugs.webkit.org/show_bug.cgi?id=180993>. >diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp >index 9c9983e4079e3d9d35ba02b63646745f404450e9..051e0854236971437654355151692ed542862fb2 100644 >--- a/Source/WebCore/rendering/RenderBlock.cpp >+++ b/Source/WebCore/rendering/RenderBlock.cpp >@@ -2856,8 +2856,8 @@ void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint > // FIXME: This is wrong for block-flows that are horizontal. > // https://bugs.webkit.org/show_bug.cgi?id=46781 > bool prevInlineHasLineBox = downcast<RenderInline>(*inlineContinuation->element()->renderer()).firstLineBox(); >- float topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : 0_lu; >- float bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : 0_lu; >+ auto topMargin = prevInlineHasLineBox ? collapsedMarginBefore() : 0_lu; >+ auto bottomMargin = nextInlineHasLineBox ? collapsedMarginAfter() : 0_lu; > LayoutRect rect(additionalOffset.x(), additionalOffset.y() - topMargin, width(), height() + topMargin + bottomMargin); > if (!rect.isEmpty()) > rects.append(rect); >diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp >index 766591cc9fecaa23e56374524c81f75c79097510..6bfaa8265915c46d090919d2eb1a00af876c1a84 100644 >--- a/Source/WebCore/rendering/RenderBlockFlow.cpp >+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp >@@ -388,7 +388,7 @@ void RenderBlockFlow::computeColumnCountAndWidth() > > LayoutUnit availWidth = desiredColumnWidth; > LayoutUnit colGap = columnGap(); >- LayoutUnit colWidth = std::max<LayoutUnit>(1, style().columnWidth()); >+ LayoutUnit colWidth = std::max(1_lu, LayoutUnit(style().columnWidth())); > unsigned colCount = std::max<unsigned>(1, style().columnCount()); > > if (style().hasAutoColumnWidth() && !style().hasAutoColumnCount()) { >@@ -3096,7 +3096,7 @@ GapRects RenderBlockFlow::inlineSelectionGaps(RenderBlock& rootBlock, const Layo > selectionState() != SelectionStart && selectionState() != SelectionBoth && !isRubyBase()) > result.uniteCenter(blockSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, lastLogicalTop, lastLogicalLeft, lastLogicalRight, selTop, cache, paintInfo)); > >- LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), selTop + selHeight); >+ LayoutRect logicalRect { LayoutUnit(curr->logicalLeft()), selTop, LayoutUnit(curr->logicalWidth()), selTop + selHeight }; > logicalRect.move(isHorizontalWritingMode() ? offsetFromRootBlock : offsetFromRootBlock.transposedSize()); > LayoutRect physicalRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect); > if (!paintInfo || (isHorizontalWritingMode() && physicalRect.y() < paintInfo->rect.maxY() && physicalRect.maxY() > paintInfo->rect.y()) >@@ -3412,7 +3412,7 @@ VisiblePosition RenderBlockFlow::positionForPointWithInlineChildren(const Layout > > if (closestBox) { > if (moveCaretToBoundary) { >- LayoutUnit firstRootBoxWithChildrenTop = std::min<LayoutUnit>(firstRootBoxWithChildren->selectionTop(), firstRootBoxWithChildren->logicalTop()); >+ LayoutUnit firstRootBoxWithChildrenTop = std::min(firstRootBoxWithChildren->selectionTop(), LayoutUnit(firstRootBoxWithChildren->logicalTop())); > if (pointInLogicalContents.y() < firstRootBoxWithChildrenTop > || (blocksAreFlipped && pointInLogicalContents.y() == firstRootBoxWithChildrenTop)) { > InlineBox* box = firstRootBoxWithChildren->firstLeafChild(); >@@ -3465,9 +3465,9 @@ void RenderBlockFlow::addFocusRingRectsForInlineChildren(Vector<LayoutRect>& rec > { > ASSERT(childrenInline()); > for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) { >- LayoutUnit top = std::max<LayoutUnit>(curr->lineTop(), curr->top()); >- LayoutUnit bottom = std::min<LayoutUnit>(curr->lineBottom(), curr->top() + curr->height()); >- LayoutRect rect(additionalOffset.x() + curr->x(), additionalOffset.y() + top, curr->width(), bottom - top); >+ LayoutUnit top = std::max(curr->lineTop(), LayoutUnit(curr->top())); >+ LayoutUnit bottom = std::min(curr->lineBottom(), LayoutUnit(curr->top() + curr->height())); >+ LayoutRect rect { LayoutUnit(additionalOffset.x() + curr->x()), additionalOffset.y() + top, LayoutUnit(curr->width()), bottom - top }; > if (!rect.isEmpty()) > rects.append(rect); > } >@@ -4228,7 +4228,7 @@ void RenderBlockFlow::computeInlinePreferredLogicalWidths(LayoutUnit& minLogical > > // Add in text-indent. This is added in only once. > if (!addedTextIndent && !child->isFloating()) { >- LayoutUnit ceiledIndent = textIndent.ceilToFloat(); >+ LayoutUnit ceiledIndent { textIndent.ceilToFloat() }; > childMin += ceiledIndent; > childMax += ceiledIndent; > >diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp >index 982fc38fc70d7106a7e0b375bad8b519f770d78c..612b5a5b7287e0ac29aaec4245495a2df028df9c 100644 >--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp >+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp >@@ -446,8 +446,8 @@ void RenderBlockFlow::setMarginsForRubyRun(BidiRun* run, RenderRubyRun& renderer > } > } > renderer.getOverhang(lineInfo.isFirstLine(), renderer.style().isLeftToRightDirection() ? previousObject : nextObject, renderer.style().isLeftToRightDirection() ? nextObject : previousObject, startOverhang, endOverhang); >- setMarginStartForChild(renderer, -startOverhang); >- setMarginEndForChild(renderer, -endOverhang); >+ setMarginStartForChild(renderer, LayoutUnit(-startOverhang)); >+ setMarginEndForChild(renderer, LayoutUnit(-endOverhang)); > } > > static inline void setLogicalWidthForTextRun(RootInlineBox* lineBox, BidiRun* run, RenderText& renderer, float xPos, const LineInfo& lineInfo, >@@ -568,7 +568,7 @@ void RenderBlockFlow::updateRubyForJustifiedText(RenderRubyRun& rubyRun, BidiRun > float newBaseWidth = rubyRun.logicalWidth() + totalExpansion + marginStartForChild(rubyRun) + marginEndForChild(rubyRun); > float newRubyRunWidth = rubyRun.logicalWidth() + totalExpansion; > rubyBase.setInitialOffset((newRubyRunWidth - newBaseWidth) / 2); >- rubyRun.setOverrideContentLogicalWidth(newRubyRunWidth); >+ rubyRun.setOverrideContentLogicalWidth(LayoutUnit(newRubyRunWidth)); > rubyRun.setNeedsLayout(MarkOnlyThis); > rootBox.markDirty(); > if (RenderRubyText* rubyText = rubyRun.rubyText()) { >@@ -2143,14 +2143,14 @@ void RenderBlockFlow::checkLinesForTextOverflow() > IndentTextOrNot shouldIndentText = firstLine ? IndentText : DoNotIndentText; > LayoutUnit blockRightEdge = logicalRightOffsetForLine(curr->lineTop(), shouldIndentText); > LayoutUnit blockLeftEdge = logicalLeftOffsetForLine(curr->lineTop(), shouldIndentText); >- LayoutUnit lineBoxEdge = ltr ? curr->x() + curr->logicalWidth() : curr->x(); >+ LayoutUnit lineBoxEdge { ltr ? curr->x() + curr->logicalWidth() : curr->x() }; > if ((ltr && lineBoxEdge > blockRightEdge) || (!ltr && lineBoxEdge < blockLeftEdge)) { > // This line spills out of our box in the appropriate direction. Now we need to see if the line > // can be truncated. In order for truncation to be possible, the line must have sufficient space to > // accommodate our truncation string, and no replaced elements (images, tables) can overlap the ellipsis > // space. >- LayoutUnit width = firstLine ? firstLineEllipsisWidth : ellipsisWidth; >- LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge; >+ LayoutUnit width { firstLine ? firstLineEllipsisWidth : ellipsisWidth }; >+ LayoutUnit blockEdge { ltr ? blockRightEdge : blockLeftEdge }; > if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, width)) { > float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width); > >@@ -2258,8 +2258,8 @@ LayoutUnit RenderBlockFlow::startAlignedOffsetForLine(LayoutUnit position, Inden > updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0); > > if (!style().isLeftToRightDirection()) >- return logicalWidth() - logicalLeft; >- return logicalLeft; >+ return LayoutUnit(logicalWidth() - logicalLeft); >+ return LayoutUnit(logicalLeft); > } > > void RenderBlockFlow::updateFragmentForLine(RootInlineBox* lineBox) const >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index de2fe374089e2c583142c22129724fbb40fd32ea..c71e73cf723475c2e28c5ce45c005cdc7d00910c 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -2144,7 +2144,7 @@ void RenderBox::positionLineBox(InlineElementBox& box) > // just below the line box (as though all the inlines that came before us got > // wrapped in an anonymous block, which is what would have happened had we been > // in flow). This value was cached in the y() of the box. >- layer()->setStaticBlockPosition(box.logicalTop()); >+ layer()->setStaticBlockPosition(LayoutUnit(box.logicalTop())); > if (style().hasStaticBlockPosition(box.isHorizontal())) > setChildNeedsLayout(MarkOnlyThis); // Just mark the positioned object as needing layout, so it will update its position properly. > } >@@ -2395,7 +2395,7 @@ void RenderBox::computeLogicalWidthInFragment(LogicalExtentComputedValues& compu > computedValues.m_margins.m_start = minimumValueForLength(styleToUse.marginStart(), containerLogicalWidth); > computedValues.m_margins.m_end = minimumValueForLength(styleToUse.marginEnd(), containerLogicalWidth); > if (treatAsReplaced) >- computedValues.m_extent = std::max<LayoutUnit>(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth()); >+ computedValues.m_extent = std::max(LayoutUnit(floatValueForLength(logicalWidthLength, 0) + borderAndPaddingLogicalWidth()), minPreferredLogicalWidth()); > return; > } > >@@ -4568,7 +4568,7 @@ LayoutRect RenderBox::applyVisualEffectOverflow(const LayoutRect& borderBox) con > } > > if (outlineStyleForRepaint().hasOutlineInVisualOverflow()) { >- LayoutUnit outlineSize = outlineStyleForRepaint().outlineSize(); >+ LayoutUnit outlineSize { outlineStyleForRepaint().outlineSize() }; > overflowMinX = std::min(overflowMinX, borderBox.x() - outlineSize); > overflowMaxX = std::max(overflowMaxX, borderBox.maxX() + outlineSize); > overflowMinY = std::min(overflowMinY, borderBox.y() - outlineSize); >diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h >index 51c7ef163acce154dc2b6d7cca20c24eafb5f50f..b7865087f2f63497a3335bde412f1e1384e62036 100644 >--- a/Source/WebCore/rendering/RenderBox.h >+++ b/Source/WebCore/rendering/RenderBox.h >@@ -71,10 +71,10 @@ public: > LayoutUnit top() const { return topLeftLocation().y(); } > LayoutUnit left() const { return topLeftLocation().x(); } > >- void setX(LayoutUnit x) { m_frameRect.setX(x); } >- void setY(LayoutUnit y) { m_frameRect.setY(y); } >- void setWidth(LayoutUnit width) { m_frameRect.setWidth(width); } >- void setHeight(LayoutUnit height) { m_frameRect.setHeight(height); } >+ template<typename T> void setX(T x) { m_frameRect.setX(x); } >+ template<typename T> void setY(T y) { m_frameRect.setY(y); } >+ template<typename T> void setWidth(T width) { m_frameRect.setWidth(width); } >+ template<typename T> void setHeight(T height) { m_frameRect.setHeight(height); } > > LayoutUnit logicalLeft() const { return style().isHorizontalWritingMode() ? x() : y(); } > LayoutUnit logicalRight() const { return logicalLeft() + logicalWidth(); } >@@ -336,6 +336,9 @@ public: > LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const; > LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const; > >+ template<typename T> LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(T width) const { return adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit(width)); } >+ template<typename T> LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(T width) const { return adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit(width)); } >+ > // Overridden by fieldsets to subtract out the intrinsic border. > virtual LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const; > virtual LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const; >@@ -437,6 +440,9 @@ override; > LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const; > LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit logicalHeight) const; > >+ template<typename T> LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(T logicalWidth, ShouldComputePreferred shouldComputePreferred = ComputeActual) const { return computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit(logicalWidth), shouldComputePreferred); } >+ template<typename T> LayoutUnit computeReplacedLogicalHeightRespectingMinMaxHeight(T logicalHeight) const { return computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutUnit(logicalHeight)); } >+ > virtual LayoutUnit computeReplacedLogicalWidth(ShouldComputePreferred = ComputeActual) const; > virtual LayoutUnit computeReplacedLogicalHeight(Optional<LayoutUnit> estimatedUsedWidth = WTF::nullopt) const; > >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.cpp b/Source/WebCore/rendering/RenderBoxModelObject.cpp >index a8429bbcd80a51205fa9024a448a4c4e867a6302..803d98449074082af3b70aebb290ed2059308d08 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.cpp >+++ b/Source/WebCore/rendering/RenderBoxModelObject.cpp >@@ -2083,10 +2083,10 @@ void RenderBoxModelObject::drawBoxSideFromPath(GraphicsContext& graphicsContext, > > // Paint inner only > GraphicsContextStateSaver stateSaver(graphicsContext); >- LayoutUnit topWidth = edges[BSTop].widthForPainting() / 2; >- LayoutUnit bottomWidth = edges[BSBottom].widthForPainting() / 2; >- LayoutUnit leftWidth = edges[BSLeft].widthForPainting() / 2; >- LayoutUnit rightWidth = edges[BSRight].widthForPainting() / 2; >+ LayoutUnit topWidth { edges[BSTop].widthForPainting() / 2 }; >+ LayoutUnit bottomWidth { edges[BSBottom].widthForPainting() / 2 }; >+ LayoutUnit leftWidth { edges[BSLeft].widthForPainting() / 2 }; >+ LayoutUnit rightWidth { edges[BSRight].widthForPainting() / 2 }; > > RoundedRect clipRect = style.getRoundedInnerBorderFor(borderRect, > topWidth, bottomWidth, leftWidth, rightWidth, >diff --git a/Source/WebCore/rendering/RenderBoxModelObject.h b/Source/WebCore/rendering/RenderBoxModelObject.h >index 1d3b7ada6db0432cd9704eb8be08562847a11248..3c1b3a241d4f6453baa0c51289756f10e07b78fd 100644 >--- a/Source/WebCore/rendering/RenderBoxModelObject.h >+++ b/Source/WebCore/rendering/RenderBoxModelObject.h >@@ -152,16 +152,16 @@ public: > virtual LayoutUnit paddingStart() const { return computedCSSPaddingStart(); } > virtual LayoutUnit paddingEnd() const { return computedCSSPaddingEnd(); } > >- virtual LayoutUnit borderTop() const { return style().borderTopWidth(); } >- virtual LayoutUnit borderBottom() const { return style().borderBottomWidth(); } >- virtual LayoutUnit borderLeft() const { return style().borderLeftWidth(); } >- virtual LayoutUnit borderRight() const { return style().borderRightWidth(); } >+ virtual LayoutUnit borderTop() const { return LayoutUnit(style().borderTopWidth()); } >+ virtual LayoutUnit borderBottom() const { return LayoutUnit(style().borderBottomWidth()); } >+ virtual LayoutUnit borderLeft() const { return LayoutUnit(style().borderLeftWidth()); } >+ virtual LayoutUnit borderRight() const { return LayoutUnit(style().borderRightWidth()); } > virtual LayoutUnit horizontalBorderExtent() const { return borderLeft() + borderRight(); } > virtual LayoutUnit verticalBorderExtent() const { return borderTop() + borderBottom(); } >- virtual LayoutUnit borderBefore() const { return style().borderBeforeWidth(); } >- virtual LayoutUnit borderAfter() const { return style().borderAfterWidth(); } >- virtual LayoutUnit borderStart() const { return style().borderStartWidth(); } >- virtual LayoutUnit borderEnd() const { return style().borderEndWidth(); } >+ virtual LayoutUnit borderBefore() const { return LayoutUnit(style().borderBeforeWidth()); } >+ virtual LayoutUnit borderAfter() const { return LayoutUnit(style().borderAfterWidth()); } >+ virtual LayoutUnit borderStart() const { return LayoutUnit(style().borderStartWidth()); } >+ virtual LayoutUnit borderEnd() const { return LayoutUnit(style().borderEndWidth()); } > > LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingStart(); } > LayoutUnit borderAndPaddingBefore() const { return borderBefore() + paddingBefore(); } >diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >index a30ccd13e2b36cdbf6dd8ea86adc4fc16fb254e9..5e848e2700c868beceff1845149af41fee8b711c 100644 >--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp >@@ -839,7 +839,7 @@ void RenderDeprecatedFlexibleBox::layoutVerticalBox(bool relayoutChildren) > // Now distribute the space to objects. > for (RenderBox* child = iterator.first(); child && spaceAvailableThisPass && totalFlex; child = iterator.next()) { > if (allowedChildFlex(child, expanding, i)) { >- LayoutUnit spaceAdd = spaceAvailableThisPass * (child->style().boxFlex() / totalFlex); >+ LayoutUnit spaceAdd { spaceAvailableThisPass * (child->style().boxFlex() / totalFlex) }; > if (spaceAdd) { > child->setOverrideContentLogicalHeight(contentHeightForChild(child) + spaceAdd); > flexingChildren = true; >@@ -1017,13 +1017,13 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool > if (!leftToRight) > continue; > >- LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(lastVisibleLine->y(), DoNotIndentText); >+ LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(LayoutUnit(lastVisibleLine->y()), DoNotIndentText); > if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockRightEdge, lastVisibleLine->x() + lastVisibleLine->logicalWidth(), totalWidth)) > continue; > > // Let the truncation code kick in. > // FIXME: the text alignment should be recomputed after the width changes due to truncation. >- LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(lastVisibleLine->y(), DoNotIndentText); >+ LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(LayoutUnit(lastVisibleLine->y()), DoNotIndentText); > lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox); > destBlock.setHasMarkupTruncation(true); > } >@@ -1106,7 +1106,7 @@ LayoutUnit RenderDeprecatedFlexibleBox::allowedChildFlex(RenderBox* child, bool > } else { > Length minHeight = child->style().minHeight(); > if (minHeight.isFixed() || minHeight.isAuto()) { >- LayoutUnit minHeight = child->style().minHeight().value(); >+ LayoutUnit minHeight { child->style().minHeight().value() }; > LayoutUnit height = contentHeightForChild(child); > LayoutUnit allowedShrinkage = std::min<LayoutUnit>(0, minHeight - height); > return allowedShrinkage; >diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp >index 6ee67c52b9f3f69df0da832346532cd3b0ffb96d..659fa5162fad1fbc5b0d135e93f15fdb15080094 100644 >--- a/Source/WebCore/rendering/RenderElement.cpp >+++ b/Source/WebCore/rendering/RenderElement.cpp >@@ -38,6 +38,7 @@ > #include "HTMLHtmlElement.h" > #include "HTMLImageElement.h" > #include "HTMLNames.h" >+#include "LengthFunctions.h" > #include "Logging.h" > #include "Page.h" > #include "PathUtilities.h" >@@ -1140,7 +1141,7 @@ bool RenderElement::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* rep > // We didn't move, but we did change size. Invalidate the delta, which will consist of possibly > // two rectangles (but typically only one). > const RenderStyle& outlineStyle = outlineStyleForRepaint(); >- LayoutUnit outlineWidth = outlineStyle.outlineSize(); >+ LayoutUnit outlineWidth { outlineStyle.outlineSize() }; > LayoutBoxExtent insetShadowExtent = style().getBoxShadowInsetExtent(); > LayoutUnit width = absoluteValue(newOutlineBox.width() - oldOutlineBox.width()); > if (width) { >@@ -1151,7 +1152,7 @@ bool RenderElement::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* rep > LayoutUnit boxWidth = is<RenderBox>(*this) ? downcast<RenderBox>(*this).width() : 0_lu; > LayoutUnit minInsetRightShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.right(), std::min(newBounds.width(), oldBounds.width())); > LayoutUnit borderWidth = std::max(borderRight, std::max(valueForLength(style().borderTopRightRadius().width, boxWidth), valueForLength(style().borderBottomRightRadius().width, boxWidth))); >- LayoutUnit decorationsWidth = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderWidth + minInsetRightShadowExtent) + std::max(outlineWidth, shadowRight); >+ LayoutUnit decorationsWidth = std::max(LayoutUnit(-outlineStyle.outlineOffset()), borderWidth + minInsetRightShadowExtent) + std::max(outlineWidth, shadowRight); > LayoutRect rightRect(newOutlineBox.x() + std::min(newOutlineBox.width(), oldOutlineBox.width()) - decorationsWidth, > newOutlineBox.y(), > width + decorationsWidth, >@@ -1172,7 +1173,7 @@ bool RenderElement::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* rep > LayoutUnit minInsetBottomShadowExtent = std::min<LayoutUnit>(-insetShadowExtent.bottom(), std::min(newBounds.height(), oldBounds.height())); > LayoutUnit borderHeight = std::max(borderBottom, std::max(valueForLength(style().borderBottomLeftRadius().height, boxHeight), > valueForLength(style().borderBottomRightRadius().height, boxHeight))); >- LayoutUnit decorationsHeight = std::max<LayoutUnit>(-outlineStyle.outlineOffset(), borderHeight + minInsetBottomShadowExtent) + std::max(outlineWidth, shadowBottom); >+ LayoutUnit decorationsHeight = std::max(LayoutUnit(-outlineStyle.outlineOffset()), borderHeight + minInsetBottomShadowExtent) + std::max(outlineWidth, shadowBottom); > LayoutRect bottomRect(newOutlineBox.x(), > std::min(newOutlineBox.maxY(), oldOutlineBox.maxY()) - decorationsHeight, > std::max(newOutlineBox.width(), oldOutlineBox.width()), >@@ -1636,13 +1637,13 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F > switch (side) { > case BSTop: > case BSBottom: >- drawBorderRect(snapRectToDevicePixels(x1, y1, length, thirdOfThickness, deviceScaleFactor)); >- drawBorderRect(snapRectToDevicePixels(x1, y2 - thirdOfThickness, length, thirdOfThickness, deviceScaleFactor)); >+ drawBorderRect(snapRectToDevicePixels(LayoutRect(x1, y1, length, thirdOfThickness), deviceScaleFactor)); >+ drawBorderRect(snapRectToDevicePixels(LayoutRect(x1, y2 - thirdOfThickness, length, thirdOfThickness), deviceScaleFactor)); > break; > case BSLeft: > case BSRight: >- drawBorderRect(snapRectToDevicePixels(x1, y1, thirdOfThickness, length, deviceScaleFactor)); >- drawBorderRect(snapRectToDevicePixels(x2 - thirdOfThickness, y1, thirdOfThickness, length, deviceScaleFactor)); >+ drawBorderRect(snapRectToDevicePixels(LayoutRect(x1, y1, thirdOfThickness, length), deviceScaleFactor)); >+ drawBorderRect(snapRectToDevicePixels(LayoutRect(x2 - thirdOfThickness, y1, thirdOfThickness, length), deviceScaleFactor)); > break; > } > >@@ -1772,7 +1773,7 @@ void RenderElement::drawLineForBoxSide(GraphicsContext& graphicsContext, const F > graphicsContext.setFillColor(color); > bool wasAntialiased = graphicsContext.shouldAntialias(); > graphicsContext.setShouldAntialias(antialias); >- drawBorderRect(snapRectToDevicePixels(x1, y1, x2 - x1, y2 - y1, deviceScaleFactor)); >+ drawBorderRect(snapRectToDevicePixels(LayoutRect(x1, y1, x2 - x1, y2 - y1), deviceScaleFactor)); > graphicsContext.setShouldAntialias(wasAntialiased); > graphicsContext.setStrokeStyle(oldStrokeStyle); > return; >diff --git a/Source/WebCore/rendering/RenderElement.h b/Source/WebCore/rendering/RenderElement.h >index f28dd245d955e16be4d65609279844c318a83705..be22e435aff9bdb1c5d3ce9c4b0442742e5ee7c8 100644 >--- a/Source/WebCore/rendering/RenderElement.h >+++ b/Source/WebCore/rendering/RenderElement.h >@@ -253,9 +253,6 @@ protected: > enum StylePropagationType { PropagateToAllChildren, PropagateToBlockChildrenOnly }; > void propagateStyleToAnonymousChildren(StylePropagationType); > >- LayoutUnit valueForLength(const Length&, LayoutUnit maximumValue) const; >- LayoutUnit minimumValueForLength(const Length&, LayoutUnit maximumValue) const; >- > void setFirstChild(RenderObject* child) { m_firstChild = child; } > void setLastChild(RenderObject* child) { m_lastChild = child; } > >@@ -376,16 +373,6 @@ inline void RenderElement::setChildNeedsLayout(MarkingBehavior markParents) > markContainingBlocksForLayout(); > } > >-inline LayoutUnit RenderElement::valueForLength(const Length& length, LayoutUnit maximumValue) const >-{ >- return WebCore::valueForLength(length, maximumValue); >-} >- >-inline LayoutUnit RenderElement::minimumValueForLength(const Length& length, LayoutUnit maximumValue) const >-{ >- return WebCore::minimumValueForLength(length, maximumValue); >-} >- > inline bool RenderElement::isRenderLayerModelObject() const > { > return m_baseTypeFlags & RenderLayerModelObjectFlag; >diff --git a/Source/WebCore/rendering/RenderImage.cpp b/Source/WebCore/rendering/RenderImage.cpp >index 5162ac3db861356c1b93271b79630c6cc4f570ea..8e8400235ae172ec82f40abd4e094519e4f86d1d 100644 >--- a/Source/WebCore/rendering/RenderImage.cpp >+++ b/Source/WebCore/rendering/RenderImage.cpp >@@ -109,8 +109,8 @@ void RenderImage::collectSelectionRects(Vector<SelectionRect>& rects, unsigned, > isFirstOnLine = !inlineBox->previousOnLineExists(); > isLastOnLine = !inlineBox->nextOnLineExists(); > LogicalSelectionOffsetCaches cache(*containingBlock); >- LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, inlineBox->logicalTop(), cache); >- LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, inlineBox->logicalTop(), cache); >+ LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, LayoutUnit(inlineBox->logicalTop()), cache); >+ LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, LayoutUnit(inlineBox->logicalTop()), cache); > lineExtentRect = IntRect(leftOffset - logicalLeft(), imageRect.y(), rightOffset - leftOffset, imageRect.height()); > if (!inlineBox->isHorizontal()) { > imageRect = imageRect.transposedRect(); >@@ -461,10 +461,10 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf > FloatSize imageSize = image->size(); > imageSize.scale(1 / brokenImageAndImageScaleFactor.second); > // Center the error image, accounting for border and padding. >- LayoutUnit centerX = (usableSize.width() - imageSize.width()) / 2; >+ LayoutUnit centerX { (usableSize.width() - imageSize.width()) / 2 }; > if (centerX < 0) > centerX = 0; >- LayoutUnit centerY = (usableSize.height() - imageSize.height()) / 2; >+ LayoutUnit centerY { (usableSize.height() - imageSize.height()) / 2 }; > if (centerY < 0) > centerY = 0; > imageOffset = LayoutSize(leftBorder + leftPad + centerX + missingImageBorderWidth, topBorder + topPad + centerY + missingImageBorderWidth); >@@ -489,7 +489,7 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf > // Only draw the alt text if it'll fit within the content box, > // and only if it fits above the error image. > TextRun textRun = RenderBlock::constructTextRun(text, style()); >- LayoutUnit textWidth = font.width(textRun); >+ LayoutUnit textWidth { font.width(textRun) }; > if (errorPictureDrawn) { > if (usableSize.width() >= textWidth && fontMetrics.height() <= imageOffset.height()) > context.drawText(font, textRun, altTextOffset); >diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp >index f041afce354f7e8954aa7b852389ae7741fda825..117e4152ebf295537cebd475e07fef9e402a3dcd 100644 >--- a/Source/WebCore/rendering/RenderInline.cpp >+++ b/Source/WebCore/rendering/RenderInline.cpp >@@ -452,7 +452,7 @@ static LayoutUnit computeMargin(const RenderInline* renderer, const Length& marg > if (margin.isAuto()) > return 0; > if (margin.isFixed()) >- return margin.value(); >+ return LayoutUnit(margin.value()); > if (margin.isPercentOrCalculated()) > return minimumValueForLength(margin, std::max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth())); > return 0; >@@ -840,7 +840,7 @@ LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObj > repaintRect.move(downcast<RenderInline>(*inlineFlow).layer()->offsetForInFlowPosition()); > } > >- LayoutUnit outlineSize = style().outlineSize(); >+ LayoutUnit outlineSize { style().outlineSize() }; > repaintRect.inflate(outlineSize); > > if (hitRepaintContainer || !containingBlock) >@@ -1235,9 +1235,9 @@ void RenderInline::paintOutline(PaintInfo& paintInfo, const LayoutPoint& paintOf > rects.append(LayoutRect()); > for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { > const RootInlineBox& rootBox = curr->root(); >- LayoutUnit top = std::max<LayoutUnit>(rootBox.lineTop(), curr->logicalTop()); >- LayoutUnit bottom = std::min<LayoutUnit>(rootBox.lineBottom(), curr->logicalBottom()); >- rects.append(LayoutRect(curr->x(), top, curr->logicalWidth(), bottom - top)); >+ LayoutUnit top = std::max(rootBox.lineTop(), LayoutUnit(curr->logicalTop())); >+ LayoutUnit bottom = std::min(rootBox.lineBottom(), LayoutUnit(curr->logicalBottom())); >+ rects.append({ LayoutUnit(curr->x()), top, LayoutUnit(curr->logicalWidth()), bottom - top }); > } > rects.append(LayoutRect()); > >diff --git a/Source/WebCore/rendering/RenderLineBreak.cpp b/Source/WebCore/rendering/RenderLineBreak.cpp >index 590c0bb97a901591fd5517ba32a9b85d3661221b..bc5527b8c46a4de066f69e5a310c8868196fc23a 100644 >--- a/Source/WebCore/rendering/RenderLineBreak.cpp >+++ b/Source/WebCore/rendering/RenderLineBreak.cpp >@@ -248,8 +248,8 @@ void RenderLineBreak::collectSelectionRects(Vector<SelectionRect>& rects, unsign > auto* containingBlock = containingBlockForObjectInFlow(); > // Map rect, extended left to leftOffset, and right to rightOffset, through transforms to get minX and maxX. > LogicalSelectionOffsetCaches cache(*containingBlock); >- LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, box->logicalTop(), cache); >- LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, box->logicalTop(), cache); >+ LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, LayoutUnit(box->logicalTop()), cache); >+ LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, LayoutUnit(box->logicalTop()), cache); > LayoutRect extentsRect = rect; > if (box->isHorizontal()) { > extentsRect.setX(leftOffset); >diff --git a/Source/WebCore/rendering/RenderListMarker.cpp b/Source/WebCore/rendering/RenderListMarker.cpp >index 4c870a6a264877239205e2269b88fa128071f56c..4f78f83105c96cc6bf81d73ef824459d644a9326 100644 >--- a/Source/WebCore/rendering/RenderListMarker.cpp >+++ b/Source/WebCore/rendering/RenderListMarker.cpp >@@ -1180,7 +1180,7 @@ LayoutRect RenderListMarker::localSelectionRect() > if (!box) > return LayoutRect(LayoutPoint(), size()); > const RootInlineBox& rootBox = m_inlineBoxWrapper->root(); >- LayoutUnit newLogicalTop = rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop(); >+ LayoutUnit newLogicalTop { rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop() }; > if (rootBox.blockFlow().style().isHorizontalWritingMode()) > return LayoutRect(0_lu, newLogicalTop, width(), rootBox.selectionHeight()); > return LayoutRect(newLogicalTop, 0_lu, rootBox.selectionHeight(), height()); >@@ -1409,9 +1409,9 @@ void RenderListMarker::layout() > Length startMargin = style().marginStart(); > Length endMargin = style().marginEnd(); > if (startMargin.isFixed()) >- setMarginStart(startMargin.value()); >+ setMarginStart(LayoutUnit(startMargin.value())); > if (endMargin.isFixed()) >- setMarginEnd(endMargin.value()); >+ setMarginEnd(LayoutUnit(endMargin.value())); > > clearNeedsLayout(); > } >@@ -1654,9 +1654,9 @@ void RenderListMarker::computePreferredLogicalWidths() > logicalWidth = 0; > else { > TextRun run = RenderBlock::constructTextRun(m_text, style()); >- LayoutUnit itemWidth = font.width(run); >+ LayoutUnit itemWidth { font.width(run) }; > UChar suffixSpace[2] = { listMarkerSuffix(type, m_listItem->value()), ' ' }; >- LayoutUnit suffixSpaceWidth = font.width(RenderBlock::constructTextRun(suffixSpace, 2, style())); >+ LayoutUnit suffixSpaceWidth { font.width(RenderBlock::constructTextRun(suffixSpace, 2, style())) }; > logicalWidth = itemWidth + suffixSpaceWidth; > } > break; >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >index 28dfeb31264c20a846d72c935f30f41f99205cc2..c8384fd0f63a0a4313ee76227db6cdbc9c58ec41 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp >@@ -584,7 +584,7 @@ void RenderMultiColumnSet::paintColumnRules(PaintInfo& paintInfo, const LayoutPo > const Color& ruleColor = blockStyle.visitedDependentColorWithColorFilter(CSSPropertyColumnRuleColor); > bool ruleTransparent = blockStyle.columnRuleIsTransparent(); > BorderStyle ruleStyle = collapsedBorderStyle(blockStyle.columnRuleStyle()); >- LayoutUnit ruleThickness = blockStyle.columnRuleWidth(); >+ LayoutUnit ruleThickness { blockStyle.columnRuleWidth() }; > LayoutUnit colGap = columnGap(); > bool renderRule = ruleStyle > BorderStyle::Hidden && !ruleTransparent; > if (!renderRule) >diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.h b/Source/WebCore/rendering/RenderMultiColumnSet.h >index 375081b3e6fac2f5fc3648e4b4d21f3f433b4a55..8fa6cc039bf6c1deeaf6fcaf519a2b5e35692a0f 100644 >--- a/Source/WebCore/rendering/RenderMultiColumnSet.h >+++ b/Source/WebCore/rendering/RenderMultiColumnSet.h >@@ -217,7 +217,7 @@ private: > > // Return the column height that this content run would require, considering the implicit > // breaks assumed so far. >- LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return ceilf(float(m_breakOffset - startOffset) / float(m_assumedImplicitBreaks + 1)); } >+ LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return LayoutUnit(ceilf(float(m_breakOffset - startOffset) / float(m_assumedImplicitBreaks + 1))); } > > private: > LayoutUnit m_breakOffset; // Flow thread offset where this run ends. >diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp >index 2f0b8ba8da9fd8228d5e67dfda68abb59998bba4..48e9cffe9afa507fc2186ed8ce6c36849bed652b 100644 >--- a/Source/WebCore/rendering/RenderObject.cpp >+++ b/Source/WebCore/rendering/RenderObject.cpp >@@ -1694,7 +1694,7 @@ int RenderObject::nextOffset(int current) const > > void RenderObject::adjustRectForOutlineAndShadow(LayoutRect& rect) const > { >- LayoutUnit outlineSize = outlineStyleForRepaint().outlineSize(); >+ LayoutUnit outlineSize { outlineStyleForRepaint().outlineSize() }; > if (const ShadowData* boxShadow = style().boxShadow()) { > boxShadow->adjustRectForShadow(rect, outlineSize); > return; >diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp >index 3e56946285c89eab39c63468e857b57ba1b6cce2..d1e144eb3f9b385502354e891e9fd20e7e5e8bef 100644 >--- a/Source/WebCore/rendering/RenderReplaced.cpp >+++ b/Source/WebCore/rendering/RenderReplaced.cpp >@@ -632,7 +632,7 @@ LayoutRect RenderReplaced::localSelectionRect(bool checkWhetherSelected) const > return LayoutRect(LayoutPoint(), size()); > > const RootInlineBox& rootBox = m_inlineBoxWrapper->root(); >- LayoutUnit newLogicalTop = rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop(); >+ LayoutUnit newLogicalTop { rootBox.blockFlow().style().isFlippedBlocksWritingMode() ? m_inlineBoxWrapper->logicalBottom() - rootBox.selectionBottom() : rootBox.selectionTop() - m_inlineBoxWrapper->logicalTop() }; > if (rootBox.blockFlow().style().isHorizontalWritingMode()) > return LayoutRect(0_lu, newLogicalTop, width(), rootBox.selectionHeight()); > return LayoutRect(newLogicalTop, 0_lu, rootBox.selectionHeight(), height()); >diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp >index 99ad8da48f24d2fc2564774d252547fdbe001069..221851f1c88a439ac15682edac577178cce418f6 100644 >--- a/Source/WebCore/rendering/RenderTable.cpp >+++ b/Source/WebCore/rendering/RenderTable.cpp >@@ -320,7 +320,7 @@ LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length& > if (is<HTMLTableElement>(element()) || style().boxSizing() == BoxSizing::BorderBox) { > borders = borderAndPadding; > } >- return styleLogicalHeight.value() - borders; >+ return LayoutUnit(styleLogicalHeight.value() - borders); > } else if (styleLogicalHeight.isPercentOrCalculated()) > return computePercentageLogicalHeight(styleLogicalHeight).valueOr(0); > else if (styleLogicalHeight.isIntrinsic()) >@@ -1218,7 +1218,7 @@ LayoutUnit RenderTable::outerBorderBefore() const > if (tb.style() == BorderStyle::Hidden) > return 0; > if (tb.style() > BorderStyle::Hidden) { >- LayoutUnit collapsedBorderWidth = std::max<LayoutUnit>(borderWidth, tb.width() / 2); >+ LayoutUnit collapsedBorderWidth = std::max(borderWidth, LayoutUnit(tb.width() / 2)); > borderWidth = floorToDevicePixel(collapsedBorderWidth, document().deviceScaleFactor()); > } > return borderWidth; >@@ -1240,7 +1240,7 @@ LayoutUnit RenderTable::outerBorderAfter() const > return 0; > if (tb.style() > BorderStyle::Hidden) { > float deviceScaleFactor = document().deviceScaleFactor(); >- LayoutUnit collapsedBorderWidth = std::max<LayoutUnit>(borderWidth, (tb.width() + (1 / deviceScaleFactor)) / 2); >+ LayoutUnit collapsedBorderWidth = std::max(borderWidth, LayoutUnit((tb.width() + (1 / deviceScaleFactor)) / 2)); > borderWidth = floorToDevicePixel(collapsedBorderWidth, deviceScaleFactor); > } > return borderWidth; >diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp >index f5a0fd0d3126cabcbcc7a7d73de004a8f37f4583..7fc230c313840e39f2c9b019f5d38690cd54a75c 100644 >--- a/Source/WebCore/rendering/RenderTableCell.cpp >+++ b/Source/WebCore/rendering/RenderTableCell.cpp >@@ -198,7 +198,7 @@ void RenderTableCell::computePreferredLogicalWidths() > // to make the minwidth of the cell into the fixed width. They do this > // even in strict mode, so do not make this a quirk. Affected the top > // of hiptop.com. >- m_minPreferredLogicalWidth = std::max<LayoutUnit>(w.value(), m_minPreferredLogicalWidth); >+ m_minPreferredLogicalWidth = std::max(LayoutUnit(w.value()), m_minPreferredLogicalWidth); > } > } > >@@ -357,7 +357,7 @@ LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel > return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer); > > bool rtl = !styleForCellFlow().isLeftToRightDirection(); >- LayoutUnit outlineSize = style().outlineSize(); >+ LayoutUnit outlineSize { style().outlineSize() }; > LayoutUnit left = std::max(borderHalfLeft(true), outlineSize); > LayoutUnit right = std::max(borderHalfRight(true), outlineSize); > LayoutUnit top = std::max(borderHalfTop(true), outlineSize); >diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp >index d1db9f285f9962814f8b77b2210fe3e8e3a5c61e..16a52031d2d4582fd61eecd0ad984fd5a5e5fdd5 100644 >--- a/Source/WebCore/rendering/RenderTableSection.cpp >+++ b/Source/WebCore/rendering/RenderTableSection.cpp >@@ -214,9 +214,9 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row) > static LayoutUnit resolveLogicalHeightForRow(const Length& rowLogicalHeight) > { > if (rowLogicalHeight.isFixed()) >- return rowLogicalHeight.value(); >+ return LayoutUnit(rowLogicalHeight.value()); > if (rowLogicalHeight.isCalculated()) >- return rowLogicalHeight.nonNanCalculatedValue(0); >+ return LayoutUnit(rowLogicalHeight.nonNanCalculatedValue(0)); > return 0; > } > >@@ -388,7 +388,7 @@ void RenderTableSection::distributeExtraLogicalHeightToPercentRows(LayoutUnit& e > LayoutUnit rowHeight = m_rowPos[1] - m_rowPos[0]; > for (unsigned r = 0; r < totalRows; ++r) { > if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) { >- LayoutUnit toAdd = std::min<LayoutUnit>(extraLogicalHeight, (totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight); >+ LayoutUnit toAdd = std::min(extraLogicalHeight, LayoutUnit((totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight)); > // If toAdd is negative, then we don't want to shrink the row (this bug > // affected Outlook Web Access). > toAdd = std::max(0_lu, toAdd); >@@ -1142,18 +1142,18 @@ void RenderTableSection::paintRowGroupBorderIfRequired(const PaintInfo& paintInf > switch (borderSide) { > case BSTop: > paintRowGroupBorder(paintInfo, antialias, LayoutRect(paintOffset.x() + offsetLeftForRowGroupBorder(cell, rowGroupRect, row), rowGroupRect.y(), >- horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style.borderTop().width()), BSTop, CSSPropertyBorderTopColor, style.borderTopStyle(), table()->style().borderTopStyle()); >+ horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), LayoutUnit(style.borderTop().width())), BSTop, CSSPropertyBorderTopColor, style.borderTopStyle(), table()->style().borderTopStyle()); > break; > case BSBottom: > paintRowGroupBorder(paintInfo, antialias, LayoutRect(paintOffset.x() + offsetLeftForRowGroupBorder(cell, rowGroupRect, row), rowGroupRect.y() + rowGroupRect.height(), >- horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), style.borderBottom().width()), BSBottom, CSSPropertyBorderBottomColor, style.borderBottomStyle(), table()->style().borderBottomStyle()); >+ horizontalRowGroupBorderWidth(cell, rowGroupRect, row, column), LayoutUnit(style.borderBottom().width())), BSBottom, CSSPropertyBorderBottomColor, style.borderBottomStyle(), table()->style().borderBottomStyle()); > break; > case BSLeft: >- paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style.borderLeft().width(), >+ paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), LayoutUnit(style.borderLeft().width()), > verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSLeft, CSSPropertyBorderLeftColor, style.borderLeftStyle(), table()->style().borderLeftStyle()); > break; > case BSRight: >- paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x() + rowGroupRect.width(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), style.borderRight().width(), >+ paintRowGroupBorder(paintInfo, antialias, LayoutRect(rowGroupRect.x() + rowGroupRect.width(), rowGroupRect.y() + offsetTopForRowGroupBorder(cell, borderSide, row), LayoutUnit(style.borderRight().width()), > verticalRowGroupBorderHeight(cell, rowGroupRect, row)), BSRight, CSSPropertyBorderRightColor, style.borderRightStyle(), table()->style().borderRightStyle()); > break; > default: >diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp >index e37f3487d4f0342d03952fb6fcf458cb2416bfa4..84484e8ec8f48585ea78881a891729f5309c23b3 100644 >--- a/Source/WebCore/rendering/RenderText.cpp >+++ b/Source/WebCore/rendering/RenderText.cpp >@@ -378,8 +378,8 @@ void RenderText::collectSelectionRects(Vector<SelectionRect>& rects, unsigned st > RenderBlock* containingBlock = this->containingBlock(); > // Map rect, extended left to leftOffset, and right to rightOffset, through transforms to get minX and maxX. > LogicalSelectionOffsetCaches cache(*containingBlock); >- LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, box->logicalTop(), cache); >- LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, box->logicalTop(), cache); >+ LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, LayoutUnit(box->logicalTop()), cache); >+ LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, LayoutUnit(box->logicalTop()), cache); > LayoutRect extentsRect = rect; > if (box->isHorizontal()) { > extentsRect.setX(leftOffset); >diff --git a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp >index 4101f4f74d7bfb7eca40a26e1f6cf2a8fd2bafb9..2c3131ce1c0c64fc354114396c791596d1a9928f 100644 >--- a/Source/WebCore/rendering/RenderTextControlMultiLine.cpp >+++ b/Source/WebCore/rendering/RenderTextControlMultiLine.cpp >@@ -84,7 +84,7 @@ float RenderTextControlMultiLine::getAverageCharWidth() > > LayoutUnit RenderTextControlMultiLine::preferredContentLogicalWidth(float charWidth) const > { >- return ceilf(charWidth * textAreaElement().cols()) + scrollbarThickness(); >+ return LayoutUnit(ceilf(charWidth * textAreaElement().cols()) + scrollbarThickness()); > } > > LayoutUnit RenderTextControlMultiLine::computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const >diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm >index 6a930ac9e19929f19166e0d7a4166c1c25eae137..7667de071c3882dee7ef0a3087a036eaa643e24d 100644 >--- a/Source/WebCore/rendering/RenderThemeMac.mm >+++ b/Source/WebCore/rendering/RenderThemeMac.mm >@@ -2920,7 +2920,7 @@ bool RenderThemeMac::paintAttachment(const RenderObject& renderer, const PaintIn > GraphicsContextStateSaver saver(context); > > context.translate(toFloatSize(paintRect.location())); >- context.translate(floorSizeToDevicePixels(LayoutSize((paintRect.width() - attachmentIconBackgroundSize) / 2, 0), renderer.document().deviceScaleFactor())); >+ context.translate(floorSizeToDevicePixels({ LayoutUnit((paintRect.width() - attachmentIconBackgroundSize) / 2), 0 }, renderer.document().deviceScaleFactor())); > > bool usePlaceholder = validProgress && !progress; > >diff --git a/Source/WebCore/rendering/RenderVTTCue.cpp b/Source/WebCore/rendering/RenderVTTCue.cpp >index 6d69d168152bda3f744eee85561cd3b2520f1c02..fc685108fabf1bb4dc2f7645da18708a7ab7c624 100644 >--- a/Source/WebCore/rendering/RenderVTTCue.cpp >+++ b/Source/WebCore/rendering/RenderVTTCue.cpp >@@ -180,8 +180,8 @@ bool RenderVTTCue::shouldSwitchDirection(InlineFlowBox* firstLineBox, LayoutUnit > { > LayoutUnit top = y(); > LayoutUnit left = x(); >- LayoutUnit bottom = top + firstLineBox->height(); >- LayoutUnit right = left + firstLineBox->width(); >+ LayoutUnit bottom { top + firstLineBox->height() }; >+ LayoutUnit right { left + firstLineBox->width() }; > > // 12. Horizontal: If step is negative and the top of the first line > // box in boxes is now above the top of the video's rendering area, >@@ -352,7 +352,7 @@ void RenderVTTCue::repositionGenericCue() > InlineFlowBox* firstLineBox = downcast<RenderInline>(*backdropElement.firstChild()).firstLineBox(); > if (static_cast<TextTrackCueGeneric*>(m_cue)->useDefaultPosition() && firstLineBox) { > LayoutUnit parentWidth = containingBlock()->logicalWidth(); >- LayoutUnit width = firstLineBox->width(); >+ LayoutUnit width { firstLineBox->width() }; > LayoutUnit right = (parentWidth / 2) - (width / 2); > setX(right); > } >diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp >index e948d4620a695acdb845cb7d3ad76d84302f0b40..515b3675fec184d285451c36b805869b8fcd8a20 100644 >--- a/Source/WebCore/rendering/RenderView.cpp >+++ b/Source/WebCore/rendering/RenderView.cpp >@@ -263,7 +263,7 @@ LayoutUnit RenderView::clientLogicalWidthForFixedPosition() const > { > // FIXME: If the FrameView's fixedVisibleContentRect() is not empty, perhaps it should be consulted here too? > if (frameView().fixedElementsLayoutRelativeToFrame()) >- return (isHorizontalWritingMode() ? frameView().visibleWidth() : frameView().visibleHeight()) / frameView().frame().frameScaleFactor(); >+ return LayoutUnit((isHorizontalWritingMode() ? frameView().visibleWidth() : frameView().visibleHeight()) / frameView().frame().frameScaleFactor()); > > #if PLATFORM(IOS_FAMILY) > if (frameView().useCustomFixedPositionLayoutRect()) >@@ -280,7 +280,7 @@ LayoutUnit RenderView::clientLogicalHeightForFixedPosition() const > { > // FIXME: If the FrameView's fixedVisibleContentRect() is not empty, perhaps it should be consulted here too? > if (frameView().fixedElementsLayoutRelativeToFrame()) >- return (isHorizontalWritingMode() ? frameView().visibleHeight() : frameView().visibleWidth()) / frameView().frame().frameScaleFactor(); >+ return LayoutUnit((isHorizontalWritingMode() ? frameView().visibleHeight() : frameView().visibleWidth()) / frameView().frame().frameScaleFactor()); > > #if PLATFORM(IOS_FAMILY) > if (frameView().useCustomFixedPositionLayoutRect()) >diff --git a/Source/WebCore/rendering/RootInlineBox.cpp b/Source/WebCore/rendering/RootInlineBox.cpp >index aced2784a21a8bf48073c153b0c1cf7019849480..c2554d46fc97f971e8ba9ee88f38b95fb963a698 100644 >--- a/Source/WebCore/rendering/RootInlineBox.cpp >+++ b/Source/WebCore/rendering/RootInlineBox.cpp >@@ -183,7 +183,7 @@ bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re > void RootInlineBox::adjustPosition(float dx, float dy) > { > InlineFlowBox::adjustPosition(dx, dy); >- LayoutUnit blockDirectionDelta = isHorizontal() ? dy : dx; // The block direction delta is a LayoutUnit. >+ LayoutUnit blockDirectionDelta { isHorizontal() ? dy : dx }; // The block direction delta is a LayoutUnit. > m_lineTop += blockDirectionDelta; > m_lineBottom += blockDirectionDelta; > m_lineTopWithLeading += blockDirectionDelta; >@@ -360,12 +360,12 @@ LayoutUnit RootInlineBox::lineSnapAdjustment(LayoutUnit delta) const > return 0; > > LayoutUnit lineGridFontAscent = lineGrid->style().fontMetrics().ascent(baselineType()); >- LayoutUnit lineGridFontHeight = lineGridBox->logicalHeight(); >- LayoutUnit firstTextTop = lineGridBlockOffset + lineGridBox->logicalTop(); >+ LayoutUnit lineGridFontHeight { lineGridBox->logicalHeight() }; >+ LayoutUnit firstTextTop { lineGridBlockOffset + lineGridBox->logicalTop() }; > LayoutUnit firstLineTopWithLeading = lineGridBlockOffset + lineGridBox->lineTopWithLeading(); > LayoutUnit firstBaselinePosition = firstTextTop + lineGridFontAscent; > >- LayoutUnit currentTextTop = blockOffset + logicalTop() + delta; >+ LayoutUnit currentTextTop { blockOffset + logicalTop() + delta }; > LayoutUnit currentFontAscent = blockFlow().style().fontMetrics().ascent(baselineType()); > LayoutUnit currentBaselinePosition = currentTextTop + currentFontAscent; > >@@ -388,7 +388,7 @@ LayoutUnit RootInlineBox::lineSnapAdjustment(LayoutUnit delta) const > if (logicalHeight() <= lineGridFontHeight) > firstTextTop += (lineGridFontHeight - logicalHeight()) / 2; > else { >- LayoutUnit numberOfLinesWithLeading = ceilf(static_cast<float>(logicalHeight() - lineGridFontHeight) / gridLineHeight); >+ LayoutUnit numberOfLinesWithLeading { ceilf(static_cast<float>(logicalHeight() - lineGridFontHeight) / gridLineHeight) }; > LayoutUnit totalHeight = lineGridFontHeight + numberOfLinesWithLeading * gridLineHeight; > firstTextTop += (totalHeight - logicalHeight()) / 2; > } >@@ -433,11 +433,11 @@ GapRects RootInlineBox::lineSelectionGap(RenderBlock& rootBlock, const LayoutPoi > InlineBox* firstBox = firstSelectedBox(); > InlineBox* lastBox = lastSelectedBox(); > if (leftGap) { >- result.uniteLeft(blockFlow().logicalLeftSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, &firstBox->parent()->renderer(), firstBox->logicalLeft(), >+ result.uniteLeft(blockFlow().logicalLeftSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, &firstBox->parent()->renderer(), LayoutUnit(firstBox->logicalLeft()), > selTop, selHeight, cache, paintInfo)); > } > if (rightGap) { >- result.uniteRight(blockFlow().logicalRightSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, &lastBox->parent()->renderer(), lastBox->logicalRight(), >+ result.uniteRight(blockFlow().logicalRightSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, &lastBox->parent()->renderer(), LayoutUnit(lastBox->logicalRight()), > selTop, selHeight, cache, paintInfo)); > } > >@@ -450,11 +450,11 @@ GapRects RootInlineBox::lineSelectionGap(RenderBlock& rootBlock, const LayoutPoi > // We can see that the |bbb| run is not part of the selection while the runs around it are. > if (firstBox && firstBox != lastBox) { > // Now fill in any gaps on the line that occurred between two selected elements. >- LayoutUnit lastLogicalLeft = firstBox->logicalRight(); >+ LayoutUnit lastLogicalLeft { firstBox->logicalRight() }; > bool isPreviousBoxSelected = firstBox->selectionState() != RenderObject::SelectionNone; > for (InlineBox* box = firstBox->nextLeafChild(); box; box = box->nextLeafChild()) { > if (box->selectionState() != RenderObject::SelectionNone) { >- LayoutRect logicalRect(lastLogicalLeft, selTop, box->logicalLeft() - lastLogicalLeft, selHeight); >+ LayoutRect logicalRect { lastLogicalLeft, selTop, LayoutUnit(box->logicalLeft() - lastLogicalLeft), selHeight }; > logicalRect.move(renderer().isHorizontalWritingMode() ? offsetFromRootBlock : LayoutSize(offsetFromRootBlock.height(), offsetFromRootBlock.width())); > LayoutRect gapRect = rootBlock.logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect); > if (isPreviousBoxSelected && gapRect.width() > 0 && gapRect.height() > 0) { >@@ -849,14 +849,14 @@ LayoutRect RootInlineBox::paddedLayoutOverflowRect(LayoutUnit endPadding) const > > if (isHorizontal()) { > if (isLeftToRightDirection()) >- lineLayoutOverflow.shiftMaxXEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxX(), logicalRight() + endPadding)); >+ lineLayoutOverflow.shiftMaxXEdgeTo(std::max(lineLayoutOverflow.maxX(), LayoutUnit(logicalRight() + endPadding))); > else >- lineLayoutOverflow.shiftXEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.x(), logicalLeft() - endPadding)); >+ lineLayoutOverflow.shiftXEdgeTo(std::min(lineLayoutOverflow.x(), LayoutUnit(logicalLeft() - endPadding))); > } else { > if (isLeftToRightDirection()) >- lineLayoutOverflow.shiftMaxYEdgeTo(std::max<LayoutUnit>(lineLayoutOverflow.maxY(), logicalRight() + endPadding)); >+ lineLayoutOverflow.shiftMaxYEdgeTo(std::max(lineLayoutOverflow.maxY(), LayoutUnit(logicalRight() + endPadding))); > else >- lineLayoutOverflow.shiftYEdgeTo(std::min<LayoutUnit>(lineLayoutOverflow.y(), logicalLeft() - endPadding)); >+ lineLayoutOverflow.shiftYEdgeTo(std::min(lineLayoutOverflow.y(), LayoutUnit(logicalLeft() - endPadding))); > } > > return lineLayoutOverflow; >@@ -993,7 +993,7 @@ void RootInlineBox::ascentAndDescentForBox(InlineBox& box, GlyphOverflowAndFallb > LayoutUnit RootInlineBox::verticalPositionForBox(InlineBox* box, VerticalPositionCache& verticalPositionCache) > { > if (box->renderer().isTextOrLineBreak()) >- return box->parent()->logicalTop(); >+ return LayoutUnit(box->parent()->logicalTop()); > > RenderBoxModelObject* renderer = box->boxModelObject(); > ASSERT(renderer->isInline()); >diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >index 71160da4e9c42160432920bf970ed1e49e426444..9af6ee4b66b7697076e879f6c67ea97289bef4d0 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp >@@ -379,7 +379,7 @@ void generateLineBoxTree(RenderBlockFlow& flow, const Layout& layout) > auto lineTop = firstRun.rect().y(); > auto lineHeight = firstRun.rect().height(); > rootLineBox.setLogicalTop(lineTop); >- rootLineBox.setLineTopBottomPositions(lineTop, lineTop + lineHeight, lineTop, lineTop + lineHeight); >+ rootLineBox.setLineTopBottomPositions(LayoutUnit(lineTop), LayoutUnit(lineTop + lineHeight), LayoutUnit(lineTop), LayoutUnit(lineTop + lineHeight)); > } > } > >diff --git a/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp b/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp >index 997dd934033b722477910a8b4f55c042886b5442..ba8da078429e1a96286ba2e19b2631e284613863 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutPagination.cpp >@@ -105,7 +105,7 @@ static void setPageBreakForLine(unsigned lineBreakIndex, PaginatedLines& lines, > if (firstLineDoesNotFit || orphanDoesNotFit) { > auto firstLine = lines.first(); > auto firstLineOverflowRect = computeOverflow(flow, LayoutRect(0_lu, firstLine.top, 0_lu, firstLine.height)); >- auto firstLineUpperOverhang = std::max<LayoutUnit>(-firstLineOverflowRect.y(), 0_lu); >+ auto firstLineUpperOverhang = std::max(LayoutUnit(-firstLineOverflowRect.y()), 0_lu); > flow.setPaginationStrut(line.top + remainingLogicalHeight + firstLineUpperOverhang); > return; > } >diff --git a/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp b/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >index 86b895ef2234a9bfb1d643d8ded57004b12a4a04..00f038167088a93efb23e7c9911a4548f04b7847 100644 >--- a/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >+++ b/Source/WebCore/rendering/SimpleLineLayoutResolver.cpp >@@ -206,7 +206,7 @@ unsigned RunResolver::lineIndexForHeight(LayoutUnit height, IndexType type) cons > adjustedY = std::max<float>(adjustedY, 0); > auto lineIndexCandidate = std::min<unsigned>(adjustedY / m_lineHeight, m_layout.lineCount() - 1); > if (m_layout.hasLineStruts()) >- return adjustLineIndexForStruts(y, type, lineIndexCandidate); >+ return adjustLineIndexForStruts(LayoutUnit(y), type, lineIndexCandidate); > return lineIndexCandidate; > } > >diff --git a/Source/WebCore/rendering/line/LineWidth.cpp b/Source/WebCore/rendering/line/LineWidth.cpp >index c09dbb847fe034bd23b93cec262e42d5ed6bb2b6..c2eb22fe3f2941390efec9e60c7bd4349d51ea3d 100644 >--- a/Source/WebCore/rendering/line/LineWidth.cpp >+++ b/Source/WebCore/rendering/line/LineWidth.cpp >@@ -182,7 +182,7 @@ void LineWidth::wrapNextToShapeOutside(bool isFirstLine) > > ++newLineTop; > } >- updateLineDimension(newLineTop, newLineWidth, newLineLeft, newLineRight); >+ updateLineDimension(newLineTop, LayoutUnit(newLineWidth), LayoutUnit(newLineLeft), LayoutUnit(newLineRight)); > } > > void LineWidth::fitBelowFloats(bool isFirstLine) >@@ -212,7 +212,7 @@ void LineWidth::fitBelowFloats(bool isFirstLine) > break; > } > >- updateLineDimension(lastFloatLogicalBottom, newLineWidth, newLineLeft, newLineRight); >+ updateLineDimension(lastFloatLogicalBottom, LayoutUnit(newLineWidth), LayoutUnit(newLineLeft), LayoutUnit(newLineRight)); > } > > void LineWidth::setTrailingWhitespaceWidth(float collapsedWhitespace, float borderPaddingMargin) >diff --git a/Source/WebCore/rendering/mathml/MathOperator.cpp b/Source/WebCore/rendering/mathml/MathOperator.cpp >index a24a266349fbb7d3ef1ece9443765d5fc0ecb960..b6cf055332fd161856c0a92cb2ce3650dcc754bb 100644 >--- a/Source/WebCore/rendering/mathml/MathOperator.cpp >+++ b/Source/WebCore/rendering/mathml/MathOperator.cpp >@@ -184,10 +184,10 @@ void MathOperator::setGlyphAssembly(const RenderStyle& style, const GlyphAssembl > > if (m_operatorType == Type::VerticalOperator) { > m_width = 0; >- m_width = std::max<LayoutUnit>(m_width, advanceWidthForGlyph(topOrRight)); >- m_width = std::max<LayoutUnit>(m_width, advanceWidthForGlyph(extension)); >- m_width = std::max<LayoutUnit>(m_width, advanceWidthForGlyph(bottomOrLeft)); >- m_width = std::max<LayoutUnit>(m_width, advanceWidthForGlyph(middle)); >+ m_width = std::max(m_width, LayoutUnit(advanceWidthForGlyph(topOrRight))); >+ m_width = std::max(m_width, LayoutUnit(advanceWidthForGlyph(extension))); >+ m_width = std::max(m_width, LayoutUnit(advanceWidthForGlyph(bottomOrLeft))); >+ m_width = std::max(m_width, LayoutUnit(advanceWidthForGlyph(middle))); > } else { > m_ascent = 0; > m_descent = 0; >@@ -401,10 +401,10 @@ void MathOperator::calculateStretchyData(const RenderStyle& style, bool calculat > for (auto& sizeVariant : sizeVariants) { > GlyphData glyphData(sizeVariant, baseGlyph.font); > if (calculateMaxPreferredWidth) >- m_maxPreferredWidth = std::max<LayoutUnit>(m_maxPreferredWidth, advanceWidthForGlyph(glyphData)); >+ m_maxPreferredWidth = std::max(m_maxPreferredWidth, LayoutUnit(advanceWidthForGlyph(glyphData))); > else { > setSizeVariant(glyphData); >- LayoutUnit size = isVertical ? heightForGlyph(glyphData) : advanceWidthForGlyph(glyphData); >+ LayoutUnit size { isVertical ? heightForGlyph(glyphData) : advanceWidthForGlyph(glyphData) }; > if (size >= targetSize) > return; > } >@@ -462,10 +462,10 @@ void MathOperator::calculateStretchyData(const RenderStyle& style, bool calculat > > // If we are measuring the maximum width, verify each component. > if (calculateMaxPreferredWidth) { >- m_maxPreferredWidth = std::max<LayoutUnit>(m_maxPreferredWidth, advanceWidthForGlyph(topOrRight)); >- m_maxPreferredWidth = std::max<LayoutUnit>(m_maxPreferredWidth, advanceWidthForGlyph(extension)); >- m_maxPreferredWidth = std::max<LayoutUnit>(m_maxPreferredWidth, advanceWidthForGlyph(middle)); >- m_maxPreferredWidth = std::max<LayoutUnit>(m_maxPreferredWidth, advanceWidthForGlyph(bottomOrLeft)); >+ m_maxPreferredWidth = std::max(m_maxPreferredWidth, LayoutUnit(advanceWidthForGlyph(topOrRight))); >+ m_maxPreferredWidth = std::max(m_maxPreferredWidth, LayoutUnit(advanceWidthForGlyph(extension))); >+ m_maxPreferredWidth = std::max(m_maxPreferredWidth, LayoutUnit(advanceWidthForGlyph(middle))); >+ m_maxPreferredWidth = std::max(m_maxPreferredWidth, LayoutUnit(advanceWidthForGlyph(bottomOrLeft))); > return; > } > >@@ -571,7 +571,7 @@ void MathOperator::fillWithVerticalExtensionGlyph(const RenderStyle& style, Pain > > // Trimming may remove up to two pixels from the top of the extender glyph, so we move it up by two pixels. > float offsetToGlyphTop = glyphBounds.y() + 2; >- LayoutPoint glyphOrigin = LayoutPoint(from.x(), from.y() - offsetToGlyphTop); >+ LayoutPoint glyphOrigin { from.x(), LayoutUnit(from.y() - offsetToGlyphTop) }; > FloatRect lastPaintedGlyphRect(from, FloatSize()); > > // In practice, only small stretch sizes are requested but we limit the number of glyphs to avoid hangs. >@@ -612,7 +612,7 @@ void MathOperator::fillWithHorizontalExtensionGlyph(const RenderStyle& style, Pa > > // Trimming may remove up to two pixels from the left of the extender glyph, so we move it left by two pixels. > float offsetToGlyphLeft = -2; >- LayoutPoint glyphOrigin = LayoutPoint(from.x() + offsetToGlyphLeft, from.y()); >+ LayoutPoint glyphOrigin { LayoutUnit(from.x() + offsetToGlyphLeft), from.y() }; > FloatRect lastPaintedGlyphRect(from, FloatSize()); > > // In practice, only small stretch sizes are requested but we limit the number of glyphs to avoid hangs. >@@ -645,11 +645,11 @@ void MathOperator::paintVerticalGlyphAssembly(const RenderStyle& style, PaintInf > // We are positioning the glyphs so that the edge of the tight glyph bounds line up exactly with the edges of our paint box. > LayoutPoint operatorTopLeft = paintOffset; > FloatRect topGlyphBounds = boundsForGlyph(topOrRight); >- LayoutPoint topGlyphOrigin(operatorTopLeft.x(), operatorTopLeft.y() - topGlyphBounds.y()); >+ LayoutPoint topGlyphOrigin { operatorTopLeft.x(), LayoutUnit(operatorTopLeft.y() - topGlyphBounds.y()) }; > LayoutRect topGlyphPaintRect = paintGlyph(style, info, topOrRight, topGlyphOrigin, TrimBottom); > > FloatRect bottomGlyphBounds = boundsForGlyph(bottomOrLeft); >- LayoutPoint bottomGlyphOrigin(operatorTopLeft.x(), operatorTopLeft.y() + stretchSize() - (bottomGlyphBounds.height() + bottomGlyphBounds.y())); >+ LayoutPoint bottomGlyphOrigin { operatorTopLeft.x(), LayoutUnit(operatorTopLeft.y() + stretchSize() - (bottomGlyphBounds.height() + bottomGlyphBounds.y())) }; > LayoutRect bottomGlyphPaintRect = paintGlyph(style, info, bottomOrLeft, bottomGlyphOrigin, TrimTop); > > if (m_assembly.hasMiddle()) { >@@ -690,7 +690,7 @@ void MathOperator::paintHorizontalGlyphAssembly(const RenderStyle& style, PaintI > LayoutRect leftGlyphPaintRect = paintGlyph(style, info, bottomOrLeft, leftGlyphOrigin, TrimRight); > > FloatRect rightGlyphBounds = boundsForGlyph(topOrRight); >- LayoutPoint rightGlyphOrigin(operatorTopLeft.x() + stretchSize() - rightGlyphBounds.width(), baselineY); >+ LayoutPoint rightGlyphOrigin { LayoutUnit(operatorTopLeft.x() + stretchSize() - rightGlyphBounds.width()), baselineY }; > LayoutRect rightGlyphPaintRect = paintGlyph(style, info, topOrRight, rightGlyphOrigin, TrimLeft); > > if (m_assembly.hasMiddle()) { >@@ -745,7 +745,7 @@ void MathOperator::paint(const RenderStyle& style, PaintInfo& info, const Layout > buffer.add(glyphData.glyph, glyphData.font, advanceWidthForGlyph(glyphData)); > LayoutPoint operatorTopLeft = paintOffset; > FloatRect glyphBounds = boundsForGlyph(glyphData); >- LayoutPoint operatorOrigin(operatorTopLeft.x(), operatorTopLeft.y() - glyphBounds.y()); >+ LayoutPoint operatorOrigin { operatorTopLeft.x(), LayoutUnit(operatorTopLeft.y() - glyphBounds.y()) }; > paintInfo.context().drawGlyphs(*glyphData.font, buffer, 0, 1, operatorOrigin, style.fontCascade().fontDescription().fontSmoothing()); > } > >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >index 7185a736a80891a919f530895d4766257f5ca5a0..7758efc629f5dd227a016c2962e7e1f98473433e 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp >@@ -75,11 +75,11 @@ static LayoutUnit axisHeight(const RenderStyle& style) > // If we have a MATH table we just return the AxisHeight constant. > const auto& primaryFont = style.fontCascade().primaryFont(); > if (auto* mathData = primaryFont.mathData()) >- return mathData->getMathConstant(primaryFont, OpenTypeMathData::AxisHeight); >+ return LayoutUnit(mathData->getMathConstant(primaryFont, OpenTypeMathData::AxisHeight)); > > // Otherwise, the idea is to try and use the middle of operators as the math axis which we thus approximate by "half of the x-height". > // Note that Gecko has a slower but more accurate version that measures half of the height of U+2212 MINUS SIGN. >- return style.fontMetrics().xHeight() / 2; >+ return LayoutUnit(style.fontMetrics().xHeight() / 2); > } > > LayoutUnit RenderMathMLBlock::mathAxisHeight() const >@@ -145,29 +145,29 @@ LayoutUnit toUserUnits(const MathMLElement::Length& length, const RenderStyle& s > switch (length.type) { > // Zoom for physical units needs to be accounted for. > case MathMLElement::LengthType::Cm: >- return style.effectiveZoom() * length.value * cssPixelsPerInch / 2.54f; >+ return LayoutUnit(style.effectiveZoom() * length.value * cssPixelsPerInch / 2.54f); > case MathMLElement::LengthType::In: >- return style.effectiveZoom() * length.value * cssPixelsPerInch; >+ return LayoutUnit(style.effectiveZoom() * length.value * cssPixelsPerInch); > case MathMLElement::LengthType::Mm: >- return style.effectiveZoom() * length.value * cssPixelsPerInch / 25.4f; >+ return LayoutUnit(style.effectiveZoom() * length.value * cssPixelsPerInch / 25.4f); > case MathMLElement::LengthType::Pc: >- return style.effectiveZoom() * length.value * cssPixelsPerInch / 6; >+ return LayoutUnit(style.effectiveZoom() * length.value * cssPixelsPerInch / 6); > case MathMLElement::LengthType::Pt: >- return style.effectiveZoom() * length.value * cssPixelsPerInch / 72; >+ return LayoutUnit(style.effectiveZoom() * length.value * cssPixelsPerInch / 72); > case MathMLElement::LengthType::Px: >- return style.effectiveZoom() * length.value; >+ return LayoutUnit(style.effectiveZoom() * length.value); > > // Zoom for logical units is accounted for either in the font info or referenceValue. > case MathMLElement::LengthType::Em: >- return length.value * style.fontCascade().size(); >+ return LayoutUnit(length.value * style.fontCascade().size()); > case MathMLElement::LengthType::Ex: >- return length.value * style.fontMetrics().xHeight(); >+ return LayoutUnit(length.value * style.fontMetrics().xHeight()); > case MathMLElement::LengthType::MathUnit: >- return length.value * style.fontCascade().size() / 18; >+ return LayoutUnit(length.value * style.fontCascade().size() / 18); > case MathMLElement::LengthType::Percentage: >- return referenceValue * length.value / 100; >+ return LayoutUnit(referenceValue * length.value / 100); > case MathMLElement::LengthType::UnitLess: >- return referenceValue * length.value; >+ return LayoutUnit(referenceValue * length.value); > case MathMLElement::LengthType::ParsingFailed: > return referenceValue; > case MathMLElement::LengthType::Infinity: >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >index 2d4393b52dffcb821bfd7c94851cd779a19eb740..304660df02a5710047668dc998b9b6e8ead8abfe 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h >@@ -71,7 +71,7 @@ protected: > // This function returns a value for the default rule thickness (TeX's \xi_8) to be used as a fallback when we lack a MATH table. > // This arbitrary value of 0.05em was used in early WebKit MathML implementations for the thickness of the fraction bars. > // Note that Gecko has a slower but more accurate version that measures the thickness of U+00AF MACRON to be more accurate and otherwise fallback to some arbitrary value. >- return 0.05f * style().fontCascade().size(); >+ return LayoutUnit(0.05f * style().fontCascade().size()); > } > > LayoutUnit mathAxisHeight() const; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >index 67907187c2c2315d02a3a4e271ef7b674c3e1874..a45b8842f254a94078b8989fffdf92b9925d046a 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFencedOperator.h >@@ -47,7 +47,7 @@ private: > LayoutUnit trailingSpace() const final; > > // minsize always has the default value "1em". >- LayoutUnit minSize() const final { return style().fontCascade().size(); } >+ LayoutUnit minSize() const final { return LayoutUnit(style().fontCascade().size()); } > > // maxsize always has the default value "infinity". > LayoutUnit maxSize() const final { return intMaxForLayoutUnit; } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >index 8ed6f707a2bfdac1a76c42509396a56987c76c9f..2d0eb3fe25934683c3446a227fd3b207cddf1bc9 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp >@@ -72,7 +72,7 @@ LayoutUnit RenderMathMLFraction::defaultLineThickness() const > { > const auto& primaryFont = style().fontCascade().primaryFont(); > if (const auto* mathData = primaryFont.mathData()) >- return mathData->getMathConstant(primaryFont, OpenTypeMathData::FractionRuleThickness); >+ return LayoutUnit(mathData->getMathConstant(primaryFont, OpenTypeMathData::FractionRuleThickness)); > return ruleThicknessFallback(); > } > >@@ -267,7 +267,7 @@ void RenderMathMLFraction::paint(PaintInfo& info, const LayoutPoint& paintOffset > info.context().setStrokeThickness(thickness); > info.context().setStrokeStyle(SolidStroke); > info.context().setStrokeColor(style().visitedDependentColorWithColorFilter(CSSPropertyColor)); >- info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth(), adjustedPaintOffset.y()))); >+ info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth(), LayoutUnit(adjustedPaintOffset.y())))); > } > > Optional<int> RenderMathMLFraction::firstLineBaseline() const >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp b/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp >index 5e7b2127210fb0856ca4c3a698350abb723b81b5..e7ecd8fcfbc531c4f388f2ee029d7a1b628504ad 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLMenclose.cpp >@@ -59,7 +59,7 @@ RenderMathMLMenclose::RenderMathMLMenclose(MathMLMencloseElement& element, Rende > // See https://bugs.webkit.org/show_bug.cgi?id=122297 > LayoutUnit RenderMathMLMenclose::ruleThickness() const > { >- return 0.05f * style().fontCascade().size(); >+ return LayoutUnit(0.05f * style().fontCascade().size()); > } > > RenderMathMLMenclose::SpaceAroundContent RenderMathMLMenclose::spaceAroundContent(LayoutUnit contentWidth, LayoutUnit contentHeight) const >@@ -139,7 +139,7 @@ RenderMathMLMenclose::SpaceAroundContent RenderMathMLMenclose::spaceAroundConten > // - We add extra margin of \xi_8 > // Then for example the top space is \sqrt{2}contentHeight/2 - contentHeight/2 + \xi_8/2 + \xi_8. > if (hasNotation(MathMLMencloseElement::Circle)) { >- LayoutUnit extraSpace = (contentWidth * (sqrtOfTwoFloat - 1) + 3 * thickness) / 2; >+ LayoutUnit extraSpace { (contentWidth * (sqrtOfTwoFloat - 1) + 3 * thickness) / 2 }; > space.left = std::max(space.left, extraSpace); > space.right = std::max(space.right, extraSpace); > extraSpace = (contentHeight * (sqrtOfTwoFloat - 1) + 3 * thickness) / 2; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >index 16901eddc442526eeefbc2b49fa34819515ae41b..a431e0e7ef259c7dea85de260bb0427073c40276 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp >@@ -100,7 +100,7 @@ LayoutUnit RenderMathMLOperator::trailingSpace() const > > LayoutUnit RenderMathMLOperator::minSize() const > { >- LayoutUnit minSize = style().fontCascade().size(); // Default minsize is "1em". >+ LayoutUnit minSize { style().fontCascade().size() }; // Default minsize is "1em". > minSize = toUserUnits(element().minSize(), style(), minSize); > return std::max<LayoutUnit>(0, minSize); > } >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp >index 923ad8e013af4adb4d496d4dbd227c5be41238f0..0cbeffd6a717fc7723f3cf31495e34a10116313e 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLRoot.cpp >@@ -219,7 +219,7 @@ void RenderMathMLRoot::layoutBlock(bool relayoutChildren, LayoutUnit) > // We can then determine the metrics of the radical operator + the base. > m_radicalOperator.stretchTo(style(), baseAscent + baseDescent); > LayoutUnit radicalOperatorHeight = m_radicalOperator.ascent() + m_radicalOperator.descent(); >- LayoutUnit indexBottomRaise = vertical.degreeBottomRaisePercent * radicalOperatorHeight; >+ LayoutUnit indexBottomRaise { vertical.degreeBottomRaisePercent * radicalOperatorHeight }; > LayoutUnit radicalAscent = baseAscent + vertical.verticalGap + vertical.ruleThickness + vertical.extraAscender; > LayoutUnit radicalDescent = std::max<LayoutUnit>(baseDescent, radicalOperatorHeight + vertical.extraAscender - radicalAscent); > LayoutUnit descent = radicalDescent; >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >index 658399c281d648845122a8e824ea8aac2da9ad3f..5c15eb44a8b9f8910ae8c9bb02011331e7c8c7c3 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp >@@ -158,8 +158,8 @@ LayoutUnit RenderMathMLScripts::spaceAfterScript() > { > const auto& primaryFont = style().fontCascade().primaryFont(); > if (auto* mathData = primaryFont.mathData()) >- return mathData->getMathConstant(primaryFont, OpenTypeMathData::SpaceAfterScript); >- return style().fontCascade().size() / 5; >+ return LayoutUnit(mathData->getMathConstant(primaryFont, OpenTypeMathData::SpaceAfterScript)); >+ return LayoutUnit(style().fontCascade().size() / 5); > } > > LayoutUnit RenderMathMLScripts::italicCorrection(const ReferenceChildren& reference) >diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >index c9c59b823c2205fd226471df37bfa324b4241b2b..7ada2fe82b6d9deab7a42f5ac7bd73d0525d8b64 100644 >--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp >@@ -583,8 +583,8 @@ void RenderMathMLToken::layoutBlock(bool relayoutChildren, LayoutUnit pageLogica > for (auto* child = firstChildBox(); child; child = child->nextSiblingBox()) > child->layoutIfNeeded(); > >- setLogicalWidth(mathVariantGlyph.font->widthForGlyph(mathVariantGlyph.glyph)); >- setLogicalHeight(mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).height()); >+ setLogicalWidth(LayoutUnit(mathVariantGlyph.font->widthForGlyph(mathVariantGlyph.glyph))); >+ setLogicalHeight(LayoutUnit(mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).height())); > > updateScrollInfoAfterLayout(); > >diff --git a/Source/WebCore/rendering/shapes/BoxShape.cpp b/Source/WebCore/rendering/shapes/BoxShape.cpp >index 10cff87a49eda655261748ff1030d7effad6fb15..9c418d1a731babef64e20bfe2b261534b725c746 100644 >--- a/Source/WebCore/rendering/shapes/BoxShape.cpp >+++ b/Source/WebCore/rendering/shapes/BoxShape.cpp >@@ -43,7 +43,7 @@ static inline LayoutUnit adjustRadiusForMarginBoxShape(LayoutUnit radius, Layout > > LayoutUnit ratio = radius / margin; > if (ratio < 1) >- return radius + (margin * (1 + pow(ratio - 1, 3.0))); >+ return LayoutUnit(radius + (margin * (1 + pow(ratio - 1, 3.0)))); > > return radius + margin; > } >diff --git a/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp b/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp >index 25f79e913a9806564f617e6dd1e6207674b47fc7..d4d733912de4f71f1b53b9283699bf5f3013505b 100644 >--- a/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp >+++ b/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp >@@ -337,11 +337,11 @@ ShapeOutsideDeltas ShapeOutsideInfo::computeDeltasForContainingBlockLine(const R > LineSegment segment = computedShape().getExcludedInterval((borderBoxLineTop - logicalTopOffset()), std::min(lineHeight, shapeLogicalBottom() - borderBoxLineTop)); > if (segment.isValid) { > LayoutUnit logicalLeftMargin = containingBlock.style().isLeftToRightDirection() ? containingBlock.marginStartForChild(m_renderer) : containingBlock.marginEndForChild(m_renderer); >- LayoutUnit rawLeftMarginBoxDelta = segment.logicalLeft + logicalLeftOffset() + logicalLeftMargin; >+ LayoutUnit rawLeftMarginBoxDelta { segment.logicalLeft + logicalLeftOffset() + logicalLeftMargin }; > LayoutUnit leftMarginBoxDelta = clampTo<LayoutUnit>(rawLeftMarginBoxDelta, 0_lu, floatMarginBoxWidth); > > LayoutUnit logicalRightMargin = containingBlock.style().isLeftToRightDirection() ? containingBlock.marginEndForChild(m_renderer) : containingBlock.marginStartForChild(m_renderer); >- LayoutUnit rawRightMarginBoxDelta = segment.logicalRight + logicalLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRightMargin; >+ LayoutUnit rawRightMarginBoxDelta { segment.logicalRight + logicalLeftOffset() - containingBlock.logicalWidthForChild(m_renderer) - logicalRightMargin }; > LayoutUnit rightMarginBoxDelta = clampTo<LayoutUnit>(rawRightMarginBoxDelta, -floatMarginBoxWidth, 0_lu); > > m_shapeOutsideDeltas = ShapeOutsideDeltas(leftMarginBoxDelta, rightMarginBoxDelta, true, borderBoxLineTop, lineHeight); >diff --git a/Source/WebCore/rendering/style/CollapsedBorderValue.h b/Source/WebCore/rendering/style/CollapsedBorderValue.h >index ef7607e4497c97a3a922439caa9e796dff495e3b..160bcfaab44eae6407a846f15d96e920bd860a6a 100644 >--- a/Source/WebCore/rendering/style/CollapsedBorderValue.h >+++ b/Source/WebCore/rendering/style/CollapsedBorderValue.h >@@ -72,7 +72,7 @@ private: > inline LayoutUnit CollapsedBorderValue::adjustedCollapsedBorderWidth(float borderWidth, float deviceScaleFactor, bool roundUp) > { > float halfCollapsedBorderWidth = (borderWidth + (roundUp ? (1 / deviceScaleFactor) : 0)) / 2; >- return floorToDevicePixel(halfCollapsedBorderWidth, deviceScaleFactor); >+ return LayoutUnit(floorToDevicePixel(halfCollapsedBorderWidth, deviceScaleFactor)); > } > > } // namespace WebCore >diff --git a/Source/WebCore/rendering/style/NinePieceImage.cpp b/Source/WebCore/rendering/style/NinePieceImage.cpp >index c97795f10a2f5ab13f0761818984eb5964858acd..76286deea4fed8fb74f8217a031723f7ece40296 100644 >--- a/Source/WebCore/rendering/style/NinePieceImage.cpp >+++ b/Source/WebCore/rendering/style/NinePieceImage.cpp >@@ -53,7 +53,7 @@ NinePieceImage::NinePieceImage(RefPtr<StyleImage>&& image, LengthBox imageSlices > LayoutUnit NinePieceImage::computeSlice(Length length, LayoutUnit width, LayoutUnit slice, LayoutUnit extent) > { > if (length.isRelative()) >- return length.value() * width; >+ return LayoutUnit(length.value() * width); > if (length.isAuto()) > return slice; > return valueForLength(length, extent); >@@ -72,17 +72,17 @@ LayoutBoxExtent NinePieceImage::computeSlices(const LayoutSize& size, const Leng > LayoutBoxExtent NinePieceImage::computeSlices(const LayoutSize& size, const LengthBox& lengths, const FloatBoxExtent& widths, const LayoutBoxExtent& slices) > { > return { >- computeSlice(lengths.top(), widths.top(), slices.top(), size.height()), >- computeSlice(lengths.right(), widths.right(), slices.right(), size.width()), >- computeSlice(lengths.bottom(), widths.bottom(), slices.bottom(), size.height()), >- computeSlice(lengths.left(), widths.left(), slices.left(), size.width()) >+ computeSlice(lengths.top(), LayoutUnit(widths.top()), slices.top(), size.height()), >+ computeSlice(lengths.right(), LayoutUnit(widths.right()), slices.right(), size.width()), >+ computeSlice(lengths.bottom(), LayoutUnit(widths.bottom()), slices.bottom(), size.height()), >+ computeSlice(lengths.left(), LayoutUnit(widths.left()), slices.left(), size.width()) > }; > } > > void NinePieceImage::scaleSlicesIfNeeded(const LayoutSize& size, LayoutBoxExtent& slices, float deviceScaleFactor) > { >- LayoutUnit width = std::max<LayoutUnit>(1 / deviceScaleFactor, slices.left() + slices.right()); >- LayoutUnit height = std::max<LayoutUnit>(1 / deviceScaleFactor, slices.top() + slices.bottom()); >+ LayoutUnit width = std::max(LayoutUnit(1 / deviceScaleFactor), slices.left() + slices.right()); >+ LayoutUnit height = std::max(LayoutUnit(1 / deviceScaleFactor), slices.top() + slices.bottom()); > > float sliceScaleFactor = std::min((float)size.width() / width, (float)size.height() / height); > >@@ -120,18 +120,18 @@ Vector<FloatRect> NinePieceImage::computeNineRects(const FloatRect& outer, const > > Vector<FloatRect> rects(MaxPiece); > >- rects[TopLeftPiece] = snapRectToDevicePixels(outer.x(), outer.y(), slices.left(), slices.top(), deviceScaleFactor); >- rects[BottomLeftPiece] = snapRectToDevicePixels(outer.x(), inner.maxY(), slices.left(), slices.bottom(), deviceScaleFactor); >- rects[LeftPiece] = snapRectToDevicePixels(outer.x(), inner.y(), slices.left(), inner.height(), deviceScaleFactor); >+ rects[TopLeftPiece] = snapRectToDevicePixels(LayoutUnit(outer.x()), LayoutUnit(outer.y()), slices.left(), slices.top(), deviceScaleFactor); >+ rects[BottomLeftPiece] = snapRectToDevicePixels(LayoutUnit(outer.x()), LayoutUnit(inner.maxY()), slices.left(), slices.bottom(), deviceScaleFactor); >+ rects[LeftPiece] = snapRectToDevicePixels(LayoutUnit(outer.x()), LayoutUnit(inner.y()), slices.left(), LayoutUnit(inner.height()), deviceScaleFactor); > >- rects[TopRightPiece] = snapRectToDevicePixels(inner.maxX(), outer.y(), slices.right(), slices.top(), deviceScaleFactor); >- rects[BottomRightPiece] = snapRectToDevicePixels(inner.maxX(), inner.maxY(), slices.right(), slices.bottom(), deviceScaleFactor); >- rects[RightPiece] = snapRectToDevicePixels(inner.maxX(), inner.y(), slices.right(), inner.height(), deviceScaleFactor); >+ rects[TopRightPiece] = snapRectToDevicePixels(LayoutUnit(inner.maxX()), LayoutUnit(outer.y()), slices.right(), slices.top(), deviceScaleFactor); >+ rects[BottomRightPiece] = snapRectToDevicePixels(LayoutUnit(inner.maxX()), LayoutUnit(inner.maxY()), slices.right(), slices.bottom(), deviceScaleFactor); >+ rects[RightPiece] = snapRectToDevicePixels(LayoutUnit(inner.maxX()), LayoutUnit(inner.y()), slices.right(), LayoutUnit(inner.height()), deviceScaleFactor); > >- rects[TopPiece] = snapRectToDevicePixels(inner.x(), outer.y(), inner.width(), slices.top(), deviceScaleFactor); >- rects[BottomPiece] = snapRectToDevicePixels(inner.x(), inner.maxY(), inner.width(), slices.bottom(), deviceScaleFactor); >+ rects[TopPiece] = snapRectToDevicePixels(LayoutUnit(inner.x()), LayoutUnit(outer.y()), LayoutUnit(inner.width()), slices.top(), deviceScaleFactor); >+ rects[BottomPiece] = snapRectToDevicePixels(LayoutUnit(inner.x()), LayoutUnit(inner.maxY()), LayoutUnit(inner.width()), slices.bottom(), deviceScaleFactor); > >- rects[MiddlePiece] = snapRectToDevicePixels(inner.x(), inner.y(), inner.width(), inner.height(), deviceScaleFactor); >+ rects[MiddlePiece] = snapRectToDevicePixels(LayoutUnit(inner.x()), LayoutUnit(inner.y()), LayoutUnit(inner.width()), LayoutUnit(inner.height()), deviceScaleFactor); > return rects; > } > >diff --git a/Source/WebCore/rendering/style/NinePieceImage.h b/Source/WebCore/rendering/style/NinePieceImage.h >index daf74964601d47fa362b7122df5638fbfe1f61c8..12a99ba7569be430a3eef401cbdd6847a4944a6f 100644 >--- a/Source/WebCore/rendering/style/NinePieceImage.h >+++ b/Source/WebCore/rendering/style/NinePieceImage.h >@@ -160,8 +160,8 @@ public: > static LayoutUnit computeOutset(const Length& outsetSide, LayoutUnit borderSide) > { > if (outsetSide.isRelative()) >- return outsetSide.value() * borderSide; >- return outsetSide.value(); >+ return LayoutUnit(outsetSide.value() * borderSide); >+ return LayoutUnit(outsetSide.value()); > } > > static LayoutUnit computeSlice(Length, LayoutUnit width, LayoutUnit slice, LayoutUnit extent); >diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp >index feeb708b2fb825c96850e13b4803a94b4067e211..6f64de354290babfd8e5a543730271616195d7f7 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.cpp >+++ b/Source/WebCore/rendering/style/RenderStyle.cpp >@@ -1423,10 +1423,10 @@ RoundedRect RenderStyle::getRoundedBorderFor(const LayoutRect& borderRect, bool > RoundedRect RenderStyle::getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const > { > bool horizontal = isHorizontalWritingMode(); >- auto leftWidth = (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0; >- auto rightWidth = (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0; >- auto topWidth = (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0; >- auto bottomWidth = (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0; >+ LayoutUnit leftWidth { (!horizontal || includeLogicalLeftEdge) ? borderLeftWidth() : 0 }; >+ LayoutUnit rightWidth { (!horizontal || includeLogicalRightEdge) ? borderRightWidth() : 0 }; >+ LayoutUnit topWidth { (horizontal || includeLogicalLeftEdge) ? borderTopWidth() : 0 }; >+ LayoutUnit bottomWidth { (horizontal || includeLogicalRightEdge) ? borderBottomWidth() : 0 }; > return getRoundedInnerBorderFor(borderRect, topWidth, bottomWidth, leftWidth, rightWidth, includeLogicalLeftEdge, includeLogicalRightEdge); > } > >@@ -2127,10 +2127,12 @@ Color RenderStyle::initialTapHighlightColor() > > LayoutBoxExtent RenderStyle::imageOutsets(const NinePieceImage& image) const > { >- return LayoutBoxExtent(NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()), >- NinePieceImage::computeOutset(image.outset().right(), borderRightWidth()), >- NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth()), >- NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth())); >+ return { >+ NinePieceImage::computeOutset(image.outset().top(), LayoutUnit(borderTopWidth())), >+ NinePieceImage::computeOutset(image.outset().right(), LayoutUnit(borderRightWidth())), >+ NinePieceImage::computeOutset(image.outset().bottom(), LayoutUnit(borderBottomWidth())), >+ NinePieceImage::computeOutset(image.outset().left(), LayoutUnit(borderLeftWidth())) >+ }; > } > > std::pair<FontOrientation, NonCJKGlyphOrientation> RenderStyle::fontAndGlyphOrientation() >diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h >index 68576ac4caf2fa7607649cc99aaaf9551c3a65a2..efe1cf831df1ce37c11e3f7e2a08ac173f7d9822 100644 >--- a/Source/WebCore/rendering/style/RenderStyle.h >+++ b/Source/WebCore/rendering/style/RenderStyle.h >@@ -2025,7 +2025,7 @@ inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle& style) > > inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, const RenderStyle& style) > { >- return value / style.effectiveZoom(); >+ return LayoutUnit(value / style.effectiveZoom()); > } > > inline BorderStyle collapsedBorderStyle(BorderStyle style) >diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp >index ebb9eac5dde49fcc68e30c938f40df3ce1858645..10f8eb2d83fc6432cc00fefd18777e1ac7860327 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp >@@ -471,7 +471,7 @@ VisiblePosition RenderSVGText::positionForPoint(const LayoutPoint& pointInConten > if (!closestBox) > return createVisiblePosition(0, DOWNSTREAM); > >- return closestBox->renderer().positionForPoint(LayoutPoint(pointInContents.x(), closestBox->y()), fragment); >+ return closestBox->renderer().positionForPoint({ pointInContents.x(), LayoutUnit(closestBox->y()) }, fragment); > } > > void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const >diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >index 892202151836b91a7f4b91ce918282f4ecc79cef..d0efd8902ac6f8c4b0cd8218f13ebaa55cf31d75 100644 >--- a/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >+++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp >@@ -123,7 +123,7 @@ FloatRect SVGInlineTextBox::selectionRectForTextFragment(const SVGTextFragment& > > textOrigin.move(0, -scaledFontMetrics.floatAscent()); > >- LayoutRect selectionRect = LayoutRect(textOrigin, LayoutSize(0, fragment.height * scalingFactor)); >+ LayoutRect selectionRect { textOrigin, LayoutSize(0, LayoutUnit(fragment.height * scalingFactor)) }; > TextRun run = constructTextRun(style, fragment); > scaledFont.adjustSelectionRectForText(run, selectionRect, startPosition, endPosition); > FloatRect snappedSelectionRect = snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 93301cc50cacbc3603e77f0123989ac7aff5a340..cfef3180c8cf46a48f72b0d9c9a5642ffc4fe8f4 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -5922,8 +5922,8 @@ void WebPage::determinePrimarySnapshottedPlugIn() > IntRect elementRectRelativeToView = element->clientRect(); > IntRect elementRectRelativeToTopDocument(elementRectRelativeToView.location() + scrollPosition, elementRectRelativeToView.size()); > LayoutRect inflatedPluginRect = plugInRectRelativeToTopDocument; >- LayoutUnit xOffset = (inflatedPluginRect.width() * overlappingImageBoundsScale - inflatedPluginRect.width()) / 2; >- LayoutUnit yOffset = (inflatedPluginRect.height() * overlappingImageBoundsScale - inflatedPluginRect.height()) / 2; >+ LayoutUnit xOffset { (inflatedPluginRect.width() * overlappingImageBoundsScale - inflatedPluginRect.width()) / 2 }; >+ LayoutUnit yOffset { (inflatedPluginRect.height() * overlappingImageBoundsScale - inflatedPluginRect.height()) / 2 }; > inflatedPluginRect.inflateX(xOffset); > inflatedPluginRect.inflateY(yOffset); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191811
:
355205
|
355215
|
355219
|
355220
|
355221
|
355222
|
355317
|
355318
|
355321
|
355445
|
355537
|
355553
|
355556
|
358535
|
370273
|
370288