-
ggaren authored
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. LayoutTests: 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. WebCore: 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: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@13865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2f992b39