From 24d5ca4a9d1514bc061407150e658c03d428f24e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 14 Feb 2022 22:05:31 +0000 Subject: [PATCH] LibWeb: Remove non-standard ReturnNullIfCrossOrigin IDL attribute This is no longer needed as BrowsingContextContainer::content_document() now does the right thing, and HTMLIFrameElement.contentDocument is the only user of this attribute. Let's not invent our own mechanisms for things that are important to get right, like same origin comparisons. --- .../Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp | 7 ------- Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp index 6de6ed238b..0e308e9c9e 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp @@ -3894,13 +3894,6 @@ JS_DEFINE_NATIVE_FUNCTION(@prototype_class@::@attribute.getter_callback@) auto* impl = TRY(impl_from(vm, global_object)); )~~~"); - if (attribute.extended_attributes.contains("ReturnNullIfCrossOrigin")) { - attribute_generator.append(R"~~~( - if (!impl->may_access_from_origin(static_cast(global_object).origin())) - return JS::js_null(); -)~~~"); - } - if (attribute.extended_attributes.contains("Reflect")) { if (attribute.type->name != "boolean") { attribute_generator.append(R"~~~( diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl index a219b66071..9384c134a0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl @@ -8,7 +8,7 @@ interface HTMLIFrameElement : HTMLElement { [Reflect] attribute DOMString height; [Reflect=allowfullscreen] attribute boolean allowFullscreen; - [ReturnNullIfCrossOrigin] readonly attribute Document? contentDocument; + readonly attribute Document? contentDocument; [Reflect] attribute DOMString align; [Reflect] attribute DOMString scrolling;