summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/src/WebNode.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebNode.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp
index 27d57cfbc..e3e720b6e 100644
--- a/Source/WebKit/chromium/src/WebNode.cpp
+++ b/Source/WebKit/chromium/src/WebNode.cpp
@@ -38,12 +38,17 @@
#include "Node.h"
#include "NodeList.h"
#include "EventListenerWrapper.h"
+#include "RenderObject.h"
+#include "RenderWidget.h"
#include "WebDOMEvent.h"
#include "WebDOMEventListener.h"
#include "WebDocument.h"
#include "WebElement.h"
#include "WebFrameImpl.h"
#include "WebNodeList.h"
+#include "WebPluginContainer.h"
+#include "WebPluginContainerImpl.h"
+#include "Widget.h"
#include "markup.h"
#include <public/WebString.h>
#include <public/WebVector.h>
@@ -204,8 +209,7 @@ bool WebNode::dispatchEvent(const WebDOMEvent& event)
void WebNode::simulateClick()
{
- RefPtr<Event> noEvent;
- m_private->dispatchSimulatedClick(noEvent);
+ m_private->dispatchSimulatedClick(0);
}
WebNodeList WebNode::getElementsByTagName(const WebString& tag) const
@@ -236,6 +240,22 @@ bool WebNode::hasNonEmptyBoundingBox() const
return m_private->hasNonEmptyBoundingBox();
}
+WebPluginContainer* WebNode::pluginContainer() const
+{
+ if (isNull())
+ return 0;
+ const Node* coreNode = constUnwrap<Node>();
+ if (coreNode->hasTagName(HTMLNames::objectTag) || coreNode->hasTagName(HTMLNames::embedTag)) {
+ RenderObject* object = coreNode->renderer();
+ if (object && object->isWidget()) {
+ Widget* widget = WebCore::toRenderWidget(object)->widget();
+ if (widget && widget->isPluginContainer())
+ return static_cast<WebPluginContainerImpl*>(widget);
+ }
+ }
+ return 0;
+}
+
WebNode::WebNode(const PassRefPtr<Node>& node)
: m_private(node)
{