michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsHtml5ReleasableAttributeName.h" michael@0: #include "nsHtml5Portability.h" michael@0: #include "nsHtml5AtomTable.h" michael@0: michael@0: nsHtml5ReleasableAttributeName::nsHtml5ReleasableAttributeName(int32_t* uri, nsIAtom** local, nsIAtom** prefix) michael@0: : nsHtml5AttributeName(uri, local, prefix) michael@0: { michael@0: } michael@0: michael@0: nsHtml5AttributeName* michael@0: nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner) michael@0: { michael@0: nsIAtom* l = getLocal(0); michael@0: if (aInterner) { michael@0: if (!l->IsStaticAtom()) { michael@0: nsAutoString str; michael@0: l->ToString(str); michael@0: l = aInterner->GetAtom(str); michael@0: } michael@0: } michael@0: return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS, michael@0: nsHtml5AttributeName::SAME_LOCAL(l), michael@0: nsHtml5AttributeName::ALL_NO_PREFIX); michael@0: } michael@0: michael@0: void michael@0: nsHtml5ReleasableAttributeName::release() michael@0: { michael@0: delete this; michael@0: }