Skip to content
  • ap@apple.com's avatar
    window.crypto doesn't preserve custom properties · bdb7a794
    ap@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=122770
    
    Reviewed by Mark Hahnenberg.
    
    Source/WebCore: 
    
    Test: security/crypto-gc.html
    
    Generate isReachableFromOpaqueRoots that makes Crypto live as long as the document
    lives (because that's when it's observable through window object).
    
    * page/Crypto.cpp:
    (WebCore::Crypto::Crypto):
    (WebCore::Crypto::~Crypto):
    (WebCore::Crypto::document):
    * page/Crypto.h:
    (WebCore::Crypto::create):
    Made Crypto a ContextDestructionObserver, so that it can report its document to bindings.
    Removed ScriptWrappable, because it seems to have served no purpose in this class.
    
    * page/Crypto.idl: Added GenerateIsReachable. Removed ImplementationLacksVTable,
    because the class now has a vtable, and can be checked for bindings integrity.
    
    * page/DOMWindow.cpp: (WebCore::DOMWindow::crypto): Pass a document when creating
    crypto.
    
    LayoutTests: 
    
    * security/crypto-gc-expected.txt: Added.
    * security/crypto-gc.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bdb7a794