2012-05-29 08:52:43 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-06-28 15:44:22 -07:00
|
|
|
|
|
|
|
#include "nsHtml5ReleasableAttributeName.h"
|
2009-09-21 00:00:10 -07:00
|
|
|
#include "nsHtml5Portability.h"
|
2009-09-21 06:18:20 -07:00
|
|
|
#include "nsHtml5AtomTable.h"
|
2009-06-28 15:44:22 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
nsHtml5ReleasableAttributeName::nsHtml5ReleasableAttributeName(int32_t* uri, nsIAtom** local, nsIAtom** prefix)
|
2009-06-28 15:44:22 -07:00
|
|
|
: nsHtml5AttributeName(uri, local, prefix)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-09-21 00:00:10 -07:00
|
|
|
nsHtml5AttributeName*
|
2009-09-21 06:18:20 -07:00
|
|
|
nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner)
|
2009-09-21 00:00:10 -07:00
|
|
|
{
|
|
|
|
nsIAtom* l = getLocal(0);
|
2009-09-21 06:18:20 -07:00
|
|
|
if (aInterner) {
|
2010-02-26 01:18:35 -08:00
|
|
|
if (!l->IsStaticAtom()) {
|
2009-09-21 06:18:20 -07:00
|
|
|
nsAutoString str;
|
|
|
|
l->ToString(str);
|
|
|
|
l = aInterner->GetAtom(str);
|
|
|
|
}
|
|
|
|
}
|
2009-09-21 00:00:10 -07:00
|
|
|
return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS,
|
|
|
|
nsHtml5AttributeName::SAME_LOCAL(l),
|
|
|
|
nsHtml5AttributeName::ALL_NO_PREFIX);
|
|
|
|
}
|
|
|
|
|
2009-06-28 15:44:22 -07:00
|
|
|
void
|
|
|
|
nsHtml5ReleasableAttributeName::release()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|