[webkit-help] Triggering icon load after FrameLoaderClient::dispatchDidChangeIcons event

Konstantin Tokarev annulen at yandex.ru
Fri Apr 21 05:17:28 PDT 2017


I'm trying to support dynamic updates of favicon in WebKit1 (Qt port), like
what happens in the following example:

    <link rel="shortcut icon" href="https://0x0.st/xgW.ico"/>
updateIcon = function() {
    var link = document.querySelector("link[rel*='icon']")
    link.href = 'https://0x0.st/xgV.ico';
    <input type="button" onClick="updateIcon()" value="Click me!"/>

I've found that FrameLoaderClient::dispatchDidChangeIcons() is called in this
case, however FrameLoaderClient::dispatchDidReceiveIcon() is not, and
icon inside IconDatabase is not updated.

I've found that doing the following call in my overload of dispatchDidChangeIcons
fixes things:


(where m_frame is WebCore::Frame)

Is it the right thng to do? I see startLoader is called only inside Document, this makes
me wonder if there is any layering violation here.

Thanks in advance!


More information about the webkit-help mailing list