2 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
24 #include "WMLFieldSetElement.h"
26 #include "HTMLNames.h"
27 #include "MappedAttribute.h"
28 #include "RenderFieldset.h"
30 #include "WMLElementFactory.h"
35 using namespace WMLNames
;
37 WMLFieldSetElement::WMLFieldSetElement(const QualifiedName
& tagName
, Document
* doc
)
38 : WMLElement(tagName
, doc
)
42 WMLFieldSetElement::~WMLFieldSetElement()
46 void WMLFieldSetElement::insertedIntoDocument()
48 WMLElement::insertedIntoDocument();
50 String title
= parseValueSubstitutingVariableReferences(getAttribute(HTMLNames::titleAttr
));
54 m_insertedLegendElement
= WMLElementFactory::createWMLElement(insertedLegendTag
, document());
56 // Insert <dummyLegend> element, as RenderFieldset expect it to be present
57 // to layout it's child text content, when rendering <fieldset> elements
59 appendChild(m_insertedLegendElement
, ec
);
62 // Create text node holding the 'title' attribute value
63 m_insertedLegendElement
->appendChild(document()->createTextNode(title
), ec
);
67 void WMLFieldSetElement::removedFromDocument()
69 WMLElement::removedFromDocument();
70 m_insertedLegendElement
.clear();
73 RenderObject
* WMLFieldSetElement::createRenderer(RenderArena
* arena
, RenderStyle
*)
75 return new (arena
) RenderFieldset(this);