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

LibWeb: Don't include Layout/Node.h from DOM/Element.h

This required moving the CSS::StyleProperty destruct out of line.
This commit is contained in:
Andreas Kling 2023-05-08 07:51:03 +02:00 committed by Jelle Raaijmakers
parent e43027091d
commit 70db40c9b0
25 changed files with 49 additions and 2 deletions

View file

@ -64,6 +64,7 @@ set(SOURCES
CSS/Size.cpp CSS/Size.cpp
CSS/StyleComputer.cpp CSS/StyleComputer.cpp
CSS/StyleProperties.cpp CSS/StyleProperties.cpp
CSS/StyleProperty.cpp
CSS/StyleSheet.cpp CSS/StyleSheet.cpp
CSS/StyleSheetList.cpp CSS/StyleSheetList.cpp
CSS/StyleValue.cpp CSS/StyleValue.cpp

View file

@ -15,6 +15,7 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/Node.h>
namespace Web::CSS { namespace Web::CSS {

View file

@ -54,6 +54,7 @@
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
#include <LibWeb/FontCache.h> #include <LibWeb/FontCache.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Platform/FontPlugin.h> #include <LibWeb/Platform/FontPlugin.h>
#include <stdio.h> #include <stdio.h>

View file

@ -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;
}

View file

@ -6,6 +6,9 @@
#pragma once #pragma once
#include <AK/DeprecatedString.h>
#include <LibWeb/CSS/PropertyID.h>
namespace Web::CSS { namespace Web::CSS {
enum class Important { enum class Important {
@ -14,6 +17,8 @@ enum class Important {
}; };
struct StyleProperty { struct StyleProperty {
~StyleProperty();
Important important { Important::No }; Important important { Important::No };
CSS::PropertyID property_id; CSS::PropertyID property_id;
NonnullRefPtr<StyleValue const> value; NonnullRefPtr<StyleValue const> value;

View file

@ -8,9 +8,11 @@
*/ */
#include "ImageStyleValue.h" #include "ImageStyleValue.h"
#include <LibWeb/CSS/ComputedValues.h>
#include <LibWeb/CSS/Serialize.h> #include <LibWeb/CSS/Serialize.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Painting/PaintContext.h>
#include <LibWeb/Platform/Timer.h> #include <LibWeb/Platform/Timer.h>
namespace Web::CSS { namespace Web::CSS {

View file

@ -1703,4 +1703,9 @@ size_t Element::attribute_list_size() const
return m_attributes->length(); return m_attributes->length();
} }
void Element::set_computed_css_values(RefPtr<CSS::StyleProperties> style)
{
m_computed_css_values = move(style);
}
} }

View file

@ -21,7 +21,6 @@
#include <LibWeb/HTML/EventLoop/Task.h> #include <LibWeb/HTML/EventLoop/Task.h>
#include <LibWeb/HTML/ScrollOptions.h> #include <LibWeb/HTML/ScrollOptions.h>
#include <LibWeb/HTML/TagNames.h> #include <LibWeb/HTML/TagNames.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/WebIDL/ExceptionOr.h> #include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::DOM { namespace Web::DOM {
@ -137,7 +136,7 @@ public:
CSS::StyleProperties* computed_css_values() { return m_computed_css_values.ptr(); } CSS::StyleProperties* computed_css_values() { return m_computed_css_values.ptr(); }
CSS::StyleProperties const* computed_css_values() const { 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(); NonnullRefPtr<CSS::StyleProperties> resolved_css_values();
CSS::CSSStyleDeclaration const* inline_style() const; CSS::CSSStyleDeclaration const* inline_style() const;

View file

@ -163,6 +163,8 @@ class URLStyleValue;
enum class MediaFeatureID; enum class MediaFeatureID;
enum class PropertyID; enum class PropertyID;
enum class ValueID; enum class ValueID;
struct BackgroundLayerData;
} }
namespace Web::CSS::Parser { namespace Web::CSS::Parser {

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/HTML/HTMLBlinkElement.h> #include <LibWeb/HTML/HTMLBlinkElement.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/Platform/Timer.h> #include <LibWeb/Platform/Timer.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -10,6 +10,7 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/HTMLBodyElement.h> #include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/Node.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h> #include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLHeadingElement.h> #include <LibWeb/HTML/HTMLHeadingElement.h>

View file

@ -6,6 +6,7 @@
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/Node.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h> #include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/HTML/HTMLMarqueeElement.h> #include <LibWeb/HTML/HTMLMarqueeElement.h>

View file

@ -28,6 +28,7 @@
#include <LibWeb/HTML/TrackEvent.h> #include <LibWeb/HTML/TrackEvent.h>
#include <LibWeb/HTML/VideoTrack.h> #include <LibWeb/HTML/VideoTrack.h>
#include <LibWeb/HTML/VideoTrackList.h> #include <LibWeb/HTML/VideoTrackList.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/MimeSniff/MimeType.h> #include <LibWeb/MimeSniff/MimeType.h>
#include <LibWeb/WebIDL/Promise.h> #include <LibWeb/WebIDL/Promise.h>

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h> #include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLParagraphElement.h> #include <LibWeb/HTML/HTMLParagraphElement.h>

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h> #include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLPreElement.h> #include <LibWeb/HTML/HTMLPreElement.h>

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h> #include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLTableCaptionElement.h> #include <LibWeb/HTML/HTMLTableCaptionElement.h>

View file

@ -6,6 +6,7 @@
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h> #include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h> #include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/HTML/HTMLTableCellElement.h> #include <LibWeb/HTML/HTMLTableCellElement.h>

View file

@ -7,6 +7,7 @@
#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h> #include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h> #include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/DOM/HTMLCollection.h>

View file

@ -8,9 +8,11 @@
#include <AK/Optional.h> #include <AK/Optional.h>
#include <LibGfx/Forward.h> #include <LibGfx/Forward.h>
#include <LibGfx/Rect.h>
#include <LibWeb/DOM/DocumentLoadEventDelayer.h> #include <LibWeb/DOM/DocumentLoadEventDelayer.h>
#include <LibWeb/Forward.h> #include <LibWeb/Forward.h>
#include <LibWeb/HTML/HTMLMediaElement.h> #include <LibWeb/HTML/HTMLMediaElement.h>
#include <LibWeb/PixelUnits.h>
#include <LibWeb/WebIDL/ExceptionOr.h> #include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -7,6 +7,7 @@
#include <AK/CharacterTypes.h> #include <AK/CharacterTypes.h>
#include <AK/Debug.h> #include <AK/Debug.h>
#include <AK/GenericShorthands.h>
#include <AK/SourceLocation.h> #include <AK/SourceLocation.h>
#include <LibTextCodec/Decoder.h> #include <LibTextCodec/Decoder.h>
#include <LibWeb/HTML/Parser/Entities.h> #include <LibWeb/HTML/Parser/Entities.h>

View file

@ -8,6 +8,7 @@
#pragma once #pragma once
#include <LibGfx/PaintStyle.h> #include <LibGfx/PaintStyle.h>
#include <LibGfx/Painter.h>
#include <LibGfx/Path.h> #include <LibGfx/Path.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/SVG/AttributeParser.h> #include <LibWeb/SVG/AttributeParser.h>

View file

@ -6,6 +6,7 @@
#pragma once #pragma once
#include <LibGfx/Color.h>
#include <LibWeb/SVG/AttributeParser.h> #include <LibWeb/SVG/AttributeParser.h>
#include <LibWeb/SVG/SVGAnimatedNumber.h> #include <LibWeb/SVG/SVGAnimatedNumber.h>
#include <LibWeb/SVG/SVGElement.h> #include <LibWeb/SVG/SVGElement.h>

View file

@ -7,6 +7,7 @@
#include <AK/Debug.h> #include <AK/Debug.h>
#include <LibGL/GLContext.h> #include <LibGL/GLContext.h>
#include <LibWeb/HTML/HTMLCanvasElement.h> #include <LibWeb/HTML/HTMLCanvasElement.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/WebGL/WebGLRenderingContextBase.h> #include <LibWeb/WebGL/WebGLRenderingContextBase.h>
namespace Web::WebGL { namespace Web::WebGL {