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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 285623003: Navigation transitions: Added "addStyleSheetByURL" function to insert stylesheet links. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index d0c099b10d3316a056370afd074d54345b09eafd..11c22c9d43cb10e8155f0daac6597885a796ff95 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1284,6 +1284,17 @@ void WebLocalFrameImpl::extendSelectionAndDelete(int before, int after)
frame()->inputMethodController().extendSelectionAndDelete(before, after);
}
+void WebLocalFrameImpl::addStyleSheetByURL(const WebString& url)
+{
+ RefPtr<Element> styleElement = frame()->document()->createElement(HTMLNames::linkTag, false);
+
+ styleElement->setAttribute(HTMLNames::typeAttr, "text/css");
+ styleElement->setAttribute(HTMLNames::relAttr, "stylesheet");
+ styleElement->setAttribute(HTMLNames::hrefAttr, url);
+
+ frame()->document()->head()->appendChild(styleElement.release(), IGNORE_EXCEPTION);
+}
+
void WebLocalFrameImpl::setCaretVisible(bool visible)
{
frame()->selection().setCaretVisible(visible);
« no previous file with comments | « Source/web/WebLocalFrameImpl.h ('k') | Source/web/WebRemoteFrameImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698