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

Side by Side Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2370673002: Changed EDisplay to an enum class and renamed its members to be keywords (Closed)
Patch Set: Renamed members Created 4 years, 2 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) 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 * Copyright (C) 2015 Google Inc. All rights reserved. 7 * Copyright (C) 2015 Google Inc. All rights reserved.
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 Lesser General Public 10 * modify it under the terms of the GNU Lesser General Public
(...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number); 1924 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number);
1925 case CSSPropertyFlexShrink: 1925 case CSSPropertyFlexShrink:
1926 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number); 1926 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number);
1927 case CSSPropertyFlexWrap: 1927 case CSSPropertyFlexWrap:
1928 return CSSPrimitiveValue::create(style.flexWrap()); 1928 return CSSPrimitiveValue::create(style.flexWrap());
1929 case CSSPropertyJustifyContent: 1929 case CSSPropertyJustifyContent:
1930 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent(), CSSValueFlexStart); 1930 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent(), CSSValueFlexStart);
1931 case CSSPropertyOrder: 1931 case CSSPropertyOrder:
1932 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number); 1932 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number);
1933 case CSSPropertyFloat: 1933 case CSSPropertyFloat:
1934 if (style.display() != NONE && style.hasOutOfFlowPosition()) 1934 if (style.display() != EDisplay::None && style.hasOutOfFlowPosition())
1935 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1935 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
1936 return CSSPrimitiveValue::create(style.floating()); 1936 return CSSPrimitiveValue::create(style.floating());
1937 case CSSPropertyFont: 1937 case CSSPropertyFont:
1938 return valueForFont(style); 1938 return valueForFont(style);
1939 case CSSPropertyFontFamily: 1939 case CSSPropertyFontFamily:
1940 return valueForFontFamily(style); 1940 return valueForFontFamily(style);
1941 case CSSPropertyFontSize: 1941 case CSSPropertyFontSize:
1942 return valueForFontSize(style); 1942 return valueForFontSize(style);
1943 case CSSPropertyFontSizeAdjust: 1943 case CSSPropertyFontSizeAdjust:
1944 if (style.hasFontSizeAdjust()) 1944 if (style.hasFontSizeAdjust())
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 return zoomAdjustedPixelValueForLength(marginTop, style); 2099 return zoomAdjustedPixelValueForLength(marginTop, style);
2100 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st yle); 2100 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st yle);
2101 } 2101 }
2102 case CSSPropertyMarginRight: { 2102 case CSSPropertyMarginRight: {
2103 Length marginRight = style.marginRight(); 2103 Length marginRight = style.marginRight();
2104 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) 2104 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox())
2105 return zoomAdjustedPixelValueForLength(marginRight, style); 2105 return zoomAdjustedPixelValueForLength(marginRight, style);
2106 float value; 2106 float value;
2107 if (marginRight.isPercentOrCalc()) { 2107 if (marginRight.isPercentOrCalc()) {
2108 // LayoutBox gives a marginRight() that is the distance between the right-edge of the child box 2108 // LayoutBox gives a marginRight() that is the distance between the right-edge of the child box
2109 // and the right-edge of the containing box, when display == BLOCK. Let's calculate the absolute 2109 // and the right-edge of the containing box, when display == EDispla y::Block. Let's calculate the absolute
2110 // value of the specified margin-right % instead of relying on Layou tBox's marginRight() value. 2110 // value of the specified margin-right % instead of relying on Layou tBox's marginRight() value.
2111 value = minimumValueForLength(marginRight, toLayoutBox(layoutObject) ->containingBlockLogicalWidthForContent()).toFloat(); 2111 value = minimumValueForLength(marginRight, toLayoutBox(layoutObject) ->containingBlockLogicalWidthForContent()).toFloat();
2112 } else { 2112 } else {
2113 value = toLayoutBox(layoutObject)->marginRight().toFloat(); 2113 value = toLayoutBox(layoutObject)->marginRight().toFloat();
2114 } 2114 }
2115 return zoomAdjustedPixelValue(value, style); 2115 return zoomAdjustedPixelValue(value, style);
2116 } 2116 }
2117 case CSSPropertyMarginBottom: { 2117 case CSSPropertyMarginBottom: {
2118 Length marginBottom = style.marginBottom(); 2118 Length marginBottom = style.marginBottom();
2119 if (marginBottom.isFixed() || !layoutObject || !layoutObject->isBox()) 2119 if (marginBottom.isFixed() || !layoutObject || !layoutObject->isBox())
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
3034 case CSSPropertyAll: 3034 case CSSPropertyAll:
3035 return nullptr; 3035 return nullptr;
3036 default: 3036 default:
3037 break; 3037 break;
3038 } 3038 }
3039 ASSERT_NOT_REACHED(); 3039 ASSERT_NOT_REACHED();
3040 return nullptr; 3040 return nullptr;
3041 } 3041 }
3042 3042
3043 } // namespace blink 3043 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698