| 
									
										
										
										
											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>
 | 
					
						
							|  |  |  | #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 { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 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); | 
					
						
							|  |  |  |     set_prototype(&Bindings::ensure_web_prototype<Bindings::MathMLElementPrototype>(realm, "MathMLElement")); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     m_dataset = HTML::DOMStringMap::create(*this); | 
					
						
							| 
									
										
										
										
											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
 | 
					
						
							|  |  |  |     if (local_name() == TagNames::math.to_deprecated_fly_string()) | 
					
						
							|  |  |  |         return ARIA::Role::math; | 
					
						
							|  |  |  |     return {}; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-05 20:24:51 -05:00
										 |  |  | } |