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

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

Issue 15746004: Rename/tweak some StylePropertySet/CSSStyleDeclaration copying functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSStyleDeclaration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2825 matching lines...) Expand 10 before | Expand all | Expand 10 after
2836 int sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescripti on().keywordSize()); 2836 int sizeValue = cssIdentifierForFontSizeKeyword(style->fontDescripti on().keywordSize());
2837 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(proper tyValue); 2837 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(proper tyValue);
2838 if (primitiveValue->isIdent() && primitiveValue->getIdent() == sizeV alue) 2838 if (primitiveValue->isIdent() && primitiveValue->getIdent() == sizeV alue)
2839 return true; 2839 return true;
2840 } 2840 }
2841 } 2841 }
2842 RefPtr<CSSValue> value = getPropertyCSSValue(propertyID); 2842 RefPtr<CSSValue> value = getPropertyCSSValue(propertyID);
2843 return value && propertyValue && value->equals(*propertyValue); 2843 return value && propertyValue && value->equals(*propertyValue);
2844 } 2844 }
2845 2845
2846 PassRefPtr<StylePropertySet> CSSComputedStyleDeclaration::copy() const 2846 PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyProperties( ) const
2847 { 2847 {
2848 return copyPropertiesInSet(computableProperties()); 2848 return copyPropertiesInSet(computableProperties());
2849 } 2849 }
2850 2850
2851 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getCSSPropertyValuesForSho rthandProperties(const StylePropertyShorthand& shorthand) const 2851 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getCSSPropertyValuesForSho rthandProperties(const StylePropertyShorthand& shorthand) const
2852 { 2852 {
2853 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); 2853 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
2854 for (size_t i = 0; i < shorthand.length(); ++i) { 2854 for (size_t i = 0; i < shorthand.length(); ++i) {
2855 RefPtr<CSSValue> value = getPropertyCSSValue(shorthand.properties()[i], DoNotUpdateLayout); 2855 RefPtr<CSSValue> value = getPropertyCSSValue(shorthand.properties()[i], DoNotUpdateLayout);
2856 list->append(value); 2856 list->append(value);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2889 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getCSSPropertyValuesForGri dShorthand(const StylePropertyShorthand& shorthand) const 2889 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getCSSPropertyValuesForGri dShorthand(const StylePropertyShorthand& shorthand) const
2890 { 2890 {
2891 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 2891 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
2892 for (size_t i = 0; i < shorthand.length(); ++i) { 2892 for (size_t i = 0; i < shorthand.length(); ++i) {
2893 RefPtr<CSSValue> value = getPropertyCSSValue(shorthand.properties()[i], DoNotUpdateLayout); 2893 RefPtr<CSSValue> value = getPropertyCSSValue(shorthand.properties()[i], DoNotUpdateLayout);
2894 list->append(value.release()); 2894 list->append(value.release());
2895 } 2895 }
2896 return list.release(); 2896 return list.release();
2897 } 2897 }
2898 2898
2899 PassRefPtr<StylePropertySet> CSSComputedStyleDeclaration::copyPropertiesInSet(co nst Vector<CSSPropertyID>& properties) const 2899 PassRefPtr<MutableStylePropertySet> CSSComputedStyleDeclaration::copyPropertiesI nSet(const Vector<CSSPropertyID>& properties) const
2900 { 2900 {
2901 Vector<CSSProperty, 256> list; 2901 Vector<CSSProperty, 256> list;
2902 list.reserveInitialCapacity(properties.size()); 2902 list.reserveInitialCapacity(properties.size());
2903 for (unsigned i = 0; i < properties.size(); ++i) { 2903 for (unsigned i = 0; i < properties.size(); ++i) {
2904 RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]); 2904 RefPtr<CSSValue> value = getPropertyCSSValue(properties[i]);
2905 if (value) 2905 if (value)
2906 list.append(CSSProperty(properties[i], value.release(), false)); 2906 list.append(CSSProperty(properties[i], value.release(), false));
2907 } 2907 }
2908 return StylePropertySet::create(list.data(), list.size()); 2908 return static_pointer_cast<MutableStylePropertySet>(StylePropertySet::create (list.data(), list.size()));
2909 } 2909 }
2910 2910
2911 void CSSComputedStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObje ctInfo) const 2911 void CSSComputedStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObje ctInfo) const
2912 { 2912 {
2913 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); 2913 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
2914 info.addMember(m_node, "node"); 2914 info.addMember(m_node, "node");
2915 } 2915 }
2916 2916
2917 CSSRule* CSSComputedStyleDeclaration::parentRule() const 2917 CSSRule* CSSComputedStyleDeclaration::parentRule() const
2918 { 2918 {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
2986 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 2986 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
2987 CSSPropertyB ackgroundClip }; 2987 CSSPropertyB ackgroundClip };
2988 2988
2989 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 2989 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
2990 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or)))); 2990 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or))));
2991 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator )))); 2991 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator ))));
2992 return list.release(); 2992 return list.release();
2993 } 2993 }
2994 2994
2995 } // namespace WebCore 2995 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.h ('k') | Source/core/css/CSSStyleDeclaration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698