mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibWeb: Port SVG::TagNames from DeprecatedFlyString
This commit is contained in:
parent
48f367adbb
commit
7aac7002d1
4 changed files with 7 additions and 7 deletions
|
@ -427,7 +427,7 @@ static JS::NonnullGCPtr<Element> create_html_element(JS::Realm& realm, Document&
|
||||||
|
|
||||||
static JS::GCPtr<SVG::SVGElement> create_svg_element(JS::Realm& realm, Document& document, QualifiedName qualified_name)
|
static JS::GCPtr<SVG::SVGElement> create_svg_element(JS::Realm& realm, Document& document, QualifiedName qualified_name)
|
||||||
{
|
{
|
||||||
auto const& local_name = qualified_name.local_name().to_deprecated_fly_string();
|
auto const& local_name = qualified_name.local_name();
|
||||||
|
|
||||||
if (local_name == SVG::TagNames::svg)
|
if (local_name == SVG::TagNames::svg)
|
||||||
return realm.heap().allocate<SVG::SVGSVGElement>(realm, document, move(qualified_name));
|
return realm.heap().allocate<SVG::SVGSVGElement>(realm, document, move(qualified_name));
|
||||||
|
|
|
@ -3514,7 +3514,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token)
|
||||||
if (token.is_self_closing()) {
|
if (token.is_self_closing()) {
|
||||||
|
|
||||||
// -> If the token's tag name is "script", and the new current node is in the SVG namespace
|
// -> If the token's tag name is "script", and the new current node is in the SVG namespace
|
||||||
if (token.tag_name().to_deprecated_fly_string() == SVG::TagNames::script && current_node().namespace_() == Namespace::SVG) {
|
if (token.tag_name() == SVG::TagNames::script && current_node().namespace_() == Namespace::SVG) {
|
||||||
// Acknowledge the token's self-closing flag, and then act as described in the steps for a "script" end tag below.
|
// Acknowledge the token's self-closing flag, and then act as described in the steps for a "script" end tag below.
|
||||||
token.acknowledge_self_closing_flag_if_set();
|
token.acknowledge_self_closing_flag_if_set();
|
||||||
goto ScriptEndTag;
|
goto ScriptEndTag;
|
||||||
|
@ -3531,7 +3531,7 @@ void HTMLParser::process_using_the_rules_for_foreign_content(HTMLToken& token)
|
||||||
}
|
}
|
||||||
|
|
||||||
// -> An end tag whose tag name is "script", if the current node is an SVG script element
|
// -> An end tag whose tag name is "script", if the current node is an SVG script element
|
||||||
if (token.is_end_tag() && current_node().namespace_() == Namespace::SVG && current_node().tag_name().to_deprecated_fly_string() == SVG::TagNames::script) {
|
if (token.is_end_tag() && current_node().namespace_() == Namespace::SVG && current_node().tag_name() == SVG::TagNames::script) {
|
||||||
ScriptEndTag:
|
ScriptEndTag:
|
||||||
// Pop the current node off the stack of open elements.
|
// Pop the current node off the stack of open elements.
|
||||||
(void)m_stack_of_open_elements.pop();
|
(void)m_stack_of_open_elements.pop();
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
namespace Web::SVG::TagNames {
|
namespace Web::SVG::TagNames {
|
||||||
|
|
||||||
#define __ENUMERATE_SVG_TAG(name) DeprecatedFlyString name;
|
#define __ENUMERATE_SVG_TAG(name) FlyString name;
|
||||||
ENUMERATE_SVG_TAGS
|
ENUMERATE_SVG_TAGS
|
||||||
#undef __ENUMERATE_SVG_TAG
|
#undef __ENUMERATE_SVG_TAG
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ void initialize_strings()
|
||||||
static bool s_initialized = false;
|
static bool s_initialized = false;
|
||||||
VERIFY(!s_initialized);
|
VERIFY(!s_initialized);
|
||||||
|
|
||||||
#define __ENUMERATE_SVG_TAG(name) name = #name;
|
#define __ENUMERATE_SVG_TAG(name) name = #name##_fly_string;
|
||||||
ENUMERATE_SVG_TAGS
|
ENUMERATE_SVG_TAGS
|
||||||
#undef __ENUMERATE_SVG_TAG
|
#undef __ENUMERATE_SVG_TAG
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/DeprecatedFlyString.h>
|
|
||||||
#include <AK/Error.h>
|
#include <AK/Error.h>
|
||||||
|
#include <AK/FlyString.h>
|
||||||
|
|
||||||
namespace Web::SVG::TagNames {
|
namespace Web::SVG::TagNames {
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ namespace Web::SVG::TagNames {
|
||||||
__ENUMERATE_SVG_TAG(title) \
|
__ENUMERATE_SVG_TAG(title) \
|
||||||
__ENUMERATE_SVG_TAG(use)
|
__ENUMERATE_SVG_TAG(use)
|
||||||
|
|
||||||
#define __ENUMERATE_SVG_TAG(name) extern DeprecatedFlyString name;
|
#define __ENUMERATE_SVG_TAG(name) extern FlyString name;
|
||||||
ENUMERATE_SVG_TAGS
|
ENUMERATE_SVG_TAGS
|
||||||
#undef __ENUMERATE_SVG_TAG
|
#undef __ENUMERATE_SVG_TAG
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue