| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/html/imports/HTMLImportTreeRoot.h" | 5 #include "core/html/imports/HTMLImportTreeRoot.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/dom/StyleEngine.h" | 8 #include "core/dom/StyleEngine.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/html/imports/HTMLImportChild.h" | 10 #include "core/html/imports/HTMLImportChild.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 document_->GetStyleEngine().HaveScriptBlockingStylesheetsLoaded(); | 44 document_->GetStyleEngine().HaveScriptBlockingStylesheetsLoaded(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void HTMLImportTreeRoot::StateWillChange() { | 47 void HTMLImportTreeRoot::StateWillChange() { |
| 48 ScheduleRecalcState(); | 48 ScheduleRecalcState(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void HTMLImportTreeRoot::StateDidChange() { | 51 void HTMLImportTreeRoot::StateDidChange() { |
| 52 HTMLImport::StateDidChange(); | 52 HTMLImport::StateDidChange(); |
| 53 | 53 |
| 54 if (!GetState().IsReady()) | 54 if (GetState().IsReady()) |
| 55 return; | 55 document_->CheckCompleted(); |
| 56 if (LocalFrame* frame = document_->GetFrame()) | |
| 57 frame->Loader().CheckCompleted(); | |
| 58 } | 56 } |
| 59 | 57 |
| 60 void HTMLImportTreeRoot::ScheduleRecalcState() { | 58 void HTMLImportTreeRoot::ScheduleRecalcState() { |
| 61 DCHECK(document_); | 59 DCHECK(document_); |
| 62 if (recalc_timer_.IsActive() || !document_->IsActive()) | 60 if (recalc_timer_.IsActive() || !document_->IsActive()) |
| 63 return; | 61 return; |
| 64 recalc_timer_.StartOneShot(0, BLINK_FROM_HERE); | 62 recalc_timer_.StartOneShot(0, BLINK_FROM_HERE); |
| 65 } | 63 } |
| 66 | 64 |
| 67 HTMLImportChild* HTMLImportTreeRoot::Add(HTMLImportChild* child) { | 65 HTMLImportChild* HTMLImportTreeRoot::Add(HTMLImportChild* child) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 83 HTMLImport::RecalcTreeState(this); | 81 HTMLImport::RecalcTreeState(this); |
| 84 } | 82 } |
| 85 | 83 |
| 86 DEFINE_TRACE(HTMLImportTreeRoot) { | 84 DEFINE_TRACE(HTMLImportTreeRoot) { |
| 87 visitor->Trace(document_); | 85 visitor->Trace(document_); |
| 88 visitor->Trace(imports_); | 86 visitor->Trace(imports_); |
| 89 HTMLImport::Trace(visitor); | 87 HTMLImport::Trace(visitor); |
| 90 } | 88 } |
| 91 | 89 |
| 92 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |