Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleElement.cpp

Issue 2546393002: Make setNeedsActiveStyleUpdate mark treescope dirty only. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
94 // updates are async. https://crbug.com/567021
95 document.styleEngine().resolverChanged(AnalyzedStyleUpdate);
96 }
97 }
96 } 98 }
97 99
98 StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) { 100 StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) {
99 if (m_createdByParser) 101 if (m_createdByParser)
100 return ProcessingSuccessful; 102 return ProcessingSuccessful;
101 103
102 return process(element); 104 return process(element);
103 } 105 }
104 106
105 StyleElement::ProcessingResult StyleElement::finishParsingChildren( 107 StyleElement::ProcessingResult StyleElement::finishParsingChildren(
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 206
205 void StyleElement::startLoadingDynamicSheet(Document& document) { 207 void StyleElement::startLoadingDynamicSheet(Document& document) {
206 document.styleEngine().addPendingSheet(m_styleEngineContext); 208 document.styleEngine().addPendingSheet(m_styleEngineContext);
207 } 209 }
208 210
209 DEFINE_TRACE(StyleElement) { 211 DEFINE_TRACE(StyleElement) {
210 visitor->trace(m_sheet); 212 visitor->trace(m_sheet);
211 } 213 }
212 214
213 } // namespace blink 215 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698