OLD | NEW |
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 *insertionPoint); | 275 *insertionPoint); |
276 } | 276 } |
277 | 277 |
278 if (m_sheet) { | 278 if (m_sheet) { |
279 DCHECK_EQ(m_sheet->ownerNode(), this); | 279 DCHECK_EQ(m_sheet->ownerNode(), this); |
280 clearSheet(); | 280 clearSheet(); |
281 } | 281 } |
282 | 282 |
283 // No need to remove pending sheets. | 283 // No need to remove pending sheets. |
284 clearResource(); | 284 clearResource(); |
285 | |
286 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet | |
287 // updates are async. https://crbug.com/567021 | |
288 // If we're in document teardown, then we don't need to do any notification of | |
289 // our sheet's removal. | |
290 if (document().isActive()) | |
291 document().styleEngine().resolverChanged(FullStyleUpdate); | |
292 } | 285 } |
293 | 286 |
294 void ProcessingInstruction::clearSheet() { | 287 void ProcessingInstruction::clearSheet() { |
295 DCHECK(m_sheet); | 288 DCHECK(m_sheet); |
296 if (m_sheet->isLoading()) | 289 if (m_sheet->isLoading()) |
297 document().styleEngine().removePendingSheet(*this, m_styleEngineContext); | 290 document().styleEngine().removePendingSheet(*this, m_styleEngineContext); |
298 m_sheet.release()->clearOwnerNode(); | 291 m_sheet.release()->clearOwnerNode(); |
299 } | 292 } |
300 | 293 |
301 DEFINE_TRACE(ProcessingInstruction) { | 294 DEFINE_TRACE(ProcessingInstruction) { |
302 visitor->trace(m_sheet); | 295 visitor->trace(m_sheet); |
303 visitor->trace(m_listenerForXSLT); | 296 visitor->trace(m_listenerForXSLT); |
304 CharacterData::trace(visitor); | 297 CharacterData::trace(visitor); |
305 ResourceOwner<StyleSheetResource>::trace(visitor); | 298 ResourceOwner<StyleSheetResource>::trace(visitor); |
306 } | 299 } |
307 | 300 |
308 } // namespace blink | 301 } // namespace blink |
OLD | NEW |