| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 m_contents->registerClient(this); | 131 m_contents->registerClient(this); |
| 132 } | 132 } |
| 133 | 133 |
| 134 CSSStyleSheet::~CSSStyleSheet() | 134 CSSStyleSheet::~CSSStyleSheet() |
| 135 { | 135 { |
| 136 } | 136 } |
| 137 | 137 |
| 138 void CSSStyleSheet::willMutateRules() | 138 void CSSStyleSheet::willMutateRules() |
| 139 { | 139 { |
| 140 // If we are the only client it is safe to mutate. | 140 // If we are the only client it is safe to mutate. |
| 141 if (m_contents->clientSize() <= 1 && !m_contents->isInMemoryCache()) { | 141 if (m_contents->clientSize() <= 1 && !m_contents->isReferencedFromResource()
) { |
| 142 m_contents->clearRuleSet(); | 142 m_contents->clearRuleSet(); |
| 143 if (Document* document = ownerDocument()) | 143 if (Document* document = ownerDocument()) |
| 144 m_contents->removeSheetFromCache(document); | 144 m_contents->removeSheetFromCache(document); |
| 145 m_contents->setMutable(); | 145 m_contents->setMutable(); |
| 146 return; | 146 return; |
| 147 } | 147 } |
| 148 // Only cacheable stylesheets should have multiple clients. | 148 // Only cacheable stylesheets should have multiple clients. |
| 149 ASSERT(m_contents->isCacheable()); | 149 ASSERT(m_contents->isCacheable()); |
| 150 | 150 |
| 151 // Copy-on-write. | 151 // Copy-on-write. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 visitor->trace(m_mediaQueries); | 430 visitor->trace(m_mediaQueries); |
| 431 visitor->trace(m_ownerNode); | 431 visitor->trace(m_ownerNode); |
| 432 visitor->trace(m_ownerRule); | 432 visitor->trace(m_ownerRule); |
| 433 visitor->trace(m_mediaCSSOMWrapper); | 433 visitor->trace(m_mediaCSSOMWrapper); |
| 434 visitor->trace(m_childRuleCSSOMWrappers); | 434 visitor->trace(m_childRuleCSSOMWrappers); |
| 435 visitor->trace(m_ruleListCSSOMWrapper); | 435 visitor->trace(m_ruleListCSSOMWrapper); |
| 436 StyleSheet::trace(visitor); | 436 StyleSheet::trace(visitor); |
| 437 } | 437 } |
| 438 | 438 |
| 439 } // namespace blink | 439 } // namespace blink |
| OLD | NEW |