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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.h

Issue 2835183002: Provide a method to remove inserted style sheet (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: third_party/WebKit/Source/core/dom/StyleEngine.h
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h
index 80d75bfceeb78c6dc30f154148bc85f9223d3f73..665e9eb30e86721a723bccc57af0bd61d58d5f24 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.h
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.h
@@ -31,6 +31,7 @@
#define StyleEngine_h
#include <memory>
+#include <utility>
#include "core/CoreExport.h"
#include "core/css/ActiveStyleSheets.h"
#include "core/css/CSSFontSelectorClient.h"
@@ -50,6 +51,7 @@
#include "platform/wtf/ListHashSet.h"
#include "platform/wtf/Vector.h"
#include "platform/wtf/text/WTFString.h"
+#include "public/web/WebDocument.h"
namespace blink {
@@ -93,7 +95,8 @@ class CORE_EXPORT StyleEngine final
const HeapVector<TraceWrapperMember<StyleSheet>>&
StyleSheetsForStyleSheetList(TreeScope&);
- const HeapVector<TraceWrapperMember<CSSStyleSheet>>&
+ const HeapVector<
+ std::pair<WebStyleSheetId, TraceWrapperMember<CSSStyleSheet>>>&
InjectedAuthorStyleSheets() const {
return injected_author_style_sheets_;
}
@@ -112,7 +115,8 @@ class CORE_EXPORT StyleEngine final
void ViewportRulesChanged();
void HtmlImportAddedOrRemoved();
- void InjectAuthorSheet(StyleSheetContents* author_sheet);
+ WebStyleSheetId InjectAuthorSheet(StyleSheetContents* author_sheet);
+ void RemoveInjectedAuthorSheet(WebStyleSheetId author_sheet_id);
CSSStyleSheet& EnsureInspectorStyleSheet();
RuleSet* WatchedSelectorsRuleSet() {
DCHECK(IsMaster());
@@ -356,7 +360,8 @@ class CORE_EXPORT StyleEngine final
int pending_render_blocking_stylesheets_ = 0;
int pending_body_stylesheets_ = 0;
- HeapVector<TraceWrapperMember<CSSStyleSheet>> injected_author_style_sheets_;
+ HeapVector<std::pair<WebStyleSheetId, TraceWrapperMember<CSSStyleSheet>>>
+ injected_author_style_sheets_;
Member<CSSStyleSheet> inspector_style_sheet_;
TraceWrapperMember<DocumentStyleSheetCollection>
@@ -398,6 +403,8 @@ class CORE_EXPORT StyleEngine final
std::unique_ptr<StyleResolverStats> style_resolver_stats_;
unsigned style_for_element_count_ = 0;
+ WebStyleSheetId injected_author_sheets_id_count_ = 0;
+
friend class StyleEngineTest;
};

Powered by Google App Engine
This is Rietveld 408576698