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

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, 1 month 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 process(href, charset); 265 process(href, charset);
266 return InsertionDone; 266 return InsertionDone;
267 } 267 }
268 268
269 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) 269 void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint)
270 { 270 {
271 CharacterData::removedFrom(insertionPoint); 271 CharacterData::removedFrom(insertionPoint);
272 if (!insertionPoint->inDocument()) 272 if (!insertionPoint->inDocument())
273 return; 273 return;
274 274
275 // No need to remove XSLStyleSheet from StyleEngine.
275 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this )) 276 if (!DocumentXSLT::processingInstructionRemovedFromDocument(document(), this ))
276 document().styleEngine()->removeStyleSheetCandidateNode(this); 277 document().styleEngine()->removeStyleSheetCandidateNode(this);
277 278
278 // No need to remove XSLStyleSheet from StyleEngine.
279 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet; 279 RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet;
280
281 if (m_sheet) { 280 if (m_sheet) {
282 ASSERT(m_sheet->ownerNode() == this); 281 ASSERT(m_sheet->ownerNode() == this);
283 clearSheet(); 282 clearSheet();
284 } else if (resource()) {
285 ASSERT(m_loading);
286 document().styleEngine()->removePendingSheet(this);
287 clearResource();
288 } 283 }
289 284
285 // No need to remove pending sheets.
286 clearResource();
287
290 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 288 // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
291 if (document().isActive()) 289 if (document().isActive())
292 document().removedStyleSheet(removedSheet.get()); 290 document().removedStyleSheet(removedSheet.get());
293 } 291 }
294 292
295 void ProcessingInstruction::clearSheet() 293 void ProcessingInstruction::clearSheet()
296 { 294 {
297 ASSERT(m_sheet); 295 ASSERT(m_sheet);
298 if (m_sheet->isLoading()) 296 if (m_sheet->isLoading())
299 document().styleEngine()->removePendingSheet(this); 297 document().styleEngine()->removePendingSheet(this);
300 m_sheet.release()->clearOwnerNode(); 298 m_sheet.release()->clearOwnerNode();
301 } 299 }
302 300
303 void ProcessingInstruction::trace(Visitor* visitor) 301 void ProcessingInstruction::trace(Visitor* visitor)
304 { 302 {
305 visitor->trace(m_sheet); 303 visitor->trace(m_sheet);
306 CharacterData::trace(visitor); 304 CharacterData::trace(visitor);
307 } 305 }
308 306
309 } // namespace 307 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698