| 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.
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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 570 |
| 571 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) | 571 static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style) |
| 572 { | 572 { |
| 573 Length length = style.lineHeight(); | 573 Length length = style.lineHeight(); |
| 574 if (length.isNegative()) | 574 if (length.isNegative()) |
| 575 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); | 575 return CSSPrimitiveValue::createIdentifier(CSSValueNormal); |
| 576 | 576 |
| 577 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr
iption().computedSize()), style); | 577 return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescr
iption().computedSize()), style); |
| 578 } | 578 } |
| 579 | 579 |
| 580 static CSSValue* valueForPosition(const LengthPoint& position, const ComputedSty
le& style) |
| 581 { |
| 582 DCHECK((position.x() == Auto) == (position.y() == Auto)); |
| 583 if (position.x() == Auto) { |
| 584 return CSSPrimitiveValue::createIdentifier(CSSValueAuto); |
| 585 } |
| 586 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| 587 list->append(*zoomAdjustedPixelValueForLength(position.x(), style)); |
| 588 list->append(*zoomAdjustedPixelValueForLength(position.y(), style)); |
| 589 return list; |
| 590 } |
| 591 |
| 580 static CSSValueID identifierForFamily(const AtomicString& family) | 592 static CSSValueID identifierForFamily(const AtomicString& family) |
| 581 { | 593 { |
| 582 if (family == FontFamilyNames::webkit_cursive) | 594 if (family == FontFamilyNames::webkit_cursive) |
| 583 return CSSValueCursive; | 595 return CSSValueCursive; |
| 584 if (family == FontFamilyNames::webkit_fantasy) | 596 if (family == FontFamilyNames::webkit_fantasy) |
| 585 return CSSValueFantasy; | 597 return CSSValueFantasy; |
| 586 if (family == FontFamilyNames::webkit_monospace) | 598 if (family == FontFamilyNames::webkit_monospace) |
| 587 return CSSValueMonospace; | 599 return CSSValueMonospace; |
| 588 if (family == FontFamilyNames::webkit_pictograph) | 600 if (family == FontFamilyNames::webkit_pictograph) |
| 589 return CSSValueWebkitPictograph; | 601 return CSSValueWebkitPictograph; |
| (...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2723 case CSSPropertyBackgroundRepeatX: | 2735 case CSSPropertyBackgroundRepeatX: |
| 2724 case CSSPropertyBackgroundRepeatY: | 2736 case CSSPropertyBackgroundRepeatY: |
| 2725 return nullptr; | 2737 return nullptr; |
| 2726 | 2738 |
| 2727 case CSSPropertyMotion: | 2739 case CSSPropertyMotion: |
| 2728 return valuesForShorthandProperty(motionShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); | 2740 return valuesForShorthandProperty(motionShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); |
| 2729 | 2741 |
| 2730 case CSSPropertyOffset: | 2742 case CSSPropertyOffset: |
| 2731 return valuesForShorthandProperty(offsetShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); | 2743 return valuesForShorthandProperty(offsetShorthand(), style, layoutObject
, styledNode, allowVisitedStyle); |
| 2732 | 2744 |
| 2745 case CSSPropertyOffsetAnchor: |
| 2746 return valueForPosition(style.offsetAnchor(), style); |
| 2747 |
| 2748 case CSSPropertyOffsetPosition: |
| 2749 return valueForPosition(style.offsetPosition(), style); |
| 2750 |
| 2733 case CSSPropertyOffsetPath: | 2751 case CSSPropertyOffsetPath: |
| 2734 if (const StylePath* styleMotionPath = style.offsetPath()) | 2752 if (const StylePath* styleMotionPath = style.offsetPath()) |
| 2735 return styleMotionPath->computedCSSValue(); | 2753 return styleMotionPath->computedCSSValue(); |
| 2736 return CSSPrimitiveValue::createIdentifier(CSSValueNone); | 2754 return CSSPrimitiveValue::createIdentifier(CSSValueNone); |
| 2737 | 2755 |
| 2738 case CSSPropertyOffsetDistance: | 2756 case CSSPropertyOffsetDistance: |
| 2739 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style); | 2757 return zoomAdjustedPixelValueForLength(style.offsetDistance(), style); |
| 2740 | 2758 |
| 2741 case CSSPropertyOffsetRotation: { | 2759 case CSSPropertyOffsetRotation: { |
| 2742 CSSValueList* list = CSSValueList::createSpaceSeparated(); | 2760 CSSValueList* list = CSSValueList::createSpaceSeparated(); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3016 case CSSPropertyAll: | 3034 case CSSPropertyAll: |
| 3017 return nullptr; | 3035 return nullptr; |
| 3018 default: | 3036 default: |
| 3019 break; | 3037 break; |
| 3020 } | 3038 } |
| 3021 ASSERT_NOT_REACHED(); | 3039 ASSERT_NOT_REACHED(); |
| 3022 return nullptr; | 3040 return nullptr; |
| 3023 } | 3041 } |
| 3024 | 3042 |
| 3025 } // namespace blink | 3043 } // namespace blink |
| OLD | NEW |