Reviewed by Anders
<rdar://problem/
3028061> - WebKit never updates favicon
The WebKit enforced expiration date for icons has worked for some time, but the
move to the new Icon Loader broke the "always get the icon if the user refreshes the page"
functionality. This patch fixes that up, along with some other architectural improvements,
the main one being that WebCore::Document now contains an iconURL for the Frame to query if needed.
* bridge/mac/FrameMac.h: Added isLoadTypeReload()
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::isLoadTypeReload): Implementation, calls into the bridge
* bridge/mac/WebCoreFrameBridge.h: Added isLoadTypeReload:
* bridge/win/FrameWin.h: Added isLoadTypeReload() for temporary link stub
* dom/Document.h: Added m_iconURL
(WebCore::Document::iconURL): Added
(WebCore::Document::setIconURL): Ditto
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process): Sets the iconURL in the Document instead of the Frame
* page/Frame.cpp:
(WebCore::Frame::iconURL): Calculates the iconURL based on the document, then the default favicon.ico url
(WebCore::Frame::endIfNotLoading): Checks for the load type - always loads icon on Reload
* page/Frame.h: Nuked setIconURL(), added isLoadTypeReload()
* page/FramePrivate.h: Nuked IconURL
* platform/win/TemporaryLinkStubs.cpp:
(FrameWin::isLoadTypeReload):
WebKit:
Reviewed by Anders
Implement a bridge method so WebCore can find the reload type of a frame load
* WebCoreSupport/WebFrameBridge.m:
(-[WebFrameBridge isLoadTypeReload]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16440
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-18 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ <rdar://problem/3028061> - WebKit never updates favicon
+ The WebKit enforced expiration date for icons has worked for some time, but the
+ move to the new Icon Loader broke the "always get the icon if the user refreshes the page"
+ functionality. This patch fixes that up, along with some other architectural improvements,
+ the main one being that WebCore::Document now contains an iconURL for the Frame to query if needed.
+
+ * bridge/mac/FrameMac.h: Added isLoadTypeReload()
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::isLoadTypeReload): Implementation, calls into the bridge
+ * bridge/mac/WebCoreFrameBridge.h: Added isLoadTypeReload:
+ * bridge/win/FrameWin.h: Added isLoadTypeReload() for temporary link stub
+ * dom/Document.h: Added m_iconURL
+ (WebCore::Document::iconURL): Added
+ (WebCore::Document::setIconURL): Ditto
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::process): Sets the iconURL in the Document instead of the Frame
+ * page/Frame.cpp:
+ (WebCore::Frame::iconURL): Calculates the iconURL based on the document, then the default favicon.ico url
+ (WebCore::Frame::endIfNotLoading): Checks for the load type - always loads icon on Reload
+ * page/Frame.h: Nuked setIconURL(), added isLoadTypeReload()
+ * page/FramePrivate.h: Nuked IconURL
+ * platform/win/TemporaryLinkStubs.cpp:
+ (FrameWin::isLoadTypeReload):
+
2006-09-18 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Tim H.
virtual void startRedirectionTimer();
virtual void stopRedirectionTimer();
virtual void cleanupPluginObjects();
+ virtual bool isLoadTypeReload();
private:
virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
return [_bridge originalRequestURL];
}
+bool FrameMac::isLoadTypeReload()
+{
+ return [_bridge isLoadTypeReload];
+}
+
}
- (void)notifyIconChanged:(NSURL*)iconURL;
- (NSURL*)originalRequestURL;
+- (BOOL)isLoadTypeReload;
@end
// This interface definition allows those who hold a WebCoreFrameBridge * to call all the methods
bool keyPress(const PlatformKeyboardEvent&);
virtual KURL originalRequestURL() const;
+
+protected:
+ virtual bool isLoadTypeReload();
private:
virtual bool passMouseDownEventToWidget(Widget*);
return HashTraits<AtomicStringImpl*>::deletedValue();
}
+
+String Document::iconURL()
+{
+ return m_iconURL;
+}
+
+void Document::setIconURL(const String& iconURL, const String& type)
+{
+ // FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "type"
+ if (m_iconURL.isEmpty())
+ m_iconURL = iconURL;
+ else if (!type.isEmpty())
+ m_iconURL = iconURL;
+}
+
}
bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == DidLayoutWithPendingSheets; }
+ String iconURL();
+ void setIconURL(const String& iconURL, const String& type);
protected:
CSSStyleSelector* m_styleSelector;
FrameView* m_view;
DeprecatedString m_url;
DeprecatedString m_baseURL;
String m_baseTarget;
-
+
RefPtr<DocumentType> m_docType;
RefPtr<DOMImplementation> m_implementation;
mutable bool m_accessKeyMapValid;
bool m_createRenderers;
bool m_inPageCache;
+ String m_iconURL;
};
} //namespace
m_styleSelector->strictParsing = !inCompatMode();
}
-
+
}
bool hasDocExtraNamedItem(const String& name);
typedef HashMap<StringImpl*, int> NameCountMap;
-
+
protected:
HTMLElement* bodyElement;
HTMLElement* htmlElement;
return;
String type = m_type.lower();
-
- Frame* frame = document()->frame();
// IE extension: location of small icon for locationbar / bookmarks
- if (frame && m_isIcon && !m_url.isEmpty() && !frame->tree()->parent())
- frame->setIconURL(m_url, type);
+ // We'll record this URL per document, even if we later only use it in top level frames
+ if (m_isIcon && !m_url.isEmpty())
+ document()->setIconURL(m_url, type);
// Stylesheet
// This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning. -dwh
return "";
// If we have an iconURL from a Link element, return that
- if (!d->m_iconURL.isEmpty())
- return KURL(d->m_iconURL.deprecatedString());
+ if (!document()->iconURL().isEmpty())
+ return KURL(document()->iconURL().deprecatedString());
// Don't return a favicon iconURL unless we're http or https
if (d->m_url.protocol() != "http" && d->m_url.protocol() != "https")
return url;
}
-void Frame::setIconURL(const String& url, const String& type)
-{
- // FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "type"
- if (d->m_iconURL.isEmpty())
- d->m_iconURL = url;
- else if (!type.isEmpty())
- d->m_iconURL = url;
-}
-
bool Frame::didOpenURL(const KURL& url)
{
if (d->m_scheduledRedirection == locationChangeScheduledDuringLoad) {
IconDatabase* sharedIconDatabase = IconDatabase::sharedIconDatabase();
// If we already have an unexpired icon, we won't kick off a load but we *will* map the appropriate URLs to it
- if (sharedIconDatabase->hasEntryForIconURL(url) && !sharedIconDatabase->isIconExpiredForIconURL(url)) {
+ if (sharedIconDatabase->hasEntryForIconURL(url) && !isLoadTypeReload() && !sharedIconDatabase->isIconExpiredForIconURL(url)) {
commitIconURLToIconDatabase();
return;
}
void didExplicitOpen();
KURL iconURL();
- void setIconURL(const String& url, const String& type);
void commitIconURLToIconDatabase();
Page* page() const;
virtual ObjectContentType objectContentType(const KURL& url, const String& mimeType) = 0;
virtual void redirectionTimerFired(Timer<Frame>*);
+
+ virtual bool isLoadTypeReload() = 0;
public:
void loadDone();
String m_referrer;
- String m_iconURL;
-
struct SubmitForm {
const char* submitAction;
String submitUrl;
bool FrameWin::canGoBackOrForward(int) const { notImplemented(); return 0; }
void FrameWin::issuePasteAndMatchStyleCommand() { notImplemented(); }
KURL FrameWin::originalRequestURL() const { return KURL(); }
+bool FrameWin::isLoadTypeReload() { notImplemented(); return false; }
bool BrowserExtensionWin::canRunModal() { notImplemented(); return 0; }
void BrowserExtensionWin::createNewWindow(struct WebCore::ResourceRequest const&,struct WebCore::WindowArgs const&,Frame*&) { notImplemented(); }
+2006-09-18 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Anders
+
+ Implement a bridge method so WebCore can find the reload type of a frame load
+
+ * WebCoreSupport/WebFrameBridge.m:
+ (-[WebFrameBridge isLoadTypeReload]):
+
2006-09-18 Sam Weinig <sam.weinig@gmail.com>
Reviewed by Tim H.
return [[[[_frame _frameLoader] activeDataSource] initialRequest] URL];
}
+- (BOOL)isLoadTypeReload
+{
+ return [_frame _loadType] == WebFrameLoadTypeReload;
+}
+
+
+
@end