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

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

Issue 751593002: Removed add/removeScopedStyleResolver from StyleEngine (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/StyleEngine.h » ('j') | 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) 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 process(href, charset); 282 process(href, charset);
283 return InsertionDone; 283 return InsertionDone;
284 } 284 }
285 285
286 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) 286 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
287 { 287 {
288 CharacterData::removedFrom(insertionPoint); 288 CharacterData::removedFrom(insertionPoint);
289 if (!insertionPoint->inDocument()) 289 if (!insertionPoint->inDocument())
290 return; 290 return;
291 291
292 // No need to remove XSLStyleSheet from StyleEngine.
292 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this )) 293 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this ))
293 document().styleEngine()->removeStyleSheetCandidateNode(this); 294 document().styleEngine()->removeStyleSheetCandidateNode(this);
294 295
295 // No need to remove XSLStyleSheet from StyleEngine.
296 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet; 296 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet;
297
298 if (m_sheet) { 297 if (m_sheet) {
299 ASSERT(m_sheet->ownerNode() == this); 298 ASSERT(m_sheet->ownerNode() == this);
300 clearSheet(); 299 clearSheet();
301 } else if (resource()) {
302 ASSERT(m_loading);
303 document().styleEngine()->removePendingSheet(this);
304 clearResource();
305 } 300 }
306 301
302 // No need to remove pending sheets.
303 clearResource();
304
307 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 305 // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
308 if (document().isActive()) 306 if (document().isActive())
309 document().removedStyleSheet(removedSheet.get()); 307 document().removedStyleSheet(removedSheet.get());
310 } 308 }
311 309
312 void ProcessingInstruction::clearSheet() 310 void ProcessingInstruction::clearSheet()
313 { 311 {
314 ASSERT(m_sheet); 312 ASSERT(m_sheet);
315 if (m_sheet->isLoading()) 313 if (m_sheet->isLoading())
316 document().styleEngine()->removePendingSheet(this); 314 document().styleEngine()->removePendingSheet(this);
317 m_sheet.release()->clearOwnerNode(); 315 m_sheet.release()->clearOwnerNode();
318 } 316 }
319 317
320 void ProcessingInstruction::trace(Visitor* visitor) 318 void ProcessingInstruction::trace(Visitor* visitor)
321 { 319 {
322 visitor->trace(m_sheet); 320 visitor->trace(m_sheet);
323 CharacterData::trace(visitor); 321 CharacterData::trace(visitor);
324 } 322 }
325 323
326 } // namespace 324 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698