1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibWeb: Move Origin into the HTML namespace

Origin is defined in the HTML Standard, and therefore belongs into the
HTML directory and namespace in LibWeb.
https://html.spec.whatwg.org/multipage/origin.html#origin
This commit is contained in:
Linus Groh 2022-07-12 20:37:43 +01:00
parent 1748362e05
commit 22a627fc1a
14 changed files with 23 additions and 21 deletions

View file

@ -56,6 +56,7 @@
#include <LibWeb/HTML/HTMLScriptElement.h>
#include <LibWeb/HTML/HTMLTitleElement.h>
#include <LibWeb/HTML/MessageEvent.h>
#include <LibWeb/HTML/Origin.h>
#include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
#include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h>
@ -64,7 +65,6 @@
#include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/TreeBuilder.h>
#include <LibWeb/Namespace.h>
#include <LibWeb/Origin.h>
#include <LibWeb/Page/Page.h>
#include <LibWeb/SVG/TagNames.h>
#include <LibWeb/UIEvents/EventNames.h>
@ -305,14 +305,14 @@ ExceptionOr<void> Document::close()
return {};
}
Origin Document::origin() const
HTML::Origin Document::origin() const
{
if (!m_url.is_valid())
return {};
return { m_url.protocol(), m_url.host(), m_url.port_or_default() };
}
void Document::set_origin(Origin const& origin)
void Document::set_origin(HTML::Origin const& origin)
{
m_url.set_protocol(origin.protocol());
m_url.set_host(origin.host());