+2006-05-16 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by andersca.
+
+ Autogenerate JSHTMLMetaElement.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=8938
+
+ * fast/dom/HTMLMetaElement: Added.
+ * fast/dom/HTMLMetaElement/meta-attributes-expected.txt: Added.
+ * fast/dom/HTMLMetaElement/meta-attributes.html: Added.
+
2006-05-15 Geoffrey Garen <ggaren@apple.com>
- Tests for JavaScript reserved words and the 'debugger' statement
--- /dev/null
+You should see 5 lines with "SUCCESS" below:
+SUCCESS (value: "[object META]")
+
+SUCCESS (value: "foo")
+
+SUCCESS (value: "bar")
+
+SUCCESS (value: "content-type")
+
+SUCCESS (value: "text/html; charset=UTF-8")
+
+
--- /dev/null
+<html>
+<head>
+<meta id="test" name="foo" scheme="bar" http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+You should see 5 lines with "SUCCESS" below:
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+function checkExpected(actual, expected)
+{
+ if (actual != expected)
+ document.writeln("<p>FAILURE: expected \"" + expected + "\", actual \"" + actual + "\"</p>");
+ else
+ document.writeln("<p>SUCCESS (value: \"" + actual + "\")</p>");
+}
+
+var metaTag = document.getElementById("test");
+checkExpected(metaTag, "[object META]");
+checkExpected(metaTag.name, "foo");
+checkExpected(metaTag.scheme, "bar");
+checkExpected(metaTag.httpEquiv, "content-type");
+checkExpected(metaTag.content, "text/html; charset=UTF-8");
+</script>
+
+</body>
+</html>
+2006-05-16 Eric Seidel <eseidel@apple.com>
+
+ Reviewed by andersca.
+
+ Autogenerate JSHTMLMetaElement.
+ http://bugzilla.opendarwin.org/show_bug.cgi?id=8938
+
+ Test: fast/dom/HTMLMetaElement/meta-attributes.html
+
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSHTMLElementWrapperFactory.cpp:
+ (WebCore::createMetaWrapper):
+ (WebCore::createJSWrapper):
+ * bindings/js/kjs_html.cpp:
+ (KJS::):
+ (KJS::JSHTMLElement::classInfo):
+ (KJS::JSHTMLElement::accessors):
+ * bindings/js/kjs_html.h:
+ * html/HTMLMetaElement.h:
+
2006-05-16 David Hyatt <hyatt@apple.com>
Bug 8936, eliminate WebTextRendererFactory and convert it over to the
JSElement.h \
JSEvent.h \
JSEntity.h \
- JSHTMLDocument.h \
JSHTMLCanvasElement.h \
+ JSHTMLDocument.h \
JSHTMLElement.h \
+ JSHTMLMetaElement.h \
JSKeyboardEvent.h \
JSMouseEvent.h \
JSMutationEvent.h \
A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E734B0A199C77007FB8C5 /* CSSSelector.h */; };
A80E73530A199C77007FB8C5 /* StyleBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E734C0A199C77007FB8C5 /* StyleBase.cpp */; };
A80E79970A19BD21007FB8C5 /* Rect.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E79960A19BD21007FB8C5 /* Rect.idl */; };
+ A80E79FD0A19C307007FB8C5 /* HTMLMetaElement.idl in Resources */ = {isa = PBXBuildFile; fileRef = A80E79FC0A19C307007FB8C5 /* HTMLMetaElement.idl */; };
+ A80E7A170A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */; };
+ A80E7A180A19C3D6007FB8C5 /* JSHTMLMetaElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */; };
A81369CA097374F600D74463 /* HTMLIsIndexElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369AE097374F500D74463 /* HTMLIsIndexElement.h */; };
A81369CB097374F600D74463 /* HTMLIsIndexElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */; };
A81369CC097374F600D74463 /* HTMLInputElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A81369B0097374F500D74463 /* HTMLInputElement.h */; };
A80E734B0A199C77007FB8C5 /* CSSSelector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSSelector.h; sourceTree = "<group>"; };
A80E734C0A199C77007FB8C5 /* StyleBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleBase.cpp; sourceTree = "<group>"; };
A80E79960A19BD21007FB8C5 /* Rect.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = Rect.idl; sourceTree = "<group>"; };
+ A80E79FC0A19C307007FB8C5 /* HTMLMetaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLMetaElement.idl; sourceTree = "<group>"; };
+ A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMetaElement.cpp; sourceTree = "<group>"; };
+ A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLMetaElement.h; sourceTree = "<group>"; };
A810E39308A4160F00333D98 /* KCanvasTreeDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KCanvasTreeDebug.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A810E39408A4160F00333D98 /* KCanvasTreeDebug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasTreeDebug.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
A8122C7E08D564B000844FA3 /* GetSVGDocument.idl */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = GetSVGDocument.idl; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
14CF7B3109F6ECD700EB3665 /* JSCSSRule.cpp */,
14CF7B3209F6ECD700EB3665 /* JSCSSRule.h */,
142011B40A003133008303F9 /* JSCSSStyleDeclaration.cpp */,
+ 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */,
14CF78A309F58CBF00EB3665 /* JSCSSValue.cpp */,
14CF78A509F58CD800EB3665 /* JSCSSValue.h */,
659DDC8009E198BA001BF3C6 /* JSDocument.cpp */,
1A494E330A12358B00FDAFC1 /* JSHTMLDocument.h */,
1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */,
1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */,
+ A80E7A150A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp */,
+ A80E7A160A19C3D6007FB8C5 /* JSHTMLMetaElement.h */,
A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */,
A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */,
A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */,
65DF31F009D1CC60000BE325 /* JSText.h */,
A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */,
A86629C909DA2B47009633A5 /* JSUIEvent.h */,
+ 65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */,
+ 65DF31F209D1CC60000BE325 /* JSWheelEvent.h */,
+ 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */,
+ 656581D809D1508D000E61D7 /* JSXMLSerializer.lut.h */,
1A762C6B0A074F2600989F5B /* JSXPathEvaluator.cpp */,
1A762C6C0A074F2600989F5B /* JSXPathEvaluator.h */,
1A762C6D0A074F2600989F5B /* JSXPathExpression.cpp */,
1A762C700A074F2600989F5B /* JSXPathNSResolver.h */,
1A762C710A074F2600989F5B /* JSXPathResult.cpp */,
1A762C720A074F2600989F5B /* JSXPathResult.h */,
- 65DF31F109D1CC60000BE325 /* JSWheelEvent.cpp */,
- 65DF31F209D1CC60000BE325 /* JSWheelEvent.h */,
- 656581D709D1508D000E61D7 /* JSXMLHttpRequest.lut.h */,
- 656581D809D1508D000E61D7 /* JSXMLSerializer.lut.h */,
656581D909D1508D000E61D7 /* JSXSLTProcessor.lut.h */,
656581DA09D1508D000E61D7 /* kjs_css.lut.h */,
656581DB09D1508D000E61D7 /* kjs_dom.lut.h */,
656581EB09D1508D000E61D7 /* XLinkNames.h */,
1A7629D30A07425100989F5B /* XPathGrammar.cpp */,
1A7629D40A07425100989F5B /* XPathGrammar.h */,
- 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */,
);
name = "Derived Sources";
path = DerivedSources/WebCore;
A8EA79E80A1916DF00A8EF5F /* HTMLMenuElement.h */,
A871DC1B0A15205700B12A68 /* HTMLMetaElement.cpp */,
A871DC180A15205700B12A68 /* HTMLMetaElement.h */,
+ A80E79FC0A19C307007FB8C5 /* HTMLMetaElement.idl */,
A8CFF79F0A156978000A4234 /* HTMLModElement.cpp */,
A8CFF79D0A156978000A4234 /* HTMLModElement.h */,
A8DF3FCD097FA0FB0052981B /* HTMLNameCollection.cpp */,
A80E73500A199C77007FB8C5 /* StyleBase.h in Headers */,
A80E73510A199C77007FB8C5 /* StyleList.h in Headers */,
A80E73520A199C77007FB8C5 /* CSSSelector.h in Headers */,
+ A80E7A180A19C3D6007FB8C5 /* JSHTMLMetaElement.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1A494E2A0A12354300FDAFC1 /* HTMLDocument.idl in Resources */,
1A494ED60A123F1A00FDAFC1 /* DocumentFragment.idl in Resources */,
A80E79970A19BD21007FB8C5 /* Rect.idl in Resources */,
+ A80E79FD0A19C307007FB8C5 /* HTMLMetaElement.idl in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A80E734D0A199C77007FB8C5 /* StyleList.cpp in Sources */,
A80E734F0A199C77007FB8C5 /* CSSSelector.cpp in Sources */,
A80E73530A199C77007FB8C5 /* StyleBase.cpp in Sources */,
+ A80E7A170A19C3D6007FB8C5 /* JSHTMLMetaElement.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "JSHTMLElementWrapperFactory.h"
#include "HTMLCanvasElement.h"
+#include "HTMLMetaElement.h"
#include "HTMLNames.h"
#include "JSHTMLCanvasElement.h"
+#include "JSHTMLMetaElement.h"
#include "JSHTMLElement.h"
#include "kjs_html.h"
return new JSHTMLCanvasElement(exec, static_cast<HTMLCanvasElement*>(element.get()));
}
+static DOMNode* createMetaWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
+{
+ return new JSHTMLMetaElement(exec, static_cast<HTMLMetaElement*>(element.get()));
+}
+
DOMNode* createJSWrapper(ExecState* exec, PassRefPtr<HTMLElement> element)
{
static HashMap<WebCore::AtomicStringImpl*, CreateHTMLElementWrapperFunction> map;
if (map.isEmpty()) {
map.set(canvasTag.localName().impl(), createCanvasWrapper);
+ map.set(metaTag.localName().impl(), createMetaWrapper);
}
CreateHTMLElementWrapperFunction f = map.get(element->localName().impl());
if (f)
const ClassInfo JSHTMLElement::map_info = { "HTMLMapElement", &JSHTMLElement::info, &HTMLMapElementTable, 0 };
const ClassInfo JSHTMLElement::marquee_info = { "HTMLMarqueeElement", &JSHTMLElement::info, &HTMLMarqueeElementTable, 0 };
const ClassInfo JSHTMLElement::menu_info = { "HTMLMenuElement", &JSHTMLElement::info, &HTMLMenuElementTable, 0 };
-const ClassInfo JSHTMLElement::meta_info = { "HTMLMetaElement", &JSHTMLElement::info, &HTMLMetaElementTable, 0 };
const ClassInfo JSHTMLElement::mod_info = { "HTMLModElement", &JSHTMLElement::info, &HTMLModElementTable, 0 };
const ClassInfo JSHTMLElement::object_info = { "HTMLObjectElement", &JSHTMLElement::info, &HTMLObjectElementTable, 0 };
const ClassInfo JSHTMLElement::ol_info = { "HTMLOListElement", &JSHTMLElement::info, &HTMLOListElementTable, 0 };
classInfoMap.set(mapTag.localName().impl(), &map_info);
classInfoMap.set(marqueeTag.localName().impl(), &marquee_info);
classInfoMap.set(menuTag.localName().impl(), &menu_info);
- classInfoMap.set(metaTag.localName().impl(), &meta_info);
classInfoMap.set(objectTag.localName().impl(), &object_info);
classInfoMap.set(olTag.localName().impl(), &ol_info);
classInfoMap.set(optgroupTag.localName().impl(), &optGroup_info);
const JSHTMLElement::Accessors JSHTMLElement::head_accessors = { &JSHTMLElement::headGetter, &JSHTMLElement::headSetter };
const JSHTMLElement::Accessors JSHTMLElement::link_accessors = { &JSHTMLElement::linkGetter, &JSHTMLElement::linkSetter };
const JSHTMLElement::Accessors JSHTMLElement::title_accessors = { &JSHTMLElement::titleGetter, &JSHTMLElement::titleSetter };
-const JSHTMLElement::Accessors JSHTMLElement::meta_accessors = { &JSHTMLElement::metaGetter, &JSHTMLElement::metaSetter };
const JSHTMLElement::Accessors JSHTMLElement::base_accessors = { &JSHTMLElement::baseGetter, &JSHTMLElement::baseSetter };
const JSHTMLElement::Accessors JSHTMLElement::isIndex_accessors = { &JSHTMLElement::isIndexGetter, &JSHTMLElement::isIndexSetter };
const JSHTMLElement::Accessors JSHTMLElement::style_accessors = { &JSHTMLElement::styleGetter, &JSHTMLElement::styleSetter };
accessorMap.add(mapTag.localName().impl(), &map_accessors);
accessorMap.add(marqueeTag.localName().impl(), &marquee_accessors);
accessorMap.add(menuTag.localName().impl(), &menu_accessors);
- accessorMap.add(metaTag.localName().impl(), &meta_accessors);
accessorMap.add(objectTag.localName().impl(), &object_accessors);
accessorMap.add(olTag.localName().impl(), &ol_accessors);
accessorMap.add(optionTag.localName().impl(), &option_accessors);
return jsUndefined();
}
-JSValue *JSHTMLElement::metaGetter(ExecState* exec, int token) const
-{
- HTMLMetaElement& meta = *static_cast<HTMLMetaElement*>(impl());
- switch (token) {
- case MetaContent: return jsString(meta.content());
- case MetaHttpEquiv: return jsString(meta.httpEquiv());
- case MetaName: return jsString(meta.name());
- case MetaScheme: return jsString(meta.scheme());
- }
- return jsUndefined();
-}
-
JSValue *JSHTMLElement::baseGetter(ExecState* exec, int token) const
{
HTMLBaseElement& base = *static_cast<HTMLBaseElement*>(impl());
title.setText(str);
}
-void JSHTMLElement::metaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
-{
- HTMLMetaElement& meta = *static_cast<HTMLMetaElement*>(impl());
- switch (token) {
- case MetaContent: { meta.setContent(str); return; }
- case MetaHttpEquiv: { meta.setHttpEquiv(str); return; }
- case MetaName: { meta.setName(str); return; }
- case MetaScheme: { meta.setScheme(str); return; }
- }
-}
-
void JSHTMLElement::baseSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str)
{
HTMLBaseElement& base = *static_cast<HTMLBaseElement*>(impl());
static const ClassInfo info;
static const ClassInfo html_info, head_info, link_info, title_info,
- meta_info, base_info, isIndex_info, style_info, body_info, form_info,
+ base_info, isIndex_info, style_info, body_info, form_info,
select_info, optGroup_info, option_info, input_info, textArea_info,
button_info, label_info, fieldSet_info, legend_info, ul_info, ol_info,
dl_info, dir_info, menu_info, li_info, div_info, p_info, heading_info,
struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
const Accessors* accessors() const;
static const Accessors html_accessors, head_accessors, link_accessors, title_accessors,
- meta_accessors, base_accessors, isIndex_accessors, style_accessors, body_accessors, form_accessors,
+ base_accessors, isIndex_accessors, style_accessors, body_accessors, form_accessors,
select_accessors, optGroup_accessors, option_accessors, input_accessors, textArea_accessors,
button_accessors, label_accessors, fieldSet_accessors, legend_accessors, ul_accessors, ol_accessors,
dl_accessors, dir_accessors, menu_accessors, li_accessors, div_accessors, p_accessors, heading_accessors,
void linkSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
JSValue *titleGetter(ExecState* exec, int token) const;
void titleSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
- JSValue *metaGetter(ExecState* exec, int token) const;
- void metaSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
JSValue *baseGetter(ExecState* exec, int token) const;
void baseSetter(ExecState *exec, int token, JSValue *value, const WebCore::String& str);
JSValue *isIndexGetter(ExecState* exec, int token) const;
class HTMLMetaElement : public HTMLElement
{
public:
- HTMLMetaElement(Document *doc);
+ HTMLMetaElement(Document*);
~HTMLMetaElement();
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+module html {
+
+ interface [LegacyParent=KJS::JSHTMLElement] HTMLMetaElement : HTMLElement {
+ attribute DOMString content;
+ attribute DOMString httpEquiv;
+ attribute DOMString name;
+ attribute DOMString scheme;
+ };
+
+}