Merge b2g-inbound to m-c. a=merge
[gecko.git] / parser / html / nsHtml5ReleasableAttributeName.cpp
blob4cef131e7db2a8a2503d41a90256c4d469a48e62
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsHtml5ReleasableAttributeName.h"
6 #include "nsHtml5Portability.h"
7 #include "nsHtml5AtomTable.h"
9 nsHtml5ReleasableAttributeName::nsHtml5ReleasableAttributeName(int32_t* uri, nsIAtom** local, nsIAtom** prefix)
10 : nsHtml5AttributeName(uri, local, prefix)
14 nsHtml5AttributeName*
15 nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner)
17 nsIAtom* l = getLocal(0);
18 if (aInterner) {
19 if (!l->IsStaticAtom()) {
20 nsAutoString str;
21 l->ToString(str);
22 l = aInterner->GetAtom(str);
25 return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS,
26 nsHtml5AttributeName::SAME_LOCAL(l),
27 nsHtml5AttributeName::ALL_NO_PREFIX);
30 void
31 nsHtml5ReleasableAttributeName::release()
33 delete this;