| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
| 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights |
| 6 * reserved. | 6 * reserved. |
| 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 void HTMLEmbedElement::parseAttribute( | 95 void HTMLEmbedElement::parseAttribute( |
| 96 const AttributeModificationParams& params) { | 96 const AttributeModificationParams& params) { |
| 97 if (params.name == typeAttr) { | 97 if (params.name == typeAttr) { |
| 98 m_serviceType = params.newValue.lower(); | 98 m_serviceType = params.newValue.lower(); |
| 99 size_t pos = m_serviceType.find(";"); | 99 size_t pos = m_serviceType.find(";"); |
| 100 if (pos != kNotFound) | 100 if (pos != kNotFound) |
| 101 m_serviceType = m_serviceType.left(pos); | 101 m_serviceType = m_serviceType.left(pos); |
| 102 if (layoutObject()) { | 102 if (layoutObject()) { |
| 103 setNeedsWidgetUpdate(true); | 103 setNeedsPluginUpdate(true); |
| 104 layoutObject()->setNeedsLayoutAndFullPaintInvalidation( | 104 layoutObject()->setNeedsLayoutAndFullPaintInvalidation( |
| 105 "Embed type changed"); | 105 "Embed type changed"); |
| 106 } else { | 106 } else { |
| 107 requestPluginCreationWithoutLayoutObjectIfPossible(); | 107 requestPluginCreationWithoutLayoutObjectIfPossible(); |
| 108 } | 108 } |
| 109 } else if (params.name == codeAttr) { | 109 } else if (params.name == codeAttr) { |
| 110 // TODO(schenney): Remove this branch? It's not in the spec and we're not in | 110 // TODO(schenney): Remove this branch? It's not in the spec and we're not in |
| 111 // the HTMLAppletElement hierarchy. | 111 // the HTMLAppletElement hierarchy. |
| 112 m_url = stripLeadingAndTrailingHTMLSpaces(params.newValue); | 112 m_url = stripLeadingAndTrailingHTMLSpaces(params.newValue); |
| 113 } else if (params.name == srcAttr) { | 113 } else if (params.name == srcAttr) { |
| 114 m_url = stripLeadingAndTrailingHTMLSpaces(params.newValue); | 114 m_url = stripLeadingAndTrailingHTMLSpaces(params.newValue); |
| 115 if (layoutObject() && isImageType()) { | 115 if (layoutObject() && isImageType()) { |
| 116 if (!m_imageLoader) | 116 if (!m_imageLoader) |
| 117 m_imageLoader = HTMLImageLoader::create(this); | 117 m_imageLoader = HTMLImageLoader::create(this); |
| 118 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousError); | 118 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousError); |
| 119 } else if (layoutObject()) { | 119 } else if (layoutObject()) { |
| 120 // Check if this Embed can transition from potentially-active to active | 120 // Check if this Embed can transition from potentially-active to active |
| 121 if (fastHasAttribute(typeAttr)) { | 121 if (fastHasAttribute(typeAttr)) { |
| 122 setNeedsWidgetUpdate(true); | 122 setNeedsPluginUpdate(true); |
| 123 lazyReattachIfNeeded(); | 123 lazyReattachIfNeeded(); |
| 124 } | 124 } |
| 125 } else { | 125 } else { |
| 126 requestPluginCreationWithoutLayoutObjectIfPossible(); | 126 requestPluginCreationWithoutLayoutObjectIfPossible(); |
| 127 } | 127 } |
| 128 } else { | 128 } else { |
| 129 HTMLPlugInElement::parseAttribute(params); | 129 HTMLPlugInElement::parseAttribute(params); |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, | 133 void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, |
| 134 Vector<String>& paramValues) { | 134 Vector<String>& paramValues) { |
| 135 AttributeCollection attributes = this->attributes(); | 135 AttributeCollection attributes = this->attributes(); |
| 136 for (const Attribute& attribute : attributes) { | 136 for (const Attribute& attribute : attributes) { |
| 137 paramNames.push_back(attribute.localName().getString()); | 137 paramNames.push_back(attribute.localName().getString()); |
| 138 paramValues.push_back(attribute.value().getString()); | 138 paramValues.push_back(attribute.value().getString()); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 // FIXME: This should be unified with HTMLObjectElement::updateWidget and | 142 // FIXME: This should be unified with HTMLObjectElement::updatePlugin and |
| 143 // moved down into HTMLPluginElement.cpp | 143 // moved down into HTMLPluginElement.cpp |
| 144 void HTMLEmbedElement::updateWidgetInternal() { | 144 void HTMLEmbedElement::updatePluginInternal() { |
| 145 DCHECK(!layoutEmbeddedItem().showsUnavailablePluginIndicator()); | 145 DCHECK(!layoutEmbeddedItem().showsUnavailablePluginIndicator()); |
| 146 DCHECK(needsWidgetUpdate()); | 146 DCHECK(needsPluginUpdate()); |
| 147 setNeedsWidgetUpdate(false); | 147 setNeedsPluginUpdate(false); |
| 148 | 148 |
| 149 if (m_url.isEmpty() && m_serviceType.isEmpty()) | 149 if (m_url.isEmpty() && m_serviceType.isEmpty()) |
| 150 return; | 150 return; |
| 151 | 151 |
| 152 // Note these pass m_url and m_serviceType to allow better code sharing with | 152 // Note these pass m_url and m_serviceType to allow better code sharing with |
| 153 // <object> which modifies url and serviceType before calling these. | 153 // <object> which modifies url and serviceType before calling these. |
| 154 if (!allowedToLoadFrameURL(m_url)) | 154 if (!allowedToLoadFrameURL(m_url)) |
| 155 return; | 155 return; |
| 156 | 156 |
| 157 // FIXME: These should be joined into a PluginParameters class. | 157 // FIXME: These should be joined into a PluginParameters class. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 for (HTMLObjectElement* object = | 224 for (HTMLObjectElement* object = |
| 225 Traversal<HTMLObjectElement>::firstAncestor(*this); | 225 Traversal<HTMLObjectElement>::firstAncestor(*this); |
| 226 object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) { | 226 object; object = Traversal<HTMLObjectElement>::firstAncestor(*object)) { |
| 227 if (object->isExposed()) | 227 if (object->isExposed()) |
| 228 return false; | 228 return false; |
| 229 } | 229 } |
| 230 return true; | 230 return true; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |