2023-07-05 20:24:51 -05:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Jonah Shafran <jonahshafran@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/ExceptionOrUtils.h>
|
2024-04-27 12:09:58 +12:00
|
|
|
#include <LibWeb/Bindings/MathMLElementPrototype.h>
|
2023-07-05 20:24:51 -05:00
|
|
|
#include <LibWeb/MathML/MathMLElement.h>
|
2023-07-05 20:25:52 -05:00
|
|
|
#include <LibWeb/MathML/TagNames.h>
|
2023-07-05 20:24:51 -05:00
|
|
|
|
|
|
|
namespace Web::MathML {
|
|
|
|
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DEFINE_ALLOCATOR(MathMLElement);
|
|
|
|
|
2023-07-05 20:24:51 -05:00
|
|
|
MathMLElement::~MathMLElement() = default;
|
|
|
|
|
|
|
|
MathMLElement::MathMLElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
|
|
|
: DOM::Element(document, move(qualified_name))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void MathMLElement::initialize(JS::Realm& realm)
|
|
|
|
{
|
|
|
|
Base::initialize(realm);
|
2024-03-16 13:13:08 +01:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(MathMLElement);
|
2024-04-24 14:56:26 +02:00
|
|
|
}
|
2023-07-05 20:24:51 -05:00
|
|
|
|
2023-07-05 20:25:52 -05:00
|
|
|
Optional<ARIA::Role> MathMLElement::default_role() const
|
|
|
|
{
|
|
|
|
// https://www.w3.org/TR/html-aria/#el-math
|
2023-10-01 20:07:44 +13:00
|
|
|
if (local_name() == TagNames::math)
|
2023-07-05 20:25:52 -05:00
|
|
|
return ARIA::Role::math;
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2024-04-05 20:16:23 +03:00
|
|
|
void MathMLElement::visit_edges(JS::Cell::Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
2024-10-29 11:07:02 +01:00
|
|
|
HTMLOrSVGElement::visit_edges(visitor);
|
2024-04-05 20:16:23 +03:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:24:51 -05:00
|
|
|
}
|