| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 if (child->isTextNode()) { | 221 if (child->isTextNode()) { |
| 222 if (!toText(child)->containsOnlyWhitespace()) | 222 if (!toText(child)->containsOnlyWhitespace()) |
| 223 return true; | 223 return true; |
| 224 } else if (!isHTMLParamElement(*child)) { | 224 } else if (!isHTMLParamElement(*child)) { |
| 225 return true; | 225 return true; |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 return false; | 228 return false; |
| 229 } | 229 } |
| 230 | 230 |
| 231 bool HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk() | |
| 232 { | |
| 233 // This site-specific hack maintains compatibility with Mac OS X Wiki Server
, | |
| 234 // which embeds QuickTime movies using an object tag containing QuickTime's | |
| 235 // ActiveX classid. Treat this classid as valid only if OS X Server's unique | |
| 236 // 'generator' meta tag is present. Only apply this quirk if there is no | |
| 237 // fallback content, which ensures the quirk will disable itself if Wiki | |
| 238 // Server is updated to generate an alternate embed tag as fallback content. | |
| 239 if (!document().settings() | |
| 240 || !document().settings()->needsSiteSpecificQuirks() | |
| 241 || hasFallbackContent() | |
| 242 || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABD
DC6B")) | |
| 243 return false; | |
| 244 | |
| 245 RefPtrWillBeRawPtr<TagCollection> metaElements = document().getElementsByTag
Name(HTMLNames::metaTag.localName()); | |
| 246 unsigned length = metaElements->length(); | |
| 247 for (unsigned i = 0; i < length; ++i) { | |
| 248 ASSERT(metaElements->item(i)->isHTMLElement()); | |
| 249 HTMLMetaElement* metaElement = toHTMLMetaElement(metaElements->item(i)); | |
| 250 if (equalIgnoringCase(metaElement->name(), "generator") && metaElement->
content().startsWith("Mac OS X Server Web Services Server", false)) | |
| 251 return true; | |
| 252 } | |
| 253 | |
| 254 return false; | |
| 255 } | |
| 256 | |
| 257 bool HTMLObjectElement::hasValidClassId() | 231 bool HTMLObjectElement::hasValidClassId() |
| 258 { | 232 { |
| 259 if (MIMETypeRegistry::isJavaAppletMIMEType(m_serviceType) && classId().start
sWith("java:", false)) | 233 if (MIMETypeRegistry::isJavaAppletMIMEType(m_serviceType) && classId().start
sWith("java:", false)) |
| 260 return true; | 234 return true; |
| 261 | 235 |
| 262 if (shouldAllowQuickTimeClassIdQuirk()) | |
| 263 return true; | |
| 264 | |
| 265 // HTML5 says that fallback content should be rendered if a non-empty | 236 // HTML5 says that fallback content should be rendered if a non-empty |
| 266 // classid is specified for which the UA can't find a suitable plug-in. | 237 // classid is specified for which the UA can't find a suitable plug-in. |
| 267 return classId().isEmpty(); | 238 return classId().isEmpty(); |
| 268 } | 239 } |
| 269 | 240 |
| 270 void HTMLObjectElement::reloadPluginOnAttributeChange(const QualifiedName& name) | 241 void HTMLObjectElement::reloadPluginOnAttributeChange(const QualifiedName& name) |
| 271 { | 242 { |
| 272 // Following, | 243 // Following, |
| 273 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element | 244 // http://www.whatwg.org/specs/web-apps/current-work/#the-object-element |
| 274 // (Enumerated list below "Whenever one of the following conditions occur:
") | 245 // (Enumerated list below "Whenever one of the following conditions occur:
") |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 { | 460 { |
| 490 return fastHasAttribute(usemapAttr); | 461 return fastHasAttribute(usemapAttr); |
| 491 } | 462 } |
| 492 | 463 |
| 493 bool HTMLObjectElement::useFallbackContent() const | 464 bool HTMLObjectElement::useFallbackContent() const |
| 494 { | 465 { |
| 495 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent; | 466 return HTMLPlugInElement::useFallbackContent() || m_useFallbackContent; |
| 496 } | 467 } |
| 497 | 468 |
| 498 } | 469 } |
| OLD | NEW |