Changeset 37655 in webkit


Ignore:
Timestamp:
Oct 17, 2008 8:56:24 AM (16 years ago)
Author:
brettw@chromium.org
Message:

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):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r37654 r37655  
     12008-10-15  Brett Wilson  <brettw@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Have ImageDocument generate its own filename for the title of images
     6        without relying on the suggested filename from the network layer, which
     7        may be nonexistant or not relevant.
     8        https://bugs.webkit.org/show_bug.cgi?id=21565
     9
     10        * loader/ImageDocument.cpp:
     11        (WebCore::ImageTokenizer::finish):
     12
    1132008-10-17  Alexey Proskuryakov  <ap@webkit.org>
    214
  • trunk/WebCore/loader/ImageDocument.cpp

    r36929 r37655  
    121121
    122122        IntSize size = cachedImage->imageSize(m_doc->frame()->pageZoomFactor());
    123         if (size.width())
    124             m_doc->setTitle(imageTitle(cachedImage->response().suggestedFilename(), size));
     123        if (size.width()) {
     124            // Compute the title, we use the filename of the resource, falling
     125            // back on the hostname if there is no path.
     126            String fileName = m_doc->url().lastPathComponent();
     127            if (fileName.isEmpty())
     128                fileName = m_doc->url().host();
     129            m_doc->setTitle(imageTitle(fileName, size));
     130        }
    125131
    126132        m_doc->imageChanged();
Note: See TracChangeset for help on using the changeset viewer.