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 29 matching lines...) Expand all Loading... |
40 #include "core/html/imports/HTMLImportChildClient.h" | 40 #include "core/html/imports/HTMLImportChildClient.h" |
41 #include "core/html/imports/HTMLImportLoader.h" | 41 #include "core/html/imports/HTMLImportLoader.h" |
42 #include "core/html/imports/HTMLImportTreeRoot.h" | 42 #include "core/html/imports/HTMLImportTreeRoot.h" |
43 #include "core/html/imports/HTMLImportsController.h" | 43 #include "core/html/imports/HTMLImportsController.h" |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 HTMLImportChild::HTMLImportChild(const KURL& url, | 47 HTMLImportChild::HTMLImportChild(const KURL& url, |
48 HTMLImportLoader* loader, | 48 HTMLImportLoader* loader, |
49 SyncMode sync) | 49 SyncMode sync) |
50 : HTMLImport(sync), m_url(url), m_loader(loader), m_client(nullptr) {} | 50 : HTMLImport(sync), m_url(url), m_loader(loader), m_client(nullptr) { |
| 51 DCHECK(loader); |
| 52 } |
51 | 53 |
52 HTMLImportChild::~HTMLImportChild() {} | 54 HTMLImportChild::~HTMLImportChild() {} |
53 | 55 |
54 void HTMLImportChild::ownerInserted() { | 56 void HTMLImportChild::ownerInserted() { |
55 if (!m_loader->isDone()) | 57 if (!m_loader->isDone()) |
56 return; | 58 return; |
57 document()->styleEngine().htmlImportAddedOrRemoved(); | 59 |
| 60 DCHECK(root()); |
| 61 DCHECK(root()->document()); |
| 62 root()->document()->styleEngine().htmlImportAddedOrRemoved(); |
58 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet | 63 // TODO(rune@opera.com): resolverChanged() can be removed once stylesheet |
59 // updates are async. https://crbug.com/567021 | 64 // updates are async. https://crbug.com/567021 |
60 root()->document()->styleEngine().resolverChanged(AnalyzedStyleUpdate); | 65 root()->document()->styleEngine().resolverChanged(AnalyzedStyleUpdate); |
61 } | 66 } |
62 | 67 |
63 void HTMLImportChild::didShareLoader() { | 68 void HTMLImportChild::didShareLoader() { |
64 createCustomElementMicrotaskStepIfNeeded(); | 69 createCustomElementMicrotaskStepIfNeeded(); |
65 stateWillChange(); | 70 stateWillChange(); |
66 } | 71 } |
67 | 72 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 #endif | 194 #endif |
190 | 195 |
191 DEFINE_TRACE(HTMLImportChild) { | 196 DEFINE_TRACE(HTMLImportChild) { |
192 visitor->trace(m_customElementMicrotaskStep); | 197 visitor->trace(m_customElementMicrotaskStep); |
193 visitor->trace(m_loader); | 198 visitor->trace(m_loader); |
194 visitor->trace(m_client); | 199 visitor->trace(m_client); |
195 HTMLImport::trace(visitor); | 200 HTMLImport::trace(visitor); |
196 } | 201 } |
197 | 202 |
198 } // namespace blink | 203 } // namespace blink |
OLD | NEW |