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/ProcessingInstruction.cpp

Issue 2546393002: Make setNeedsActiveStyleUpdate mark treescope dirty only. (Closed)
Patch Set: Rebased 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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2008, 2009 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (!insertionPoint->isConnected()) 268 if (!insertionPoint->isConnected())
269 return; 269 return;
270 270
271 // No need to remove XSLStyleSheet from StyleEngine. 271 // No need to remove XSLStyleSheet from StyleEngine.
272 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), 272 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(),
273 this)) { 273 this)) {
274 document().styleEngine().removeStyleSheetCandidateNode(*this, 274 document().styleEngine().removeStyleSheetCandidateNode(*this,
275 *insertionPoint); 275 *insertionPoint);
276 } 276 }
277 277
278 StyleSheet* removedSheet = m_sheet;
279 if (m_sheet) { 278 if (m_sheet) {
280 DCHECK_EQ(m_sheet->ownerNode(), this); 279 DCHECK_EQ(m_sheet->ownerNode(), this);
281 clearSheet(); 280 clearSheet();
282 } 281 }
283 282
284 // No need to remove pending sheets. 283 // No need to remove pending sheets.
285 clearResource(); 284 clearResource();
286 285
286 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
287 // updates are async. https://crbug.com/567021
287 // If we're in document teardown, then we don't need to do any notification of 288 // If we're in document teardown, then we don't need to do any notification of
288 // our sheet's removal. 289 // our sheet's removal.
289 if (document().isActive()) 290 if (document().isActive())
290 document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, 291 document().styleEngine().resolverChanged(FullStyleUpdate);
291 FullStyleUpdate);
292 } 292 }
293 293
294 void ProcessingInstruction::clearSheet() { 294 void ProcessingInstruction::clearSheet() {
295 DCHECK(m_sheet); 295 DCHECK(m_sheet);
296 if (m_sheet->isLoading()) 296 if (m_sheet->isLoading())
297 document().styleEngine().removePendingSheet(*this, m_styleEngineContext); 297 document().styleEngine().removePendingSheet(*this, m_styleEngineContext);
298 m_sheet.release()->clearOwnerNode(); 298 m_sheet.release()->clearOwnerNode();
299 } 299 }
300 300
301 DEFINE_TRACE(ProcessingInstruction) { 301 DEFINE_TRACE(ProcessingInstruction) {
302 visitor->trace(m_sheet); 302 visitor->trace(m_sheet);
303 visitor->trace(m_listenerForXSLT); 303 visitor->trace(m_listenerForXSLT);
304 CharacterData::trace(visitor); 304 CharacterData::trace(visitor);
305 ResourceOwner<StyleSheetResource>::trace(visitor); 305 ResourceOwner<StyleSheetResource>::trace(visitor);
306 } 306 }
307 307
308 } // namespace blink 308 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSStyleSheet.cpp ('k') | third_party/WebKit/Source/core/dom/StyleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698