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. | 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 Loading... |
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() == kItemPositionBaseline) { | 506 if (data.GetPosition() == kItemPositionAuto) { |
| 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) { |
507 result->Append( | 513 result->Append( |
508 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueBaseline), | 514 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueBaseline), |
509 CSSIdentifierValue::Create(CSSValueBaseline), | 515 CSSIdentifierValue::Create(CSSValueBaseline), |
510 CSSValuePair::kDropIdenticalValues)); | 516 CSSValuePair::kDropIdenticalValues)); |
511 } else if (data.GetPosition() == kItemPositionLastBaseline) { | 517 } else if (data.GetPosition() == kItemPositionLastBaseline) { |
512 result->Append( | 518 result->Append( |
513 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueLast), | 519 *CSSValuePair::Create(CSSIdentifierValue::Create(CSSValueLast), |
514 CSSIdentifierValue::Create(CSSValueBaseline), | 520 CSSIdentifierValue::Create(CSSValueBaseline), |
515 CSSValuePair::kDropIdenticalValues)); | 521 CSSValuePair::kDropIdenticalValues)); |
516 } else { | 522 } else { |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 case CSSPropertyImageRendering: | 2606 case CSSPropertyImageRendering: |
2601 return CSSIdentifierValue::Create(style.ImageRendering()); | 2607 return CSSIdentifierValue::Create(style.ImageRendering()); |
2602 case CSSPropertyImageOrientation: | 2608 case CSSPropertyImageOrientation: |
2603 if (style.RespectImageOrientation() == kRespectImageOrientation) | 2609 if (style.RespectImageOrientation() == kRespectImageOrientation) |
2604 return CSSIdentifierValue::Create(CSSValueFromImage); | 2610 return CSSIdentifierValue::Create(CSSValueFromImage); |
2605 return CSSPrimitiveValue::Create(0, | 2611 return CSSPrimitiveValue::Create(0, |
2606 CSSPrimitiveValue::UnitType::kDegrees); | 2612 CSSPrimitiveValue::UnitType::kDegrees); |
2607 case CSSPropertyIsolation: | 2613 case CSSPropertyIsolation: |
2608 return CSSIdentifierValue::Create(style.Isolation()); | 2614 return CSSIdentifierValue::Create(style.Isolation()); |
2609 case CSSPropertyJustifyItems: | 2615 case CSSPropertyJustifyItems: |
2610 return ValueForItemPositionWithOverflowAlignment( | 2616 return ValueForItemPositionWithOverflowAlignment(style.JustifyItems()); |
2611 style.JustifyItems().GetPosition() == kItemPositionAuto | |
2612 ? ComputedStyle::InitialDefaultAlignment() | |
2613 : style.JustifyItems()); | |
2614 case CSSPropertyJustifySelf: | 2617 case CSSPropertyJustifySelf: |
2615 return ValueForItemPositionWithOverflowAlignment(style.JustifySelf()); | 2618 return ValueForItemPositionWithOverflowAlignment(style.JustifySelf()); |
2616 case CSSPropertyLeft: | 2619 case CSSPropertyLeft: |
2617 return ValueForPositionOffset(style, CSSPropertyLeft, layout_object); | 2620 return ValueForPositionOffset(style, CSSPropertyLeft, layout_object); |
2618 case CSSPropertyLetterSpacing: | 2621 case CSSPropertyLetterSpacing: |
2619 if (!style.LetterSpacing()) | 2622 if (!style.LetterSpacing()) |
2620 return CSSIdentifierValue::Create(CSSValueNormal); | 2623 return CSSIdentifierValue::Create(CSSValueNormal); |
2621 return ZoomAdjustedPixelValue(style.LetterSpacing(), style); | 2624 return ZoomAdjustedPixelValue(style.LetterSpacing(), style); |
2622 case CSSPropertyWebkitLineClamp: | 2625 case CSSPropertyWebkitLineClamp: |
2623 if (style.LineClamp().IsNone()) | 2626 if (style.LineClamp().IsNone()) |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3749 case CSSPropertyAll: | 3752 case CSSPropertyAll: |
3750 return nullptr; | 3753 return nullptr; |
3751 default: | 3754 default: |
3752 break; | 3755 break; |
3753 } | 3756 } |
3754 NOTREACHED(); | 3757 NOTREACHED(); |
3755 return nullptr; | 3758 return nullptr; |
3756 } | 3759 } |
3757 | 3760 |
3758 } // namespace blink | 3761 } // namespace blink |
OLD | NEW |