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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutReplaced.cpp

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, 4 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 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 // Solve for 'margin-right' 314 // Solve for 'margin-right'
315 marginLogicalRightAlias = availableSpace - (logicalLeftValue + logicalRi ghtValue + marginLogicalLeftAlias); 315 marginLogicalRightAlias = availableSpace - (logicalLeftValue + logicalRi ghtValue + marginLogicalLeftAlias);
316 } else { 316 } else {
317 // Nothing is 'auto', just calculate the values. 317 // Nothing is 'auto', just calculate the values.
318 marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRela tiveLogicalWidth); 318 marginLogicalLeftAlias = valueForLength(marginLogicalLeft, containerRela tiveLogicalWidth);
319 marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRe lativeLogicalWidth); 319 marginLogicalRightAlias = valueForLength(marginLogicalRight, containerRe lativeLogicalWidth);
320 logicalRightValue = valueForLength(logicalRight, containerLogicalWidth); 320 logicalRightValue = valueForLength(logicalRight, containerLogicalWidth);
321 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth); 321 logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
322 // If the containing block is right-to-left, then push the left position as far to the right as possible 322 // If the containing block is right-to-left, then push the left position as far to the right as possible
323 if (containerDirection == RTL) { 323 if (containerDirection == RTL) {
324 int totalLogicalWidth = computedValues.m_extent + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias; 324 int totalLogicalWidth = (computedValues.m_extent + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias).toInt() ;
325 logicalLeftValue = containerLogicalWidth - (totalLogicalWidth - logi calLeftValue); 325 logicalLeftValue = containerLogicalWidth - (totalLogicalWidth - logi calLeftValue);
326 } 326 }
327 } 327 }
328 328
329 /*-----------------------------------------------------------------------*\ 329 /*-----------------------------------------------------------------------*\
330 * 6. If at this point the values are over-constrained, ignore the value 330 * 6. If at this point the values are over-constrained, ignore the value
331 * for either 'left' (in case the 'direction' property of the 331 * for either 'left' (in case the 'direction' property of the
332 * containing block is 'rtl') or 'right' (in case 'direction' is 332 * containing block is 'rtl') or 'right' (in case 'direction' is
333 * 'ltr') and solve for that value. 333 * 'ltr') and solve for that value.
334 \*-----------------------------------------------------------------------*/ 334 \*-----------------------------------------------------------------------*/
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 } 760 }
761 761
762 void LayoutReplaced::IntrinsicSizingInfo::transpose() 762 void LayoutReplaced::IntrinsicSizingInfo::transpose()
763 { 763 {
764 size = size.transposedSize(); 764 size = size.transposedSize();
765 aspectRatio = aspectRatio.transposedSize(); 765 aspectRatio = aspectRatio.transposedSize();
766 std::swap(hasWidth, hasHeight); 766 std::swap(hasWidth, hasHeight);
767 } 767 }
768 768
769 } // namespace blink 769 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698