Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
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)
11 {
12 }
14 nsHtml5AttributeName*
15 nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner)
16 {
17 nsIAtom* l = getLocal(0);
18 if (aInterner) {
19 if (!l->IsStaticAtom()) {
20 nsAutoString str;
21 l->ToString(str);
22 l = aInterner->GetAtom(str);
23 }
24 }
25 return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS,
26 nsHtml5AttributeName::SAME_LOCAL(l),
27 nsHtml5AttributeName::ALL_NO_PREFIX);
28 }
30 void
31 nsHtml5ReleasableAttributeName::release()
32 {
33 delete this;
34 }