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

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

Issue 75273004: Add 'exposed' objects and embeds to a document's named properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove extraneous empty line in expected output Created 7 years 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
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 OVERRIDE; 42 virtual bool useFallbackContent() const OVERRIDE;
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
50 virtual bool isFormControlElement() const { return false; } 48 virtual bool isFormControlElement() const { return false; }
51 49
52 virtual bool isEnumeratable() const { return true; } 50 virtual bool isEnumeratable() const { return true; }
53 virtual bool isInteractiveContent() const OVERRIDE; 51 virtual bool isInteractiveContent() const OVERRIDE;
54 virtual bool appendFormData(FormDataList&, bool); 52 virtual bool appendFormData(FormDataList&, bool);
55 53
56 virtual bool isObjectElement() const OVERRIDE { return true; } 54 virtual bool isObjectElement() const OVERRIDE { return true; }
57 55
58 // Implementations of constraint validation API. 56 // Implementations of constraint validation API.
59 // Note that the object elements are always barred from constraint validatio n. 57 // Note that the object elements are always barred from constraint validatio n.
60 virtual String validationMessage() const OVERRIDE { return String(); } 58 virtual String validationMessage() const OVERRIDE { return String(); }
61 bool checkValidity() { return true; } 59 bool checkValidity() { return true; }
62 virtual void setCustomValidity(const String&) OVERRIDE { } 60 virtual void setCustomValidity(const String&) OVERRIDE { }
63 61
64 using Node::ref; 62 using Node::ref;
65 using Node::deref; 63 using Node::deref;
66 64
67 virtual bool canContainRangeEndPoint() const { return useFallbackContent(); } 65 virtual bool canContainRangeEndPoint() const { return useFallbackContent(); }
68 66
67 bool isExposed() const;
68
69 private: 69 private:
70 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser); 70 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser);
71 71
72 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 72 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
73 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; 73 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
74 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) OVERRIDE; 74 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons t AtomicString&, MutableStylePropertySet*) OVERRIDE;
75 75
76 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE; 76 virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
77 virtual void removedFrom(ContainerNode*) OVERRIDE; 77 virtual void removedFrom(ContainerNode*) OVERRIDE;
78 78
(...skipping 20 matching lines...) Expand all
99 // so that we can better share code between <object> and <embed>. 99 // 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); 100 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa lues, String& url, String& serviceType);
101 101
102 bool shouldAllowQuickTimeClassIdQuirk(); 102 bool shouldAllowQuickTimeClassIdQuirk();
103 bool hasValidClassId(); 103 bool hasValidClassId();
104 104
105 virtual void refFormAssociatedElement() { ref(); } 105 virtual void refFormAssociatedElement() { ref(); }
106 virtual void derefFormAssociatedElement() { deref(); } 106 virtual void derefFormAssociatedElement() { deref(); }
107 virtual HTMLFormElement* virtualForm() const; 107 virtual HTMLFormElement* virtualForm() const;
108 108
109 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return isDocNamedI tem(); } 109 virtual bool shouldRegisterAsNamedItem() const OVERRIDE { return true; }
110 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return isDocN amedItem(); } 110 virtual bool shouldRegisterAsExtraNamedItem() const OVERRIDE { return true; }
111 111
112 String m_classId; 112 String m_classId;
113 bool m_docNamedItem : 1;
114 bool m_useFallbackContent : 1; 113 bool m_useFallbackContent : 1;
115 }; 114 };
116 115
117 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag)); 116 DEFINE_NODE_TYPE_CASTS(HTMLObjectElement, hasTagName(HTMLNames::objectTag));
118 117
119 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element) 118 inline const HTMLObjectElement* toHTMLObjectElement(const FormAssociatedElement* element)
120 { 119 {
121 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( )); 120 ASSERT_WITH_SECURITY_IMPLICATION(!element || !element->isFormControlElement( ));
122 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element); 121 const HTMLObjectElement* objectElement = static_cast<const HTMLObjectElement *>(element);
123 // We need to assert after the cast because FormAssociatedElement doesn't 122 // We need to assert after the cast because FormAssociatedElement doesn't
124 // have hasTagName. 123 // have hasTagName.
125 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag)); 124 ASSERT_WITH_SECURITY_IMPLICATION(!objectElement || objectElement->hasTagName (HTMLNames::objectTag));
126 return objectElement; 125 return objectElement;
127 } 126 }
128 127
129 inline const HTMLObjectElement& toHTMLObjectElement(const FormAssociatedElement& element) 128 inline const HTMLObjectElement& toHTMLObjectElement(const FormAssociatedElement& element)
130 { 129 {
131 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement()); 130 ASSERT_WITH_SECURITY_IMPLICATION(!element.isFormControlElement());
132 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element); 131 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement &>(element);
133 // We need to assert after the cast because FormAssociatedElement doesn't 132 // We need to assert after the cast because FormAssociatedElement doesn't
134 // have hasTagName. 133 // have hasTagName.
135 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT ag)); 134 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT ag));
136 return objectElement; 135 return objectElement;
137 } 136 }
138 137
139 } 138 }
140 139
141 #endif 140 #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