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

Unified Diff: chrome/test/data/onload_change_favicon.html

Issue 1747015: Add support for new webkit capability allowing us to update (Closed)
Patch Set: Created 10 years, 8 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
« chrome/renderer/render_view.cc ('K') | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/onload_change_favicon.html
diff --git a/chrome/test/data/onload_change_favicon.html b/chrome/test/data/onload_change_favicon.html
new file mode 100755
index 0000000000000000000000000000000000000000..49a894385f8703a6150eb4c99e9b58d7ef911d6f
--- /dev/null
+++ b/chrome/test/data/onload_change_favicon.html
@@ -0,0 +1,37 @@
+<html>
+<head>
+<title></title>
+<link rel='icon' href='test.png'>
+<script type='text/javascript' language='javascript'>
+function removeLinkIfExists() {
+ var docHead = document.getElementsByTagName("head")[0];
+ var links = docHead.getElementsByTagName("link");
+ for (var i=0; i<links.length; i++) {
+ var link = links[i];
+ if (link.type=="image/x-icon" && link.rel=="shortcut icon") {
+ docHead.removeChild(link);
+ return; // Assuming only one match at most.
+ }
+ }
+}
+
+function addLink(iconURL) {
+ var docHead = document.getElementsByTagName("head")[0];
+ var link = document.createElement("link");
+ link.type = "image/x-icon";
+ link.rel = "shortcut icon";
+ link.href = iconURL;
+ removeLinkIfExists();
+ docHead.appendChild(link);
+}
+
+function OnLoad() {
+ addLink("test1.png");
+}
+
+</script>
+</head>
+<body onload='OnLoad();'>
+<a name='test'>
+</body>
+</html>
« chrome/renderer/render_view.cc ('K') | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698