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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 200023002: Making LayoutUnit conversions to Float type explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to trunk Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 } 2048 }
2049 case CSSPropertyMarginRight: { 2049 case CSSPropertyMarginRight: {
2050 Length marginRight = style->marginRight(); 2050 Length marginRight = style->marginRight();
2051 if (marginRight.isFixed() || !renderer || !renderer->isBox()) 2051 if (marginRight.isFixed() || !renderer || !renderer->isBox())
2052 return zoomAdjustedPixelValueForLength(marginRight, *style); 2052 return zoomAdjustedPixelValueForLength(marginRight, *style);
2053 float value; 2053 float value;
2054 if (marginRight.isPercent()) { 2054 if (marginRight.isPercent()) {
2055 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box 2055 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
2056 // and the right-edge of the containing box, when display == BLO CK. Let's calculate the absolute 2056 // and the right-edge of the containing box, when display == BLO CK. Let's calculate the absolute
2057 // value of the specified margin-right % instead of relying on R enderBox's marginRight() value. 2057 // value of the specified margin-right % instead of relying on R enderBox's marginRight() value.
2058 value = minimumValueForLength(marginRight, toRenderBox(renderer) ->containingBlockLogicalWidthForContent()); 2058 value = minimumValueForLength(marginRight, toRenderBox(renderer) ->containingBlockLogicalWidthForContent()).toFloat();
2059 } else { 2059 } else {
2060 value = toRenderBox(renderer)->marginRight(); 2060 value = toRenderBox(renderer)->marginRight().toFloat();
2061 } 2061 }
2062 return zoomAdjustedPixelValue(value, *style); 2062 return zoomAdjustedPixelValue(value, *style);
2063 } 2063 }
2064 case CSSPropertyMarginBottom: { 2064 case CSSPropertyMarginBottom: {
2065 Length marginBottom = style->marginBottom(); 2065 Length marginBottom = style->marginBottom();
2066 if (marginBottom.isFixed() || !renderer || !renderer->isBox()) 2066 if (marginBottom.isFixed() || !renderer || !renderer->isBox())
2067 return zoomAdjustedPixelValueForLength(marginBottom, *style); 2067 return zoomAdjustedPixelValueForLength(marginBottom, *style);
2068 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), *style); 2068 return zoomAdjustedPixelValue(toRenderBox(renderer)->marginBottom(), *style);
2069 } 2069 }
2070 case CSSPropertyMarginLeft: { 2070 case CSSPropertyMarginLeft: {
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
3042 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3042 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3043 CSSPropertyB ackgroundClip }; 3043 CSSPropertyB ackgroundClip };
3044 3044
3045 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ; 3045 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ;
3046 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3046 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3047 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3047 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3048 return list.release(); 3048 return list.release();
3049 } 3049 }
3050 3050
3051 } // namespace WebCore 3051 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698