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

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

Issue 2455093002: [css-align] Don't resolve 'auto' values for computed style. (Closed)
Patch Set: Patch for landing. Created 3 years, 6 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 return CSSReflectValue::Create( 497 return CSSReflectValue::Create(
498 direction, offset, ValueForNinePieceImage(reflection->Mask(), style)); 498 direction, offset, ValueForNinePieceImage(reflection->Mask(), style));
499 } 499 }
500 500
501 static CSSValueList* ValueForItemPositionWithOverflowAlignment( 501 static CSSValueList* ValueForItemPositionWithOverflowAlignment(
502 const StyleSelfAlignmentData& data) { 502 const StyleSelfAlignmentData& data) {
503 CSSValueList* result = CSSValueList::CreateSpaceSeparated(); 503 CSSValueList* result = CSSValueList::CreateSpaceSeparated();
504 if (data.PositionType() == kLegacyPosition) 504 if (data.PositionType() == kLegacyPosition)
505 result->Append(*CSSIdentifierValue::Create(CSSValueLegacy)); 505 result->Append(*CSSIdentifierValue::Create(CSSValueLegacy));
506 if (data.GetPosition() == kItemPositionAuto) { 506 if (data.GetPosition() == kItemPositionBaseline) {
507 // To avoid needing to copy the RareNonInheritedData, we repurpose the
508 // 'auto' flag to not just mean 'auto' prior to running the StyleAdjuster
509 // but also mean 'normal' after running it.
510 result->Append(*CSSIdentifierValue::Create(
511 ComputedStyle::InitialDefaultAlignment().GetPosition()));
512 } else if (data.GetPosition() == kItemPositionBaseline) {
513 result->Append( 507 result->Append(
514 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueBaseline), 508 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueBaseline),
515 CSSIdentifierValue::Create(CSSValueBaseline), 509 CSSIdentifierValue::Create(CSSValueBaseline),
516 CSSValuePair::kDropIdenticalValues)); 510 CSSValuePair::kDropIdenticalValues));
517 } else if (data.GetPosition() == kItemPositionLastBaseline) { 511 } else if (data.GetPosition() == kItemPositionLastBaseline) {
518 result->Append( 512 result->Append(
519 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueLast), 513 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueLast),
520 CSSIdentifierValue::Create(CSSValueBaseline), 514 CSSIdentifierValue::Create(CSSValueBaseline),
521 CSSValuePair::kDropIdenticalValues)); 515 CSSValuePair::kDropIdenticalValues));
522 } else { 516 } else {
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 case CSSPropertyImageRendering: 2600 case CSSPropertyImageRendering:
2607 return CSSIdentifierValue::Create(style.ImageRendering()); 2601 return CSSIdentifierValue::Create(style.ImageRendering());
2608 case CSSPropertyImageOrientation: 2602 case CSSPropertyImageOrientation:
2609 if (style.RespectImageOrientation() == kRespectImageOrientation) 2603 if (style.RespectImageOrientation() == kRespectImageOrientation)
2610 return CSSIdentifierValue::Create(CSSValueFromImage); 2604 return CSSIdentifierValue::Create(CSSValueFromImage);
2611 return CSSPrimitiveValue::Create(0, 2605 return CSSPrimitiveValue::Create(0,
2612 CSSPrimitiveValue::UnitType::kDegrees); 2606 CSSPrimitiveValue::UnitType::kDegrees);
2613 case CSSPropertyIsolation: 2607 case CSSPropertyIsolation:
2614 return CSSIdentifierValue::Create(style.Isolation()); 2608 return CSSIdentifierValue::Create(style.Isolation());
2615 case CSSPropertyJustifyItems: 2609 case CSSPropertyJustifyItems:
2616 return ValueForItemPositionWithOverflowAlignment(style.JustifyItems()); 2610 return ValueForItemPositionWithOverflowAlignment(
2611 style.JustifyItems().GetPosition() == kItemPositionAuto
2612 ? ComputedStyle::InitialDefaultAlignment()
2613 : style.JustifyItems());
2617 case CSSPropertyJustifySelf: 2614 case CSSPropertyJustifySelf:
2618 return ValueForItemPositionWithOverflowAlignment(style.JustifySelf()); 2615 return ValueForItemPositionWithOverflowAlignment(style.JustifySelf());
2619 case CSSPropertyLeft: 2616 case CSSPropertyLeft:
2620 return ValueForPositionOffset(style, CSSPropertyLeft, layout_object); 2617 return ValueForPositionOffset(style, CSSPropertyLeft, layout_object);
2621 case CSSPropertyLetterSpacing: 2618 case CSSPropertyLetterSpacing:
2622 if (!style.LetterSpacing()) 2619 if (!style.LetterSpacing())
2623 return CSSIdentifierValue::Create(CSSValueNormal); 2620 return CSSIdentifierValue::Create(CSSValueNormal);
2624 return ZoomAdjustedPixelValue(style.LetterSpacing(), style); 2621 return ZoomAdjustedPixelValue(style.LetterSpacing(), style);
2625 case CSSPropertyWebkitLineClamp: 2622 case CSSPropertyWebkitLineClamp:
2626 if (style.LineClamp().IsNone()) 2623 if (style.LineClamp().IsNone())
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 case CSSPropertyAll: 3749 case CSSPropertyAll:
3753 return nullptr; 3750 return nullptr;
3754 default: 3751 default:
3755 break; 3752 break;
3756 } 3753 }
3757 NOTREACHED(); 3754 NOTREACHED();
3758 return nullptr; 3755 return nullptr;
3759 } 3756 }
3760 3757
3761 } // namespace blink 3758 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698