[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
weinig at apple.com
weinig at apple.com
Wed Dec 22 18:14:49 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7b9d6b96c136c2a74c1122ca0ad5cd0c5454b871
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 9 02:02:13 2010 +0000
Need a way to get a WKBundleFrameRef from JS HTMLIFrameElement
https://bugs.webkit.org/show_bug.cgi?id=50726
Reviewed by Darin Adler.
Adds WKBundleNodeHandleCopyDocumentFrame, WKBundleNodeHandleCopyHTMLFrameElementContentFrame
and WKBundleNodeHandleCopyHTMLIFrameElementContentFrame, to handle the document, <frame>
and <iframe> cases.
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleCopyDocumentFrame):
(WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
(WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::copyDocumentFrame):
(WebKit::InjectedBundleNodeHandle::copyHTMLFrameElementContentFrame):
(WebKit::InjectedBundleNodeHandle::copyHTMLIFrameElementContentFrame):
* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6c15219..d526a4c 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,27 @@
2010-12-08 Sam Weinig <sam at webkit.org>
+ Reviewed by Darin Adler.
+
+ Need a way to get a WKBundleFrameRef from JS HTMLIFrameElement
+ https://bugs.webkit.org/show_bug.cgi?id=50726
+
+ Adds WKBundleNodeHandleCopyDocumentFrame, WKBundleNodeHandleCopyHTMLFrameElementContentFrame
+ and WKBundleNodeHandleCopyHTMLIFrameElementContentFrame, to handle the document, <frame>
+ and <iframe> cases.
+
+ * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
+ (WKBundleNodeHandleCopyDocumentFrame):
+ (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
+ (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
+ * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+ (WebKit::InjectedBundleNodeHandle::copyDocumentFrame):
+ (WebKit::InjectedBundleNodeHandle::copyHTMLFrameElementContentFrame):
+ (WebKit::InjectedBundleNodeHandle::copyHTMLIFrameElementContentFrame):
+ * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
+
+2010-12-08 Sam Weinig <sam at webkit.org>
+
Reviewed by Gavin Barraclough.
Need a WebKit2 way to test whether a frame is displaying a standalone image
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
index 0be4bdf..86d913b 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
@@ -29,6 +29,7 @@
#include "InjectedBundleNodeHandle.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
+#include "WebFrame.h"
using namespace WebKit;
@@ -65,6 +66,24 @@ void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlI
WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandleRef)
{
- RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(htmlTableCellElementHandleRef)->copyHTMLTableCellElementCellAbove();
+ RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(htmlTableCellElementHandleRef)->htmlTableCellElementCellAbove();
return toAPI(nodeHandle.release().releaseRef());
}
+
+WKBundleFrameRef WKBundleNodeHandleCopyDocumentFrame(WKBundleNodeHandleRef documentHandleRef)
+{
+ RefPtr<WebFrame> frame = toImpl(documentHandleRef)->documentFrame();
+ return toAPI(frame.release().releaseRef());
+}
+
+WKBundleFrameRef WKBundleNodeHandleCopyHTMLFrameElementContentFrame(WKBundleNodeHandleRef htmlFrameElementHandleRef)
+{
+ RefPtr<WebFrame> frame = toImpl(htmlFrameElementHandleRef)->htmlFrameElementContentFrame();
+ return toAPI(frame.release().releaseRef());
+}
+
+WKBundleFrameRef WKBundleNodeHandleCopyHTMLIFrameElementContentFrame(WKBundleNodeHandleRef htmlIFrameElementHandleRef)
+{
+ RefPtr<WebFrame> frame = toImpl(htmlIFrameElementHandleRef)->htmlIFrameElementContentFrame();
+ return toAPI(frame.release().releaseRef());
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
index c0f0e82..854677b 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
@@ -49,6 +49,15 @@ WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandl
/* HTMLTableCellElement Specific Operations */
WK_EXPORT WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandle);
+/* Document Specific Operations */
+WK_EXPORT WKBundleFrameRef WKBundleNodeHandleCopyDocumentFrame(WKBundleNodeHandleRef documentHandle);
+
+/* HTMLFrameElement Specific Operations */
+WK_EXPORT WKBundleFrameRef WKBundleNodeHandleCopyHTMLFrameElementContentFrame(WKBundleNodeHandleRef htmlFrameElementHandle);
+
+/* HTMLIFrameElement Specific Operations */
+WK_EXPORT WKBundleFrameRef WKBundleNodeHandleCopyHTMLIFrameElementContentFrame(WKBundleNodeHandleRef htmlIFrameElementHandle);
+
#ifdef __cplusplus
}
#endif
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
index b8ce728..e9370c6 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
@@ -25,7 +25,13 @@
#include "InjectedBundleNodeHandle.h"
+#include "WebFrame.h"
+#include "WebFrameLoaderClient.h"
#include <JavaScriptCore/APICast.h>
+#include <WebCore/Document.h>
+#include <WebCore/HTMLFrameElement.h>
+#include <WebCore/HTMLIFrameElement.h>
+#include <WebCore/Frame.h>
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
#include <WebCore/HTMLTableCellElement.h>
@@ -124,7 +130,7 @@ void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled)
static_cast<HTMLInputElement*>(m_node.get())->setAutofilled(filled);
}
-PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::copyHTMLTableCellElementCellAbove()
+PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::htmlTableCellElementCellAbove()
{
if (!m_node->hasTagName(tdTag))
return 0;
@@ -132,4 +138,40 @@ PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::copyHTMLTableCell
return getOrCreate(static_cast<HTMLTableCellElement*>(m_node.get())->cellAbove());
}
+PassRefPtr<WebFrame> InjectedBundleNodeHandle::documentFrame()
+{
+ if (!m_node->isDocumentNode())
+ return 0;
+
+ Frame* frame = static_cast<Document*>(m_node.get())->frame();
+ if (!frame)
+ return 0;
+
+ return static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+}
+
+PassRefPtr<WebFrame> InjectedBundleNodeHandle::htmlFrameElementContentFrame()
+{
+ if (!m_node->hasTagName(frameTag))
+ return 0;
+
+ Frame* frame = static_cast<HTMLFrameElement*>(m_node.get())->contentFrame();
+ if (!frame)
+ return 0;
+
+ return static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+}
+
+PassRefPtr<WebFrame> InjectedBundleNodeHandle::htmlIFrameElementContentFrame()
+{
+ if (!m_node->hasTagName(iframeTag))
+ return 0;
+
+ Frame* frame = static_cast<HTMLIFrameElement*>(m_node.get())->contentFrame();
+ if (!frame)
+ return 0;
+
+ return static_cast<WebFrameLoaderClient*>(frame->loader()->client())->webFrame();
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
index ad99840..4670e41 100644
--- a/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
+++ b/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
@@ -37,6 +37,7 @@ namespace WebCore {
namespace WebKit {
class InjectedBundleScriptWorld;
+class WebFrame;
class InjectedBundleNodeHandle : public APIObject {
public:
@@ -55,7 +56,11 @@ public:
void setHTMLInputElementValueForUser(const String&);
bool isHTMLInputElementAutofilled() const;
void setHTMLInputElementAutofilled(bool);
- PassRefPtr<InjectedBundleNodeHandle> copyHTMLTableCellElementCellAbove();
+ PassRefPtr<InjectedBundleNodeHandle> htmlTableCellElementCellAbove();
+
+ PassRefPtr<WebFrame> documentFrame();
+ PassRefPtr<WebFrame> htmlFrameElementContentFrame();
+ PassRefPtr<WebFrame> htmlIFrameElementContentFrame();
private:
static PassRefPtr<InjectedBundleNodeHandle> create(WebCore::Node*);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list