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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 if (!m_link) { | 216 if (!m_link) { |
217 if (m_relAttribute.isImport()) { | 217 if (m_relAttribute.isImport()) { |
218 m_link = LinkImport::create(this); | 218 m_link = LinkImport::create(this); |
219 } else if (m_relAttribute.isManifest()) { | 219 } else if (m_relAttribute.isManifest()) { |
220 m_link = LinkManifest::create(this); | 220 m_link = LinkManifest::create(this); |
221 } else if (m_relAttribute.isDefaultPresentation()) { | 221 } else if (m_relAttribute.isDefaultPresentation()) { |
222 m_link = LinkDefaultPresentation::create(this); | 222 m_link = LinkDefaultPresentation::create(this); |
223 } else { | 223 } else { |
224 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this); | 224 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this); |
225 if (fastHasAttribute(disabledAttr) || m_relAttribute.isTransitionExi
tingStylesheet()) | 225 if (fastHasAttribute(disabledAttr)) |
226 link->setDisabledState(true); | 226 link->setDisabledState(true); |
227 m_link = link.release(); | 227 m_link = link.release(); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 return m_link.get(); | 231 return m_link.get(); |
232 } | 232 } |
233 | 233 |
234 LinkStyle* HTMLLinkElement::linkStyle() const | 234 LinkStyle* HTMLLinkElement::linkStyle() const |
235 { | 235 { |
(...skipping 15 matching lines...) Expand all Loading... |
251 return link->importedDocument(); | 251 return link->importedDocument(); |
252 return nullptr; | 252 return nullptr; |
253 } | 253 } |
254 | 254 |
255 void HTMLLinkElement::process() | 255 void HTMLLinkElement::process() |
256 { | 256 { |
257 if (LinkResource* link = linkResourceToProcess()) | 257 if (LinkResource* link = linkResourceToProcess()) |
258 link->process(); | 258 link->process(); |
259 } | 259 } |
260 | 260 |
261 void HTMLLinkElement::setEnabledIfExitTransitionStyle(bool enabled) | |
262 { | |
263 if (m_relAttribute.isTransitionExitingStylesheet()) { | |
264 if (LinkStyle* link = linkStyle()) | |
265 link->setDisabledState(!enabled); | |
266 } | |
267 } | |
268 | |
269 Node::InsertionNotificationRequest HTMLLinkElement::insertedInto(ContainerNode*
insertionPoint) | 261 Node::InsertionNotificationRequest HTMLLinkElement::insertedInto(ContainerNode*
insertionPoint) |
270 { | 262 { |
271 if (insertionPoint->inDocument()) { | 263 if (insertionPoint->inDocument()) { |
272 V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivi
tyLoggerIfIsolatedWorld(); | 264 V8DOMActivityLogger* activityLogger = V8DOMActivityLogger::currentActivi
tyLoggerIfIsolatedWorld(); |
273 if (activityLogger) { | 265 if (activityLogger) { |
274 Vector<String> argv; | 266 Vector<String> argv; |
275 argv.append("link"); | 267 argv.append("link"); |
276 argv.append(fastGetAttribute(relAttr)); | 268 argv.append(fastGetAttribute(relAttr)); |
277 argv.append(fastGetAttribute(hrefAttr)); | 269 argv.append(fastGetAttribute(hrefAttr)); |
278 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data()
); | 270 activityLogger->logEvent("blinkAddElement", argv.size(), argv.data()
); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 return; | 695 return; |
704 if (!document().contentSecurityPolicy()->allowImageFromSource(builder.ur
l())) | 696 if (!document().contentSecurityPolicy()->allowImageFromSource(builder.ur
l())) |
705 return; | 697 return; |
706 if (document().frame() && document().frame()->loader().client()) | 698 if (document().frame() && document().frame()->loader().client()) |
707 document().frame()->loader().client()->dispatchDidChangeIcons(m_owne
r->relAttribute().iconType()); | 699 document().frame()->loader().client()->dispatchDidChangeIcons(m_owne
r->relAttribute().iconType()); |
708 } | 700 } |
709 | 701 |
710 if (!m_owner->loadLink(type, as, builder.url())) | 702 if (!m_owner->loadLink(type, as, builder.url())) |
711 return; | 703 return; |
712 | 704 |
713 if ((m_disabledState != Disabled) && (m_owner->relAttribute().isStyleSheet()
|| m_owner->relAttribute().isTransitionExitingStylesheet()) | 705 if (m_disabledState != Disabled && m_owner->relAttribute().isStyleSheet() &&
shouldLoadResource() && builder.url().isValid()) { |
714 && shouldLoadResource() && builder.url().isValid()) { | |
715 | 706 |
716 if (resource()) { | 707 if (resource()) { |
717 removePendingSheet(); | 708 removePendingSheet(); |
718 clearResource(); | 709 clearResource(); |
719 } | 710 } |
720 | 711 |
721 if (!m_owner->shouldLoadLink()) | 712 if (!m_owner->shouldLoadLink()) |
722 return; | 713 return; |
723 | 714 |
724 m_loading = true; | 715 m_loading = true; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 removePendingSheet(); | 766 removePendingSheet(); |
776 } | 767 } |
777 | 768 |
778 DEFINE_TRACE(LinkStyle) | 769 DEFINE_TRACE(LinkStyle) |
779 { | 770 { |
780 visitor->trace(m_sheet); | 771 visitor->trace(m_sheet); |
781 LinkResource::trace(visitor); | 772 LinkResource::trace(visitor); |
782 } | 773 } |
783 | 774 |
784 } // namespace blink | 775 } // namespace blink |
OLD | NEW |