summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.cpp
diff options
context:
space:
mode:
authorSigmund Lahn <s@lahn.no>2023-04-24 22:38:50 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-25 09:33:35 +0200
commitf2f14ad9bd9c18a1a1ab517343c706b43737761e (patch)
tree26952a3790c63bdff8e6e5059b5b188fc1e2daaa /Userland/Libraries/LibWeb/DOM/Document.cpp
parent5e7c838160f67774d633120ee3ed8df7f9e9261c (diff)
downloadserenity-f2f14ad9bd9c18a1a1ab517343c706b43737761e.zip
LibWeb+WebContent: Make document background and Viewport transparent
This means iframes are transparent by default (as in firefox/chrome). Painting the outermost canvas background is moved to the PageHost.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.cpp')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp
index 8d270c21e2..0aa1394a3e 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Document.cpp
@@ -722,7 +722,7 @@ void Document::tear_down_layout_tree()
m_layout_root = nullptr;
}
-Color Document::background_color(Gfx::Palette const& palette) const
+Color Document::background_color() const
{
// CSS2 says we should use the HTML element's background color unless it's transparent...
if (auto* html_element = this->html_element(); html_element && html_element->layout_node()) {
@@ -734,12 +734,12 @@ Color Document::background_color(Gfx::Palette const& palette) const
// ...in which case we use the BODY element's background color.
if (auto* body_element = body(); body_element && body_element->layout_node()) {
auto color = body_element->layout_node()->computed_values().background_color();
- if (color.alpha())
- return color;
+ return color;
}
- // If both HTML and BODY are transparent, we fall back to the system's "base" palette color.
- return palette.base();
+ // By default, the document is transparent.
+ // The outermost canvas is colored by the PageHost.
+ return Color::Transparent;
}
Vector<CSS::BackgroundLayerData> const* Document::background_layers() const