mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
LibWeb: Implement HTMLIFrameElement.sandbox
This commit is contained in:
parent
a4b43cae9a
commit
634823d5b4
Notes:
github-actions[bot]
2024-11-17 21:13:47 +00:00
Author: https://github.com/shannonbooth
Commit: 634823d5b4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2404
5 changed files with 19 additions and 4 deletions
|
@ -233,6 +233,7 @@ namespace AttributeNames {
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(rows) \
|
__ENUMERATE_HTML_ATTRIBUTE(rows) \
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(rowspan) \
|
__ENUMERATE_HTML_ATTRIBUTE(rowspan) \
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(rules) \
|
__ENUMERATE_HTML_ATTRIBUTE(rules) \
|
||||||
|
__ENUMERATE_HTML_ATTRIBUTE(sandbox) \
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(scheme) \
|
__ENUMERATE_HTML_ATTRIBUTE(scheme) \
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(scope) \
|
__ENUMERATE_HTML_ATTRIBUTE(scope) \
|
||||||
__ENUMERATE_HTML_ATTRIBUTE(scrollamount) \
|
__ENUMERATE_HTML_ATTRIBUTE(scrollamount) \
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <LibURL/Origin.h>
|
#include <LibURL/Origin.h>
|
||||||
#include <LibWeb/Bindings/HTMLIFrameElementPrototype.h>
|
#include <LibWeb/Bindings/HTMLIFrameElementPrototype.h>
|
||||||
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
#include <LibWeb/CSS/StyleValues/DisplayStyleValue.h>
|
||||||
|
#include <LibWeb/DOM/DOMTokenList.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Event.h>
|
#include <LibWeb/DOM/Event.h>
|
||||||
#include <LibWeb/HTML/BrowsingContext.h>
|
#include <LibWeb/HTML/BrowsingContext.h>
|
||||||
|
@ -211,10 +212,20 @@ i32 HTMLIFrameElement::default_tab_index_value() const
|
||||||
return 0;
|
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)
|
void HTMLIFrameElement::visit_edges(Cell::Visitor& visitor)
|
||||||
{
|
{
|
||||||
Base::visit_edges(visitor);
|
Base::visit_edges(visitor);
|
||||||
visit_lazy_loading_element(visitor);
|
visit_lazy_loading_element(visitor);
|
||||||
|
visitor.visit(m_sandbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLIFrameElement::set_current_navigation_was_lazy_loaded(bool value)
|
void HTMLIFrameElement::set_current_navigation_was_lazy_loaded(bool value)
|
||||||
|
|
|
@ -31,6 +31,8 @@ public:
|
||||||
Optional<HighResolutionTime::DOMHighResTimeStamp> const& pending_resource_start_time() const { return m_pending_resource_start_time; }
|
Optional<HighResolutionTime::DOMHighResTimeStamp> const& pending_resource_start_time() const { return m_pending_resource_start_time; }
|
||||||
void set_pending_resource_start_time(Optional<HighResolutionTime::DOMHighResTimeStamp> time) { m_pending_resource_start_time = time; }
|
void set_pending_resource_start_time(Optional<HighResolutionTime::DOMHighResTimeStamp> time) { m_pending_resource_start_time = time; }
|
||||||
|
|
||||||
|
GC::Ref<DOM::DOMTokenList> sandbox();
|
||||||
|
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -55,6 +57,8 @@ private:
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#iframe-pending-resource-timing-start-time
|
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#iframe-pending-resource-timing-start-time
|
||||||
Optional<HighResolutionTime::DOMHighResTimeStamp> m_pending_resource_start_time = {};
|
Optional<HighResolutionTime::DOMHighResTimeStamp> m_pending_resource_start_time = {};
|
||||||
|
|
||||||
|
GC::Ptr<DOM::DOMTokenList> m_sandbox;
|
||||||
};
|
};
|
||||||
|
|
||||||
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
|
void run_iframe_load_event_steps(HTML::HTMLIFrameElement&);
|
||||||
|
|
|
@ -11,7 +11,7 @@ interface HTMLIFrameElement : HTMLElement {
|
||||||
[CEReactions, Reflect, URL] attribute USVString src;
|
[CEReactions, Reflect, URL] attribute USVString src;
|
||||||
[CEReactions, Reflect] attribute DOMString srcdoc;
|
[CEReactions, Reflect] attribute DOMString srcdoc;
|
||||||
[CEReactions, Reflect] attribute DOMString name;
|
[CEReactions, Reflect] attribute DOMString name;
|
||||||
[FIXME, SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox;
|
[SameObject, PutForwards=value] readonly attribute DOMTokenList sandbox;
|
||||||
[CEReactions, Reflect] attribute DOMString allow;
|
[CEReactions, Reflect] attribute DOMString allow;
|
||||||
[CEReactions, Reflect=allowfullscreen] attribute boolean allowFullscreen;
|
[CEReactions, Reflect=allowfullscreen] attribute boolean allowFullscreen;
|
||||||
[CEReactions, Reflect] attribute DOMString width;
|
[CEReactions, Reflect] attribute DOMString width;
|
||||||
|
|
|
@ -6,8 +6,7 @@ Rerun
|
||||||
|
|
||||||
Found 175 tests
|
Found 175 tests
|
||||||
|
|
||||||
174 Pass
|
175 Pass
|
||||||
1 Fail
|
|
||||||
Details
|
Details
|
||||||
Result Test Name MessagePass a.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
Result Test Name MessagePass a.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
||||||
Pass area.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
Pass area.classList in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
||||||
|
@ -117,7 +116,7 @@ Pass th.htmlFor in null namespace should be undefined.
|
||||||
Pass a.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass a.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
Pass area.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass area.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
Pass link.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass link.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
Fail iframe.sandbox in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
Pass iframe.sandbox in http://www.w3.org/1999/xhtml namespace should be DOMTokenList.
|
||||||
Pass output.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass output.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
Pass td.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass td.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
Pass th.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
Pass th.sandbox in http://www.w3.org/1999/xhtml namespace should be undefined.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue