| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return documentStyleSheetCollection().styleSheetsForStyleSheetList(); | 133 return documentStyleSheetCollection().styleSheetsForStyleSheetList(); |
| 134 | 134 |
| 135 return ensureStyleSheetCollectionFor(treeScope) | 135 return ensureStyleSheetCollectionFor(treeScope) |
| 136 ->styleSheetsForStyleSheetList(); | 136 ->styleSheetsForStyleSheetList(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void StyleEngine::injectAuthorSheet(StyleSheetContents* authorSheet) { | 139 void StyleEngine::injectAuthorSheet(StyleSheetContents* authorSheet) { |
| 140 m_injectedAuthorStyleSheets.push_back(TraceWrapperMember<CSSStyleSheet>( | 140 m_injectedAuthorStyleSheets.push_back(TraceWrapperMember<CSSStyleSheet>( |
| 141 this, CSSStyleSheet::create(authorSheet, *m_document))); | 141 this, CSSStyleSheet::create(authorSheet, *m_document))); |
| 142 markDocumentDirty(); | 142 markDocumentDirty(); |
| 143 resolverChanged(AnalyzedStyleUpdate); | |
| 144 } | 143 } |
| 145 | 144 |
| 146 CSSStyleSheet& StyleEngine::ensureInspectorStyleSheet() { | 145 CSSStyleSheet& StyleEngine::ensureInspectorStyleSheet() { |
| 147 if (m_inspectorStyleSheet) | 146 if (m_inspectorStyleSheet) |
| 148 return *m_inspectorStyleSheet; | 147 return *m_inspectorStyleSheet; |
| 149 | 148 |
| 150 StyleSheetContents* contents = | 149 StyleSheetContents* contents = |
| 151 StyleSheetContents::create(CSSParserContext(*m_document, nullptr)); | 150 StyleSheetContents::create(CSSParserContext(*m_document, nullptr)); |
| 152 m_inspectorStyleSheet = CSSStyleSheet::create(contents, *m_document); | 151 m_inspectorStyleSheet = CSSStyleSheet::create(contents, *m_document); |
| 153 markDocumentDirty(); | 152 markDocumentDirty(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // After detaching document, collection could be null. In the case, | 226 // After detaching document, collection could be null. In the case, |
| 228 // we should not update anything. Instead, just return. | 227 // we should not update anything. Instead, just return. |
| 229 if (!collection) | 228 if (!collection) |
| 230 return; | 229 return; |
| 231 collection->removeStyleSheetCandidateNode(node); | 230 collection->removeStyleSheetCandidateNode(node); |
| 232 | 231 |
| 233 markTreeScopeDirty(treeScope); | 232 markTreeScopeDirty(treeScope); |
| 234 } | 233 } |
| 235 | 234 |
| 236 void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) { | 235 void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) { |
| 237 if (!node.isConnected()) | 236 if (node.isConnected()) |
| 238 return; | 237 markTreeScopeDirty(node.treeScope()); |
| 239 | |
| 240 markTreeScopeDirty(node.treeScope()); | |
| 241 resolverChanged(AnalyzedStyleUpdate); | |
| 242 } | 238 } |
| 243 | 239 |
| 244 void StyleEngine::mediaQueriesChangedInScope(TreeScope& treeScope) { | 240 void StyleEngine::mediaQueriesChangedInScope(TreeScope& treeScope) { |
| 245 if (ScopedStyleResolver* resolver = treeScope.scopedStyleResolver()) | 241 if (ScopedStyleResolver* resolver = treeScope.scopedStyleResolver()) |
| 246 resolver->setNeedsAppendAllSheets(); | 242 resolver->setNeedsAppendAllSheets(); |
| 247 setNeedsActiveStyleUpdate(treeScope); | 243 setNeedsActiveStyleUpdate(treeScope); |
| 248 } | 244 } |
| 249 | 245 |
| 250 void StyleEngine::watchedSelectorsChanged() { | 246 void StyleEngine::watchedSelectorsChanged() { |
| 251 m_globalRuleSet.initWatchedSelectorsRuleSet(document()); | 247 m_globalRuleSet.initWatchedSelectorsRuleSet(document()); |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 } | 1173 } |
| 1178 | 1174 |
| 1179 DEFINE_TRACE_WRAPPERS(StyleEngine) { | 1175 DEFINE_TRACE_WRAPPERS(StyleEngine) { |
| 1180 for (auto sheet : m_injectedAuthorStyleSheets) { | 1176 for (auto sheet : m_injectedAuthorStyleSheets) { |
| 1181 visitor->traceWrappers(sheet); | 1177 visitor->traceWrappers(sheet); |
| 1182 } | 1178 } |
| 1183 visitor->traceWrappers(m_documentStyleSheetCollection); | 1179 visitor->traceWrappers(m_documentStyleSheetCollection); |
| 1184 } | 1180 } |
| 1185 | 1181 |
| 1186 } // namespace blink | 1182 } // namespace blink |
| OLD | NEW |