| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include "core/css/CSSStyleSheet.h" | 27 #include "core/css/CSSStyleSheet.h" |
| 28 #include "core/dom/DOMSettableTokenList.h" | 28 #include "core/dom/DOMSettableTokenList.h" |
| 29 #include "core/dom/IconURL.h" | 29 #include "core/dom/IconURL.h" |
| 30 #include "core/fetch/ResourceOwner.h" | 30 #include "core/fetch/ResourceOwner.h" |
| 31 #include "core/fetch/StyleSheetResource.h" | 31 #include "core/fetch/StyleSheetResource.h" |
| 32 #include "core/fetch/StyleSheetResourceClient.h" | 32 #include "core/fetch/StyleSheetResourceClient.h" |
| 33 #include "core/html/HTMLElement.h" | 33 #include "core/html/HTMLElement.h" |
| 34 #include "core/html/LinkRelAttribute.h" | 34 #include "core/html/LinkRelAttribute.h" |
| 35 #include "core/html/LinkResource.h" | 35 #include "core/html/LinkResource.h" |
| 36 #include "core/html/parser/CSSPreloadScanner.h" |
| 36 #include "core/loader/LinkLoader.h" | 37 #include "core/loader/LinkLoader.h" |
| 37 #include "core/loader/LinkLoaderClient.h" | 38 #include "core/loader/LinkLoaderClient.h" |
| 39 #include "platform/text/SegmentedString.h" |
| 38 | 40 |
| 39 namespace WebCore { | 41 namespace WebCore { |
| 40 | 42 |
| 41 class DocumentFragment; | 43 class DocumentFragment; |
| 42 class HTMLLinkElement; | 44 class HTMLLinkElement; |
| 43 class KURL; | 45 class KURL; |
| 44 class LinkImport; | 46 class LinkImport; |
| 45 | 47 |
| 46 template<typename T> class EventSender; | 48 template<typename T> class EventSender; |
| 47 typedef EventSender<HTMLLinkElement> LinkEventSender; | 49 typedef EventSender<HTMLLinkElement> LinkEventSender; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool hasSheet() const { return m_sheet; } | 82 bool hasSheet() const { return m_sheet; } |
| 81 bool isDisabled() const { return m_disabledState == Disabled; } | 83 bool isDisabled() const { return m_disabledState == Disabled; } |
| 82 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript
; } | 84 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript
; } |
| 83 bool isUnset() const { return m_disabledState == Unset; } | 85 bool isUnset() const { return m_disabledState == Unset; } |
| 84 | 86 |
| 85 CSSStyleSheet* sheet() const { return m_sheet.get(); } | 87 CSSStyleSheet* sheet() const { return m_sheet.get(); } |
| 86 | 88 |
| 87 private: | 89 private: |
| 88 // From StyleSheetResourceClient | 90 // From StyleSheetResourceClient |
| 89 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource*) OVERRIDE; | 91 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const
String& charset, const CSSStyleSheetResource*) OVERRIDE; |
| 92 virtual void dataReceived(const CSSStyleSheetResource* cachedStyleSheet, con
st char* data, int length) OVERRIDE; |
| 90 | 93 |
| 91 enum DisabledState { | 94 enum DisabledState { |
| 92 Unset, | 95 Unset, |
| 93 EnabledViaScript, | 96 EnabledViaScript, |
| 94 Disabled | 97 Disabled |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 enum PendingSheetType { | 100 enum PendingSheetType { |
| 98 None, | 101 None, |
| 99 NonBlocking, | 102 NonBlocking, |
| 100 Blocking | 103 Blocking |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 enum RemovePendingSheetNotificationType { | 106 enum RemovePendingSheetNotificationType { |
| 104 RemovePendingSheetNotifyImmediately, | 107 RemovePendingSheetNotifyImmediately, |
| 105 RemovePendingSheetNotifyLater | 108 RemovePendingSheetNotifyLater |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 void clearSheet(); | 111 void clearSheet(); |
| 109 void addPendingSheet(PendingSheetType); | 112 void addPendingSheet(PendingSheetType); |
| 110 void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSh
eetNotifyImmediately); | 113 void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSh
eetNotifyImmediately); |
| 111 Document& document(); | 114 Document& document(); |
| 112 | 115 |
| 113 RefPtrWillBeMember<CSSStyleSheet> m_sheet; | 116 RefPtrWillBeMember<CSSStyleSheet> m_sheet; |
| 117 OwnPtr<CSSPreloadScanner> m_preloadScanner; |
| 118 OwnPtr<SegmentedString> m_input; |
| 114 DisabledState m_disabledState; | 119 DisabledState m_disabledState; |
| 115 PendingSheetType m_pendingSheetType; | 120 PendingSheetType m_pendingSheetType; |
| 116 bool m_loading; | 121 bool m_loading; |
| 117 bool m_firedLoad; | 122 bool m_firedLoad; |
| 118 bool m_loadedSheet; | 123 bool m_loadedSheet; |
| 119 }; | 124 }; |
| 120 | 125 |
| 121 | 126 |
| 122 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient { | 127 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient { |
| 123 public: | 128 public: |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 Vector<IntSize> m_iconSizes; | 215 Vector<IntSize> m_iconSizes; |
| 211 LinkRelAttribute m_relAttribute; | 216 LinkRelAttribute m_relAttribute; |
| 212 | 217 |
| 213 bool m_createdByParser; | 218 bool m_createdByParser; |
| 214 bool m_isInShadowTree; | 219 bool m_isInShadowTree; |
| 215 }; | 220 }; |
| 216 | 221 |
| 217 } //namespace | 222 } //namespace |
| 218 | 223 |
| 219 #endif | 224 #endif |
| OLD | NEW |