Changeset 19322 in webkit


Ignore:
Timestamp:
Jan 31, 2007 7:51:00 PM (17 years ago)
Author:
andersca
Message:

LayoutTests:

Reviewed by Maciej.

<rdar://problem/4886776>
REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file

  • webarchive/loading/resources/helloworld.webarchive: Added.
  • webarchive/loading/test-loading-archive-expected.txt: Added.
  • webarchive/loading/test-loading-archive.html: Added.

WebCore:

Reviewed by Maciej.

<rdar://problem/4886776>
REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file

  • WebCore.exp:
  • loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadWithData):
  • loader/FrameLoader.h: New function which continues a load but using a given buffer instead.

WebKit:

Reviewed by Maciej.

<rdar://problem/4886776>
REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file


"Revert" the change done in 13734.


  • WebView/WebHTMLRepresentation.mm: (-[WebHTMLRepresentation loadArchive]): Don't do a new load here, as this would cancel the current load and call the resource load delegate's didFailLoadingWithError: method. Instead, call continueLoadWithData.
Location:
trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19313 r19322  
     12007-01-31  Anders Carlsson  <acarlsson@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        <rdar://problem/4886776>
     6        REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file
     7
     8        * webarchive/loading/resources/helloworld.webarchive: Added.
     9        * webarchive/loading/test-loading-archive-expected.txt: Added.
     10        * webarchive/loading/test-loading-archive.html: Added.
     11
    1122007-01-31  Adele Peterson  <adele@apple.com>
    213
  • trunk/WebCore/ChangeLog

    r19319 r19322  
     12007-01-31  Anders Carlsson  <acarlsson@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        <rdar://problem/4886776>
     6        REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file
     7
     8        * WebCore.exp:
     9        * loader/FrameLoader.cpp:
     10        (WebCore::FrameLoader::continueLoadWithData):
     11        * loader/FrameLoader.h:
     12        New function which continues a load but using a given buffer instead.
     13       
    1142007-01-31  Adele Peterson  <adele@apple.com>
    215
  • trunk/WebCore/WebCore.exp

    r19237 r19322  
    139139__ZN7WebCore11FrameLoader16detachFromParentEv
    140140__ZN7WebCore11FrameLoader18currentHistoryItemEv
     141__ZN7WebCore11FrameLoader20continueLoadWithDataEPNS_12SharedBufferERKNS_6StringES5_RKNS_4KURLE
    141142__ZN7WebCore11FrameLoader21addPlugInStreamLoaderEPNS_14ResourceLoaderE
    142143__ZN7WebCore11FrameLoader21setCurrentHistoryItemEN3WTF10PassRefPtrINS_11HistoryItemEEE
  • trunk/WebCore/loader/FrameLoader.cpp

    r19289 r19322  
    42794279}
    42804280
     4281void FrameLoader::continueLoadWithData(SharedBuffer* buffer, const String& mimeType, const String& textEncoding, const KURL& url)
     4282{
     4283    m_responseMIMEType = mimeType;
     4284    didOpenURL(url);
     4285
     4286    String encoding;
     4287    if (m_frame)
     4288        encoding = documentLoader()->overrideEncoding();
     4289    bool userChosen = !encoding.isNull();
     4290    if (encoding.isNull())
     4291        encoding = textEncoding;
     4292    setEncoding(encoding, userChosen);
     4293
     4294    if (!m_frame->document())
     4295        return;
     4296
     4297    addData(buffer->data(), buffer->size());
     4298}
     4299
    42814300} // namespace WebCore
  • trunk/WebCore/loader/FrameLoader.h

    r19218 r19322  
    421421        void setProvisionalHistoryItem(PassRefPtr<HistoryItem>);
    422422       
     423        void continueLoadWithData(SharedBuffer*, const String& mimeType, const String& textEncoding, const KURL&);
    423424    private:       
    424425        PassRefPtr<HistoryItem> createHistoryItem(bool useOriginal);
  • trunk/WebKit/ChangeLog

    r19318 r19322  
     12007-01-31  Anders Carlsson  <acarlsson@apple.com>
     2
     3        Reviewed by Maciej.
     4
     5        <rdar://problem/4886776>
     6        REGRESSION: After opening a web archive, location shows the actual URL, not the webarchive file
     7       
     8        "Revert" the change done in 13734.
     9       
     10        * WebView/WebHTMLRepresentation.mm:
     11        (-[WebHTMLRepresentation loadArchive]):
     12        Don't do a new load here, as this would cancel the current load and call the resource load
     13        delegate's didFailLoadingWithError: method. Instead, call continueLoadWithData.
     14
    1152007-02-01  Nikolas Zimmermann  <zimmermann@kde.org>
    216
  • trunk/WebKit/WebView/WebHTMLRepresentation.mm

    r18764 r19322  
    4747#import <WebCore/Document.h>
    4848#import <WebCore/DocumentLoader.h>
     49#import <WebCore/FrameLoader.h>
    4950#import <WebCore/FrameMac.h>
    5051#import <WebCore/MimeTypeRegistry.h>
     
    190191}
    191192
    192 - (void)loadArchive
     193- (void)_loadDataSourceAsWebArchive
    193194{
    194195    WebArchive *archive = [[WebArchive alloc] initWithData:[_private->dataSource data]];
    195     [[_private->dataSource webFrame] loadArchive:archive];
     196    WebResource *mainResource = [archive mainResource];
     197    if (!mainResource) {
     198        [archive release];
     199        return;
     200    }
     201   
     202    NSData *data = [mainResource data];
     203    [data retain];
     204    [_private->parsedArchiveData release];
     205    _private->parsedArchiveData = data;
     206   
     207    [_private->dataSource _addToUnarchiveState:archive];
     208    [archive release];
     209   
     210    WebFrame *webFrame = [_private->dataSource webFrame];
     211   
     212    if (!webFrame)
     213        return;
     214   
     215    core(webFrame)->loader()->continueLoadWithData(SharedBuffer::wrapNSData(data).get(), [mainResource MIMEType], [mainResource textEncodingName], [mainResource URL]);
    196216}
    197217
     
    207227    if (frame) {
    208228        if ([self _isDisplayingWebArchive])
    209             [self loadArchive];
     229            [self _loadDataSourceAsWebArchive];
    210230        else
    211231            // Telling the bridge we received some data and passing nil as the data is our
     
    232252- (NSString *)documentSource
    233253{
     254    if ([self _isDisplayingWebArchive])
     255        return [[[NSString alloc] initWithData:_private->parsedArchiveData encoding:NSUTF8StringEncoding] autorelease];
     256
    234257    return [_private->bridge stringWithData:[_private->dataSource data]];
    235258}
Note: See TracChangeset for help on using the changeset viewer.