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 30 matching lines...) Expand all Loading... |
41 class StyleSheetContents; | 41 class StyleSheetContents; |
42 | 42 |
43 enum StyleSheetUpdateType { | 43 enum StyleSheetUpdateType { |
44 PartialRuleUpdate, | 44 PartialRuleUpdate, |
45 EntireStyleSheetUpdate | 45 EntireStyleSheetUpdate |
46 }; | 46 }; |
47 | 47 |
48 class CORE_EXPORT CSSStyleSheet final : public StyleSheet { | 48 class CORE_EXPORT CSSStyleSheet final : public StyleSheet { |
49 DEFINE_WRAPPERTYPEINFO(); | 49 DEFINE_WRAPPERTYPEINFO(); |
50 public: | 50 public: |
51 static RawPtr<CSSStyleSheet> create(RawPtr<StyleSheetContents>, CSSImportRul
e* ownerRule = 0); | 51 static CSSStyleSheet* create(StyleSheetContents*, CSSImportRule* ownerRule =
0); |
52 static RawPtr<CSSStyleSheet> create(RawPtr<StyleSheetContents>, Node* ownerN
ode); | 52 static CSSStyleSheet* create(StyleSheetContents*, Node* ownerNode); |
53 static RawPtr<CSSStyleSheet> createInline(Node*, const KURL&, const TextPosi
tion& startPosition = TextPosition::minimumPosition(), const String& encoding =
String()); | 53 static CSSStyleSheet* createInline(Node*, const KURL&, const TextPosition& s
tartPosition = TextPosition::minimumPosition(), const String& encoding = String(
)); |
54 static RawPtr<CSSStyleSheet> createInline(RawPtr<StyleSheetContents>, Node*
ownerNode, const TextPosition& startPosition = TextPosition::minimumPosition()); | 54 static CSSStyleSheet* createInline(StyleSheetContents*, Node* ownerNode, con
st TextPosition& startPosition = TextPosition::minimumPosition()); |
55 | 55 |
56 ~CSSStyleSheet() override; | 56 ~CSSStyleSheet() override; |
57 | 57 |
58 CSSStyleSheet* parentStyleSheet() const override; | 58 CSSStyleSheet* parentStyleSheet() const override; |
59 Node* ownerNode() const override { return m_ownerNode; } | 59 Node* ownerNode() const override { return m_ownerNode; } |
60 MediaList* media() const override; | 60 MediaList* media() const override; |
61 String href() const override; | 61 String href() const override; |
62 String title() const override { return m_title; } | 62 String title() const override { return m_title; } |
63 bool disabled() const override { return m_isDisabled; } | 63 bool disabled() const override { return m_isDisabled; } |
64 void setDisabled(bool) override; | 64 void setDisabled(bool) override; |
65 | 65 |
66 RawPtr<CSSRuleList> cssRules(); | 66 CSSRuleList* cssRules(); |
67 unsigned insertRule(const String& rule, unsigned index, ExceptionState&); | 67 unsigned insertRule(const String& rule, unsigned index, ExceptionState&); |
68 unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. | 68 unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. |
69 void deleteRule(unsigned index, ExceptionState&); | 69 void deleteRule(unsigned index, ExceptionState&); |
70 | 70 |
71 // IE Extensions | 71 // IE Extensions |
72 RawPtr<CSSRuleList> rules(); | 72 CSSRuleList* rules(); |
73 int addRule(const String& selector, const String& style, int index, Exceptio
nState&); | 73 int addRule(const String& selector, const String& style, int index, Exceptio
nState&); |
74 int addRule(const String& selector, const String& style, ExceptionState&); | 74 int addRule(const String& selector, const String& style, ExceptionState&); |
75 void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule
(index, exceptionState); } | 75 void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule
(index, exceptionState); } |
76 | 76 |
77 // For CSSRuleList. | 77 // For CSSRuleList. |
78 unsigned length() const; | 78 unsigned length() const; |
79 CSSRule* item(unsigned index); | 79 CSSRule* item(unsigned index); |
80 | 80 |
81 void clearOwnerNode() override; | 81 void clearOwnerNode() override; |
82 | 82 |
83 CSSRule* ownerRule() const override { return m_ownerRule; } | 83 CSSRule* ownerRule() const override { return m_ownerRule; } |
84 KURL baseURL() const override; | 84 KURL baseURL() const override; |
85 bool isLoading() const override; | 85 bool isLoading() const override; |
86 | 86 |
87 void clearOwnerRule() { m_ownerRule = nullptr; } | 87 void clearOwnerRule() { m_ownerRule = nullptr; } |
88 Document* ownerDocument() const; | 88 Document* ownerDocument() const; |
89 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } | 89 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } |
90 void setMediaQueries(RawPtr<MediaQuerySet>); | 90 void setMediaQueries(MediaQuerySet*); |
91 void setTitle(const String& title) { m_title = title; } | 91 void setTitle(const String& title) { m_title = title; } |
92 // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this
origin. | 92 // Set by LinkStyle iff CORS-enabled fetch of stylesheet succeeded from this
origin. |
93 void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); | 93 void setAllowRuleAccessFromOrigin(PassRefPtr<SecurityOrigin> allowedOrigin); |
94 | 94 |
95 class RuleMutationScope { | 95 class RuleMutationScope { |
96 WTF_MAKE_NONCOPYABLE(RuleMutationScope); | 96 WTF_MAKE_NONCOPYABLE(RuleMutationScope); |
97 STACK_ALLOCATED(); | 97 STACK_ALLOCATED(); |
98 public: | 98 public: |
99 explicit RuleMutationScope(CSSStyleSheet*); | 99 explicit RuleMutationScope(CSSStyleSheet*); |
100 explicit RuleMutationScope(CSSRule*); | 100 explicit RuleMutationScope(CSSRule*); |
(...skipping 13 matching lines...) Expand all Loading... |
114 TextPosition startPositionInSource() const { return m_startPosition; } | 114 TextPosition startPositionInSource() const { return m_startPosition; } |
115 | 115 |
116 bool sheetLoaded(); | 116 bool sheetLoaded(); |
117 bool loadCompleted() const { return m_loadCompleted; } | 117 bool loadCompleted() const { return m_loadCompleted; } |
118 void startLoadingDynamicSheet(); | 118 void startLoadingDynamicSheet(); |
119 void setText(const String&); | 119 void setText(const String&); |
120 | 120 |
121 DECLARE_VIRTUAL_TRACE(); | 121 DECLARE_VIRTUAL_TRACE(); |
122 | 122 |
123 private: | 123 private: |
124 CSSStyleSheet(RawPtr<StyleSheetContents>, CSSImportRule* ownerRule); | 124 CSSStyleSheet(StyleSheetContents*, CSSImportRule* ownerRule); |
125 CSSStyleSheet(RawPtr<StyleSheetContents>, Node* ownerNode, bool isInlineStyl
esheet, const TextPosition& startPosition); | 125 CSSStyleSheet(StyleSheetContents*, Node* ownerNode, bool isInlineStylesheet,
const TextPosition& startPosition); |
126 | 126 |
127 bool isCSSStyleSheet() const override { return true; } | 127 bool isCSSStyleSheet() const override { return true; } |
128 String type() const override { return "text/css"; } | 128 String type() const override { return "text/css"; } |
129 | 129 |
130 void reattachChildRuleCSSOMWrappers(); | 130 void reattachChildRuleCSSOMWrappers(); |
131 | 131 |
132 bool canAccessRules() const; | 132 bool canAccessRules() const; |
133 | 133 |
134 void setLoadCompleted(bool); | 134 void setLoadCompleted(bool); |
135 | 135 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 { | 169 { |
170 if (m_styleSheet) | 170 if (m_styleSheet) |
171 m_styleSheet->didMutateRules(); | 171 m_styleSheet->didMutateRules(); |
172 } | 172 } |
173 | 173 |
174 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); | 174 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
177 | 177 |
178 #endif | 178 #endif |
OLD | NEW |