OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 m_contents->setMutable(); | 153 m_contents->setMutable(); |
154 | 154 |
155 // Any existing CSSOM wrappers need to be connected to the copied child rules. | 155 // Any existing CSSOM wrappers need to be connected to the copied child rules. |
156 reattachChildRuleCSSOMWrappers(); | 156 reattachChildRuleCSSOMWrappers(); |
157 } | 157 } |
158 | 158 |
159 void CSSStyleSheet::didMutateRules() { | 159 void CSSStyleSheet::didMutateRules() { |
160 DCHECK(m_contents->isMutable()); | 160 DCHECK(m_contents->isMutable()); |
161 DCHECK_LE(m_contents->clientSize(), 1u); | 161 DCHECK_LE(m_contents->clientSize(), 1u); |
162 | 162 |
163 didMutate(); | 163 Document* owner = ownerDocument(); |
| 164 if (!owner) |
| 165 return; |
| 166 if (ownerNode() && ownerNode()->isConnected()) { |
| 167 owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope()); |
| 168 if (StyleResolver* resolver = owner->styleEngine().resolver()) |
| 169 resolver->invalidateMatchedPropertiesCache(); |
| 170 } |
164 } | 171 } |
165 | 172 |
166 void CSSStyleSheet::didMutate() { | 173 void CSSStyleSheet::didMutate() { |
167 Document* owner = ownerDocument(); | 174 Document* owner = ownerDocument(); |
168 if (!owner) | 175 if (!owner) |
169 return; | 176 return; |
170 if (ownerNode() && ownerNode()->isConnected()) | 177 if (ownerNode() && ownerNode()->isConnected()) |
171 owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope()); | 178 owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope()); |
172 } | 179 } |
173 | 180 |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 visitor->trace(m_deviceDependentMediaQueryResults); | 441 visitor->trace(m_deviceDependentMediaQueryResults); |
435 visitor->trace(m_ownerNode); | 442 visitor->trace(m_ownerNode); |
436 visitor->trace(m_ownerRule); | 443 visitor->trace(m_ownerRule); |
437 visitor->trace(m_mediaCSSOMWrapper); | 444 visitor->trace(m_mediaCSSOMWrapper); |
438 visitor->trace(m_childRuleCSSOMWrappers); | 445 visitor->trace(m_childRuleCSSOMWrappers); |
439 visitor->trace(m_ruleListCSSOMWrapper); | 446 visitor->trace(m_ruleListCSSOMWrapper); |
440 StyleSheet::trace(visitor); | 447 StyleSheet::trace(visitor); |
441 } | 448 } |
442 | 449 |
443 } // namespace blink | 450 } // namespace blink |
OLD | NEW |