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 28 matching lines...) Expand all Loading... |
39 #include "core/dom/ProcessingInstruction.h" | 39 #include "core/dom/ProcessingInstruction.h" |
40 #include "core/dom/ShadowTreeStyleSheetCollection.h" | 40 #include "core/dom/ShadowTreeStyleSheetCollection.h" |
41 #include "core/dom/shadow/ShadowRoot.h" | 41 #include "core/dom/shadow/ShadowRoot.h" |
42 #include "core/frame/Settings.h" | 42 #include "core/frame/Settings.h" |
43 #include "core/html/HTMLIFrameElement.h" | 43 #include "core/html/HTMLIFrameElement.h" |
44 #include "core/html/HTMLLinkElement.h" | 44 #include "core/html/HTMLLinkElement.h" |
45 #include "core/html/imports/HTMLImportsController.h" | 45 #include "core/html/imports/HTMLImportsController.h" |
46 #include "core/inspector/InspectorInstrumentation.h" | 46 #include "core/inspector/InspectorInstrumentation.h" |
47 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
48 #include "core/svg/SVGStyleElement.h" | 48 #include "core/svg/SVGStyleElement.h" |
| 49 #include "platform/TraceEvent.h" |
49 | 50 |
50 namespace blink { | 51 namespace blink { |
51 | 52 |
52 using namespace HTMLNames; | 53 using namespace HTMLNames; |
53 | 54 |
54 StyleEngine::StyleEngine(Document& document) | 55 StyleEngine::StyleEngine(Document& document) |
55 : m_document(&document) | 56 : m_document(&document) |
56 , m_isMaster(!document.importsController() || document.importsController()->
master() == &document) | 57 , m_isMaster(!document.importsController() || document.importsController()->
master() == &document) |
57 , m_pendingStylesheets(0) | 58 , m_pendingStylesheets(0) |
58 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume
nt)) | 59 , m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(docume
nt)) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 m_resolver->appendAuthorStyleSheets(documentStyleSheetCollection()->activeAu
thorStyleSheets()); | 387 m_resolver->appendAuthorStyleSheets(documentStyleSheetCollection()->activeAu
thorStyleSheets()); |
387 for (TreeScope* treeScope : m_activeTreeScopes) { | 388 for (TreeScope* treeScope : m_activeTreeScopes) { |
388 if (TreeScopeStyleSheetCollection* collection = m_styleSheetCollectionMa
p.get(treeScope)) | 389 if (TreeScopeStyleSheetCollection* collection = m_styleSheetCollectionMa
p.get(treeScope)) |
389 m_resolver->appendAuthorStyleSheets(collection->activeAuthorStyleShe
ets()); | 390 m_resolver->appendAuthorStyleSheets(collection->activeAuthorStyleShe
ets()); |
390 } | 391 } |
391 m_resolver->finishAppendAuthorStyleSheets(); | 392 m_resolver->finishAppendAuthorStyleSheets(); |
392 } | 393 } |
393 | 394 |
394 void StyleEngine::createResolver() | 395 void StyleEngine::createResolver() |
395 { | 396 { |
| 397 TRACE_EVENT0("blink", "StyleEngine::createResolver"); |
396 // 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 |
397 // 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 |
398 // Document::isActive() before calling into code which could get here. | 400 // Document::isActive() before calling into code which could get here. |
399 | 401 |
400 ASSERT(document().frame()); | 402 ASSERT(document().frame()); |
401 | 403 |
402 m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document)); | 404 m_resolver = adoptPtrWillBeNoop(new StyleResolver(*m_document)); |
403 | 405 |
404 // A scoped style resolver for document will be created during | 406 // A scoped style resolver for document will be created during |
405 // appendActiveAuthorStyleSheets if needed. | 407 // appendActiveAuthorStyleSheets if needed. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 visitor->trace(m_dirtyTreeScopes); | 723 visitor->trace(m_dirtyTreeScopes); |
722 visitor->trace(m_activeTreeScopes); | 724 visitor->trace(m_activeTreeScopes); |
723 visitor->trace(m_fontSelector); | 725 visitor->trace(m_fontSelector); |
724 visitor->trace(m_textToSheetCache); | 726 visitor->trace(m_textToSheetCache); |
725 visitor->trace(m_sheetToTextCache); | 727 visitor->trace(m_sheetToTextCache); |
726 #endif | 728 #endif |
727 CSSFontSelectorClient::trace(visitor); | 729 CSSFontSelectorClient::trace(visitor); |
728 } | 730 } |
729 | 731 |
730 } | 732 } |
OLD | NEW |