Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp

Issue 2551973003: Use correct document for notifying of inserted import. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/imports/import-child-null-document-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp
index 8718ce5913f19a5e8e8a2556319f3a7d5ff27399..33f3951e51cc66cd6c17c3befe96773acde9c2af 100644
--- a/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp
+++ b/third_party/WebKit/Source/core/html/imports/HTMLImportChild.cpp
@@ -47,14 +47,19 @@ namespace blink {
HTMLImportChild::HTMLImportChild(const KURL& url,
HTMLImportLoader* loader,
SyncMode sync)
- : HTMLImport(sync), m_url(url), m_loader(loader), m_client(nullptr) {}
+ : HTMLImport(sync), m_url(url), m_loader(loader), m_client(nullptr) {
+ DCHECK(loader);
+}
HTMLImportChild::~HTMLImportChild() {}
void HTMLImportChild::ownerInserted() {
if (!m_loader->isDone())
return;
- document()->styleEngine().htmlImportAddedOrRemoved();
+
+ DCHECK(root());
+ DCHECK(root()->document());
+ root()->document()->styleEngine().htmlImportAddedOrRemoved();
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
root()->document()->styleEngine().resolverChanged(AnalyzedStyleUpdate);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/html/imports/import-child-null-document-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698