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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moar tweaks! Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 virtual int borderAfter() const { return style()->borderAfterWidth(); } 211 virtual int borderAfter() const { return style()->borderAfterWidth(); }
212 virtual int borderStart() const { return style()->borderStartWidth(); } 212 virtual int borderStart() const { return style()->borderStartWidth(); }
213 virtual int borderEnd() const { return style()->borderEndWidth(); } 213 virtual int borderEnd() const { return style()->borderEndWidth(); }
214 int borderOver() const { return style()->borderOverWidth(); } 214 int borderOver() const { return style()->borderOverWidth(); }
215 int borderUnder() const { return style()->borderUnderWidth(); } 215 int borderUnder() const { return style()->borderUnderWidth(); }
216 216
217 int borderWidth() const { return borderLeft() + borderRight(); } 217 int borderWidth() const { return borderLeft() + borderRight(); }
218 int borderHeight() const { return borderTop() + borderBottom(); } 218 int borderHeight() const { return borderTop() + borderBottom(); }
219 219
220 // Insets from the border box to the inside of the border. 220 // Insets from the border box to the inside of the border.
221 LayoutRectOutsets borderInsets() const { return LayoutRectOutsets(-borderTop (), -borderRight(), -borderBottom(), -borderLeft()); } 221 LayoutRectOutsets borderInsets() const { return LayoutRectOutsets(LayoutUnit (-borderTop()), LayoutUnit(-borderRight()), LayoutUnit(-borderBottom()), LayoutU nit(-borderLeft())); }
eae 2016/01/29 03:38:12 How about adding a LayoutRectOutset constructor th
leviw_travelin_and_unemployed 2016/01/29 03:47:27 Sure.
222 222
223 bool hasBorderOrPadding() const { return style()->hasBorder() || style()->ha sPadding(); } 223 bool hasBorderOrPadding() const { return style()->hasBorder() || style()->ha sPadding(); }
224 224
225 LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingSta rt(); } 225 LayoutUnit borderAndPaddingStart() const { return borderStart() + paddingSta rt(); }
226 LayoutUnit borderAndPaddingBefore() const { return borderBefore() + paddingB efore(); } 226 LayoutUnit borderAndPaddingBefore() const { return borderBefore() + paddingB efore(); }
227 LayoutUnit borderAndPaddingAfter() const { return borderAfter() + paddingAft er(); } 227 LayoutUnit borderAndPaddingAfter() const { return borderAfter() + paddingAft er(); }
228 LayoutUnit borderAndPaddingOver() const { return borderOver() + paddingOver( ); } 228 LayoutUnit borderAndPaddingOver() const { return borderOver() + paddingOver( ); }
229 LayoutUnit borderAndPaddingUnder() const { return borderUnder() + paddingUnd er(); } 229 LayoutUnit borderAndPaddingUnder() const { return borderUnder() + paddingUnd er(); }
230 230
231 LayoutUnit borderAndPaddingHeight() const { return borderTop() + borderBotto m() + paddingTop() + paddingBottom(); } 231 LayoutUnit borderAndPaddingHeight() const { return borderTop() + borderBotto m() + paddingTop() + paddingBottom(); }
232 LayoutUnit borderAndPaddingWidth() const { return borderLeft() + borderRight () + paddingLeft() + paddingRight(); } 232 LayoutUnit borderAndPaddingWidth() const { return borderLeft() + borderRight () + paddingLeft() + paddingRight(); }
233 LayoutUnit borderAndPaddingLogicalHeight() const { return hasBorderOrPadding () ? borderAndPaddingBefore() + borderAndPaddingAfter() : LayoutUnit(); } 233 LayoutUnit borderAndPaddingLogicalHeight() const { return hasBorderOrPadding () ? borderAndPaddingBefore() + borderAndPaddingAfter() : LayoutUnit(); }
234 LayoutUnit borderAndPaddingLogicalWidth() const { return borderStart() + bor derEnd() + paddingStart() + paddingEnd(); } 234 LayoutUnit borderAndPaddingLogicalWidth() const { return borderStart() + bor derEnd() + paddingStart() + paddingEnd(); }
235 LayoutUnit borderAndPaddingLogicalLeft() const { return style()->isHorizonta lWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } 235 LayoutUnit borderAndPaddingLogicalLeft() const { return style()->isHorizonta lWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
236 236
237 LayoutUnit borderLogicalLeft() const { return style()->isHorizontalWritingMo de() ? borderLeft() : borderTop(); } 237 LayoutUnit borderLogicalLeft() const { return LayoutUnit(style()->isHorizont alWritingMode() ? borderLeft() : borderTop()); }
238 238
239 LayoutUnit paddingLogicalWidth() const { return paddingStart() + paddingEnd( ); } 239 LayoutUnit paddingLogicalWidth() const { return paddingStart() + paddingEnd( ); }
240 LayoutUnit paddingLogicalHeight() const { return paddingBefore() + paddingAf ter(); } 240 LayoutUnit paddingLogicalHeight() const { return paddingBefore() + paddingAf ter(); }
241 241
242 virtual LayoutRectOutsets marginBoxOutsets() const = 0; 242 virtual LayoutRectOutsets marginBoxOutsets() const = 0;
243 virtual LayoutUnit marginTop() const = 0; 243 virtual LayoutUnit marginTop() const = 0;
244 virtual LayoutUnit marginBottom() const = 0; 244 virtual LayoutUnit marginBottom() const = 0;
245 virtual LayoutUnit marginLeft() const = 0; 245 virtual LayoutUnit marginLeft() const = 0;
246 virtual LayoutUnit marginRight() const = 0; 246 virtual LayoutUnit marginRight() const = 0;
247 virtual LayoutUnit marginBefore(const ComputedStyle* otherStyle = nullptr) c onst = 0; 247 virtual LayoutUnit marginBefore(const ComputedStyle* otherStyle = nullptr) c onst = 0;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // The PaintLayer associated with this object. 366 // The PaintLayer associated with this object.
367 // |m_layer| can be nullptr depending on the return value of layerTypeRequir ed(). 367 // |m_layer| can be nullptr depending on the return value of layerTypeRequir ed().
368 OwnPtr<PaintLayer> m_layer; 368 OwnPtr<PaintLayer> m_layer;
369 }; 369 };
370 370
371 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject()); 371 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, isBoxModelObject());
372 372
373 } // namespace blink 373 } // namespace blink
374 374
375 #endif // LayoutBoxModelObject_h 375 #endif // LayoutBoxModelObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698