|
1 /** |
|
2 * This file is part of the DOM implementation for KDE. |
|
3 * |
|
4 * Copyright (C) 1997 Martin Jones (mjones@kde.org) |
|
5 * (C) 1997 Torben Weis (weis@kde.org) |
|
6 * (C) 1998 Waldo Bastian (bastian@kde.org) |
|
7 * (C) 1999 Lars Knoll (knoll@kde.org) |
|
8 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
|
9 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. |
|
10 * |
|
11 * This library is free software; you can redistribute it and/or |
|
12 * modify it under the terms of the GNU Library General Public |
|
13 * License as published by the Free Software Foundation; either |
|
14 * version 2 of the License, or (at your option) any later version. |
|
15 * |
|
16 * This library is distributed in the hope that it will be useful, |
|
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
19 * Library General Public License for more details. |
|
20 * |
|
21 * You should have received a copy of the GNU Library General Public License |
|
22 * along with this library; see the file COPYING.LIB. If not, write to |
|
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
24 * Boston, MA 02110-1301, USA. |
|
25 */ |
|
26 #include "config.h" |
|
27 #include "HTMLTableCaptionElement.h" |
|
28 |
|
29 #include "CSSPropertyNames.h" |
|
30 #include "HTMLNames.h" |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 using namespace HTMLNames; |
|
35 |
|
36 HTMLTableCaptionElement::HTMLTableCaptionElement(Document *doc) |
|
37 : HTMLTablePartElement(captionTag, doc) |
|
38 { |
|
39 } |
|
40 |
|
41 bool HTMLTableCaptionElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const |
|
42 { |
|
43 if (attrName == alignAttr) { |
|
44 result = eCaption; |
|
45 return false; |
|
46 } |
|
47 |
|
48 return HTMLElement::mapToEntry(attrName, result); |
|
49 } |
|
50 |
|
51 void HTMLTableCaptionElement::parseMappedAttribute(MappedAttribute *attr) |
|
52 { |
|
53 if (attr->name() == alignAttr) { |
|
54 if (!attr->value().isEmpty()) |
|
55 addCSSProperty(attr, CSS_PROP_CAPTION_SIDE, attr->value()); |
|
56 } else |
|
57 HTMLElement::parseMappedAttribute(attr); |
|
58 } |
|
59 |
|
60 String HTMLTableCaptionElement::align() const |
|
61 { |
|
62 return getAttribute(alignAttr); |
|
63 } |
|
64 |
|
65 void HTMLTableCaptionElement::setAlign(const String &value) |
|
66 { |
|
67 setAttribute(alignAttr, value); |
|
68 } |
|
69 |
|
70 } |