| 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 * |
| 11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
| 15 * | 15 * |
| 16 * You should have received a copy of the GNU Library General Public License | 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 | 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, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
| 20 * | 20 * |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #ifndef HTMLObjectElement_h | 23 #ifndef HTMLObjectElement_h |
| 24 #define HTMLObjectElement_h | 24 #define HTMLObjectElement_h |
| 25 | 25 |
| 26 #include "core/CoreExport.h" | 26 #include "core/CoreExport.h" |
| 27 #include "core/html/FormAssociated.h" |
| 27 #include "core/html/HTMLPlugInElement.h" | 28 #include "core/html/HTMLPlugInElement.h" |
| 28 #include "core/html/ListedElement.h" | 29 #include "core/html/ListedElement.h" |
| 29 | 30 |
| 30 namespace blink { | 31 namespace blink { |
| 31 | 32 |
| 32 class HTMLFormElement; | 33 class HTMLFormElement; |
| 33 | 34 |
| 34 // Inheritance of ListedElement was used for NPAPI form association, but | 35 // Inheritance of ListedElement was used for NPAPI form association, but |
| 35 // is still kept here so that legacy APIs such as form attribute can keep | 36 // is still kept here so that legacy APIs such as form attribute can keep |
| 36 // working according to the spec. See: | 37 // working according to the spec. See: |
| 37 // https://html.spec.whatwg.org/multipage/embedded-content.html#the-object-eleme
nt | 38 // https://html.spec.whatwg.org/multipage/embedded-content.html#the-object-eleme
nt |
| 38 class CORE_EXPORT HTMLObjectElement final : public HTMLPlugInElement, | 39 class CORE_EXPORT HTMLObjectElement final : public HTMLPlugInElement, |
| 39 public ListedElement { | 40 public ListedElement, |
| 41 public FormAssociated { |
| 40 DEFINE_WRAPPERTYPEINFO(); | 42 DEFINE_WRAPPERTYPEINFO(); |
| 41 USING_GARBAGE_COLLECTED_MIXIN(HTMLObjectElement); | 43 USING_GARBAGE_COLLECTED_MIXIN(HTMLObjectElement); |
| 42 | 44 |
| 43 public: | 45 public: |
| 44 static HTMLObjectElement* create(Document&, | 46 static HTMLObjectElement* create(Document&, |
| 45 HTMLFormElement*, | 47 HTMLFormElement*, |
| 46 bool createdByParser); | 48 bool createdByParser); |
| 47 ~HTMLObjectElement() override; | 49 ~HTMLObjectElement() override; |
| 48 DECLARE_VIRTUAL_TRACE(); | 50 DECLARE_VIRTUAL_TRACE(); |
| 49 | 51 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 bool checkValidity() { return true; } | 71 bool checkValidity() { return true; } |
| 70 bool reportValidity() { return true; } | 72 bool reportValidity() { return true; } |
| 71 void setCustomValidity(const String&) override {} | 73 void setCustomValidity(const String&) override {} |
| 72 | 74 |
| 73 bool canContainRangeEndPoint() const override { return useFallbackContent(); } | 75 bool canContainRangeEndPoint() const override { return useFallbackContent(); } |
| 74 | 76 |
| 75 bool isExposed() const; | 77 bool isExposed() const; |
| 76 | 78 |
| 77 bool willUseFallbackContentAtLayout() const; | 79 bool willUseFallbackContentAtLayout() const; |
| 78 | 80 |
| 81 FormAssociated* toFormAssociatedOrNull() override { return this; }; |
| 82 void associateWith(HTMLFormElement*) override; |
| 83 |
| 79 private: | 84 private: |
| 80 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser); | 85 HTMLObjectElement(Document&, HTMLFormElement*, bool createdByParser); |
| 81 | 86 |
| 82 void parseAttribute(const QualifiedName&, | 87 void parseAttribute(const QualifiedName&, |
| 83 const AtomicString&, | 88 const AtomicString&, |
| 84 const AtomicString&) override; | 89 const AtomicString&) override; |
| 85 bool isPresentationAttribute(const QualifiedName&) const override; | 90 bool isPresentationAttribute(const QualifiedName&) const override; |
| 86 void collectStyleForPresentationAttribute(const QualifiedName&, | 91 void collectStyleForPresentationAttribute(const QualifiedName&, |
| 87 const AtomicString&, | 92 const AtomicString&, |
| 88 MutableStylePropertySet*) override; | 93 MutableStylePropertySet*) override; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 static_cast<const HTMLObjectElement&>(element); | 159 static_cast<const HTMLObjectElement&>(element); |
| 155 // We need to assert after the cast because ListedElement doesn't | 160 // We need to assert after the cast because ListedElement doesn't |
| 156 // have hasTagName. | 161 // have hasTagName. |
| 157 SECURITY_DCHECK(objectElement.hasTagName(HTMLNames::objectTag)); | 162 SECURITY_DCHECK(objectElement.hasTagName(HTMLNames::objectTag)); |
| 158 return objectElement; | 163 return objectElement; |
| 159 } | 164 } |
| 160 | 165 |
| 161 } // namespace blink | 166 } // namespace blink |
| 162 | 167 |
| 163 #endif // HTMLObjectElement_h | 168 #endif // HTMLObjectElement_h |
| OLD | NEW |