PluginDocument::pluginNode() should be pluginElement() instead.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 May 2013 02:48:46 +0000 (02:48 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 26 May 2013 02:48:46 +0000 (02:48 +0000)
<http://webkit.org/b/116774>

Reviewed by Anders Carlsson.

Source/WebCore:

Make PluginDocument hand out a HTMLPlugInElement* instead of a Node*.

* dom/Document.cpp:
(WebCore::eventTargetNodeForDocument):
* html/PluginDocument.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
(WebCore::PluginDocument::pluginWidget):
(WebCore::PluginDocument::setPluginElement):
(WebCore::PluginDocument::detach):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedPluginViewForFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150700 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/dom/Document.cpp
Source/WebCore/html/PluginDocument.cpp
Source/WebCore/html/PluginDocument.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 17e3df3f88e89880bd049761d3e5f4fb1fdafac5..4f33a84878f7fa40c92ec8c0cd38dc5ee059f7b8 100644 (file)
@@ -1,3 +1,21 @@
+2013-05-25  Andreas Kling  <akling@apple.com>
+
+        PluginDocument::pluginNode() should be pluginElement() instead.
+        <http://webkit.org/b/116774>
+
+        Reviewed by Anders Carlsson.
+
+        Make PluginDocument hand out a HTMLPlugInElement* instead of a Node*.
+
+        * dom/Document.cpp:
+        (WebCore::eventTargetNodeForDocument):
+        * html/PluginDocument.h:
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocumentParser::createDocumentStructure):
+        (WebCore::PluginDocument::pluginWidget):
+        (WebCore::PluginDocument::setPluginElement):
+        (WebCore::PluginDocument::detach):
+
 2013-05-25  Andreas Kling  <akling@apple.com>
 
         Remove Document::getFocusableNodes().
index 7faaf11cdac6858e4617cf7cf2a07f36740b60f9..695da915e984959efa36ad927c2a175414a9846e 100644 (file)
@@ -329,7 +329,6 @@ __ZN7WebCore14FrameSelection9selectAllEv
 __ZN7WebCore14FrameSelectionC1EPNS_5FrameE
 __ZN7WebCore14LoaderStrategy21resourceLoadSchedulerEv
 __ZN7WebCore14LoaderStrategy25loadResourceSynchronouslyEPNS_17NetworkingContextEmRKNS_15ResourceRequestENS_17StoredCredentialsENS_22ClientCredentialPolicyERNS_13ResourceErrorERNS_16ResourceResponseERN3WTF6VectorIcLm0ENSC_15CrashOnOverflowEEE
-__ZN7WebCore14PluginDocument10pluginNodeEv
 __ZN7WebCore14PluginDocument12pluginWidgetEv
 __ZN7WebCore14ResourceBuffer12createNSDataEv
 __ZN7WebCore14ResourceBuffer6appendEPKcj
index 8e2ad3b8ee907a6a529859a1f247aea28c95f4c7..35d60ddaef2a213b4ab1c109b46cf21ad437c4fd 100644 (file)
 #include "HTMLNameCollection.h"
 #include "HTMLNames.h"
 #include "HTMLParserIdioms.h"
+#include "HTMLPlugInElement.h"
 #include "HTMLStyleElement.h"
 #include "HTMLTitleElement.h"
 #include "HTTPParsers.h"
@@ -5770,7 +5771,7 @@ Node* eventTargetNodeForDocument(Document* doc)
     Node* node = doc->focusedNode();
     if (!node && doc->isPluginDocument()) {
         PluginDocument* pluginDocument = toPluginDocument(doc);
-        node =  pluginDocument->pluginNode();
+        node = pluginDocument->pluginElement();
     }
     if (!node && doc->isHTMLDocument())
         node = doc->body();
index 883f04d0162cead583b134c1d9dee6666a656b89..2ba2d5aceca403d4cff34401ff9fa768e134f79d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2008, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,7 +34,6 @@
 #include "HTMLEmbedElement.h"
 #include "HTMLHtmlElement.h"
 #include "HTMLNames.h"
-#include "NodeList.h"
 #include "Page.h"
 #include "RawDataDocumentParser.h"
 #include "RenderEmbeddedObject.h"
