| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r
ights reserved. |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 m_resolver->appendAuthorStyleSheets(documentStyleSheetCollection()->activeAu
thorStyleSheets()); | 387 m_resolver->appendAuthorStyleSheets(documentStyleSheetCollection()->activeAu
thorStyleSheets()); |
| 388 for (TreeScope* treeScope : m_activeTreeScopes) { | 388 for (TreeScope* treeScope : m_activeTreeScopes) { |
| 389 if (TreeScopeStyleSheetCollection* collection = m_styleSheetCollectionMa
p.get(treeScope)) | 389 if (TreeScopeStyleSheetCollection* collection = m_styleSheetCollectionMa
p.get(treeScope)) |
| 390 m_resolver->appendAuthorStyleSheets(collection->activeAuthorStyleShe
ets()); | 390 m_resolver->appendAuthorStyleSheets(collection->activeAuthorStyleShe
ets()); |
| 391 } | 391 } |
| 392 m_resolver->finishAppendAuthorStyleSheets(); | 392 m_resolver->finishAppendAuthorStyleSheets(); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void StyleEngine::createResolver() | 395 void StyleEngine::createResolver() |
| 396 { | 396 { |
| 397 TRACE_EVENT0("blink", "StyleEngine::createResolver"); | 397 TRACE_EVENT1("blink", "StyleEngine::createResolver", "frame", document().fra
me()); |
| 398 // It is a programming error to attempt to resolve style on a Document | 398 // It is a programming error to attempt to resolve style on a Document |
| 399 // which is not in a frame. Code which hits this should have checked | 399 // which is not in a frame. Code which hits this should have checked |
| 400 // Document::isActive() before calling into code which could get here. | 400 // Document::isActive() before calling into code which could get here. |
| 401 | 401 |
| 402 ASSERT(document().frame()); | 402 ASSERT(document().frame()); |
| 403 | 403 |
| 404 m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document)); | 404 m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document)); |
| 405 | 405 |
| 406 // A scoped style resolver for document will be created during | 406 // A scoped style resolver for document will be created during |
| 407 // appendActiveAuthorStyleSheets if needed. | 407 // appendActiveAuthorStyleSheets if needed. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 418 // StyleEngine::shadowRootRemovedFromDocument removes not-in-document | 418 // StyleEngine::shadowRootRemovedFromDocument removes not-in-document |
| 419 // treescopes from activeTreeScopes. StyleEngine::didRemoveShadowRoot | 419 // treescopes from activeTreeScopes. StyleEngine::didRemoveShadowRoot |
| 420 // removes treescopes which are being destroyed from activeTreeScopes. | 420 // removes treescopes which are being destroyed from activeTreeScopes. |
| 421 // So we need to clearScopedStyleResolver for treescopes which have been | 421 // So we need to clearScopedStyleResolver for treescopes which have been |
| 422 // just removed from document. If document is destroyed before invoking | 422 // just removed from document. If document is destroyed before invoking |
| 423 // updateActiveStyleSheets, the treescope has a scopedStyleResolver which | 423 // updateActiveStyleSheets, the treescope has a scopedStyleResolver which |
| 424 // has destroyed StyleSheetContents. | 424 // has destroyed StyleSheetContents. |
| 425 for (TreeScope* treeScope : m_activeTreeScopes) | 425 for (TreeScope* treeScope : m_activeTreeScopes) |
| 426 treeScope->clearScopedStyleResolver(); | 426 treeScope->clearScopedStyleResolver(); |
| 427 | 427 |
| 428 m_resolver.clear(); | 428 if (m_resolver) { |
| 429 TRACE_EVENT1("blink", "StyleEngine::clearResolver", "frame", document().
frame()); |
| 430 m_resolver.clear(); |
| 431 } |
| 429 } | 432 } |
| 430 | 433 |
| 431 void StyleEngine::clearMasterResolver() | 434 void StyleEngine::clearMasterResolver() |
| 432 { | 435 { |
| 433 if (Document* master = this->master()) | 436 if (Document* master = this->master()) |
| 434 master->styleEngine().clearResolver(); | 437 master->styleEngine().clearResolver(); |
| 435 } | 438 } |
| 436 | 439 |
| 437 unsigned StyleEngine::resolverAccessCount() const | 440 unsigned StyleEngine::resolverAccessCount() const |
| 438 { | 441 { |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 visitor->trace(m_dirtyTreeScopes); | 726 visitor->trace(m_dirtyTreeScopes); |
| 724 visitor->trace(m_activeTreeScopes); | 727 visitor->trace(m_activeTreeScopes); |
| 725 visitor->trace(m_fontSelector); | 728 visitor->trace(m_fontSelector); |
| 726 visitor->trace(m_textToSheetCache); | 729 visitor->trace(m_textToSheetCache); |
| 727 visitor->trace(m_sheetToTextCache); | 730 visitor->trace(m_sheetToTextCache); |
| 728 #endif | 731 #endif |
| 729 CSSFontSelectorClient::trace(visitor); | 732 CSSFontSelectorClient::trace(visitor); |
| 730 } | 733 } |
| 731 | 734 |
| 732 } | 735 } |
| OLD | NEW |