1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/parser/html/nsHtml5ReleasableAttributeName.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "nsHtml5ReleasableAttributeName.h" 1.9 +#include "nsHtml5Portability.h" 1.10 +#include "nsHtml5AtomTable.h" 1.11 + 1.12 +nsHtml5ReleasableAttributeName::nsHtml5ReleasableAttributeName(int32_t* uri, nsIAtom** local, nsIAtom** prefix) 1.13 + : nsHtml5AttributeName(uri, local, prefix) 1.14 +{ 1.15 +} 1.16 + 1.17 +nsHtml5AttributeName* 1.18 +nsHtml5ReleasableAttributeName::cloneAttributeName(nsHtml5AtomTable* aInterner) 1.19 +{ 1.20 + nsIAtom* l = getLocal(0); 1.21 + if (aInterner) { 1.22 + if (!l->IsStaticAtom()) { 1.23 + nsAutoString str; 1.24 + l->ToString(str); 1.25 + l = aInterner->GetAtom(str); 1.26 + } 1.27 + } 1.28 + return new nsHtml5ReleasableAttributeName(nsHtml5AttributeName::ALL_NO_NS, 1.29 + nsHtml5AttributeName::SAME_LOCAL(l), 1.30 + nsHtml5AttributeName::ALL_NO_PREFIX); 1.31 +} 1.32 + 1.33 +void 1.34 +nsHtml5ReleasableAttributeName::release() 1.35 +{ 1.36 + delete this; 1.37 +}