Changeset 16440 in webkit
- Timestamp:
- Sep 18, 2006 7:21:52 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r16439 r16440 1 2006-09-18 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders 4 5 <rdar://problem/3028061> - WebKit never updates favicon 6 The WebKit enforced expiration date for icons has worked for some time, but the 7 move to the new Icon Loader broke the "always get the icon if the user refreshes the page" 8 functionality. This patch fixes that up, along with some other architectural improvements, 9 the main one being that WebCore::Document now contains an iconURL for the Frame to query if needed. 10 11 * bridge/mac/FrameMac.h: Added isLoadTypeReload() 12 * bridge/mac/FrameMac.mm: 13 (WebCore::FrameMac::isLoadTypeReload): Implementation, calls into the bridge 14 * bridge/mac/WebCoreFrameBridge.h: Added isLoadTypeReload: 15 * bridge/win/FrameWin.h: Added isLoadTypeReload() for temporary link stub 16 * dom/Document.h: Added m_iconURL 17 (WebCore::Document::iconURL): Added 18 (WebCore::Document::setIconURL): Ditto 19 * html/HTMLLinkElement.cpp: 20 (WebCore::HTMLLinkElement::process): Sets the iconURL in the Document instead of the Frame 21 * page/Frame.cpp: 22 (WebCore::Frame::iconURL): Calculates the iconURL based on the document, then the default favicon.ico url 23 (WebCore::Frame::endIfNotLoading): Checks for the load type - always loads icon on Reload 24 * page/Frame.h: Nuked setIconURL(), added isLoadTypeReload() 25 * page/FramePrivate.h: Nuked IconURL 26 * platform/win/TemporaryLinkStubs.cpp: 27 (FrameWin::isLoadTypeReload): 28 1 29 2006-09-18 Sam Weinig <sam.weinig@gmail.com> 2 30 -
trunk/WebCore/bridge/mac/FrameMac.h
r16423 r16440 325 325 virtual void stopRedirectionTimer(); 326 326 virtual void cleanupPluginObjects(); 327 virtual bool isLoadTypeReload(); 327 328 328 329 private: -
trunk/WebCore/bridge/mac/FrameMac.mm
r16368 r16440 3571 3571 } 3572 3572 3573 } 3573 bool FrameMac::isLoadTypeReload() 3574 { 3575 return [_bridge isLoadTypeReload]; 3576 } 3577 3578 } -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.h
r16386 r16440 689 689 - (void)notifyIconChanged:(NSURL*)iconURL; 690 690 - (NSURL*)originalRequestURL; 691 - (BOOL)isLoadTypeReload; 691 692 @end 692 693 -
trunk/WebCore/bridge/win/FrameWin.h
r16423 r16440 127 127 bool keyPress(const PlatformKeyboardEvent&); 128 128 virtual KURL originalRequestURL() const; 129 130 protected: 131 virtual bool isLoadTypeReload(); 129 132 130 133 private: -
trunk/WebCore/dom/Document.cpp
r16411 r16440 3482 3482 } 3483 3483 3484 } 3484 3485 String Document::iconURL() 3486 { 3487 return m_iconURL; 3488 } 3489 3490 void Document::setIconURL(const String& iconURL, const String& type) 3491 { 3492 // FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "type" 3493 if (m_iconURL.isEmpty()) 3494 m_iconURL = iconURL; 3495 else if (!type.isEmpty()) 3496 m_iconURL = iconURL; 3497 } 3498 3499 } -
trunk/WebCore/dom/Document.h
r16348 r16440 599 599 bool didLayoutWithPendingStylesheets() const { return m_pendingSheetLayout == DidLayoutWithPendingSheets; } 600 600 601 String iconURL(); 602 void setIconURL(const String& iconURL, const String& type); 601 603 protected: 602 604 CSSStyleSelector* m_styleSelector; … … 608 610 DeprecatedString m_baseURL; 609 611 String m_baseTarget; 610 612 611 613 RefPtr<DocumentType> m_docType; 612 614 RefPtr<DOMImplementation> m_implementation; … … 813 815 bool m_createRenderers; 814 816 bool m_inPageCache; 817 String m_iconURL; 815 818 }; 816 819 -
trunk/WebCore/html/HTMLDocument.cpp
r16405 r16440 423 423 424 424 } 425 426 } 425 426 } -
trunk/WebCore/html/HTMLDocument.h
r16245 r16440 66 66 67 67 typedef HashMap<StringImpl*, int> NameCountMap; 68 68 69 69 protected: 70 70 HTMLElement* bodyElement; -
trunk/WebCore/html/HTMLLinkElement.cpp
r16405 r16440 153 153 154 154 String type = m_type.lower(); 155 156 Frame* frame = document()->frame();157 155 158 156 // IE extension: location of small icon for locationbar / bookmarks 159 if (frame && m_isIcon && !m_url.isEmpty() && !frame->tree()->parent()) 160 frame->setIconURL(m_url, type); 157 // We'll record this URL per document, even if we later only use it in top level frames 158 if (m_isIcon && !m_url.isEmpty()) 159 document()->setIconURL(m_url, type); 161 160 162 161 // Stylesheet -
trunk/WebCore/page/Frame.cpp
r16423 r16440 232 232 233 233 // If we have an iconURL from a Link element, return that 234 if (!d ->m_iconURL.isEmpty())235 return KURL(d ->m_iconURL.deprecatedString());234 if (!document()->iconURL().isEmpty()) 235 return KURL(document()->iconURL().deprecatedString()); 236 236 237 237 // Don't return a favicon iconURL unless we're http or https … … 244 244 url.setPath("/favicon.ico"); 245 245 return url; 246 }247 248 void Frame::setIconURL(const String& url, const String& type)249 {250 // FIXME - <rdar://problem/4727645> - At some point in the future, we might actually honor the "type"251 if (d->m_iconURL.isEmpty())252 d->m_iconURL = url;253 else if (!type.isEmpty())254 d->m_iconURL = url;255 246 } 256 247 … … 783 774 IconDatabase* sharedIconDatabase = IconDatabase::sharedIconDatabase(); 784 775 // If we already have an unexpired icon, we won't kick off a load but we *will* map the appropriate URLs to it 785 if (sharedIconDatabase->hasEntryForIconURL(url) && ! sharedIconDatabase->isIconExpiredForIconURL(url)) {776 if (sharedIconDatabase->hasEntryForIconURL(url) && !isLoadTypeReload() && !sharedIconDatabase->isIconExpiredForIconURL(url)) { 786 777 commitIconURLToIconDatabase(); 787 778 return; -
trunk/WebCore/page/Frame.h
r16423 r16440 108 108 109 109 KURL iconURL(); 110 void setIconURL(const String& url, const String& type);111 110 void commitIconURLToIconDatabase(); 112 111 … … 591 590 592 591 virtual void redirectionTimerFired(Timer<Frame>*); 592 593 virtual bool isLoadTypeReload() = 0; 593 594 594 595 public: -
trunk/WebCore/page/FramePrivate.h
r16363 r16440 174 174 String m_referrer; 175 175 176 String m_iconURL;177 178 176 struct SubmitForm { 179 177 const char* submitAction; -
trunk/WebCore/platform/win/TemporaryLinkStubs.cpp
r16436 r16440 183 183 void FrameWin::issuePasteAndMatchStyleCommand() { notImplemented(); } 184 184 KURL FrameWin::originalRequestURL() const { return KURL(); } 185 bool FrameWin::isLoadTypeReload() { notImplemented(); return false; } 185 186 186 187 bool BrowserExtensionWin::canRunModal() { notImplemented(); return 0; } -
trunk/WebKit/ChangeLog
r16438 r16440 1 2006-09-18 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders 4 5 Implement a bridge method so WebCore can find the reload type of a frame load 6 7 * WebCoreSupport/WebFrameBridge.m: 8 (-[WebFrameBridge isLoadTypeReload]): 9 1 10 2006-09-18 Sam Weinig <sam.weinig@gmail.com> 2 11 -
trunk/WebKit/WebCoreSupport/WebFrameBridge.m
r16395 r16440 1714 1714 } 1715 1715 1716 - (BOOL)isLoadTypeReload 1717 { 1718 return [_frame _loadType] == WebFrameLoadTypeReload; 1719 } 1720 1721 1722 1716 1723 @end
Note: See TracChangeset
for help on using the changeset viewer.