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

Unified Diff: Source/core/dom/EmptyNodeList.h

Issue 132923003: Make sure the rootNode of a LiveNodeListBase is always a ContainerNode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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/dom/ContainerNode.cpp ('k') | Source/core/dom/EmptyNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/EmptyNodeList.h
diff --git a/Source/core/svg/SVGDiscardElement.h b/Source/core/dom/EmptyNodeList.h
old mode 100755
new mode 100644
similarity index 64%
copy from Source/core/svg/SVGDiscardElement.h
copy to Source/core/dom/EmptyNodeList.h
index 653a1db94ebf2acb389f89122027bfc7fdc4f0d3..a505aaa08b04f48bee3903622ddfb89667554516
--- a/Source/core/svg/SVGDiscardElement.h
+++ b/Source/core/dom/EmptyNodeList.h
@@ -1,4 +1,5 @@
/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2014 Samsung Electronics. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -28,32 +29,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SVGDiscardElement_h
-#define SVGDiscardElement_h
+#ifndef EmptyNodeList_h
+#define EmptyNodeList_h
-#include "core/svg/animation/SVGSMILElement.h"
+#include "core/dom/NodeList.h"
namespace WebCore {
-class SVGDiscardElement FINAL : public SVGSMILElement {
+class EmptyNodeList FINAL : public NodeList {
public:
- static PassRefPtr<SVGDiscardElement> create(Document&);
+ static PassRefPtr<EmptyNodeList> create(Node* rootNode)
+ {
+ return adoptRef(new EmptyNodeList(rootNode));
+ }
+ virtual ~EmptyNodeList();
+
+ Node* ownerNode() const { return m_owner.get(); }
- virtual bool isSVGDiscardElement() const OVERRIDE { return true; }
private:
- explicit SVGDiscardElement(Document&);
+ explicit EmptyNodeList(Node* rootNode) : m_owner(rootNode) { }
+
+ virtual unsigned length() const OVERRIDE { return 0; }
+ virtual Node* item(unsigned) const OVERRIDE { return 0; }
+ virtual Node* namedItem(const AtomicString&) const OVERRIDE { return 0; }
- virtual void resetAnimatedType() OVERRIDE { }
- virtual void clearAnimatedType(SVGElement* targetElement) OVERRIDE { }
- virtual void applyResultsToTarget() OVERRIDE { }
- virtual bool hasValidAttributeType() OVERRIDE;
- virtual bool hasValidAttributeName() OVERRIDE;
- virtual void animationAttributeChanged() OVERRIDE { }
+ virtual bool isEmptyNodeList() const OVERRIDE { return true; }
- virtual void startedActiveInterval() OVERRIDE { }
- virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) OVERRIDE { }
+ RefPtr<Node> m_owner;
};
+DEFINE_TYPE_CASTS(EmptyNodeList, NodeList, nodeList, nodeList->isEmptyNodeList(), nodeList.isEmptyNodeList());
+
} // namespace WebCore
-#endif // SVGDiscardElement_h
+#endif // EmptyNodeList_h
« no previous file with comments | « Source/core/dom/ContainerNode.cpp ('k') | Source/core/dom/EmptyNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698