OLD | NEW |
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 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un
itType::Number); | 1927 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un
itType::Number); |
1928 case CSSPropertyFlexShrink: | 1928 case CSSPropertyFlexShrink: |
1929 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue::
UnitType::Number); | 1929 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue::
UnitType::Number); |
1930 case CSSPropertyFlexWrap: | 1930 case CSSPropertyFlexWrap: |
1931 return CSSPrimitiveValue::create(style.flexWrap()); | 1931 return CSSPrimitiveValue::create(style.flexWrap()); |
1932 case CSSPropertyJustifyContent: | 1932 case CSSPropertyJustifyContent: |
1933 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.justifyContent(), CSSValueFlexStart); | 1933 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.justifyContent(), CSSValueFlexStart); |
1934 case CSSPropertyOrder: | 1934 case CSSPropertyOrder: |
1935 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT
ype::Number); | 1935 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT
ype::Number); |
1936 case CSSPropertyFloat: | 1936 case CSSPropertyFloat: |
1937 if (style.display() != NONE && style.hasOutOfFlowPosition()) | 1937 if (style.display() != EDisplay::None && style.hasOutOfFlowPosition()) |
1938 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1938 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
1939 return CSSPrimitiveValue::create(style.floating()); | 1939 return CSSPrimitiveValue::create(style.floating()); |
1940 case CSSPropertyFont: | 1940 case CSSPropertyFont: |
1941 return valueForFont(style); | 1941 return valueForFont(style); |
1942 case CSSPropertyFontFamily: | 1942 case CSSPropertyFontFamily: |
1943 return valueForFontFamily(style); | 1943 return valueForFontFamily(style); |
1944 case CSSPropertyFontSize: | 1944 case CSSPropertyFontSize: |
1945 return valueForFontSize(style); | 1945 return valueForFontSize(style); |
1946 case CSSPropertyFontSizeAdjust: | 1946 case CSSPropertyFontSizeAdjust: |
1947 if (style.hasFontSizeAdjust()) | 1947 if (style.hasFontSizeAdjust()) |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2102 return zoomAdjustedPixelValueForLength(marginTop, style); | 2102 return zoomAdjustedPixelValueForLength(marginTop, style); |
2103 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); | 2103 return zoomAdjustedPixelValue(toLayoutBox(layoutObject)->marginTop(), st
yle); |
2104 } | 2104 } |
2105 case CSSPropertyMarginRight: { | 2105 case CSSPropertyMarginRight: { |
2106 Length marginRight = style.marginRight(); | 2106 Length marginRight = style.marginRight(); |
2107 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) | 2107 if (marginRight.isFixed() || !layoutObject || !layoutObject->isBox()) |
2108 return zoomAdjustedPixelValueForLength(marginRight, style); | 2108 return zoomAdjustedPixelValueForLength(marginRight, style); |
2109 float value; | 2109 float value; |
2110 if (marginRight.isPercentOrCalc()) { | 2110 if (marginRight.isPercentOrCalc()) { |
2111 // LayoutBox gives a marginRight() that is the distance between the
right-edge of the child box | 2111 // LayoutBox gives a marginRight() that is the distance between the
right-edge of the child box |
2112 // and the right-edge of the containing box, when display == BLOCK.
Let's calculate the absolute | 2112 // and the right-edge of the containing box, when display == EDispla
y::Block. Let's calculate the absolute |
2113 // value of the specified margin-right % instead of relying on Layou
tBox's marginRight() value. | 2113 // value of the specified margin-right % instead of relying on Layou
tBox's marginRight() value. |
2114 value = minimumValueForLength(marginRight, toLayoutBox(layoutObject)
->containingBlockLogicalWidthForContent()).toFloat(); | 2114 value = minimumValueForLength(marginRight, toLayoutBox(layoutObject)
->containingBlockLogicalWidthForContent()).toFloat(); |
2115 } else { | 2115 } else { |
2116 value = toLayoutBox(layoutObject)->marginRight().toFloat(); | 2116 value = toLayoutBox(layoutObject)->marginRight().toFloat(); |
2117 } | 2117 } |
2118 return zoomAdjustedPixelValue(value, style); | 2118 return zoomAdjustedPixelValue(value, style); |
2119 } | 2119 } |
2120 case CSSPropertyMarginBottom: { | 2120 case CSSPropertyMarginBottom: { |
2121 Length marginBottom = style.marginBottom(); | 2121 Length marginBottom = style.marginBottom(); |
2122 if (marginBottom.isFixed() || !layoutObject || !layoutObject->isBox()) | 2122 if (marginBottom.isFixed() || !layoutObject || !layoutObject->isBox()) |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3037 case CSSPropertyAll: | 3037 case CSSPropertyAll: |
3038 return nullptr; | 3038 return nullptr; |
3039 default: | 3039 default: |
3040 break; | 3040 break; |
3041 } | 3041 } |
3042 ASSERT_NOT_REACHED(); | 3042 ASSERT_NOT_REACHED(); |
3043 return nullptr; | 3043 return nullptr; |
3044 } | 3044 } |
3045 | 3045 |
3046 } // namespace blink | 3046 } // namespace blink |
OLD | NEW |