+2006-04-13 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Darin.
+
+ * kjs/internal.cpp:
+ (KJS::InterpreterImp::initGlobalObject): Add the built-in object
+ prototype to the end of the global object's prototype chain instead of
+ just blowing away its existing prototype. We need to do this because
+ the window object has a meaningful prototype now.
+
2006-04-13 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
ErrorPrototype *errorProto = new ErrorPrototype(&globExec, objProto, funcProto);
b_ErrorPrototype = errorProto;
- static_cast<JSObject*>(global)->setPrototype(b_ObjectPrototype);
+ JSObject* o = global;
+ while (o->prototype()->isObject())
+ o = static_cast<JSObject*>(o->prototype());
+ o->setPrototype(b_ObjectPrototype);
// Constructors (Object, Array, etc.)
b_Object = new ObjectObjectImp(&globExec, objProto, funcProto);
+2006-04-12 Geoffrey Garen <ggaren@apple.com>
+
+ Layout test for document.defaultView
+
+ * fast/dom/defaultView-expected.txt: Added.
+ * fast/dom/defaultView.html: Added.
+ * fast/events/event-view-toString-expected.txt: Updated to reflect new
+ prototype chain for defaultView.
+
+2006-04-12 Geoffrey Garen <ggaren@apple.com>
+
+ Layout test to ensure that the window object gets cleared during a
+ navigation. I caused a regression in that area when working in window
+ object code.
+
+ * fast/loader/resources/window-clearing2.html: Added.
+ * fast/loader/window-clearing.html: Added.
+
2006-04-13 Alexey Proskuryakov <ap@nypop.com>
Test created by Maciej.
--- /dev/null
+This test checks that document.defaultView returns the window object, and that it implements all the methods and properties it should.
+
+If the test passes, you will see only PASS messages below.
+
+PASS: defaultView is the window object
+
+PASS: defaultView.document is the document object
+
+PASS: defaultView implements getComputedStyle
+
+PASS: defaultView implements getMatchedCSSRules
--- /dev/null
+<html>
+<head>
+<script>
+function print(message) {
+ var paragraph = document.createElement("p");
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(paragraph);
+}
+
+function test() {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ }
+
+ if (window === document.defaultView)
+ print("PASS: defaultView is the window object");
+ else
+ print("FAIL: defaultView is not the window object");
+
+ if (document.defaultView.document === document)
+ print("PASS: defaultView.document is the document object");
+ else
+ print("FAIL: defaultView.document is not the document object");
+
+ if (document.defaultView.getComputedStyle)
+ print("PASS: defaultView implements getComputedStyle");
+ else
+ print("FAIL: defaultView does not implement getComputedStyle");
+
+ if (document.defaultView.getMatchedCSSRules)
+ print("PASS: defaultView implements getMatchedCSSRules");
+ else
+ print("FAIL: defaultView does not implement getMatchedCSSRules");
+}
+</script>
+</head>
+<body onload="test();">
+<p>This test checks that document.defaultView returns the window object, and that it implements
+all the methods and properties it should.</p>
+<p>If the test passes, you will see only PASS messages below.</p>
+<hr>
+<div id='console'/>
+</body>
+</html>
--- /dev/null
+<html>
+<head>
+<script>
+function print(message) {
+ var paragraph = document.createElement("p");
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(paragraph);
+}
+
+function test() {
+ var count = 0;
+ var o = window;
+ do {
+ if (o.x)
+ print("FAIL: element " + count + " in the window's prototype chain was not cleared");
+ else
+ print("PASS: element " + count + " in the window's prototype chain was cleared");
+
+ ++count;
+ o = o.__proto__;
+ } while(o);
+
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+</script>
+</head>
+<body onload="test();">
+<p>This test checks to ensure that the window object is cleared during a navigation.</p>
+<p>If the test passes, you will see only PASS messages below.</p>
+<hr>
+<div id='console'/>
+</body>
+</html>
--- /dev/null
+This test checks to ensure that the window object is cleared during a navigation.
+
+If the test passes, you will see only PASS messages below.
+
+PASS: element 0 in the window's prototype chain was cleared
+
+PASS: element 1 in the window's prototype chain was cleared
+
+PASS: element 2 in the window's prototype chain was cleared
--- /dev/null
+<html>
+<head>
+<script>
+function test() {
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ // set up test variables -- they should be cleared
+ var o = window;
+ do {
+ o.x = 1;
+ o = o.__proto__;
+ } while(o);
+
+ window.location.href="resources/window-clearing2.html";
+}
+</script>
+</head>
+<body onload="test();">
+<p>FAIL: Could not load resources/window-clearing2.html</p>
+<hr>
+</body>
+</html>
+2006-04-12 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Darin.
+
+ - Fixed <rdar://problem/4478467> document.defaultView should return
+ the window object
+
+ Also made part of the window object autogenerated by IDL file.
+
+ * DerivedSources.make: Added /page to IDL file search path, added
+ JSDOMWindow.h, removed kjs_views.lut.h
+ * WebCore.xcodeproj/project.pbxproj: Added missing files, removed
+ obsolete files
+ * bindings/js/kjs_dom.cpp:
+ * bindings/js/kjs_events.cpp:
+ * bindings/js/kjs_proxy.cpp:
+ (WebCore::KJSProxy::initScriptIfNeeded):
+ * bindings/js/kjs_views.cpp: Removed.
+ * bindings/js/kjs_views.h: Removed.
+ * bindings/js/kjs_window.cpp: Removed document property -- it now
+ belongs to JSDOMWindow. Added toJS and toDOMWindow.
+ (KJS::Window::Window):
+ (KJS::Window::impl):
+ (KJS::Window::getValueProperty):
+ (KJS::Window::clear): Added call to setPrototype to ensure
+ that the prototype gets cleared during navigation. (Previously
+ this wasn't an issue because the window object had no real prototype.)
+ (WebCore::toJS):
+ (WebCore::toDOMWindow):
+ * bindings/js/kjs_window.h:
+ (KJS::Window::):
+ * bindings/objc/DOMCSS.mm: Added NULL checks for the AbstractView
+ (Presumably this is an issue after the window is closed.) Typedef-ed
+ AbstractView as DOMWindow. I could have just replaced AbstractView
+ with DOMWindow, but I think it's clearer to say, "There's this thing
+ called the AbstractView, but really it's just the window."
+ (-[DOMDocument getComputedStyle::]):
+ (-[DOMDocument getMatchedCSSRules::]):
+ * bindings/objc/DOMViews.mm:
+ * bindings/objc/DOMViewsInternal.h:
+ * bindings/scripts/CodeGeneratorJS.pm: Removed unused
+ GetLegacyImplementationIncludes. Added support for DOMWindow and new
+ "DoNotCache" attribute. Replaced C macros with text because (1) it
+ makes the generated source easier to read and debug and (2) it made
+ it much easier to implement the DoNotCache attribute.
+ * bindings/scripts/IDLParser.pm: Return a hash reference instead of
+ a hash, because otherwise an interface with more than one attribute
+ returns too many arguments to be processed.
+ * bridge/mac/FrameMac.mm:
+ * dom/AbstractView.cpp: Removed.
+ * dom/AbstractView.h: Removed.
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::defaultView):
+ * dom/Document.h:
+ * dom/Document.idl:
+ * dom/KeyboardEvent.idl:
+ * dom/MouseEvent.idl:
+ * dom/Position.cpp:
+ * dom/UIEvent.idl:
+ * dom/dom2_eventsimpl.h:
+ * page/DOMWindow.cpp: Added.
+ (WebCore::DOMWindow::DOMWindow):
+ (WebCore::DOMWindow::frame):
+ (WebCore::DOMWindow::disconnectFrame):
+ (WebCore::DOMWindow::document):
+ (WebCore::DOMWindow::getComputedStyle):
+ (WebCore::DOMWindow::getMatchedCSSRules):
+ * page/DOMWindow.h: Added.
+ * page/DOMWindow.idl: Added.
+ * page/Frame.cpp:
+ (WebCore::Frame::~Frame): Disconnect the new DOMWindow object in
+ addition to the Window object. Maybe we can unify this in the future.
+ (WebCore::Frame::tree):
+ (WebCore::Frame::domWindow):
+ * page/Frame.h:
+ * page/FramePrivate.h:
+
2006-04-13 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
$(WebCore)/css \
$(WebCore)/dom \
$(WebCore)/html \
+ $(WebCore)/page \
#
.PHONY : all
JSDOMParser.lut.h \
JSDocument.h \
JSDocumentType.h \
+ JSDOMWindow.h \
JSElement.h \
JSEntity.h \
JSKeyboardEvent.h \
kjs_html.lut.h \
kjs_navigator.lut.h \
kjs_traversal.lut.h \
- kjs_views.lut.h \
kjs_window.lut.h \
ksvgcssproperties.h \
ksvgcssvalues.h \
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403B99509EB13AF00797C7F /* DOMWindow.h */; };
+ 1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1403B99609EB13AF00797C7F /* DOMWindow.cpp */; };
+ 1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */; };
+ 1403BA0F09EB18F900797C7F /* JSDOMWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */; };
+ 141B94E609EC4223000E9413 /* MouseEvent.idl in Resources */ = {isa = PBXBuildFile; fileRef = 141B94E509EC4223000E9413 /* MouseEvent.idl */; };
+ 141B94EF09EC425A000E9413 /* UIEvent.idl in Resources */ = {isa = PBXBuildFile; fileRef = 141B94EE09EC425A000E9413 /* UIEvent.idl */; };
+ 14813BF409EDF88E00F757E1 /* IDLParser.pm in Resources */ = {isa = PBXBuildFile; fileRef = 14813BF309EDF88E00F757E1 /* IDLParser.pm */; };
14EC267F09CA07E000E1EEEC /* EventTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EC267D09CA07E000E1EEEC /* EventTargetNode.h */; };
14EC268009CA07E000E1EEEC /* EventTargetNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14EC267E09CA07E000E1EEEC /* EventTargetNode.cpp */; };
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DD09D1508D000E61D7 /* kjs_html.lut.h */; };
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */; };
656581F609D1508D000E61D7 /* kjs_traversal.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */; };
- 656581F709D1508D000E61D7 /* kjs_views.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E009D1508D000E61D7 /* kjs_views.lut.h */; };
656581F809D1508D000E61D7 /* kjs_window.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E109D1508D000E61D7 /* kjs_window.lut.h */; };
656581FB09D1508D000E61D7 /* ksvgcssproperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E409D1508D000E61D7 /* ksvgcssproperties.h */; };
656581FE09D1508D000E61D7 /* SVGElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 656581E709D1508D000E61D7 /* SVGElementFactory.h */; };
93B70D7009EB0C7C009D8468 /* kjs_proxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5409EB0C7C009D8468 /* kjs_proxy.h */; };
93B70D7109EB0C7C009D8468 /* kjs_traversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5509EB0C7C009D8468 /* kjs_traversal.cpp */; };
93B70D7209EB0C7C009D8468 /* kjs_traversal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5609EB0C7C009D8468 /* kjs_traversal.h */; };
- 93B70D7309EB0C7C009D8468 /* kjs_views.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5709EB0C7C009D8468 /* kjs_views.cpp */; };
- 93B70D7409EB0C7C009D8468 /* kjs_views.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5809EB0C7C009D8468 /* kjs_views.h */; };
93B70D7509EB0C7C009D8468 /* kjs_window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93B70D5909EB0C7C009D8468 /* kjs_window.cpp */; };
93B70D7609EB0C7C009D8468 /* kjs_window.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B70D5A09EB0C7C009D8468 /* kjs_window.h */; };
93B780CA09B3B7FE00690162 /* WidgetClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 93B780C909B3B7FE00690162 /* WidgetClient.h */; };
93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30202DE4476018635CA /* dom2_eventsimpl.h */; };
93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; };
93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30602DE4476018635CA /* dom2_traversalimpl.h */; };
- 93F1991A08245E59001E9ABC /* AbstractView.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30802DE4476018635CA /* AbstractView.h */; };
93F1992008245E59001E9ABC /* dom_xmlimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30002DE4476018635CA /* dom_xmlimpl.h */; };
93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* xml_tokenizer.h */; };
93F1992908245E59001E9ABC /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30102DE4476018635CA /* dom2_eventsimpl.cpp */; };
93F19AB908245E59001E9ABC /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30302DE4476018635CA /* Range.cpp */; };
93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */; };
- 93F19ABB08245E59001E9ABC /* AbstractView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30702DE4476018635CA /* AbstractView.cpp */; };
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* xml_tokenizer.cpp */; };
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A4FD02E2220F018635CB /* WebCoreCache.mm */; };
93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5B2A52C02E22573018635CB /* WebCoreJavaScript.mm */; };
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 1403B90C09EB124500797C7F /* DOMWindow.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindow.idl; sourceTree = "<group>"; };
+ 1403B99509EB13AF00797C7F /* DOMWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindow.h; sourceTree = "<group>"; };
+ 1403B99609EB13AF00797C7F /* DOMWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindow.cpp; sourceTree = "<group>"; };
+ 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindow.cpp; sourceTree = "<group>"; };
+ 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSDOMWindow.h; sourceTree = "<group>"; };
+ 141B94E509EC4223000E9413 /* MouseEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = MouseEvent.idl; sourceTree = "<group>"; };
+ 141B94EE09EC425A000E9413 /* UIEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = UIEvent.idl; sourceTree = "<group>"; };
+ 14813BF309EDF88E00F757E1 /* IDLParser.pm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; name = IDLParser.pm; path = scripts/IDLParser.pm; sourceTree = "<group>"; };
14EC267D09CA07E000E1EEEC /* EventTargetNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventTargetNode.h; sourceTree = "<group>"; };
14EC267E09CA07E000E1EEEC /* EventTargetNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventTargetNode.cpp; sourceTree = "<group>"; };
2D90660B0665D937006B6F1A /* ClipboardMac.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardMac.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
656581DD09D1508D000E61D7 /* kjs_html.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_html.lut.h; sourceTree = "<group>"; };
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_navigator.lut.h; sourceTree = "<group>"; };
656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_traversal.lut.h; sourceTree = "<group>"; };
- 656581E009D1508D000E61D7 /* kjs_views.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_views.lut.h; sourceTree = "<group>"; };
656581E109D1508D000E61D7 /* kjs_window.lut.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_window.lut.h; sourceTree = "<group>"; };
656581E209D1508D000E61D7 /* ksvgcssproperties.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ksvgcssproperties.c; sourceTree = "<group>"; };
656581E309D1508D000E61D7 /* ksvgcssproperties.gperf */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ksvgcssproperties.gperf; sourceTree = "<group>"; };
93B70D5409EB0C7C009D8468 /* kjs_proxy.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_proxy.h; sourceTree = "<group>"; };
93B70D5509EB0C7C009D8468 /* kjs_traversal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_traversal.cpp; sourceTree = "<group>"; };
93B70D5609EB0C7C009D8468 /* kjs_traversal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_traversal.h; sourceTree = "<group>"; };
- 93B70D5709EB0C7C009D8468 /* kjs_views.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_views.cpp; sourceTree = "<group>"; };
- 93B70D5809EB0C7C009D8468 /* kjs_views.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_views.h; sourceTree = "<group>"; };
93B70D5909EB0C7C009D8468 /* kjs_window.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = kjs_window.cpp; sourceTree = "<group>"; };
93B70D5A09EB0C7C009D8468 /* kjs_window.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = kjs_window.h; sourceTree = "<group>"; };
93B780C909B3B7FE00690162 /* WidgetClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WidgetClient.h; sourceTree = "<group>"; };
F523D30402DE4476018635CA /* Range.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Range.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30502DE4476018635CA /* dom2_traversalimpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dom2_traversalimpl.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30602DE4476018635CA /* dom2_traversalimpl.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = dom2_traversalimpl.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D30702DE4476018635CA /* AbstractView.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AbstractView.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D30802DE4476018635CA /* AbstractView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AbstractView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30902DE4476018635CA /* xml_tokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xml_tokenizer.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30A02DE4476018635CA /* xml_tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = xml_tokenizer.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5517DC2031AB56301A80180 /* WebCoreHistory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCoreHistory.h; sourceTree = "<group>"; };
65DF31E309D1CC60000BE325 /* JSDOMImplementation.cpp */,
65DF31E409D1CC60000BE325 /* JSDOMImplementation.h */,
656581D609D1508D000E61D7 /* JSDOMParser.lut.h */,
+ 1403BA0B09EB18C700797C7F /* JSDOMWindow.cpp */,
+ 1403BA0E09EB18F800797C7F /* JSDOMWindow.h */,
65DF31E509D1CC60000BE325 /* JSElement.cpp */,
65DF31E609D1CC60000BE325 /* JSElement.h */,
65DF322D09D1DDBC000BE325 /* JSEntity.cpp */,
656581DD09D1508D000E61D7 /* kjs_html.lut.h */,
656581DE09D1508D000E61D7 /* kjs_navigator.lut.h */,
656581DF09D1508D000E61D7 /* kjs_traversal.lut.h */,
- 656581E009D1508D000E61D7 /* kjs_views.lut.h */,
656581E109D1508D000E61D7 /* kjs_window.lut.h */,
656581E209D1508D000E61D7 /* ksvgcssproperties.c */,
656581E309D1508D000E61D7 /* ksvgcssproperties.gperf */,
65FEA86809833ADE00BED4AB /* Page.cpp */,
65A21467097A329100B9050A /* Page.h */,
65D1C1C909932B22000CB324 /* Plugin.h */,
+ 1403B90C09EB124500797C7F /* DOMWindow.idl */,
+ 1403B99509EB13AF00797C7F /* DOMWindow.h */,
+ 1403B99609EB13AF00797C7F /* DOMWindow.cpp */,
6522BCDE09C9DAA800C9BA7A /* ResourceRequest.h */,
);
path = page;
BC1A3790097C6F970019F3D8 /* bindings */ = {
isa = PBXGroup;
children = (
+ 14813BF309EDF88E00F757E1 /* IDLParser.pm */,
BC1A3793097C6FB10019F3D8 /* js */,
BC1A3794097C6FC40019F3D8 /* objc */,
);
93B70D5409EB0C7C009D8468 /* kjs_proxy.h */,
93B70D5509EB0C7C009D8468 /* kjs_traversal.cpp */,
93B70D5609EB0C7C009D8468 /* kjs_traversal.h */,
- 93B70D5709EB0C7C009D8468 /* kjs_views.cpp */,
- 93B70D5809EB0C7C009D8468 /* kjs_views.h */,
93B70D5909EB0C7C009D8468 /* kjs_window.cpp */,
93B70D5A09EB0C7C009D8468 /* kjs_window.h */,
);
F523D32402DE4478018635CA /* dom */ = {
isa = PBXGroup;
children = (
- F523D30702DE4476018635CA /* AbstractView.cpp */,
- F523D30802DE4476018635CA /* AbstractView.h */,
BC3B364705C9D5E200E42902 /* AtomicStringList.h */,
A8C4A7FC09D563270003AC8D /* Attr.cpp */,
A8C4A7FB09D563270003AC8D /* Attr.h */,
A8C4A7F409D563270003AC8D /* MappedAttribute.cpp */,
A8C4A7F309D563270003AC8D /* MappedAttribute.h */,
A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */,
+ 141B94E509EC4223000E9413 /* MouseEvent.idl */,
93EEC1F309C2877700C515D1 /* MutationEvent.idl */,
A8C4A7F209D563270003AC8D /* NamedAttrMap.cpp */,
A8C4A7F109D563270003AC8D /* NamedAttrMap.h */,
6550B69B099DF0270090D781 /* Text.cpp */,
6550B69C099DF0270090D781 /* Text.h */,
93EEC1F609C2877700C515D1 /* Text.idl */,
+ 141B94EE09EC425A000E9413 /* UIEvent.idl */,
93EEC1F709C2877700C515D1 /* WheelEvent.idl */,
F523D30902DE4476018635CA /* xml_tokenizer.cpp */,
F523D30A02DE4476018635CA /* xml_tokenizer.h */,
93F1991708245E59001E9ABC /* dom2_eventsimpl.h in Headers */,
93F1991808245E59001E9ABC /* Range.h in Headers */,
93F1991908245E59001E9ABC /* dom2_traversalimpl.h in Headers */,
- 93F1991A08245E59001E9ABC /* AbstractView.h in Headers */,
93F1992008245E59001E9ABC /* dom_xmlimpl.h in Headers */,
93F1992108245E59001E9ABC /* xml_tokenizer.h in Headers */,
93F1992908245E59001E9ABC /* KWQCString.h in Headers */,
656581F409D1508D000E61D7 /* kjs_html.lut.h in Headers */,
656581F509D1508D000E61D7 /* kjs_navigator.lut.h in Headers */,
656581F609D1508D000E61D7 /* kjs_traversal.lut.h in Headers */,
- 656581F709D1508D000E61D7 /* kjs_views.lut.h in Headers */,
656581F809D1508D000E61D7 /* kjs_window.lut.h in Headers */,
656581FB09D1508D000E61D7 /* ksvgcssproperties.h in Headers */,
656581FE09D1508D000E61D7 /* SVGElementFactory.h in Headers */,
93B70D6E09EB0C7C009D8468 /* kjs_navigator.h in Headers */,
93B70D7009EB0C7C009D8468 /* kjs_proxy.h in Headers */,
93B70D7209EB0C7C009D8468 /* kjs_traversal.h in Headers */,
- 93B70D7409EB0C7C009D8468 /* kjs_views.h in Headers */,
93B70D7609EB0C7C009D8468 /* kjs_window.h in Headers */,
+ 1403B99709EB13AF00797C7F /* DOMWindow.h in Headers */,
+ 1403BA0F09EB18F900797C7F /* JSDOMWindow.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A88AD3A40952486D001DD196 /* WKSpecularLightingFilter.cikernel in Resources */,
A88AD3A70952486D001DD196 /* WKSpotLightFilter.cikernel in Resources */,
A7638A92099592C30007E14F /* WKDisplacementMapFilter.cikernel in Resources */,
+ 141B94E609EC4223000E9413 /* MouseEvent.idl in Resources */,
+ 141B94EF09EC425A000E9413 /* UIEvent.idl in Resources */,
+ 14813BF409EDF88E00F757E1 /* IDLParser.pm in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
93F19AB808245E59001E9ABC /* dom2_eventsimpl.cpp in Sources */,
93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
93F19ABA08245E59001E9ABC /* dom2_traversalimpl.cpp in Sources */,
- 93F19ABB08245E59001E9ABC /* AbstractView.cpp in Sources */,
93F19ABC08245E59001E9ABC /* xml_tokenizer.cpp in Sources */,
93F19ABE08245E59001E9ABC /* WebCoreCache.mm in Sources */,
93F19ABF08245E59001E9ABC /* WebCoreJavaScript.mm in Sources */,
93B70D6D09EB0C7C009D8468 /* kjs_navigator.cpp in Sources */,
93B70D6F09EB0C7C009D8468 /* kjs_proxy.cpp in Sources */,
93B70D7109EB0C7C009D8468 /* kjs_traversal.cpp in Sources */,
- 93B70D7309EB0C7C009D8468 /* kjs_views.cpp in Sources */,
93B70D7509EB0C7C009D8468 /* kjs_window.cpp in Sources */,
+ 1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
+ 1403BA0C09EB18C700797C7F /* JSDOMWindow.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "kjs_css.h"
#include "kjs_events.h"
#include "kjs_traversal.h"
-#include "kjs_views.h"
#include "kjs_window.h"
#include "RenderCanvas.h"
#include "html_imageimpl.h"
#include "HTMLNames.h"
#include "kjs_proxy.h"
-#include "kjs_views.h"
#include "kjs_window.h"
#include "kjs_events.lut.h"
#include "kjs_events.h"
#include "kjs_window.h"
#include "Frame.h"
+#include "JSDOMWindow.h"
#if SVG_SUPPORT
#include "JSSVGLazyEventListener.h"
// Build the global object - which is a Window instance
JSLock lock;
- JSObject *globalObject( new Window(m_frame) );
+ JSObject* globalObject = new JSDOMWindow(m_frame->domWindow());
// Create a KJS interpreter for this frame
m_script = new ScriptInterpreter(globalObject, m_frame);
+++ /dev/null
-/*
- * This file is part of the KDE libraries
- * Copyright (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2004 Apple Computer, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-#include "kjs_views.h"
-
-#include "kjs_css.h"
-
-#include "AbstractView.h"
-#include "Element.h"
-#include "Document.h"
-#include "css/css_stylesheetimpl.h"
-#include "css/css_ruleimpl.h"
-
-using namespace WebCore;
-
-#include "kjs_views.lut.h"
-
-namespace KJS {
-
-// -------------------------------------------------------------------------
-
-const ClassInfo DOMAbstractView::info = { "AbstractView", 0, &DOMAbstractViewTable, 0 };
-/*
-@begin DOMAbstractViewTable 2
- document DOMAbstractView::Document_ DontDelete|ReadOnly
-@end
-@begin DOMAbstractViewProtoTable 1
- getComputedStyle DOMAbstractView::GetComputedStyle DontDelete|Function 2
- getMatchedCSSRules DOMAbstractView::GetMatchedCSSRules DontDelete|Function 2
-@end
-*/
-
-KJS_DEFINE_PROTOTYPE(DOMAbstractViewProto)
-KJS_IMPLEMENT_PROTOFUNC(DOMAbstractViewProtoFunc)
-KJS_IMPLEMENT_PROTOTYPE("DOMAbstractView",DOMAbstractViewProto,DOMAbstractViewProtoFunc)
-
-DOMAbstractView::DOMAbstractView(ExecState *exec, AbstractView *av)
- : m_impl(av)
-{
- setPrototype(DOMAbstractViewProto::self(exec));
-}
-
-DOMAbstractView::~DOMAbstractView()
-{
- ScriptInterpreter::forgetDOMObject(m_impl.get());
-}
-
-JSValue *DOMAbstractView::getValueProperty(ExecState *exec, int token)
-{
- assert(token == Document_);
- return toJS(exec, impl()->document());
-}
-
-bool DOMAbstractView::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<DOMAbstractView, DOMObject>(exec, &DOMAbstractViewTable, this, propertyName, slot);
-}
-
-JSValue *DOMAbstractViewProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
-{
- if (!thisObj->inherits(&DOMAbstractView::info))
- return throwError(exec, TypeError);
- AbstractView &abstractView = *static_cast<DOMAbstractView *>(thisObj)->impl();
- switch (id) {
- case DOMAbstractView::GetComputedStyle: {
- Element *arg0 = toElement(args[0]);
- if (!arg0)
- return jsUndefined(); // throw exception?
- else {
- arg0->document()->updateLayoutIgnorePendingStylesheets();
- return toJS(exec, abstractView.getComputedStyle(arg0, WebCore::String(args[1]->toString(exec)).impl()));
- }
- }
- case DOMAbstractView::GetMatchedCSSRules: {
- Element *arg0 = toElement(args[0]);
- if (!arg0)
- return jsUndefined(); // throw exception?
- else {
- // No need to update layout, since we just want the back-end rules.
- return toJS(exec, abstractView.getMatchedCSSRules(arg0, WebCore::String(args[1]->toString(exec)).impl()).get());
- }
- }
- }
- return jsUndefined();
-}
-
-JSValue *toJS(ExecState *exec, AbstractView *av)
-{
- return cacheDOMObject<AbstractView, DOMAbstractView>(exec, av);
-}
-
-AbstractView *toAbstractView(JSValue *val)
-{
- if (!val || !val->isObject(&DOMAbstractView::info))
- return 0;
- return static_cast<DOMAbstractView *>(val)->impl();
-}
-
-}
+++ /dev/null
-// -*- c-basic-offset: 2 -*-
-/*
- * This file is part of the KDE libraries
- * Copyright (C) 2001 Peter Kelly (pmk@post.com)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef KJS_VIEWS_H_
-#define KJS_VIEWS_H_
-
-#include "kjs_dom.h"
-
-namespace WebCore {
- class AbstractView;
-}
-
-namespace KJS {
-
- class DOMAbstractView : public DOMObject {
- public:
- DOMAbstractView(ExecState *, WebCore::AbstractView *av);
- ~DOMAbstractView();
- virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&);
- JSValue *getValueProperty(ExecState *exec, int token);
- // no put - all read-only
- virtual const ClassInfo* classInfo() const { return &info; }
- static const ClassInfo info;
- WebCore::AbstractView *impl() const { return m_impl.get(); }
- enum { Document_, GetComputedStyle, GetMatchedCSSRules };
- private:
- RefPtr<WebCore::AbstractView> m_impl;
- };
-
- JSValue* toJS(ExecState*, WebCore::AbstractView*);
-
- WebCore::AbstractView *toAbstractView(JSValue *);
-
-} // namespace
-
-#endif
#include "config.h"
#include "kjs_window.h"
+#include "DOMWindow.h"
#include "Element.h"
#include "EventNames.h"
#include "Frame.h"
#include "FrameTree.h"
#include "HTMLDocument.h"
#include "JSDOMParser.h"
+#include "JSDOMWindow.h"
#include "JSMutationEvent.h"
#include "JSRange.h"
#include "JSXMLHttpRequest.h"
defaultStatus Window::DefaultStatus DontDelete
defaultstatus Window::DefaultStatus DontDelete
status Window::Status DontDelete
- document Window::Document_ DontDelete|ReadOnly
Node Window::Node DontDelete
Event Window::EventCtor DontDelete
Range Window::Range DontDelete
*/
KJS_IMPLEMENT_PROTOFUNC(WindowFunc)
-Window::Window(Frame *f)
- : m_frame(f)
+Window::Window(DOMWindow* window)
+ : m_frame(window->frame())
, screen(0)
, history(0)
, frames(0)
i2->second->clearWindowObj();
}
+DOMWindow* Window::impl() const
+{
+ return m_frame->domWindow();
+}
+
ScriptInterpreter *Window::interpreter() const
{
return m_frame->jScript()->interpreter();
return jsUndefined();
switch (token) {
- case Document_:
- if (!m_frame->document()) {
- m_frame->createEmptyDocument();
- m_frame->begin();
- m_frame->write("<HTML><BODY>");
- m_frame->end();
- }
- return toJS(exec, m_frame->document());
case Onabort:
return getListener(exec, abortEvent);
case Onblur:
*m_returnValueSlot = returnValue;
clearAllTimeouts();
-
clearProperties();
+ setPrototype(JSDOMWindowProto::self()); // clear the prototype
// there's likely to be lots of garbage now
Collector::collect();
}
} // namespace KJS
+
+using namespace KJS;
+
+namespace WebCore {
+
+JSValue* toJS(ExecState*, DOMWindow* domWindow)
+{
+ return Window::retrieve(domWindow->frame());
+}
+
+DOMWindow* toDOMWindow(JSValue* val)
+{
+ return val->isObject(&JSDOMWindow::info) ? static_cast<JSDOMWindow*>(val)->impl() : 0;
+}
+
+} // namespace WebCore
\ No newline at end of file
namespace WebCore {
class AtomicString;
+ class DOMWindow;
class Frame;
class FrameView;
+ class JSDOMWindow;
class Node;
}
friend class Location;
friend class WindowFunc;
friend class ScheduledAction;
- public:
- Window(WebCore::Frame*);
+ protected:
+ Window(WebCore::DOMWindow*);
public:
~Window();
+ WebCore::DOMWindow* impl() const;
void disconnectFrame();
/**
* Returns and registers a window object. In case there's already a Window
UnprotectedListenersMap jsUnprotectedEventListeners;
virtual const ClassInfo* classInfo() const { return &info; }
static const ClassInfo info;
- enum { Closed, Crypto, DefaultStatus, Status, Document_, Node, EventCtor, MutationEventCtor, Range,
+ enum { Closed, Crypto, DefaultStatus, Status, Node, EventCtor, MutationEventCtor, Range,
NodeFilter, DOMException, CSSRule, Frames, History_, Event_, InnerHeight,
InnerWidth, Length, Location_, Locationbar, Name, Navigator_, ClientInformation,
Menubar, OffscreenBuffering, Opener, OuterHeight, OuterWidth, PageXOffset, PageYOffset,
} // namespace
+namespace WebCore {
+ KJS::JSValue* toJS(KJS::ExecState*, DOMWindow*);
+ DOMWindow* toDOMWindow(KJS::JSValue*);
+} // namespace WebCore
+
#endif
#import "config.h"
#import "DOMCSS.h"
-#import "AbstractView.h"
#import "DOMInternal.h"
+#import "DOMWindow.h"
#import "Document.h"
#import "FoundationExtras.h"
#import "css_ruleimpl.h"
using namespace WebCore;
+typedef DOMWindow AbstractView;
+
@interface DOMStyleSheet (WebCoreInternal)
+ (DOMStyleSheet *)_DOMStyleSheetWith:(StyleSheet *)impl;
@end
- (DOMCSSStyleDeclaration *)getComputedStyle:(DOMElement *)elt :(NSString *)pseudoElt
{
- Element *element = [elt _element];
+ Element* element = [elt _element];
+ AbstractView* defaultView = [self _document]->defaultView();
String pseudoEltString(pseudoElt);
- return [DOMCSSStyleDeclaration _styleDeclarationWith:[self _document]->defaultView()->getComputedStyle(element, pseudoEltString.impl())];
+
+ if (!defaultView)
+ return nil;
+
+ return [DOMCSSStyleDeclaration _styleDeclarationWith:defaultView->getComputedStyle(element, pseudoEltString.impl()).get()];
}
- (DOMCSSRuleList *)getMatchedCSSRules:(DOMElement *)elt :(NSString *)pseudoElt
{
+ AbstractView* defaultView = [self _document]->defaultView();
+
+ if (!defaultView)
+ return nil;
+
// The parameter of "false" is handy for the DOM inspector and lets us see user agent and user rules.
- return [DOMCSSRuleList _ruleListWith: AbstractView([self _document]).getMatchedCSSRules([elt _element], String(pseudoElt).impl(), false).get()];
+ return [DOMCSSRuleList _ruleListWith:defaultView->getMatchedCSSRules([elt _element], String(pseudoElt).impl(), false).get()];
}
@end
#import "config.h"
#import "DOMViews.h"
-#import "AbstractView.h"
#import "DOMInternal.h"
#import "DOMViewsInternal.h"
#import "Document.h"
+namespace WebCore {
+ typedef DOMWindow AbstractView;
+}
using WebCore::AbstractView;
+using WebCore::DOMWindow;
-ALLOW_DOM_CAST(AbstractView)
+ALLOW_DOM_CAST(DOMWindow)
@implementation DOMAbstractView
*/
#import "DOMViews.h"
+#import "DOMWindow.h"
namespace WebCore {
- class AbstractView;
+ typedef DOMWindow AbstractView;
}
@interface DOMAbstractView (WebCoreInternal)
my $legacyParent = shift;
if ($legacyParent eq "JSCanvasRenderingContext2DBase") {
return "#include \"JSCanvasRenderingContext2DBase.h\"\n\n";
+ } elsif ($legacyParent eq "KJS::Window") {
+ return "#include \"kjs_window.h\"\n\n";
} elsif ($module eq "events") {
return "#include \"kjs_events.h\"\n\n";
} elsif ($module eq "core") {
if ($type eq "DocumentType" or
$type eq "Document" or
+ $type eq "DOMWindow" or
$type eq "DOMImplementation" or
$type eq "NodeList" or
$type eq "Text" or
$type eq "DocumentFragment" or
$type eq "Node" or
$type eq "Attr" or
- $type eq "AbstractView" or
$type eq "Comment" or
$type eq "Element") {
$implIncludes{"${type}.h"} = 1;
} elsif ($type eq "CSSStyleSheet" or $type eq "StyleSheet") {
$implIncludes{"css_stylesheetimpl.h"} = 1;
+ } elsif ($type eq "CSSRuleList") {
+ $implIncludes{"css_ruleimpl.h"} = 1;
} elsif ($type eq "CSSPrimitiveValue" or $type eq "Counter" or $type eq "Rect" or $type eq "RGBColor") {
$implIncludes{"css_valueimpl.h"} = 1;
} elsif ($type eq "CSSStyleDeclaration") {
}
}
-sub GetLegacyImplementationIncludes
-{
- my $interfaceName = shift;
-
- if ($module eq "events") {
- return "#include \"dom2_eventsimpl.h\"\n";
- } elsif ($module eq "core") {
- return "#include \"${interfaceName}.h\"\n";
- } else {
- die ("Don't know what headers to include for module $module");
- }
-}
-
sub GenerateHeader
{
my $object = shift;
push(@headerContent, "public:\n");
# Constructor
- push(@headerContent, " $className(KJS::ExecState*, $implClassName*);\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@headerContent, " $className($implClassName*);\n");
+ } else {
+ push(@headerContent, " $className(KJS::ExecState*, $implClassName*);\n");
+ }
# Destructor
if (!$hasParent or $interfaceName eq "Document") {
push(@headerContent, "$implClassName* to${interfaceName}(KJS::JSValue*);\n\n");
}
- # Add prototype declaration
+ # Add prototype declaration -- code adopted from the KJS_DEFINE_PROTOTYPE and KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE macros
if ($numFunctions > 0) {
- if ($hasParent) {
- push(@headerContent, "KJS_DEFINE_PROTOTYPE_WITH_PROTOTYPE(${className}Proto, ${parentClassName}Proto);\n\n");
- } else {
- push(@headerContent, "KJS_DEFINE_PROTOTYPE(${className}Proto);\n\n");
- }
+ push(@headerContent, "class ${className}Proto : public KJS::JSObject {\n");
+ if (!$dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@headerContent, " friend KJS::JSObject* KJS_GCC_ROOT_NS_HACK cacheGlobalObject<${className}Proto>(KJS::ExecState*, const KJS::Identifier& propertyName);\n");
+ }
+ push(@headerContent, "public:\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@headerContent, " static KJS::JSObject* self();\n");
+ } else {
+ push(@headerContent, " static KJS::JSObject* self(KJS::ExecState* exec);\n");
+ }
+ push(@headerContent, " virtual const KJS::ClassInfo* classInfo() const { return &info; }\n");
+ push(@headerContent, " static const KJS::ClassInfo info;\n");
+ push(@headerContent, " bool getOwnPropertySlot(KJS::ExecState*, const KJS::Identifier&, KJS::PropertySlot&);\n");
+ push(@headerContent, "protected:\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@headerContent, " ${className}Proto() { }\n");
+ } else {
+ push(@headerContent, " ${className}Proto(KJS::ExecState* exec)\n");
+ if ($hasParent) {
+ push(@headerContent, " : KJS::JSObject(${parentClassName}Proto::self(exec)) { }\n");
+ } else {
+ push(@headerContent, " : KJS::JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()) { }\n");
+ }
+ }
+ push(@headerContent, "};\n\n");
}
push(@headerContent, "}\n\n#endif\n");
\@hashKeys, \@hashValues,
\@hashSpecials, \@hashParameters);
- push(@implContent, "KJS_IMPLEMENT_PROTOFUNC(${className}ProtoFunc)\n");
- push(@implContent, "KJS_IMPLEMENT_PROTOTYPE(\"$className\", ${className}Proto, ${className}ProtoFunc)\n\n");
+ push(@implContent, "class ${className}ProtoFunc : public InternalFunctionImp {\n");
+ push(@implContent, "public:\n");
+ push(@implContent, " ${className}ProtoFunc(ExecState* exec, int i, int len, const Identifier& name)\n");
+ push(@implContent, " : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype()), name)\n");
+ push(@implContent, " , id(i)\n");
+ push(@implContent, " {\n");
+ push(@implContent, " put(exec, lengthPropertyName, jsNumber(len), DontDelete|ReadOnly|DontEnum);\n");
+ push(@implContent, " }\n");
+ push(@implContent, " virtual JSValue* callAsFunction(ExecState* exec, JSObject* thisObj, const List& args);\n");
+ push(@implContent, "private:\n");
+ push(@implContent, " int id;\n");
+ push(@implContent, "};\n\n");
+
+ push(@implContent, "const ClassInfo ${className}Proto::info = { \"$className\", 0, &${className}ProtoTable, 0 };\n\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@implContent, "JSObject* ${className}Proto::self()\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return new ${className}Proto();\n");
+ push(@implContent, "}\n\n");
+ } else {
+ push(@implContent, "JSObject* ${className}Proto::self(ExecState* exec)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return ::cacheGlobalObject<${className}Proto>(exec, \"[[${className}.prototype]]\");\n");
+ push(@implContent, "}\n\n");
+ }
+ push(@implContent, "bool ${className}Proto::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " return getStaticFunctionSlot<${className}ProtoFunc, JSObject>(exec, &${className}ProtoTable, this, propertyName, slot);\n");
+ push(@implContent, "}\n\n");
}
# - Initialize static ClassInfo object
push(@implContent, "0 };\n\n");
# Constructor
- push(@implContent, "${className}::$className(ExecState* exec, $implClassName* impl)\n");
- if ($hasParent) {
- push(@implContent, " : $parentClassName(exec, impl)\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@implContent, "${className}::$className($implClassName* impl)\n");
+ push(@implContent, " : $parentClassName(impl)\n");
} else {
- push(@implContent, " : m_impl(impl)\n");
+ push(@implContent, "${className}::$className(ExecState* exec, $implClassName* impl)\n");
+ if ($hasParent) {
+ push(@implContent, " : $parentClassName(exec, impl)\n");
+ } else {
+ push(@implContent, " : m_impl(impl)\n");
+ }
}
- if ($numFunctions ne 0) {
- push(@implContent, "{\n setPrototype(${className}Proto::self(exec));\n}\n\n");
+ if ($dataNode->extendedAttributes->{"DoNotCache"}) {
+ push(@implContent, "{\n setPrototype(${className}Proto::self());\n}\n\n");
+ } elsif ($numFunctions ne 0) {
+ push(@implContent, "{\n setPrototype(${className}Proto::self(exec));\n}\n\n");
} else {
- push(@implContent, "{\n}\n\n");
+ push(@implContent, "{\n}\n\n");
}
# Destructor
return "AtomicString";
} elsif ($type eq "DOMString") {
return "String";
- } elsif ($type eq "views::AbstractView") {
- return "AbstractView*";
} elsif ($type eq "Node" or
$type eq "Element" or
$type eq "Attr" or
return "Range::CompareHow";
} elsif ($type eq "EventTarget") {
return "EventTargetNode*";
+ } elsif ($type eq "DOMWindow") {
+ return "DOMWindow*";
} else {
die "Don't know the native type of $type";
}
return 0;
} elsif ($type eq "DOMString") {
return 0;
- } elsif ($type eq "views::AbstractView") {
- return 0;
} elsif ($type eq "Node") {
return 0;
} elsif ($type eq "Element") {
return 0;
} elsif ($type eq "NodeFilter") {
return 0;
+ } elsif ($type eq "DOMWindow") {
+ return 0;
} else {
die "Don't know whether a JS value can fail conversion to type $type."
}
} else {
return "$value->toString(exec)";
}
- } elsif ($type eq "views::AbstractView") {
- $implIncludes{"kjs_views.h"} = 1;
- return "toAbstractView($value)";
} elsif ($type eq "Node") {
$implIncludes{"kjs_dom.h"} = 1;
return "toNode($value)";
} elsif ($type eq "NodeFilter") {
$implIncludes{"kjs_traversal.h"} = 1;
return "toNodeFilter($value)";
+ } elsif ($type eq "DOMWindow") {
+ $implIncludes{"kjs_window.h"} = 1;
+ return "toDOMWindow($value)";
} else {
die "Don't know how to convert a JS value of type $type."
}
$implIncludes{"css_stylesheetimpl.h"} = 1;
$implIncludes{"kjs_css.h"} = 1;
return "toJS(exec, $value, impl)";
+ } elsif ($type eq "CSSRuleList") {
+ $implIncludes{"css_ruleimpl.h"} = 1;
+ return "toJS(exec, $value)";
} elsif ($type eq "CSSStyleDeclaration" or $type eq "Rect") {
$implIncludes{"css_valueimpl.h"} = 1;
$implIncludes{"kjs_css.h"} = 1;
} elsif ($type eq "CanvasGradient" or $type eq "Counter" or $type eq "Range") {
$implIncludes{"JS$type.h"} = 1;
return "toJS(exec, $value)";
- } elsif ($type eq "views::AbstractView") {
- $implIncludes{"kjs_views.h"} = 1;
- return "toJS(exec, $value)";
} elsif ($type eq "NodeIterator" or
$type eq "TreeWalker") {
$implIncludes{"kjs_traversal.h"} = 1;
return "toJS(exec, $value)";
+ } elsif ($type eq "DOMWindow") {
+ $implIncludes{"kjs_window.h"} = 1;
+ return "toJS(exec, $value)";
} else {
die "Don't know how to convert a value of type $type to a JS Value";
}
$attrs{$name} = $value;
}
- return %attrs;
+ return \%attrs;
}
sub ParseInterface
#import "Cache.h"
#import "Cursor.h"
#import "DOMInternal.h"
+#import "DOMWindow.h"
#import "EventNames.h"
#import "FloatRect.h"
#import "FoundationExtras.h"
+++ /dev/null
-/**
- * This file is part of the DOM implementation for KDE.
- *
- * (C) 2001 Peter Kelly (pmk@post.com)
- * Copyright (C) 2004, 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.
- *
- */
-
-#include "config.h"
-#include "AbstractView.h"
-
-#include "Document.h"
-#include "Element.h"
-#include "CSSComputedStyleDeclaration.h"
-#include "cssstyleselector.h"
-
-namespace WebCore {
-
-AbstractView::AbstractView(Document *doc)
-{
- m_document = doc;
-}
-
-AbstractView::~AbstractView()
-{
-}
-
-CSSStyleDeclaration *AbstractView::getComputedStyle(Element *elt, StringImpl *pseudoElt)
-{
- // FIXME: This should work even if we do not have a renderer.
- // FIXME: This needs to work with pseudo elements.
- if (!elt || !elt->renderer())
- return 0;
-
- return new CSSComputedStyleDeclaration(elt);
-}
-
-RefPtr<CSSRuleList> AbstractView::getMatchedCSSRules(Element* elt, StringImpl* pseudoElt, bool authorOnly)
-{
- if (pseudoElt && pseudoElt->length())
- return m_document->styleSelector()->pseudoStyleRulesForElement(elt, pseudoElt, authorOnly);
- return m_document->styleSelector()->styleRulesForElement(elt, authorOnly);
-}
-
-}
+++ /dev/null
-/*
- * This file is part of the DOM implementation for KDE.
- *
- * (C) 2001 Peter Kelly (pmk@post.com)
- *
- * 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.
- *
- */
-
-#ifndef _DOM_ViewsImpl_h_
-#define _DOM_ViewsImpl_h_
-
-#include "css_valueimpl.h"
-
-namespace WebCore {
-
-class Document;
-class CSSStyleDeclaration;
-class CSSRuleList;
-class Element;
-class StringImpl;
-
-// Introduced in DOM Level 2:
-class AbstractView : public Shared<AbstractView>
-{
-public:
- AbstractView(Document *_document);
- ~AbstractView();
-
- Document *document() const { return m_document; }
- CSSStyleDeclaration *getComputedStyle(Element *elt, StringImpl *pseudoElt);
- RefPtr<CSSRuleList> getMatchedCSSRules(Element *elt, StringImpl *pseudoElt, bool authorOnly = true);
-
-protected:
- Document *m_document;
-};
-
-}; //namespace
-#endif
#include "config.h"
#include "Document.h"
-#include "AbstractView.h"
#include "AccessibilityObjectCache.h"
#include "CDATASection.h"
#include "CSSValueKeywords.h"
m_attrNames = 0;
m_attrNameAlloc = 0;
m_attrNameCount = 0;
- m_defaultView = new AbstractView(this);
m_listenerTypes = 0;
m_inDocument = true;
m_styleSelectorDirty = false;
it.current()->notifyBeforeNodeRemoval(n);
}
-AbstractView *Document::defaultView() const
+DOMWindow* Document::defaultView() const
{
- return m_defaultView.get();
+ if (!frame())
+ return 0;
+
+ return frame()->domWindow();
}
PassRefPtr<Event> Document::createEvent(const String &eventType, ExceptionCode& ec)
namespace WebCore {
class AccessibilityObjectCache;
- class AbstractView;
class CDATASection;
class CSSStyleDeclaration;
class CSSStyleSelector;
class CSSStyleSheet;
class Comment;
class DOMImplementation;
+ class DOMWindow;
class DocLoader;
class DocumentFragment;
class DocumentType;
void attachNodeIterator(NodeIterator*);
void detachNodeIterator(NodeIterator*);
void notifyBeforeNodeRemoval(Node*);
- AbstractView* defaultView() const;
+ DOMWindow* defaultView() const;
PassRefPtr<Event> createEvent(const String& eventType, ExceptionCode&);
// keep track of what types of event listeners are registered, so we don't
unsigned short m_namespaceURICount;
DeprecatedPtrList<NodeIterator> m_nodeIterators;
- RefPtr<AbstractView> m_defaultView;
unsigned short m_listenerTypes;
RefPtr<StyleSheetList> m_styleSheets;
// DOM Level 2 Abstract Views (DocumentView interface)
- readonly attribute views::AbstractView defaultView;
+ readonly attribute DOMWindow defaultView;
// DOM Level 2 Style (DocumentStyle interface)
void initKeyboardEvent(in AtomicString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
- in views::AbstractView viewArg,
+ in DOMWindow viewArg,
in DOMString keyIdentifier,
in unsigned long keyLocationArg,
in boolean ctrlKeyArg,
void initMouseEvent(in AtomicString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
- in views::AbstractView viewArg,
+ in DOMWindow viewArg,
in long detailArg,
in long screenXArg,
in long screenYArg,
#include "Logging.h"
#include "RenderBlock.h"
#include "CSSComputedStyleDeclaration.h"
-#include "AbstractView.h"
#include "htmlediting.h"
#include "HTMLNames.h"
#include "TextIterator.h"
interface [LegacyParent=KJS::DOMEvent] UIEvent : Event {
- readonly attribute views::AbstractView view;
+ readonly attribute DOMWindow view;
readonly attribute long detail;
readonly attribute long keyCode;
void initUIEvent(in AtomicString typeArg,
in boolean canBubbleArg,
in boolean cancelableArg,
- in views::AbstractView viewArg,
+ in DOMWindow viewArg,
in long detailArg);
};
#ifndef DOM_EVENTSIMPL_H
#define DOM_EVENTSIMPL_H
-#include "AbstractView.h"
+#include "AtomicString.h"
+#include "DOMWindow.h"
#include "Node.h"
class DeprecatedStringList;
namespace WebCore {
+class CachedImage;
class Clipboard;
class EventListener;
class EventTargetNode;
class PlatformKeyboardEvent;
typedef unsigned long long DOMTimeStamp;
+typedef DOMWindow AbstractView;
const int EventExceptionOffset = 100;
const int EventExceptionMax = 199;
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMWindow.h"
+
+#include "cssstyleselector.h"
+#include "CSSComputedStyleDeclaration.h"
+#include "Document.h"
+#include "Element.h"
+#include "Frame.h"
+
+namespace WebCore {
+
+DOMWindow::DOMWindow(Frame* f)
+ : m_frame(f)
+{
+}
+
+Frame* DOMWindow::frame()
+{
+ return m_frame;
+}
+
+void DOMWindow::disconnectFrame()
+{
+ m_frame = 0;
+}
+
+Document* DOMWindow::document() const
+{
+ if (!m_frame)
+ return 0;
+
+ if (!m_frame->document()) {
+ m_frame->createEmptyDocument();
+ m_frame->begin();
+ m_frame->write("<HTML><BODY>");
+ m_frame->end();
+ }
+ return m_frame->document();
+}
+
+PassRefPtr<CSSStyleDeclaration> DOMWindow::getComputedStyle(Element* elt, const String&) const
+{
+ // FIXME: This should work even if we do not have a renderer.
+ // FIXME: This needs to work with pseudo elements.
+ if (!elt || !elt->renderer())
+ return 0;
+
+ return new CSSComputedStyleDeclaration(elt);
+}
+
+PassRefPtr<CSSRuleList> DOMWindow::getMatchedCSSRules(Element* elt, const String& pseudoElt, bool authorOnly) const
+{
+ if (!m_frame || !m_frame->document())
+ return 0;
+
+ if (!pseudoElt.isEmpty())
+ return m_frame->document()->styleSelector()->pseudoStyleRulesForElement(elt, pseudoElt.impl(), authorOnly);
+ return m_frame->document()->styleSelector()->styleRulesForElement(elt, authorOnly);
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMWindow_h
+#define DOMWindow_h
+
+#include "Shared.h"
+#include <kxmlcore/Noncopyable.h>
+#include <kxmlcore/PassRefPtr.h>
+
+namespace WebCore {
+ class CSSRuleList;
+ class CSSStyleDeclaration;
+ class Document;
+ class Element;
+ class Frame;
+ class String;
+
+ class DOMWindow : public Shared<DOMWindow>, Noncopyable {
+ public:
+ DOMWindow(Frame*);
+ Frame* frame();
+ void disconnectFrame();
+
+ // DOM Level 2 AbstractView Interface
+ Document* document() const;
+
+ // DOM Level 2 Style Interface
+ PassRefPtr<CSSStyleDeclaration> getComputedStyle(Element*, const String& pseudoElt) const;
+
+ // WebKit extension for the Web Inspector
+ PassRefPtr<CSSRuleList> getMatchedCSSRules(Element*, const String& pseudoElt, bool authorOnly = true) const;
+
+ private:
+ Frame* m_frame;
+ };
+
+} // namespace WebCore
+
+#endif
--- /dev/null
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module window {
+
+ // You can't cache the Window object in the global object because it *is* the global object.
+ // For the same reason, there's no need to.
+ interface [LegacyParent=KJS::Window, DoNotCache] DOMWindow {
+ // DOM Level 2 AbstractView Interface
+ readonly attribute Document document;
+
+ // DOM Level 2 Style Interface
+ CSSStyleDeclaration getComputedStyle(in Element elt,
+ in DOMString pseudoElt);
+
+ // WebKit extension for the Web Inspector
+ CSSRuleList getMatchedCSSRules(in Element elt,
+ in DOMString pseudoElt,
+ in [ConvertUndefinedToTrue] boolean authorOnly);
+
+ };
+
+}
#include "CachedCSSStyleSheet.h"
#include "DOMImplementation.h"
#include "DocLoader.h"
+#include "DOMWindow.h"
#include "EditingText.h"
#include "EventNames.h"
#include "FloatRect.h"
w = 0;
}
+ if (d->m_domWindow)
+ d->m_domWindow->disconnectFrame();
+
setOpener(0);
HashSet<Frame*> openedBy = d->m_openedFrames;
HashSet<Frame*>::iterator end = openedBy.end();
return d->m_bLoadingMainResource;
}
-FrameTree *Frame::tree() const
+FrameTree* Frame::tree() const
{
- return& d->m_treeNode;
+ return &d->m_treeNode;
+}
+
+DOMWindow* Frame::domWindow() const
+{
+ if (!d->m_domWindow)
+ d->m_domWindow = new DOMWindow(const_cast<Frame*>(this));
+
+ return d->m_domWindow.get();
}
KURL Frame::url() const
class CSSMutableStyleDeclaration;
class CSSStyleDeclaration;
class DrawContentsEvent;
+class DOMWindow;
class EditCommandPtr;
class FramePrivate;
class FrameTree;
// split out controller objects
FrameTree* tree() const;
SelectionController& selection() const;
+ DOMWindow* domWindow() const;
private:
friend class FramePrivate;
Page* m_page;
FrameTree m_treeNode;
+ RefPtr<DOMWindow> m_domWindow;
Vector<RefPtr<Plugin> > m_plugins;
#include "Image.h"
#include "IntPoint.h"
#include "dom2_eventsimpl.h"
+#include "CachedObjectClient.h"
#ifdef __OBJC__
@class NSImage;
}
-// FIXME: Remove when everything is in the WebCore namespace.
-using WebCore::ClipboardMac;
-
#endif