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

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

Issue 2348273002: [css-align] Initial value of align-content should be 'stretch'. (Closed)
Patch Set: Added layout test based on the test case in the bug report. Created 4 years, 3 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated(); 543 CSSValueList* afterSlash = CSSValueList::createSpaceSeparated();
544 afterSlash->append(*valueForFillSize(currLayer->size(), style)); 544 afterSlash->append(*valueForFillSize(currLayer->size(), style));
545 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin())); 545 afterSlash->append(*CSSPrimitiveValue::create(currLayer->origin()));
546 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip())); 546 afterSlash->append(*CSSPrimitiveValue::create(currLayer->clip()));
547 list->append(*afterSlash); 547 list->append(*afterSlash);
548 ret->append(*list); 548 ret->append(*list);
549 } 549 }
550 return ret; 550 return ret;
551 } 551 }
552 552
553 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment (const StyleContentAlignmentData& data) 553 static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment (const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID)
554 { 554 {
555 CSSValueList* result = CSSValueList::createSpaceSeparated(); 555 CSSValueList* result = CSSValueList::createSpaceSeparated();
556 if (data.distribution() != ContentDistributionDefault) 556 if (data.distribution() != ContentDistributionDefault)
557 result->append(*CSSPrimitiveValue::create(data.distribution())); 557 result->append(*CSSPrimitiveValue::create(data.distribution()));
558 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) 558 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) {
559 result->append(*CSSPrimitiveValue::create(data.position())); 559 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && data.position() = = ContentPositionNormal)
560 result->append(*CSSPrimitiveValue::createIdentifier(normalBehaviorVa lueID));
561 else
562 result->append(*CSSPrimitiveValue::create(data.position()));
563 }
560 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault) 564 if ((data.position() >= ContentPositionCenter || data.distribution() != Cont entDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
561 result->append(*CSSPrimitiveValue::create(data.overflow())); 565 result->append(*CSSPrimitiveValue::create(data.overflow()));
562 ASSERT(result->length() > 0); 566 ASSERT(result->length() > 0);
563 ASSERT(result->length() <= 3); 567 ASSERT(result->length() <= 3);
564 return result; 568 return result;
565 } 569 }
566 570
567 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) 571 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style)
568 { 572 {
569 Length length = style.lineHeight(); 573 Length length = style.lineHeight();
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 } 1888 }
1885 return value; 1889 return value;
1886 } 1890 }
1887 case CSSPropertyDirection: 1891 case CSSPropertyDirection:
1888 return CSSPrimitiveValue::create(style.direction()); 1892 return CSSPrimitiveValue::create(style.direction());
1889 case CSSPropertyDisplay: 1893 case CSSPropertyDisplay:
1890 return CSSPrimitiveValue::create(style.display()); 1894 return CSSPrimitiveValue::create(style.display());
1891 case CSSPropertyEmptyCells: 1895 case CSSPropertyEmptyCells:
1892 return CSSPrimitiveValue::create(style.emptyCells()); 1896 return CSSPrimitiveValue::create(style.emptyCells());
1893 case CSSPropertyAlignContent: 1897 case CSSPropertyAlignContent:
1894 return valueForContentPositionAndDistributionWithOverflowAlignment(style .alignContent()); 1898 return valueForContentPositionAndDistributionWithOverflowAlignment(style .alignContent(), CSSValueStretch);
1895 case CSSPropertyAlignItems: 1899 case CSSPropertyAlignItems:
1896 return valueForItemPositionWithOverflowAlignment(style.alignItems()); 1900 return valueForItemPositionWithOverflowAlignment(style.alignItems());
1897 case CSSPropertyAlignSelf: 1901 case CSSPropertyAlignSelf:
1898 return valueForItemPositionWithOverflowAlignment(style.alignSelf()); 1902 return valueForItemPositionWithOverflowAlignment(style.alignSelf());
1899 case CSSPropertyFlex: 1903 case CSSPropertyFlex:
1900 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, styledNode, allowVisitedStyle); 1904 return valuesForShorthandProperty(flexShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
1901 case CSSPropertyFlexBasis: 1905 case CSSPropertyFlexBasis:
1902 return zoomAdjustedPixelValueForLength(style.flexBasis(), style); 1906 return zoomAdjustedPixelValueForLength(style.flexBasis(), style);
1903 case CSSPropertyFlexDirection: 1907 case CSSPropertyFlexDirection:
1904 return CSSPrimitiveValue::create(style.flexDirection()); 1908 return CSSPrimitiveValue::create(style.flexDirection());
1905 case CSSPropertyFlexFlow: 1909 case CSSPropertyFlexFlow:
1906 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle); 1910 return valuesForShorthandProperty(flexFlowShorthand(), style, layoutObje ct, styledNode, allowVisitedStyle);
1907 case CSSPropertyFlexGrow: 1911 case CSSPropertyFlexGrow:
1908 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number); 1912 return CSSPrimitiveValue::create(style.flexGrow(), CSSPrimitiveValue::Un itType::Number);
1909 case CSSPropertyFlexShrink: 1913 case CSSPropertyFlexShrink:
1910 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number); 1914 return CSSPrimitiveValue::create(style.flexShrink(), CSSPrimitiveValue:: UnitType::Number);
1911 case CSSPropertyFlexWrap: 1915 case CSSPropertyFlexWrap:
1912 return CSSPrimitiveValue::create(style.flexWrap()); 1916 return CSSPrimitiveValue::create(style.flexWrap());
1913 case CSSPropertyJustifyContent: 1917 case CSSPropertyJustifyContent:
1914 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent()); 1918 return valueForContentPositionAndDistributionWithOverflowAlignment(style .justifyContent(), CSSValueFlexStart);
1915 case CSSPropertyOrder: 1919 case CSSPropertyOrder:
1916 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number); 1920 return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitT ype::Number);
1917 case CSSPropertyFloat: 1921 case CSSPropertyFloat:
1918 if (style.display() != NONE && style.hasOutOfFlowPosition()) 1922 if (style.display() != NONE && style.hasOutOfFlowPosition())
1919 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 1923 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
1920 return CSSPrimitiveValue::create(style.floating()); 1924 return CSSPrimitiveValue::create(style.floating());
1921 case CSSPropertyFont: 1925 case CSSPropertyFont:
1922 return valueForFont(style); 1926 return valueForFont(style);
1923 case CSSPropertyFontFamily: 1927 case CSSPropertyFontFamily:
1924 return valueForFontFamily(style); 1928 return valueForFontFamily(style);
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 case CSSPropertyAll: 3013 case CSSPropertyAll:
3010 return nullptr; 3014 return nullptr;
3011 default: 3015 default:
3012 break; 3016 break;
3013 } 3017 }
3014 ASSERT_NOT_REACHED(); 3018 ASSERT_NOT_REACHED();
3015 return nullptr; 3019 return nullptr;
3016 } 3020 }
3017 3021
3018 } // namespace blink 3022 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698