| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) |
| 4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights | 4 * Copyright (C) 2002, 2005, 2006, 2008, 2009, 2010, 2012 Apple Inc. All rights |
| 5 * reserved. | 5 * 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 14 matching lines...) Expand all Loading... |
| 25 #include "core/css/StyleSheetContents.h" | 25 #include "core/css/StyleSheetContents.h" |
| 26 #include "core/dom/Document.h" | 26 #include "core/dom/Document.h" |
| 27 #include "core/loader/resource/CSSStyleSheetResource.h" | 27 #include "core/loader/resource/CSSStyleSheetResource.h" |
| 28 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" | 28 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" |
| 29 #include "platform/loader/fetch/FetchRequest.h" | 29 #include "platform/loader/fetch/FetchRequest.h" |
| 30 #include "platform/loader/fetch/ResourceFetcher.h" | 30 #include "platform/loader/fetch/ResourceFetcher.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 StyleRuleImport* StyleRuleImport::create(const String& href, | 34 StyleRuleImport* StyleRuleImport::create(const String& href, |
| 35 MediaQuerySet* media) { | 35 RefPtr<MediaQuerySet> media) { |
| 36 return new StyleRuleImport(href, media); | 36 return new StyleRuleImport(href, media); |
| 37 } | 37 } |
| 38 | 38 |
| 39 StyleRuleImport::StyleRuleImport(const String& href, MediaQuerySet* media) | 39 StyleRuleImport::StyleRuleImport(const String& href, |
| 40 RefPtr<MediaQuerySet> media) |
| 40 : StyleRuleBase(Import), | 41 : StyleRuleBase(Import), |
| 41 m_parentStyleSheet(nullptr), | 42 m_parentStyleSheet(nullptr), |
| 42 m_styleSheetClient(new ImportedStyleSheetClient(this)), | 43 m_styleSheetClient(new ImportedStyleSheetClient(this)), |
| 43 m_strHref(href), | 44 m_strHref(href), |
| 44 m_mediaQueries(media), | 45 m_mediaQueries(media), |
| 45 m_loading(false) { | 46 m_loading(false) { |
| 46 if (!m_mediaQueries) | 47 if (!m_mediaQueries) |
| 47 m_mediaQueries = MediaQuerySet::create(String()); | 48 m_mediaQueries = MediaQuerySet::create(String()); |
| 48 } | 49 } |
| 49 | 50 |
| 50 StyleRuleImport::~StyleRuleImport() {} | 51 StyleRuleImport::~StyleRuleImport() {} |
| 51 | 52 |
| 52 void StyleRuleImport::dispose() { | 53 void StyleRuleImport::dispose() { |
| 53 if (m_resource) | 54 if (m_resource) |
| 54 m_resource->removeClient(m_styleSheetClient); | 55 m_resource->removeClient(m_styleSheetClient); |
| 55 m_resource = nullptr; | 56 m_resource = nullptr; |
| 56 } | 57 } |
| 57 | 58 |
| 58 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleImport) { | 59 DEFINE_TRACE_AFTER_DISPATCH(StyleRuleImport) { |
| 59 visitor->trace(m_styleSheetClient); | 60 visitor->trace(m_styleSheetClient); |
| 60 visitor->trace(m_parentStyleSheet); | 61 visitor->trace(m_parentStyleSheet); |
| 61 visitor->trace(m_mediaQueries); | |
| 62 visitor->trace(m_styleSheet); | 62 visitor->trace(m_styleSheet); |
| 63 visitor->trace(m_resource); | 63 visitor->trace(m_resource); |
| 64 StyleRuleBase::traceAfterDispatch(visitor); | 64 StyleRuleBase::traceAfterDispatch(visitor); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void StyleRuleImport::setCSSStyleSheet( | 67 void StyleRuleImport::setCSSStyleSheet( |
| 68 const String& href, | 68 const String& href, |
| 69 const KURL& baseURL, | 69 const KURL& baseURL, |
| 70 const String& charset, | 70 const String& charset, |
| 71 const CSSStyleSheetResource* cachedStyleSheet) { | 71 const CSSStyleSheetResource* cachedStyleSheet) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // the sheet being imported is pending. | 144 // the sheet being imported is pending. |
| 145 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && | 145 if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && |
| 146 rootSheet == m_parentStyleSheet) | 146 rootSheet == m_parentStyleSheet) |
| 147 m_parentStyleSheet->startLoadingDynamicSheet(); | 147 m_parentStyleSheet->startLoadingDynamicSheet(); |
| 148 m_loading = true; | 148 m_loading = true; |
| 149 m_resource->addClient(m_styleSheetClient); | 149 m_resource->addClient(m_styleSheetClient); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |