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

Unified Diff: third_party/WebKit/Source/web/WebDocument.cpp

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/web/WebDocument.cpp
diff --git a/third_party/WebKit/Source/web/WebDocument.cpp b/third_party/WebKit/Source/web/WebDocument.cpp
index 8dfe2b6a37518a6f5fa511a6a67adeb0edbb2128..6f423cb0df31d34f571c7d68e91059a999730e19 100644
--- a/third_party/WebKit/Source/web/WebDocument.cpp
+++ b/third_party/WebKit/Source/web/WebDocument.cpp
@@ -182,13 +182,17 @@ WebElement WebDocument::FocusedElement() const {
return WebElement(ConstUnwrap<Document>()->FocusedElement());
}
-void WebDocument::InsertStyleSheet(const WebString& source_code) {
+WebStyleSheetId WebDocument::InsertStyleSheet(const WebString& source_code) {
Document* document = Unwrap<Document>();
DCHECK(document);
StyleSheetContents* parsed_sheet =
StyleSheetContents::Create(CSSParserContext::Create(*document));
parsed_sheet->ParseString(source_code);
- document->GetStyleEngine().InjectAuthorSheet(parsed_sheet);
+ return document->GetStyleEngine().InjectAuthorSheet(parsed_sheet);
+}
+
+void WebDocument::RemoveInsertedStyleSheet(WebStyleSheetId stylesheet_id) {
+ Unwrap<Document>()->GetStyleEngine().RemoveInjectedAuthorSheet(stylesheet_id);
}
void WebDocument::WatchCSSSelectors(const WebVector<WebString>& web_selectors) {
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngineTest.cpp ('k') | third_party/WebKit/Source/web/tests/WebDocumentTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698