Commit af9954f2 authored by brettw@chromium.org's avatar brettw@chromium.org

Reviewed by Timothy Hatcher.

Have ImageDocument generate its own filename for the title of images
without relying on the suggested filename from the network layer, which
may be nonexistant or not relevant.
https://bugs.webkit.org/show_bug.cgi?id=21565

* loader/ImageDocument.cpp:
  (WebCore::ImageTokenizer::finish):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37655 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6959ea0d
2008-10-15 Brett Wilson <brettw@chromium.org>
Reviewed by Timothy Hatcher.
Have ImageDocument generate its own filename for the title of images
without relying on the suggested filename from the network layer, which
may be nonexistant or not relevant.
https://bugs.webkit.org/show_bug.cgi?id=21565
* loader/ImageDocument.cpp:
(WebCore::ImageTokenizer::finish):
2008-10-17 Alexey Proskuryakov <ap@webkit.org>
Non-Mac build fix.
......
......@@ -120,8 +120,14 @@ void ImageTokenizer::finish()
cachedImage->setResponse(m_doc->frame()->loader()->documentLoader()->response());
IntSize size = cachedImage->imageSize(m_doc->frame()->pageZoomFactor());
if (size.width())
m_doc->setTitle(imageTitle(cachedImage->response().suggestedFilename(), size));
if (size.width()) {
// Compute the title, we use the filename of the resource, falling
// back on the hostname if there is no path.
String fileName = m_doc->url().lastPathComponent();
if (fileName.isEmpty())
fileName = m_doc->url().host();
m_doc->setTitle(imageTitle(fileName, size));
}
m_doc->imageChanged();
}
......
Markdown is supported
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