/*
 * THIS FILE WAS AUTOMATICALLY GENERATED, DO NOT EDIT.
 *
 * This file was generated by the dom/make_names.pl script.
 *
 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#pragma once

#include "Namespace.h"
#include "TagName.h"
#include <wtf/Forward.h>

namespace WebCore {

class QualifiedName;

enum class ElementName : uint16_t {
    Unknown,
    HTML_abbr,
    HTML_acronym,
    HTML_address,
    HTML_applet,
    HTML_area,
    HTML_article,
    HTML_aside,
    HTML_attachment,
    HTML_audio,
    HTML_b,
    HTML_base,
    HTML_basefont,
    HTML_bdi,
    HTML_bdo,
    HTML_bgsound,
    HTML_big,
    HTML_blockquote,
    HTML_body,
    HTML_br,
    HTML_button,
    HTML_canvas,
    HTML_caption,
    HTML_center,
    HTML_cite,
    HTML_code,
    HTML_col,
    HTML_colgroup,
    HTML_data,
    HTML_datalist,
    HTML_dd,
    HTML_del,
    HTML_details,
    HTML_dfn,
    HTML_dialog,
    HTML_dir,
    HTML_div,
    HTML_dl,
    HTML_dt,
    HTML_em,
    HTML_embed,
    HTML_fieldset,
    HTML_figcaption,
    HTML_figure,
    HTML_footer,
    HTML_form,
    HTML_frame,
    HTML_frameset,
    HTML_h1,
    HTML_h2,
    HTML_h3,
    HTML_h4,
    HTML_h5,
    HTML_h6,
    HTML_head,
    HTML_header,
    HTML_hgroup,
    HTML_hr,
    HTML_html,
    HTML_i,
    HTML_iframe,
    HTML_img,
    HTML_input,
    HTML_ins,
    HTML_kbd,
    HTML_keygen,
    HTML_label,
    HTML_legend,
    HTML_li,
    HTML_link,
    HTML_listing,
    HTML_main,
    HTML_map,
    HTML_mark,
    HTML_marquee,
    HTML_menu,
    HTML_menuitem,
    HTML_meta,
    HTML_meter,
    HTML_model,
    HTML_nav,
    HTML_nobr,
    HTML_noembed,
    HTML_noframes,
    HTML_noscript,
    HTML_object,
    HTML_ol,
    HTML_optgroup,
    HTML_option,
    HTML_output,
    HTML_p,
    HTML_param,
    HTML_picture,
    HTML_plaintext,
    HTML_pre,
    HTML_progress,
    HTML_q,
    HTML_rb,
    HTML_rp,
    HTML_rt,
    HTML_rtc,
    HTML_ruby,
    HTML_s,
    HTML_samp,
    HTML_section,
    HTML_select,
    HTML_slot,
    HTML_small,
    HTML_source,
    HTML_span,
    HTML_strike,
    HTML_strong,
    HTML_sub,
    HTML_summary,
    HTML_sup,
    HTML_table,
    HTML_tbody,
    HTML_td,
    HTML_template,
    HTML_textarea,
    HTML_tfoot,
    HTML_th,
    HTML_thead,
    HTML_time,
    HTML_tr,
    HTML_track,
    HTML_tt,
    HTML_u,
    HTML_ul,
    HTML_var,
    HTML_video,
    HTML_wbr,
    HTML_xmp,
    MathML_annotation,
    MathML_annotation_xml,
    MathML_maction,
    MathML_maligngroup,
    MathML_malignmark,
    MathML_math,
    MathML_menclose,
    MathML_merror,
    MathML_mfenced,
    MathML_mfrac,
    MathML_mglyph,
    MathML_mi,
    MathML_mlabeledtr,
    MathML_mlongdiv,
    MathML_mmultiscripts,
    MathML_mn,
    MathML_mo,
    MathML_mover,
    MathML_mpadded,
    MathML_mphantom,
    MathML_mprescripts,
    MathML_mroot,
    MathML_mrow,
    MathML_ms,
    MathML_mscarries,
    MathML_mscarry,
    MathML_msgroup,
    MathML_msline,
    MathML_mspace,
    MathML_msqrt,
    MathML_msrow,
    MathML_mstack,
    MathML_mstyle,
    MathML_msub,
    MathML_msubsup,
    MathML_msup,
    MathML_mtable,
    MathML_mtd,
    MathML_mtext,
    MathML_mtr,
    MathML_munder,
    MathML_munderover,
    MathML_none,
    MathML_semantics,
    SVG_altGlyph,
    SVG_altGlyphDef,
    SVG_altGlyphItem,
    SVG_animate,
    SVG_animateColor,
    SVG_animateMotion,
    SVG_animateTransform,
    SVG_circle,
    SVG_clipPath,
    SVG_cursor,
    SVG_defs,
    SVG_desc,
    SVG_ellipse,
    SVG_feBlend,
    SVG_feColorMatrix,
    SVG_feComponentTransfer,
    SVG_feComposite,
    SVG_feConvolveMatrix,
    SVG_feDiffuseLighting,
    SVG_feDisplacementMap,
    SVG_feDistantLight,
    SVG_feDropShadow,
    SVG_feFlood,
    SVG_feFuncA,
    SVG_feFuncB,
    SVG_feFuncG,
    SVG_feFuncR,
    SVG_feGaussianBlur,
    SVG_feImage,
    SVG_feMerge,
    SVG_feMergeNode,
    SVG_feMorphology,
    SVG_feOffset,
    SVG_fePointLight,
    SVG_feSpecularLighting,
    SVG_feSpotLight,
    SVG_feTile,
    SVG_feTurbulence,
    SVG_filter,
    SVG_font_face,
    SVG_font_face_format,
    SVG_font_face_name,
    SVG_font_face_src,
    SVG_font_face_uri,
    SVG_foreignObject,
    SVG_g,
    SVG_glyph,
    SVG_glyphRef,
    SVG_hkern,
    SVG_line,
    SVG_linearGradient,
    SVG_marker,
    SVG_mask,
    SVG_metadata,
    SVG_missing_glyph,
    SVG_mpath,
    SVG_path,
    SVG_pattern,
    SVG_polygon,
    SVG_polyline,
    SVG_radialGradient,
    SVG_rect,
    SVG_set,
    SVG_stop,
    SVG_svg,
    SVG_switch,
    SVG_symbol,
    SVG_text,
    SVG_textPath,
    SVG_tref,
    SVG_tspan,
    SVG_use,
    SVG_view,
    SVG_vkern,
    HTML_a,
    HTML_font,
    HTML_image,
    HTML_script,
    HTML_style,
    HTML_title,
    SVG_a,
    SVG_font,
    SVG_image,
    SVG_script,
    SVG_style,
    SVG_title,
};

namespace ElementNames {
namespace HTML {
inline constexpr auto abbr = ElementName::HTML_abbr;
inline constexpr auto acronym = ElementName::HTML_acronym;
inline constexpr auto address = ElementName::HTML_address;
inline constexpr auto applet = ElementName::HTML_applet;
inline constexpr auto area = ElementName::HTML_area;
inline constexpr auto article = ElementName::HTML_article;
inline constexpr auto aside = ElementName::HTML_aside;
inline constexpr auto attachment = ElementName::HTML_attachment;
inline constexpr auto audio = ElementName::HTML_audio;
inline constexpr auto b = ElementName::HTML_b;
inline constexpr auto base = ElementName::HTML_base;
inline constexpr auto basefont = ElementName::HTML_basefont;
inline constexpr auto bdi = ElementName::HTML_bdi;
inline constexpr auto bdo = ElementName::HTML_bdo;
inline constexpr auto bgsound = ElementName::HTML_bgsound;
inline constexpr auto big = ElementName::HTML_big;
inline constexpr auto blockquote = ElementName::HTML_blockquote;
inline constexpr auto body = ElementName::HTML_body;
inline constexpr auto br = ElementName::HTML_br;
inline constexpr auto button = ElementName::HTML_button;
inline constexpr auto canvas = ElementName::HTML_canvas;
inline constexpr auto caption = ElementName::HTML_caption;
inline constexpr auto center = ElementName::HTML_center;
inline constexpr auto cite = ElementName::HTML_cite;
inline constexpr auto code = ElementName::HTML_code;
inline constexpr auto col = ElementName::HTML_col;
inline constexpr auto colgroup = ElementName::HTML_colgroup;
inline constexpr auto data = ElementName::HTML_data;
inline constexpr auto datalist = ElementName::HTML_datalist;
inline constexpr auto dd = ElementName::HTML_dd;
inline constexpr auto del = ElementName::HTML_del;
inline constexpr auto details = ElementName::HTML_details;
inline constexpr auto dfn = ElementName::HTML_dfn;
inline constexpr auto dialog = ElementName::HTML_dialog;
inline constexpr auto dir = ElementName::HTML_dir;
inline constexpr auto div = ElementName::HTML_div;
inline constexpr auto dl = ElementName::HTML_dl;
inline constexpr auto dt = ElementName::HTML_dt;
inline constexpr auto em = ElementName::HTML_em;
inline constexpr auto embed = ElementName::HTML_embed;
inline constexpr auto fieldset = ElementName::HTML_fieldset;
inline constexpr auto figcaption = ElementName::HTML_figcaption;
inline constexpr auto figure = ElementName::HTML_figure;
inline constexpr auto footer = ElementName::HTML_footer;
inline constexpr auto form = ElementName::HTML_form;
inline constexpr auto frame = ElementName::HTML_frame;
inline constexpr auto frameset = ElementName::HTML_frameset;
inline constexpr auto h1 = ElementName::HTML_h1;
inline constexpr auto h2 = ElementName::HTML_h2;
inline constexpr auto h3 = ElementName::HTML_h3;
inline constexpr auto h4 = ElementName::HTML_h4;
inline constexpr auto h5 = ElementName::HTML_h5;
inline constexpr auto h6 = ElementName::HTML_h6;
inline constexpr auto head = ElementName::HTML_head;
inline constexpr auto header = ElementName::HTML_header;
inline constexpr auto hgroup = ElementName::HTML_hgroup;
inline constexpr auto hr = ElementName::HTML_hr;
inline constexpr auto html = ElementName::HTML_html;
inline constexpr auto i = ElementName::HTML_i;
inline constexpr auto iframe = ElementName::HTML_iframe;
inline constexpr auto img = ElementName::HTML_img;
inline constexpr auto input = ElementName::HTML_input;
inline constexpr auto ins = ElementName::HTML_ins;
inline constexpr auto kbd = ElementName::HTML_kbd;
inline constexpr auto keygen = ElementName::HTML_keygen;
inline constexpr auto label = ElementName::HTML_label;
inline constexpr auto legend = ElementName::HTML_legend;
inline constexpr auto li = ElementName::HTML_li;
inline constexpr auto link = ElementName::HTML_link;
inline constexpr auto listing = ElementName::HTML_listing;
inline constexpr auto main = ElementName::HTML_main;
inline constexpr auto map = ElementName::HTML_map;
inline constexpr auto mark = ElementName::HTML_mark;
inline constexpr auto marquee = ElementName::HTML_marquee;
inline constexpr auto menu = ElementName::HTML_menu;
inline constexpr auto menuitem = ElementName::HTML_menuitem;
inline constexpr auto meta = ElementName::HTML_meta;
inline constexpr auto meter = ElementName::HTML_meter;
inline constexpr auto model = ElementName::HTML_model;
inline constexpr auto nav = ElementName::HTML_nav;
inline constexpr auto nobr = ElementName::HTML_nobr;
inline constexpr auto noembed = ElementName::HTML_noembed;
inline constexpr auto noframes = ElementName::HTML_noframes;
inline constexpr auto noscript = ElementName::HTML_noscript;
inline constexpr auto object = ElementName::HTML_object;
inline constexpr auto ol = ElementName::HTML_ol;
inline constexpr auto optgroup = ElementName::HTML_optgroup;
inline constexpr auto option = ElementName::HTML_option;
inline constexpr auto output = ElementName::HTML_output;
inline constexpr auto p = ElementName::HTML_p;
inline constexpr auto param = ElementName::HTML_param;
inline constexpr auto picture = ElementName::HTML_picture;
inline constexpr auto plaintext = ElementName::HTML_plaintext;
inline constexpr auto pre = ElementName::HTML_pre;
inline constexpr auto progress = ElementName::HTML_progress;
inline constexpr auto q = ElementName::HTML_q;
inline constexpr auto rb = ElementName::HTML_rb;
inline constexpr auto rp = ElementName::HTML_rp;
inline constexpr auto rt = ElementName::HTML_rt;
inline constexpr auto rtc = ElementName::HTML_rtc;
inline constexpr auto ruby = ElementName::HTML_ruby;
inline constexpr auto s = ElementName::HTML_s;
inline constexpr auto samp = ElementName::HTML_samp;
inline constexpr auto section = ElementName::HTML_section;
inline constexpr auto select = ElementName::HTML_select;
inline constexpr auto slot = ElementName::HTML_slot;
inline constexpr auto small_ = ElementName::HTML_small;
inline constexpr auto source = ElementName::HTML_source;
inline constexpr auto span = ElementName::HTML_span;
inline constexpr auto strike = ElementName::HTML_strike;
inline constexpr auto strong = ElementName::HTML_strong;
inline constexpr auto sub = ElementName::HTML_sub;
inline constexpr auto summary = ElementName::HTML_summary;
inline constexpr auto sup = ElementName::HTML_sup;
inline constexpr auto table = ElementName::HTML_table;
inline constexpr auto tbody = ElementName::HTML_tbody;
inline constexpr auto td = ElementName::HTML_td;
inline constexpr auto template_ = ElementName::HTML_template;
inline constexpr auto textarea = ElementName::HTML_textarea;
inline constexpr auto tfoot = ElementName::HTML_tfoot;
inline constexpr auto th = ElementName::HTML_th;
inline constexpr auto thead = ElementName::HTML_thead;
inline constexpr auto time = ElementName::HTML_time;
inline constexpr auto tr = ElementName::HTML_tr;
inline constexpr auto track = ElementName::HTML_track;
inline constexpr auto tt = ElementName::HTML_tt;
inline constexpr auto u = ElementName::HTML_u;
inline constexpr auto ul = ElementName::HTML_ul;
inline constexpr auto var = ElementName::HTML_var;
inline constexpr auto video = ElementName::HTML_video;
inline constexpr auto wbr = ElementName::HTML_wbr;
inline constexpr auto xmp = ElementName::HTML_xmp;
inline constexpr auto a = ElementName::HTML_a;
inline constexpr auto font = ElementName::HTML_font;
inline constexpr auto image = ElementName::HTML_image;
inline constexpr auto script = ElementName::HTML_script;
inline constexpr auto style = ElementName::HTML_style;
inline constexpr auto title = ElementName::HTML_title;
} // namespace HTML
namespace MathML {
inline constexpr auto annotation = ElementName::MathML_annotation;
inline constexpr auto annotation_xml = ElementName::MathML_annotation_xml;
inline constexpr auto maction = ElementName::MathML_maction;
inline constexpr auto maligngroup = ElementName::MathML_maligngroup;
inline constexpr auto malignmark = ElementName::MathML_malignmark;
inline constexpr auto math = ElementName::MathML_math;
inline constexpr auto menclose = ElementName::MathML_menclose;
inline constexpr auto merror = ElementName::MathML_merror;
inline constexpr auto mfenced = ElementName::MathML_mfenced;
inline constexpr auto mfrac = ElementName::MathML_mfrac;
inline constexpr auto mglyph = ElementName::MathML_mglyph;
inline constexpr auto mi = ElementName::MathML_mi;
inline constexpr auto mlabeledtr = ElementName::MathML_mlabeledtr;
inline constexpr auto mlongdiv = ElementName::MathML_mlongdiv;
inline constexpr auto mmultiscripts = ElementName::MathML_mmultiscripts;
inline constexpr auto mn = ElementName::MathML_mn;
inline constexpr auto mo = ElementName::MathML_mo;
inline constexpr auto mover = ElementName::MathML_mover;
inline constexpr auto mpadded = ElementName::MathML_mpadded;
inline constexpr auto mphantom = ElementName::MathML_mphantom;
inline constexpr auto mprescripts = ElementName::MathML_mprescripts;
inline constexpr auto mroot = ElementName::MathML_mroot;
inline constexpr auto mrow = ElementName::MathML_mrow;
inline constexpr auto ms = ElementName::MathML_ms;
inline constexpr auto mscarries = ElementName::MathML_mscarries;
inline constexpr auto mscarry = ElementName::MathML_mscarry;
inline constexpr auto msgroup = ElementName::MathML_msgroup;
inline constexpr auto msline = ElementName::MathML_msline;
inline constexpr auto mspace = ElementName::MathML_mspace;
inline constexpr auto msqrt = ElementName::MathML_msqrt;
inline constexpr auto msrow = ElementName::MathML_msrow;
inline constexpr auto mstack = ElementName::MathML_mstack;
inline constexpr auto mstyle = ElementName::MathML_mstyle;
inline constexpr auto msub = ElementName::MathML_msub;
inline constexpr auto msubsup = ElementName::MathML_msubsup;
inline constexpr auto msup = ElementName::MathML_msup;
inline constexpr auto mtable = ElementName::MathML_mtable;
inline constexpr auto mtd = ElementName::MathML_mtd;
inline constexpr auto mtext = ElementName::MathML_mtext;
inline constexpr auto mtr = ElementName::MathML_mtr;
inline constexpr auto munder = ElementName::MathML_munder;
inline constexpr auto munderover = ElementName::MathML_munderover;
inline constexpr auto none = ElementName::MathML_none;
inline constexpr auto semantics = ElementName::MathML_semantics;
} // namespace MathML
namespace SVG {
inline constexpr auto altGlyph = ElementName::SVG_altGlyph;
inline constexpr auto altGlyphDef = ElementName::SVG_altGlyphDef;
inline constexpr auto altGlyphItem = ElementName::SVG_altGlyphItem;
inline constexpr auto animate = ElementName::SVG_animate;
inline constexpr auto animateColor = ElementName::SVG_animateColor;
inline constexpr auto animateMotion = ElementName::SVG_animateMotion;
inline constexpr auto animateTransform = ElementName::SVG_animateTransform;
inline constexpr auto circle = ElementName::SVG_circle;
inline constexpr auto clipPath = ElementName::SVG_clipPath;
inline constexpr auto cursor = ElementName::SVG_cursor;
inline constexpr auto defs = ElementName::SVG_defs;
inline constexpr auto desc = ElementName::SVG_desc;
inline constexpr auto ellipse = ElementName::SVG_ellipse;
inline constexpr auto feBlend = ElementName::SVG_feBlend;
inline constexpr auto feColorMatrix = ElementName::SVG_feColorMatrix;
inline constexpr auto feComponentTransfer = ElementName::SVG_feComponentTransfer;
inline constexpr auto feComposite = ElementName::SVG_feComposite;
inline constexpr auto feConvolveMatrix = ElementName::SVG_feConvolveMatrix;
inline constexpr auto feDiffuseLighting = ElementName::SVG_feDiffuseLighting;
inline constexpr auto feDisplacementMap = ElementName::SVG_feDisplacementMap;
inline constexpr auto feDistantLight = ElementName::SVG_feDistantLight;
inline constexpr auto feDropShadow = ElementName::SVG_feDropShadow;
inline constexpr auto feFlood = ElementName::SVG_feFlood;
inline constexpr auto feFuncA = ElementName::SVG_feFuncA;
inline constexpr auto feFuncB = ElementName::SVG_feFuncB;
inline constexpr auto feFuncG = ElementName::SVG_feFuncG;
inline constexpr auto feFuncR = ElementName::SVG_feFuncR;
inline constexpr auto feGaussianBlur = ElementName::SVG_feGaussianBlur;
inline constexpr auto feImage = ElementName::SVG_feImage;
inline constexpr auto feMerge = ElementName::SVG_feMerge;
inline constexpr auto feMergeNode = ElementName::SVG_feMergeNode;
inline constexpr auto feMorphology = ElementName::SVG_feMorphology;
inline constexpr auto feOffset = ElementName::SVG_feOffset;
inline constexpr auto fePointLight = ElementName::SVG_fePointLight;
inline constexpr auto feSpecularLighting = ElementName::SVG_feSpecularLighting;
inline constexpr auto feSpotLight = ElementName::SVG_feSpotLight;
inline constexpr auto feTile = ElementName::SVG_feTile;
inline constexpr auto feTurbulence = ElementName::SVG_feTurbulence;
inline constexpr auto filter = ElementName::SVG_filter;
inline constexpr auto font_face = ElementName::SVG_font_face;
inline constexpr auto font_face_format = ElementName::SVG_font_face_format;
inline constexpr auto font_face_name = ElementName::SVG_font_face_name;
inline constexpr auto font_face_src = ElementName::SVG_font_face_src;
inline constexpr auto font_face_uri = ElementName::SVG_font_face_uri;
inline constexpr auto foreignObject = ElementName::SVG_foreignObject;
inline constexpr auto g = ElementName::SVG_g;
inline constexpr auto glyph = ElementName::SVG_glyph;
inline constexpr auto glyphRef = ElementName::SVG_glyphRef;
inline constexpr auto hkern = ElementName::SVG_hkern;
inline constexpr auto line = ElementName::SVG_line;
inline constexpr auto linearGradient = ElementName::SVG_linearGradient;
inline constexpr auto marker = ElementName::SVG_marker;
inline constexpr auto mask = ElementName::SVG_mask;
inline constexpr auto metadata = ElementName::SVG_metadata;
inline constexpr auto missing_glyph = ElementName::SVG_missing_glyph;
inline constexpr auto mpath = ElementName::SVG_mpath;
inline constexpr auto path = ElementName::SVG_path;
inline constexpr auto pattern = ElementName::SVG_pattern;
inline constexpr auto polygon = ElementName::SVG_polygon;
inline constexpr auto polyline = ElementName::SVG_polyline;
inline constexpr auto radialGradient = ElementName::SVG_radialGradient;
inline constexpr auto rect = ElementName::SVG_rect;
inline constexpr auto set = ElementName::SVG_set;
inline constexpr auto stop = ElementName::SVG_stop;
inline constexpr auto svg = ElementName::SVG_svg;
inline constexpr auto switch_ = ElementName::SVG_switch;
inline constexpr auto symbol = ElementName::SVG_symbol;
inline constexpr auto text = ElementName::SVG_text;
inline constexpr auto textPath = ElementName::SVG_textPath;
inline constexpr auto tref = ElementName::SVG_tref;
inline constexpr auto tspan = ElementName::SVG_tspan;
inline constexpr auto use = ElementName::SVG_use;
inline constexpr auto view = ElementName::SVG_view;
inline constexpr auto vkern = ElementName::SVG_vkern;
inline constexpr auto a = ElementName::SVG_a;
inline constexpr auto font = ElementName::SVG_font;
inline constexpr auto image = ElementName::SVG_image;
inline constexpr auto script = ElementName::SVG_script;
inline constexpr auto style = ElementName::SVG_style;
inline constexpr auto title = ElementName::SVG_title;
} // namespace SVG
} // namespace ElementNames

ElementName findElementName(Namespace, const String&);
ElementName findHTMLElementName(Span<const LChar>);
ElementName findHTMLElementName(Span<const UChar>);
TagName tagNameForElement(ElementName);
ElementName elementNameForTag(Namespace, TagName);
const QualifiedName& qualifiedNameForElement(ElementName);

inline TagName tagNameForElement(ElementName elementName)
{
    constexpr auto s_lastUniqueTagName = TagName::vkern;

    if (LIKELY(static_cast<uint16_t>(elementName) <= static_cast<uint16_t>(s_lastUniqueTagName)))
        return static_cast<TagName>(elementName);

    switch (elementName) {
    case ElementName::HTML_a:
        return TagName::a;
    case ElementName::HTML_font:
        return TagName::font;
    case ElementName::HTML_image:
        return TagName::image;
    case ElementName::HTML_script:
        return TagName::script;
    case ElementName::HTML_style:
        return TagName::style;
    case ElementName::HTML_title:
        return TagName::title;
    case ElementName::SVG_a:
        return TagName::a;
    case ElementName::SVG_font:
        return TagName::font;
    case ElementName::SVG_image:
        return TagName::image;
    case ElementName::SVG_script:
        return TagName::script;
    case ElementName::SVG_style:
        return TagName::style;
    case ElementName::SVG_title:
        return TagName::title;
    default:
        break;
    }

    return TagName::Unknown;
}

inline ElementName elementNameForTag(Namespace ns, TagName tagName)
{
    if (ns == Namespace::HTML) {
        constexpr auto s_firstUniqueHTMLTagName = TagName::abbr;
        constexpr auto s_lastUniqueHTMLTagName = TagName::xmp;

        if (UNLIKELY(static_cast<uint16_t>(tagName) < static_cast<uint16_t>(s_firstUniqueHTMLTagName)))
            return ElementName::Unknown;

        if (LIKELY(static_cast<uint16_t>(tagName) <= static_cast<uint16_t>(s_lastUniqueHTMLTagName)))
            return static_cast<ElementName>(tagName);

        switch (tagName) {
        case TagName::a:
            return ElementName::HTML_a;
        case TagName::font:
            return ElementName::HTML_font;
        case TagName::image:
            return ElementName::HTML_image;
        case TagName::script:
            return ElementName::HTML_script;
        case TagName::style:
            return ElementName::HTML_style;
        case TagName::title:
            return ElementName::HTML_title;
        default:
            break;
        }
        return ElementName::Unknown;
    }

    if (ns == Namespace::MathML) {
        constexpr auto s_firstUniqueMathMLTagName = TagName::annotation;
        constexpr auto s_lastUniqueMathMLTagName = TagName::semantics;

        if (UNLIKELY(static_cast<uint16_t>(tagName) < static_cast<uint16_t>(s_firstUniqueMathMLTagName)))
            return ElementName::Unknown;

        if (LIKELY(static_cast<uint16_t>(tagName) <= static_cast<uint16_t>(s_lastUniqueMathMLTagName)))
            return static_cast<ElementName>(tagName);

        return ElementName::Unknown;
    }

    if (ns == Namespace::SVG) {
        constexpr auto s_firstUniqueSVGTagName = TagName::altGlyph;
        constexpr auto s_lastUniqueSVGTagName = TagName::vkern;

        if (UNLIKELY(static_cast<uint16_t>(tagName) < static_cast<uint16_t>(s_firstUniqueSVGTagName)))
            return ElementName::Unknown;

        if (LIKELY(static_cast<uint16_t>(tagName) <= static_cast<uint16_t>(s_lastUniqueSVGTagName)))
            return static_cast<ElementName>(tagName);

        switch (tagName) {
        case TagName::a:
            return ElementName::SVG_a;
        case TagName::font:
            return ElementName::SVG_font;
        case TagName::image:
            return ElementName::SVG_image;
        case TagName::script:
            return ElementName::SVG_script;
        case TagName::style:
            return ElementName::SVG_style;
        case TagName::title:
            return ElementName::SVG_title;
        default:
            break;
        }
        return ElementName::Unknown;
    }

    return ElementName::Unknown;
}

} // namespace WebCore
