mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:57:44 +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:
parent
1748362e05
commit
22a627fc1a
14 changed files with 23 additions and 21 deletions
|
@ -9,8 +9,8 @@
|
|||
#include <LibWeb/DOM/DocumentType.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
#include <LibWeb/Namespace.h>
|
||||
#include <LibWeb/Origin.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <LibWeb/HTML/DocumentReadyState.h>
|
||||
#include <LibWeb/HTML/HTMLScriptElement.h>
|
||||
#include <LibWeb/HTML/History.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -82,8 +83,8 @@ public:
|
|||
String url_string() const { return m_url.to_string(); }
|
||||
String document_uri() const { return m_url.to_string(); }
|
||||
|
||||
Origin origin() const;
|
||||
void set_origin(Origin const& origin);
|
||||
HTML::Origin origin() const;
|
||||
void set_origin(HTML::Origin const& origin);
|
||||
|
||||
AK::URL parse_url(String const&) const;
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#include <LibWeb/DOM/StaticNodeList.h>
|
||||
#include <LibWeb/HTML/BrowsingContextContainer.h>
|
||||
#include <LibWeb/HTML/HTMLAnchorElement.h>
|
||||
#include <LibWeb/HTML/Origin.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
#include <LibWeb/Layout/InitialContainingBlock.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
#include <LibWeb/Layout/TextNode.h>
|
||||
#include <LibWeb/Origin.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue