Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: Source/core/html/HTMLObjectElement.h

Issue 50453004: Finding an <object> element by name only works it has no children other than <param> elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix 2 plugins tests Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 17 matching lines...) Expand all
28 28
29 namespace WebCore { 29 namespace WebCore {
30 30
31 class HTMLFormElement; 31 class HTMLFormElement;
32 32
33 class HTMLObjectElement FINAL : public HTMLPlugInElement, public FormAssociatedE lement { 33 class HTMLObjectElement FINAL : public HTMLPlugInElement, public FormAssociatedE lement {
34 public: 34 public:
35 static PassRefPtr<HTMLObjectElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser); 35 static PassRefPtr<HTMLObjectElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
36 virtual ~HTMLObjectElement(); 36 virtual ~HTMLObjectElement();
37 37
38 bool isDocNamedItem() const { return m_docNamedItem; }
39
40 const String& classId() const { return m_classId; } 38 const String& classId() const { return m_classId; }
41 39
42 bool containsJavaApplet() const; 40 bool containsJavaApplet() const;
43 41
44 virtual bool useFallbackContent() const { return m_useFallbackContent; } 42 virtual bool useFallbackContent() const { return m_useFallbackContent; }
45 virtual void renderFallbackContent() OVERRIDE; 43 virtual void renderFallbackContent() OVERRIDE;
46 44
47 // Implementations of FormAssociatedElement 45 // Implementations of FormAssociatedElement
48 HTMLFormElement* form() const { return FormAssociatedElement::form(); } 46 HTMLFormElement* form() const { return FormAssociatedElement::form(); }
49 47
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 80 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0);
83 81
84 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; 82 virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
85 virtual const AtomicString imageSourceURL() const OVERRIDE; 83 virtual const AtomicString imageSourceURL() const OVERRIDE;
86 84
87 virtual RenderWidget* existingRenderWidget() const OVERRIDE; 85 virtual RenderWidget* existingRenderWidget() const OVERRIDE;
88 86
89 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 87 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
90 88
91 virtual void updateWidget(PluginCreationOption); 89 virtual void updateWidget(PluginCreationOption);
92 void updateDocNamedItem();
93 90
94 void reattachFallbackContent(); 91 void reattachFallbackContent();
95 92
96 bool hasFallbackContent() const; 93 bool hasFallbackContent() const;
97 94
98 // FIXME: This function should not deal with url or serviceType 95 // FIXME: This function should not deal with url or serviceType
99 // so that we can better share code between <object> and <embed>. 96 // so that we can better share code between <object> and <embed>.
100 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa lues, String& url, String& serviceType); 97 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa lues, String& url, String& serviceType);
101 98
102 bool shouldAllowQuickTimeClassIdQuirk(); 99 bool shouldAllowQuickTimeClassIdQuirk();
103 bool hasValidClassId(); 100 bool hasValidClassId();
104 101
105 virtual void refFormAssociatedElement() { ref(); } 102 virtual void refFormAssociatedElement() { ref(); }
106 virtual void derefFormAssociatedElement() { deref(); } 103 virtual void derefFormAssociatedElement() { deref(); }
107 virtual HTMLFormElement* virtualForm() const; 104 virtual HTMLFormElement* virtualForm() const;
108 105
109 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return isDocNamedI tem(); } 106 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
110 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return isDocN amedItem(); } 107 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
111 108
112 String m_classId; 109 String m_classId;
113 bool m_docNamedItem : 1;
114 bool m_useFallbackContent : 1; 110 bool m_useFallbackContent : 1;
115 }; 111 };
116 112
117 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag)); 113 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag));
118 114
119 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element) 115 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element)
120 { 116 {
121 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( )); 117 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( ));
122 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element); 118 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element);
123 // We need to assert after the cast because FormAssociatedElement doesn't 119 // We need to assert after the cast because FormAssociatedElement doesn't
124 // have hasTagName. 120 // have hasTagName.
125 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag)); 121 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag));
126 return objectElement; 122 return objectElement;
127 } 123 }
128 124
129 } 125 }
130 126
131 #endif 127 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698