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

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

Issue 2261663002: Disallow cast/implicit conversion from LayoutUnit to int/unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserv ed. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserv ed.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 // The collapsing border model dissallows paddings on table, which is why we 293 // The collapsing border model dissallows paddings on table, which is why we
294 // override those functions. 294 // override those functions.
295 // See http://www.w3.org/TR/CSS2/tables.html#collapsing-borders. 295 // See http://www.w3.org/TR/CSS2/tables.html#collapsing-borders.
296 LayoutUnit paddingTop() const override; 296 LayoutUnit paddingTop() const override;
297 LayoutUnit paddingBottom() const override; 297 LayoutUnit paddingBottom() const override;
298 LayoutUnit paddingLeft() const override; 298 LayoutUnit paddingLeft() const override;
299 LayoutUnit paddingRight() const override; 299 LayoutUnit paddingRight() const override;
300 300
301 // Override paddingStart/End to return pixel values to match behavor of Layo utTableCell. 301 // Override paddingStart/End to return pixel values to match behavor of Layo utTableCell.
302 LayoutUnit paddingEnd() const override { return LayoutUnit(static_cast<int>( LayoutBlock::paddingEnd())); } 302 LayoutUnit paddingEnd() const override { return LayoutUnit(LayoutBlock::padd ingEnd().toInt()); }
303 LayoutUnit paddingStart() const override { return LayoutUnit(static_cast<int >(LayoutBlock::paddingStart())); } 303 LayoutUnit paddingStart() const override { return LayoutUnit(LayoutBlock::pa ddingStart().toInt()); }
304 304
305 LayoutUnit bordersPaddingAndSpacingInRowDirection() const 305 LayoutUnit bordersPaddingAndSpacingInRowDirection() const
306 { 306 {
307 // 'border-spacing' only applies to separate borders (see 17.6.1 The sep arated borders model). 307 // 'border-spacing' only applies to separate borders (see 17.6.1 The sep arated borders model).
308 return borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : (paddingStart() + paddingEnd() + borderSpacingInRowDirection())); 308 return borderStart() + borderEnd() + (collapseBorders() ? LayoutUnit() : (paddingStart() + paddingEnd() + borderSpacingInRowDirection()));
309 } 309 }
310 310
311 // Return the first column or column-group. 311 // Return the first column or column-group.
312 LayoutTableCol* firstColumn() const; 312 LayoutTableCol* firstColumn() const;
313 313
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 if (m_firstBody) 516 if (m_firstBody)
517 return m_firstBody; 517 return m_firstBody;
518 return m_foot; 518 return m_foot;
519 } 519 }
520 520
521 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, isTable()); 521 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, isTable());
522 522
523 } // namespace blink 523 } // namespace blink
524 524
525 #endif // LayoutTable_h 525 #endif // LayoutTable_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutSlider.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698