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

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

Issue 980343002: Skip removal of stylesheet candidate node if not added. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 clearSheet(element); 107 clearSheet(element);
108 if (removedSheet) 108 if (removedSheet)
109 document.removedStyleSheet(removedSheet.get(), AnalyzedStyleUpdate); 109 document.removedStyleSheet(removedSheet.get(), AnalyzedStyleUpdate);
110 } 110 }
111 111
112 void StyleElement::clearDocumentData(Document& document, Element* element) 112 void StyleElement::clearDocumentData(Document& document, Element* element)
113 { 113 {
114 if (m_sheet) 114 if (m_sheet)
115 m_sheet->clearOwnerNode(); 115 m_sheet->clearOwnerNode();
116 116
117 if (element->inDocument()) { 117 if (m_registeredAsCandidate) {
118 // HTMLLinkElement in shadow tree is not supported. 118 ASSERT(element->inDocument());
119 TreeScope& treeScope = isHTMLStyleElement(element) || isSVGStyleElement( element) ? element->treeScope() : element->document(); 119 document.styleEngine().removeStyleSheetCandidateNode(element, element->t reeScope());
120 document.styleEngine().removeStyleSheetCandidateNode(element, treeScope) ;
121 } 120 }
122 } 121 }
123 122
124 void StyleElement::childrenChanged(Element* element) 123 void StyleElement::childrenChanged(Element* element)
125 { 124 {
126 ASSERT(element); 125 ASSERT(element);
127 if (m_createdByParser) 126 if (m_createdByParser)
128 return; 127 return;
129 128
130 process(element); 129 process(element);
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 { 222 {
224 document.styleEngine().addPendingSheet(); 223 document.styleEngine().addPendingSheet();
225 } 224 }
226 225
227 DEFINE_TRACE(StyleElement) 226 DEFINE_TRACE(StyleElement)
228 { 227 {
229 visitor->trace(m_sheet); 228 visitor->trace(m_sheet);
230 } 229 }
231 230
232 } 231 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698