2012-05-29 15:52:43 +00: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 22:44:22 +00:00
|
|
|
|
|
|
|
#include "nsHtml5ReleasableAttributeName.h"
|
2009-09-21 07:00:10 +00:00
|
|
|
#include "nsHtml5Portability.h"
|
2009-09-21 13:18:20 +00:00
|
|
|
#include "nsHtml5AtomTable.h"
|
2009-06-28 22:44:22 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsHtml5ReleasableAttributeName::nsHtml5ReleasableAttributeName(int32_t* uri, nsIAtom** local, nsIAtom** prefix)
|
2009-06-28 22:44:22 +00:00
|
|
|
: nsHtml5AttributeName(uri, local, prefix)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-09-21 07:00:10 +00:00
|
|
|
nsHtml5AttributeName*
|
2009-09-21 13:18:20 +00:00
|
|
|
nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner)
|
2009-09-21 07:00:10 +00:00
|
|
|
{
|
|
|
|
nsIAtom* l = getLocal(0);
|
2009-09-21 13:18:20 +00:00
|
|
|
if (aInterner) {
|
2010-02-26 09:18:35 +00:00
|
|
|
if (!l->IsStaticAtom()) {
|
2009-09-21 13:18:20 +00:00
|
|
|
nsAutoString str;
|
|
|
|
l->ToString(str);
|
|
|
|
l = aInterner->GetAtom(str);
|
|
|
|
}
|
|
|
|
}
|
2009-09-21 07:00:10 +00:00
|
|
|
return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS,
|
|
|
|
nsHtml5AttributeName::SAME_LOCAL(l),
|
|
|
|
nsHtml5AttributeName::ALL_NO_PREFIX);
|
|
|
|
}
|
|
|
|
|
2009-06-28 22:44:22 +00:00
|
|
|
void
|
|
|
|
nsHtml5ReleasableAttributeName::release()
|
|
|
|
{
|
|
|
|
delete this;
|
|
|
|
}
|