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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) | 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) |
7 * Copyright (C) 2011 Google Inc. All rights reserved. | 7 * Copyright (C) 2011 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if (value.isEmpty()) | 132 if (value.isEmpty()) |
133 return; | 133 return; |
134 if (value.is8Bit()) | 134 if (value.is8Bit()) |
135 parseSizes(value.characters8(), value.length(), iconSizes); | 135 parseSizes(value.characters8(), value.length(), iconSizes); |
136 else | 136 else |
137 parseSizes(value.characters16(), value.length(), iconSizes); | 137 parseSizes(value.characters16(), value.length(), iconSizes); |
138 } | 138 } |
139 | 139 |
140 inline HTMLLinkElement::HTMLLinkElement(Document& document, bool createdByParser
) | 140 inline HTMLLinkElement::HTMLLinkElement(Document& document, bool createdByParser
) |
141 : HTMLElement(linkTag, document) | 141 : HTMLElement(linkTag, document) |
142 , m_linkLoader(this) | 142 , m_linkLoader(LinkLoader::create(this)) |
143 , m_sizes(DOMSettableTokenList::create(this)) | 143 , m_sizes(DOMSettableTokenList::create(this)) |
144 , m_relList(RelList::create(this)) | 144 , m_relList(RelList::create(this)) |
145 , m_createdByParser(createdByParser) | 145 , m_createdByParser(createdByParser) |
146 , m_isInShadowTree(false) | 146 , m_isInShadowTree(false) |
147 { | 147 { |
148 } | 148 } |
149 | 149 |
150 PassRefPtrWillBeRawPtr<HTMLLinkElement> HTMLLinkElement::create(Document& docume
nt, bool createdByParser) | 150 PassRefPtrWillBeRawPtr<HTMLLinkElement> HTMLLinkElement::create(Document& docume
nt, bool createdByParser) |
151 { | 151 { |
152 return adoptRefWillBeNoop(new HTMLLinkElement(document, createdByParser)); | 152 return adoptRefWillBeNoop(new HTMLLinkElement(document, createdByParser)); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 bool HTMLLinkElement::shouldLoadLink() | 201 bool HTMLLinkElement::shouldLoadLink() |
202 { | 202 { |
203 return inDocument(); | 203 return inDocument(); |
204 } | 204 } |
205 | 205 |
206 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL&
url) | 206 bool HTMLLinkElement::loadLink(const String& type, const String& as, const KURL&
url) |
207 { | 207 { |
208 return m_linkLoader.loadLink(m_relAttribute, crossOriginAttributeValue(fastG
etAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHint
sInterfaceImpl()); | 208 return m_linkLoader->loadLink(m_relAttribute, crossOriginAttributeValue(fast
GetAttribute(HTMLNames::crossoriginAttr)), type, as, url, document(), NetworkHin
tsInterfaceImpl()); |
209 } | 209 } |
210 | 210 |
211 LinkResource* HTMLLinkElement::linkResourceToProcess() | 211 LinkResource* HTMLLinkElement::linkResourceToProcess() |
212 { | 212 { |
213 bool visible = inDocument() && !m_isInShadowTree; | 213 bool visible = inDocument() && !m_isInShadowTree; |
214 if (!visible) { | 214 if (!visible) { |
215 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); | 215 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); |
216 return nullptr; | 216 return nullptr; |
217 } | 217 } |
218 | 218 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 284 |
285 return InsertionDone; | 285 return InsertionDone; |
286 } | 286 } |
287 | 287 |
288 void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) | 288 void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) |
289 { | 289 { |
290 HTMLElement::removedFrom(insertionPoint); | 290 HTMLElement::removedFrom(insertionPoint); |
291 if (!insertionPoint->inDocument()) | 291 if (!insertionPoint->inDocument()) |
292 return; | 292 return; |
293 | 293 |
294 m_linkLoader.released(); | 294 m_linkLoader->released(); |
295 | 295 |
296 if (m_isInShadowTree) { | 296 if (m_isInShadowTree) { |
297 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); | 297 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); |
298 return; | 298 return; |
299 } | 299 } |
300 document().styleEngine().removeStyleSheetCandidateNode(this); | 300 document().styleEngine().removeStyleSheetCandidateNode(this); |
301 | 301 |
302 RefPtrWillBeRawPtr<StyleSheet> removedSheet = sheet(); | 302 RefPtrWillBeRawPtr<StyleSheet> removedSheet = sheet(); |
303 | 303 |
304 if (m_link) | 304 if (m_link) |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 clearSheet(); | 763 clearSheet(); |
764 | 764 |
765 if (styleSheetIsLoading()) | 765 if (styleSheetIsLoading()) |
766 removePendingSheet(); | 766 removePendingSheet(); |
767 } | 767 } |
768 | 768 |
769 DEFINE_TRACE(LinkStyle) | 769 DEFINE_TRACE(LinkStyle) |
770 { | 770 { |
771 visitor->trace(m_sheet); | 771 visitor->trace(m_sheet); |
772 LinkResource::trace(visitor); | 772 LinkResource::trace(visitor); |
| 773 ResourceOwner<StyleSheetResource>::trace(visitor); |
773 } | 774 } |
774 | 775 |
775 } // namespace blink | 776 } // namespace blink |
OLD | NEW |