OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/html/imports/HTMLImportChild.h" | 32 #include "core/html/imports/HTMLImportChild.h" |
33 | 33 |
| 34 #include "core/css/StyleSheetList.h" |
34 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
35 #include "core/dom/custom/CustomElement.h" | 36 #include "core/dom/custom/CustomElement.h" |
36 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" | 37 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" |
37 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" | 38 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" |
| 39 #include "core/frame/UseCounter.h" |
38 #include "core/html/imports/HTMLImportChildClient.h" | 40 #include "core/html/imports/HTMLImportChildClient.h" |
39 #include "core/html/imports/HTMLImportLoader.h" | 41 #include "core/html/imports/HTMLImportLoader.h" |
40 #include "core/html/imports/HTMLImportTreeRoot.h" | 42 #include "core/html/imports/HTMLImportTreeRoot.h" |
41 #include "core/html/imports/HTMLImportsController.h" | 43 #include "core/html/imports/HTMLImportsController.h" |
42 | 44 |
43 namespace blink { | 45 namespace blink { |
44 | 46 |
45 HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportLoader* loader, Sync
Mode sync) | 47 HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportLoader* loader, Sync
Mode sync) |
46 : HTMLImport(sync) | 48 : HTMLImport(sync) |
47 , m_url(url) | 49 , m_url(url) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 83 |
82 void HTMLImportChild::didFinish() | 84 void HTMLImportChild::didFinish() |
83 { | 85 { |
84 if (m_client) | 86 if (m_client) |
85 m_client->didFinish(); | 87 m_client->didFinish(); |
86 } | 88 } |
87 | 89 |
88 void HTMLImportChild::didFinishLoading() | 90 void HTMLImportChild::didFinishLoading() |
89 { | 91 { |
90 stateWillChange(); | 92 stateWillChange(); |
| 93 if (document() && document()->styleSheets()->length() > 0) |
| 94 UseCounter::count(root()->document(), UseCounter::HTMLImportsHasStyleShe
ets); |
91 CustomElement::didFinishLoadingImport(*(root()->document())); | 95 CustomElement::didFinishLoadingImport(*(root()->document())); |
92 } | 96 } |
93 | 97 |
94 void HTMLImportChild::didFinishUpgradingCustomElements() | 98 void HTMLImportChild::didFinishUpgradingCustomElements() |
95 { | 99 { |
96 stateWillChange(); | 100 stateWillChange(); |
97 m_customElementMicrotaskStep.clear(); | 101 m_customElementMicrotaskStep.clear(); |
98 } | 102 } |
99 | 103 |
100 void HTMLImportChild::dispose() | 104 void HTMLImportChild::dispose() |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 227 |
224 DEFINE_TRACE(HTMLImportChild) | 228 DEFINE_TRACE(HTMLImportChild) |
225 { | 229 { |
226 visitor->trace(m_customElementMicrotaskStep); | 230 visitor->trace(m_customElementMicrotaskStep); |
227 visitor->trace(m_loader); | 231 visitor->trace(m_loader); |
228 visitor->trace(m_client); | 232 visitor->trace(m_client); |
229 HTMLImport::trace(visitor); | 233 HTMLImport::trace(visitor); |
230 } | 234 } |
231 | 235 |
232 } // namespace blink | 236 } // namespace blink |
OLD | NEW |