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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and review changes Created 7 years, 2 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/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 274 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
275 return m_propertySet->variableCount(); 275 return m_propertySet->variableCount();
276 } 276 }
277 277
278 String PropertySetCSSStyleDeclaration::variableValue(const AtomicString& name) c onst 278 String PropertySetCSSStyleDeclaration::variableValue(const AtomicString& name) c onst
279 { 279 {
280 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 280 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
281 return m_propertySet->variableValue(name); 281 return m_propertySet->variableValue(name);
282 } 282 }
283 283
284 void PropertySetCSSStyleDeclaration::setVariableValue(const AtomicString& name, const String& value, ExceptionState&) 284 bool PropertySetCSSStyleDeclaration::setVariableValue(const AtomicString& name, const String& value, ExceptionState&)
285 { 285 {
286 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 286 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
287 StyleAttributeMutationScope mutationScope(this); 287 StyleAttributeMutationScope mutationScope(this);
288 willMutate(); 288 willMutate();
289 bool changed = m_propertySet->setVariableValue(name, value); 289 bool changed = m_propertySet->setVariableValue(name, value);
290 didMutate(changed ? PropertyChanged : NoChanges); 290 didMutate(changed ? PropertyChanged : NoChanges);
291 if (changed) 291 if (changed)
292 mutationScope.enqueueMutationRecord(); 292 mutationScope.enqueueMutationRecord();
293 return changed;
293 } 294 }
294 295
295 bool PropertySetCSSStyleDeclaration::removeVariable(const AtomicString& name) 296 bool PropertySetCSSStyleDeclaration::removeVariable(const AtomicString& name)
296 { 297 {
297 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 298 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
298 StyleAttributeMutationScope mutationScope(this); 299 StyleAttributeMutationScope mutationScope(this);
299 willMutate(); 300 willMutate();
300 bool changed = m_propertySet->removeVariable(name); 301 bool changed = m_propertySet->removeVariable(name);
301 didMutate(changed ? PropertyChanged : NoChanges); 302 didMutate(changed ? PropertyChanged : NoChanges);
302 if (changed) 303 if (changed)
303 mutationScope.enqueueMutationRecord(); 304 mutationScope.enqueueMutationRecord();
304 return changed; 305 return changed;
305 } 306 }
306 307
307 void PropertySetCSSStyleDeclaration::clearVariables(ExceptionState&) 308 bool PropertySetCSSStyleDeclaration::clearVariables(ExceptionState&)
308 { 309 {
309 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); 310 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
310 StyleAttributeMutationScope mutationScope(this); 311 StyleAttributeMutationScope mutationScope(this);
311 willMutate(); 312 willMutate();
312 bool changed = m_propertySet->clearVariables(); 313 bool changed = m_propertySet->clearVariables();
313 didMutate(changed ? PropertyChanged : NoChanges); 314 didMutate(changed ? PropertyChanged : NoChanges);
314 if (changed) 315 if (changed)
315 mutationScope.enqueueMutationRecord(); 316 mutationScope.enqueueMutationRecord();
317 return changed;
318 }
319
320 PassRefPtr<CSSVariablesIterator> PropertySetCSSStyleDeclaration::variablesIterat or() const
321 {
322 return m_propertySet->variablesIterator();
316 } 323 }
317 324
318 CSSValue* PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM(CSSValue* intern alValue) 325 CSSValue* PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM(CSSValue* intern alValue)
319 { 326 {
320 if (!internalValue) 327 if (!internalValue)
321 return 0; 328 return 0;
322 329
323 // The map is here to maintain the object identity of the CSSValues over mul tiple invocations. 330 // The map is here to maintain the object identity of the CSSValues over mul tiple invocations.
324 // FIXME: It is likely that the identity is not important for web compatibil ity and this code should be removed. 331 // FIXME: It is likely that the identity is not important for web compatibil ity and this code should be removed.
325 if (!m_cssomCSSValueClones) 332 if (!m_cssomCSSValueClones)
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 m_parentElement->invalidateStyleAttribute(); 422 m_parentElement->invalidateStyleAttribute();
416 StyleAttributeMutationScope(this).didInvalidateStyleAttr(); 423 StyleAttributeMutationScope(this).didInvalidateStyleAttr();
417 } 424 }
418 425
419 CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const 426 CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const
420 { 427 {
421 return m_parentElement ? m_parentElement->document().elementSheet() : 0; 428 return m_parentElement ? m_parentElement->document().elementSheet() : 0;
422 } 429 }
423 430
424 } // namespace WebCore 431 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698