Commit 16885ff7 authored by weinig's avatar weinig
Browse files

LayoutTests:

        Reviewed by Adam and Darin.

        - update results for http://bugs.webkit.org/show_bug.cgi?id=13791
          to account for new JSHTMLElements that are being autogenerated and
          can now produce constructors.

        * fast/dom/Window/element-constructors-on-window-expected.txt:
        * fast/dom/Window/window-properties-expected.txt:

WebCore:

        Reviewed by Adam and Darin.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=13791
        Autogenerate the JS bindings for the HTMLIFrameElement and HTMLFrameElement.

        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSHTMLAnchorElementCustom.cpp:
        * bindings/js/JSHTMLElementWrapperFactory.cpp:
        * bindings/js/kjs_html.cpp:
        (KJS::):
        (KJS::JSHTMLElement::classInfo):
        (KJS::JSHTMLElement::accessors):
        (KJS::HTMLElementFunction::callAsFunction):
        * bindings/js/kjs_html.h:
        (KJS::JSHTMLElement::):
        * bindings/scripts/CodeGeneratorJS.pm:
        * html/HTMLFrameElement.idl:
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::location):
        * html/HTMLFrameElementBase.h:
        * html/HTMLFrameOwnerElement.h:
        (WebCore::HTMLFrameOwnerElement::contentWindow):
        * html/HTMLIFrameElement.idl:
        * page/DOMWindow.idl:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8cb65d5a
2007-05-21 Sam Weinig <sam@webkit.org>
Reviewed by Adam and Darin.
- update results for http://bugs.webkit.org/show_bug.cgi?id=13791
to account for new JSHTMLElements that are being autogenerated and
can now produce constructors.
* fast/dom/Window/element-constructors-on-window-expected.txt:
* fast/dom/Window/window-properties-expected.txt:
2007-05-19 Mitz Pettel <mitz@webkit.org>
 
Reviewed by Dave Hyatt.
......@@ -30,7 +30,7 @@ HTMLFontElement: [object HTMLFontElementConstructor]
HTMLFormElement: [object HTMLFormElementConstructor]
HTMLFrameElement: undefined
HTMLFrameElement: [object HTMLFrameElementConstructor]
HTMLFrameSetElement: undefined
......@@ -42,7 +42,7 @@ HTMLHRElement: [object HTMLHRElementConstructor]
HTMLHtmlElement: [object HTMLHtmlElementConstructor]
HTMLIFrameElement: undefined
HTMLIFrameElement: [object HTMLIFrameElementConstructor]
HTMLImageElement: [object HTMLImageElementConstructor]
......
......@@ -528,6 +528,8 @@ window.HTMLFontElement [object HTMLFontElementConstructor]
window.HTMLFontElement.prototype [printed above as window.Element.prototype]
window.HTMLFormElement [object HTMLFormElementConstructor]
window.HTMLFormElement.prototype [printed above as window.Element.prototype]
window.HTMLFrameElement [object HTMLFrameElementConstructor]
window.HTMLFrameElement.prototype [printed above as window.Element.prototype]
window.HTMLHRElement [object HTMLHRElementConstructor]
window.HTMLHRElement.prototype [printed above as window.Element.prototype]
window.HTMLHeadElement [object HTMLHeadElementConstructor]
......@@ -536,6 +538,8 @@ window.HTMLHeadingElement [object HTMLHeadingElementConstructor]
window.HTMLHeadingElement.prototype [printed above as window.Element.prototype]
window.HTMLHtmlElement [object HTMLHtmlElementConstructor]
window.HTMLHtmlElement.prototype [printed above as window.Element.prototype]
window.HTMLIFrameElement [object HTMLIFrameElementConstructor]
window.HTMLIFrameElement.prototype [printed above as window.Element.prototype]
window.HTMLImageElement [object HTMLImageElementConstructor]
window.HTMLImageElement.prototype [printed above as window.Element.prototype]
window.HTMLInputElement [object HTMLInputElementConstructor]
......
2007-05-21 Sam Weinig <sam@webkit.org>
Reviewed by Adam and Darin.
Patch for http://bugs.webkit.org/show_bug.cgi?id=13791
Autogenerate the JS bindings for the HTMLIFrameElement and HTMLFrameElement.
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSHTMLAnchorElementCustom.cpp:
* bindings/js/JSHTMLElementWrapperFactory.cpp:
* bindings/js/kjs_html.cpp:
(KJS::):
(KJS::JSHTMLElement::classInfo):
(KJS::JSHTMLElement::accessors):
(KJS::HTMLElementFunction::callAsFunction):
* bindings/js/kjs_html.h:
(KJS::JSHTMLElement::):
* bindings/scripts/CodeGeneratorJS.pm:
* html/HTMLFrameElement.idl:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::location):
* html/HTMLFrameElementBase.h:
* html/HTMLFrameOwnerElement.h:
(WebCore::HTMLFrameOwnerElement::contentWindow):
* html/HTMLIFrameElement.idl:
* page/DOMWindow.idl:
2007-05-21 Lars Knoll <lars@trolltech.com>
 
