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 virtual bool useFallbackContent() const override { return m_useFallbackContent; }
43 void renderFallbackContent();
45 virtual bool willValidate() const override { 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 virtual void setCustomValidity(const String&) override { }
51 virtual String validationMessage() const override { return String(); }
53 using HTMLPlugInImageElement::ref;
54 using HTMLPlugInImageElement::deref;
56 using FormAssociatedElement::form;
59 HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
61 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
62 virtual bool isPresentationAttribute(const QualifiedName&) const override;
63 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override;
65 virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
66 virtual void removedFrom(ContainerNode&) override;
68 virtual void didMoveToNewDocument(Document* oldDocument) override;
70 virtual void childrenChanged(const ChildChange&) override;
72 virtual bool isURLAttribute(const Attribute&) const override;
73 virtual const AtomicString& imageSourceURL() const override;
75 virtual RenderWidget* renderWidgetLoadingPlugin() const override;
77 virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
79 virtual void updateWidget(PluginCreationOption) override;
80 void updateDocNamedItem();
82 // FIXME: This function should not deal with url or serviceType
83 // so that we can better share code between <object> and <embed>.
84 void parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType);
86 bool shouldAllowQuickTimeClassIdQuirk();
87 bool hasValidClassId();
88 void clearUseFallbackContent() { m_useFallbackContent = false; }
90 virtual void refFormAssociatedElement() override { ref(); }
91 virtual void derefFormAssociatedElement() override { deref(); }
92 virtual HTMLFormElement* virtualForm() const override;
94 virtual FormNamedItem* asFormNamedItem() override { return this; }
95 virtual HTMLObjectElement& asHTMLElement() override { return *this; }
96 virtual const HTMLObjectElement& asHTMLElement() const override { return *this; }
98 virtual bool isFormControlElement() const override { return false; }
100 virtual bool isEnumeratable() const override { return true; }
101 virtual bool appendFormData(FormDataList&, bool) override;
103 virtual bool canContainRangeEndPoint() const override;
105 bool m_docNamedItem : 1;
106 bool m_useFallbackContent : 1;