Changeset 21153 for S60/trunk/WebCore

Show
Ignore:
Timestamp:
04/27/07 12:58:34 (21 months ago)
Author:
zbujtas
Message:

2007-04-27 w3liu <wei.liu@nokia.com>

reviewed by Zalan <zbujtas@gmail.com>
DESC: handle codebase in HTMLImageLoader
http://bugs.webkit.org/show_bug.cgi?id=13491

WARNING: NO TEST CASES ADDED OR CHANGED

  • khtml/html/html_imageimpl.cpp: (HTMLImageLoader::updateFromElement):
Location:
S60/trunk/WebCore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • S60/trunk/WebCore/ChangeLog

    r21150 r21153  
     1w3liu   <wei.liu@nokia.com> 
     2reviewed by Zalan <zbujtas@gmail.com> 
     3 DESC: handle codebase in HTMLImageLoader 
     4 http://bugs.webkit.org/show_bug.cgi?id=13491 
     5 
     6        WARNING: NO TEST CASES ADDED OR CHANGED 
     7 
     8        * khtml/html/html_imageimpl.cpp: 
     9        (HTMLImageLoader::updateFromElement): 
     10 
    111rathnasa, reviewed by zbujtas 
    212 DESC: Widget Menu API 
  • S60/trunk/WebCore/khtml/html/html_imageimpl.cpp

    r17845 r21153  
    7575        return; 
    7676 
    77     AtomicString attr; 
     77    DOMString attr; 
    7878    if (element()->id() == ID_OBJECT) 
    79         attr = element()->getAttribute(ATTR_DATA); 
     79    { 
     80        attr = khtml::parseURL(element()->getAttribute(ATTR_DATA)); 
     81#if NOKIA_CHANGES 
     82        QString attrCodebase = element()->getAttribute(ATTR_CODEBASE).string(); 
     83        if ( attrCodebase.length() ) 
     84        { 
     85            KURL dataURL(attr.string()); 
     86            if (!dataURL.isValid() )    // if data attr only contains relative URL, check for code base part 
     87            { 
     88            if ( !attrCodebase.endsWith(QString("/")) ) 
     89                attrCodebase.append(QString("/")); 
     90            attr.insert(attrCodebase, 0); 
     91            } 
     92        } 
     93#endif 
     94    } 
    8095    else 
    81         attr = element()->getAttribute(ATTR_SRC); 
     96        attr = khtml::parseURL(element()->getAttribute(ATTR_SRC)); 
    8297     
    8398    // Treat a lack of src or empty string for src as no image at all. 
    8499    CachedImage* newImage = 0; 
    85100    if (!attr.isEmpty()) 
    86         newImage = element()->getDocument()->docLoader()->requestImage(khtml::parseURL(attr)); 
     101        newImage = element()->getDocument()->docLoader()->requestImage(attr); 
    87102 
    88103    if (newImage != m_image) {