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