Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(981)

Unified Diff: Source/core/html/HTMLPictureElement.h

Issue 14449003: Picture element initial implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@picture_after_rebase
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/HTMLPictureElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/html/HTMLImageElement.cpp ('k') | Source/core/html/HTMLPictureElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698