mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:07:35 +00:00
LibWeb: Rename DOM::Element::parse_attribute() => attribute_changed()
This is a first step towards merging attribute change and removal notifications into a single function.
This commit is contained in:
parent
e1e04884b9
commit
5a74486b59
65 changed files with 99 additions and 99 deletions
|
@ -24,9 +24,9 @@ JS::ThrowCompletionOr<void> SVGCircleElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGCircleElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGCircleElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::cx) {
|
||||
m_center_x = AttributeParser::parse_coordinate(value);
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGCircleElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGCircleElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ void SVGElement::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_dataset);
|
||||
}
|
||||
|
||||
void SVGElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
Base::parse_attribute(name, value);
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
update_use_elements_that_reference_this();
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGElement : public DOM::Element {
|
|||
public:
|
||||
virtual bool requires_svg_container() const override { return true; }
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual void children_changed() override;
|
||||
virtual void inserted() override;
|
||||
|
|
|
@ -24,9 +24,9 @@ JS::ThrowCompletionOr<void> SVGEllipseElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGEllipseElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGEllipseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::cx) {
|
||||
m_center_x = AttributeParser::parse_coordinate(value);
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGEllipseElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGEllipseElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ SVGGradientElement::SVGGradientElement(DOM::Document& document, DOM::QualifiedNa
|
|||
{
|
||||
}
|
||||
|
||||
void SVGGradientElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::parse_attribute(name, value);
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == AttributeNames::gradientUnits) {
|
||||
m_gradient_units = AttributeParser::parse_gradient_units(value);
|
||||
} else if (name == AttributeNames::gradientTransform) {
|
||||
|
|
|
@ -26,7 +26,7 @@ class SVGGradientElement : public SVGElement {
|
|||
public:
|
||||
virtual ~SVGGradientElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const = 0;
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ JS::ThrowCompletionOr<void> SVGGraphicsElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGGraphicsElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGGraphicsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::parse_attribute(name, value);
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == "transform"sv) {
|
||||
auto transform_list = AttributeParser::parse_transform(value);
|
||||
if (transform_list.has_value())
|
||||
|
|
|
@ -24,7 +24,7 @@ class SVGGraphicsElement : public SVGElement {
|
|||
public:
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
Optional<Gfx::Color> fill_color() const;
|
||||
Optional<FillRule> fill_rule() const;
|
||||
|
|
|
@ -24,9 +24,9 @@ JS::ThrowCompletionOr<void> SVGLineElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGLineElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGLineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::x1) {
|
||||
m_x1 = AttributeParser::parse_coordinate(value);
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGLineElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGLineElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ JS::ThrowCompletionOr<void> SVGLinearGradientElement::initialize(JS::Realm& real
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGLinearGradientElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGLinearGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGradientElement::parse_attribute(name, value);
|
||||
SVGGradientElement::attribute_changed(name, value);
|
||||
|
||||
// FIXME: Should allow for `<number-percentage> | <length>` for x1, x2, y1, y2
|
||||
if (name == SVG::AttributeNames::x1) {
|
||||
|
|
|
@ -18,7 +18,7 @@ class SVGLinearGradientElement : public SVGGradientElement {
|
|||
public:
|
||||
virtual ~SVGLinearGradientElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;
|
||||
|
||||
|
|
|
@ -97,9 +97,9 @@ JS::ThrowCompletionOr<void> SVGPathElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGPathElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPathElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == "d") {
|
||||
m_instructions = AttributeParser::parse_path_data(value);
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGPathElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPathElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ JS::ThrowCompletionOr<void> SVGPolygonElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGPolygonElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPolygonElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::points) {
|
||||
m_points = AttributeParser::parse_points(value);
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGPolygonElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPolygonElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ JS::ThrowCompletionOr<void> SVGPolylineElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGPolylineElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGPolylineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::points) {
|
||||
m_points = AttributeParser::parse_points(value);
|
||||
|
|
|
@ -16,7 +16,7 @@ class SVGPolylineElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGPolylineElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ JS::ThrowCompletionOr<void> SVGRadialGradientElement::initialize(JS::Realm& real
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGRadialGradientElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGRadialGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGradientElement::parse_attribute(name, value);
|
||||
SVGGradientElement::attribute_changed(name, value);
|
||||
|
||||
// FIXME: These are <length> or <coordinate> in the spec, but all examples seem to allow percentages
|
||||
// and unitless values.
|
||||
|
|
|
@ -18,7 +18,7 @@ class SVGRadialGradientElement : public SVGGradientElement {
|
|||
public:
|
||||
virtual ~SVGRadialGradientElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ JS::ThrowCompletionOr<void> SVGRectElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGRectElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGRectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGeometryElement::parse_attribute(name, value);
|
||||
SVGGeometryElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::x) {
|
||||
m_x = AttributeParser::parse_coordinate(value);
|
||||
|
|
|
@ -17,7 +17,7 @@ class SVGRectElement final : public SVGGeometryElement {
|
|||
public:
|
||||
virtual ~SVGRectElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual Gfx::Path& get_path() override;
|
||||
|
||||
|
|
|
@ -70,9 +70,9 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons
|
|||
}
|
||||
}
|
||||
|
||||
void SVGSVGElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGSVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGraphicsElement::parse_attribute(name, value);
|
||||
SVGGraphicsElement::attribute_changed(name, value);
|
||||
|
||||
if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox))
|
||||
m_view_box = try_parse_view_box(value);
|
||||
|
|
|
@ -36,7 +36,7 @@ private:
|
|||
|
||||
virtual bool is_svg_svg_element() const override { return true; }
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
void update_fallback_view_box_for_svg_as_image();
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ SVGStopElement::SVGStopElement(DOM::Document& document, DOM::QualifiedName quali
|
|||
{
|
||||
}
|
||||
|
||||
void SVGStopElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGStopElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGElement::parse_attribute(name, value);
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == SVG::AttributeNames::offset) {
|
||||
m_offset = AttributeParser::parse_number_percentage(value);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGStopElement final : public SVGElement {
|
|||
public:
|
||||
virtual ~SVGStopElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
JS::NonnullGCPtr<SVGAnimatedNumber> offset() const;
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ JS::ThrowCompletionOr<void> SVGTextContentElement::initialize(JS::Realm& realm)
|
|||
return {};
|
||||
}
|
||||
|
||||
void SVGTextContentElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGTextContentElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
SVGGraphicsElement::parse_attribute(name, value);
|
||||
SVGGraphicsElement::attribute_changed(name, value);
|
||||
|
||||
if (name == SVG::AttributeNames::x) {
|
||||
m_x = AttributeParser::parse_coordinate(value).value_or(m_x);
|
||||
|
|
|
@ -18,7 +18,7 @@ class SVGTextContentElement : public SVGGraphicsElement {
|
|||
public:
|
||||
virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
WebIDL::ExceptionOr<int> get_number_of_chars() const;
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ void SVGUseElement::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_document_observer);
|
||||
}
|
||||
|
||||
void SVGUseElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
void SVGUseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
Base::parse_attribute(name, value);
|
||||
Base::attribute_changed(name, value);
|
||||
|
||||
// https://svgwg.org/svg2-draft/struct.html#UseLayout
|
||||
if (name == SVG::AttributeNames::x) {
|
||||
|
@ -87,7 +87,7 @@ void SVGUseElement::svg_element_changed(SVGElement& svg_element)
|
|||
return;
|
||||
}
|
||||
|
||||
// NOTE: We need to check the ancestor because parse_attribute of a child doesn't call children_changed on the parent(s)
|
||||
// NOTE: We need to check the ancestor because attribute_changed of a child doesn't call children_changed on the parent(s)
|
||||
if (to_clone == &svg_element || to_clone->is_ancestor_of(svg_element)) {
|
||||
clone_element_tree_as_our_shadow_tree(to_clone);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ class SVGUseElement final : public SVGGraphicsElement {
|
|||
public:
|
||||
virtual ~SVGUseElement() override = default;
|
||||
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual void inserted() override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue