mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 11:15:08 +00:00
LibWeb: Rename SVGPathBox -> SVGGeometryBox
This fits better since it's now used by all SVGGeometryElements.
This commit is contained in:
parent
326a5a82eb
commit
784c3183f7
7 changed files with 18 additions and 18 deletions
|
@ -235,8 +235,8 @@ set(SOURCES
|
||||||
Layout/ReplacedBox.cpp
|
Layout/ReplacedBox.cpp
|
||||||
Layout/SVGBox.cpp
|
Layout/SVGBox.cpp
|
||||||
Layout/SVGFormattingContext.cpp
|
Layout/SVGFormattingContext.cpp
|
||||||
|
Layout/SVGGeometryBox.cpp
|
||||||
Layout/SVGGraphicsBox.cpp
|
Layout/SVGGraphicsBox.cpp
|
||||||
Layout/SVGPathBox.cpp
|
|
||||||
Layout/SVGSVGBox.cpp
|
Layout/SVGSVGBox.cpp
|
||||||
Layout/TableBox.cpp
|
Layout/TableBox.cpp
|
||||||
Layout/TableCellBox.cpp
|
Layout/TableCellBox.cpp
|
||||||
|
|
|
@ -103,7 +103,7 @@ public:
|
||||||
virtual bool is_text_node() const { return false; }
|
virtual bool is_text_node() const { return false; }
|
||||||
virtual bool is_initial_containing_block_box() const { return false; }
|
virtual bool is_initial_containing_block_box() const { return false; }
|
||||||
virtual bool is_svg_box() const { return false; }
|
virtual bool is_svg_box() const { return false; }
|
||||||
virtual bool is_svg_path_box() const { return false; }
|
virtual bool is_svg_geometry_box() const { return false; }
|
||||||
virtual bool is_label() const { return false; }
|
virtual bool is_label() const { return false; }
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <AK/Format.h>
|
#include <AK/Format.h>
|
||||||
#include <LibWeb/Layout/SVGFormattingContext.h>
|
#include <LibWeb/Layout/SVGFormattingContext.h>
|
||||||
#include <LibWeb/Layout/SVGPathBox.h>
|
#include <LibWeb/Layout/SVGGeometryBox.h>
|
||||||
#include <LibWeb/Layout/SVGSVGBox.h>
|
#include <LibWeb/Layout/SVGSVGBox.h>
|
||||||
|
|
||||||
namespace Web::Layout {
|
namespace Web::Layout {
|
||||||
|
@ -29,10 +29,10 @@ void SVGFormattingContext::run(Box& box, LayoutMode)
|
||||||
Gfx::FloatRect total_bounding_box;
|
Gfx::FloatRect total_bounding_box;
|
||||||
|
|
||||||
box.for_each_in_subtree_of_type<SVGBox>([&](auto& descendant) {
|
box.for_each_in_subtree_of_type<SVGBox>([&](auto& descendant) {
|
||||||
if (is<SVGPathBox>(descendant)) {
|
if (is<SVGGeometryBox>(descendant)) {
|
||||||
auto& path_box = static_cast<SVGPathBox&>(descendant);
|
auto& geometry_box = static_cast<SVGGeometryBox&>(descendant);
|
||||||
auto& path = path_box.dom_node().get_path();
|
auto& path = geometry_box.dom_node().get_path();
|
||||||
path_box.set_content_size(path.bounding_box().size());
|
geometry_box.set_content_size(path.bounding_box().size());
|
||||||
|
|
||||||
total_bounding_box = total_bounding_box.united(path.bounding_box());
|
total_bounding_box = total_bounding_box.united(path.bounding_box());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,17 +6,17 @@
|
||||||
|
|
||||||
#include <LibGfx/AntiAliasingPainter.h>
|
#include <LibGfx/AntiAliasingPainter.h>
|
||||||
#include <LibGfx/Painter.h>
|
#include <LibGfx/Painter.h>
|
||||||
#include <LibWeb/Layout/SVGPathBox.h>
|
#include <LibWeb/Layout/SVGGeometryBox.h>
|
||||||
#include <LibWeb/SVG/SVGPathElement.h>
|
#include <LibWeb/SVG/SVGPathElement.h>
|
||||||
|
|
||||||
namespace Web::Layout {
|
namespace Web::Layout {
|
||||||
|
|
||||||
SVGPathBox::SVGPathBox(DOM::Document& document, SVG::SVGGeometryElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
SVGGeometryBox::SVGGeometryBox(DOM::Document& document, SVG::SVGGeometryElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||||
: SVGGraphicsBox(document, element, properties)
|
: SVGGraphicsBox(document, element, properties)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void SVGPathBox::paint(PaintContext& context, PaintPhase phase)
|
void SVGGeometryBox::paint(PaintContext& context, PaintPhase phase)
|
||||||
{
|
{
|
||||||
if (!is_visible())
|
if (!is_visible())
|
||||||
return;
|
return;
|
|
@ -11,10 +11,10 @@
|
||||||
|
|
||||||
namespace Web::Layout {
|
namespace Web::Layout {
|
||||||
|
|
||||||
class SVGPathBox final : public SVGGraphicsBox {
|
class SVGGeometryBox final : public SVGGraphicsBox {
|
||||||
public:
|
public:
|
||||||
SVGPathBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
|
SVGGeometryBox(DOM::Document&, SVG::SVGGeometryElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||||
virtual ~SVGPathBox() override = default;
|
virtual ~SVGGeometryBox() override = default;
|
||||||
|
|
||||||
SVG::SVGGeometryElement& dom_node() { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
SVG::SVGGeometryElement& dom_node() { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
||||||
SVG::SVGGeometryElement const& dom_node() const { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
SVG::SVGGeometryElement const& dom_node() const { return verify_cast<SVG::SVGGeometryElement>(SVGGraphicsBox::dom_node()); }
|
||||||
|
@ -22,10 +22,10 @@ public:
|
||||||
virtual void paint(PaintContext& context, PaintPhase phase) override;
|
virtual void paint(PaintContext& context, PaintPhase phase) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool is_svg_path_box() const final { return true; }
|
virtual bool is_svg_geometry_box() const final { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline bool Node::fast_is<SVGPathBox>() const { return is_svg_path_box(); }
|
inline bool Node::fast_is<SVGGeometryBox>() const { return is_svg_geometry_box(); }
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibWeb/Layout/SVGPathBox.h>
|
#include <LibWeb/Layout/SVGGeometryBox.h>
|
||||||
#include <LibWeb/SVG/SVGGeometryElement.h>
|
#include <LibWeb/SVG/SVGGeometryElement.h>
|
||||||
|
|
||||||
namespace Web::SVG {
|
namespace Web::SVG {
|
||||||
|
@ -16,7 +16,7 @@ SVGGeometryElement::SVGGeometryElement(DOM::Document& document, QualifiedName qu
|
||||||
|
|
||||||
RefPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
RefPtr<Layout::Node> SVGGeometryElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
|
||||||
{
|
{
|
||||||
return adopt_ref(*new Layout::SVGPathBox(document(), *this, move(style)));
|
return adopt_ref(*new Layout::SVGGeometryBox(document(), *this, move(style)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include <LibGfx/Path.h>
|
#include <LibGfx/Path.h>
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/DOM/Event.h>
|
#include <LibWeb/DOM/Event.h>
|
||||||
#include <LibWeb/Layout/SVGPathBox.h>
|
#include <LibWeb/Layout/SVGGeometryBox.h>
|
||||||
#include <LibWeb/SVG/SVGPathElement.h>
|
#include <LibWeb/SVG/SVGPathElement.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue