| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007 Rob Buis | 2 * Copyright (C) 2006, 2007 Rob Buis |
| 3 * Copyright (C) 2008 Apple, Inc. All rights reserved. | 3 * Copyright (C) 2008 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 if (shadowRoot) | 91 if (shadowRoot) |
| 92 shadowRoot->unregisterScopedHTMLStyleChild(); | 92 shadowRoot->unregisterScopedHTMLStyleChild(); |
| 93 | 93 |
| 94 Document& document = element->document(); | 94 Document& document = element->document(); |
| 95 if (m_registeredAsCandidate) { | 95 if (m_registeredAsCandidate) { |
| 96 document.styleEngine().removeStyleSheetCandidateNode(element, shadowRoot
? *toTreeScope(shadowRoot) : toTreeScope(document)); | 96 document.styleEngine().removeStyleSheetCandidateNode(element, shadowRoot
? *toTreeScope(shadowRoot) : toTreeScope(document)); |
| 97 m_registeredAsCandidate = false; | 97 m_registeredAsCandidate = false; |
| 98 } | 98 } |
| 99 | 99 |
| 100 StyleSheet* removedSheet = m_sheet.get(); | 100 if (m_sheet) { |
| 101 | |
| 102 if (m_sheet) | |
| 103 clearSheet(element); | 101 clearSheet(element); |
| 104 if (removedSheet) | 102 if (element->inShadowIncludingDocument()) |
| 105 document.styleEngine().setNeedsActiveStyleUpdate(removedSheet, AnalyzedS
tyleUpdate); | 103 document.styleEngine().setNeedsActiveStyleUpdate(element->treeScope(
)); |
| 104 } |
| 106 } | 105 } |
| 107 | 106 |
| 108 void StyleElement::clearDocumentData(Document& document, Element* element) | 107 void StyleElement::clearDocumentData(Document& document, Element* element) |
| 109 { | 108 { |
| 110 if (m_sheet) | 109 if (m_sheet) |
| 111 m_sheet->clearOwnerNode(); | 110 m_sheet->clearOwnerNode(); |
| 112 | 111 |
| 113 if (m_registeredAsCandidate) { | 112 if (m_registeredAsCandidate) { |
| 114 DCHECK(element->inShadowIncludingDocument()); | 113 DCHECK(element->inShadowIncludingDocument()); |
| 115 document.styleEngine().removeStyleSheetCandidateNode(element, element->t
reeScope()); | 114 document.styleEngine().removeStyleSheetCandidateNode(element, element->t
reeScope()); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 { | 226 { |
| 228 document.styleEngine().addPendingSheet(m_styleEngineContext); | 227 document.styleEngine().addPendingSheet(m_styleEngineContext); |
| 229 } | 228 } |
| 230 | 229 |
| 231 DEFINE_TRACE(StyleElement) | 230 DEFINE_TRACE(StyleElement) |
| 232 { | 231 { |
| 233 visitor->trace(m_sheet); | 232 visitor->trace(m_sheet); |
| 234 } | 233 } |
| 235 | 234 |
| 236 } // namespace blink | 235 } // namespace blink |
| OLD | NEW |