diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-28 18:20:36 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-28 18:55:48 +0200 |
commit | c46439f24063a5531f1f7562cf6d733cdbabdb51 (patch) | |
tree | 859ce620cbb59fd0d18700a524631dcbe6dd9eea /Libraries/LibWeb/Layout | |
parent | ebd2e7d9f569d284effeeb53a5589318391617b8 (diff) | |
download | serenity-c46439f24063a5531f1f7562cf6d733cdbabdb51.zip |
LibWeb: Move HTML classes into the Web::HTML namespace
Diffstat (limited to 'Libraries/LibWeb/Layout')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutBreak.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutBreak.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutCanvas.cpp | 2 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutCanvas.h | 7 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutFrame.h | 4 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutImage.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutImage.h | 2 |
7 files changed, 11 insertions, 16 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBreak.cpp b/Libraries/LibWeb/Layout/LayoutBreak.cpp index 7149c189af..6f4a57d2c9 100644 --- a/Libraries/LibWeb/Layout/LayoutBreak.cpp +++ b/Libraries/LibWeb/Layout/LayoutBreak.cpp @@ -29,7 +29,7 @@ namespace Web { -LayoutBreak::LayoutBreak(DOM::Document& document, const HTMLBRElement& element) +LayoutBreak::LayoutBreak(DOM::Document& document, const HTML::HTMLBRElement& element) : LayoutNodeWithStyleAndBoxModelMetrics(document, &element, CSS::StyleProperties::create()) { set_inline(true); diff --git a/Libraries/LibWeb/Layout/LayoutBreak.h b/Libraries/LibWeb/Layout/LayoutBreak.h index 61a5a7ec9c..e54115cd8b 100644 --- a/Libraries/LibWeb/Layout/LayoutBreak.h +++ b/Libraries/LibWeb/Layout/LayoutBreak.h @@ -33,10 +33,10 @@ namespace Web { class LayoutBreak final : public LayoutNodeWithStyleAndBoxModelMetrics { public: - LayoutBreak(DOM::Document&, const HTMLBRElement&); + LayoutBreak(DOM::Document&, const HTML::HTMLBRElement&); virtual ~LayoutBreak() override; - const HTMLBRElement& node() const { return downcast<HTMLBRElement>(*LayoutNode::node()); } + const HTML::HTMLBRElement& node() const { return downcast<HTML::HTMLBRElement>(*LayoutNode::node()); } private: virtual bool is_break() const override { return true; } diff --git a/Libraries/LibWeb/Layout/LayoutCanvas.cpp b/Libraries/LibWeb/Layout/LayoutCanvas.cpp index a778af20c0..3f864be0cd 100644 --- a/Libraries/LibWeb/Layout/LayoutCanvas.cpp +++ b/Libraries/LibWeb/Layout/LayoutCanvas.cpp @@ -31,7 +31,7 @@ namespace Web { -LayoutCanvas::LayoutCanvas(DOM::Document& document, const HTMLCanvasElement& element, NonnullRefPtr<CSS::StyleProperties> style) +LayoutCanvas::LayoutCanvas(DOM::Document& document, const HTML::HTMLCanvasElement& element, NonnullRefPtr<CSS::StyleProperties> style) : LayoutReplaced(document, element, move(style)) { } diff --git a/Libraries/LibWeb/Layout/LayoutCanvas.h b/Libraries/LibWeb/Layout/LayoutCanvas.h index 4e248eb993..db25e1cc27 100644 --- a/Libraries/LibWeb/Layout/LayoutCanvas.h +++ b/Libraries/LibWeb/Layout/LayoutCanvas.h @@ -31,24 +31,21 @@ namespace Web { -class HTMLCanvasElement; - class LayoutCanvas : public LayoutReplaced { public: - LayoutCanvas(DOM::Document&, const HTMLCanvasElement&, NonnullRefPtr<CSS::StyleProperties>); + LayoutCanvas(DOM::Document&, const HTML::HTMLCanvasElement&, NonnullRefPtr<CSS::StyleProperties>); virtual ~LayoutCanvas() override; virtual void layout(LayoutMode = LayoutMode::Default) override; virtual void paint(PaintContext&, PaintPhase) override; - const HTMLCanvasElement& node() const { return static_cast<const HTMLCanvasElement&>(LayoutReplaced::node()); } + const HTML::HTMLCanvasElement& node() const { return static_cast<const HTML::HTMLCanvasElement&>(LayoutReplaced::node()); } private: virtual const char* class_name() const override { return "LayoutCanvas"; } virtual bool is_canvas() const override { return true; } }; - } AK_BEGIN_TYPE_TRAITS(Web::LayoutCanvas) diff --git a/Libraries/LibWeb/Layout/LayoutFrame.h b/Libraries/LibWeb/Layout/LayoutFrame.h index cd7694d6e1..3679c026c6 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.h +++ b/Libraries/LibWeb/Layout/LayoutFrame.h @@ -39,8 +39,8 @@ public: virtual void paint(PaintContext&, PaintPhase) override; virtual void layout(LayoutMode) override; - const HTMLIFrameElement& node() const { return static_cast<const HTMLIFrameElement&>(LayoutReplaced::node()); } - HTMLIFrameElement& node() { return static_cast<HTMLIFrameElement&>(LayoutReplaced::node()); } + const HTML::HTMLIFrameElement& node() const { return downcast<HTML::HTMLIFrameElement>(LayoutReplaced::node()); } + HTML::HTMLIFrameElement& node() { return downcast<HTML::HTMLIFrameElement>(LayoutReplaced::node()); } private: virtual bool is_frame() const final { return true; } diff --git a/Libraries/LibWeb/Layout/LayoutImage.cpp b/Libraries/LibWeb/Layout/LayoutImage.cpp index 92a37a5a00..d4d658d9cf 100644 --- a/Libraries/LibWeb/Layout/LayoutImage.cpp +++ b/Libraries/LibWeb/Layout/LayoutImage.cpp @@ -71,7 +71,7 @@ void LayoutImage::layout(LayoutMode layout_mode) } if (renders_as_alt_text()) { - auto& image_element = downcast<HTMLImageElement>(node()); + auto& image_element = downcast<HTML::HTMLImageElement>(node()); auto& font = Gfx::Font::default_font(); auto alt = image_element.alt(); if (alt.is_empty()) @@ -101,7 +101,7 @@ void LayoutImage::paint(PaintContext& context, PaintPhase phase) if (phase == PaintPhase::Foreground) { if (renders_as_alt_text()) { - auto& image_element = downcast<HTMLImageElement>(node()); + auto& image_element = downcast<HTML::HTMLImageElement>(node()); context.painter().set_font(Gfx::Font::default_font()); Gfx::StylePainter::paint_frame(context.painter(), enclosing_int_rect(absolute_rect()), context.palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2); auto alt = image_element.alt(); @@ -116,7 +116,7 @@ void LayoutImage::paint(PaintContext& context, PaintPhase phase) bool LayoutImage::renders_as_alt_text() const { - if (is<HTMLImageElement>(node())) + if (is<HTML::HTMLImageElement>(node())) return !m_image_loader.has_image(); return false; } diff --git a/Libraries/LibWeb/Layout/LayoutImage.h b/Libraries/LibWeb/Layout/LayoutImage.h index b2001a26b1..d953f257c8 100644 --- a/Libraries/LibWeb/Layout/LayoutImage.h +++ b/Libraries/LibWeb/Layout/LayoutImage.h @@ -31,8 +31,6 @@ namespace Web { -class HTMLImageElement; - class LayoutImage : public LayoutReplaced { public: LayoutImage(DOM::Document&, const DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, const ImageLoader&); |