http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
Some HTML DOM attributes have incorrect types
Adjust idl and dom source code for HTMLImageElement and
HTMLBaseFontElement to choose correct type for
HTMLImageElement::border and HTMLBaseFontElement::size
attributes.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15653
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-27 Rob Buis <buis@kde.org>
+
+ Reviewed by Anders.
+
+ Testcase for and from:
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
+ Some HTML DOM attributes have incorrect types
+
+ * fast/dom/html-attribute-types-expected.txt: Added.
+ * fast/dom/html-attribute-types.html: Added.
+
2006-07-27 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
--- /dev/null
+This checks the types of some HTML DOM attributes whose types currently clash with our implementation.
+PASS typeof img.border is 'string'
+PASS typeof pre.width is 'number'
+PASS typeof basefont.size is 'number'
+
--- /dev/null
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+var img;
+var pre;
+var basefont;
+
+function test() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ img = document.createElement('img');
+ shouldBe("typeof img.border", "'string'");
+
+ pre = document.createElement('pre');
+ shouldBe("typeof pre.width", "'number'");
+
+ basefont = document.createElement('basefont');
+ shouldBe("typeof basefont.size", "'number'")
+}
+</script>
+</head>
+<body onload="test()">
+This checks the types of some HTML DOM attributes whose types currently clash with our implementation.
+<div id="console"></div>
+</body>
+
+2006-07-27 Rob Buis <buis@kde.org>
+
+ Reviewed by Anders.
+
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
+ Some HTML DOM attributes have incorrect types
+
+ Adjust idl and dom source code for HTMLImageElement and
+ HTMLBaseFontElement to choose correct type for
+ HTMLImageElement::border and HTMLBaseFontElement::size
+ attributes.
+
+ * html/HTMLBaseFontElement.cpp:
+ (WebCore::HTMLBaseFontElement::size):
+ (WebCore::HTMLBaseFontElement::setSize):
+ * html/HTMLBaseFontElement.h:
+ * html/HTMLBaseFontElement.idl:
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::border):
+ (WebCore::HTMLImageElement::setBorder):
+ * html/HTMLImageElement.h:
+ * html/HTMLImageElement.idl:
+
2006-07-27 Justin Garcia <justin.garcia@apple.com>
Reviewed by levi
setAttribute(faceAttr, value);
}
-String HTMLBaseFontElement::size() const
+int HTMLBaseFontElement::size() const
{
- return getAttribute(sizeAttr);
+ return getAttribute(sizeAttr).toInt();
}
-void HTMLBaseFontElement::setSize(const String &value)
+void HTMLBaseFontElement::setSize(int value)
{
- setAttribute(sizeAttr, value);
+ setAttribute(sizeAttr, String::number(value));
}
}
String face() const;
void setFace(const String &);
- String size() const;
- void setSize(const String &);
+ int size() const;
+ void setSize(int);
};
} //namespace
interface [LegacyParent=KJS::JSHTMLElement] HTMLBaseFontElement : HTMLElement {
attribute DOMString color;
attribute DOMString face;
-
- // FIXME: According to the DOM spec, this should be long instead of DOMString
- // see http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
- attribute DOMString size;
+ attribute long size;
};
}
setAttribute(altAttr, value);
}
-int HTMLImageElement::border() const
+String HTMLImageElement::border() const
{
- // ### return value in pixels
- return getAttribute(borderAttr).toInt();
+ return getAttribute(borderAttr);
}
-void HTMLImageElement::setBorder(int value)
+void HTMLImageElement::setBorder(const String &value)
{
- setAttribute(borderAttr, String::number(value));
+ setAttribute(borderAttr, value);
}
void HTMLImageElement::setHeight(int value)
String alt() const;
void setAlt(const String&);
- int border() const;
- void setBorder(int);
+ String border() const;
+ void setBorder(const String&);
void setHeight(int);
attribute DOMString name;
attribute DOMString align;
attribute DOMString alt;
- // FIXME: According to the DOM spec border should be of type DOMString
- // see http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
- attribute long border;
+ attribute DOMString border;
attribute long height;
attribute long hspace;
attribute boolean isMap;