1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 *
20 */
21
22 #include "config.h"
23 #include "HTMLUListElement.h"
24
25 #include "CSSPropertyNames.h"
26 #include "HTMLNames.h"
27 #include "MappedAttribute.h"
28
29 namespace WebCore {
30
31 using namespace HTMLNames;
32
HTMLUListElement(const QualifiedName & tagName,Document * doc)33 HTMLUListElement::HTMLUListElement(const QualifiedName& tagName, Document* doc)
34 : HTMLElement(tagName, doc)
35 {
36 ASSERT(hasTagName(ulTag));
37 }
38
mapToEntry(const QualifiedName & attrName,MappedAttributeEntry & result) const39 bool HTMLUListElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
40 {
41 if (attrName == typeAttr) {
42 result = eUnorderedList;
43 return false;
44 }
45
46 return HTMLElement::mapToEntry(attrName, result);
47 }
48
parseMappedAttribute(MappedAttribute * attr)49 void HTMLUListElement::parseMappedAttribute(MappedAttribute *attr)
50 {
51 if (attr->name() == typeAttr)
52 addCSSProperty(attr, CSSPropertyListStyleType, attr->value());
53 else
54 HTMLElement::parseMappedAttribute(attr);
55 }
56
compact() const57 bool HTMLUListElement::compact() const
58 {
59 return !getAttribute(compactAttr).isNull();
60 }
61
setCompact(bool b)62 void HTMLUListElement::setCompact(bool b)
63 {
64 setAttribute(compactAttr, b ? "" : 0);
65 }
66
type() const67 String HTMLUListElement::type() const
68 {
69 return getAttribute(typeAttr);
70 }
71
setType(const String & value)72 void HTMLUListElement::setType(const String &value)
73 {
74 setAttribute(typeAttr, value);
75 }
76
77 }
78