Skip to content
  • Nika Layzell's avatar
    Bug 1580565 - Part 2: Delay creating nsFrameLoader in static clone until... · 1872a6cc
    Nika Layzell authored
    Bug 1580565 - Part 2: Delay creating nsFrameLoader in static clone until embedder has window, r=smaug
    
    Follow-up parts in this bug depend on being able to read the `nsGlobalWindow`
    which embeds a `nsFrameLoader` within `CreateBrowsingContext`, which is called
    from the `nsFrameLoader` constructor. Unfortunately, we depend on creating the
    `nsFrameLoader` and `BrowsingContext` before we have the window as part of the
    fix to bug 1577711.
    
    This patch changes `BuildNestedPrintObjects` to instead use a list of pending
    clones stored on the parent `Document` object, and delays creation of the
    `nsFrameLoader`, and thus the inner `BrowsingContext`, until after the document
    has an owner global.
    
    Due to the low number of automated tests for printing, I manually tested
    print-previewing both the reduced test case from bug 1577711, a wikipedia
    article, and 'data:text/html,<object data="data:text/html,hi">' to avoid
    regressions.
    
    Differential Revision: https://phabricator.services.mozilla.com/D71236
    1872a6cc