| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 class CSSImportRule; | 32 class CSSImportRule; |
| 33 class CSSRule; | 33 class CSSRule; |
| 34 class CSSRuleList; | 34 class CSSRuleList; |
| 35 class CSSStyleSheet; | 35 class CSSStyleSheet; |
| 36 class Document; | 36 class Document; |
| 37 class ExceptionState; | 37 class ExceptionState; |
| 38 class MediaQuerySet; | 38 class MediaQuerySet; |
| 39 class SecurityOrigin; |
| 39 class StyleSheetContents; | 40 class StyleSheetContents; |
| 40 | 41 |
| 41 enum StyleSheetUpdateType { | 42 enum StyleSheetUpdateType { |
| 42 PartialRuleUpdate, | 43 PartialRuleUpdate, |
| 43 EntireStyleSheetUpdate | 44 EntireStyleSheetUpdate |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 class CSSStyleSheet final : public StyleSheet { | 47 class CSSStyleSheet final : public StyleSheet { |
| 47 DEFINE_WRAPPERTYPEINFO(); | 48 DEFINE_WRAPPERTYPEINFO(); |
| 48 public: | 49 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 81 |
| 81 virtual CSSRule* ownerRule() const override { return m_ownerRule; } | 82 virtual CSSRule* ownerRule() const override { return m_ownerRule; } |
| 82 virtual KURL baseURL() const override; | 83 virtual KURL baseURL() const override; |
| 83 virtual bool isLoading() const override; | 84 virtual bool isLoading() const override; |
| 84 | 85 |
| 85 void clearOwnerRule() { m_ownerRule = nullptr; } | 86 void clearOwnerRule() { m_ownerRule = nullptr; } |
| 86 Document* ownerDocument() const; | 87 Document* ownerDocument() const; |
| 87 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } | 88 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } |
| 88 void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>); | 89 void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>); |
| 89 void setTitle(const String& title) { m_title = title; } | 90 void setTitle(const String& title) { m_title = title; } |
| 91 // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this
origin. |
| 92 void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); |
| 90 | 93 |
| 91 class RuleMutationScope { | 94 class RuleMutationScope { |
| 92 WTF_MAKE_NONCOPYABLE(RuleMutationScope); | 95 WTF_MAKE_NONCOPYABLE(RuleMutationScope); |
| 93 STACK_ALLOCATED(); | 96 STACK_ALLOCATED(); |
| 94 public: | 97 public: |
| 95 explicit RuleMutationScope(CSSStyleSheet*); | 98 explicit RuleMutationScope(CSSStyleSheet*); |
| 96 explicit RuleMutationScope(CSSRule*); | 99 explicit RuleMutationScope(CSSRule*); |
| 97 ~RuleMutationScope(); | 100 ~RuleMutationScope(); |
| 98 | 101 |
| 99 private: | 102 private: |
| (...skipping 29 matching lines...) Expand all Loading... |
| 129 bool canAccessRules() const; | 132 bool canAccessRules() const; |
| 130 | 133 |
| 131 void setLoadCompleted(bool); | 134 void setLoadCompleted(bool); |
| 132 | 135 |
| 133 RefPtrWillBeMember<StyleSheetContents> m_contents; | 136 RefPtrWillBeMember<StyleSheetContents> m_contents; |
| 134 bool m_isInlineStylesheet; | 137 bool m_isInlineStylesheet; |
| 135 bool m_isDisabled; | 138 bool m_isDisabled; |
| 136 String m_title; | 139 String m_title; |
| 137 RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; | 140 RefPtrWillBeMember<MediaQuerySet> m_mediaQueries; |
| 138 | 141 |
| 142 RefPtr<SecurityOrigin> m_allowRuleAccessFromOrigin; |
| 143 |
| 139 RawPtrWillBeMember<Node> m_ownerNode; | 144 RawPtrWillBeMember<Node> m_ownerNode; |
| 140 RawPtrWillBeMember<CSSRule> m_ownerRule; | 145 RawPtrWillBeMember<CSSRule> m_ownerRule; |
| 141 | 146 |
| 142 TextPosition m_startPosition; | 147 TextPosition m_startPosition; |
| 143 bool m_loadCompleted; | 148 bool m_loadCompleted; |
| 144 mutable RefPtrWillBeMember<MediaList> m_mediaCSSOMWrapper; | 149 mutable RefPtrWillBeMember<MediaList> m_mediaCSSOMWrapper; |
| 145 mutable WillBeHeapVector<RefPtrWillBeMember<CSSRule>> m_childRuleCSSOMWrappe
rs; | 150 mutable WillBeHeapVector<RefPtrWillBeMember<CSSRule>> m_childRuleCSSOMWrappe
rs; |
| 146 mutable OwnPtrWillBeMember<CSSRuleList> m_ruleListCSSOMWrapper; | 151 mutable OwnPtrWillBeMember<CSSRuleList> m_ruleListCSSOMWrapper; |
| 147 }; | 152 }; |
| 148 | 153 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 164 { | 169 { |
| 165 if (m_styleSheet) | 170 if (m_styleSheet) |
| 166 m_styleSheet->didMutateRules(); | 171 m_styleSheet->didMutateRules(); |
| 167 } | 172 } |
| 168 | 173 |
| 169 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); | 174 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); |
| 170 | 175 |
| 171 } // namespace blink | 176 } // namespace blink |
| 172 | 177 |
| 173 #endif | 178 #endif |
| OLD | NEW |