| 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 * 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace blink { | 30 namespace blink { |
| 31 | 31 |
| 32 class HTMLFormElement; | 32 class HTMLFormElement; |
| 33 | 33 |
| 34 class CORE_EXPORT HTMLObjectElement final : public HTMLPlugInElement, public For
mAssociatedElement { | 34 class CORE_EXPORT HTMLObjectElement final : public HTMLPlugInElement, public For
mAssociatedElement { |
| 35 DEFINE_WRAPPERTYPEINFO(); | 35 DEFINE_WRAPPERTYPEINFO(); |
| 36 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLObjectElement); | 36 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLObjectElement); |
| 37 public: | 37 public: |
| 38 static PassRefPtrWillBeRawPtr<HTMLObjectElement> create(Document&, HTMLFormE
lement*, bool createdByParser); | 38 static PassRefPtrWillBeRawPtr<HTMLObjectElement> create(Document&, HTMLFormE
lement*, bool createdByParser); |
| 39 virtual ~HTMLObjectElement(); | 39 ~HTMLObjectElement() override; |
| 40 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
| 41 | 41 |
| 42 const String& classId() const { return m_classId; } | 42 const String& classId() const { return m_classId; } |
| 43 | 43 |
| 44 virtual HTMLFormElement* formOwner() const override; | 44 HTMLFormElement* formOwner() const override; |
| 45 | 45 |
| 46 bool containsJavaApplet() const; | 46 bool containsJavaApplet() const; |
| 47 | 47 |
| 48 virtual bool hasFallbackContent() const override; | 48 bool hasFallbackContent() const override; |
| 49 virtual bool useFallbackContent() const override; | 49 bool useFallbackContent() const override; |
| 50 virtual void renderFallbackContent() override; | 50 void renderFallbackContent() override; |
| 51 | 51 |
| 52 virtual bool isFormControlElement() const override { return false; } | 52 bool isFormControlElement() const override { return false; } |
| 53 | 53 |
| 54 virtual bool isEnumeratable() const override { return true; } | 54 bool isEnumeratable() const override { return true; } |
| 55 virtual bool isInteractiveContent() const override; | 55 bool isInteractiveContent() const override; |
| 56 virtual bool appendFormData(FormDataList&, bool) override; | 56 bool appendFormData(FormDataList&, bool) override; |
| 57 | 57 |
| 58 // Implementations of constraint validation API. | 58 // Implementations of constraint validation API. |
| 59 // Note that the object elements are always barred from constraint validatio
n. | 59 // Note that the object elements are always barred from constraint validatio
n. |
| 60 virtual String validationMessage() const override { return String(); } | 60 String validationMessage() const override { return String(); } |
| 61 bool checkValidity() { return true; } | 61 bool checkValidity() { return true; } |
| 62 bool reportValidity() { return true; } | 62 bool reportValidity() { return true; } |
| 63 virtual void setCustomValidity(const String&) override { } | 63 void setCustomValidity(const String&) override { } |
| 64 | 64 |
| 65 #if !ENABLE(OILPAN) | 65 #if !ENABLE(OILPAN) |
| 66 using Node::ref; | 66 using Node::ref; |
| 67 using Node::deref; | 67 using Node::deref; |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 virtual bool canContainRangeEndPoint() const override { return useFallbackCo
ntent(); } | 70 bool canContainRangeEndPoint() const override { return useFallbackContent();
} |
| 71 | 71 |
| 72 bool isExposed() const; | 72 bool isExposed() const; |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser); | 75 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser); |
| 76 | 76 |
| 77 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 77 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
| 78 virtual bool isPresentationAttribute(const QualifiedName&) const override; | 78 bool isPresentationAttribute(const QualifiedName&) const override; |
| 79 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) override; | 79 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; |
| 80 | 80 |
| 81 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 81 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 82 virtual void removedFrom(ContainerNode*) override; | 82 void removedFrom(ContainerNode*) override; |
| 83 | 83 |
| 84 virtual void didMoveToNewDocument(Document& oldDocument) override; | 84 void didMoveToNewDocument(Document& oldDocument) override; |
| 85 | 85 |
| 86 virtual void childrenChanged(const ChildrenChange&) override; | 86 void childrenChanged(const ChildrenChange&) override; |
| 87 | 87 |
| 88 virtual bool isURLAttribute(const Attribute&) const override; | 88 bool isURLAttribute(const Attribute&) const override; |
| 89 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override; | 89 bool hasLegalLinkAttribute(const QualifiedName&) const override; |
| 90 virtual const QualifiedName& subResourceAttributeName() const override; | 90 const QualifiedName& subResourceAttributeName() const override; |
| 91 virtual const AtomicString imageSourceURL() const override; | 91 const AtomicString imageSourceURL() const override; |
| 92 | 92 |
| 93 virtual LayoutPart* existingLayoutPart() const override; | 93 LayoutPart* existingLayoutPart() const override; |
| 94 | 94 |
| 95 virtual void updateWidgetInternal() override; | 95 void updateWidgetInternal() override; |
| 96 void updateDocNamedItem(); | 96 void updateDocNamedItem(); |
| 97 | 97 |
| 98 void reattachFallbackContent(); | 98 void reattachFallbackContent(); |
| 99 | 99 |
| 100 // FIXME: This function should not deal with url or serviceType | 100 // FIXME: This function should not deal with url or serviceType |
| 101 // so that we can better share code between <object> and <embed>. | 101 // so that we can better share code between <object> and <embed>. |
| 102 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa
lues, String& url, String& serviceType); | 102 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramVa
lues, String& url, String& serviceType); |
| 103 | 103 |
| 104 bool hasValidClassId(); | 104 bool hasValidClassId(); |
| 105 | 105 |
| 106 void reloadPluginOnAttributeChange(const QualifiedName&); | 106 void reloadPluginOnAttributeChange(const QualifiedName&); |
| 107 | 107 |
| 108 #if !ENABLE(OILPAN) | 108 #if !ENABLE(OILPAN) |
| 109 virtual void refFormAssociatedElement() override { ref(); } | 109 void refFormAssociatedElement() override { ref(); } |
| 110 virtual void derefFormAssociatedElement() override { deref(); } | 110 void derefFormAssociatedElement() override { deref(); } |
| 111 #endif | 111 #endif |
| 112 | 112 |
| 113 virtual bool shouldRegisterAsNamedItem() const override { return true; } | 113 bool shouldRegisterAsNamedItem() const override { return true; } |
| 114 virtual bool shouldRegisterAsExtraNamedItem() const override { return true;
} | 114 bool shouldRegisterAsExtraNamedItem() const override { return true; } |
| 115 | 115 |
| 116 String m_classId; | 116 String m_classId; |
| 117 bool m_useFallbackContent : 1; | 117 bool m_useFallbackContent : 1; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Intentionally left unimplemented, template specialization needs to be provide
d for specific | 120 // Intentionally left unimplemented, template specialization needs to be provide
d for specific |
| 121 // return types. | 121 // return types. |
| 122 template<typename T> inline const T& toElement(const FormAssociatedElement&); | 122 template<typename T> inline const T& toElement(const FormAssociatedElement&); |
| 123 template<typename T> inline const T* toElement(const FormAssociatedElement*); | 123 template<typename T> inline const T* toElement(const FormAssociatedElement*); |
| 124 | 124 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 141 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement
&>(element); | 141 const HTMLObjectElement& objectElement = static_cast<const HTMLObjectElement
&>(element); |
| 142 // We need to assert after the cast because FormAssociatedElement doesn't | 142 // We need to assert after the cast because FormAssociatedElement doesn't |
| 143 // have hasTagName. | 143 // have hasTagName. |
| 144 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT
ag)); | 144 ASSERT_WITH_SECURITY_IMPLICATION(objectElement.hasTagName(HTMLNames::objectT
ag)); |
| 145 return objectElement; | 145 return objectElement; |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace blink | 148 } // namespace blink |
| 149 | 149 |
| 150 #endif // HTMLObjectElement_h | 150 #endif // HTMLObjectElement_h |
| OLD | NEW |