| 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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 String urlParameter; | 155 String urlParameter; |
| 156 | 156 |
| 157 // Scan the PARAM children and store their name/value pairs. | 157 // Scan the PARAM children and store their name/value pairs. |
| 158 // Get the URL and type from the params if we don't already have them. | 158 // Get the URL and type from the params if we don't already have them. |
| 159 for (HTMLParamElement* p = Traversal<HTMLParamElement>::firstChild(*this); p; | 159 for (HTMLParamElement* p = Traversal<HTMLParamElement>::firstChild(*this); p; |
| 160 p = Traversal<HTMLParamElement>::nextSibling(*p)) { | 160 p = Traversal<HTMLParamElement>::nextSibling(*p)) { |
| 161 String name = p->name(); | 161 String name = p->name(); |
| 162 if (name.isEmpty()) | 162 if (name.isEmpty()) |
| 163 continue; | 163 continue; |
| 164 | 164 |
| 165 uniqueParamNames.add(name.impl()); | 165 uniqueParamNames.insert(name.impl()); |
| 166 paramNames.push_back(p->name()); | 166 paramNames.push_back(p->name()); |
| 167 paramValues.push_back(p->value()); | 167 paramValues.push_back(p->value()); |
| 168 | 168 |
| 169 // TODO(schenney): crbug.com/572908 url adjustment does not belong in this | 169 // TODO(schenney): crbug.com/572908 url adjustment does not belong in this |
| 170 // function. | 170 // function. |
| 171 if (url.isEmpty() && urlParameter.isEmpty() && | 171 if (url.isEmpty() && urlParameter.isEmpty() && |
| 172 (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || | 172 (equalIgnoringCase(name, "src") || equalIgnoringCase(name, "movie") || |
| 173 equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) | 173 equalIgnoringCase(name, "code") || equalIgnoringCase(name, "url"))) |
| 174 urlParameter = stripLeadingAndTrailingHTMLSpaces(p->value()); | 174 urlParameter = stripLeadingAndTrailingHTMLSpaces(p->value()); |
| 175 // TODO(schenney): crbug.com/572908 serviceType calculation does not belong | 175 // TODO(schenney): crbug.com/572908 serviceType calculation does not belong |
| 176 // in this function. | 176 // in this function. |
| 177 if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) { | 177 if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) { |
| 178 serviceType = p->value(); | 178 serviceType = p->value(); |
| 179 size_t pos = serviceType.find(";"); | 179 size_t pos = serviceType.find(";"); |
| 180 if (pos != kNotFound) | 180 if (pos != kNotFound) |
| 181 serviceType = serviceType.left(pos); | 181 serviceType = serviceType.left(pos); |
| 182 } | 182 } |
| 183 } | 183 } |
| 184 | 184 |
| 185 // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE | 185 // When OBJECT is used for an applet via Sun's Java plugin, the CODEBASE |
| 186 // attribute in the tag points to the Java plugin itself (an ActiveX | 186 // attribute in the tag points to the Java plugin itself (an ActiveX |
| 187 // component) while the actual applet CODEBASE is in a PARAM tag. See | 187 // component) while the actual applet CODEBASE is in a PARAM tag. See |
| 188 // <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means we | 188 // <http://java.sun.com/products/plugin/1.2/docs/tags.html>. This means we |
| 189 // have to explicitly suppress the tag's CODEBASE attribute if there is none | 189 // have to explicitly suppress the tag's CODEBASE attribute if there is none |
| 190 // in a PARAM, else our Java plugin will misinterpret it. [4004531] | 190 // in a PARAM, else our Java plugin will misinterpret it. [4004531] |
| 191 String codebase; | 191 String codebase; |
| 192 if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) { | 192 if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType)) { |
| 193 codebase = "codebase"; | 193 codebase = "codebase"; |
| 194 uniqueParamNames.add( | 194 uniqueParamNames.insert( |
| 195 codebase.impl()); // pretend we found it in a PARAM already | 195 codebase.impl()); // pretend we found it in a PARAM already |
| 196 } | 196 } |
| 197 | 197 |
| 198 // Turn the attributes of the <object> element into arrays, but don't override | 198 // Turn the attributes of the <object> element into arrays, but don't override |
| 199 // <param> values. | 199 // <param> values. |
| 200 AttributeCollection attributes = this->attributes(); | 200 AttributeCollection attributes = this->attributes(); |
| 201 for (const Attribute& attribute : attributes) { | 201 for (const Attribute& attribute : attributes) { |
| 202 const AtomicString& name = attribute.name().localName(); | 202 const AtomicString& name = attribute.name().localName(); |
| 203 if (!uniqueParamNames.contains(name.impl())) { | 203 if (!uniqueParamNames.contains(name.impl())) { |
| 204 paramNames.push_back(name.getString()); | 204 paramNames.push_back(name.getString()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 458 |
| 459 bool HTMLObjectElement::willUseFallbackContentAtLayout() const { | 459 bool HTMLObjectElement::willUseFallbackContentAtLayout() const { |
| 460 return !hasValidClassId() && hasFallbackContent(); | 460 return !hasValidClassId() && hasFallbackContent(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void HTMLObjectElement::associateWith(HTMLFormElement* form) { | 463 void HTMLObjectElement::associateWith(HTMLFormElement* form) { |
| 464 associateByParser(form); | 464 associateByParser(form); |
| 465 }; | 465 }; |
| 466 | 466 |
| 467 } // namespace blink | 467 } // namespace blink |
| OLD | NEW |