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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 2575273002: Fix empty href for favicon link element causing page to be fetched twice. (Closed)
Patch Set: Update test Created 4 years 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/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index e3baf910d492c2287c9c1a5f97b1bcde1a9b0cd1..ae4f4dd33c61a07379bb4d6c073955834bde5257 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -324,7 +324,10 @@ const QualifiedName& HTMLLinkElement::subResourceAttributeName() const {
}
KURL HTMLLinkElement::href() const {
- return document().completeURL(getAttribute(hrefAttr));
+ const String& url = getAttribute(hrefAttr);
+ if (url.isEmpty())
+ return KURL();
+ return document().completeURL(url);
}
const AtomicString& HTMLLinkElement::rel() const {
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/html/HTMLLinkElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698