Chromium Code Reviews| 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, 2010, 2012 Apple Inc. All r ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 { | 83 { |
| 84 } | 84 } |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 friend class IgnoringPendingStylesheet; | 87 friend class IgnoringPendingStylesheet; |
| 88 | 88 |
| 89 static PassOwnPtrWillBeRawPtr<StyleEngine> create(Document& document) { retu rn adoptPtrWillBeNoop(new StyleEngine(document)); } | 89 static PassOwnPtrWillBeRawPtr<StyleEngine> create(Document& document) { retu rn adoptPtrWillBeNoop(new StyleEngine(document)); } |
| 90 | 90 |
| 91 ~StyleEngine(); | 91 ~StyleEngine(); |
| 92 | 92 |
| 93 #if !ENABLE(OILPAN) | |
| 93 void detachFromDocument(); | 94 void detachFromDocument(); |
| 95 #endif | |
| 94 | 96 |
| 95 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyle SheetList(TreeScope&); | 97 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyle SheetList(TreeScope&); |
| 96 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyl eSheets() const; | 98 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyl eSheets() const; |
| 97 | 99 |
| 98 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& documentAuthorSt yleSheets() const { return m_authorStyleSheets; } | 100 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& documentAuthorSt yleSheets() const { return m_authorStyleSheets; } |
| 99 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& injectedAuthorSt yleSheets() const; | 101 const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& injectedAuthorSt yleSheets() const; |
| 100 | 102 |
| 101 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > activeStyleSheetsFor Inspector() const; | 103 const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > activeStyleSheetsFor Inspector() const; |
| 102 | 104 |
| 103 void modifiedStyleSheet(StyleSheet*); | 105 void modifiedStyleSheet(StyleSheet*); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 Document* master(); | 205 Document* master(); |
| 204 | 206 |
| 205 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; | 207 typedef ListHashSet<TreeScope*, 16> TreeScopeSet; |
| 206 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*); | 208 static void insertTreeScopeInDocumentOrder(TreeScopeSet&, TreeScope*); |
| 207 void clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet treeScopes); | 209 void clearMediaQueryRuleSetOnTreeScopeStyleSheets(TreeScopeSet treeScopes); |
| 208 | 210 |
| 209 void createResolver(); | 211 void createResolver(); |
| 210 | 212 |
| 211 static PassRefPtrWillBeRawPtr<CSSStyleSheet> parseSheet(Element*, const Stri ng& text, TextPosition startPosition, bool createdByParser); | 213 static PassRefPtrWillBeRawPtr<CSSStyleSheet> parseSheet(Element*, const Stri ng& text, TextPosition startPosition, bool createdByParser); |
| 212 | 214 |
| 213 Document& m_document; | 215 Document& m_document; |
|
Erik Corry
2014/05/05 12:47:01
This doesn't keep the document alive?
Mads Ager (chromium)
2014/05/05 12:52:39
The StyleEngine is owned (OwnPtr) by the document.
haraken
2014/05/06 04:20:16
The StyleEngine is already on the heap :)
Before
Mads Ager (chromium)
2014/05/06 08:26:00
Yes, I'll do that. I think we will end up replacin
| |
| 214 bool m_isMaster; | 216 bool m_isMaster; |
| 215 | 217 |
| 216 // Track the number of currently loading top-level stylesheets needed for re ndering. | 218 // Track the number of currently loading top-level stylesheets needed for re ndering. |
| 217 // Sheets loaded using the @import directive are not included in this count. | 219 // Sheets loaded using the @import directive are not included in this count. |
| 218 // We use this count of pending sheets to detect when we can begin attaching | 220 // We use this count of pending sheets to detect when we can begin attaching |
| 219 // elements and when it is safe to execute scripts. | 221 // elements and when it is safe to execute scripts. |
| 220 int m_pendingStylesheets; | 222 int m_pendingStylesheets; |
| 221 | 223 |
| 222 mutable WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > m_injectedAutho rStyleSheets; | 224 mutable WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > m_injectedAutho rStyleSheets; |
| 223 mutable bool m_injectedStyleSheetCacheValid; | 225 mutable bool m_injectedStyleSheetCacheValid; |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 248 | 250 |
| 249 RefPtrWillBeMember<CSSFontSelector> m_fontSelector; | 251 RefPtrWillBeMember<CSSFontSelector> m_fontSelector; |
| 250 | 252 |
| 251 WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents> > m_t extToSheetCache; | 253 WillBeHeapHashMap<AtomicString, RawPtrWillBeMember<StyleSheetContents> > m_t extToSheetCache; |
| 252 WillBeHeapHashMap<RawPtrWillBeMember<StyleSheetContents>, AtomicString> m_sh eetToTextCache; | 254 WillBeHeapHashMap<RawPtrWillBeMember<StyleSheetContents>, AtomicString> m_sh eetToTextCache; |
| 253 }; | 255 }; |
| 254 | 256 |
| 255 } | 257 } |
| 256 | 258 |
| 257 #endif | 259 #endif |
| OLD | NEW |