summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-08 07:51:03 +0200
committerJelle Raaijmakers <jelle@gmta.nl>2023-05-08 09:29:44 +0200
commit70db40c9b03a57c26d97a17636c2cf40c0a658d1 (patch)
tree7421cf3c06a6c3968ee7d426c98007605ab7e64c /Userland
parente43027091dfd9a3dcc54895278c2524950039f75 (diff)
downloadserenity-70db40c9b03a57c26d97a17636c2cf40c0a658d1.zip
LibWeb: Don't include Layout/Node.h from DOM/Element.h
This required moving the CSS::StyleProperty destruct out of line.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/CMakeLists.txt1
-rw-r--r--Userland/Libraries/LibWeb/CSS/Length.cpp1
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp1
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperty.cpp14
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperty.h5
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp2
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.cpp5
-rw-r--r--Userland/Libraries/LibWeb/DOM/Element.h3
-rw-r--r--Userland/Libraries/LibWeb/Forward.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp1
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h2
-rw-r--r--Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp1
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h1
-rw-r--r--Userland/Libraries/LibWeb/SVG/SVGStopElement.h1
-rw-r--r--Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp1
25 files changed, 49 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt
index a27d131ff5..5efc844bb1 100644
--- a/Userland/Libraries/LibWeb/CMakeLists.txt
+++ b/Userland/Libraries/LibWeb/CMakeLists.txt
@@ -64,6 +64,7 @@ set(SOURCES
CSS/Size.cpp
CSS/StyleComputer.cpp
CSS/StyleProperties.cpp
+ CSS/StyleProperty.cpp
CSS/StyleSheet.cpp
CSS/StyleSheetList.cpp
CSS/StyleValue.cpp
diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp
index 61637b4e66..509ad1ec0e 100644
--- a/Userland/Libraries/LibWeb/CSS/Length.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Length.cpp
@@ -15,6 +15,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLHtmlElement.h>
+#include <LibWeb/Layout/Node.h>
namespace Web::CSS {
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index 02e065cd49..ca0112ee5f 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -54,6 +54,7 @@
#include <LibWeb/DOM/Element.h>
#include <LibWeb/FontCache.h>
#include <LibWeb/HTML/HTMLHtmlElement.h>
+#include <LibWeb/Layout/Node.h>
#include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Platform/FontPlugin.h>
#include <stdio.h>
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperty.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperty.cpp
new file mode 100644
index 0000000000..736007f01b
--- /dev/null
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperty.cpp
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <LibWeb/CSS/StyleProperty.h>
+#include <LibWeb/CSS/StyleValue.h>
+
+namespace Web::CSS {
+
+StyleProperty::~StyleProperty() = default;
+
+}
diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperty.h b/Userland/Libraries/LibWeb/CSS/StyleProperty.h
index 8adfc386f0..8372325104 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleProperty.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleProperty.h
@@ -6,6 +6,9 @@
#pragma once
+#include <AK/DeprecatedString.h>
+#include <LibWeb/CSS/PropertyID.h>
+
namespace Web::CSS {
enum class Important {
@@ -14,6 +17,8 @@ enum class Important {
};
struct StyleProperty {
+ ~StyleProperty();
+
Important important { Important::No };
CSS::PropertyID property_id;
NonnullRefPtr<StyleValue const> value;
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp
index 0039031c0a..77f20c19c3 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp
@@ -8,9 +8,11 @@
*/
#include "ImageStyleValue.h"
+#include <LibWeb/CSS/ComputedValues.h>
#include <LibWeb/CSS/Serialize.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Loader/ResourceLoader.h>
+#include <LibWeb/Painting/PaintContext.h>
#include <LibWeb/Platform/Timer.h>
namespace Web::CSS {
diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp
index 3cdaca22f9..5a032c3ce0 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Element.cpp
@@ -1703,4 +1703,9 @@ size_t Element::attribute_list_size() const
return m_attributes->length();
}
+void Element::set_computed_css_values(RefPtr<CSS::StyleProperties> style)
+{
+ m_computed_css_values = move(style);
+}
+
}
diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h
index 86fe0fc816..b34efa081e 100644
--- a/Userland/Libraries/LibWeb/DOM/Element.h
+++ b/Userland/Libraries/LibWeb/DOM/Element.h
@@ -21,7 +21,6 @@
#include <LibWeb/HTML/EventLoop/Task.h>
#include <LibWeb/HTML/ScrollOptions.h>
#include <LibWeb/HTML/TagNames.h>
-#include <LibWeb/Layout/Node.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::DOM {
@@ -137,7 +136,7 @@ public:
CSS::StyleProperties* computed_css_values() { return m_computed_css_values.ptr(); }
CSS::StyleProperties const* computed_css_values() const { return m_computed_css_values.ptr(); }
- void set_computed_css_values(RefPtr<CSS::StyleProperties> style) { m_computed_css_values = move(style); }
+ void set_computed_css_values(RefPtr<CSS::StyleProperties>);
NonnullRefPtr<CSS::StyleProperties> resolved_css_values();
CSS::CSSStyleDeclaration const* inline_style() const;
diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h
index e5bf9e62da..8cec154ee1 100644
--- a/Userland/Libraries/LibWeb/Forward.h
+++ b/Userland/Libraries/LibWeb/Forward.h
@@ -163,6 +163,8 @@ class URLStyleValue;
enum class MediaFeatureID;
enum class PropertyID;
enum class ValueID;
+
+struct BackgroundLayerData;
}
namespace Web::CSS::Parser {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp
index 6bfa7806fd..011d576364 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/HTML/HTMLBlinkElement.h>
+#include <LibWeb/Layout/Node.h>
#include <LibWeb/Platform/Timer.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
index af3878235f..e206ee08fe 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
@@ -10,6 +10,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/Window.h>
+#include <LibWeb/Layout/Node.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp
index ce132ae7c9..f7577cd74d 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLHeadingElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
index 606519ac02..db4ef5ecc2 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
@@ -6,6 +6,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/HTMLHtmlElement.h>
+#include <LibWeb/Layout/Node.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp
index 6c7ff94696..573bf8b637 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/HTML/HTMLMarqueeElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
index fd9a4cf34d..635de9e564 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
@@ -28,6 +28,7 @@
#include <LibWeb/HTML/TrackEvent.h>
#include <LibWeb/HTML/VideoTrack.h>
#include <LibWeb/HTML/VideoTrackList.h>
+#include <LibWeb/Layout/Node.h>
#include <LibWeb/MimeSniff/MimeType.h>
#include <LibWeb/WebIDL/Promise.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp
index 3c1e3ae52a..554938b888 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLParagraphElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp
index 89770cb3bd..7adea79fae 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLPreElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp
index 022e22089a..555b7108b9 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp
@@ -5,6 +5,7 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLTableCaptionElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
index bf7529034e..762843569f 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
@@ -6,6 +6,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLTableCellElement.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
index f26458ccfc..8f8a3281c3 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
@@ -7,6 +7,7 @@
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
+#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/HTMLCollection.h>
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h
index 1c2d3e59e1..3b06af6001 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h
@@ -8,9 +8,11 @@
#include <AK/Optional.h>
#include <LibGfx/Forward.h>
+#include <LibGfx/Rect.h>
#include <LibWeb/DOM/DocumentLoadEventDelayer.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/HTMLMediaElement.h>
+#include <LibWeb/PixelUnits.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
index f661ee6f80..aa6681f575 100644
--- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
@@ -7,6 +7,7 @@
#include <AK/CharacterTypes.h>
#include <AK/Debug.h>
+#include <AK/GenericShorthands.h>
#include <AK/SourceLocation.h>
#include <LibTextCodec/Decoder.h>
#include <LibWeb/HTML/Parser/Entities.h>
diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h
index 3bcb380ec7..1016ee8dc1 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h
+++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h
@@ -8,6 +8,7 @@
#pragma once
#include <LibGfx/PaintStyle.h>
+#include <LibGfx/Painter.h>
#include <LibGfx/Path.h>
#include <LibWeb/DOM/Node.h>
#include <LibWeb/SVG/AttributeParser.h>
diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h
index a1167397b5..49b2cb20d6 100644
--- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h
+++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h
@@ -6,6 +6,7 @@
#pragma once
+#include <LibGfx/Color.h>
#include <LibWeb/SVG/AttributeParser.h>
#include <LibWeb/SVG/SVGAnimatedNumber.h>
#include <LibWeb/SVG/SVGElement.h>
diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp
index b501b04084..e01a21ef31 100644
--- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp
+++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp
@@ -7,6 +7,7 @@
#include <AK/Debug.h>
#include <LibGL/GLContext.h>
#include <LibWeb/HTML/HTMLCanvasElement.h>
+#include <LibWeb/Layout/Node.h>
#include <LibWeb/WebGL/WebGLRenderingContextBase.h>
namespace Web::WebGL {