mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-16 16:12:53 +00:00
LibWeb: Expose crypto
object to workers
This change moves the `crypto()` getter from `Window` to `WorkerOrWindowGlobalScope`. This aligns our implementation with the WebCrypto specification.
This commit is contained in:
parent
d6a31d80c0
commit
89b6cd3fb1
Notes:
github-actions[bot]
2024-09-18 08:09:56 +00:00
Author: https://github.com/tcl3
Commit: 89b6cd3fb1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1419
9 changed files with 33 additions and 19 deletions
|
@ -24,7 +24,6 @@
|
|||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/ResolvedCSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/Screen.h>
|
||||
#include <LibWeb/Crypto/Crypto.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
|
@ -120,7 +119,6 @@ void Window::visit_edges(JS::Cell::Visitor& visitor)
|
|||
visitor.visit(m_current_event);
|
||||
visitor.visit(m_screen);
|
||||
visitor.visit(m_location);
|
||||
visitor.visit(m_crypto);
|
||||
visitor.visit(m_navigator);
|
||||
visitor.visit(m_navigation);
|
||||
visitor.visit(m_custom_element_registry);
|
||||
|
@ -1553,16 +1551,6 @@ JS::GCPtr<Selection::Selection> Window::get_selection() const
|
|||
return associated_document().get_selection();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webcrypto/#dom-windoworworkerglobalscope-crypto
|
||||
JS::NonnullGCPtr<Crypto::Crypto> Window::crypto()
|
||||
{
|
||||
auto& realm = this->realm();
|
||||
|
||||
if (!m_crypto)
|
||||
m_crypto = heap().allocate<Crypto::Crypto>(realm, realm);
|
||||
return JS::NonnullGCPtr { *m_crypto };
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/obsolete.html#dom-window-captureevents
|
||||
void Window::capture_events()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue