| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 bool needsRepaint() const { return m_needsRepaint; } | 64 bool needsRepaint() const { return m_needsRepaint; } |
| 65 bool needsStyleRecalc() const { return m_needsStyleRecalc; } | 65 bool needsStyleRecalc() const { return m_needsStyleRecalc; } |
| 66 void setNeedsRepaint() { m_needsRepaint = true; } | 66 void setNeedsRepaint() { m_needsRepaint = true; } |
| 67 void setNeedsStyleRecalc() { m_needsStyleRecalc = true; } | 67 void setNeedsStyleRecalc() { m_needsStyleRecalc = true; } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 bool m_needsRepaint; | 70 bool m_needsRepaint; |
| 71 bool m_needsStyleRecalc; | 71 bool m_needsStyleRecalc; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class StyleEngine { | 74 class StyleEngine : public NoBaseWillBeGarbageCollectedFinalized<StyleEngine> { |
| 75 WTF_MAKE_FAST_ALLOCATED; | 75 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 76 public: | 76 public: |
| 77 | 77 |
| 78 class IgnoringPendingStylesheet : public TemporaryChange<bool> { | 78 class IgnoringPendingStylesheet : public TemporaryChange<bool> { |
| 79 public: | 79 public: |
| 80 IgnoringPendingStylesheet(StyleEngine* engine) | 80 IgnoringPendingStylesheet(StyleEngine* engine) |
| 81 : TemporaryChange<bool>(engine->m_ignorePendingStylesheets, true) | 81 : TemporaryChange<bool>(engine->m_ignorePendingStylesheets, true) |
| 82 { | 82 { |
| 83 } | 83 } |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 friend class IgnoringPendingStylesheet; | 86 friend class IgnoringPendingStylesheet; |
| 87 | 87 |
| 88 static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr(
new StyleEngine(document)); } | 88 static PassOwnPtrWillBeRawPtr<StyleEngine> create(Document& document) { retu
rn adoptPtrWillBeNoop(new StyleEngine(document)); } |
| 89 | 89 |
| 90 ~StyleEngine(); | 90 ~StyleEngine(); |
| 91 | 91 |
| 92 const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&); | 92 const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&); |
| 93 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const; | 93 const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const; |
| 94 | 94 |
| 95 const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { re
turn m_authorStyleSheets; } | 95 const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { re
turn m_authorStyleSheets; } |
| 96 const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const; | 96 const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const; |
| 97 | 97 |
| 98 const Vector<RefPtr<StyleSheet> > activeStyleSheetsForInspector() const; | 98 const Vector<RefPtr<StyleSheet> > activeStyleSheetsForInspector() const; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void didDetach(); | 177 void didDetach(); |
| 178 bool shouldClearResolver() const; | 178 bool shouldClearResolver() const; |
| 179 StyleResolverChange resolverChanged(RecalcStyleTime, StyleResolverUpdateMode
); | 179 StyleResolverChange resolverChanged(RecalcStyleTime, StyleResolverUpdateMode
); |
| 180 unsigned resolverAccessCount() const; | 180 unsigned resolverAccessCount() const; |
| 181 | 181 |
| 182 void markDocumentDirty(); | 182 void markDocumentDirty(); |
| 183 | 183 |
| 184 static PassRefPtr<CSSStyleSheet> createSheet(Element*, const String& text, T
extPosition startPosition, bool createdByParser); | 184 static PassRefPtr<CSSStyleSheet> createSheet(Element*, const String& text, T
extPosition startPosition, bool createdByParser); |
| 185 static void removeSheet(StyleSheetContents*); | 185 static void removeSheet(StyleSheetContents*); |
| 186 | 186 |
| 187 void trace(Visitor*) { } |
| 188 |
| 187 private: | 189 private: |
| 188 StyleEngine(Document&); | 190 StyleEngine(Document&); |
| 189 | 191 |
| 190 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); | 192 TreeScopeStyleSheetCollection* ensureStyleSheetCollectionFor(TreeScope&); |
| 191 TreeScopeStyleSheetCollection* styleSheetCollectionFor(TreeScope&); | 193 TreeScopeStyleSheetCollection* styleSheetCollectionFor(TreeScope&); |
| 192 bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode); | 194 bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode); |
| 193 | 195 |
| 194 void markTreeScopeDirty(TreeScope&); | 196 void markTreeScopeDirty(TreeScope&); |
| 195 | 197 |
| 196 bool isMaster() const { return m_isMaster; } | 198 bool isMaster() const { return m_isMaster; } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 bool m_ignorePendingStylesheets; | 243 bool m_ignorePendingStylesheets; |
| 242 bool m_didCalculateResolver; | 244 bool m_didCalculateResolver; |
| 243 OwnPtr<StyleResolver> m_resolver; | 245 OwnPtr<StyleResolver> m_resolver; |
| 244 | 246 |
| 245 RefPtr<CSSFontSelector> m_fontSelector; | 247 RefPtr<CSSFontSelector> m_fontSelector; |
| 246 }; | 248 }; |
| 247 | 249 |
| 248 } | 250 } |
| 249 | 251 |
| 250 #endif | 252 #endif |
| OLD | NEW |