1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

LibURL: Add FIXME's for testing equality of opaque origins

The spec seems to indicate in its wording that while opaque
origins only serialize to 'null', they can still be tested
for equality with one another. Probably we will need to
generate some unique ID which is unique across processes.
This commit is contained in:
Shannon Booth 2025-05-24 20:53:34 +12:00 committed by Tim Flynn
parent ceaeea3c26
commit 40d21e343f
Notes: github-actions[bot] 2025-05-24 13:52:51 +00:00

View file

@ -15,7 +15,10 @@ namespace URL {
class Origin {
public:
// FIXME: This should be generating a unique origin identifer that can be used for equality checks.
// Probably we should remove the default constructor, and instead expose this as a factory method.
Origin() = default;
Origin(Optional<String> const& scheme, Host const& host, Optional<u16> port)
: m_state(State {
.scheme = scheme,
@ -36,6 +39,7 @@ public:
bool is_same_origin(Origin const& other) const
{
// 1. If A and B are the same opaque origin, then return true.
// FIXME: What about opaque origins that are not equal to one another?
if (is_opaque() && other.is_opaque())
return true;
@ -55,6 +59,7 @@ public:
bool is_same_origin_domain(Origin const& other) const
{
// 1. If A and B are the same opaque origin, then return true.
// FIXME: What about opaque origins that are not equal to one another?
if (is_opaque() && other.is_opaque())
return true;