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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (m_registeredAsCandidate) { | 79 if (m_registeredAsCandidate) { |
80 ShadowRoot* shadowRoot = element.containingShadowRoot(); | 80 ShadowRoot* shadowRoot = element.containingShadowRoot(); |
81 if (!shadowRoot) | 81 if (!shadowRoot) |
82 shadowRoot = insertionPoint->containingShadowRoot(); | 82 shadowRoot = insertionPoint->containingShadowRoot(); |
83 | 83 |
84 document.styleEngine().removeStyleSheetCandidateNode( | 84 document.styleEngine().removeStyleSheetCandidateNode( |
85 element, shadowRoot ? *toTreeScope(shadowRoot) : toTreeScope(document)); | 85 element, shadowRoot ? *toTreeScope(shadowRoot) : toTreeScope(document)); |
86 m_registeredAsCandidate = false; | 86 m_registeredAsCandidate = false; |
87 } | 87 } |
88 | 88 |
89 StyleSheet* removedSheet = m_sheet.get(); | 89 if (m_sheet) { |
90 | |
91 if (m_sheet) | |
92 clearSheet(element); | 90 clearSheet(element); |
93 if (removedSheet) | 91 if (element.isConnected()) |
94 document.styleEngine().setNeedsActiveStyleUpdate(removedSheet, | 92 document.styleEngine().setNeedsActiveStyleUpdate(element.treeScope()); |
95 AnalyzedStyleUpdate); | 93 } |
96 } | 94 } |
97 | 95 |
98 StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) { | 96 StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) { |
99 if (m_createdByParser) | 97 if (m_createdByParser) |
100 return ProcessingSuccessful; | 98 return ProcessingSuccessful; |
101 | 99 |
102 return process(element); | 100 return process(element); |
103 } | 101 } |
104 | 102 |
105 StyleElement::ProcessingResult StyleElement::finishParsingChildren( | 103 StyleElement::ProcessingResult StyleElement::finishParsingChildren( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 202 |
205 void StyleElement::startLoadingDynamicSheet(Document& document) { | 203 void StyleElement::startLoadingDynamicSheet(Document& document) { |
206 document.styleEngine().addPendingSheet(m_styleEngineContext); | 204 document.styleEngine().addPendingSheet(m_styleEngineContext); |
207 } | 205 } |
208 | 206 |
209 DEFINE_TRACE(StyleElement) { | 207 DEFINE_TRACE(StyleElement) { |
210 visitor->trace(m_sheet); | 208 visitor->trace(m_sheet); |
211 } | 209 } |
212 | 210 |
213 } // namespace blink | 211 } // namespace blink |
OLD | NEW |