mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:47:35 +00:00
LibWeb: Port AttributeNames to FlyString
This commit is contained in:
parent
6a3f27509f
commit
e4f8c59210
93 changed files with 148 additions and 149 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::SVG::AttributeNames {
|
||||
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) DeprecatedFlyString name;
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) FlyString name;
|
||||
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
|
||||
#undef __ENUMERATE_SVG_ATTRIBUTE
|
||||
|
||||
|
@ -18,7 +18,7 @@ void initialize_strings()
|
|||
VERIFY(!s_initialized);
|
||||
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) \
|
||||
name = #name;
|
||||
name = #name##_fly_string;
|
||||
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
|
||||
#undef __ENUMERATE_SVG_ATTRIBUTE
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/FlyString.h>
|
||||
|
||||
namespace Web::SVG::AttributeNames {
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace Web::SVG::AttributeNames {
|
|||
E(yChannelSelector) \
|
||||
E(zoomAndPan)
|
||||
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) extern DeprecatedFlyString name;
|
||||
#define __ENUMERATE_SVG_ATTRIBUTE(name) extern FlyString name;
|
||||
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
|
||||
#undef __ENUMERATE_SVG_ATTRIBUTE
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ void SVGCircleElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGCircleElementPrototype>(realm, "SVGCircleElement"));
|
||||
}
|
||||
|
||||
void SVGCircleElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGCircleElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGCircleElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGCircleElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ void SVGElement::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_dataset);
|
||||
}
|
||||
|
||||
void SVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGElement : public DOM::Element {
|
|||
public:
|
||||
virtual bool requires_svg_container() const override { return true; }
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual void children_changed() override;
|
||||
virtual void inserted() override;
|
||||
|
|
|
@ -22,7 +22,7 @@ void SVGEllipseElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGEllipseElementPrototype>(realm, "SVGEllipseElement"));
|
||||
}
|
||||
|
||||
void SVGEllipseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGEllipseElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGEllipseElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGEllipseElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ SVGGradientElement::SVGGradientElement(DOM::Document& document, DOM::QualifiedNa
|
|||
{
|
||||
}
|
||||
|
||||
void SVGGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == AttributeNames::gradientUnits) {
|
||||
|
|
|
@ -40,7 +40,7 @@ class SVGGradientElement : public SVGElement {
|
|||
public:
|
||||
virtual ~SVGGradientElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const = 0;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ void SVGGraphicsElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGraphicsElementPrototype>(realm, "SVGGraphicsElement"));
|
||||
}
|
||||
|
||||
void SVGGraphicsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGGraphicsElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == "transform"sv) {
|
||||
|
|
|
@ -25,7 +25,7 @@ class SVGGraphicsElement : public SVGElement {
|
|||
public:
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
Optional<Gfx::Color> fill_color() const;
|
||||
Optional<FillRule> fill_rule() const;
|
||||
|
|
|
@ -22,7 +22,7 @@ void SVGLineElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLineElementPrototype>(realm, "SVGLineElement"));
|
||||
}
|
||||
|
||||
void SVGLineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGLineElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGLineElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGLineElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ void SVGLinearGradientElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLinearGradientElementPrototype>(realm, "SVGLinearGradientElement"));
|
||||
}
|
||||
|
||||
void SVGLinearGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGLinearGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGradientElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class SVGLinearGradientElement : public SVGGradientElement {
|
|||
public:
|
||||
virtual ~SVGLinearGradientElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ JS::GCPtr<Layout::Node> SVGMaskElement::create_layout_node(NonnullRefPtr<CSS::St
|
|||
return heap().allocate_without_realm<Layout::SVGGraphicsBox>(document(), *this, move(style));
|
||||
}
|
||||
|
||||
void SVGMaskElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGMaskElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGraphicsElement::attribute_changed(name, value);
|
||||
if (name == AttributeNames::maskUnits) {
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGMaskElement final : public SVGGraphicsElement {
|
|||
public:
|
||||
virtual ~SVGMaskElement() override;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ void SVGPathElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPathElementPrototype>(realm, "SVGPathElement"));
|
||||
}
|
||||
|
||||
void SVGPathElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPathElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGPathElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPathElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ void SVGPolygonElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolygonElementPrototype>(realm, "SVGPolygonElement"));
|
||||
}
|
||||
|
||||
void SVGPolygonElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPolygonElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGPolygonElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPolygonElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ void SVGPolylineElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolylineElementPrototype>(realm, "SVGPolylineElement"));
|
||||
}
|
||||
|
||||
void SVGPolylineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPolylineElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGPolylineElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPolylineElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ void SVGRadialGradientElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRadialGradientElementPrototype>(realm, "SVGRadialGradientElement"));
|
||||
}
|
||||
|
||||
void SVGRadialGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGRadialGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGradientElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class SVGRadialGradientElement : public SVGGradientElement {
|
|||
public:
|
||||
virtual ~SVGRadialGradientElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ void SVGRectElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRectElementPrototype>(realm, "SVGRectElement"));
|
||||
}
|
||||
|
||||
void SVGRectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGRectElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGRectElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGRectElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons
|
|||
}
|
||||
}
|
||||
|
||||
void SVGSVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGSVGElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGraphicsElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
|
||||
virtual bool is_svg_svg_element() const override { return true; }
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
void update_fallback_view_box_for_svg_as_image();
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ SVGStopElement::SVGStopElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
void SVGStopElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGStopElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == SVG::AttributeNames::offset) {
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGStopElement final : public SVGElement {
|
|||
public:
|
||||
virtual ~SVGStopElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedNumber> offset() const;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ void SVGSymbolElement::apply_presentational_hints(CSS::StyleProperties& style) c
|
|||
}
|
||||
}
|
||||
|
||||
void SVGSymbolElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGSymbolElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox))
|
||||
m_view_box = try_parse_view_box(value);
|
||||
|
|
|
@ -29,7 +29,7 @@ private:
|
|||
|
||||
bool is_direct_child_of_use_shadow_tree() const;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
Optional<ViewBox> m_view_box;
|
||||
};
|
||||
|
|
|
@ -28,7 +28,7 @@ void SVGTextPositioningElement::initialize(JS::Realm& realm)
|
|||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextPositioningElementPrototype>(realm, "SVGTextPositioningElement"));
|
||||
}
|
||||
|
||||
void SVGTextPositioningElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGTextPositioningElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGraphicsElement::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGTextPositioningElement : public SVGTextContentElement {
|
|||
WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement);
|
||||
|
||||
public:
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
Gfx::FloatPoint get_offset() const;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ void SVGUseElement::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_document_observer);
|
||||
}
|
||||
|
||||
void SVGUseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGUseElement::attribute_changed(FlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGUseElement final : public SVGGraphicsElement {
|
|||
public:
|
||||
virtual ~SVGUseElement() override = default;
|
||||
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual void inserted() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue