Explorar el Código

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

This required moving the CSS::StyleProperty destruct out of line.
Andreas Kling hace 2 años
padre
commit
70db40c9b0
Se han modificado 25 ficheros con 49 adiciones y 2 borrados
  1. 1 0
      Userland/Libraries/LibWeb/CMakeLists.txt
  2. 1 0
      Userland/Libraries/LibWeb/CSS/Length.cpp
  3. 1 0
      Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
  4. 14 0
      Userland/Libraries/LibWeb/CSS/StyleProperty.cpp
  5. 5 0
      Userland/Libraries/LibWeb/CSS/StyleProperty.h
  6. 2 0
      Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.cpp
  7. 5 0
      Userland/Libraries/LibWeb/DOM/Element.cpp
  8. 1 2
      Userland/Libraries/LibWeb/DOM/Element.h
  9. 2 0
      Userland/Libraries/LibWeb/Forward.h
  10. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLBlinkElement.cpp
  11. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp
  12. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp
  13. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp
  14. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp
  15. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp
  16. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp
  17. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp
  18. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp
  19. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp
  20. 1 0
      Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
  21. 2 0
      Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h
  22. 1 0
      Userland/Libraries/LibWeb/HTML/Parser/HTMLTokenizer.cpp
  23. 1 0
      Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h
  24. 1 0
      Userland/Libraries/LibWeb/SVG/SVGStopElement.h
  25. 1 0
      Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp

+ 1 - 0
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

+ 1 - 0
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 {
 

+ 1 - 0
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>

+ 14 - 0
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;
+
+}

+ 5 - 0
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;

+ 2 - 0
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 {

+ 5 - 0
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);
+}
+
 }

+ 1 - 2
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;

+ 2 - 0
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 {

+ 1 - 0
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 {

+ 1 - 0
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 {
 

+ 1 - 0
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>
 

+ 1 - 0
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 {
 

+ 1 - 0
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>
 

+ 1 - 0
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>
 

+ 1 - 0
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>
 

+ 1 - 0
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>
 

+ 1 - 0
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>
 

+ 1 - 0
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>

+ 1 - 0
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>

+ 2 - 0
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 {

+ 1 - 0
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>

+ 1 - 0
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>

+ 1 - 0
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>

+ 1 - 0
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 {