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

Side by Side Diff: sky/engine/core/dom/StyleElement.cpp

Issue 774953002: Always Reconstruct when stylesheets change. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (m_registeredAsCandidate) { 85 if (m_registeredAsCandidate) {
86 document.styleEngine()->removeStyleSheetCandidateNode(element, scopingNo de, treeScope); 86 document.styleEngine()->removeStyleSheetCandidateNode(element, scopingNo de, treeScope);
87 m_registeredAsCandidate = false; 87 m_registeredAsCandidate = false;
88 } 88 }
89 89
90 RefPtr<StyleSheet> removedSheet = m_sheet.get(); 90 RefPtr<StyleSheet> removedSheet = m_sheet.get();
91 91
92 if (m_sheet) 92 if (m_sheet)
93 clearSheet(element); 93 clearSheet(element);
94 if (removedSheet) 94 if (removedSheet)
95 document.removedStyleSheet(removedSheet.get(), AnalyzedStyleUpdate); 95 document.removedStyleSheet(removedSheet.get());
96 } 96 }
97 97
98 void StyleElement::clearDocumentData(Document& document, Element* element) 98 void StyleElement::clearDocumentData(Document& document, Element* element)
99 { 99 {
100 if (m_sheet) 100 if (m_sheet)
101 m_sheet->clearOwnerNode(); 101 m_sheet->clearOwnerNode();
102 102
103 if (element->inDocument()) { 103 if (element->inDocument()) {
104 ContainerNode* scopingNode = isHTMLStyleElement(element) ? toHTMLStyleEl ement(element)->scopingNode() : 0; 104 ContainerNode* scopingNode = isHTMLStyleElement(element) ? toHTMLStyleEl ement(element)->scopingNode() : 0;
105 TreeScope& treeScope = scopingNode ? scopingNode->treeScope() : element- >treeScope(); 105 TreeScope& treeScope = scopingNode ? scopingNode->treeScope() : element- >treeScope();
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g et())) { 154 if (screenEval.eval(mediaQueries.get()) || printEval.eval(mediaQueries.g et())) {
155 m_loading = true; 155 m_loading = true;
156 TextPosition startPosition = m_startPosition == TextPosition::belowR angePosition() ? TextPosition::minimumPosition() : m_startPosition; 156 TextPosition startPosition = m_startPosition == TextPosition::belowR angePosition() ? TextPosition::minimumPosition() : m_startPosition;
157 m_sheet = document.styleEngine()->createSheet(e, text, startPosition , m_createdByParser); 157 m_sheet = document.styleEngine()->createSheet(e, text, startPosition , m_createdByParser);
158 m_sheet->setMediaQueries(mediaQueries.release()); 158 m_sheet->setMediaQueries(mediaQueries.release());
159 m_loading = false; 159 m_loading = false;
160 } 160 }
161 } 161 }
162 162
163 163
164 document.styleResolverMayHaveChanged(); 164 document.styleResolverChanged();
165 } 165 }
166 166
167 } 167 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/ShadowTreeStyleSheetCollection.cpp ('k') | sky/engine/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698