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 17e3df3..4f33a84 100644 (file)
@@ -1,5 +1,23 @@
 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().
         <http://webkit.org/b/116773>
 
index 7faaf11..695da91 100644 (file)
@@ -329,7 +329,6 @@ __ZN7WebCore14FrameSelection9selectAllEv
 __ZN7WebCore14FrameSelectionC1EPNS_5FrameE
 __ZN7WebCore14LoaderStrategy21resourceLoadSchedulerEv
 __ZN7WebCore14LoaderStrategy25loadResourceSynchronouslyEPNS_17NetworkingContextEmRKNS_15ResourceRequestENS_17StoredCredentialsENS_22ClientCredentialPolicyERNS_13ResourceErrorERNS_16ResourceResponseERN3WTF6VectorIcLm0ENSC_15CrashOnOverflowEEE
-__ZN7WebCore14PluginDocument10pluginNodeEv
 __ZN7WebCore14PluginDocument12pluginWidgetEv
 __ZN7WebCore14ResourceBuffer12createNSDataEv
 __ZN7WebCore14ResourceBuffer6appendEPKcj
index 8e2ad3b..35d60dd 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 883f04d..2ba2d5a 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 26ccd6c..8cf0bd0 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 0fb227c..8d4a94c 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 5b8a6dc..9d0a4b0 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());