summaryrefslogtreecommitdiff
path: root/Libraries/LibHTML
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 11:56:38 +0100
commit11580babbfb1b8ae0acab2400f11d905c35642f5 (patch)
tree3b26fcd4bf7afe9ff92203468ba7cd95e192d55f /Libraries/LibHTML
parent939a605334a71dd8b7af91cdcbe9047281f7b5b9 (diff)
downloadserenity-11580babbfb1b8ae0acab2400f11d905c35642f5.zip
LibDraw: Put all classes in the Gfx namespace
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
Diffstat (limited to 'Libraries/LibHTML')
-rw-r--r--Libraries/LibHTML/CSS/StyleProperties.cpp6
-rw-r--r--Libraries/LibHTML/CSS/StyleProperties.h6
-rw-r--r--Libraries/LibHTML/CSS/StyleValue.cpp2
-rw-r--r--Libraries/LibHTML/CSS/StyleValue.h4
-rw-r--r--Libraries/LibHTML/DOM/Document.cpp2
-rw-r--r--Libraries/LibHTML/DOM/Document.h7
-rw-r--r--Libraries/LibHTML/DOM/HTMLImageElement.cpp6
-rw-r--r--Libraries/LibHTML/DOM/HTMLImageElement.h6
-rw-r--r--Libraries/LibHTML/DOM/HTMLInputElement.cpp4
-rw-r--r--Libraries/LibHTML/DOMTreeModel.cpp6
-rw-r--r--Libraries/LibHTML/FontCache.cpp4
-rw-r--r--Libraries/LibHTML/FontCache.h8
-rw-r--r--Libraries/LibHTML/Frame.cpp6
-rw-r--r--Libraries/LibHTML/Frame.h14
-rw-r--r--Libraries/LibHTML/HtmlView.cpp6
-rw-r--r--Libraries/LibHTML/Layout/LayoutBlock.cpp2
-rw-r--r--Libraries/LibHTML/Layout/LayoutBlock.h2
-rw-r--r--Libraries/LibHTML/Layout/LayoutBox.cpp2
-rw-r--r--Libraries/LibHTML/Layout/LayoutBox.h2
-rw-r--r--Libraries/LibHTML/Layout/LayoutDocument.cpp2
-rw-r--r--Libraries/LibHTML/Layout/LayoutDocument.h2
-rw-r--r--Libraries/LibHTML/Layout/LayoutImage.cpp8
-rw-r--r--Libraries/LibHTML/Layout/LayoutNode.cpp2
-rw-r--r--Libraries/LibHTML/Layout/LayoutNode.h2
-rw-r--r--Libraries/LibHTML/Layout/LayoutText.cpp2
-rw-r--r--Libraries/LibHTML/RenderingContext.h4
26 files changed, 62 insertions, 55 deletions
diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp
index a2c3fe7b64..1648410d74 100644
--- a/Libraries/LibHTML/CSS/StyleProperties.cpp
+++ b/Libraries/LibHTML/CSS/StyleProperties.cpp
@@ -136,9 +136,9 @@ void StyleProperties::load_font() const
dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight;
if (font_weight == "bold")
- m_font = Font::default_bold_font();
+ m_font = Gfx::Font::default_bold_font();
else
- m_font = Font::default_font();
+ m_font = Gfx::Font::default_font();
return;
}
@@ -146,7 +146,7 @@ void StyleProperties::load_font() const
dbg() << "Found font " << file_name << " for family " << font_family << " weight " << font_weight;
#endif
- m_font = Font::load_from_file(String::format("/res/fonts/%s", file_name.characters()));
+ m_font = Gfx::Font::load_from_file(String::format("/res/fonts/%s", file_name.characters()));
FontCache::the().set({ font_family, font_weight }, *m_font);
}
diff --git a/Libraries/LibHTML/CSS/StyleProperties.h b/Libraries/LibHTML/CSS/StyleProperties.h
index b01d9a18e4..fd3fdfae9d 100644
--- a/Libraries/LibHTML/CSS/StyleProperties.h
+++ b/Libraries/LibHTML/CSS/StyleProperties.h
@@ -31,7 +31,9 @@
#include <LibDraw/Font.h>
#include <LibHTML/CSS/StyleValue.h>
+namespace Gfx {
class Color;
+}
class StyleProperties : public RefCounted<StyleProperties> {
public:
@@ -57,7 +59,7 @@ public:
String string_or_fallback(CSS::PropertyID, const StringView& fallback) const;
Color color_or_fallback(CSS::PropertyID, const Document&, Color fallback) const;
- const Font& font() const
+ const Gfx::Font& font() const
{
if (!m_font)
load_font();
@@ -74,5 +76,5 @@ private:
void load_font() const;
- mutable RefPtr<Font> m_font;
+ mutable RefPtr<Gfx::Font> m_font;
};
diff --git a/Libraries/LibHTML/CSS/StyleValue.cpp b/Libraries/LibHTML/CSS/StyleValue.cpp
index c743972755..09d31914ac 100644
--- a/Libraries/LibHTML/CSS/StyleValue.cpp
+++ b/Libraries/LibHTML/CSS/StyleValue.cpp
@@ -68,7 +68,7 @@ ImageStyleValue::ImageStyleValue(const URL& url, Document& document)
ResourceLoader::the().load(url, [this, protector](auto& data) {
if (!m_document)
return;
- m_bitmap = load_png_from_memory(data.data(), data.size());
+ m_bitmap = Gfx::load_png_from_memory(data.data(), data.size());
if (!m_bitmap)
return;
// FIXME: Do less than a full repaint if possible?
diff --git a/Libraries/LibHTML/CSS/StyleValue.h b/Libraries/LibHTML/CSS/StyleValue.h
index ce9573d25b..0ab130ea45 100644
--- a/Libraries/LibHTML/CSS/StyleValue.h
+++ b/Libraries/LibHTML/CSS/StyleValue.h
@@ -213,12 +213,12 @@ public:
String to_string() const override { return String::format("Image{%s}", m_url.to_string().characters()); }
- const GraphicsBitmap* bitmap() const { return m_bitmap; }
+ const Gfx::Bitmap* bitmap() const { return m_bitmap; }
private:
ImageStyleValue(const URL&, Document&);
URL m_url;
WeakPtr<Document> m_document;
- RefPtr<GraphicsBitmap> m_bitmap;
+ RefPtr<Gfx::Bitmap> m_bitmap;
};
diff --git a/Libraries/LibHTML/DOM/Document.cpp b/Libraries/LibHTML/DOM/Document.cpp
index e06d503554..e8fd302261 100644
--- a/Libraries/LibHTML/DOM/Document.cpp
+++ b/Libraries/LibHTML/DOM/Document.cpp
@@ -162,7 +162,7 @@ Color Document::background_color(const Palette& palette) const
return background_color.value()->to_color(*this);
}
-RefPtr<GraphicsBitmap> Document::background_image() const
+RefPtr<Gfx::Bitmap> Document::background_image() const
{
auto* body_element = body();
if (!body_element)
diff --git a/Libraries/LibHTML/DOM/Document.h b/Libraries/LibHTML/DOM/Document.h
index 49bef5168b..ec8e6518b4 100644
--- a/Libraries/LibHTML/DOM/Document.h
+++ b/Libraries/LibHTML/DOM/Document.h
@@ -40,7 +40,10 @@ namespace Core {
class Timer;
}
+namespace Gfx {
class Palette;
+}
+
class Frame;
class HTMLBodyElement;
class HTMLHtmlElement;
@@ -90,8 +93,8 @@ public:
Frame* frame() { return m_frame.ptr(); }
const Frame* frame() const { return m_frame.ptr(); }
- Color background_color(const Palette&) const;
- RefPtr<GraphicsBitmap> background_image() const;
+ Color background_color(const Gfx::Palette&) const;
+ RefPtr<Gfx::Bitmap> background_image() const;
Color link_color() const;
void set_link_color(Color);
diff --git a/Libraries/LibHTML/DOM/HTMLImageElement.cpp b/Libraries/LibHTML/DOM/HTMLImageElement.cpp
index e35e51ea21..482ea5b981 100644
--- a/Libraries/LibHTML/DOM/HTMLImageElement.cpp
+++ b/Libraries/LibHTML/DOM/HTMLImageElement.cpp
@@ -60,7 +60,7 @@ void HTMLImageElement::load_image(const String& src)
}
m_encoded_data = data;
- m_image_decoder = ImageDecoder::create(m_encoded_data.data(), m_encoded_data.size());
+ m_image_decoder = Gfx::ImageDecoder::create(m_encoded_data.data(), m_encoded_data.size());
document().update_layout();
});
}
@@ -100,7 +100,7 @@ RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleProperties* p
return adopt(*new LayoutImage(*this, move(style)));
}
-const GraphicsBitmap* HTMLImageElement::bitmap() const
+const Gfx::Bitmap* HTMLImageElement::bitmap() const
{
if (!m_image_decoder)
return nullptr;
@@ -118,5 +118,5 @@ void HTMLImageElement::set_volatile(Badge<LayoutDocument>, bool v)
bool has_image = m_image_decoder->set_nonvolatile();
if (has_image)
return;
- m_image_decoder = ImageDecoder::create(m_encoded_data.data(), m_encoded_data.size());
+ m_image_decoder = Gfx::ImageDecoder::create(m_encoded_data.data(), m_encoded_data.size());
}
diff --git a/Libraries/LibHTML/DOM/HTMLImageElement.h b/Libraries/LibHTML/DOM/HTMLImageElement.h
index cb1d6a5ead..1d5303db23 100644
--- a/Libraries/LibHTML/DOM/HTMLImageElement.h
+++ b/Libraries/LibHTML/DOM/HTMLImageElement.h
@@ -44,8 +44,8 @@ public:
int preferred_width() const;
int preferred_height() const;
- const GraphicsBitmap* bitmap() const;
- const ImageDecoder* image_decoder() const { return m_image_decoder; }
+ const Gfx::Bitmap* bitmap() const;
+ const Gfx::ImageDecoder* image_decoder() const { return m_image_decoder; }
void set_volatile(Badge<LayoutDocument>, bool);
@@ -54,6 +54,6 @@ private:
virtual RefPtr<LayoutNode> create_layout_node(const StyleProperties* parent_style) const override;
- RefPtr<ImageDecoder> m_image_decoder;
+ RefPtr<Gfx::ImageDecoder> m_image_decoder;
ByteBuffer m_encoded_data;
};
diff --git a/Libraries/LibHTML/DOM/HTMLInputElement.cpp b/Libraries/LibHTML/DOM/HTMLInputElement.cpp
index fa0e3ef4f3..bf0619ec7c 100644
--- a/Libraries/LibHTML/DOM/HTMLInputElement.cpp
+++ b/Libraries/LibHTML/DOM/HTMLInputElement.cpp
@@ -52,7 +52,7 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*)
RefPtr<GUI::Widget> widget;
if (type() == "submit") {
auto button = GUI::Button::construct(value(), &html_view);
- int text_width = Font::default_font().width(value());
+ int text_width = Gfx::Font::default_font().width(value());
button->set_relative_rect(0, 0, text_width + 20, 20);
button->on_click = [this](auto&) {
if (auto* form = first_ancestor_of_type<HTMLFormElement>()) {
@@ -68,7 +68,7 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const StyleProperties*)
auto& widget = to<LayoutWidget>(layout_node())->widget();
const_cast<HTMLInputElement*>(this)->set_attribute("value", static_cast<const GUI::TextBox&>(widget).text());
};
- int text_width = Font::default_font().width(value());
+ int text_width = Gfx::Font::default_font().width(value());
text_box->set_relative_rect(0, 0, text_width + 20, 20);
widget = text_box;
}
diff --git a/Libraries/LibHTML/DOMTreeModel.cpp b/Libraries/LibHTML/DOMTreeModel.cpp
index a6aaac033f..bafb006e73 100644
--- a/Libraries/LibHTML/DOMTreeModel.cpp
+++ b/Libraries/LibHTML/DOMTreeModel.cpp
@@ -35,9 +35,9 @@
DOMTreeModel::DOMTreeModel(Document& document)
: m_document(document)
{
- m_document_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-html.png"));
- m_element_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
- m_text_icon.set_bitmap_for_size(16, GraphicsBitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"));
+ m_document_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"));
+ m_element_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/inspector-object.png"));
+ m_text_icon.set_bitmap_for_size(16, Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png"));
}
DOMTreeModel::~DOMTreeModel()
diff --git a/Libraries/LibHTML/FontCache.cpp b/Libraries/LibHTML/FontCache.cpp
index e29e09f3fa..00afe06e31 100644
--- a/Libraries/LibHTML/FontCache.cpp
+++ b/Libraries/LibHTML/FontCache.cpp
@@ -33,7 +33,7 @@ FontCache& FontCache::the()
return cache;
}
-RefPtr<Font> FontCache::get(const FontSelector& font_selector) const
+RefPtr<Gfx::Font> FontCache::get(const FontSelector& font_selector) const
{
auto cached_font = m_fonts.get(font_selector);
if (cached_font.has_value())
@@ -41,7 +41,7 @@ RefPtr<Font> FontCache::get(const FontSelector& font_selector) const
return nullptr;
}
-void FontCache::set(const FontSelector& font_selector, NonnullRefPtr<Font> font)
+void FontCache::set(const FontSelector& font_selector, NonnullRefPtr<Gfx::Font> font)
{
m_fonts.set(font_selector, move(font));
}
diff --git a/Libraries/LibHTML/FontCache.h b/Libraries/LibHTML/FontCache.h
index 511158e62b..f44afd4b93 100644
--- a/Libraries/LibHTML/FontCache.h
+++ b/Libraries/LibHTML/FontCache.h
@@ -29,7 +29,9 @@
#include <AK/HashMap.h>
#include <AK/String.h>
+namespace Gfx {
class Font;
+}
struct FontSelector {
String family;
@@ -51,10 +53,10 @@ struct Traits<FontSelector> : public GenericTraits<FontSelector> {
class FontCache {
public:
static FontCache& the();
- RefPtr<Font> get(const FontSelector&) const;
- void set(const FontSelector&, NonnullRefPtr<Font>);
+ RefPtr<Gfx::Font> get(const FontSelector&) const;
+ void set(const FontSelector&, NonnullRefPtr<Gfx::Font>);
private:
FontCache() {}
- mutable HashMap<FontSelector, NonnullRefPtr<Font>> m_fonts;
+ mutable HashMap<FontSelector, NonnullRefPtr<Gfx::Font>> m_fonts;
};
diff --git a/Libraries/LibHTML/Frame.cpp b/Libraries/LibHTML/Frame.cpp
index b421519177..235adf2207 100644
--- a/Libraries/LibHTML/Frame.cpp
+++ b/Libraries/LibHTML/Frame.cpp
@@ -52,14 +52,14 @@ void Frame::set_document(Document* document)
m_document->attach_to_frame({}, *this);
}
-void Frame::set_size(const Size& size)
+void Frame::set_size(const Gfx::Size& size)
{
if (m_size == size)
return;
m_size = size;
}
-void Frame::set_viewport_rect(const Rect& rect)
+void Frame::set_viewport_rect(const Gfx::Rect& rect)
{
if (m_viewport_rect == rect)
return;
@@ -69,7 +69,7 @@ void Frame::set_viewport_rect(const Rect& rect)
m_document->layout_node()->did_set_viewport_rect({}, rect);
}
-void Frame::set_needs_display(const Rect& rect)
+void Frame::set_needs_display(const Gfx::Rect& rect)
{
if (!m_viewport_rect.intersects(rect))
return;
diff --git a/Libraries/LibHTML/Frame.h b/Libraries/LibHTML/Frame.h
index 3b7b484874..a99e675737 100644
--- a/Libraries/LibHTML/Frame.h
+++ b/Libraries/LibHTML/Frame.h
@@ -50,13 +50,13 @@ public:
HtmlView* html_view() { return m_html_view; }
const HtmlView* html_view() const { return m_html_view; }
- const Size& size() const { return m_size; }
- void set_size(const Size&);
+ const Gfx::Size& size() const { return m_size; }
+ void set_size(const Gfx::Size&);
- void set_needs_display(const Rect&);
- Function<void(const Rect&)> on_set_needs_display;
+ void set_needs_display(const Gfx::Rect&);
+ Function<void(const Gfx::Rect&)> on_set_needs_display;
- void set_viewport_rect(const Rect&);
+ void set_viewport_rect(const Gfx::Rect&);
Rect viewport_rect() const { return m_viewport_rect; }
private:
@@ -64,6 +64,6 @@ private:
WeakPtr<HtmlView> m_html_view;
RefPtr<Document> m_document;
- Size m_size;
- Rect m_viewport_rect;
+ Gfx::Size m_size;
+ Gfx::Rect m_viewport_rect;
};
diff --git a/Libraries/LibHTML/HtmlView.cpp b/Libraries/LibHTML/HtmlView.cpp
index 86f2377d94..a8dbdf169c 100644
--- a/Libraries/LibHTML/HtmlView.cpp
+++ b/Libraries/LibHTML/HtmlView.cpp
@@ -60,8 +60,8 @@ HtmlView::HtmlView(GUI::Widget* parent)
update(adjusted_rect);
};
- set_frame_shape(FrameShape::Container);
- set_frame_shadow(FrameShadow::Sunken);
+ set_frame_shape(Gfx::FrameShape::Container);
+ set_frame_shadow(Gfx::FrameShadow::Sunken);
set_frame_thickness(2);
set_should_hide_unnecessary_scrollbars(true);
set_background_role(ColorRole::Base);
@@ -297,7 +297,7 @@ static RefPtr<Document> create_image_document(const ByteBuffer& data, const URL&
auto document = adopt(*new Document);
document->set_url(url);
- auto bitmap = load_png_from_memory(data.data(), data.size());
+ auto bitmap = Gfx::load_png_from_memory(data.data(), data.size());
ASSERT(bitmap);
auto html_element = create_element(document, "html");
diff --git a/Libraries/LibHTML/Layout/LayoutBlock.cpp b/Libraries/LibHTML/Layout/LayoutBlock.cpp
index f6d9c23d99..f64034719e 100644
--- a/Libraries/LibHTML/Layout/LayoutBlock.cpp
+++ b/Libraries/LibHTML/Layout/LayoutBlock.cpp
@@ -344,7 +344,7 @@ void LayoutBlock::render(RenderingContext& context)
}
}
-HitTestResult LayoutBlock::hit_test(const Point& position) const
+HitTestResult LayoutBlock::hit_test(const Gfx::Point& position) const
{
if (!children_are_inline())
return LayoutBox::hit_test(position);
diff --git a/Libraries/LibHTML/Layout/LayoutBlock.h b/Libraries/LibHTML/Layout/LayoutBlock.h
index 80a18b716e..5f5d2d769d 100644
--- a/Libraries/LibHTML/Layout/LayoutBlock.h
+++ b/Libraries/LibHTML/Layout/LayoutBlock.h
@@ -49,7 +49,7 @@ public:
LineBox& ensure_last_line_box();
LineBox& add_line_box();
- virtual HitTestResult hit_test(const Point&) const override;
+ virtual HitTestResult hit_test(const Gfx::Point&) const override;
LayoutBlock* previous_sibling() { return to<LayoutBlock>(LayoutNode::previous_sibling()); }
const LayoutBlock* previous_sibling() const { return to<LayoutBlock>(LayoutNode::previous_sibling()); }
diff --git a/Libraries/LibHTML/Layout/LayoutBox.cpp b/Libraries/LibHTML/Layout/LayoutBox.cpp
index b376b86801..4cb3ae5cae 100644
--- a/Libraries/LibHTML/Layout/LayoutBox.cpp
+++ b/Libraries/LibHTML/Layout/LayoutBox.cpp
@@ -207,7 +207,7 @@ void LayoutBox::render(RenderingContext& context)
LayoutNodeWithStyleAndBoxModelMetrics::render(context);
}
-HitTestResult LayoutBox::hit_test(const Point& position) const
+HitTestResult LayoutBox::hit_test(const Gfx::Point& position) const
{
// FIXME: It would be nice if we could confidently skip over hit testing
// parts of the layout tree, but currently we can't just check
diff --git a/Libraries/LibHTML/Layout/LayoutBox.h b/Libraries/LibHTML/Layout/LayoutBox.h
index d212926ea5..6fcd2a5f44 100644
--- a/Libraries/LibHTML/Layout/LayoutBox.h
+++ b/Libraries/LibHTML/Layout/LayoutBox.h
@@ -42,7 +42,7 @@ public:
FloatSize size() const { return rect().size(); }
FloatPoint position() const { return rect().location(); }
- virtual HitTestResult hit_test(const Point& position) const override;
+ virtual HitTestResult hit_test(const Gfx::Point& position) const override;
virtual void set_needs_display() override;
bool is_body() const;
diff --git a/Libraries/LibHTML/Layout/LayoutDocument.cpp b/Libraries/LibHTML/Layout/LayoutDocument.cpp
index 9924df3e78..60f4293c6d 100644
--- a/Libraries/LibHTML/Layout/LayoutDocument.cpp
+++ b/Libraries/LibHTML/Layout/LayoutDocument.cpp
@@ -57,7 +57,7 @@ void LayoutDocument::layout()
rect().set_bottom(lowest_bottom);
}
-void LayoutDocument::did_set_viewport_rect(Badge<Frame>, const Rect& a_viewport_rect)
+void LayoutDocument::did_set_viewport_rect(Badge<Frame>, const Gfx::Rect& a_viewport_rect)
{
FloatRect viewport_rect(a_viewport_rect.x(), a_viewport_rect.y(), a_viewport_rect.width(), a_viewport_rect.height());
for_each_in_subtree_of_type<LayoutImage>([&](auto& layout_image) {
diff --git a/Libraries/LibHTML/Layout/LayoutDocument.h b/Libraries/LibHTML/Layout/LayoutDocument.h
index 123c32902f..7cd59b68b1 100644
--- a/Libraries/LibHTML/Layout/LayoutDocument.h
+++ b/Libraries/LibHTML/Layout/LayoutDocument.h
@@ -41,7 +41,7 @@ public:
const LayoutRange& selection() const { return m_selection; }
LayoutRange& selection() { return m_selection; }
- void did_set_viewport_rect(Badge<Frame>, const Rect&);
+ void did_set_viewport_rect(Badge<Frame>, const Gfx::Rect&);
private:
LayoutRange m_selection;
diff --git a/Libraries/LibHTML/Layout/LayoutImage.cpp b/Libraries/LibHTML/Layout/LayoutImage.cpp
index a10e2859e6..c77a412dfa 100644
--- a/Libraries/LibHTML/Layout/LayoutImage.cpp
+++ b/Libraries/LibHTML/Layout/LayoutImage.cpp
@@ -44,7 +44,7 @@ void LayoutImage::layout()
rect().set_width(node().preferred_width());
rect().set_height(node().preferred_height());
} else if (renders_as_alt_text()) {
- auto& font = Font::default_font();
+ auto& font = Gfx::Font::default_font();
auto alt = node().alt();
if (alt.is_empty())
alt = node().src();
@@ -68,12 +68,12 @@ void LayoutImage::render(RenderingContext& context)
return;
if (renders_as_alt_text()) {
- context.painter().set_font(Font::default_font());
- StylePainter::paint_frame(context.painter(), enclosing_int_rect(rect()), context.palette(), FrameShape::Container, FrameShadow::Sunken, 2);
+ context.painter().set_font(Gfx::Font::default_font());
+ Gfx::StylePainter::paint_frame(context.painter(), enclosing_int_rect(rect()), context.palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2);
auto alt = node().alt();
if (alt.is_empty())
alt = node().src();
- context.painter().draw_text(enclosing_int_rect(rect()), alt, TextAlignment::Center, style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black), TextElision::Right);
+ context.painter().draw_text(enclosing_int_rect(rect()), alt, Gfx::TextAlignment::Center, style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black), Gfx::TextElision::Right);
} else if (node().bitmap())
context.painter().draw_scaled_bitmap(enclosing_int_rect(rect()), *node().bitmap(), node().bitmap()->rect());
LayoutReplaced::render(context);
diff --git a/Libraries/LibHTML/Layout/LayoutNode.cpp b/Libraries/LibHTML/Layout/LayoutNode.cpp
index 857cf4a8e6..59207164fc 100644
--- a/Libraries/LibHTML/Layout/LayoutNode.cpp
+++ b/Libraries/LibHTML/Layout/LayoutNode.cpp
@@ -71,7 +71,7 @@ void LayoutNode::render(RenderingContext& context)
});
}
-HitTestResult LayoutNode::hit_test(const Point& position) const
+HitTestResult LayoutNode::hit_test(const Gfx::Point& position) const
{
HitTestResult result;
for_each_child([&](auto& child) {
diff --git a/Libraries/LibHTML/Layout/LayoutNode.h b/Libraries/LibHTML/Layout/LayoutNode.h
index e7fcf54873..e1e2470016 100644
--- a/Libraries/LibHTML/Layout/LayoutNode.h
+++ b/Libraries/LibHTML/Layout/LayoutNode.h
@@ -54,7 +54,7 @@ class LayoutNode : public TreeNode<LayoutNode> {
public:
virtual ~LayoutNode();
- virtual HitTestResult hit_test(const Point&) const;
+ virtual HitTestResult hit_test(const Gfx::Point&) const;
bool is_anonymous() const { return !m_node; }
const Node* node() const { return m_node; }
diff --git a/Libraries/LibHTML/Layout/LayoutText.cpp b/Libraries/LibHTML/Layout/LayoutText.cpp
index 1b1cccb55c..7e92654261 100644
--- a/Libraries/LibHTML/Layout/LayoutText.cpp
+++ b/Libraries/LibHTML/Layout/LayoutText.cpp
@@ -82,7 +82,7 @@ void LayoutText::render_fragment(RenderingContext& context, const LineBoxFragmen
if (is_underline)
painter.draw_line(enclosing_int_rect(fragment.rect()).bottom_left().translated(0, 1), enclosing_int_rect(fragment.rect()).bottom_right().translated(0, 1), color);
- painter.draw_text(enclosing_int_rect(fragment.rect()), m_text_for_rendering.substring_view(fragment.start(), fragment.length()), TextAlignment::TopLeft, color);
+ painter.draw_text(enclosing_int_rect(fragment.rect()), m_text_for_rendering.substring_view(fragment.start(), fragment.length()), Gfx::TextAlignment::TopLeft, color);
}
template<typename Callback>
diff --git a/Libraries/LibHTML/RenderingContext.h b/Libraries/LibHTML/RenderingContext.h
index 67df337180..78df84335d 100644
--- a/Libraries/LibHTML/RenderingContext.h
+++ b/Libraries/LibHTML/RenderingContext.h
@@ -48,11 +48,11 @@ public:
void set_should_show_line_box_borders(bool value) { m_should_show_line_box_borders = value; }
Rect viewport_rect() const { return m_viewport_rect; }
- void set_viewport_rect(const Rect& rect) { m_viewport_rect = rect; }
+ void set_viewport_rect(const Gfx::Rect& rect) { m_viewport_rect = rect; }
private:
GUI::Painter& m_painter;
Palette m_palette;
- Rect m_viewport_rect;
+ Gfx::Rect m_viewport_rect;
bool m_should_show_line_box_borders { false };
};