On May 12, 2007, at 7:59 AM, Holger Freyther wrote:


Am 12.05.2007 um 13:28 schrieb Holger Freyther:


Am 12.05.2007 um 12:32 schrieb Maciej Stachowiak:


I can't check this in right now because the SVN server is temporarily out of disk, but this appears to mostly fix the Qt build, at least in QtLauncher. Rob Buis helped me test and is running layout tests now.


Okay,
the difference between Mac and Gdk is in FrameLoaderClient::canCachePage. If canCachePage returns false, clear() will be called which sets m_frame->d->m_doc->m_ptr to 0. And on load setEncoding comes after calling saveDocumentState. So there is no way to restore/has a valid document.

Oh - that was actually a bug and I believe I've landed a fix.


I don't know how to fix it, but at least this explains why it crashes on Gdk and not on Mac. I think we should review codepath's ending in a clear().

void FrameLoader::provisionalLoadStarted()
{
    m_firstLayoutDone = false;
    cancelRedirection(true);
    m_client->provisionalLoadStarted();

    if (canCachePage()) {
        if (m_client->canCachePage()) {
            if (!m_currentHistoryItem->cachedPage()) {
                cachePageToHistoryItem(m_currentHistoryItem.get());
                purgePageCache();
            }
        } else {
// Put the document into a null state, so it can be restored correctly.ยท
            clear();
        }
    }
}

The code now reads like this:

if (canCachePage() && m_client->canCachePage() && ! m_currentHistoryItem->cachedPage()) {
        cachePageToHistoryItem(m_currentHistoryItem.get());
        purgePageCache();
    }


_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to