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

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

Issue 1312733003: [HTMLImport] Add an Usecounter if imported ducmnet has stylesheets. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Check if document is loaded Created 5 years, 4 months 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 | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/imports/HTMLImportChild.cpp
diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp
index 910f1dc2618c447ee0a37a064f38dbebea3a8b30..f4cd333ff6a9ff0b7d4b18b36a335cdca3c43561 100644
--- a/Source/core/html/imports/HTMLImportChild.cpp
+++ b/Source/core/html/imports/HTMLImportChild.cpp
@@ -31,10 +31,12 @@
#include "config.h"
#include "core/html/imports/HTMLImportChild.h"
+#include "core/css/StyleSheetList.h"
#include "core/dom/Document.h"
#include "core/dom/custom/CustomElement.h"
#include "core/dom/custom/CustomElementMicrotaskImportStep.h"
#include "core/dom/custom/CustomElementSyncMicrotaskQueue.h"
+#include "core/frame/UseCounter.h"
#include "core/html/imports/HTMLImportChildClient.h"
#include "core/html/imports/HTMLImportLoader.h"
#include "core/html/imports/HTMLImportTreeRoot.h"
@@ -88,6 +90,8 @@ void HTMLImportChild::didFinish()
void HTMLImportChild::didFinishLoading()
{
stateWillChange();
+ if (document() && document()->styleSheets()->length() > 0)
+ UseCounter::count(root()->document(), UseCounter::HTMLImportsHasStyleSheets);
CustomElement::didFinishLoadingImport(*(root()->document()));
}
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698