| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, CSSImportRule* ownerRule = 0); | 51 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, CSSImportRule* ownerRule = 0); |
| 52 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, Node* ownerNode); | 52 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, Node* ownerNode); |
| 53 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(Node*, const KURL&
, const TextPosition& startPosition = TextPosition::minimumPosition(), const Str
ing& encoding = String()); | 53 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(Node*, const KURL&
, const TextPosition& startPosition = TextPosition::minimumPosition(), const Str
ing& encoding = String()); |
| 54 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(PassRefPtrWillBeRa
wPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = T
extPosition::minimumPosition()); | 54 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(PassRefPtrWillBeRa
wPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = T
extPosition::minimumPosition()); |
| 55 | 55 |
| 56 virtual ~CSSStyleSheet(); | 56 ~CSSStyleSheet() override; |
| 57 | 57 |
| 58 virtual CSSStyleSheet* parentStyleSheet() const override; | 58 CSSStyleSheet* parentStyleSheet() const override; |
| 59 virtual Node* ownerNode() const override { return m_ownerNode; } | 59 Node* ownerNode() const override { return m_ownerNode; } |
| 60 virtual MediaList* media() const override; | 60 MediaList* media() const override; |
| 61 virtual String href() const override; | 61 String href() const override; |
| 62 virtual String title() const override { return m_title; } | 62 String title() const override { return m_title; } |
| 63 virtual bool disabled() const override { return m_isDisabled; } | 63 bool disabled() const override { return m_isDisabled; } |
| 64 virtual void setDisabled(bool) override; | 64 void setDisabled(bool) override; |
| 65 | 65 |
| 66 PassRefPtrWillBeRawPtr<CSSRuleList> cssRules(); | 66 PassRefPtrWillBeRawPtr<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 PassRefPtrWillBeRawPtr<CSSRuleList> rules(); | 72 PassRefPtrWillBeRawPtr<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 virtual void clearOwnerNode() override; | 81 void clearOwnerNode() override; |
| 82 | 82 |
| 83 virtual CSSRule* ownerRule() const override { return m_ownerRule; } | 83 CSSRule* ownerRule() const override { return m_ownerRule; } |
| 84 virtual KURL baseURL() const override; | 84 KURL baseURL() const override; |
| 85 virtual 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(PassRefPtrWillBeRawPtr<MediaQuerySet>); | 90 void setMediaQueries(PassRefPtrWillBeRawPtr<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 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 118 bool sheetLoaded(); | 118 bool sheetLoaded(); |
| 119 bool loadCompleted() const { return m_loadCompleted; } | 119 bool loadCompleted() const { return m_loadCompleted; } |
| 120 void startLoadingDynamicSheet(); | 120 void startLoadingDynamicSheet(); |
| 121 | 121 |
| 122 DECLARE_VIRTUAL_TRACE(); | 122 DECLARE_VIRTUAL_TRACE(); |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* own
erRule); | 125 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* own
erRule); |
| 126 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, b
ool isInlineStylesheet, const TextPosition& startPosition); | 126 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, b
ool isInlineStylesheet, const TextPosition& startPosition); |
| 127 | 127 |
| 128 virtual bool isCSSStyleSheet() const override { return true; } | 128 bool isCSSStyleSheet() const override { return true; } |
| 129 virtual String type() const override { return "text/css"; } | 129 String type() const override { return "text/css"; } |
| 130 | 130 |
| 131 void reattachChildRuleCSSOMWrappers(); | 131 void reattachChildRuleCSSOMWrappers(); |
| 132 | 132 |
| 133 bool canAccessRules() const; | 133 bool canAccessRules() const; |
| 134 | 134 |
| 135 void setLoadCompleted(bool); | 135 void setLoadCompleted(bool); |
| 136 | 136 |
| 137 RefPtrWillBeMember<StyleSheetContents> m_contents; | 137 RefPtrWillBeMember<StyleSheetContents> m_contents; |
| 138 bool m_isInlineStylesheet; | 138 bool m_isInlineStylesheet; |
| 139 bool m_isDisabled; | 139 bool m_isDisabled; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 170 { | 170 { |
| 171 if (m_styleSheet) | 171 if (m_styleSheet) |
| 172 m_styleSheet->didMutateRules(); | 172 m_styleSheet->didMutateRules(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); | 175 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| 178 | 178 |
| 179 #endif | 179 #endif |
| OLD | NEW |