OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return m_styleDeclaration->removeVariable(name); | 66 return m_styleDeclaration->removeVariable(name); |
67 return false; | 67 return false; |
68 } | 68 } |
69 | 69 |
70 void CSSVariablesMap::clear(ExceptionCode& ec) const | 70 void CSSVariablesMap::clear(ExceptionCode& ec) const |
71 { | 71 { |
72 if (m_styleDeclaration) | 72 if (m_styleDeclaration) |
73 return m_styleDeclaration->clearVariables(ec); | 73 return m_styleDeclaration->clearVariables(ec); |
74 } | 74 } |
75 | 75 |
| 76 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac
k, ScriptValue* thisArg) const |
| 77 { |
| 78 if (!m_styleDeclaration) |
| 79 return; |
| 80 RefPtr<CSSVariablesIterator> iterator = m_styleDeclaration->variablesIterato
r(); |
| 81 while (!iterator->atEnd()) { |
| 82 String name = iterator->name(); |
| 83 String value = iterator->value(); |
| 84 if (thisArg) |
| 85 callback->handleItem(*thisArg, value, name, const_cast<CSSVariablesM
ap*>(this)); |
| 86 else |
| 87 callback->handleItem(value, name, const_cast<CSSVariablesMap*>(this)
); |
| 88 iterator->advance(); |
| 89 } |
| 90 } |
| 91 |
| 92 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac
k, ScriptValue thisArg) const |
| 93 { |
| 94 forEach(callback, &thisArg); |
| 95 } |
| 96 |
| 97 void CSSVariablesMap::forEach(PassRefPtr<CSSVariablesMapForEachCallback> callbac
k) const |
| 98 { |
| 99 forEach(callback, 0); |
| 100 } |
| 101 |
76 } // namespace WebCore | 102 } // namespace WebCore |
OLD | NEW |