OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "CSSImportRule.h" | 23 #include "CSSImportRule.h" |
24 | 24 |
25 #include "CSSStyleSheet.h" | 25 #include "CSSStyleSheet.h" |
26 #include "CachedCSSStyleSheet.h" | 26 #include "CachedCSSStyleSheet.h" |
27 #include "CachedResourceLoader.h" | 27 #include "CachedResourceLoader.h" |
28 #include "Document.h" | 28 #include "Document.h" |
29 #include "MediaList.h" | 29 #include "MediaList.h" |
30 #include "SecurityOrigin.h" | 30 #include "SecurityOrigin.h" |
31 #include "StyleRuleImport.h" | 31 #include "StyleRuleImport.h" |
32 #include "StyleSheetContents.h" | 32 #include "StyleSheetContents.h" |
33 #include "WebCoreMemoryInstrumentation.h" | |
34 #include <wtf/text/StringBuilder.h> | 33 #include <wtf/text/StringBuilder.h> |
35 | 34 |
36 namespace WebCore { | 35 namespace WebCore { |
37 | 36 |
38 CSSImportRule::CSSImportRule(StyleRuleImport* importRule, CSSStyleSheet* parent) | 37 CSSImportRule::CSSImportRule(StyleRuleImport* importRule, CSSStyleSheet* parent) |
39 : CSSRule(parent) | 38 : CSSRule(parent) |
40 , m_importRule(importRule) | 39 , m_importRule(importRule) |
41 { | 40 { |
42 } | 41 } |
43 | 42 |
(...skipping 29 matching lines...) Expand all Loading... |
73 if (!mediaText.isEmpty()) { | 72 if (!mediaText.isEmpty()) { |
74 result.append(' '); | 73 result.append(' '); |
75 result.append(mediaText); | 74 result.append(mediaText); |
76 } | 75 } |
77 } | 76 } |
78 result.append(';'); | 77 result.append(';'); |
79 | 78 |
80 return result.toString(); | 79 return result.toString(); |
81 } | 80 } |
82 | 81 |
83 void CSSImportRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
84 { | |
85 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | |
86 CSSRule::reportMemoryUsage(memoryObjectInfo); | |
87 info.addMember(m_importRule, "importRule"); | |
88 info.addMember(m_mediaCSSOMWrapper, "mediaCSSOMWrapper"); | |
89 info.addMember(m_styleSheetCSSOMWrapper, "styleSheetCSSOMWrapper"); | |
90 } | |
91 | |
92 CSSStyleSheet* CSSImportRule::styleSheet() const | 82 CSSStyleSheet* CSSImportRule::styleSheet() const |
93 { | 83 { |
94 if (!m_importRule->styleSheet()) | 84 if (!m_importRule->styleSheet()) |
95 return 0; | 85 return 0; |
96 | 86 |
97 if (!m_styleSheetCSSOMWrapper) | 87 if (!m_styleSheetCSSOMWrapper) |
98 m_styleSheetCSSOMWrapper = CSSStyleSheet::create(m_importRule->styleShee
t(), const_cast<CSSImportRule*>(this)); | 88 m_styleSheetCSSOMWrapper = CSSStyleSheet::create(m_importRule->styleShee
t(), const_cast<CSSImportRule*>(this)); |
99 return m_styleSheetCSSOMWrapper.get(); | 89 return m_styleSheetCSSOMWrapper.get(); |
100 } | 90 } |
101 | 91 |
102 void CSSImportRule::reattach(StyleRuleBase*) | 92 void CSSImportRule::reattach(StyleRuleBase*) |
103 { | 93 { |
104 // FIXME: Implement when enabling caching for stylesheets with import rules. | 94 // FIXME: Implement when enabling caching for stylesheets with import rules. |
105 ASSERT_NOT_REACHED(); | 95 ASSERT_NOT_REACHED(); |
106 } | 96 } |
107 | 97 |
108 } // namespace WebCore | 98 } // namespace WebCore |
OLD | NEW |