summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp b/Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp
index fc397a8707..f45129df91 100644
--- a/Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/CrossOriginAbstractOperations.cpp
@@ -71,4 +71,11 @@ JS::ThrowCompletionOr<JS::PropertyDescriptor> cross_origin_property_fallback(JS:
return vm.throw_completion<DOMExceptionWrapper>(global_object, DOM::SecurityError::create(String::formatted("Can't access property '{}' on cross-origin object", property_key)));
}
+// 7.2.3.3 IsPlatformObjectSameOrigin ( O ), https://html.spec.whatwg.org/multipage/browsers.html#isplatformobjectsameorigin-(-o-)
+bool is_platform_object_same_origin(JS::Object const& object)
+{
+ // 1. Return true if the current settings object's origin is same origin-domain with O's relevant settings object's origin, and false otherwise.
+ return HTML::current_settings_object().origin().is_same_origin_domain(HTML::relevant_settings_object(object).origin());
+}
+
}