/*
 * 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.
 */

#include "config.h"

#include "XLinkNames.h"

#include "Namespace.h"
#include "NodeName.h"

namespace WebCore {

namespace XLinkNames {

using namespace WebCore;

MainThreadLazyNeverDestroyed<const AtomString> xlinkNamespaceURI;

#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable: 4307)
#endif

static constexpr StringImpl::StaticStringImpl actuateData("actuate");
static constexpr StringImpl::StaticStringImpl arcroleData("arcrole");
static constexpr StringImpl::StaticStringImpl hrefData("href");
static constexpr StringImpl::StaticStringImpl roleData("role");
static constexpr StringImpl::StaticStringImpl showData("show");
static constexpr StringImpl::StaticStringImpl titleData("title");
static constexpr StringImpl::StaticStringImpl typeData("type");

#if COMPILER(MSVC)
#pragma warning(pop)
#endif


// Attributes
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> actuateAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> arcroleAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> hrefAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> roleAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> showAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> titleAttr;
WEBCORE_EXPORT LazyNeverDestroyed<const QualifiedName> typeAttr;

void init()
{
    static bool initialized = false;
    if (initialized)
        return;
    initialized = true;

    // Use placement new to initialize the globals.
    AtomString xlinkNS("http://www.w3.org/1999/xlink"_s);

    // Namespace
    xlinkNamespaceURI.construct(xlinkNS);

#ifndef NDEBUG
    reinterpret_cast<const StringImpl*>(&actuateData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&arcroleData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&hrefData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&roleData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&showData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&titleData)->assertHashIsCorrect();
    reinterpret_cast<const StringImpl*>(&typeData)->assertHashIsCorrect();
#endif // NDEBUG


    struct AttributesTableEntry {
        LazyNeverDestroyed<const QualifiedName>* targetAddress;
        const StaticStringImpl& name;
        NodeName nodeName;
    };

    static const AttributesTableEntry attributesTable[] = {
        { &actuateAttr, *(&actuateData), NodeName::XLink_actuateAttr },
        { &arcroleAttr, *(&arcroleData), NodeName::XLink_arcroleAttr },
        { &hrefAttr, *(&hrefData), NodeName::XLink_hrefAttr },
        { &roleAttr, *(&roleData), NodeName::XLink_roleAttr },
        { &showAttr, *(&showData), NodeName::XLink_showAttr },
        { &titleAttr, *(&titleData), NodeName::XLink_titleAttr },
        { &typeAttr, *(&typeData), NodeName::XLink_typeAttr },
    };

    for (auto& entry : attributesTable)
        entry.targetAddress->construct(nullAtom(), AtomString(&entry.name), xlinkNS, Namespace::XLink, entry.nodeName);
}

} }

