OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 m_shouldCallCheckCompleted = false; | 561 m_shouldCallCheckCompleted = false; |
562 m_shouldCallCheckLoadComplete = false; | 562 m_shouldCallCheckLoadComplete = false; |
563 | 563 |
564 if (m_stateMachine.isDisplayingInitialEmptyDocument() && m_stateMachine.comm
ittedFirstRealDocumentLoad()) | 564 if (m_stateMachine.isDisplayingInitialEmptyDocument() && m_stateMachine.comm
ittedFirstRealDocumentLoad()) |
565 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad
); | 565 m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad
); |
566 } | 566 } |
567 | 567 |
568 void FrameLoader::receivedFirstData() | 568 void FrameLoader::receivedFirstData() |
569 { | 569 { |
570 KURL workingURL = activeDocumentLoader()->documentURL(); | 570 KURL workingURL = activeDocumentLoader()->documentURL(); |
571 #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML) | 571 #if ENABLE(WEB_ARCHIVE) |
572 // FIXME: The document loader, not the frame loader, should be in charge of
loading web archives. | 572 // FIXME: The document loader, not the frame loader, should be in charge of
loading web archives. |
573 // Once this is done, we can just make DocumentLoader::documentURL() return
the right URL | 573 // Once this is done, we can just make DocumentLoader::documentURL() return
the right URL |
574 // based on whether it has a non-null archive or not. | 574 // based on whether it has a non-null archive or not. |
575 if (m_archive && activeDocumentLoader()->parsedArchiveData()) | 575 if (m_archive && activeDocumentLoader()->parsedArchiveData()) |
576 workingURL = m_archive->mainResource()->url(); | 576 workingURL = m_archive->mainResource()->url(); |
577 #endif | 577 #endif |
578 | 578 |
579 activeDocumentLoader()->writer()->begin(workingURL, false); | 579 activeDocumentLoader()->writer()->begin(workingURL, false); |
580 activeDocumentLoader()->writer()->setDocumentWasLoadedAsPartOfNavigation(); | 580 activeDocumentLoader()->writer()->setDocumentWasLoadedAsPartOfNavigation(); |
581 | 581 |
582 dispatchDidCommitLoad(); | 582 dispatchDidCommitLoad(); |
583 dispatchDidClearWindowObjectsInAllWorlds(); | 583 dispatchDidClearWindowObjectsInAllWorlds(); |
584 | 584 |
| 585 #if ENABLE(MHTML) |
| 586 if (m_archive) { |
| 587 // The origin is the MHTML file, we need to set the base URL to the docu
ment encoded in the MHTML so |
| 588 // relative URLs are resolved properly. |
| 589 m_frame->document()->setBaseURLOverride(m_archive->mainResource()->url()
); |
| 590 } |
| 591 #endif |
| 592 |
585 if (m_documentLoader) { | 593 if (m_documentLoader) { |
586 StringWithDirection ptitle = m_documentLoader->title(); | 594 StringWithDirection ptitle = m_documentLoader->title(); |
587 // If we have a title let the WebView know about it. | 595 // If we have a title let the WebView know about it. |
588 if (!ptitle.isNull()) | 596 if (!ptitle.isNull()) |
589 m_client->dispatchDidReceiveTitle(ptitle); | 597 m_client->dispatchDidReceiveTitle(ptitle); |
590 } | 598 } |
591 | 599 |
592 m_hasReceivedFirstData = true; | 600 m_hasReceivedFirstData = true; |
593 | 601 |
594 if (!m_documentLoader) | 602 if (!m_documentLoader) |
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3312 windowRect.setHeight(features.height + (windowRect.height() - pageSize.h
eight())); | 3320 windowRect.setHeight(features.height + (windowRect.height() - pageSize.h
eight())); |
3313 page->chrome()->setWindowRect(windowRect); | 3321 page->chrome()->setWindowRect(windowRect); |
3314 | 3322 |
3315 page->chrome()->show(); | 3323 page->chrome()->show(); |
3316 | 3324 |
3317 created = true; | 3325 created = true; |
3318 return frame; | 3326 return frame; |
3319 } | 3327 } |
3320 | 3328 |
3321 } // namespace WebCore | 3329 } // namespace WebCore |
OLD | NEW |