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

Side by Side Diff: third_party/WebKit/Source/core/dom/ProcessingInstruction.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) 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) { 266 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) {
267 CharacterData::removedFrom(insertionPoint); 267 CharacterData::removedFrom(insertionPoint);
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(), this)) 272 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this))
273 document().styleEngine().removeStyleSheetCandidateNode(*this); 273 document().styleEngine().removeStyleSheetCandidateNode(*this);
274 274
275 StyleSheet* removedSheet = m_sheet;
276 if (m_sheet) { 275 if (m_sheet) {
277 DCHECK_EQ(m_sheet->ownerNode(), this); 276 DCHECK_EQ(m_sheet->ownerNode(), this);
278 clearSheet(); 277 clearSheet();
278 document().styleEngine().setNeedsActiveStyleUpdate(treeScope());
279 } 279 }
280 280
281 // No need to remove pending sheets. 281 // No need to remove pending sheets.
282 clearResource(); 282 clearResource();
283 283
284 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
285 // updates are async. https://crbug.com/567021
284 // If we're in document teardown, then we don't need to do any notification of 286 // If we're in document teardown, then we don't need to do any notification of
285 // our sheet's removal. 287 // our sheet's removal.
286 if (document().isActive()) 288 if (document().isActive())
287 document().styleEngine().setNeedsActiveStyleUpdate(removedSheet, 289 document().styleEngine().resolverChanged(FullStyleUpdate);
288 FullStyleUpdate);
289 } 290 }
290 291
291 void ProcessingInstruction::clearSheet() { 292 void ProcessingInstruction::clearSheet() {
292 DCHECK(m_sheet); 293 DCHECK(m_sheet);
293 if (m_sheet->isLoading()) 294 if (m_sheet->isLoading())
294 document().styleEngine().removePendingSheet(*this, m_styleEngineContext); 295 document().styleEngine().removePendingSheet(*this, m_styleEngineContext);
295 m_sheet.release()->clearOwnerNode(); 296 m_sheet.release()->clearOwnerNode();
296 } 297 }
297 298
298 DEFINE_TRACE(ProcessingInstruction) { 299 DEFINE_TRACE(ProcessingInstruction) {
299 visitor->trace(m_sheet); 300 visitor->trace(m_sheet);
300 visitor->trace(m_listenerForXSLT); 301 visitor->trace(m_listenerForXSLT);
301 CharacterData::trace(visitor); 302 CharacterData::trace(visitor);
302 ResourceOwner<StyleSheetResource>::trace(visitor); 303 ResourceOwner<StyleSheetResource>::trace(visitor);
303 } 304 }
304 305
305 } // namespace blink 306 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698