| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); | 549 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); |
| 550 afterSlash->append(*valueForFillSize(currLayer->size(), style)); | 550 afterSlash->append(*valueForFillSize(currLayer->size(), style)); |
| 551 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin())); | 551 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin())); |
| 552 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip())); | 552 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip())); |
| 553 list->append(*afterSlash); | 553 list->append(*afterSlash); |
| 554 ret->append(*list); | 554 ret->append(*list); |
| 555 } | 555 } |
| 556 return ret; | 556 return ret; |
| 557 } | 557 } |
| 558 | 558 |
| 559 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment
(const StyleContentAlignmentData& data) | 559 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment
(const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID) |
| 560 { | 560 { |
| 561 CSSValueList* result = CSSValueList::createSpaceSeparated(); | 561 CSSValueList* result = CSSValueList::createSpaceSeparated(); |
| 562 if (data.distribution() != ContentDistributionDefault) | 562 if (data.distribution() != ContentDistributionDefault) |
| 563 result->append(*CSSPrimitiveValue::create(data.distribution())); | 563 result->append(*CSSPrimitiveValue::create(data.distribution())); |
| 564 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionNormal) | 564 if (data.distribution() == ContentDistributionDefault || data.position() !=
ContentPositionNormal) { |
| 565 result->append(*CSSPrimitiveValue::create(data.position())); | 565 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && data.position() =
= ContentPositionNormal) |
| 566 result->append(*CSSPrimitiveValue::createIdentifier(normalBehaviorVa
lueID)); |
| 567 else |
| 568 result->append(*CSSPrimitiveValue::create(data.position())); |
| 569 } |
| 566 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) | 570 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont
entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) |
| 567 result->append(*CSSPrimitiveValue::create(data.overflow())); | 571 result->append(*CSSPrimitiveValue::create(data.overflow())); |
| 568 ASSERT(result->length() > 0); | 572 ASSERT(result->length() > 0); |
| 569 ASSERT(result->length() <= 3); | 573 ASSERT(result->length() <= 3); |
| 570 return result; | 574 return result; |
| 571 } | 575 } |
| 572 | 576 |
| 573 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) | 577 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) |
| 574 { | 578 { |
| 575 Length length = style.lineHeight(); | 579 Length length = style.lineHeight(); |
| (...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1873 } | 1877 } |
| 1874 return value; | 1878 return value; |
| 1875 } | 1879 } |
| 1876 case CSSPropertyDirection: | 1880 case CSSPropertyDirection: |
| 1877 return CSSPrimitiveValue::create(style.direction()); | 1881 return CSSPrimitiveValue::create(style.direction()); |
| 1878 case CSSPropertyDisplay: | 1882 case CSSPropertyDisplay: |
| 1879 return CSSPrimitiveValue::create(style.display()); | 1883 return CSSPrimitiveValue::create(style.display()); |
| 1880 case CSSPropertyEmptyCells: | 1884 case CSSPropertyEmptyCells: |
| 1881 return CSSPrimitiveValue::create(style.emptyCells()); | 1885 return CSSPrimitiveValue::create(style.emptyCells()); |
| 1882 case CSSPropertyAlignContent: | 1886 case CSSPropertyAlignContent: |
| 1883 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.alignContent()); | 1887 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.alignContent(), CSSValueStretch); |
| 1884 case CSSPropertyAlignItems: | 1888 case CSSPropertyAlignItems: |
| 1885 return valueForItemPositionWithOverflowAlignment(style.alignItems()); | 1889 return valueForItemPositionWithOverflowAlignment(style.alignItems()); |
| 1886 case CSSPropertyAlignSelf: | 1890 case CSSPropertyAlignSelf: |
| 1887 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); | 1891 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); |
| 1888 case CSSPropertyFlex: | 1892 case CSSPropertyFlex: |
| 1889 return valuesForShorthandProperty(flexShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); | 1893 return valuesForShorthandProperty(flexShorthand(), style, layoutObject,
styledNode, allowVisitedStyle); |
| 1890 case CSSPropertyFlexBasis: | 1894 case CSSPropertyFlexBasis: |
| 1891 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); | 1895 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); |
| 1892 case CSSPropertyFlexDirection: | 1896 case CSSPropertyFlexDirection: |
| 1893 return CSSPrimitiveValue::create(style.flexDirection()); | 1897 return CSSPrimitiveValue::create(style.flexDirection()); |
| 1894 case CSSPropertyFlexFlow: | 1898 case CSSPropertyFlexFlow: |
| 1895 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); | 1899 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje
ct, styledNode, allowVisitedStyle); |
| 1896 case CSSPropertyFlexGrow: | 1900 case CSSPropertyFlexGrow: |
| 1897 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un
itType::Number); | 1901 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un
itType::Number); |
| 1898 case CSSPropertyFlexShrink: | 1902 case CSSPropertyFlexShrink: |
| 1899 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue::
UnitType::Number); | 1903 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue::
UnitType::Number); |
| 1900 case CSSPropertyFlexWrap: | 1904 case CSSPropertyFlexWrap: |
| 1901 return CSSPrimitiveValue::create(style.flexWrap()); | 1905 return CSSPrimitiveValue::create(style.flexWrap()); |
| 1902 case CSSPropertyJustifyContent: | 1906 case CSSPropertyJustifyContent: |
| 1903 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.justifyContent()); | 1907 return valueForContentPositionAndDistributionWithOverflowAlignment(style
.justifyContent(), CSSValueFlexStart); |
| 1904 case CSSPropertyOrder: | 1908 case CSSPropertyOrder: |
| 1905 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT
ype::Number); | 1909 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT
ype::Number); |
| 1906 case CSSPropertyFloat: | 1910 case CSSPropertyFloat: |
| 1907 if (style.display() != NONE && style.hasOutOfFlowPosition()) | 1911 if (style.display() != NONE && style.hasOutOfFlowPosition()) |
| 1908 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 1912 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 1909 return CSSPrimitiveValue::create(style.floating()); | 1913 return CSSPrimitiveValue::create(style.floating()); |
| 1910 case CSSPropertyFont: | 1914 case CSSPropertyFont: |
| 1911 return valueForFont(style); | 1915 return valueForFont(style); |
| 1912 case CSSPropertyFontFamily: | 1916 case CSSPropertyFontFamily: |
| 1913 return valueForFontFamily(style); | 1917 return valueForFontFamily(style); |
| (...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3002 case CSSPropertyAll: | 3006 case CSSPropertyAll: |
| 3003 return nullptr; | 3007 return nullptr; |
| 3004 default: | 3008 default: |
| 3005 break; | 3009 break; |
| 3006 } | 3010 } |
| 3007 ASSERT_NOT_REACHED(); | 3011 ASSERT_NOT_REACHED(); |
| 3008 return nullptr; | 3012 return nullptr; |
| 3009 } | 3013 } |
| 3010 | 3014 |
| 3011 } // namespace blink | 3015 } // namespace blink |
| OLD | NEW |