LibWeb: Don't include HTML/Window.h from DOM/Element.h

This required moving HTML::ScrollOptions to its own header file.
This commit is contained in:
Andreas Kling 2023-05-08 07:39:05 +02:00 committed by Jelle Raaijmakers
parent ac0c30ce62
commit e43027091d
6 changed files with 25 additions and 6 deletions

View file

@ -19,8 +19,8 @@
#include <LibWeb/DOM/QualifiedName.h>
#include <LibWeb/HTML/AttributeNames.h>
#include <LibWeb/HTML/EventLoop/Task.h>
#include <LibWeb/HTML/ScrollOptions.h>
#include <LibWeb/HTML/TagNames.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/WebIDL/ExceptionOr.h>

View file

@ -7,6 +7,7 @@
#pragma once
#include <LibJS/Forward.h>
#include <LibWeb/Bindings/Forward.h>
namespace Web {
@ -582,6 +583,8 @@ class DOMException;
template<typename ValueType>
class ExceptionOr;
using Promise = JS::PromiseCapability;
}
namespace Web::WebSockets {

View file

@ -5,6 +5,7 @@
*/
#include <AK/GenericLexer.h>
#include <AK/Random.h>
#include <LibWeb/HTML/FormControlInfrastructure.h>
#include <LibWeb/HTML/FormDataEvent.h>
#include <LibWeb/HTML/HTMLButtonElement.h>

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/WindowGlobalMixin.h>
namespace Web::HTML {
// https://w3c.github.io/csswg-drafts/cssom-view/#dictdef-scrolloptions
struct ScrollOptions {
Bindings::ScrollBehavior behavior { Bindings::ScrollBehavior::Auto };
};
}

View file

@ -22,6 +22,7 @@
#include <LibWeb/HTML/MimeType.h>
#include <LibWeb/HTML/Plugin.h>
#include <LibWeb/HTML/Scripting/ImportMap.h>
#include <LibWeb/HTML/ScrollOptions.h>
#include <LibWeb/HTML/WindowEventHandlers.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
#include <LibWeb/RequestIdleCallback/IdleRequest.h>
@ -30,11 +31,6 @@ namespace Web::HTML {
class IdleCallback;
// https://w3c.github.io/csswg-drafts/cssom-view/#dictdef-scrolloptions
struct ScrollOptions {
Bindings::ScrollBehavior behavior { Bindings::ScrollBehavior::Auto };
};
// https://w3c.github.io/csswg-drafts/cssom-view/#dictdef-scrolltooptions
struct ScrollToOptions : public ScrollOptions {
Optional<double> left;

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/SVG/AttributeNames.h>
#include <LibWeb/SVG/SVGRadialGradientElement.h>