HTMLPreElement::create(const QualifiedName& tagName, Document* document)
+{
+ return adoptRef(new HTMLPreElement(tagName, document));
+}
+
+bool HTMLPreElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
+{
+ if (attrName == widthAttr || attrName == wrapAttr) {
+ result = ePre;
+ return false;
+ }
+ return HTMLElement::mapToEntry(attrName, result);
+}
+
+void HTMLPreElement::parseMappedAttribute(Attribute* attr)
+{
+ if (attr->name() == widthAttr) {
+ // FIXME: Implement this some day. Width on a is the # of characters that
+ // we should size the pre to. We basically need to take the width of a space,
+ // multiply by the value of the attribute and then set that as the width CSS
+ // property.
+ } else if (attr->name() == wrapAttr) {
+ if (!attr->value().isNull())
+ addCSSProperty(attr, CSSPropertyWhiteSpace, CSSValuePreWrap);
+ } else
+ return HTMLElement::parseMappedAttribute(attr);
+}
+
+}