| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights
reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class CSSStyleSheet; | 38 class CSSStyleSheet; |
| 39 class Document; | 39 class Document; |
| 40 class Node; | 40 class Node; |
| 41 class StyleRuleBase; | 41 class StyleRuleBase; |
| 42 class StyleRuleFontFace; | 42 class StyleRuleFontFace; |
| 43 | 43 |
| 44 class StyleSheetContents : public RefCounted<StyleSheetContents> { | 44 class StyleSheetContents : public RefCounted<StyleSheetContents> { |
| 45 public: | 45 public: |
| 46 static PassRefPtr<StyleSheetContents> create(const CSSParserContext& context
) | 46 static PassRefPtr<StyleSheetContents> create(Document* document, const CSSPa
rserContext& context) |
| 47 { | 47 { |
| 48 return adoptRef(new StyleSheetContents(context)); | 48 return adoptRef(new StyleSheetContents(document, context)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 ~StyleSheetContents(); | 51 ~StyleSheetContents(); |
| 52 | 52 |
| 53 const CSSParserContext& parserContext() const { return m_parserContext; } | 53 const CSSParserContext& parserContext() const { return m_parserContext; } |
| 54 | 54 |
| 55 bool parseString(const String&); | 55 bool parseString(const String&); |
| 56 | 56 |
| 57 void parserAppendRule(PassRefPtr<StyleRuleBase>); | 57 void parserAppendRule(PassRefPtr<StyleRuleBase>); |
| 58 | 58 |
| 59 const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRul
es; } | 59 const Vector<RefPtr<StyleRuleBase> >& childRules() const { return m_childRul
es; } |
| 60 | 60 |
| 61 void registerClient(CSSStyleSheet*); | |
| 62 void unregisterClient(CSSStyleSheet*); | |
| 63 | |
| 64 void shrinkToFit(); | 61 void shrinkToFit(); |
| 65 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } | 62 RuleSet& ruleSet() { ASSERT(m_ruleSet); return *m_ruleSet.get(); } |
| 66 RuleSet& ensureRuleSet(AddRuleFlags); | 63 RuleSet& ensureRuleSet(AddRuleFlags); |
| 67 void clearRuleSet(); | |
| 68 | 64 |
| 69 private: | 65 private: |
| 70 explicit StyleSheetContents(const CSSParserContext&); | 66 explicit StyleSheetContents(Document* document, const CSSParserContext&); |
| 71 | 67 |
| 72 OwnPtr<RuleSet> m_ruleSet; | 68 OwnPtr<RuleSet> m_ruleSet; |
| 73 Vector<RefPtr<StyleRuleBase> > m_childRules; | 69 Vector<RefPtr<StyleRuleBase> > m_childRules; |
| 74 CSSParserContext m_parserContext; | 70 CSSParserContext m_parserContext; |
| 75 | 71 |
| 76 HashSet<RawPtr<CSSStyleSheet> > m_clients; | 72 RefPtr<Document> m_document; |
| 77 }; | 73 }; |
| 78 | 74 |
| 79 } // namespace | 75 } // namespace |
| 80 | 76 |
| 81 #endif // SKY_ENGINE_CORE_CSS_STYLESHEETCONTENTS_H_ | 77 #endif // SKY_ENGINE_CORE_CSS_STYLESHEETCONTENTS_H_ |
| OLD | NEW |