LibWeb: Implement HTMLIFrameElement.sandbox

This commit is contained in:
Shannon Booth 2024-11-18 07:16:26 +13:00 committed by Andreas Kling
parent a4b43cae9a
commit 634823d5b4
Notes: github-actions[bot] 2024-11-17 21:13:47 +00:00
5 changed files with 19 additions and 4 deletions

View file

@ -8,6 +8,7 @@
#include <LibURL/Origin.h>
#include <LibWeb/Bindings/HTMLIFrameElementPrototype.h>
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
#include <LibWeb/DOM/DOMTokenList.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h>
#include <LibWeb/HTML/BrowsingContext.h>
@ -211,10 +212,20 @@ i32 HTMLIFrameElement::default_tab_index_value() const
return 0;
}
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-sandbox
GC::Ref<DOM::DOMTokenList> HTMLIFrameElement::sandbox()
{
// The sandbox IDL attribute must reflect the sandbox content attribute.
if (!m_sandbox)
m_sandbox = DOM::DOMTokenList::create(*this, HTML::AttributeNames::sandbox);
return *m_sandbox;
}
void HTMLIFrameElement::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visit_lazy_loading_element(visitor);
visitor.visit(m_sandbox);
}
void HTMLIFrameElement::set_current_navigation_was_lazy_loaded(bool value)