| 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 class Document; | 36 class Document; |
| 37 class ExceptionState; | 37 class ExceptionState; |
| 38 class MediaQuerySet; | 38 class MediaQuerySet; |
| 39 class StyleSheetContents; | 39 class StyleSheetContents; |
| 40 | 40 |
| 41 enum StyleSheetUpdateType { | 41 enum StyleSheetUpdateType { |
| 42 PartialRuleUpdate, | 42 PartialRuleUpdate, |
| 43 EntireStyleSheetUpdate | 43 EntireStyleSheetUpdate |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 class CSSStyleSheet FINAL : public StyleSheet { | 46 class CSSStyleSheet final : public StyleSheet { |
| 47 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 48 public: | 48 public: |
| 49 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, CSSImportRule* ownerRule = 0); | 49 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, CSSImportRule* ownerRule = 0); |
| 50 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, Node* ownerNode); | 50 static PassRefPtrWillBeRawPtr<CSSStyleSheet> create(PassRefPtrWillBeRawPtr<S
tyleSheetContents>, Node* ownerNode); |
| 51 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(Node*, const KURL&
, const TextPosition& startPosition = TextPosition::minimumPosition(), const Str
ing& encoding = String()); | 51 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(Node*, const KURL&
, const TextPosition& startPosition = TextPosition::minimumPosition(), const Str
ing& encoding = String()); |
| 52 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(PassRefPtrWillBeRa
wPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = T
extPosition::minimumPosition()); | 52 static PassRefPtrWillBeRawPtr<CSSStyleSheet> createInline(PassRefPtrWillBeRa
wPtr<StyleSheetContents>, Node* ownerNode, const TextPosition& startPosition = T
extPosition::minimumPosition()); |
| 53 | 53 |
| 54 virtual ~CSSStyleSheet(); | 54 virtual ~CSSStyleSheet(); |
| 55 | 55 |
| 56 virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE; | 56 virtual CSSStyleSheet* parentStyleSheet() const override; |
| 57 virtual Node* ownerNode() const OVERRIDE { return m_ownerNode; } | 57 virtual Node* ownerNode() const override { return m_ownerNode; } |
| 58 virtual MediaList* media() const OVERRIDE; | 58 virtual MediaList* media() const override; |
| 59 virtual String href() const OVERRIDE; | 59 virtual String href() const override; |
| 60 virtual String title() const OVERRIDE { return m_title; } | 60 virtual String title() const override { return m_title; } |
| 61 virtual bool disabled() const OVERRIDE { return m_isDisabled; } | 61 virtual bool disabled() const override { return m_isDisabled; } |
| 62 virtual void setDisabled(bool) OVERRIDE; | 62 virtual void setDisabled(bool) override; |
| 63 | 63 |
| 64 PassRefPtrWillBeRawPtr<CSSRuleList> cssRules(); | 64 PassRefPtrWillBeRawPtr<CSSRuleList> cssRules(); |
| 65 unsigned insertRule(const String& rule, unsigned index, ExceptionState&); | 65 unsigned insertRule(const String& rule, unsigned index, ExceptionState&); |
| 66 unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. | 66 unsigned insertRule(const String& rule, ExceptionState&); // Deprecated. |
| 67 void deleteRule(unsigned index, ExceptionState&); | 67 void deleteRule(unsigned index, ExceptionState&); |
| 68 | 68 |
| 69 // IE Extensions | 69 // IE Extensions |
| 70 PassRefPtrWillBeRawPtr<CSSRuleList> rules(); | 70 PassRefPtrWillBeRawPtr<CSSRuleList> rules(); |
| 71 int addRule(const String& selector, const String& style, int index, Exceptio
nState&); | 71 int addRule(const String& selector, const String& style, int index, Exceptio
nState&); |
| 72 int addRule(const String& selector, const String& style, ExceptionState&); | 72 int addRule(const String& selector, const String& style, ExceptionState&); |
| 73 void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule
(index, exceptionState); } | 73 void removeRule(unsigned index, ExceptionState& exceptionState) { deleteRule
(index, exceptionState); } |
| 74 | 74 |
| 75 // For CSSRuleList. | 75 // For CSSRuleList. |
| 76 unsigned length() const; | 76 unsigned length() const; |
| 77 CSSRule* item(unsigned index); | 77 CSSRule* item(unsigned index); |
| 78 | 78 |
| 79 virtual void clearOwnerNode() OVERRIDE; | 79 virtual void clearOwnerNode() override; |
| 80 | 80 |
| 81 virtual CSSRule* ownerRule() const OVERRIDE { return m_ownerRule; } | 81 virtual CSSRule* ownerRule() const override { return m_ownerRule; } |
| 82 virtual KURL baseURL() const OVERRIDE; | 82 virtual KURL baseURL() const override; |
| 83 virtual bool isLoading() const OVERRIDE; | 83 virtual bool isLoading() const override; |
| 84 | 84 |
| 85 void clearOwnerRule() { m_ownerRule = nullptr; } | 85 void clearOwnerRule() { m_ownerRule = nullptr; } |
| 86 Document* ownerDocument() const; | 86 Document* ownerDocument() const; |
| 87 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } | 87 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } |
| 88 void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>); | 88 void setMediaQueries(PassRefPtrWillBeRawPtr<MediaQuerySet>); |
| 89 void setTitle(const String& title) { m_title = title; } | 89 void setTitle(const String& title) { m_title = title; } |
| 90 | 90 |
| 91 class RuleMutationScope { | 91 class RuleMutationScope { |
| 92 WTF_MAKE_NONCOPYABLE(RuleMutationScope); | 92 WTF_MAKE_NONCOPYABLE(RuleMutationScope); |
| 93 STACK_ALLOCATED(); | 93 STACK_ALLOCATED(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 108 | 108 |
| 109 StyleSheetContents* contents() const { return m_contents.get(); } | 109 StyleSheetContents* contents() const { return m_contents.get(); } |
| 110 | 110 |
| 111 bool isInline() const { return m_isInlineStylesheet; } | 111 bool isInline() const { return m_isInlineStylesheet; } |
| 112 TextPosition startPositionInSource() const { return m_startPosition; } | 112 TextPosition startPositionInSource() const { return m_startPosition; } |
| 113 | 113 |
| 114 bool sheetLoaded(); | 114 bool sheetLoaded(); |
| 115 bool loadCompleted() const { return m_loadCompleted; } | 115 bool loadCompleted() const { return m_loadCompleted; } |
| 116 void startLoadingDynamicSheet(); | 116 void startLoadingDynamicSheet(); |
| 117 | 117 |
| 118 virtual void trace(Visitor*) OVERRIDE; | 118 virtual void trace(Visitor*) override; |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* own
erRule); | 121 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, CSSImportRule* own
erRule); |
| 122 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, b
ool isInlineStylesheet, const TextPosition& startPosition); | 122 CSSStyleSheet(PassRefPtrWillBeRawPtr<StyleSheetContents>, Node* ownerNode, b
ool isInlineStylesheet, const TextPosition& startPosition); |
| 123 | 123 |
| 124 virtual bool isCSSStyleSheet() const OVERRIDE { return true; } | 124 virtual bool isCSSStyleSheet() const override { return true; } |
| 125 virtual String type() const OVERRIDE { return "text/css"; } | 125 virtual String type() const override { return "text/css"; } |
| 126 | 126 |
| 127 void reattachChildRuleCSSOMWrappers(); | 127 void reattachChildRuleCSSOMWrappers(); |
| 128 | 128 |
| 129 bool canAccessRules() const; | 129 bool canAccessRules() const; |
| 130 | 130 |
| 131 void setLoadCompleted(bool); | 131 void setLoadCompleted(bool); |
| 132 | 132 |
| 133 RefPtrWillBeMember<StyleSheetContents> m_contents; | 133 RefPtrWillBeMember<StyleSheetContents> m_contents; |
| 134 bool m_isInlineStylesheet; | 134 bool m_isInlineStylesheet; |
| 135 bool m_isDisabled; | 135 bool m_isDisabled; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 { | 164 { |
| 165 if (m_styleSheet) | 165 if (m_styleSheet) |
| 166 m_styleSheet->didMutateRules(); | 166 m_styleSheet->didMutateRules(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); | 169 DEFINE_TYPE_CASTS(CSSStyleSheet, StyleSheet, sheet, sheet->isCSSStyleSheet(), sh
eet.isCSSStyleSheet()); |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| 172 | 172 |
| 173 #endif | 173 #endif |
| OLD | NEW |