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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Python code generator changes Created 7 years, 4 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 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after
3057 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 3057 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
3058 return false; 3058 return false;
3059 } 3059 }
3060 3060
3061 void CSSComputedStyleDeclaration::clearVariables(ExceptionState& es) 3061 void CSSComputedStyleDeclaration::clearVariables(ExceptionState& es)
3062 { 3062 {
3063 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 3063 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
3064 es.throwDOMException(NoModificationAllowedError); 3064 es.throwDOMException(NoModificationAllowedError);
3065 } 3065 }
3066 3066
3067 CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::ComputedCSSVariablesI terator(const HashMap<AtomicString, String>* variables)
3068 : m_active(variables)
3069 {
3070 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
3071 if (m_active) {
3072 m_it = variables->begin();
3073 m_end = variables->end();
3074 }
3075 }
3076
3077 void CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::advance()
3078 {
3079 ASSERT(m_active);
3080 ++m_it;
3081 m_active = !atEnd();
3082 }
3083
3084 AtomicString CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::name() c onst
3085 {
3086 ASSERT(m_active);
3087 return m_it->key;
3088 }
3089
3090 String CSSComputedStyleDeclaration::ComputedCSSVariablesIterator::value() const
3091 {
3092 ASSERT(m_active);
3093 return m_it->value;
3094 }
3095
3096
3067 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getBackgroundShorthandValu e() const 3097 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getBackgroundShorthandValu e() const
3068 { 3098 {
3069 static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSProperty BackgroundColor, CSSPropertyBackgroundImage, 3099 static const CSSPropertyID propertiesBeforeSlashSeperator[5] = { CSSProperty BackgroundColor, CSSPropertyBackgroundImage,
3070 CSSProperty BackgroundRepeat, CSSPropertyBackgroundAttachment, 3100 CSSProperty BackgroundRepeat, CSSPropertyBackgroundAttachment,
3071 CSSProperty BackgroundPosition }; 3101 CSSProperty BackgroundPosition };
3072 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3102 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3073 CSSPropertyB ackgroundClip }; 3103 CSSPropertyB ackgroundClip };
3074 3104
3075 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3105 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3076 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(CSSPropertyBackground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(prope rtiesBeforeSlashSeperator)))); 3106 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(CSSPropertyBackground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(prope rtiesBeforeSlashSeperator))));
3077 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(CSSPropertyBackground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(proper tiesAfterSlashSeperator)))); 3107 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(CSSPropertyBackground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(proper tiesAfterSlashSeperator))));
3078 return list.release(); 3108 return list.release();
3079 } 3109 }
3080 3110
3081 } // namespace WebCore 3111 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698