summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/HTMLPlugInElement.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebCore/html/HTMLPlugInElement.cpp
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebCore/html/HTMLPlugInElement.cpp')
-rw-r--r--Source/WebCore/html/HTMLPlugInElement.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/Source/WebCore/html/HTMLPlugInElement.cpp b/Source/WebCore/html/HTMLPlugInElement.cpp
index 6229d2e03..66d60922c 100644
--- a/Source/WebCore/html/HTMLPlugInElement.cpp
+++ b/Source/WebCore/html/HTMLPlugInElement.cpp
@@ -112,7 +112,11 @@ PassScriptInstance HTMLPlugInElement::getInstance()
bool HTMLPlugInElement::guardedDispatchBeforeLoadEvent(const String& sourceURL)
{
- ASSERT(!m_inBeforeLoadEventHandler);
+ // FIXME: Our current plug-in loading design can't guarantee the following
+ // assertion is true, since plug-in loading can be initiated during layout,
+ // and synchronous layout can be initiated in a beforeload event handler!
+ // See <http://webkit.org/b/71264>.
+ // ASSERT(!m_inBeforeLoadEventHandler);
m_inBeforeLoadEventHandler = true;
// static_cast is used to avoid a compile error since dispatchBeforeLoadEvent
// is intentionally undefined on this class.
@@ -136,40 +140,36 @@ Widget* HTMLPlugInElement::pluginWidget()
return renderWidget->widget();
}
-bool HTMLPlugInElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
-{
- if (attrName == widthAttr ||
- attrName == heightAttr ||
- attrName == vspaceAttr ||
- attrName == hspaceAttr) {
- result = eUniversal;
- return false;
- }
-
- if (attrName == alignAttr) {
- result = eReplaced; // Share with <img> since the alignment behavior is the same.
- return false;
- }
-
- return HTMLFrameOwnerElement::mapToEntry(attrName, result);
-}
-
-void HTMLPlugInElement::parseMappedAttribute(Attribute* attr)
+void HTMLPlugInElement::parseAttribute(Attribute* attr)
{
if (attr->name() == widthAttr)
- addCSSLength(attr, CSSPropertyWidth, attr->value());
+ if (attr->isNull())
+ removeCSSProperty(CSSPropertyWidth);
+ else
+ addCSSLength(CSSPropertyWidth, attr->value());
else if (attr->name() == heightAttr)
- addCSSLength(attr, CSSPropertyHeight, attr->value());
+ if (attr->isNull())
+ removeCSSProperty(CSSPropertyHeight);
+ else
+ addCSSLength(CSSPropertyHeight, attr->value());
else if (attr->name() == vspaceAttr) {
- addCSSLength(attr, CSSPropertyMarginTop, attr->value());
- addCSSLength(attr, CSSPropertyMarginBottom, attr->value());
+ if (attr->isNull())
+ removeCSSProperties(CSSPropertyMarginTop, CSSPropertyMarginBottom);
+ else {
+ addCSSLength(CSSPropertyMarginTop, attr->value());
+ addCSSLength(CSSPropertyMarginBottom, attr->value());
+ }
} else if (attr->name() == hspaceAttr) {
- addCSSLength(attr, CSSPropertyMarginLeft, attr->value());
- addCSSLength(attr, CSSPropertyMarginRight, attr->value());
+ if (attr->isNull())
+ removeCSSProperties(CSSPropertyMarginLeft, CSSPropertyMarginRight);
+ else {
+ addCSSLength(CSSPropertyMarginLeft, attr->value());
+ addCSSLength(CSSPropertyMarginRight, attr->value());
+ }
} else if (attr->name() == alignAttr)
addHTMLAlignment(attr);
else
- HTMLFrameOwnerElement::parseMappedAttribute(attr);
+ HTMLFrameOwnerElement::parseAttribute(attr);
}
void HTMLPlugInElement::defaultEventHandler(Event* event)