Changeset 212173 in webkit


Ignore:
Timestamp:
Feb 10, 2017 6:53:53 PM (7 years ago)
Author:
dbates@webkit.org
Message:

Detach frame from document when entering page cache
https://bugs.webkit.org/show_bug.cgi?id=166774
<rdar://problem/29904368>

Reviewed by Chris Dumez.

Source/WebCore:

When a page enters the page cache it is unnecessary for it to hold a reference to its
associated frame because subsequent interactions with the page do not need to make use
of it. Once a page exits the page cache we associate it with its frame.

  • dom/Document.cpp:

(WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
(WebCore::Document::attachToCachedFrame): Added.
(WebCore::Document::detachFromCachedFrame): Added.
(WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
the former.
(WebCore::Document::hasEverCalledWindowOpen): Deleted.
(WebCore::Document::markHasCalledWindowOpen): Deleted.
(WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.

  • dom/Document.h:

(WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
visibility from public to private and made this function inline.

  • history/CachedFrame.cpp:

(WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
removed from the page when it was in the page cache as there is no need to restore such frames.
(WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
frame tree.
(WebCore::CachedFrame::CachedFrame): Detach from the frame.
(WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
(WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
detach the animation controller from the document as it is being destroyed. We have to do this here
because the document does not have a frame. And Document::prepareForDestruction() only calls
CSSAnimationController::detachFromDocument() if the document has a frame.

  • history/CachedFrame.h:
  • history/PageCache.cpp:

(WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
or has an opener as it is feasible to keep such pages in the page cache.

  • html/HTMLFrameElementBase.cpp:

(WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
page is not in- or about to enter- the page cache. A page in the page cache has finished loading
and its active DOM objects are suspended. Also fix style nit in comment.
(WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
function will be removed.

  • page/DiagnosticLoggingKeys.cpp:

(WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
(WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.

  • page/DiagnosticLoggingKeys.h:
  • page/Page.cpp:

(WebCore::Page::openedByWindowOpen): Deleted.

  • page/Page.h:
  • page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.

Source/WebKit/mac:

  • WebView/WebPreferenceKeysPrivate.h:
  • WebView/WebPreferences.mm:

(+[WebPreferences initialize]):
(-[WebPreferences allowsPageCacheWithWindowOpener]): Deleted.
(-[WebPreferences setAllowsPageCacheWithWindowOpener:]): Deleted.

  • WebView/WebPreferencesPrivate.h:
  • WebView/WebView.mm:

(-[WebView _preferencesChanged:]):

Source/WebKit/win:

  • Interfaces/IWebPreferencesPrivate.idl:
  • WebPreferenceKeysPrivate.h:
  • WebPreferences.cpp:

(WebPreferences::initializeDefaultSettings):
(WebPreferences::setAllowsPageCacheWithWindowOpener): Deleted.
(WebPreferences::allowsPageCacheWithWindowOpener): Deleted.

  • WebPreferences.h:
  • WebView.cpp:

(WebView::notifyPreferencesChanged):

Source/WebKit2:

  • Shared/WebPreferencesDefinitions.h:
  • UIProcess/API/C/WKPreferences.cpp:

(WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
(WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.

  • UIProcess/API/C/WKPreferencesRefPrivate.h:
  • WebProcess/InjectedBundle/InjectedBundle.cpp:

(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Tools:

  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetWebPreferencesToConsistentValues):

  • DumpRenderTree/win/DumpRenderTree.cpp:

(resetWebPreferencesToConsistentValues):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):

Location:
trunk
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/editing/mac/input/unconfirmed-text-navigation-with-page-cache.html

    r211254 r212173  
    1111    testRunner.setCanOpenWindows();
    1212    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
    13     testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    1413}
    1514
  • trunk/LayoutTests/fast/harness/page-cache-crash-on-data-urls.html

    r211254 r212173  
    2323        testRunner.setCanOpenWindows();
    2424        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
    25         testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    2625    }
    2726    log("open page with data urls");
  • trunk/LayoutTests/fast/harness/use-page-cache.html

    r211254 r212173  
    2929        testRunner.setCanOpenWindows();
    3030        testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
    31         testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    3231    }
    3332    log("open page-1");
  • trunk/LayoutTests/fast/loader/stateobjects/no-popstate-when-back-to-stateless-entry-with-page-cache.html

    r211254 r212173  
    1515        testRunner.setCanOpenWindows();
    1616        testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
    17         testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    1817    }
    1918    testWindow = window.open('resources/no-popstate-when-back-to-stateless-entry-1.html');
  • trunk/LayoutTests/fast/loader/stateobjects/popstate-fires-with-page-cache.html

    r211254 r212173  
    1515        testRunner.setCanOpenWindows();
    1616        testRunner.overridePreference('WebKitUsesPageCachePreferenceKey', 1);
    17         testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    1817    }
    1918    testWindow = window.open('resources/popstate-fires-with-page-cache-1.html');
  • trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html

    r211254 r212173  
    88            testRunner.setCanOpenWindows();
    99            testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
    10             testRunner.overridePreference("WebKitAllowsPageCacheWithWindowOpenerKey", 1);
    1110        }
    1211
  • trunk/Source/WebCore/ChangeLog

    r212172 r212173  
     12017-02-10  Daniel Bates  <dabates@apple.com>
     2
     3        Detach frame from document when entering page cache
     4        https://bugs.webkit.org/show_bug.cgi?id=166774
     5        <rdar://problem/29904368>
     6
     7        Reviewed by Chris Dumez.
     8
     9        When a page enters the page cache it is unnecessary for it to hold a reference to its
     10        associated frame because subsequent interactions with the page do not need to make use
     11        of it. Once a page exits the page cache we associate it with its frame.
     12
     13        * dom/Document.cpp:
     14        (WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
     15        (WebCore::Document::attachToCachedFrame): Added.
     16        (WebCore::Document::detachFromCachedFrame): Added.
     17        (WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
     18        we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
     19        the former.
     20        (WebCore::Document::hasEverCalledWindowOpen): Deleted.
     21        (WebCore::Document::markHasCalledWindowOpen): Deleted.
     22        (WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
     23        * dom/Document.h:
     24        (WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
     25        visibility from public to private and made this function inline.
     26        * history/CachedFrame.cpp:
     27        (WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
     28        removed from the page when it was in the page cache as there is no need to restore such frames.
     29        (WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
     30        frame tree.
     31        (WebCore::CachedFrame::CachedFrame): Detach from the frame.
     32        (WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
     33        (WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
     34        frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
     35        subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
     36        detach the animation controller from the document as it is being destroyed. We have to do this here
     37        because the document does not have a frame. And Document::prepareForDestruction() only calls
     38        CSSAnimationController::detachFromDocument() if the document has a frame.
     39        * history/CachedFrame.h:
     40        * history/PageCache.cpp:
     41        (WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
     42        or has an opener as it is feasible to keep such pages in the page cache.
     43        * html/HTMLFrameElementBase.cpp:
     44        (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
     45        * loader/FrameLoader.cpp:
     46        (WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
     47        page is not in- or about to enter- the page cache. A page in the page cache has finished loading
     48        and its active DOM objects are suspended. Also fix style nit in comment.
     49        (WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
     50        enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
     51        that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
     52        * page/DOMWindow.cpp:
     53        (WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
     54        function will be removed.
     55        * page/DiagnosticLoggingKeys.cpp:
     56        (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
     57        (WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
     58        * page/DiagnosticLoggingKeys.h:
     59        * page/Page.cpp:
     60        (WebCore::Page::openedByWindowOpen): Deleted.
     61        * page/Page.h:
     62        * page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
     63
    1642017-02-10  Simon Fraser  <simon.fraser@apple.com>
    265
  • trunk/Source/WebCore/dom/Document.cpp

    r211966 r212173  
    3737#include "CSSStyleSheet.h"
    3838#include "CachedCSSStyleSheet.h"
     39#include "CachedFrame.h"
    3940#include "CachedResourceLoader.h"
    4041#include "Chrome.h"
     
    837838}
    838839
    839 bool Document::hasEverCalledWindowOpen() const
    840 {
    841     auto& topDocument = this->topDocument();
    842     if (&topDocument == this)
    843         return m_hasEverCalledWindowOpen;
    844     return topDocument.hasEverCalledWindowOpen();
    845 }
    846 
    847 void Document::markHasCalledWindowOpen()
    848 {
    849     auto& topDocument = this->topDocument();
    850     if (&topDocument == this)
    851         m_hasEverCalledWindowOpen = true;
    852     else
    853         topDocument.markHasCalledWindowOpen();
    854 }
    855 
    856840DocumentType* Document::doctype() const
    857841{
     
    21912175}
    21922176
    2193 void Document::disconnectFromFrame()
    2194 {
    2195     observeFrame(nullptr);
    2196 }
    2197 
    21982177void Document::frameDestroyed()
    21992178{
    2200     // disconnectFromFrame() must be called before destroying the Frame.
     2179    // detachFromFrame() must be called before destroying the Frame.
    22012180    ASSERT_WITH_SECURITY_IMPLICATION(!m_frame);
    22022181    FrameDestructionObserver::frameDestroyed();
     2182}
     2183
     2184void Document::attachToCachedFrame(CachedFrameBase& cachedFrame)
     2185{
     2186    ASSERT_WITH_SECURITY_IMPLICATION(cachedFrame.document() == this);
     2187    ASSERT(cachedFrame.view());
     2188    ASSERT(m_pageCacheState == Document::InPageCache);
     2189    observeFrame(&cachedFrame.view()->frame());
     2190}
     2191
     2192void Document::detachFromCachedFrame(CachedFrameBase& cachedFrame)
     2193{
     2194    ASSERT_WITH_SECURITY_IMPLICATION(cachedFrame.document() == this);
     2195    ASSERT(cachedFrame.view());
     2196    ASSERT(m_frame == &cachedFrame.view()->frame());
     2197    ASSERT(m_pageCacheState == Document::InPageCache);
     2198    detachFromFrame();
    22032199}
    22042200
     
    22602256        return;
    22612257
    2262     m_frame->animation().detachFromDocument(this);
     2258    if (m_frame)
     2259        m_frame->animation().detachFromDocument(this);
    22632260
    22642261#if ENABLE(IOS_TOUCH_EVENTS)
     
    23252322#endif
    23262323
    2327     disconnectFromFrame();
     2324    detachFromFrame();
    23282325
    23292326    m_hasPreparedForDestruction = true;
  • trunk/Source/WebCore/dom/Document.h

    r211979 r212173  
    7979class CSSStyleSheet;
    8080class CachedCSSStyleSheet;
     81class CachedFrameBase;
    8182class CachedResourceLoader;
    8283class CachedScript;
     
    368369
    369370    bool hasManifest() const;
    370 
    371     bool hasEverCalledWindowOpen() const;
    372     void markHasCalledWindowOpen();
    373371   
    374372    WEBCORE_EXPORT ExceptionOr<Ref<Element>> createElementForBindings(const AtomicString& tagName);
     
    558556    void didBecomeCurrentDocumentInFrame();
    559557    void destroyRenderTree();
    560     void disconnectFromFrame();
    561558    void prepareForDestruction();
    562559
     
    12871284    const HashSet<ShadowRoot*>& inDocumentShadowRoots() const { return m_inDocumentShadowRoots; }
    12881285
     1286    void attachToCachedFrame(CachedFrameBase&);
     1287    void detachFromCachedFrame(CachedFrameBase&);
     1288
    12891289protected:
    12901290    enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 };
     
    12991299    friend class IgnoreDestructiveWriteCountIncrementer;
    13001300    friend class IgnoreOpensDuringUnloadCountIncrementer;
     1301
     1302    void detachFromFrame() { observeFrame(nullptr); }
    13011303
    13021304    void updateTitleElement(Element* newTitleElement);
     
    14761478
    14771479    Timer m_styleRecalcTimer;
    1478     bool m_hasEverCalledWindowOpen { false };
    14791480    bool m_pendingStyleRecalcShouldForce;
    14801481    bool m_inStyleRecalc;
  • trunk/Source/WebCore/history/CachedFrame.cpp

    r211885 r212173  
    7676}
    7777
     78void CachedFrameBase::pruneDetachedChildFrames()
     79{
     80    for (size_t i = m_childFrames.size(); i;) {
     81        --i;
     82        if (m_childFrames[i]->view()->frame().page())
     83            continue;
     84        m_childFrames[i]->destroy();
     85        m_childFrames.remove(i);
     86    }
     87}
     88
    7889void CachedFrameBase::restore()
    7990{
     
    99110    frame.loader().client().didRestoreFromPageCache();
    100111
     112    pruneDetachedChildFrames();
     113
    101114    // Reconstruct the FrameTree. And open the child CachedFrames in their respective FrameLoaders.
    102115    for (auto& childFrame : m_childFrames) {
     116        ASSERT(childFrame->view()->frame().page());
    103117        frame.tree().appendChild(childFrame->view()->frame());
    104118        childFrame->open();
     
    184198#endif
    185199
     200    m_document->detachFromCachedFrame(*this);
     201
    186202    ASSERT_WITH_SECURITY_IMPLICATION(!m_documentLoader->isLoading());
    187203}
     
    190206{
    191207    ASSERT(m_view);
     208    ASSERT(m_document);
    192209    if (!m_isMainFrame)
    193210        m_view->frame().page()->incrementSubframeCount();
     211
     212    m_document->attachToCachedFrame(*this);
    194213
    195214    m_view->frame().loader().open(*this);
     
    228247    ASSERT(m_document->pageCacheState() == Document::InPageCache);
    229248    ASSERT(m_view);
    230     ASSERT(m_document->frame() == &m_view->frame());
     249    ASSERT(!m_document->frame());
    231250
    232251    m_document->domWindow()->willDestroyCachedFrame();
    233252
    234     if (!m_isMainFrame) {
     253    if (!m_isMainFrame && m_view->frame().page()) {
    235254        m_view->frame().loader().detachViewsAndDocumentLoader();
    236255        m_view->frame().detachFromPage();
     
    244263
    245264    Frame::clearTimers(m_view.get(), m_document.get());
     265
     266    m_view->frame().animation().detachFromDocument(m_document.get());
    246267
    247268    // FIXME: Why do we need to call removeAllEventListeners here? When the document is in page cache, this method won't work
  • trunk/Source/WebCore/history/CachedFrame.h

    r210142 r212173  
    5353    CachedFrameBase(Frame&);
    5454    ~CachedFrameBase();
    55    
     55
     56    void pruneDetachedChildFrames();
     57
    5658    RefPtr<Document> m_document;
    5759    RefPtr<DocumentLoader> m_documentLoader;
  • trunk/Source/WebCore/history/PageCache.cpp

    r211676 r212173  
    192192    DiagnosticLoggingClient& diagnosticLoggingClient = page.diagnosticLoggingClient();
    193193    bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
    194 
    195     if (page.openedByWindowOpen() && !page.settings().allowsPageCacheWithWindowOpener()) {
    196         PCLOG("   -Page has been opened via window.open()");
    197         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasOpenerKey());
    198         isCacheable = false;
    199     }
    200 
    201     auto* topDocument = page.mainFrame().document();
    202     if (topDocument && topDocument->hasEverCalledWindowOpen()) {
    203         PCLOG("   -Page has called window.open()");
    204         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::hasCalledWindowOpenKey());
    205         isCacheable = false;
    206     }
    207194   
    208195    if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
  • trunk/Source/WebCore/html/HTMLFrameElementBase.cpp

    r211964 r212173  
    146146        return;
    147147
    148     // DocumentFragments don't kick of any loads.
     148    // DocumentFragments don't kick off any loads.
    149149    if (!document().frame())
    150150        return;
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r211946 r212173  
    24972497void FrameLoader::frameDetached()
    24982498{
    2499     // Calling stopAllLoaders can cause the frame to be deallocated, including the frame loader.
     2499    // Calling stopAllLoaders() can cause the frame to be deallocated, including the frame loader.
    25002500    Ref<Frame> protectedFrame(m_frame);
    25012501
    2502     stopAllLoaders();
    2503     m_frame.document()->stopActiveDOMObjects();
     2502    if (m_frame.document()->pageCacheState() != Document::InPageCache) {
     2503        stopAllLoaders();
     2504        m_frame.document()->stopActiveDOMObjects();
     2505    }
     2506
    25042507    detachFromParent();
    25052508}
     
    25072510void FrameLoader::detachFromParent()
    25082511{
     2512    // Calling stopAllLoaders() can cause the frame to be deallocated, including the frame loader.
    25092513    Ref<Frame> protect(m_frame);
    25102514
     
    25122516    history().saveScrollPositionAndViewStateToItem(history().currentItem());
    25132517    detachChildren();
    2514     // stopAllLoaders() needs to be called after detachChildren(), because detachedChildren()
    2515     // will trigger the unload event handlers of any child frames, and those event
    2516     // handlers might start a new subresource load in this frame.
    2517     stopAllLoaders();
     2518    if (m_frame.document()->pageCacheState() != Document::InPageCache) {
     2519        // stopAllLoaders() needs to be called after detachChildren() if the document is not in the page cache,
     2520        // because detachedChildren() will trigger the unload event handlers of any child frames, and those event
     2521        // handlers might start a new subresource load in this frame.
     2522        stopAllLoaders();
     2523    }
    25182524
    25192525    InspectorInstrumentation::frameDetachedFromParent(m_frame);
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r211889 r212173  
    21872187    newFrame->loader().setOpener(&openerFrame);
    21882188    newFrame->page()->setOpenedByDOM();
    2189     if (auto* openerDocument = openerFrame.document())
    2190         openerDocument->markHasCalledWindowOpen();
    21912189
    21922190    if (newFrame->document()->domWindow()->isInsecureScriptAccess(activeWindow, completedURL))
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp

    r211870 r212173  
    649649}
    650650
    651 String DiagnosticLoggingKeys::hasCalledWindowOpenKey()
    652 {
    653     return ASCIILiteral("hasCalledWindowOpen");
    654 }
    655 
    656 String DiagnosticLoggingKeys::hasOpenerKey()
    657 {
    658     return ASCIILiteral("hasOpener");
    659 }
    660 
    661651String DiagnosticLoggingKeys::prunedDueToMemoryPressureKey()
    662652{
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.h

    r211870 r212173  
    5757    static String expiredKey();
    5858    static String fontKey();
    59     static String hasCalledWindowOpenKey();
    60     static String hasOpenerKey();
    6159    static String hasPluginsKey();
    6260    static String httpsNoStoreKey();
  • trunk/Source/WebCore/page/Page.cpp

    r211910 r212173  
    470470}
    471471
    472 bool Page::openedByWindowOpen() const
    473 {
    474     auto* document = m_mainFrame->document();
    475     if (!document)
    476         return false;
    477     auto* window = document->domWindow();
    478     if (!window)
    479         return false;
    480     return window->opener();
    481 }
    482 
    483472void Page::goToItem(HistoryItem& item, FrameLoadType type)
    484473{
  • trunk/Source/WebCore/page/Page.h

    r211910 r212173  
    180180    void setOpenedByDOM();
    181181
    182     bool openedByWindowOpen() const;
    183 
    184182    WEBCORE_EXPORT void goToItem(HistoryItem&, FrameLoadType);
    185183
  • trunk/Source/WebCore/page/Settings.in

    r211949 r212173  
    288288
    289289langAttributeAwareFormControlUIEnabled initial=false
    290 
    291 allowsPageCacheWithWindowOpener initial=false
  • trunk/Source/WebKit/mac/ChangeLog

    r212150 r212173  
     12017-02-10  Daniel Bates  <dabates@apple.com>
     2
     3        Detach frame from document when entering page cache
     4        https://bugs.webkit.org/show_bug.cgi?id=166774
     5        <rdar://problem/29904368>
     6
     7        Reviewed by Chris Dumez.
     8
     9        * WebView/WebPreferenceKeysPrivate.h:
     10        * WebView/WebPreferences.mm:
     11        (+[WebPreferences initialize]):
     12        (-[WebPreferences allowsPageCacheWithWindowOpener]): Deleted.
     13        (-[WebPreferences setAllowsPageCacheWithWindowOpener:]): Deleted.
     14        * WebView/WebPreferencesPrivate.h:
     15        * WebView/WebView.mm:
     16        (-[WebView _preferencesChanged:]):
     17
    1182017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r212150 r212173  
    8484#define WebKitDOMPasteAllowedPreferenceKey @"WebKitDOMPasteAllowedPreferenceKey"
    8585#define WebKitUsesPageCachePreferenceKey @"WebKitUsesPageCachePreferenceKey"
    86 #define WebKitAllowsPageCacheWithWindowOpenerKey @"WebKitAllowsPageCacheWithWindowOpenerKey"
    8786#define WebKitPageCacheSupportsPluginsPreferenceKey @"WebKitPageCacheSupportsPluginsPreferenceKey"
    8887#define WebKitFTPDirectoryTemplatePath @"WebKitFTPDirectoryTemplatePath"
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r212150 r212173  
    479479#endif
    480480        [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
    481         [NSNumber numberWithBool:NO],   WebKitAllowsPageCacheWithWindowOpenerKey,
    482481        [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
    483482        [NSNumber numberWithBool:YES],  WebKitPageCacheSupportsPluginsPreferenceKey,
     
    24492448}
    24502449
    2451 - (BOOL)allowsPageCacheWithWindowOpener
    2452 {
    2453     return [self _boolValueForKey:WebKitAllowsPageCacheWithWindowOpenerKey];
    2454 }
    2455 
    2456 - (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag
    2457 {
    2458     [self _setBoolValue:flag forKey:WebKitAllowsPageCacheWithWindowOpenerKey];
    2459 }
    2460 
    24612450#if PLATFORM(IOS)
    24622451- (void)_invalidateCachedPreferences
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r212150 r212173  
    299299- (void)setPictographFontFamily:(NSString *)family;
    300300
    301 - (BOOL)allowsPageCacheWithWindowOpener;
    302 - (void)setAllowsPageCacheWithWindowOpener:(BOOL)flag;
    303 
    304301- (BOOL)pageCacheSupportsPlugins;
    305302- (void)setPageCacheSupportsPlugins:(BOOL)flag;
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r212150 r212173  
    26722672    settings.setDOMPasteAllowed([preferences isDOMPasteAllowed]);
    26732673    settings.setUsesPageCache([self usesPageCache]);
    2674     settings.setAllowsPageCacheWithWindowOpener([preferences allowsPageCacheWithWindowOpener]);
    26752674    settings.setPageCacheSupportsPlugins([preferences pageCacheSupportsPlugins]);
    26762675    settings.setBackForwardCacheExpirationInterval([preferences _backForwardCacheExpirationInterval]);
  • trunk/Source/WebKit/win/ChangeLog

    r212150 r212173  
     12017-02-10  Daniel Bates  <dabates@apple.com>
     2
     3        Detach frame from document when entering page cache
     4        https://bugs.webkit.org/show_bug.cgi?id=166774
     5        <rdar://problem/29904368>
     6
     7        Reviewed by Chris Dumez.
     8
     9        * Interfaces/IWebPreferencesPrivate.idl:
     10        * WebPreferenceKeysPrivate.h:
     11        * WebPreferences.cpp:
     12        (WebPreferences::initializeDefaultSettings):
     13        (WebPreferences::setAllowsPageCacheWithWindowOpener): Deleted.
     14        (WebPreferences::allowsPageCacheWithWindowOpener): Deleted.
     15        * WebPreferences.h:
     16        * WebView.cpp:
     17        (WebView::notifyPreferencesChanged):
     18
    1192017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
    220
  • trunk/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl

    r212150 r212173  
    9292    HRESULT setExperimentalNotificationsEnabled([in] BOOL enabled);
    9393
    94     HRESULT allowsPageCacheWithWindowOpener([out, retval] BOOL* usesPageCache);
    95     HRESULT setAllowsPageCacheWithWindowOpener([in] BOOL usesPageCache);
    96 
    9794    HRESULT setShouldUseHighResolutionTimers([in] BOOL useHighResolutionTimers);
    9895    HRESULT shouldUseHighResolutionTimers([out, retval] BOOL* useHighResolutionTimers);
  • trunk/Source/WebKit/win/WebPreferenceKeysPrivate.h

    r212150 r212173  
    6969#define WebKitIconDatabaseEnabledPreferenceKey "WebKitIconDatabaseEnabled"
    7070#define WebKitUsesPageCachePreferenceKey "WebKitUsesPageCachePreferenceKey"
    71 #define WebKitAllowsPageCacheWithWindowOpenerKey "WebKitAllowsPageCacheWithWindowOpenerKey"
    7271#define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey"
    7372#define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath"
  • trunk/Source/WebKit/win/WebPreferences.cpp

    r212150 r212173  
    263263    CFDictionaryAddValue(defaults, CFSTR(AllowContinuousSpellCheckingPreferenceKey), kCFBooleanTrue);
    264264    CFDictionaryAddValue(defaults, CFSTR(WebKitUsesPageCachePreferenceKey), kCFBooleanTrue);
    265     CFDictionaryAddValue(defaults, CFSTR(WebKitAllowsPageCacheWithWindowOpenerKey), kCFBooleanFalse);
    266265    CFDictionaryAddValue(defaults, CFSTR(WebKitLocalStorageDatabasePathPreferenceKey), CFSTR(""));
    267266
     
    16141613}
    16151614
    1616 HRESULT WebPreferences::setAllowsPageCacheWithWindowOpener(BOOL value)
    1617 {
    1618     setBoolValue(WebKitAllowsPageCacheWithWindowOpenerKey, value);
    1619     return S_OK;
    1620 }
    1621 
    1622 HRESULT WebPreferences::allowsPageCacheWithWindowOpener(_Out_ BOOL* enabled)
    1623 {
    1624     if (!enabled)
    1625         return E_POINTER;
    1626     *enabled = boolValueForKey(WebKitAllowsPageCacheWithWindowOpenerKey);
    1627     return S_OK;
    1628 }
    1629 
    16301615HRESULT WebPreferences::setZoomsTextOnly(BOOL zoomsTextOnly)
    16311616{
  • trunk/Source/WebKit/win/WebPreferences.h

    r212150 r212173  
    160160    virtual HRESULT STDMETHODCALLTYPE experimentalNotificationsEnabled(_Out_ BOOL*);
    161161    virtual HRESULT STDMETHODCALLTYPE setExperimentalNotificationsEnabled(BOOL);
    162     virtual HRESULT STDMETHODCALLTYPE allowsPageCacheWithWindowOpener(_Out_ BOOL*);
    163     virtual HRESULT STDMETHODCALLTYPE setAllowsPageCacheWithWindowOpener(BOOL);
    164162
    165163    // These two methods are no-ops, and only retained to keep
  • trunk/Source/WebKit/win/WebView.cpp

    r212150 r212173  
    54155415    settings.setExperimentalNotificationsEnabled(enabled);
    54165416
    5417     hr = prefsPrivate->allowsPageCacheWithWindowOpener(&enabled);
    5418     if (FAILED(hr))
    5419         return hr;
    5420     settings.setAllowsPageCacheWithWindowOpener(enabled);
    5421 
    54225417    hr = prefsPrivate->isWebSecurityEnabled(&enabled);
    54235418    if (FAILED(hr))
  • trunk/Source/WebKit2/ChangeLog

    r212169 r212173  
     12017-02-10  Daniel Bates  <dabates@apple.com>
     2
     3        Detach frame from document when entering page cache
     4        https://bugs.webkit.org/show_bug.cgi?id=166774
     5        <rdar://problem/29904368>
     6
     7        Reviewed by Chris Dumez.
     8
     9        * Shared/WebPreferencesDefinitions.h:
     10        * UIProcess/API/C/WKPreferences.cpp:
     11        (WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
     12        (WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.
     13        * UIProcess/API/C/WKPreferencesRefPrivate.h:
     14        * WebProcess/InjectedBundle/InjectedBundle.cpp:
     15        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
     16        * WebProcess/WebPage/WebPage.cpp:
     17        (WebKit::WebPage::updatePreferences):
     18
    1192017-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h

    r212150 r212173  
    138138    macro(LocalFileContentSniffingEnabled, localFileContentSniffingEnabled, Bool, bool, false, "", "") \
    139139    macro(UsesPageCache, usesPageCache, Bool, bool, true, "", "") \
    140     macro(AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener, Bool, bool, false, "", "") \
    141140    macro(PageCacheSupportsPlugins, pageCacheSupportsPlugins, Bool, bool, true, "", "") \
    142141    macro(AuthorAndUserStylesEnabled, authorAndUserStylesEnabled, Bool, bool, true, "", "") \
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp

    r212150 r212173  
    624624}
    625625
    626 void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef, bool enabled)
    627 {
    628     toImpl(preferencesRef)->setAllowsPageCacheWithWindowOpener(enabled);
    629 }
    630 
    631 bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferencesRef)
    632 {
    633     return toImpl(preferencesRef)->allowsPageCacheWithWindowOpener();
    634 }
    635 
    636626void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool pageCacheSupportsPlugins)
    637627{
  • trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h

    r212150 r212173  
    144144WK_EXPORT bool WKPreferencesGetPageCacheEnabled(WKPreferencesRef preferences);
    145145
    146 // Defaults to false.
    147 WK_EXPORT void WKPreferencesSetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences, bool enabled);
    148 WK_EXPORT bool WKPreferencesGetAllowsPageCacheWithWindowOpener(WKPreferencesRef preferences);
    149 
    150146// Defaults to true.
    151147WK_EXPORT void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferences, bool pageCacheSupportsPlugins);
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

    r211824 r212173  
    249249    macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
    250250    macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
    251     macro(WebKitAllowsPageCacheWithWindowOpenerKey, AllowsPageCacheWithWindowOpener, allowsPageCacheWithWindowOpener) \
    252251    macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
    253252    macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r212150 r212173  
    29862986    settings.setLocalFileContentSniffingEnabled(store.getBoolValueForKey(WebPreferencesKey::localFileContentSniffingEnabledKey()));
    29872987    settings.setUsesPageCache(store.getBoolValueForKey(WebPreferencesKey::usesPageCacheKey()));
    2988     settings.setAllowsPageCacheWithWindowOpener(store.getBoolValueForKey(WebPreferencesKey::allowsPageCacheWithWindowOpenerKey()));
    29892988    settings.setPageCacheSupportsPlugins(store.getBoolValueForKey(WebPreferencesKey::pageCacheSupportsPluginsKey()));
    29902989    settings.setAuthorAndUserStylesEnabled(store.getBoolValueForKey(WebPreferencesKey::authorAndUserStylesEnabledKey()));
  • trunk/Tools/ChangeLog

    r212167 r212173  
     12017-02-10  Daniel Bates  <dabates@apple.com>
     2
     3        Detach frame from document when entering page cache
     4        https://bugs.webkit.org/show_bug.cgi?id=166774
     5        <rdar://problem/29904368>
     6
     7        Reviewed by Chris Dumez.
     8
     9        * DumpRenderTree/mac/DumpRenderTree.mm:
     10        (resetWebPreferencesToConsistentValues):
     11        * DumpRenderTree/win/DumpRenderTree.cpp:
     12        (resetWebPreferencesToConsistentValues):
     13        * WebKitTestRunner/TestController.cpp:
     14        (WTR::TestController::resetPreferencesToConsistentValues):
     15
    1162017-02-10  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r212153 r212173  
    988988    // So, turn it off for now, but we might want to turn it back on some day.
    989989    [preferences setUsesPageCache:NO];
    990     [preferences setAllowsPageCacheWithWindowOpener:NO];
    991990    [preferences setAcceleratedCompositingEnabled:YES];
    992991#if USE(CA)
  • trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp

    r212150 r212173  
    836836    preferences->setTextAreasAreResizable(TRUE);
    837837    preferences->setUsesPageCache(FALSE);
    838     prefsPrivate->setAllowsPageCacheWithWindowOpener(FALSE);
    839838
    840839    preferences->setPrivateBrowsingEnabled(FALSE);
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r212150 r212173  
    656656#endif
    657657    WKPreferencesSetPageCacheEnabled(preferences, false);
    658     WKPreferencesSetAllowsPageCacheWithWindowOpener(preferences, false);
    659658    WKPreferencesSetAsynchronousPluginInitializationEnabled(preferences, false);
    660659    WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(preferences, false);
Note: See TracChangeset for help on using the changeset viewer.