| 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 | 3 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All rights |
| 4 * reserved. | 4 * 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
| 17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef CSSStyleSheet_h | 22 #ifndef CSSStyleSheet_h |
| 23 #define CSSStyleSheet_h | 23 #define CSSStyleSheet_h |
| 24 | 24 |
| 25 #include "core/CoreExport.h" | 25 #include "core/CoreExport.h" |
| 26 #include "core/css/CSSRule.h" | 26 #include "core/css/CSSRule.h" |
| 27 #include "core/css/MediaQueryEvaluator.h" |
| 27 #include "core/css/StyleSheet.h" | 28 #include "core/css/StyleSheet.h" |
| 28 #include "platform/heap/Handle.h" | 29 #include "platform/heap/Handle.h" |
| 29 #include "wtf/Noncopyable.h" | 30 #include "wtf/Noncopyable.h" |
| 30 #include "wtf/text/TextPosition.h" | 31 #include "wtf/text/TextPosition.h" |
| 31 | 32 |
| 32 namespace blink { | 33 namespace blink { |
| 33 | 34 |
| 34 class CSSImportRule; | 35 class CSSImportRule; |
| 35 class CSSRule; | 36 class CSSRule; |
| 36 class CSSRuleList; | 37 class CSSRuleList; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void clearOwnerNode() override; | 95 void clearOwnerNode() override; |
| 95 | 96 |
| 96 CSSRule* ownerRule() const override { return m_ownerRule; } | 97 CSSRule* ownerRule() const override { return m_ownerRule; } |
| 97 KURL baseURL() const override; | 98 KURL baseURL() const override; |
| 98 bool isLoading() const override; | 99 bool isLoading() const override; |
| 99 | 100 |
| 100 void clearOwnerRule() { m_ownerRule = nullptr; } | 101 void clearOwnerRule() { m_ownerRule = nullptr; } |
| 101 Document* ownerDocument() const; | 102 Document* ownerDocument() const; |
| 102 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } | 103 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } |
| 103 void setMediaQueries(MediaQuerySet*); | 104 void setMediaQueries(MediaQuerySet*); |
| 105 bool matchesMediaQueries(const MediaQueryEvaluator&); |
| 106 const MediaQueryResultList& viewportDependentMediaQueryResults() const { |
| 107 return m_viewportDependentMediaQueryResults; |
| 108 } |
| 109 const MediaQueryResultList& deviceDependentMediaQueryResults() const { |
| 110 return m_deviceDependentMediaQueryResults; |
| 111 } |
| 104 void setTitle(const String& title) { m_title = title; } | 112 void setTitle(const String& title) { m_title = title; } |
| 105 // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this | 113 // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this |
| 106 // origin. | 114 // origin. |
| 107 void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); | 115 void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); |
| 108 | 116 |
| 109 class RuleMutationScope { | 117 class RuleMutationScope { |
| 110 WTF_MAKE_NONCOPYABLE(RuleMutationScope); | 118 WTF_MAKE_NONCOPYABLE(RuleMutationScope); |
| 111 STACK_ALLOCATED(); | 119 STACK_ALLOCATED(); |
| 112 | 120 |
| 113 public: | 121 public: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool canAccessRules() const; | 158 bool canAccessRules() const; |
| 151 | 159 |
| 152 void setLoadCompleted(bool); | 160 void setLoadCompleted(bool); |
| 153 | 161 |
| 154 Member<StyleSheetContents> m_contents; | 162 Member<StyleSheetContents> m_contents; |
| 155 bool m_isInlineStylesheet = false; | 163 bool m_isInlineStylesheet = false; |
| 156 bool m_isDisabled = false; | 164 bool m_isDisabled = false; |
| 157 bool m_loadCompleted = false; | 165 bool m_loadCompleted = false; |
| 158 String m_title; | 166 String m_title; |
| 159 Member<MediaQuerySet> m_mediaQueries; | 167 Member<MediaQuerySet> m_mediaQueries; |
| 168 MediaQueryResultList m_viewportDependentMediaQueryResults; |
| 169 MediaQueryResultList m_deviceDependentMediaQueryResults; |
| 160 | 170 |
| 161 RefPtr<SecurityOrigin> m_allowRuleAccessFromOrigin; | 171 RefPtr<SecurityOrigin> m_allowRuleAccessFromOrigin; |
| 162 | 172 |
| 163 Member<Node> m_ownerNode; | 173 Member<Node> m_ownerNode; |
| 164 Member<CSSRule> m_ownerRule; | 174 Member<CSSRule> m_ownerRule; |
| 165 | 175 |
| 166 TextPosition m_startPosition; | 176 TextPosition m_startPosition; |
| 167 mutable Member<MediaList> m_mediaCSSOMWrapper; | 177 mutable Member<MediaList> m_mediaCSSOMWrapper; |
| 168 mutable HeapVector<Member<CSSRule>> m_childRuleCSSOMWrappers; | 178 mutable HeapVector<Member<CSSRule>> m_childRuleCSSOMWrappers; |
| 169 mutable Member<CSSRuleList> m_ruleListCSSOMWrapper; | 179 mutable Member<CSSRuleList> m_ruleListCSSOMWrapper; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 188 | 198 |
| 189 DEFINE_TYPE_CASTS(CSSStyleSheet, | 199 DEFINE_TYPE_CASTS(CSSStyleSheet, |
| 190 StyleSheet, | 200 StyleSheet, |
| 191 sheet, | 201 sheet, |
| 192 sheet->isCSSStyleSheet(), | 202 sheet->isCSSStyleSheet(), |
| 193 sheet.isCSSStyleSheet()); | 203 sheet.isCSSStyleSheet()); |
| 194 | 204 |
| 195 } // namespace blink | 205 } // namespace blink |
| 196 | 206 |
| 197 #endif | 207 #endif |
| OLD | NEW |