@@ -96,7 +95,7 @@ void PluginDocumentParser::createDocumentStructure()
     if (loader)
         m_embedElement->setAttribute(typeAttr, loader->writer()->mimeType());
 
-    toPluginDocument(document())->setPluginNode(m_embedElement);
+    toPluginDocument(document())->setPluginElement(m_embedElement);
 
     body->appendChild(embedElement, IGNORE_EXCEPTION);
 }
@@ -150,22 +149,22 @@ PassRefPtr<DocumentParser> PluginDocument::createParser()
 
 Widget* PluginDocument::pluginWidget()
 {
-    if (m_pluginNode && m_pluginNode->renderer()) {
-        ASSERT(m_pluginNode->renderer()->isEmbeddedObject());
-        return toRenderEmbeddedObject(m_pluginNode->renderer())->widget();
+    if (m_pluginElement && m_pluginElement->renderer()) {
+        ASSERT(m_pluginElement->renderer()->isEmbeddedObject());
+        return toRenderEmbeddedObject(m_pluginElement->renderer())->widget();
     }
     return 0;
 }
 
-Node* PluginDocument::pluginNode()
+void PluginDocument::setPluginElement(PassRefPtr<HTMLPlugInElement> element)
 {
-    return m_pluginNode.get();
+    m_pluginElement = element;
 }
 
 void PluginDocument::detach()
 {
-    // Release the plugin node so that we don't have a circular reference.
-    m_pluginNode = 0;
+    // Release the plugin Element so that we don't have a circular reference.
+    m_pluginElement = 0;
     if (FrameLoader* loader = frame()->loader())
         loader->client()->redirectDataToPlugin(0);
     HTMLDocument::detach();
index 26ccd6c57e0b0e5c6bcc6cbf47efb2d17c2c5513..8cf0bd007cded22ba792c3778cb54b0ba0915cc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2008, 2009, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,7 +29,7 @@
 
 namespace WebCore {
 
-class Node;
+class HTMLPlugInElement;
 class Widget;
 
 class PluginDocument FINAL : public HTMLDocument {
@@ -39,10 +39,10 @@ public:
         return adoptRef(new PluginDocument(frame, url));
     }
 
-    void setPluginNode(Node* pluginNode) { m_pluginNode = pluginNode; }
+    void setPluginElement(PassRefPtr<HTMLPlugInElement>);
 
     Widget* pluginWidget();
-    Node* pluginNode();
+    HTMLPlugInElement* pluginElement() { return m_pluginElement.get(); }
 
     virtual void detach() OVERRIDE;
 
@@ -58,7 +58,7 @@ private:
     void setShouldLoadPluginManually(bool loadManually) { m_shouldLoadPluginManually = loadManually; }
 
     bool m_shouldLoadPluginManually;
-    RefPtr<Node> m_pluginNode;
+    RefPtr<HTMLPlugInElement> m_pluginElement;
 };
 
 inline PluginDocument* toPluginDocument(Document* document)
index 0fb227c4893c1a0e981a28821bd1c859610db166..8d4a94c3b67248665b410f79153609d6727d14df 100644 (file)
@@ -1,3 +1,13 @@
+2013-05-25  Andreas Kling  <akling@apple.com>
+
+        PluginDocument::pluginNode() should be pluginElement() instead.
+        <http://webkit.org/b/116774>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::focusedPluginViewForFrame):
+
 2013-05-25  Simon Fraser  <simon.fraser@apple.com>
 
         Unprefix Page Visibility API
index 5b8a6dc8c1ad271b4ebb746dae85ac8f5831c274..9d0a4b060e77fe4dcd5b4d7e0a22e140783f3aaf 100644 (file)
@@ -744,7 +744,7 @@ PluginView* WebPage::focusedPluginViewForFrame(Frame* frame)
 
     PluginDocument* pluginDocument = static_cast<PluginDocument*>(frame->document());
 
-    if (pluginDocument->focusedNode() != pluginDocument->pluginNode())
+    if (pluginDocument->focusedNode() != pluginDocument->pluginElement())
         return 0;
 
     PluginView* pluginView = static_cast<PluginView*>(pluginDocument->pluginWidget());