Changeset 207535 in webkit
- Timestamp:
- Oct 19, 2016 6:42:43 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207523 r207535 1 2016-10-19 Javier Fernandez <jfernandez@igalia.com> 2 3 Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected 4 https://bugs.webkit.org/show_bug.cgi?id=163572 5 6 Reviewed by Sergio Villar Senin. 7 8 Modified test cases for initial values. 9 Added regression test for the align-content issue. 10 11 * css3/flexbox/flexbox-lines-must-be-stretched-by-default-expected.txt: Added. 12 * css3/flexbox/flexbox-lines-must-be-stretched-by-default.html: Added. 13 * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: 14 1 15 2016-10-19 Jer Noble <jer.noble@apple.com> 2 16 -
trunk/LayoutTests/fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt
r205807 r207535 26 26 PASS CSS.supports('align-items', 'stretch') is true 27 27 PASS CSS.supports('align-self', 'stretch') is true 28 PASS CSS.supports('align-content', ' flex-start') is true28 PASS CSS.supports('align-content', 'stretch') is true 29 29 PASS CSS.supports('justify-content', 'flex-start') is true 30 30 PASS CSS.supports('align-items', 'stretch') is true 31 31 PASS CSS.supports('align-self', 'stretch') is true 32 PASS CSS.supports('align-content', ' flex-start') is true32 PASS CSS.supports('align-content', 'stretch') is true 33 33 PASS CSS.supports('justify-content', 'flex-start') is true 34 34 PASS CSS.supports('align-items', 'stretch') is true 35 35 PASS CSS.supports('align-self', 'stretch') is true 36 PASS CSS.supports('align-content', ' flex-start') is true36 PASS CSS.supports('align-content', 'stretch') is true 37 37 PASS CSS.supports('justify-content', 'flex-start') is true 38 38 PASS CSS.supports('align-items', 'stretch') is true 39 39 PASS CSS.supports('align-self', 'stretch') is true 40 PASS CSS.supports('align-content', ' flex-start') is true40 PASS CSS.supports('align-content', 'stretch') is true 41 41 PASS CSS.supports('justify-content', 'flex-start') is true 42 42 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r207533 r207535 1 2016-10-19 Javier Fernandez <jfernandez@igalia.com> 2 3 Web Inspector: Debugger buttons positioned incorrectly, align-content default value is unexpected 4 https://bugs.webkit.org/show_bug.cgi?id=163572 5 6 Reviewed by Sergio Villar Senin. 7 8 We only allow the new CSS Box Alignment syntax when the Grid Layout 9 feature is enabled. Due to flexbox backward compatibility we have 10 implemented a different code path for the style initial/default values 11 assignment. However, we have incorrectly resolved both align-content 12 and justify-content to 'flex-start' when grid layout is disabled. 13 14 This patch changes the approach, so we set 'normal' (the value specified 15 by the new syntax) for both properties, but using the values defined in 16 the old syntax (Flexbox specification) at computed style resolution. 17 18 Since 'stretch' is the default value for the align-content property, this 19 issue implies that any flexbox line with an undefined height will be 20 laid out incorrectly, if not explicitly set via CSS, because flex items 21 can't use the available height, even though they use 'stretch' for their 22 'align-self' properties. 23 24 Test: css3/flexbox/flexbox-lines-must-be-stretched-by-default.html 25 26 * css/CSSComputedStyleDeclaration.cpp: 27 (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment): 28 (WebCore::ComputedStyleExtractor::propertyValue): 29 * rendering/style/RenderStyle.h: 30 (WebCore::RenderStyle::initialContentAlignment): 31 1 32 2016-10-19 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 33 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r207499 r207535 63 63 #include "RenderBox.h" 64 64 #include "RenderStyle.h" 65 #include "RuntimeEnabledFeatures.h" 65 66 #include "SVGElement.h" 66 67 #include "Settings.h" … … 2415 2416 } 2416 2417 2417 static Ref<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data )2418 static Ref<CSSValueList> valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID) 2418 2419 { 2419 2420 auto& cssValuePool = CSSValuePool::singleton(); … … 2421 2422 if (data.distribution() != ContentDistributionDefault) 2422 2423 result.get().append(cssValuePool.createValue(data.distribution())); 2423 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) 2424 result.get().append(cssValuePool.createValue(data.position())); 2424 if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) { 2425 bool gridEnabled = false; 2426 #if ENABLE(CSS_GRID_LAYOUT) 2427 gridEnabled = RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled(); 2428 #endif 2429 if (data.position() != ContentPositionNormal || gridEnabled) 2430 result.get().append(cssValuePool.createValue(data.position())); 2431 else 2432 result.get().append(cssValuePool.createIdentifierValue(normalBehaviorValueID)); 2433 } 2425 2434 if ((data.position() >= ContentPositionCenter || data.distribution() != ContentDistributionDefault) && data.overflow() != OverflowAlignmentDefault) 2426 2435 result.get().append(cssValuePool.createValue(data.overflow())); … … 2804 2813 return cssValuePool.createValue(style->emptyCells()); 2805 2814 case CSSPropertyAlignContent: 2806 return valueForContentPositionAndDistributionWithOverflowAlignment(style->alignContent() );2815 return valueForContentPositionAndDistributionWithOverflowAlignment(style->alignContent(), CSSValueStretch); 2807 2816 case CSSPropertyAlignItems: 2808 2817 return valueForItemPositionWithOverflowAlignment(style->alignItems()); … … 2824 2833 return cssValuePool.createValue(style->flexWrap()); 2825 2834 case CSSPropertyJustifyContent: 2826 return valueForContentPositionAndDistributionWithOverflowAlignment(style->justifyContent() );2835 return valueForContentPositionAndDistributionWithOverflowAlignment(style->justifyContent(), CSSValueFlexStart); 2827 2836 #if ENABLE(CSS_GRID_LAYOUT) 2828 2837 case CSSPropertyJustifyItems: -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r207499 r207535 2005 2005 static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); } 2006 2006 static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(isCSSGridLayoutEnabled() ? ItemPositionNormal : ItemPositionStretch, OverflowAlignmentDefault); } 2007 static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData( isCSSGridLayoutEnabled() ? ContentPositionNormal : ContentPositionFlexStart, ContentDistributionDefault, OverflowAlignmentDefault); }2007 static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); } 2008 2008 static EFlexDirection initialFlexDirection() { return FlowRow; } 2009 2009 static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
Note: See TracChangeset
for help on using the changeset viewer.