WebCore:

        Reviewed by Brady.

        - http://bugs.webkit.org/show_bug.cgi?id=11794
          fix lifetime problems affecting Frame's ownerElement pointer

        * CMakeLists.txt:
        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        Updated for new source files.

        * WebCore.exp: Updated for changes to entry point names.

        * bridge/mac/FrameMac.h:
        * bridge/mac/FrameMac.mm: (WebCore::FrameMac::FrameMac):
        * bridge/win/FrameWin.h:
        * bridge/win/FrameWin.cpp: (WebCore::FrameWin::FrameWin):
        * platform/qt/FrameQt.h:
        * platform/qt/FrameQt.cpp: (WebCore::FrameQt::FrameQt):
        Updated owner element type to HTMLFrameOwnerElement.

        * bridge/mac/WebCoreFrameBridge.h: Removed non-C++ case since we don't
        use that any more. Updated owner element type to HTMLFrameOwnerElement.

        * dom/Document.cpp: Added include so that the ownerElement function can
        compile (since it downcasts an HTMLFrameOwnerElement to an Element).

        * html/HTMLFrameElement.cpp:
        (WebCore::containingFrameSetElement): Moved this function in here; it
        doesn't need to be a member function.
        (WebCore::HTMLFrameElement::attach): Updated to call this.

        * html/HTMLFrameElementBase.h:
        * html/HTMLFrameElementBase.cpp:
        (WebCore::HTMLFrameElementBase::HTMLFrameElementBase): Inherit from
        HTMLFrameOwnerElement. Removed contentFrame, contentDocument, and
        containingFrameSetElement. Removed friend classes.

        * html/HTMLFrameOwnerElement.h: Added.
        * html/HTMLFrameOwnerElement.cpp: Added.

        * html/HTMLEmbedElement.h:
        * html/HTMLEmbedElement.cpp:
        * html/HTMLObjectElement.h:
        * html/HTMLObjectElement.cpp:
        Remove now-unneeded contentDocument functions.

        * html/HTMLPlugInElement.h:
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::HTMLPlugInElement): Inherit from
        HTMLFrameOwnerElement.

        * loader/FormState.h:
        * loader/FormState.cpp: Use HTMLFormElement instead of just Element.

        * loader/FrameLoader.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::requestFrame): Use HTMLFormElement.
        (WebCore::FrameLoader::loadSubframe): Ditto.
        (WebCore::FrameLoader::requestObject): Don't pass an element parameter
        to shouldUsePlugin, and remove now-unneeded type casts.
        (WebCore::FrameLoader::shouldUsePlugin): Removed unneeded element parameter.
        (WebCore::FrameLoader::handleFallbackContent): Use HTMLFrameOwnerElement.
        (WebCore::FrameLoader::updateBaseURLForEmptyDocument): Ditto.
        (WebCore::FrameLoader::isHostedByObjectElement): Ditto.
        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::load): Use HTMLFormElement.
        (WebCore::FrameLoader::post): Ditto.
        (WebCore::FrameLoader::createFrame): Use HTMLFrameOwnerElement.

        * page/Frame.h:
        * page/FramePrivate.h:
        * page/Frame.cpp:
        (WebCore::parentFromOwnerElement): Use HTMLFrameOwnerElement.
        (WebCore::Frame::Frame): Ditto. Also set m_contentFrame on the owner element.
        (WebCore::Frame::ownerElement): Ditto.
        (WebCore::Frame::ownerRenderer): Ditto.
        (WebCore::Frame::disconnectOwnerElement): Clear m_contentFrame on the owner
        element before disconnecting it.
        (WebCore::FramePrivate::FramePrivate): Use HTMLFrameOwnerElement.

        * page/mac/EventHandlerMac.mm: Include HTMLFrameOwnerElement.h so that
        the code here will compile (no code changes needed).

        * rendering/RenderFrame.cpp: (WebCore::RenderFrame::viewCleared):
        Updated so that RenderFrame doesn't need to be a friend of HTMLFrameElementBase.

        * rendering/RenderPart.h:
        * rendering/RenderPart.cpp: (WebCore::RenderPart::RenderPart):
        Use HTMLFrameOwnerElement.

        * rendering/RenderPartObject.h:
        * rendering/RenderPartObject.cpp:
        (WebCore::RenderPartObject::RenderPartObject): Use HTMLFrameOwnerElement.
        (WebCore::RenderPartObject::viewCleared): Updated so that RenderFrame doesn't
        need to be a friend of HTMLFrameElementBase.

        - other changes

        * platform/network/ResourceHandleInternal.h: Added Noncopyable and
        fixed indentation.

WebKit:

        Reviewed by Brady.

        - http://bugs.webkit.org/show_bug.cgi?id=11794
          fix lifetime problems affecting Frame's ownerElement pointer

        * WebCoreSupport/WebFrameBridge.mm:
        (-[WebFrameBridge finishInitializingWithPage:WebCore::frameName:frameView:ownerElement:]):
        (-[WebFrameBridge initSubframeWithOwnerElement:frameName:frameView:]):
        (-[WebFrameBridge createChildFrameNamed:withURL:referrer:ownerElement:allowsScrolling:marginWidth:marginHeight:]):
        Use HTMLFrameOwnerElement.

        * WebCoreSupport/WebFrameLoaderClient.mm: Include the relevant headers for the
        HTMLFormElement class.

        * WebKit.xcodeproj/project.pbxproj: Let Xcode have its way.

        * WebView/WebFrame.mm: (-[WebFrame frameElement]): Update includes and types for the
        change in return type of ownerElement.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@18163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/html/HTMLFrameOwnerElement.h b/WebCore/html/HTMLFrameOwnerElement.h
new file mode 100644
index 0000000..b9372f7
--- /dev/null
+++ b/WebCore/html/HTMLFrameOwnerElement.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef HTMLFrameOwnerElement_h
+#define HTMLFrameOwnerElement_h
+
+#include "HTMLElement.h"
+
+namespace WebCore {
+
+class Frame;
+
+class HTMLFrameOwnerElement : public HTMLElement {
+protected:
+    HTMLFrameOwnerElement(const QualifiedName& tagName, Document*);
+
+public:
+    virtual ~HTMLFrameOwnerElement();
+
+    Frame* contentFrame() const { return m_contentFrame; }
+    Document* contentDocument() const;
+
+private:
+    friend class Frame;
+    Frame* m_contentFrame;
+};
+
+}
+
+#endif