2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef HTMLObjectElement_h
24 #define HTMLObjectElement_h
26 #include "FormAssociatedElement.h"
27 #include "HTMLPlugInImageElement.h"
31 class HTMLFormElement;
33 class HTMLObjectElement final : public HTMLPlugInImageElement, public FormAssociatedElement {
35 static Ref<HTMLObjectElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
36 virtual ~HTMLObjectElement();
38 bool isDocNamedItem() const { return m_docNamedItem; }
39 bool containsJavaApplet() const;
41 bool hasFallbackContent() const;
42 bool useFallbackContent() const final { return m_useFallbackContent; }
43 void renderFallbackContent();
45 bool willValidate() const final { return false; }
47 // Implementation of constraint validation API.
48 // Note that the object elements are always barred from constraint validation.
49 static bool checkValidity() { return true; }
50 void setCustomValidity(const String&) final { }
51 String validationMessage() const final { return String(); }
53 using HTMLPlugInImageElement::ref;
54 using HTMLPlugInImageElement::deref;
56 using FormAssociatedElement::form;
59 HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
61 void parseAttribute(const QualifiedName&, const AtomicString&) final;
62 bool isPresentationAttribute(const QualifiedName&) const final;
63 void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
65 InsertionNotificationRequest insertedInto(ContainerNode&) final;
66 void finishedInsertingSubtree() final;
67 void removedFrom(ContainerNode&) final;
69 void didMoveToNewDocument(Document* oldDocument) final;
71 void childrenChanged(const ChildChange&) final;
73 bool isURLAttribute(const Attribute&) const final;
74 const AtomicString& imageSourceURL() const final;
76 RenderWidget* renderWidgetLoadingPlugin() const final;
78 void addSubresourceAttributeURLs(ListHashSet<URL>&) const final;
80 void updateWidget(PluginCreationOption) final;
81 void updateDocNamedItem();
83 // FIXME: This function should not deal with url or serviceType
84 // so that we can better share code between <object> and <embed>.
85 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
87 bool shouldAllowQuickTimeClassIdQuirk();
88 bool hasValidClassId();
89 void clearUseFallbackContent() { m_useFallbackContent = false; }
91 void refFormAssociatedElement() final { ref(); }
92 void derefFormAssociatedElement() final { deref(); }
93 HTMLFormElement* virtualForm() const final;
95 FormNamedItem* asFormNamedItem() final { return this; }
96 HTMLObjectElement& asHTMLElement() final { return *this; }
97 const HTMLObjectElement& asHTMLElement() const final { return *this; }
99 bool isFormControlElement() const final { return false; }
101 bool isEnumeratable() const final { return true; }
102 bool appendFormData(FormDataList&, bool) final;
104 bool canContainRangeEndPoint() const final;
106 bool m_docNamedItem : 1;
107 bool m_useFallbackContent : 1;