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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 216803002: Implement all shorthand property. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated css-properties-as-js-properties-expected.txt Created 6 years, 8 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 | Annotate | Revision Log
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. 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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after
2846 case CSSPropertyBaselineShift: 2846 case CSSPropertyBaselineShift:
2847 case CSSPropertyDominantBaseline: 2847 case CSSPropertyDominantBaseline:
2848 case CSSPropertyGlyphOrientationHorizontal: 2848 case CSSPropertyGlyphOrientationHorizontal:
2849 case CSSPropertyGlyphOrientationVertical: 2849 case CSSPropertyGlyphOrientationVertical:
2850 case CSSPropertyKerning: 2850 case CSSPropertyKerning:
2851 case CSSPropertyTextAnchor: 2851 case CSSPropertyTextAnchor:
2852 case CSSPropertyVectorEffect: 2852 case CSSPropertyVectorEffect:
2853 case CSSPropertyPaintOrder: 2853 case CSSPropertyPaintOrder:
2854 case CSSPropertyWritingMode: 2854 case CSSPropertyWritingMode:
2855 return getSVGPropertyCSSValue(propertyID, DoNotUpdateLayout); 2855 return getSVGPropertyCSSValue(propertyID, DoNotUpdateLayout);
2856
2857 case CSSPropertyAll:
2858 {
2859 // FIXME: need to support "unset".
2860 bool isInitial = true;
2861 bool isInherit = true;
2862 for (unsigned i = 0; i < allShorthand().length() && (isInitial || is Inherit); ++i) {
2863 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(allShor thand().properties()[i], DoNotUpdateLayout);
2864 isInitial = isInitial && value->isInitialValue();
2865 isInherit = isInherit && value->isInheritedValue();
2866 }
2867 if (isInitial)
2868 return cssValuePool().createExplicitInitialValue();
2869 if (isInherit)
2870 return cssValuePool().createInheritedValue();
2871 return nullptr;
2872 }
2856 } 2873 }
2857 2874
2858 logUnimplementedPropertyID(propertyID); 2875 logUnimplementedPropertyID(propertyID);
2859 return nullptr; 2876 return nullptr;
2860 } 2877 }
2861 2878
2862 String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c onst 2879 String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c onst
2863 { 2880 {
2864 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); 2881 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID);
2865 if (value) 2882 if (value)
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
3042 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3059 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3043 CSSPropertyB ackgroundClip }; 3060 CSSPropertyB ackgroundClip };
3044 3061
3045 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ; 3062 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ;
3046 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3063 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3047 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3064 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3048 return list.release(); 3065 return list.release();
3049 } 3066 }
3050 3067
3051 } // namespace WebCore 3068 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698