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

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

Issue 61213008: Revert "Finding an <object> element by name only works it has no children other than <param> elemen… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/html/HTMLNameCollection.cpp ('k') | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(Document&, HTMLFormElement*, boo l createdByParser); 35 static PassRefPtr<HTMLObjectElement> create(Document&, HTMLFormElement*, boo l createdByParser);
36 virtual ~HTMLObjectElement(); 36 virtual ~HTMLObjectElement();
37 37
38 bool isDocNamedItem() const { return m_docNamedItem; }
39
38 const String& classId() const { return m_classId; } 40 const String& classId() const { return m_classId; }
39 41
40 bool containsJavaApplet() const; 42 bool containsJavaApplet() const;
41 43
42 virtual bool useFallbackContent() const { return m_useFallbackContent; } 44 virtual bool useFallbackContent() const { return m_useFallbackContent; }
43 virtual void renderFallbackContent() OVERRIDE; 45 virtual void renderFallbackContent() OVERRIDE;
44 46
45 // Implementations of FormAssociatedElement 47 // Implementations of FormAssociatedElement
46 HTMLFormElement* form() const { return FormAssociatedElement::form(); } 48 HTMLFormElement* form() const { return FormAssociatedElement::form(); }
47 49
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 82 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0);
81 83
82 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; 84 virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
83 virtual const AtomicString imageSourceURL() const OVERRIDE; 85 virtual const AtomicString imageSourceURL() const OVERRIDE;
84 86
85 virtual RenderWidget* existingRenderWidget() const OVERRIDE; 87 virtual RenderWidget* existingRenderWidget() const OVERRIDE;
86 88
87 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 89 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
88 90
89 virtual void updateWidget(PluginCreationOption); 91 virtual void updateWidget(PluginCreationOption);
92 void updateDocNamedItem();
90 93
91 void reattachFallbackContent(); 94 void reattachFallbackContent();
92 95
93 bool hasFallbackContent() const; 96 bool hasFallbackContent() const;
94 97
95 // FIXME: This function should not deal with url or serviceType 98 // FIXME: This function should not deal with url or serviceType
96 // so that we can better share code between <object> and <embed>. 99 // so that we can better share code between <object> and <embed>.
97 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa lues, String& url, String& serviceType); 100 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa lues, String& url, String& serviceType);
98 101
99 bool shouldAllowQuickTimeClassIdQuirk(); 102 bool shouldAllowQuickTimeClassIdQuirk();
100 bool hasValidClassId(); 103 bool hasValidClassId();
101 104
102 virtual void refFormAssociatedElement() { ref(); } 105 virtual void refFormAssociatedElement() { ref(); }
103 virtual void derefFormAssociatedElement() { deref(); } 106 virtual void derefFormAssociatedElement() { deref(); }
104 virtual HTMLFormElement* virtualForm() const; 107 virtual HTMLFormElement* virtualForm() const;
105 108
106 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; } 109 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return isDocNamedI tem(); }
107 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; } 110 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return isDocN amedItem(); }
108 111
109 String m_classId; 112 String m_classId;
113 bool m_docNamedItem : 1;
110 bool m_useFallbackContent : 1; 114 bool m_useFallbackContent : 1;
111 }; 115 };
112 116
113 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag)); 117 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag));
114 118
115 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element) 119 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element)
116 { 120 {
117 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( )); 121 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( ));
118 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element); 122 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element);
119 // We need to assert after the cast because FormAssociatedElement doesn't 123 // We need to assert after the cast because FormAssociatedElement doesn't
120 // have hasTagName. 124 // have hasTagName.
121 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag)); 125 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag));
122 return objectElement; 126 return objectElement;
123 } 127 }
124 128
125 inline const HTMLObjectElement& toHTMLObjectElement(const FormAssociatedElement& element) 129 inline const HTMLObjectElement& toHTMLObjectElement(const FormAssociatedElement& element)
126 { 130 {
127 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement()); 131 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement());
128 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element); 132 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element);
129 // We need to assert after the cast because FormAssociatedElement doesn't 133 // We need to assert after the cast because FormAssociatedElement doesn't
130 // have hasTagName. 134 // have hasTagName.
131 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT ag)); 135 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT ag));
132 return objectElement; 136 return objectElement;
133 } 137 }
134 138
135 } 139 }
136 140
137 #endif 141 #endif
OLDNEW
« no previous file with comments | « Source/core/html/HTMLNameCollection.cpp ('k') | Source/core/html/HTMLObjectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698