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

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

Issue 2750843002: [css-align] Adapt content-alignment properties to the new baseline syntax (Closed)
Patch Set: Don't use raw pointers attributes on a GC managed class. Created 3 years, 9 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. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 6 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
7 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 7 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
8 * Copyright (C) 2015 Google Inc. All rights reserved. 8 * Copyright (C) 2015 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 ret->append(*list); 652 ret->append(*list);
653 } 653 }
654 return ret; 654 return ret;
655 } 655 }
656 656
657 static CSSValueList* 657 static CSSValueList*
658 valueForContentPositionAndDistributionWithOverflowAlignment( 658 valueForContentPositionAndDistributionWithOverflowAlignment(
659 const StyleContentAlignmentData& data, 659 const StyleContentAlignmentData& data,
660 CSSValueID normalBehaviorValueID) { 660 CSSValueID normalBehaviorValueID) {
661 CSSValueList* result = CSSValueList::createSpaceSeparated(); 661 CSSValueList* result = CSSValueList::createSpaceSeparated();
662 // Handle content-distribution values
662 if (data.distribution() != ContentDistributionDefault) 663 if (data.distribution() != ContentDistributionDefault)
663 result->append(*CSSIdentifierValue::create(data.distribution())); 664 result->append(*CSSIdentifierValue::create(data.distribution()));
664 if (data.distribution() == ContentDistributionDefault || 665
665 data.position() != ContentPositionNormal) { 666 // Handle content-position values (either as fallback or actual value)
666 if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && 667 switch (data.position()) {
667 data.position() == ContentPositionNormal) 668 case ContentPositionNormal:
668 result->append(*CSSIdentifierValue::create(normalBehaviorValueID)); 669 // Handle 'normal' value, not valid as content-distribution fallback.
669 else 670 if (data.distribution() == ContentDistributionDefault) {
671 result->append(*CSSIdentifierValue::create(
672 RuntimeEnabledFeatures::cssGridLayoutEnabled()
673 ? CSSValueNormal
674 : normalBehaviorValueID));
675 }
676 break;
677 case ContentPositionLastBaseline:
678 result->append(
679 *CSSValuePair::create(CSSIdentifierValue::create(CSSValueLast),
680 CSSIdentifierValue::create(CSSValueBaseline),
681 CSSValuePair::DropIdenticalValues));
682 break;
683 default:
670 result->append(*CSSIdentifierValue::create(data.position())); 684 result->append(*CSSIdentifierValue::create(data.position()));
671 } 685 }
686
687 // Handle overflow-alignment (only allowed for content-position values)
672 if ((data.position() >= ContentPositionCenter || 688 if ((data.position() >= ContentPositionCenter ||
673 data.distribution() != ContentDistributionDefault) && 689 data.distribution() != ContentDistributionDefault) &&
674 data.overflow() != OverflowAlignmentDefault) 690 data.overflow() != OverflowAlignmentDefault)
675 result->append(*CSSIdentifierValue::create(data.overflow())); 691 result->append(*CSSIdentifierValue::create(data.overflow()));
676 ASSERT(result->length() > 0); 692 ASSERT(result->length() > 0);
677 ASSERT(result->length() <= 3); 693 ASSERT(result->length() <= 3);
678 return result; 694 return result;
679 } 695 }
680 696
681 static CSSValue* valueForLineHeight(const ComputedStyle& style) { 697 static CSSValue* valueForLineHeight(const ComputedStyle& style) {
(...skipping 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3675 case CSSPropertyAll: 3691 case CSSPropertyAll:
3676 return nullptr; 3692 return nullptr;
3677 default: 3693 default:
3678 break; 3694 break;
3679 } 3695 }
3680 ASSERT_NOT_REACHED(); 3696 ASSERT_NOT_REACHED();
3681 return nullptr; 3697 return nullptr;
3682 } 3698 }
3683 3699
3684 } // namespace blink 3700 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698