[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
abarth at webkit.org
abarth at webkit.org
Mon Feb 21 00:37:08 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 12c7af02dcd0b177982d98472dedd8156b767fbc
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 2 08:00:19 2011 +0000
2011-02-01 Adam Barth <abarth at webkit.org>
Reviewed by Alexey Proskuryakov.
Improve readability of updateWidget by converting bool parameter to an enum
https://bugs.webkit.org/show_bug.cgi?id=53576
As requested on webkit-dev.
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget):
* html/HTMLEmbedElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateWidget):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget):
* html/HTMLObjectElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
* html/HTMLPlugInImageElement.h:
* page/FrameView.cpp:
(WebCore::FrameView::updateWidget):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index f5f375a..b4ab02f 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2011-02-01 Adam Barth <abarth at webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Improve readability of updateWidget by converting bool parameter to an enum
+ https://bugs.webkit.org/show_bug.cgi?id=53576
+
+ As requested on webkit-dev.
+
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::updateWidget):
+ * html/HTMLEmbedElement.h:
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::updateWidget):
+ * html/HTMLMediaElement.h:
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::updateWidget):
+ * html/HTMLObjectElement.h:
+ * html/HTMLPlugInImageElement.cpp:
+ (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary):
+ * html/HTMLPlugInImageElement.h:
+ * page/FrameView.cpp:
+ (WebCore::FrameView::updateWidget):
+
2011-02-01 James Robinson <jamesr at chromium.org>
Reviewed by Adam Barth.
diff --git a/Source/WebCore/html/HTMLEmbedElement.cpp b/Source/WebCore/html/HTMLEmbedElement.cpp
index df97280..f419e2a 100644
--- a/Source/WebCore/html/HTMLEmbedElement.cpp
+++ b/Source/WebCore/html/HTMLEmbedElement.cpp
@@ -138,7 +138,7 @@ void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, Vector<St
// FIXME: This should be unified with HTMLObjectElement::updateWidget and
// moved down into HTMLPluginImageElement.cpp
-void HTMLEmbedElement::updateWidget(bool onlyCreateNonNetscapePlugins)
+void HTMLEmbedElement::updateWidget(PluginCreationOption pluginCreationOption)
{
ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
// FIXME: We should ASSERT(needsWidgetUpdate()), but currently
@@ -153,7 +153,10 @@ void HTMLEmbedElement::updateWidget(bool onlyCreateNonNetscapePlugins)
// <object> which modifies url and serviceType before calling these.
if (!allowedToLoadFrameURL(m_url))
return;
- if (onlyCreateNonNetscapePlugins && wouldLoadAsNetscapePlugin(m_url, m_serviceType))
+ // FIXME: It's sadness that we have this special case here.
+ // See http://trac.webkit.org/changeset/25128 and
+ // plugins/netscape-plugin-setwindow-size.html
+ if (pluginCreationOption == CreateOnlyNonNetscapePlugins && wouldLoadAsNetscapePlugin(m_url, m_serviceType))
return;
// FIXME: These should be joined into a PluginParameters class.
diff --git a/Source/WebCore/html/HTMLEmbedElement.h b/Source/WebCore/html/HTMLEmbedElement.h
index 70eb0dc..863c09b 100644
--- a/Source/WebCore/html/HTMLEmbedElement.h
+++ b/Source/WebCore/html/HTMLEmbedElement.h
@@ -47,7 +47,7 @@ private:
virtual RenderWidget* renderWidgetForJSBindings() const;
- virtual void updateWidget(bool onlyCreateNonNetscapePlugins);
+ virtual void updateWidget(PluginCreationOption);
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index ec1e5e1..9f11aa5 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -2392,7 +2392,7 @@ void HTMLMediaElement::createMediaPlayerProxy()
m_needWidgetUpdate = false;
}
-void HTMLMediaElement::updateWidget(bool)
+void HTMLMediaElement::updateWidget(PluginCreationOption)
{
mediaElement->setNeedWidgetUpdate(false);
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index bdc3447..e261ad9 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -152,7 +152,7 @@ public:
void getPluginProxyParams(KURL& url, Vector<String>& names, Vector<String>& values);
virtual void finishParsingChildren();
void createMediaPlayerProxy();
- void updateWidget(bool onlyCreateNonNetscapePlugins);
+ void updateWidget(PluginCreationOption);
#endif
bool hasSingleSecurityOrigin() const { return !m_player || m_player->hasSingleSecurityOrigin(); }
diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp
index 84dc684..da1bea9 100644
--- a/Source/WebCore/html/HTMLObjectElement.cpp
+++ b/Source/WebCore/html/HTMLObjectElement.cpp
@@ -251,7 +251,7 @@ inline bool HTMLObjectElement::hasValidClassId()
// FIXME: This should be unified with HTMLEmbedElement::updateWidget and
// moved down into HTMLPluginImageElement.cpp
-void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
+void HTMLObjectElement::updateWidget(PluginCreationOption pluginCreationOption)
{
ASSERT(!renderEmbeddedObject()->pluginCrashedOrWasMissing());
// FIXME: We should ASSERT(needsWidgetUpdate()), but currently
@@ -277,7 +277,7 @@ void HTMLObjectElement::updateWidget(bool onlyCreateNonNetscapePlugins)
bool fallbackContent = hasFallbackContent();
renderEmbeddedObject()->setHasFallbackContent(fallbackContent);
- if (onlyCreateNonNetscapePlugins && wouldLoadAsNetscapePlugin(url, serviceType))
+ if (pluginCreationOption == CreateOnlyNonNetscapePlugins && wouldLoadAsNetscapePlugin(url, serviceType))
return;
ASSERT(!m_inBeforeLoadEventHandler);
diff --git a/Source/WebCore/html/HTMLObjectElement.h b/Source/WebCore/html/HTMLObjectElement.h
index cc8a03c..a4dca8c 100644
--- a/Source/WebCore/html/HTMLObjectElement.h
+++ b/Source/WebCore/html/HTMLObjectElement.h
@@ -85,7 +85,7 @@ private:
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
- virtual void updateWidget(bool onlyCreateNonNetscapePlugins);
+ virtual void updateWidget(PluginCreationOption);
void updateDocNamedItem();
bool hasFallbackContent() const;
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.cpp b/Source/WebCore/html/HTMLPlugInImageElement.cpp
index 1c91c05..db07334 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInImageElement.cpp
@@ -166,7 +166,7 @@ void HTMLPlugInImageElement::updateWidgetIfNecessary()
if (!renderEmbeddedObject() || renderEmbeddedObject()->pluginCrashedOrWasMissing())
return;
- updateWidget(true);
+ updateWidget(CreateOnlyNonNetscapePlugins);
}
void HTMLPlugInImageElement::finishParsingChildren()
diff --git a/Source/WebCore/html/HTMLPlugInImageElement.h b/Source/WebCore/html/HTMLPlugInImageElement.h
index f394d40..364262b 100644
--- a/Source/WebCore/html/HTMLPlugInImageElement.h
+++ b/Source/WebCore/html/HTMLPlugInImageElement.h
@@ -29,12 +29,17 @@ namespace WebCore {
class HTMLImageLoader;
class FrameLoader;
+enum PluginCreationOption {
+ CreateAnyWidgetType,
+ CreateOnlyNonNetscapePlugins,
+};
+
// Base class for HTMLObjectElement and HTMLEmbedElement
class HTMLPlugInImageElement : public HTMLPlugInElement {
public:
RenderEmbeddedObject* renderEmbeddedObject() const;
- virtual void updateWidget(bool onlyCreateNonNetscapePlugins) = 0;
+ virtual void updateWidget(PluginCreationOption) = 0;
const String& serviceType() const { return m_serviceType; }
const String& url() const { return m_url; }
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index bbadea6..0e84dc0 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -1793,11 +1793,11 @@ void FrameView::updateWidget(RenderEmbeddedObject* object)
// FIXME: This could turn into a real virtual dispatch if we defined
// updateWidget(bool) on HTMLElement.
if (ownerElement->hasTagName(objectTag) || ownerElement->hasTagName(embedTag))
- static_cast<HTMLPlugInImageElement*>(ownerElement)->updateWidget(false);
+ static_cast<HTMLPlugInImageElement*>(ownerElement)->updateWidget(CreateAnyWidgetType);
// FIXME: It is not clear that Media elements need or want this updateWidget() call.
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (ownerElement->hasTagName(videoTag) || ownerElement->hasTagName(audioTag))
- static_cast<HTMLMediaElement*>(ownerElement)->updateWidget(false);
+ static_cast<HTMLMediaElement*>(ownerElement)->updateWidget(CreateAnyWidgetType);
#endif
else
ASSERT_NOT_REACHED();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list