Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove int constructors for size/point... they result in incorrect conversions until LayoutUnit is … Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index 2dd9f946f312fc51eb137ed7250b1c6e85d614d8..05df8d3b96193fc69183ffab4b6a5b4d2fcc338b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -56,7 +56,7 @@ public:
: m_spannerPlaceholder(nullptr)
, m_overrideLogicalContentHeight(-1)
, m_overrideLogicalContentWidth(-1)
- , m_previousBorderBoxSize(-1, -1)
+ , m_previousBorderBoxSize(LayoutUnit(-1), LayoutUnit(-1))
, m_percentHeightContainer(nullptr)
{
}
@@ -319,7 +319,7 @@ public:
// Note that those functions have their origin at this box's CSS border box.
// As such their location doesn't account for 'top'/'left'.
LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
- LayoutRect paddingBoxRect() const { return LayoutRect(borderLeft(), borderTop(), clientWidth(), clientHeight()); }
+ LayoutRect paddingBoxRect() const { return LayoutRect(LayoutUnit(borderLeft()), LayoutUnit(borderTop()), clientWidth(), clientHeight()); }
IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); }
IntRect borderBoundingBox() const final { return pixelSnappedBorderBoxRect(); }
@@ -401,8 +401,8 @@ public:
// More IE extensions. clientWidth and clientHeight represent the interior of an object
// excluding border and scrollbar. clientLeft/Top are just the borderLeftWidth and borderTopWidth.
- LayoutUnit clientLeft() const { return borderLeft() + (shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0); }
- LayoutUnit clientTop() const { return borderTop(); }
+ LayoutUnit clientLeft() const { return LayoutUnit(borderLeft() + (shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0)); }
+ LayoutUnit clientTop() const { return LayoutUnit(borderTop()); }
LayoutUnit clientWidth() const;
LayoutUnit clientHeight() const;
LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); }
@@ -482,7 +482,10 @@ public:
virtual bool isSelfCollapsingBlock() const { return false; }
virtual LayoutUnit collapsedMarginBefore() const { return marginBefore(); }
virtual LayoutUnit collapsedMarginAfter() const { return marginAfter(); }
- LayoutRectOutsets collapsedMarginBoxLogicalOutsets() const { return LayoutRectOutsets(collapsedMarginBefore(), 0, collapsedMarginAfter(), 0); }
+ LayoutRectOutsets collapsedMarginBoxLogicalOutsets() const
+ {
+ return LayoutRectOutsets(collapsedMarginBefore(), LayoutUnit(), collapsedMarginAfter(), LayoutUnit());
+ }
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698