Reviewed by Zack.
......@@ -331,38 +331,40 @@ all : \
JSHTMLBRElement.h \
JSHTMLButtonElement.h \
JSHTMLCanvasElement.h \
JSHTMLDListElement.h \
JSHTMLDirectoryElement.h \
JSHTMLDivElement.h \
JSHTMLDListElement.h \
JSHTMLDocument.h \
JSHTMLElement.h \
JSHTMLFieldSetElement.h \
JSHTMLFontElement.h \
JSHTMLFormElement.h \
JSHTMLFrameElement.h \
JSHTMLHRElement.h \
JSHTMLHeadElement.h \
JSHTMLHeadingElement.h \
JSHTMLHRElement.h \
JSHTMLImageElement.h \
JSHTMLIsIndexElement.h \
JSHTMLHtmlElement.h \
JSHTMLIFrameElement.h \
JSHTMLImageElement.h \
JSHTMLInputElement.h \
JSHTMLInputElementBaseTable.cpp \
JSHTMLIsIndexElement.h \
JSHTMLLIElement.h \
JSHTMLLabelElement.h \
JSHTMLLegendElement.h \
JSHTMLLIElement.h \
JSHTMLLinkElement.h \
JSHTMLMenuElement.h \
JSHTMLOptionElement.h \
JSHTMLOptionsCollection.h \
JSHTMLOptGroupElement.h \
JSHTMLQuoteElement.h \
JSHTMLMapElement.h \
JSHTMLMenuElement.h \
JSHTMLMetaElement.h \
JSHTMLModElement.h \
JSHTMLOListElement.h \
JSHTMLOptGroupElement.h \
JSHTMLOptionElement.h \
JSHTMLOptionsCollection.h \
JSHTMLParagraphElement.h \
JSHTMLParamElement.h \
JSHTMLPreElement.h \
JSHTMLQuoteElement.h \
JSHTMLScriptElement.h \
JSHTMLSelectElement.h \
JSHTMLStyleElement.h \
......
......@@ -2760,6 +2760,10 @@
BC1A37BF097C715F0019F3D8 /* DOMUtility.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC1A37A9097C715F0019F3D8 /* DOMUtility.mm */; };
BC1A37C0097C715F0019F3D8 /* DOMViews.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A37AA097C715F0019F3D8 /* DOMViews.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC3FCAA90AC3DB5800BA54AD /* PlatformScrollBar.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */; settings = {ATTRIBUTES = (); }; };
BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */; };
BC4918C70BFEA050009D6316 /* JSHTMLFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4918C10BFEA050009D6316 /* JSHTMLFrameElement.h */; };
BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4918C20BFEA050009D6316 /* JSHTMLIFrameElement.cpp */; };
BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4918C30BFEA050009D6316 /* JSHTMLIFrameElement.h */; };
BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */; };
BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */; };
BC6D6DD209AF906600F59759 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC6D6DD009AF906600F59759 /* Font.cpp */; };
......@@ -5982,6 +5986,10 @@
BC1A37AA097C715F0019F3D8 /* DOMViews.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMViews.h; sourceTree = "<group>"; };
BC3B364705C9D5E200E42902 /* AtomicStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AtomicStringList.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC3FCAA80AC3DB5800BA54AD /* PlatformScrollBar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformScrollBar.h; sourceTree = "<group>"; };
BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameElement.cpp; sourceTree = "<group>"; };
BC4918C10BFEA050009D6316 /* JSHTMLFrameElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLFrameElement.h; sourceTree = "<group>"; };
BC4918C20BFEA050009D6316 /* JSHTMLIFrameElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLIFrameElement.cpp; sourceTree = "<group>"; };
BC4918C30BFEA050009D6316 /* JSHTMLIFrameElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLIFrameElement.h; sourceTree = "<group>"; };
BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLParserErrorCodes.h; sourceTree = "<group>"; };
BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserErrorCodes.cpp; sourceTree = "<group>"; };
BC5EC1760A507E3E006007F5 /* view-source.css */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = "view-source.css"; sourceTree = "<group>"; };
......@@ -6330,6 +6338,10 @@
14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
isa = PBXGroup;
children = (
BC4918C00BFEA050009D6316 /* JSHTMLFrameElement.cpp */,
BC4918C10BFEA050009D6316 /* JSHTMLFrameElement.h */,
BC4918C20BFEA050009D6316 /* JSHTMLIFrameElement.cpp */,
BC4918C30BFEA050009D6316 /* JSHTMLIFrameElement.h */,
65DF31D809D1C122000BE325 /* JSAttr.cpp */,
65DF31D909D1C123000BE325 /* JSAttr.h */,
65DF323309D1DE65000BE325 /* JSCanvasGradient.cpp */,
......@@ -11323,6 +11335,8 @@
BC06EDA00BFD660600856E9D /* JSHTMLTableRowElement.h in Headers */,
BC06EDE40BFD6D0D00856E9D /* JSHTMLTableCellElement.h in Headers */,
BC06EE050BFD71AA00856E9D /* JSHTMLTableElement.h in Headers */,
BC4918C70BFEA050009D6316 /* JSHTMLFrameElement.h in Headers */,
BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -12705,6 +12719,8 @@
BC06ED9F0BFD660600856E9D /* JSHTMLTableRowElement.cpp in Sources */,
BC06EDE30BFD6D0D00856E9D /* JSHTMLTableCellElement.cpp in Sources */,
BC06EE040BFD71AA00856E9D /* JSHTMLTableElement.cpp in Sources */,
BC4918C60BFEA050009D6316 /* JSHTMLFrameElement.cpp in Sources */,
BC4918C80BFEA050009D6316 /* JSHTMLIFrameElement.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/*
* Copyright (C) 2007 Apple, Inc.
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......
......@@ -35,10 +35,12 @@
#include "HTMLFieldSetElement.h"
#include "HTMLFontElement.h"
#include "HTMLFormElement.h"
#include "HTMLFrameElement.h"
#include "HTMLHRElement.h"
#include "HTMLHeadElement.h"
#include "HTMLHeadingElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLIFrameElement.h"
#include "HTMLImageElement.h"
#include "HTMLInputElement.h"
#include "HTMLIsIndexElement.h"
......@@ -88,10 +90,12 @@
#include "JSHTMLFieldSetElement.h"
#include "JSHTMLFontElement.h"
#include "JSHTMLFormElement.h"
#include "JSHTMLFrameElement.h"
#include "JSHTMLHRElement.h"
#include "JSHTMLHeadElement.h"
#include "JSHTMLHeadingElement.h"
#include "JSHTMLHtmlElement.h"
#include "JSHTMLIFrameElement.h"
#include "JSHTMLImageElement.h"
#include "JSHTMLInputElement.h"
#include "JSHTMLIsIndexElement.h"
......@@ -145,20 +149,22 @@ typedef DOMNode* (*CreateHTMLElementWrapperFunction)(ExecState*, PassRefPtr<HTML
macro(body, Body) \
macro(br, BR) \
macro(button, Button) \
macro(caption, TableCaption) \
macro(canvas, Canvas) \
macro(caption, TableCaption) \
macro(col, TableCol) \
macro(del, Mod) \
macro(dir, Directory) \
macro(div, Div) \
macro(dl, DList) \
macro(fieldset, FieldSet) \
macro(form, Form) \
macro(font, Font) \
macro(form, Form) \
macro(frame, Frame) \
macro(h1, Heading) \
macro(head, Head) \
macro(hr, HR) \
macro(html, Html) \
macro(iframe, IFrame) \
macro(img, Image) \
macro(input, Input) \
macro(isindex, IsIndex) \
......
......@@ -410,11 +410,10 @@ void JSHTMLDocument::putValueProperty(ExecState* exec, int token, JSValue *value
// -------------------------------------------------------------------------
const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, &HTMLElementTable, 0 };
const ClassInfo JSHTMLElement::embed_info = { "HTMLEmbedElement", &JSHTMLElement::info, &HTMLEmbedElementTable, 0 };
const ClassInfo JSHTMLElement::frameSet_info = { "HTMLFrameSetElement", &JSHTMLElement::info, &HTMLFrameSetElementTable, 0 };
const ClassInfo JSHTMLElement::frame_info = { "HTMLFrameElement", &JSHTMLElement::info, &HTMLFrameElementTable, 0 };
const ClassInfo JSHTMLElement::iFrame_info = { "HTMLIFrameElement", &JSHTMLElement::info, &HTMLIFrameElementTable, 0 };
const ClassInfo JSHTMLElement::info = { "HTMLElement", &JSElement::info, &HTMLElementTable, 0 };
const ClassInfo JSHTMLElement::marquee_info = { "HTMLMarqueeElement", &JSHTMLElement::info, &HTMLMarqueeElementTable, 0 };
const ClassInfo JSHTMLElement::object_info = { "HTMLObjectElement", &JSHTMLElement::info, &HTMLObjectElementTable, 0 };
......@@ -423,9 +422,7 @@ const ClassInfo* JSHTMLElement::classInfo() const
static HashMap<AtomicStringImpl*, const ClassInfo*> classInfoMap;
if (classInfoMap.isEmpty()) {
classInfoMap.set(embedTag.localName().impl(), &embed_info);
classInfoMap.set(frameTag.localName().impl(), &frame_info);
classInfoMap.set(framesetTag.localName().impl(), &frameSet_info);
classInfoMap.set(iframeTag.localName().impl(), &iFrame_info);
classInfoMap.set(marqueeTag.localName().impl(), &marquee_info);
classInfoMap.set(objectTag.localName().impl(), &object_info);
}
......@@ -440,8 +437,6 @@ const ClassInfo* JSHTMLElement::classInfo() const
const JSHTMLElement::Accessors JSHTMLElement::object_accessors = { &JSHTMLElement::objectGetter, &JSHTMLElement::objectSetter };
const JSHTMLElement::Accessors JSHTMLElement::embed_accessors = { &JSHTMLElement::embedGetter, &JSHTMLElement::embedSetter };
const JSHTMLElement::Accessors JSHTMLElement::frameSet_accessors = { &JSHTMLElement::frameSetGetter, &JSHTMLElement::frameSetSetter };
const JSHTMLElement::Accessors JSHTMLElement::frame_accessors = { &JSHTMLElement::frameGetter, &JSHTMLElement::frameSetter };
const JSHTMLElement::Accessors JSHTMLElement::iFrame_accessors = { &JSHTMLElement::iFrameGetter, &JSHTMLElement::iFrameSetter };
const JSHTMLElement::Accessors JSHTMLElement::marquee_accessors = { &JSHTMLElement::marqueeGetter, &JSHTMLElement::marqueeSetter };
const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
......@@ -449,9 +444,7 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
static HashMap<AtomicStringImpl*, const Accessors*> accessorMap;
if (accessorMap.isEmpty()) {
accessorMap.add(embedTag.localName().impl(), &embed_accessors);
accessorMap.add(frameTag.localName().impl(), &frame_accessors);
accessorMap.add(framesetTag.localName().impl(), &frameSet_accessors);
accessorMap.add(iframeTag.localName().impl(), &iFrame_accessors);
accessorMap.add(marqueeTag.localName().impl(), &marquee_accessors);
accessorMap.add(objectTag.localName().impl(), &object_accessors);
}
......@@ -516,36 +509,6 @@ const JSHTMLElement::Accessors* JSHTMLElement::accessors() const
cols KJS::JSHTMLElement::FrameSetCols DontDelete
rows KJS::JSHTMLElement::FrameSetRows DontDelete
@end
@begin HTMLFrameElementTable 9
contentDocument KJS::JSHTMLElement::FrameContentDocument DontDelete|ReadOnly
contentWindow KJS::JSHTMLElement::FrameContentWindow DontDelete|ReadOnly
frameBorder KJS::JSHTMLElement::FrameFrameBorder DontDelete
longDesc KJS::JSHTMLElement::FrameLongDesc DontDelete
marginHeight KJS::JSHTMLElement::FrameMarginHeight DontDelete
marginWidth KJS::JSHTMLElement::FrameMarginWidth DontDelete
name KJS::JSHTMLElement::FrameName DontDelete
noResize KJS::JSHTMLElement::FrameNoResize DontDelete
width KJS::JSHTMLElement::FrameWidth DontDelete|ReadOnly
height KJS::JSHTMLElement::FrameHeight DontDelete|ReadOnly
scrolling KJS::JSHTMLElement::FrameScrolling DontDelete
src KJS::JSHTMLElement::FrameSrc DontDelete
location KJS::JSHTMLElement::FrameLocation DontDelete
@end
@begin HTMLIFrameElementTable 12
align KJS::JSHTMLElement::IFrameAlign DontDelete
contentDocument KJS::JSHTMLElement::IFrameContentDocument DontDelete|ReadOnly
contentWindow KJS::JSHTMLElement::IFrameContentWindow DontDelete|ReadOnly
frameBorder KJS::JSHTMLElement::IFrameFrameBorder DontDelete
height KJS::JSHTMLElement::IFrameHeight DontDelete
longDesc KJS::JSHTMLElement::IFrameLongDesc DontDelete
marginHeight KJS::JSHTMLElement::IFrameMarginHeight DontDelete
marginWidth KJS::JSHTMLElement::IFrameMarginWidth DontDelete
name KJS::JSHTMLElement::IFrameName DontDelete
scrolling KJS::JSHTMLElement::IFrameScrolling DontDelete
src KJS::JSHTMLElement::IFrameSrc DontDelete
width KJS::JSHTMLElement::IFrameWidth DontDelete
@end
@begin HTMLMarqueeElementTable 2
start KJS::JSHTMLElement::MarqueeStart DontDelete|Function 0
stop KJS::JSHTMLElement::MarqueeStop DontDelete|Function 0
......@@ -714,54 +677,6 @@ JSValue *JSHTMLElement::frameSetGetter(ExecState* exec, int token) const
return jsUndefined();
}
JSValue *JSHTMLElement::frameGetter(ExecState* exec, int token) const
{
HTMLFrameElement& frameElement = *static_cast<HTMLFrameElement*>(impl());
switch (token) {
case FrameContentDocument: return checkNodeSecurity(exec,frameElement.contentDocument()) ?
toJS(exec, frameElement.contentDocument()) : jsUndefined();
case FrameContentWindow: return checkNodeSecurity(exec,frameElement.contentDocument())
? Window::retrieve(frameElement.contentFrame())
: jsUndefined();
case FrameFrameBorder: return jsString(frameElement.frameBorder());
case FrameLongDesc: return jsString(frameElement.longDesc());
case FrameMarginHeight: return jsString(frameElement.marginHeight());
case FrameMarginWidth: return jsString(frameElement.marginWidth());
case FrameName: return jsString(frameElement.name());
case FrameNoResize: return jsBoolean(frameElement.noResize());
case FrameWidth: return jsNumber(frameElement.width());
case FrameHeight: return jsNumber(frameElement.height());
case FrameScrolling: return jsString(frameElement.scrolling());
case FrameSrc:
case FrameLocation: return jsString(frameElement.src());
}
return jsUndefined();
}
JSValue *JSHTMLElement::iFrameGetter(ExecState* exec, int token) const
{
HTMLIFrameElement& iFrame = *static_cast<HTMLIFrameElement*>(impl());
switch (token) {
case IFrameAlign: return jsString(iFrame.align());
// ### security check ?
case IFrameContentDocument: return checkNodeSecurity(exec,iFrame.contentDocument()) ?
toJS(exec, iFrame.contentDocument()) : jsUndefined();
case IFrameContentWindow: return checkNodeSecurity(exec,iFrame.contentDocument())
? Window::retrieve(iFrame.contentFrame())
: jsUndefined();
case IFrameFrameBorder: return jsString(iFrame.frameBorder());
case IFrameHeight: return jsString(iFrame.height());
case IFrameLongDesc: return jsString(iFrame.longDesc());
case IFrameMarginHeight: return jsString(iFrame.marginHeight());
case IFrameMarginWidth: return jsString(iFrame.marginWidth());
case IFrameName: return jsString(iFrame.name());
case IFrameScrolling: return jsString(iFrame.scrolling());
case IFrameSrc: return jsString(iFrame.src());
case IFrameWidth: return jsString(iFrame.width());
}
return jsUndefined();
}
JSValue *JSHTMLElement::marqueeGetter(ExecState* exec, int token) const
{
// FIXME: Find out what WinIE exposes as properties and implement this.
......@@ -886,15 +801,15 @@ JSValue *HTMLElementFunction::callAsFunction(ExecState* exec, JSObject* thisObj,
}
}
#if ENABLE(SVG)
else if (element.hasLocalName(objectTag)) {
HTMLObjectElement& object = static_cast<HTMLObjectElement&>(element);
if (id == JSHTMLElement::ObjectGetSVGDocument)
return checkNodeSecurity(exec, object.getSVGDocument(exception)) ? toJS(exec, object.getSVGDocument(exception)) : jsUndefined();
} else if (element.hasLocalName(embedTag)) {
HTMLEmbedElement& embed = static_cast<HTMLEmbedElement&>(element);
if (id == JSHTMLElement::EmbedGetSVGDocument)
return checkNodeSecurity(exec, embed.getSVGDocument(exception)) ? toJS(exec, embed.getSVGDocument(exception)) : jsUndefined();
}
else if (element.hasLocalName(objectTag)) {
HTMLObjectElement& object = static_cast<HTMLObjectElement&>(element);
if (id == JSHTMLElement::ObjectGetSVGDocument)
return checkNodeSecurity(exec, object.getSVGDocument(exception)) ? toJS(exec, object.getSVGDocument(exception)) : jsUndefined();
} else if (element.hasLocalName(embedTag)) {
HTMLEmbedElement& embed = static_cast<HTMLEmbedElement&>(element);
if (id == JSHTMLElement::EmbedGetSVGDocument)
return checkNodeSecurity(exec, embed.getSVGDocument(exception)) ? toJS(exec, embed.getSVGDocument(exception)) : jsUndefined();
}
#endif
return jsUndefined();
......@@ -975,41 +890,6 @@ void JSHTMLElement::frameSetSetter(ExecState* exec, int token, JSValue* value)
}
}
void JSHTMLElement::frameSetter(ExecState* exec, int token, JSValue* value)
{
HTMLFrameElement& frameElement = *static_cast<HTMLFrameElement*>(impl());
switch (token) {
// read-only: FrameContentDocument:
case FrameFrameBorder: { frameElement.setFrameBorder(valueToStringWithNullCheck(exec, value)); return; }
case FrameLongDesc: { frameElement.setLongDesc(valueToStringWithNullCheck(exec, value)); return; }
case FrameMarginHeight: { frameElement.setMarginHeight(valueToStringWithNullCheck(exec, value)); return; }
case FrameMarginWidth: { frameElement.setMarginWidth(valueToStringWithNullCheck(exec, value)); return; }
case FrameName: { frameElement.setName(valueToStringWithNullCheck(exec, value)); return; }
case FrameNoResize: { frameElement.setNoResize(value->toBoolean(exec)); return; }
case FrameScrolling: { frameElement.setScrolling(valueToStringWithNullCheck(exec, value)); return; }
case FrameSrc: { frameElement.setSrc(valueToStringWithNullCheck(exec, value)); return; }
case FrameLocation: { frameElement.setLocation(valueToStringWithNullCheck(exec, value)); return; }
}
}
void JSHTMLElement::iFrameSetter(ExecState* exec, int token, JSValue* value)
{
HTMLIFrameElement& iFrame = *static_cast<HTMLIFrameElement*>(impl());
switch (token) {
case IFrameAlign: { iFrame.setAlign(valueToStringWithNullCheck(exec, value)); return; }
// read-only: IFrameContentDocument
case IFrameFrameBorder: { iFrame.setFrameBorder(valueToStringWithNullCheck(exec, value)); return; }
case IFrameHeight: { iFrame.setHeight(valueToStringWithNullCheck(exec, value)); return; }
case IFrameLongDesc: { iFrame.setLongDesc(valueToStringWithNullCheck(exec, value)); return; }
case IFrameMarginHeight: { iFrame.setMarginHeight(valueToStringWithNullCheck(exec, value)); return; }
case IFrameMarginWidth: { iFrame.setMarginWidth(valueToStringWithNullCheck(exec, value)); return; }
case IFrameName: { iFrame.setName(valueToStringWithNullCheck(exec, value)); return; }
case IFrameScrolling: { iFrame.setScrolling(valueToStringWithNullCheck(exec, value)); return; }
case IFrameSrc: { iFrame.setSrc(valueToStringWithNullCheck(exec, value)); return; }
case IFrameWidth: { iFrame.setWidth(valueToStringWithNullCheck(exec, value)); return; }
}
}
void JSHTMLElement::marqueeSetter(ExecState* exec, int token, JSValue* value)
{
// FIXME: Find out what WinIE supports and implement it.
......
......@@ -76,18 +76,14 @@ namespace KJS {
virtual const ClassInfo* classInfo() const;
static const ClassInfo info;
static const ClassInfo
object_info, embed_info,
frameSet_info, frame_info, iFrame_info, marquee_info;
static const ClassInfo object_info, embed_info, frameSet_info, marquee_info;
// FIXME: Might make sense to combine this with ClassInfo some day.
typedef JSValue* (JSHTMLElement::*GetterFunction)(ExecState*, int token) const;
typedef void (JSHTMLElement::*SetterFunction)(ExecState*, int token, JSValue*);
struct Accessors { GetterFunction m_getter; SetterFunction m_setter; };
const Accessors* accessors() const;
static const Accessors
object_accessors, embed_accessors,
frameSet_accessors, frame_accessors, iFrame_accessors, marquee_accessors;
static const Accessors object_accessors, embed_accessors, frameSet_accessors, marquee_accessors;
JSValue* objectGetter(ExecState* exec, int token) const;
void objectSetter(ExecState*, int token, JSValue*);
......@@ -95,10 +91,6 @@ namespace KJS {
void embedSetter(ExecState*, int token, JSValue*);
JSValue* frameSetGetter(ExecState* exec, int token) const;
void frameSetSetter(ExecState*, int token, JSValue*);
JSValue* frameGetter(ExecState* exec, int token) const;
void frameSetter(ExecState*, int token, JSValue*);
JSValue* iFrameGetter(ExecState* exec, int token) const;
void iFrameSetter(ExecState*, int token, JSValue*);
JSValue* marqueeGetter(ExecState* exec, int token) const;
void marqueeSetter(ExecState*, int token, JSValue*);
......@@ -108,11 +100,7 @@ namespace KJS {
ObjectDeclare, ObjectForm, ObjectCodeBase, ObjectCodeType, ObjectData,
ObjectName, ObjectStandby, ObjectTabIndex, ObjectUseMap, ObjectWidth, ObjectContentDocument, ObjectGetSVGDocument,
EmbedAlign, EmbedHeight, EmbedName, EmbedSrc, EmbedType, EmbedWidth, EmbedGetSVGDocument,
FrameSetCols, FrameSetRows, FrameSrc, FrameLocation, FrameFrameBorder, FrameScrolling,
FrameMarginWidth, FrameLongDesc, FrameMarginHeight, FrameName, FrameContentDocument, FrameContentWindow,
FrameNoResize, FrameWidth, FrameHeight, IFrameLongDesc, IFrameAlign,
IFrameFrameBorder, IFrameSrc, IFrameName, IFrameHeight,
IFrameMarginHeight, IFrameMarginWidth, IFrameScrolling, IFrameWidth, IFrameContentDocument, IFrameContentWindow,
FrameSetCols, FrameSetRows,
MarqueeStart, MarqueeStop,
GetContext,
ElementInnerHTML, ElementId, ElementDir, ElementLang,
......
......@@ -832,6 +832,10 @@ sub GenerateImplementation
if ($attribute->signature->extendedAttributes->{"Custom"}) {
push(@implContent, " case " . WK_ucfirst($name) . "AttrNum:\n");
push(@implContent, " return $name(exec);\n");
} elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
push(@implContent, " case " . WK_ucfirst($name) . "AttrNum:\n");
push(@implContent, " return checkNodeSecurity(exec, imp->contentDocument()) ? " . NativeToJSValue($attribute->signature, $implClassNameForValueConversion, "imp->$name()") . " : jsUndefined();\n");
$implIncludes{"Document.h"} = 1;
} elsif ($attribute->signature->type =~ /Constructor$/) {
my $constructorType = $codeGenerator->StripModule($attribute->signature->type);
$constructorType =~ s/Constructor$//;
......@@ -1381,6 +1385,11 @@ sub NativeToJSValue
return "toJS(exec, WTF::getPtr($value), imp)";
}
if ($type eq "Window") {
$implIncludes{"kjs_window.h"} = 1;
return "Window::retrieve(WTF::getPtr($value))";
}
if ($codeGenerator->IsSVGAnimatedType($type)) {
$value =~ s/\(\)//;
$value .= "Animated()";
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
......@@ -20,7 +20,7 @@
module html {
interface HTMLFrameElement : HTMLElement {
interface [LegacyParent=KJS::JSHTMLElement, GenerateConstructor] HTMLFrameElement : HTMLElement {
attribute [ConvertNullToNullString] DOMString frameBorder;
attribute [ConvertNullToNullString] DOMString longDesc;
......@@ -30,8 +30,19 @@ module html {
attribute boolean noResize;
attribute [ConvertNullToNullString] DOMString scrolling;
attribute [ConvertNullToNullString] DOMString src;
// Introduced in DOM Level 2:
readonly attribute Document contentDocument;
readonly attribute [CheckFrameSecurity] Document contentDocument;
// Extensions
#if defined(LANGUAGE_JAVASCRIPT)
// FIXME: this need not be JS only. See http://bugs.webkit.org/show_bug.cgi?id=13798
readonly attribute [CheckFrameSecurity] Window contentWindow;
#endif
attribute [ConvertNullToNullString] DOMString location;
readonly attribute long width;
readonly attribute long height;
};
......
......@@ -193,6 +193,11 @@ void HTMLFrameElementBase::willRemove()
HTMLElement::willRemove();
}
String HTMLFrameElementBase::location() const
{
return src();
}
void HTMLFrameElementBase::setLocation(const String& str)
{
if (m_URL == str)
......
......@@ -40,6 +40,7 @@ public:
virtual void attach();
String location() const;
void setLocation(const String&);
virtual bool isFocusable() const;
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -36,6 +36,7 @@ public:
virtual ~HTMLFrameOwnerElement();
Frame* contentFrame() const { return m_contentFrame; }
Frame* contentWindow() const { return contentFrame(); } // alias for JS DOM bindings
Document* contentDocument() const;
virtual bool isFrameOwnerElement() const { return true; }
......
/*
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
......@@ -20,7 +20,7 @@
module html {