Commit eeaac5fd authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

2011-05-11 Tao Bai <michaelbai@chromium.org>

        Reviewed by David Kilzer.

        Return empty Favicon URL instead of default one when the frame isn't top level one
        https://bugs.webkit.org/show_bug.cgi?id=60527
        This issue was discovered by chromium browser test.

        * dom/Document.cpp:
        (WebCore::Document::setIconURL):
        Restored original logic which was inadvertently flipped by http://trac.webkit.org/changeset/85785.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::iconURLs):
        (WebCore::FrameLoader::fillIconURL):
        Restored original logic, the empty URL should be returned instead of default one. The client (at
        least chromium) may rely on the returned value to decided whether the favicon should be changed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 72e44f58
2011-05-11 Tao Bai <michaelbai@chromium.org>
Reviewed by David Kilzer.
Return empty Favicon URL instead of default one when the frame isn't top level one
https://bugs.webkit.org/show_bug.cgi?id=60527
This issue was discovered by chromium browser test.
* dom/Document.cpp:
(WebCore::Document::setIconURL):
Restored original logic which was inadvertently flipped by http://trac.webkit.org/changeset/85785.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::iconURLs):
(WebCore::FrameLoader::fillIconURL):
Restored original logic, the empty URL should be returned instead of default one. The client (at
least chromium) may rely on the returned value to decided whether the favicon should be changed.
2011-05-11 Nat Duca <nduca@chromium.org>
 
Reviewed by Kenneth Russell.
......@@ -4422,7 +4422,7 @@ void Document::setIconURL(const String& url, const String& mimeType, IconType ic
{
// FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "mimeType"
IconURL newURL(KURL(ParsedURLString, url), iconType);
if (!iconURL(iconType).m_iconURL.isEmpty())
if (iconURL(iconType).m_iconURL.isEmpty())
setIconURL(newURL);
else if (!mimeType.isEmpty())
setIconURL(newURL);
......
......@@ -476,6 +476,10 @@ KURL FrameLoader::iconURL()
IconURLs FrameLoader::iconURLs(int iconTypes)
{
IconURLs iconURLs;
// If this isn't a top level frame, return
if (m_frame->tree() && m_frame->tree()->parent())
return iconURLs;
if (iconTypes & Favicon && !fillIconURL(Favicon, &iconURLs))
iconURLs.append(getDefaultIconURL(Favicon));
......@@ -499,10 +503,6 @@ IconURLs FrameLoader::iconURLs(int iconTypes)
bool FrameLoader::fillIconURL(IconType iconType, IconURLs* iconURLs)
{
// If this isn't a top level frame, return
if (m_frame->tree() && m_frame->tree()->parent())
return false;
// If we have an iconURL from a Link element, return that
IconURL url = m_frame->document()->iconURL(iconType);
if (url.m_iconURL.isEmpty())
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment