[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:15:17 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 745a13bbc995e71cb0f19147034c2a12f694c49a
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 5 23:15:11 2010 +0000
2010-10-05 Sanjeev Radhakrishnan <sanjeevr at chromium.org>
Reviewed by Darin Fisher.
PluginDocument now holds on to the created plugin node so that the pluginNode() and pluginWidget() methods can return the correct node.
https://bugs.webkit.org/show_bug.cgi?id=47129
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
(WebCore::PluginDocument::pluginWidget):
(WebCore::PluginDocument::pluginNode):
* html/PluginDocument.h:
(WebCore::PluginDocument::setPluginNode):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5bb66ae..8897a41 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-10-05 Sanjeev Radhakrishnan <sanjeevr at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ PluginDocument now holds on to the created plugin node so that the pluginNode() and pluginWidget() methods can return the correct node.
+ https://bugs.webkit.org/show_bug.cgi?id=47129
+
+ * html/PluginDocument.cpp:
+ (WebCore::PluginDocumentParser::createDocumentStructure):
+ (WebCore::PluginDocument::pluginWidget):
+ (WebCore::PluginDocument::pluginNode):
+ * html/PluginDocument.h:
+ (WebCore::PluginDocument::setPluginNode):
+
2010-10-05 Andreas Kling <kling at webkit.org>
Reviewed by Tor Arne Vestbø.
diff --git a/WebCore/html/PluginDocument.cpp b/WebCore/html/PluginDocument.cpp
index 715d3b6..ca2e19a 100644
--- a/WebCore/html/PluginDocument.cpp
+++ b/WebCore/html/PluginDocument.cpp
@@ -50,8 +50,6 @@ public:
return adoptRef(new PluginDocumentParser(document));
}
- static Widget* pluginWidgetFromDocument(Document*);
-
private:
PluginDocumentParser(Document* document)
: RawDataDocumentParser(document)
@@ -66,22 +64,6 @@ private:
HTMLEmbedElement* m_embedElement;
};
-Widget* PluginDocumentParser::pluginWidgetFromDocument(Document* doc)
-{
- ASSERT(doc);
- RefPtr<Element> body = doc->body();
- if (body) {
- RefPtr<NodeList> embedNodes = body->getElementsByTagName("embed");
- ASSERT(embedNodes && embedNodes->length());
- Node* node = embedNodes->item(0);
- if (node && node->renderer()) {
- ASSERT(node->renderer()->isEmbeddedObject());
- return toRenderEmbeddedObject(node->renderer())->widget();
- }
- }
- return 0;
-}
-
void PluginDocumentParser::createDocumentStructure()
{
ExceptionCode ec;
@@ -110,7 +92,9 @@ void PluginDocumentParser::createDocumentStructure()
m_embedElement->setAttribute(nameAttr, "plugin");
m_embedElement->setAttribute(srcAttr, document()->url().string());
m_embedElement->setAttribute(typeAttr, document()->frame()->loader()->writer()->mimeType());
-
+
+ static_cast<PluginDocument*>(document())->setPluginNode(m_embedElement);
+
body->appendChild(embedElement, ec);
}
@@ -159,16 +143,16 @@ PassRefPtr<DocumentParser> PluginDocument::createParser()
Widget* PluginDocument::pluginWidget()
{
- return PluginDocumentParser::pluginWidgetFromDocument(this);
+ if (m_pluginNode && m_pluginNode->renderer()) {
+ ASSERT(m_pluginNode->renderer()->isEmbeddedObject());
+ return toRenderEmbeddedObject(m_pluginNode->renderer())->widget();
+ }
+ return 0;
}
Node* PluginDocument::pluginNode()
{
- RefPtr<Element> body_element = body();
- if (body_element)
- return body_element->firstChild();
-
- return 0;
+ return m_pluginNode.get();
}
void PluginDocument::cancelManualPluginLoad()
diff --git a/WebCore/html/PluginDocument.h b/WebCore/html/PluginDocument.h
index cb83fa7..2f7d711 100644
--- a/WebCore/html/PluginDocument.h
+++ b/WebCore/html/PluginDocument.h
@@ -38,6 +38,8 @@ public:
return adoptRef(new PluginDocument(frame, url));
}
+ void setPluginNode(Node* pluginNode) { m_pluginNode = pluginNode; }
+
Widget* pluginWidget();
Node* pluginNode();
@@ -55,6 +57,7 @@ private:
void setShouldLoadPluginManually(bool loadManually) { m_shouldLoadPluginManually = loadManually; }
bool m_shouldLoadPluginManually;
+ RefPtr<Node> m_pluginNode;
};
inline PluginDocument* toPluginDocument(Document* document)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list