| 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 reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2011 Apple Inc. All rights reserv
ed. |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 PassRefPtrWillBeRawPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& docu
ment, bool createdByParser) | 48 PassRefPtrWillBeRawPtr<HTMLEmbedElement> HTMLEmbedElement::create(Document& docu
ment, bool createdByParser) |
| 49 { | 49 { |
| 50 RefPtrWillBeRawPtr<HTMLEmbedElement> element = adoptRefWillBeNoop(new HTMLEm
bedElement(document, createdByParser)); | 50 RefPtrWillBeRawPtr<HTMLEmbedElement> element = adoptRefWillBeNoop(new HTMLEm
bedElement(document, createdByParser)); |
| 51 element->ensureClosedShadowRoot(); | 51 element->ensureClosedShadowRoot(); |
| 52 return element.release(); | 52 return element.release(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 static inline LayoutPart* findPartRenderer(const Node* n) | 55 static inline LayoutPart* findPartRenderer(const Node* n) |
| 56 { | 56 { |
| 57 if (!n->renderer()) | 57 if (!n->layoutObject()) |
| 58 n = Traversal<HTMLObjectElement>::firstAncestor(*n); | 58 n = Traversal<HTMLObjectElement>::firstAncestor(*n); |
| 59 | 59 |
| 60 if (n && n->renderer() && n->renderer()->isLayoutPart()) | 60 if (n && n->layoutObject() && n->layoutObject()->isLayoutPart()) |
| 61 return toLayoutPart(n->renderer()); | 61 return toLayoutPart(n->layoutObject()); |
| 62 | 62 |
| 63 return nullptr; | 63 return nullptr; |
| 64 } | 64 } |
| 65 | 65 |
| 66 LayoutPart* HTMLEmbedElement::existingLayoutPart() const | 66 LayoutPart* HTMLEmbedElement::existingLayoutPart() const |
| 67 { | 67 { |
| 68 return findPartRenderer(this); | 68 return findPartRenderer(this); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool HTMLEmbedElement::isPresentationAttribute(const QualifiedName& name) const | 71 bool HTMLEmbedElement::isPresentationAttribute(const QualifiedName& name) const |
| (...skipping 15 matching lines...) Expand all Loading... |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 void HTMLEmbedElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 90 void HTMLEmbedElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
| 91 { | 91 { |
| 92 if (name == typeAttr) { | 92 if (name == typeAttr) { |
| 93 m_serviceType = value.lower(); | 93 m_serviceType = value.lower(); |
| 94 size_t pos = m_serviceType.find(";"); | 94 size_t pos = m_serviceType.find(";"); |
| 95 if (pos != kNotFound) | 95 if (pos != kNotFound) |
| 96 m_serviceType = m_serviceType.left(pos); | 96 m_serviceType = m_serviceType.left(pos); |
| 97 if (!renderer()) | 97 if (!layoutObject()) |
| 98 requestPluginCreationWithoutRendererIfPossible(); | 98 requestPluginCreationWithoutRendererIfPossible(); |
| 99 } else if (name == codeAttr) { | 99 } else if (name == codeAttr) { |
| 100 m_url = stripLeadingAndTrailingHTMLSpaces(value); | 100 m_url = stripLeadingAndTrailingHTMLSpaces(value); |
| 101 } else if (name == srcAttr) { | 101 } else if (name == srcAttr) { |
| 102 m_url = stripLeadingAndTrailingHTMLSpaces(value); | 102 m_url = stripLeadingAndTrailingHTMLSpaces(value); |
| 103 if (renderer() && isImageType()) { | 103 if (layoutObject() && isImageType()) { |
| 104 if (!m_imageLoader) | 104 if (!m_imageLoader) |
| 105 m_imageLoader = HTMLImageLoader::create(this); | 105 m_imageLoader = HTMLImageLoader::create(this); |
| 106 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousEr
ror); | 106 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousEr
ror); |
| 107 } | 107 } |
| 108 } else { | 108 } else { |
| 109 HTMLPlugInElement::parseAttribute(name, value); | 109 HTMLPlugInElement::parseAttribute(name, value); |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 | 112 |
| 113 void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, Vector<St
ring>& paramValues) | 113 void HTMLEmbedElement::parametersForPlugin(Vector<String>& paramNames, Vector<St
ring>& paramValues) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 // FIXME: These should be joined into a PluginParameters class. | 138 // FIXME: These should be joined into a PluginParameters class. |
| 139 Vector<String> paramNames; | 139 Vector<String> paramNames; |
| 140 Vector<String> paramValues; | 140 Vector<String> paramValues; |
| 141 parametersForPlugin(paramNames, paramValues); | 141 parametersForPlugin(paramNames, paramValues); |
| 142 | 142 |
| 143 RefPtrWillBeRawPtr<HTMLEmbedElement> protect(this); // Loading the plugin mi
ght remove us from the document. | 143 RefPtrWillBeRawPtr<HTMLEmbedElement> protect(this); // Loading the plugin mi
ght remove us from the document. |
| 144 | 144 |
| 145 // FIXME: Can we not have renderer here now that beforeload events are gone? | 145 // FIXME: Can we not have renderer here now that beforeload events are gone? |
| 146 if (!renderer()) | 146 if (!layoutObject()) |
| 147 return; | 147 return; |
| 148 | 148 |
| 149 requestObject(m_url, m_serviceType, paramNames, paramValues); | 149 requestObject(m_url, m_serviceType, paramNames, paramValues); |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool HTMLEmbedElement::layoutObjectIsNeeded(const LayoutStyle& style) | 152 bool HTMLEmbedElement::layoutObjectIsNeeded(const LayoutStyle& style) |
| 153 { | 153 { |
| 154 if (isImageType()) | 154 if (isImageType()) |
| 155 return HTMLPlugInElement::layoutObjectIsNeeded(style); | 155 return HTMLPlugInElement::layoutObjectIsNeeded(style); |
| 156 | 156 |
| 157 LocalFrame* frame = document().frame(); | 157 LocalFrame* frame = document().frame(); |
| 158 if (!frame) | 158 if (!frame) |
| 159 return false; | 159 return false; |
| 160 | 160 |
| 161 // If my parent is an <object> and is not set to use fallback content, I | 161 // If my parent is an <object> and is not set to use fallback content, I |
| 162 // should be ignored and not get a renderer. | 162 // should be ignored and not get a renderer. |
| 163 ContainerNode* p = parentNode(); | 163 ContainerNode* p = parentNode(); |
| 164 if (isHTMLObjectElement(p)) { | 164 if (isHTMLObjectElement(p)) { |
| 165 ASSERT(p->renderer()); | 165 ASSERT(p->layoutObject()); |
| 166 if (!toHTMLObjectElement(p)->useFallbackContent()) { | 166 if (!toHTMLObjectElement(p)->useFallbackContent()) { |
| 167 ASSERT(!p->renderer()->isEmbeddedObject()); | 167 ASSERT(!p->layoutObject()->isEmbeddedObject()); |
| 168 return false; | 168 return false; |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 return HTMLPlugInElement::layoutObjectIsNeeded(style); | 171 return HTMLPlugInElement::layoutObjectIsNeeded(style); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool HTMLEmbedElement::isURLAttribute(const Attribute& attribute) const | 174 bool HTMLEmbedElement::isURLAttribute(const Attribute& attribute) const |
| 175 { | 175 { |
| 176 return attribute.name() == srcAttr || HTMLPlugInElement::isURLAttribute(attr
ibute); | 176 return attribute.name() == srcAttr || HTMLPlugInElement::isURLAttribute(attr
ibute); |
| 177 } | 177 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 190 { | 190 { |
| 191 // http://www.whatwg.org/specs/web-apps/current-work/#exposed | 191 // http://www.whatwg.org/specs/web-apps/current-work/#exposed |
| 192 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor
(*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object))
{ | 192 for (HTMLObjectElement* object = Traversal<HTMLObjectElement>::firstAncestor
(*this); object; object = Traversal<HTMLObjectElement>::firstAncestor(*object))
{ |
| 193 if (object->isExposed()) | 193 if (object->isExposed()) |
| 194 return false; | 194 return false; |
| 195 } | 195 } |
| 196 return true; | 196 return true; |
| 197 } | 197 } |
| 198 | 198 |
| 199 } | 199 } |
| OLD | NEW |