| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved. |
| 5 * Copyright (C) 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 WTF_MAKE_FAST_ALLOCATED; | 58 WTF_MAKE_FAST_ALLOCATED; |
| 59 public: | 59 public: |
| 60 static PassRefPtr<LinkStyle> create(HTMLLinkElement* owner); | 60 static PassRefPtr<LinkStyle> create(HTMLLinkElement* owner); |
| 61 | 61 |
| 62 explicit LinkStyle(HTMLLinkElement* owner); | 62 explicit LinkStyle(HTMLLinkElement* owner); |
| 63 virtual ~LinkStyle(); | 63 virtual ~LinkStyle(); |
| 64 | 64 |
| 65 virtual Type type() const OVERRIDE { return Style; } | 65 virtual Type type() const OVERRIDE { return Style; } |
| 66 virtual void process() OVERRIDE; | 66 virtual void process() OVERRIDE; |
| 67 virtual void ownerRemoved() OVERRIDE; | 67 virtual void ownerRemoved() OVERRIDE; |
| 68 virtual bool hasLoaded() const OVERRIDE { return m_loadedSheet; } |
| 68 | 69 |
| 69 void startLoadingDynamicSheet(); | 70 void startLoadingDynamicSheet(); |
| 70 void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred); | 71 void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred); |
| 71 bool sheetLoaded(); | 72 bool sheetLoaded(); |
| 72 | 73 |
| 73 void setDisabledState(bool); | 74 void setDisabledState(bool); |
| 74 void setSheetTitle(const String&); | 75 void setSheetTitle(const String&); |
| 75 | 76 |
| 76 bool styleSheetIsLoading() const; | 77 bool styleSheetIsLoading() const; |
| 77 bool hasSheet() const { return m_sheet; } | 78 bool hasSheet() const { return m_sheet; } |
| 78 bool hasLoadedSheet() const { return m_loadedSheet; } | |
| 79 bool isDisabled() const { return m_disabledState == Disabled; } | 79 bool isDisabled() const { return m_disabledState == Disabled; } |
| 80 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript
; } | 80 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript
; } |
| 81 bool isUnset() const { return m_disabledState == Unset; } | 81 bool isUnset() const { return m_disabledState == Unset; } |
| 82 | 82 |
| 83 CSSStyleSheet* sheet() const { return m_sheet.get(); } | 83 CSSStyleSheet* sheet() const { return m_sheet.get(); } |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 // From ResourceClient | 86 // From ResourceClient |
| 87 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CachedCSSStyleSheet*); | 87 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CachedCSSStyleSheet*); |
| 88 | 88 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 Document* import() const; | 142 Document* import() const; |
| 143 | 143 |
| 144 bool styleSheetIsLoading() const; | 144 bool styleSheetIsLoading() const; |
| 145 | 145 |
| 146 bool isDisabled() const { return linkStyle() && linkStyle()->isDisabled(); } | 146 bool isDisabled() const { return linkStyle() && linkStyle()->isDisabled(); } |
| 147 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl
edViaScript(); } | 147 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl
edViaScript(); } |
| 148 void setSizes(const String&); | 148 void setSizes(const String&); |
| 149 DOMSettableTokenList* sizes() const; | 149 DOMSettableTokenList* sizes() const; |
| 150 | 150 |
| 151 void dispatchPendingEvent(LinkEventSender*); | 151 void dispatchPendingEvent(LinkEventSender*); |
| 152 void scheduleEvent(); |
| 152 static void dispatchPendingLoadEvents(); | 153 static void dispatchPendingLoadEvents(); |
| 153 | 154 |
| 154 // From LinkLoaderClient | 155 // From LinkLoaderClient |
| 155 virtual bool shouldLoadLink() OVERRIDE; | 156 virtual bool shouldLoadLink() OVERRIDE; |
| 156 | 157 |
| 157 // For LinkStyle | 158 // For LinkStyle |
| 158 bool loadLink(const String& type, const KURL& url) { return m_linkLoader.loa
dLink(m_relAttribute, type, url, document()); } | 159 bool loadLink(const String& type, const KURL& url) { return m_linkLoader.loa
dLink(m_relAttribute, type, url, document()); } |
| 159 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i
sAlternate(); } | 160 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i
sAlternate(); } |
| 160 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } | 161 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } |
| 161 | 162 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 206 |
| 206 inline HTMLLinkElement* toHTMLLinkElement(Node* node) | 207 inline HTMLLinkElement* toHTMLLinkElement(Node* node) |
| 207 { | 208 { |
| 208 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::linkTa
g)); | 209 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::linkTa
g)); |
| 209 return static_cast<HTMLLinkElement*>(node); | 210 return static_cast<HTMLLinkElement*>(node); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } //namespace | 213 } //namespace |
| 213 | 214 |
| 214 #endif | 215 #endif |
| OLD | NEW |