http://bugzilla.opendarwin.org/show_bug.cgi?id=10907
REGRESSION: New Icon Loaders don't handle certain non-server-root URLs correctly
* bridge/mac/FrameMac.h: Changed originalRequestURL() to virtual
* bridge/win/FrameWin.h: Added originalRequestURL()
* loader/icon/IconLoader.cpp:
(IconLoader::receivedAllData): Moved the "pageURL to iconURL mapping logic" to Frame::commitIconURLToIconDatabase()
* page/Frame.cpp:
(WebCore::Frame::iconURL): Construct the icon URL from *only* the protocol and host of the frame's url.
(WebCore::Frame::endIfNotLoading): Call commitIconURLToIconDatabase() if we're not kicking off an icon load
(WebCore::Frame::commitIconURLToIconDatabase): Map the completed doc's pageURL to the iconURL
* page/Frame.h: Added pure virtual originalRequestURL()
* platform/win/TemporaryLinkStubs.cpp:
(FrameWin::originalRequestURL): Added
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16423
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-09-18 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=10907
+ REGRESSION: New Icon Loaders don't handle certain non-server-root URLs correctly
+
+ * bridge/mac/FrameMac.h: Changed originalRequestURL() to virtual
+ * bridge/win/FrameWin.h: Added originalRequestURL()
+ * loader/icon/IconLoader.cpp:
+ (IconLoader::receivedAllData): Moved the "pageURL to iconURL mapping logic" to Frame::commitIconURLToIconDatabase()
+ * page/Frame.cpp:
+ (WebCore::Frame::iconURL): Construct the icon URL from *only* the protocol and host of the frame's url.
+ (WebCore::Frame::endIfNotLoading): Call commitIconURLToIconDatabase() if we're not kicking off an icon load
+ (WebCore::Frame::commitIconURLToIconDatabase): Map the completed doc's pageURL to the iconURL
+ * page/Frame.h: Added pure virtual originalRequestURL()
+ * platform/win/TemporaryLinkStubs.cpp:
+ (FrameWin::originalRequestURL): Added
+
2006-09-18 Rob Buis <buis@kde.org>
Reviewed by Maciej.
void paintCustomHighlight(const AtomicString& type, const FloatRect& boxRect, const FloatRect& lineRect, bool text, bool line);
NSEvent* currentEvent() { return _currentEvent; }
- KURL originalRequestURL() const;
+ virtual KURL originalRequestURL() const;
protected:
virtual void startRedirectionTimer();
virtual void handleMousePressEvent(const MouseEventWithHitTestResults&);
virtual void handleMouseMoveEvent(const MouseEventWithHitTestResults&);
virtual void handleMouseReleaseEvent(const MouseEventWithHitTestResults&);
-
+
NSView* mouseDownViewIfStillGood();
NSView* nextKeyViewInFrame(Node* startingPoint, SelectionDirection, bool* focusCallResultedInViewBeingCreated = 0);
virtual void print();
bool keyPress(const PlatformKeyboardEvent&);
+ virtual KURL originalRequestURL() const;
private:
virtual bool passMouseDownEventToWidget(Widget*);
size = m_data.size();
}
- IconDatabase * iconDatabase = IconDatabase::sharedIconDatabase();
+ IconDatabase* iconDatabase = IconDatabase::sharedIconDatabase();
ASSERT(iconDatabase);
KURL iconURL(resourceLoader->url());
else
iconDatabase->setHaveNoIconForIconURL(iconURL.url());
- // We set both the original request URL and the final URL as the PageURLs as different parts
- // of the app tend to want to retain both
- iconDatabase->setIconURLForPageURL(iconURL.url(), m_frame->url().url());
-
- // FIXME - Need to be able to do the following platform independently
-#if PLATFORM(MAC)
- FrameMac* frameMac = Mac(m_frame);
- iconDatabase->setIconURLForPageURL(iconURL.url(), frameMac->originalRequestURL().url());
-#endif
-
+ // Tell the Frame to map its url(s) to its iconURL in the database
+ m_frame->commitIconURLToIconDatabase();
+
+ // Send the notification to the app that this icon is finished loading
notifyIconChanged(iconURL);
// ResourceLoaders delete themselves after they deliver their last data, so we can just forget about it
if (d->m_url.protocol() != "http" && d->m_url.protocol() != "https")
return "";
- KURL url = d->m_url;
+ KURL url;
+ url.setProtocol(d->m_url.protocol());
+ url.setHost(d->m_url.host());
url.setPath("/favicon.ico");
return url;
}
String url(iconURL().url());
if (url.isEmpty())
return;
-
+
IconDatabase* sharedIconDatabase = IconDatabase::sharedIconDatabase();
- if (sharedIconDatabase->hasEntryForIconURL(url) && !sharedIconDatabase->isIconExpiredForIconURL(url))
+ // 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)) {
+ commitIconURLToIconDatabase();
return;
+ }
if (!d->m_iconLoader)
d->m_iconLoader = IconLoader::createForFrame(this);
d->m_iconLoader->startLoading();
}
+void Frame::commitIconURLToIconDatabase()
+{
+ KURL icon = iconURL();
+
+ IconDatabase* iconDatabase = IconDatabase::sharedIconDatabase();
+ ASSERT(iconDatabase);
+ iconDatabase->setIconURLForPageURL(icon.url(), this->url().url());
+ iconDatabase->setIconURLForPageURL(icon.url(), originalRequestURL().url());
+}
+
void Frame::stop()
{
// http://bugzilla.opendarwin.org/show_bug.cgi?id=10854
KURL iconURL();
void setIconURL(const String& url, const String& type);
+ void commitIconURLToIconDatabase();
Page* page() const;
void pageDestroyed();
void reparseConfiguration();
private:
-
+ virtual KURL originalRequestURL() const = 0;
void childBegin();
void submitFormAgain();
bool FrameWin::canPaste() const { notImplemented(); return 0; }
bool FrameWin::canGoBackOrForward(int) const { notImplemented(); return 0; }
void FrameWin::issuePasteAndMatchStyleCommand() { notImplemented(); }
+KURL FrameWin::originalRequestURL() const { return KURL(); }
bool BrowserExtensionWin::canRunModal() { notImplemented(); return 0; }
void BrowserExtensionWin::createNewWindow(struct WebCore::ResourceRequest const&,struct WebCore::WindowArgs const&,Frame*&) { notImplemented(); }