Index: Source/core/html/HTMLPictureElement.h |
diff --git a/Source/core/html/HTMLPictureElement.h b/Source/core/html/HTMLPictureElement.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6f9b4d7aa1be164ac71e65eee832627c14b09f76 |
--- /dev/null |
+++ b/Source/core/html/HTMLPictureElement.h |
@@ -0,0 +1,60 @@ |
+/* |
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
+ * (C) 1999 Antti Koivisto (koivisto@kde.org) |
+ * Copyright (C) 2004, 2008, 2010 Apple Inc. All rights reserved. |
+ * Copyright (C) 2010 Google Inc. All rights reserved. |
+ * |
+ * This library is free software; you can redistribute it and/or |
+ * modify it under the terms of the GNU Library General Public |
+ * License as published by the Free Software Foundation; either |
+ * version 2 of the License, or (at your option) any later version. |
+ * |
+ * This library is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+ * Library General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU Library General Public License |
+ * along with this library; see the file COPYING.LIB. If not, write to |
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
+ * Boston, MA 02110-1301, USA. |
+ * |
+ */ |
+ |
+#ifndef HTMLPictureElement_h |
+#define HTMLPictureElement_h |
+ |
+#include "HTMLImageElement.h" |
+#include "HTMLSourceElement.h" |
+ |
+namespace WebCore { |
+ |
+class HTMLPictureElement : public HTMLImageElement { |
+ HTMLPictureElement(const QualifiedName& tagName, Document* document) |
+ : HTMLImageElement(tagName, document, 0), |
+ m_hasSrc(false) |
+ { |
+ ASSERT(hasTagName(pictureTag)); |
+ } |
+ |
+ ~HTMLPictureElement(); |
+ const AtomicString& imageSourceURL() const { return getMatchingSource()->getAttribute(HTMLNames::srcAttr); } |
+ const Element* getMatchingSource() const; |
+ |
+ virtual bool isPictureElement() const { return true; } |
+ virtual void parseAttribute(const QualifiedName&, const AtomicString&); |
+ |
+ bool m_hasSrc; |
+ |
+public: |
+ static PassRefPtr<HTMLPictureElement> create(Document*); |
+ |
+ static PassRefPtr<HTMLPictureElement> create(const QualifiedName& tagName, Document*); |
+ static PassRefPtr<HTMLPictureElement> createForJSConstructor(Document*, const int* optionalWidth, const int* optionalHeight); |
+ void sourceWasAdded(); |
+ |
+}; |
+ |
+} // namespace |
+ |
+#endif |