| 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, 2007, 2008, 2009, 2011 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
reserved. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 paramNames.append(name.string()); | 193 paramNames.append(name.string()); |
| 194 paramValues.append(attribute.value().string()); | 194 paramValues.append(attribute.value().string()); |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 | 197 |
| 198 mapDataParamToSrc(¶mNames, ¶mValues); | 198 mapDataParamToSrc(¶mNames, ¶mValues); |
| 199 | 199 |
| 200 // HTML5 says that an object resource's URL is specified by the object's dat
a | 200 // HTML5 says that an object resource's URL is specified by the object's dat
a |
| 201 // attribute, not by a param element. However, for compatibility, allow the | 201 // attribute, not by a param element. However, for compatibility, allow the |
| 202 // resource's URL to be given by a param named "src", "movie", "code" or "ur
l" | 202 // resource's URL to be given by a param named "src", "movie", "code" or "ur
l" |
| 203 // if we know that resource points to a plug-in. | 203 // if we know that resource points to a plugin. |
| 204 if (url.isEmpty() && !urlParameter.isEmpty()) { | 204 if (url.isEmpty() && !urlParameter.isEmpty()) { |
| 205 KURL completedURL = document().completeURL(urlParameter); | 205 KURL completedURL = document().completeURL(urlParameter); |
| 206 bool useFallback; | 206 bool useFallback; |
| 207 if (shouldUsePlugin(completedURL, serviceType, false, useFallback)) | 207 if (shouldUsePlugin(completedURL, serviceType, false, useFallback)) |
| 208 url = urlParameter; | 208 url = urlParameter; |
| 209 } | 209 } |
| 210 } | 210 } |
| 211 | 211 |
| 212 | 212 |
| 213 bool HTMLObjectElement::hasFallbackContent() const | 213 bool HTMLObjectElement::hasFallbackContent() const |
| 214 { | 214 { |
| 215 for (Node* child = firstChild(); child; child = child->nextSibling()) { | 215 for (Node* child = firstChild(); child; child = child->nextSibling()) { |
| 216 // Ignore whitespace-only text, and <param> tags, any other content is f
allback content. | 216 // Ignore whitespace-only text, and <param> tags, any other content is f
allback content. |
| 217 if (child->isTextNode()) { | 217 if (child->isTextNode()) { |
| 218 if (!toText(child)->containsOnlyWhitespace()) | 218 if (!toText(child)->containsOnlyWhitespace()) |
| 219 return true; | 219 return true; |
| 220 } else if (!isHTMLParamElement(*child)) { | 220 } else if (!isHTMLParamElement(*child)) { |
| 221 return true; | 221 return true; |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 return false; | 224 return false; |
| 225 } | 225 } |
| 226 | 226 |
| 227 bool HTMLObjectElement::hasValidClassId() | 227 bool HTMLObjectElement::hasValidClassId() |
| 228 { | 228 { |
| 229 if (MIMETypeRegistry::isJavaAppletMIMEType(m_serviceType) && classId().start
sWith("java:", TextCaseInsensitive)) | 229 if (MIMETypeRegistry::isJavaAppletMIMEType(m_serviceType) && classId().start
sWith("java:", TextCaseInsensitive)) |
| 230 return true; | 230 return true; |
| 231 | 231 |
| 232 // HTML5 says that fallback content should be rendered if a non-empty | 232 // HTML5 says that fallback content should be rendered if a non-empty |
| 233 // classid is specified for which the UA can't find a suitable plug-in. | 233 // classid is specified for which the UA can't find a suitable plugin. |
| 234 return classId().isEmpty(); | 234 return classId().isEmpty(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void HTMLObjectElement::reloadPluginOnAttributeChange(const QualifiedName& name) | 237 void HTMLObjectElement::reloadPluginOnAttributeChange(const QualifiedName& name) |
| 238 { | 238 { |
| 239 // Following, | 239 // Following, |
| 240 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element | 240 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element |
| 241 // (Enumerated list below "Whenever one of the following conditions occur:
") | 241 // (Enumerated list below "Whenever one of the following conditions occur:
") |
| 242 // | 242 // |
| 243 // the updating of certain attributes should bring about "redetermination" | 243 // the updating of certain attributes should bring about "redetermination" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 { | 450 { |
| 451 return fastHasAttribute(usemapAttr); | 451 return fastHasAttribute(usemapAttr); |
| 452 } | 452 } |
| 453 | 453 |
| 454 bool HTMLObjectElement::useFallbackContent() const | 454 bool HTMLObjectElement::useFallbackContent() const |
| 455 { | 455 { |
| 456 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent; | 456 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent; |
| 457 } | 457 } |
| 458 | 458 |
| 459 } | 459 } |
| OLD | NEW |